Skip to contentSkip to conversation

board/broadcom: add support for bcm47xx platform devices

PATCH Superseded Rafał Miłecki 2 participants 3 messages Oct 21, 2021 – Jan 13, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board/broadcom: add support for bcm47xx platform devices

From: Rafał Miłecki <[email protected]>

Broadcom's bcm47xx is a family of MIPS SoCs going back to the 2002 and including e.g. Linksys WRT54G with its BCM4702. It evolved through years and its latest model BCM4706 is still in use nowadays.

Pretty much all SoCs contain all following components:
1. CPU
2. PCIe controller(s)
3. Ethernet interface(s)
4. USB controllers
5. Serial flash controller
6. GPIO controller (for LEDs and buttons)
7. Watchdog

Upstream kernel includes a pretty much complete support for bcm47xx but it isn't DTS based. Board detection is handled on runtime so there is one kernel image to serve all.

Bootloader used in those devices is CFE. It allows booting kernel over tftp and flashing firmwares using TRX format. It isn't properly open sourced (except some early versions) and in practice it's irreplaceable.

This commit adds support for building a bootable kernel based on 5.4
stable release:
Starting program at 0x80001000
Linux version 5.4.155 ([email protected]) (gcc version 10.3.0 (Buildroot 2021.08-930-gc0c925605d)) #5 Thu Oct 21 10:16:20 CEST 2021

Linux 5.10 doesn't start booting due to some regression that remains to be debugged. Adding support for building full images (including rootfs) is also planned for the future.

---
 board/broadcom/bcm47xx/linux.config | 28 ++++++++++++++++++++++++++++
 configs/broadcom_bcm47xx_defconfig  |  8 ++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 board/broadcom/bcm47xx/linux.config
 create mode 100644 configs/broadcom_bcm47xx_defconfig
board/broadcom/bcm47xx/linux.config new file +28 -0
new file mode 100644
index 0000000000..30976759d9
@@ -0,0 +1,28 @@
+CONFIG_EMBEDDED=y
+CONFIG_BCM47XX=y
+CONFIG_CPU_MIPS32_R2=y
+# CONFIG_MIPS_FP_SUPPORT is not set
+CONFIG_HIGHMEM=y
+# CONFIG_SUSPEND is not set
+CONFIG_PCI=y
+CONFIG_MTD=y
+CONFIG_MTD_BCM47XX_PARTS=y
+CONFIG_MTD_PARSER_TRX=y
+CONFIG_MTD_BCM47XXSFLASH=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_WATCHDOG=y
+CONFIG_BCM47XX_WDT=y
+CONFIG_BCMA_DRIVER_GMAC_CMN=y
+CONFIG_USB=y
+CONFIG_USB_HCD_BCMA=y
+CONFIG_USB_HCD_SSB=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttyS0,115200"
configs/broadcom_bcm47xx_defconfig new file +8 -0
new file mode 100644
index 0000000000..7b4aa16429
@@ -0,0 +1,8 @@
+BR2_mipsel=y
+BR2_KERNEL_HEADERS_5_4=y
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.4.155"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/broadcom/bcm47xx/linux.config"
+BR2_LINUX_KERNEL_VMLINUX=y
Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello Rafał,

Quoted 32 lines · On Thu, 21 Oct 2021 10:55:40 +0200 Rafał Miłecki <[email protected]> wrote:

From: Rafał Miłecki <[email protected]>

Broadcom's bcm47xx is a family of MIPS SoCs going back to the 2002 and including e.g. Linksys WRT54G with its BCM4702. It evolved through years and its latest model BCM4706 is still in use nowadays.

Pretty much all SoCs contain all following components:
1. CPU
2. PCIe controller(s)
3. Ethernet interface(s)
4. USB controllers
5. Serial flash controller
6. GPIO controller (for LEDs and buttons)
7. Watchdog

Upstream kernel includes a pretty much complete support for bcm47xx but it isn't DTS based. Board detection is handled on runtime so there is one kernel image to serve all.

Bootloader used in those devices is CFE. It allows booting kernel over tftp and flashing firmwares using TRX format. It isn't properly open sourced (except some early versions) and in practice it's irreplaceable.

This commit adds support for building a bootable kernel based on 5.4
stable release:
Starting program at 0x80001000
Linux version 5.4.155 ([email protected]) (gcc version 10.3.0 (Buildroot 2021.08-930-gc0c925605d)) #5 Thu Oct 21 10:16:20 CEST 2021

Linux 5.10 doesn't start booting due to some regression that remains to be debugged. Adding support for building full images (including rootfs) is also planned for the future.

Quoted 7 lines
---
 board/broadcom/bcm47xx/linux.config | 28 ++++++++++++++++++++++++++++
 configs/broadcom_bcm47xx_defconfig  |  8 ++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 board/broadcom/bcm47xx/linux.config
 create mode 100644 configs/broadcom_bcm47xx_defconfig

Thanks for this contribution, but it doesn't seem to be really useful as it is: the root filesystem generated as a tarball is not even used, and there is no readme.txt. We prefer to have directly useful defconfig files.

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 4 lines · Thomas Petazzoni

Thanks for this contribution, but it doesn't seem to be really useful as it is: the root filesystem generated as a tarball is not even used, and there is no readme.txt. We prefer to have directly useful defconfig files.

Thank you for your feedback, I'm still "learning" buildroot.

I aim to upstream 3 Broadcom platforms support and I already learnt about kernel + rootfs + readme.txt in another patch review. I didn't send V2 for bcm47xx yet, I plan to get back to working on it once I (hopefully) get:
[PATCH V2] board/broadcom: add support for BCM4908 platform devices

accepted (V2 or another one). I want to learn on 1 platform and then get other ones. So I'll work on bcm47xx V2 a bit later.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot