[Buildroot] [PATCH] board/broadcom: add support for bcm47xx platform devices

Rafał Miłecki zajec5 at gmail.com
Thu Oct 21 08:55:40 UTC 2021


From: Rafał Miłecki <rafal at milecki.pl>

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 (rmilecki at localhost.localdomain) (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.

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 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

diff --git a/board/broadcom/bcm47xx/linux.config b/board/broadcom/bcm47xx/linux.config
new file mode 100644
index 0000000000..30976759d9
--- /dev/null
+++ b/board/broadcom/bcm47xx/linux.config
@@ -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"
diff --git a/configs/broadcom_bcm47xx_defconfig b/configs/broadcom_bcm47xx_defconfig
new file mode 100644
index 0000000000..7b4aa16429
--- /dev/null
+++ b/configs/broadcom_bcm47xx_defconfig
@@ -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
-- 
2.31.1



More information about the buildroot mailing list