Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: buildroot@buildroot.org
Cc: "Rafał Miłecki" <rafal@milecki.pl>
Subject: [Buildroot] [PATCH] board/broadcom: add support for bcm47xx platform devices
Date: Thu, 21 Oct 2021 10:55:40 +0200	[thread overview]
Message-ID: <20211021085540.18764-1-zajec5@gmail.com> (raw)

From: Rafał Miłecki <rafal@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@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@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

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

             reply	other threads:[~2021-10-21  8:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21  8:55 Rafał Miłecki [this message]
2022-01-13 21:42 ` [Buildroot] [PATCH] board/broadcom: add support for bcm47xx platform devices Thomas Petazzoni
2022-01-13 21:56   ` Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211021085540.18764-1-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=rafal@milecki.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox