[openwrt/openwrt] bmips: add subtargets for each SoC
LEDE Commits
lede-commits at lists.infradead.org
Mon Apr 10 02:57:08 PDT 2023
noltari pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6fd8e0f943a0e8216daf238e015b6a311512d4ae
commit 6fd8e0f943a0e8216daf238e015b6a311512d4ae
Author: Álvaro Fernández Rojas <noltari at gmail.com>
AuthorDate: Sun Apr 9 21:01:11 2023 +0200
bmips: add subtargets for each SoC
BMIPS is a generic arch that can be used for multiple Broadcom SoCs, each one
with its own specific drivers, so instead of having a huge kernel supporting
all of them, let's switch to a subtarget per SoC like other OpenWrt targets.
Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
target/linux/bmips/Makefile | 2 +-
.../lib/upgrade/cfe-jffs2-nand.sh} | 20 ---
.../base-files/etc/board.d/01_leds} | 6 +-
.../base-files/etc/board.d/02_network | 7 +-
.../base-files/etc/uci-defaults/09_fix_crc | 8 +-
.../base-files/lib/upgrade/platform.sh | 6 +-
target/linux/bmips/{ => bcm6318}/config-5.15 | 33 ++--
target/linux/bmips/bcm6318/target.mk | 8 +
.../bmips/bcm63268/base-files/etc/board.d/01_leds | 27 ++++
.../base-files/etc/board.d/02_network | 10 +-
.../base-files/etc/board.d/03_gpio_switches | 0
.../bcm63268/base-files/lib/upgrade/platform.sh | 26 ++++
target/linux/bmips/{ => bcm63268}/config-5.15 | 39 ++---
target/linux/bmips/bcm63268/target.mk | 9 ++
.../base-files/etc/board.d/02_network | 7 +-
.../base-files/etc/uci-defaults/09_fix_crc | 8 +-
.../base-files/lib/upgrade/platform.sh | 8 +-
target/linux/bmips/{ => bcm6328}/config-5.15 | 43 +++---
target/linux/bmips/bcm6328/target.mk | 9 ++
.../base-files/etc/board.d/01_leds} | 6 +-
.../base-files/etc/board.d/02_network | 6 -
.../base-files/lib/upgrade/platform.sh | 6 +-
target/linux/bmips/{ => bcm6358}/config-5.15 | 46 ++----
target/linux/bmips/bcm6358/target.mk | 9 ++
.../bmips/bcm6362/base-files/etc/board.d/01_leds | 20 +++
.../base-files/etc/board.d/02_network} | 7 +-
.../base-files/lib/upgrade/platform.sh | 12 +-
target/linux/bmips/{ => bcm6362}/config-5.15 | 41 ++---
target/linux/bmips/bcm6362/target.mk | 9 ++
.../base-files/etc/board.d/02_network | 5 -
.../base-files/etc/uci-defaults/09_fix_crc | 8 +-
.../base-files/lib/upgrade/platform.sh | 6 +-
target/linux/bmips/{ => bcm6368}/config-5.15 | 52 +++----
target/linux/bmips/bcm6368/target.mk | 9 ++
.../bmips/generic/base-files/etc/board.d/01_leds | 16 --
target/linux/bmips/generic/config-default | 3 -
target/linux/bmips/generic/target.mk | 5 -
target/linux/bmips/image/Makefile | 75 ++++++++-
target/linux/bmips/image/bcm6318.mk | 13 ++
target/linux/bmips/image/bcm63268.mk | 82 ++++++++++
target/linux/bmips/image/bcm6328.mk | 13 ++
target/linux/bmips/image/bcm6358.mk | 15 ++
target/linux/bmips/image/bcm6362.mk | 41 +++++
target/linux/bmips/image/bcm6368.mk | 14 ++
target/linux/bmips/image/bcm63xx_generic.mk | 78 ----------
target/linux/bmips/image/bcm63xx_nand.mk | 168 ---------------------
.../bmips/nand/base-files/etc/board.d/01_leds | 16 --
target/linux/bmips/nand/config-default | 27 ----
target/linux/bmips/nand/target.mk | 6 -
49 files changed, 547 insertions(+), 543 deletions(-)
diff --git a/target/linux/bmips/Makefile b/target/linux/bmips/Makefile
index fa648665d9..0de5377f4e 100644
--- a/target/linux/bmips/Makefile
+++ b/target/linux/bmips/Makefile
@@ -6,7 +6,7 @@ ARCH:=mips
CPU_TYPE:=mips32
BOARD:=bmips
BOARDNAME:=Broadcom BMIPS
-SUBTARGETS:=generic nand
+SUBTARGETS:=bcm6318 bcm6328 bcm6358 bcm6362 bcm6368 bcm63268
FEATURES:=gpio source-only squashfs usb
KERNEL_PATCHVER:=5.15
diff --git a/target/linux/bmips/nand/base-files/lib/upgrade/platform.sh b/target/linux/bmips/base-files/lib/upgrade/cfe-jffs2-nand.sh
similarity index 79%
rename from target/linux/bmips/nand/base-files/lib/upgrade/platform.sh
rename to target/linux/bmips/base-files/lib/upgrade/cfe-jffs2-nand.sh
index 33217ed975..64b8df652b 100644
--- a/target/linux/bmips/nand/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bmips/base-files/lib/upgrade/cfe-jffs2-nand.sh
@@ -1,12 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
-PART_NAME=firmware
-REQUIRE_IMAGE_METADATA=1
-
-platform_check_image() {
- return 0
-}
-
cfe_jffs2_nand_upgrade() {
local tar_file="$1"
local kernel_mtd="$(find_mtd_index $CI_KERNPART)"
@@ -42,16 +35,3 @@ cfe_jffs2_nand_upgrade() {
nand_do_upgrade_success
}
-
-platform_do_upgrade() {
- case "$(board_name)" in
- comtrend,vr-3032u|\
- huawei,hg253s-v2|\
- netgear,dgnd3700-v2)
- cfe_jffs2_nand_upgrade "$1"
- ;;
- *)
- nand_do_upgrade "$1"
- ;;
- esac
-}
diff --git a/target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches b/target/linux/bmips/bcm6318/base-files/etc/board.d/01_leds
similarity index 57%
copy from target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches
copy to target/linux/bmips/bcm6318/base-files/etc/board.d/01_leds
index 75ac111b0c..98355460a0 100644
--- a/target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches
+++ b/target/linux/bmips/bcm6318/base-files/etc/board.d/01_leds
@@ -1,13 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-or-later
+. /lib/functions/leds.sh
. /lib/functions/uci-defaults.sh
board_config_update
case "$(board_name)" in
-sercomm,h500-s-lowi |\
-sercomm,h500-s-vfes)
- ucidef_add_gpio_switch "qtn_power" "Quantenna Module Power" "480" "1"
+comtrend,ar-5315u)
+ ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1"
;;
esac
diff --git a/target/linux/bmips/generic/base-files/etc/board.d/02_network b/target/linux/bmips/bcm6318/base-files/etc/board.d/02_network
similarity index 67%
copy from target/linux/bmips/generic/base-files/etc/board.d/02_network
copy to target/linux/bmips/bcm6318/base-files/etc/board.d/02_network
index a5995849f0..92b2e8f4d4 100644
--- a/target/linux/bmips/generic/base-files/etc/board.d/02_network
+++ b/target/linux/bmips/bcm6318/base-files/etc/board.d/02_network
@@ -5,15 +5,10 @@
board_config_update
case "$(board_name)" in
-comtrend,ar-5315u |\
-comtrend,ar-5387un |\
-comtrend,vr-3025u)
+comtrend,ar-5315u)
ucidef_set_bridge_device switch
ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
;;
-huawei,hg556a-b)
- ucidef_set_interface_lan "eth0"
- ;;
esac
board_config_flush
diff --git a/target/linux/bmips/generic/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bmips/bcm6318/base-files/etc/uci-defaults/09_fix_crc
similarity index 53%
copy from target/linux/bmips/generic/base-files/etc/uci-defaults/09_fix_crc
copy to target/linux/bmips/bcm6318/base-files/etc/uci-defaults/09_fix_crc
index 60227e7c34..a52f0ecc40 100644
--- a/target/linux/bmips/generic/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/bmips/bcm6318/base-files/etc/uci-defaults/09_fix_crc
@@ -3,11 +3,9 @@
. /lib/functions.sh
case "$(board_name)" in
- comtrend,ar-5315u|\
- comtrend,ar-5387un|\
- comtrend,vr-3025u)
- mtd fixtrx firmware
- ;;
+comtrend,ar-5315u)
+ mtd fixtrx firmware
+ ;;
esac
exit 0
diff --git a/target/linux/bmips/generic/base-files/lib/upgrade/platform.sh b/target/linux/bmips/bcm6318/base-files/lib/upgrade/platform.sh
similarity index 82%
copy from target/linux/bmips/generic/base-files/lib/upgrade/platform.sh
copy to target/linux/bmips/bcm6318/base-files/lib/upgrade/platform.sh
index d731bb74d5..1cf95be26a 100644
--- a/target/linux/bmips/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bmips/bcm6318/base-files/lib/upgrade/platform.sh
@@ -9,8 +9,8 @@ platform_check_image() {
platform_do_upgrade() {
case "$(board_name)" in
- *)
- default_do_upgrade "$1"
- ;;
+ *)
+ default_do_upgrade "$1"
+ ;;
esac
}
diff --git a/target/linux/bmips/config-5.15 b/target/linux/bmips/bcm6318/config-5.15
similarity index 93%
copy from target/linux/bmips/config-5.15
copy to target/linux/bmips/bcm6318/config-5.15
index 3fc58d01dd..588d751744 100644
--- a/target/linux/bmips/config-5.15
+++ b/target/linux/bmips/bcm6318/config-5.15
@@ -10,7 +10,7 @@ CONFIG_B53_MMAP_DRIVER=y
CONFIG_B53_SPI_DRIVER=y
CONFIG_BCM6345_EXT_IRQ=y
CONFIG_BCM6345_L1_IRQ=y
-CONFIG_BCM6348_ENET=y
+# CONFIG_BCM6348_ENET is not set
CONFIG_BCM6368_ENETSW=y
CONFIG_BCM63XX_POWER=y
CONFIG_BCM7038_WDT=y
@@ -28,7 +28,7 @@ CONFIG_BLK_MQ_PCI=y
CONFIG_BLK_PM=y
CONFIG_BMIPS_GENERIC=y
CONFIG_CEVT_R4K=y
-CONFIG_CLK_BCM63268_TIMER=y
+# CONFIG_CLK_BCM63268_TIMER is not set
CONFIG_CLK_BCM_63XX_GATE=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_COMMON_CLK=y
@@ -116,8 +116,6 @@ CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
-CONFIG_HW_RANDOM=y
-CONFIG_HW_RANDOM_BCM2835=y
CONFIG_HZ_PERIODIC=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_IRQCHIP=y
@@ -165,6 +163,8 @@ CONFIG_MTD_CFI_BE_BYTE_SWAP=y
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_JEDECPROBE=y
# CONFIG_MTD_PARSER_IMAGETAG is not set
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_BCM63XX_FW=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NET_DEVLINK=y
CONFIG_NET_DSA=y
@@ -191,9 +191,9 @@ CONFIG_PADATA=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCIE_BCM6318=y
-CONFIG_PCIE_BCM6328=y
+# CONFIG_PCIE_BCM6328 is not set
CONFIG_PCIE_PME=y
-CONFIG_PCI_BCM6348=y
+# CONFIG_PCI_BCM6348 is not set
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DRIVERS_LEGACY=y
CONFIG_PERF_USE_VMALLOC=y
@@ -205,11 +205,11 @@ CONFIG_PHY_BCM63XX_USBH=y
# CONFIG_PHY_BRCM_SATA is not set
CONFIG_PINCTRL=y
CONFIG_PINCTRL_BCM6318=y
-CONFIG_PINCTRL_BCM63268=y
-CONFIG_PINCTRL_BCM6328=y
-CONFIG_PINCTRL_BCM6358=y
-CONFIG_PINCTRL_BCM6362=y
-CONFIG_PINCTRL_BCM6368=y
+# CONFIG_PINCTRL_BCM63268 is not set
+# CONFIG_PINCTRL_BCM6328 is not set
+# CONFIG_PINCTRL_BCM6358 is not set
+# CONFIG_PINCTRL_BCM6362 is not set
+# CONFIG_PINCTRL_BCM6368 is not set
CONFIG_PINCTRL_BCM63XX=y
CONFIG_PM=y
CONFIG_PM_CLK=y
@@ -241,20 +241,11 @@ CONFIG_SMP_UP=y
CONFIG_SOCK_RX_QUEUE_MAPPING=y
CONFIG_SOC_BCM63XX=y
CONFIG_SPI=y
-CONFIG_SPI_BCM63XX=y
+# CONFIG_SPI_BCM63XX is not set
CONFIG_SPI_BCM63XX_HSSPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SRCU=y
-CONFIG_SSB=y
-CONFIG_SSB_B43_PCI_BRIDGE=y
-CONFIG_SSB_BLOCKIO=y
-# CONFIG_SSB_DRIVER_MIPS is not set
-CONFIG_SSB_DRIVER_PCICORE=y
-CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
-CONFIG_SSB_PCIHOST=y
-CONFIG_SSB_PCIHOST_POSSIBLE=y
-CONFIG_SSB_SPROM=y
CONFIG_SWAP_IO_SPACE=y
CONFIG_SWPHY=y
CONFIG_SYNC_R4K=y
diff --git a/target/linux/bmips/bcm6318/target.mk b/target/linux/bmips/bcm6318/target.mk
new file mode 100644
index 0000000000..a8bbc8b976
--- /dev/null
+++ b/target/linux/bmips/bcm6318/target.mk
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+SUBTARGET:=bcm6318
+BOARDNAME:=BCM6318 based boards
+
+define Target/Description
+ Build firmware images for Broadcom BCM6318 based boards.
+endef
diff --git a/target/linux/bmips/bcm63268/base-files/etc/board.d/01_leds b/target/linux/bmips/bcm63268/base-files/etc/board.d/01_leds
new file mode 100644
index 0000000000..d5b65a9c0f
--- /dev/null
+++ b/target/linux/bmips/bcm63268/base-files/etc/board.d/01_leds
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+. /lib/functions/leds.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$(board_name)" in
+comtrend,vr-3032u)
+ ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1"
+ ;;
+sercomm,h500-s-lowi |\
+sercomm,h500-s-vfes)
+ ucidef_set_led_netdev "wan" "WAN" "green:internet" "wan"
+ ucidef_set_led_netdev "wifi" "WiFi" "green:wifi" "wifi"
+ ucidef_set_led_usbport "usb" "USB" "green:mobile" "usb1-port1" "usb2-port1"
+ ;;
+sercomm,shg2500)
+ ucidef_set_led_netdev "wan" "WAN" "green:internet" "wan"
+ ucidef_set_led_usbport "usb1" "USB1" "blue:modem" "usb1-port1" "usb2-port1"
+ ucidef_set_led_usbport "usb2" "USB2" "green:modem" "usb1-port2" "usb2-port2"
+ ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/bmips/nand/base-files/etc/board.d/02_network b/target/linux/bmips/bcm63268/base-files/etc/board.d/02_network
similarity index 93%
rename from target/linux/bmips/nand/base-files/etc/board.d/02_network
rename to target/linux/bmips/bcm63268/base-files/etc/board.d/02_network
index 0e130103da..ad7f2432e2 100644
--- a/target/linux/bmips/nand/base-files/etc/board.d/02_network
+++ b/target/linux/bmips/bcm63268/base-files/etc/board.d/02_network
@@ -9,12 +9,6 @@ comtrend,vr-3032u)
ucidef_set_bridge_device switch
ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
;;
-huawei,hg253s-v2 |\
-netgear,dgnd3700-v2 |\
-sercomm,shg2500)
- ucidef_set_bridge_device switch
- ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
- ;;
sercomm,h500-s-lowi |\
sercomm,h500-s-vfes)
ucidef_set_bridge_device switch
@@ -22,6 +16,10 @@ sercomm,h500-s-vfes)
ucidef_set_interface "qtn" device "wifi" protocol "static" ipaddr "1.1.1.1" netmask "255.255.255.252"
uci add_list firewall. at zone[0].network='qtn'
;;
+sercomm,shg2500)
+ ucidef_set_bridge_device switch
+ ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
+ ;;
esac
board_config_flush
diff --git a/target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches b/target/linux/bmips/bcm63268/base-files/etc/board.d/03_gpio_switches
similarity index 100%
copy from target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches
copy to target/linux/bmips/bcm63268/base-files/etc/board.d/03_gpio_switches
diff --git a/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh b/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh
new file mode 100644
index 0000000000..0aaf10442b
--- /dev/null
+++ b/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,26 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+. /lib/upgrade/cfe-jffs2-nand.sh
+
+PART_NAME=firmware
+REQUIRE_IMAGE_METADATA=1
+
+platform_check_image() {
+ return 0
+}
+
+platform_do_upgrade() {
+ case "$(board_name)" in
+ comtrend,vr-3032u)
+ cfe_jffs2_nand_upgrade "$1"
+ ;;
+ sercomm,h500-s-lowi |\
+ sercomm,h500-s-vfes |\
+ sercomm,shg2500)
+ nand_do_upgrade "$1"
+ ;;
+ *)
+ default_do_upgrade "$1"
+ ;;
+ esac
+}
diff --git a/target/linux/bmips/config-5.15 b/target/linux/bmips/bcm63268/config-5.15
similarity index 91%
copy from target/linux/bmips/config-5.15
copy to target/linux/bmips/bcm63268/config-5.15
index 3fc58d01dd..4cdbe13228 100644
--- a/target/linux/bmips/config-5.15
+++ b/target/linux/bmips/bcm63268/config-5.15
@@ -10,7 +10,7 @@ CONFIG_B53_MMAP_DRIVER=y
CONFIG_B53_SPI_DRIVER=y
CONFIG_BCM6345_EXT_IRQ=y
CONFIG_BCM6345_L1_IRQ=y
-CONFIG_BCM6348_ENET=y
+# CONFIG_BCM6348_ENET is not set
CONFIG_BCM6368_ENETSW=y
CONFIG_BCM63XX_POWER=y
CONFIG_BCM7038_WDT=y
@@ -53,6 +53,7 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y
CONFIG_CRASH_DUMP=y
CONFIG_CRC16=y
CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2
CONFIG_CRYPTO_LZO=y
@@ -164,7 +165,19 @@ CONFIG_MTD_CFI_BE_BYTE_SWAP=y
# CONFIG_MTD_CFI_NOSWAP is not set
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_NAND_BRCMNAND=y
+CONFIG_MTD_NAND_CORE=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_ECC_SW_HAMMING=y
# CONFIG_MTD_PARSER_IMAGETAG is not set
+CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_BCM63XX_FW=y
+CONFIG_MTD_SPLIT_BCM_WFI_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+CONFIG_MTD_UBI_BLOCK=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NET_DEVLINK=y
CONFIG_NET_DSA=y
@@ -190,10 +203,10 @@ CONFIG_OF_MDIO=y
CONFIG_PADATA=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_BCM6318=y
+# CONFIG_PCIE_BCM6318 is not set
CONFIG_PCIE_BCM6328=y
CONFIG_PCIE_PME=y
-CONFIG_PCI_BCM6348=y
+# CONFIG_PCI_BCM6348 is not set
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DRIVERS_LEGACY=y
CONFIG_PERF_USE_VMALLOC=y
@@ -204,12 +217,12 @@ CONFIG_PHYSICAL_START=0x80010000
CONFIG_PHY_BCM63XX_USBH=y
# CONFIG_PHY_BRCM_SATA is not set
CONFIG_PINCTRL=y
-CONFIG_PINCTRL_BCM6318=y
+# CONFIG_PINCTRL_BCM6318 is not set
CONFIG_PINCTRL_BCM63268=y
-CONFIG_PINCTRL_BCM6328=y
-CONFIG_PINCTRL_BCM6358=y
-CONFIG_PINCTRL_BCM6362=y
-CONFIG_PINCTRL_BCM6368=y
+# CONFIG_PINCTRL_BCM6328 is not set
+# CONFIG_PINCTRL_BCM6358 is not set
+# CONFIG_PINCTRL_BCM6362 is not set
+# CONFIG_PINCTRL_BCM6368 is not set
CONFIG_PINCTRL_BCM63XX=y
CONFIG_PM=y
CONFIG_PM_CLK=y
@@ -246,15 +259,6 @@ CONFIG_SPI_BCM63XX_HSSPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SRCU=y
-CONFIG_SSB=y
-CONFIG_SSB_B43_PCI_BRIDGE=y
-CONFIG_SSB_BLOCKIO=y
-# CONFIG_SSB_DRIVER_MIPS is not set
-CONFIG_SSB_DRIVER_PCICORE=y
-CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
-CONFIG_SSB_PCIHOST=y
-CONFIG_SSB_PCIHOST_POSSIBLE=y
-CONFIG_SSB_SPROM=y
CONFIG_SWAP_IO_SPACE=y
CONFIG_SWPHY=y
CONFIG_SYNC_R4K=y
@@ -272,6 +276,7 @@ CONFIG_TARGET_ISA_REV=0
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TREE_RCU=y
CONFIG_TREE_SRCU=y
+CONFIG_UBIFS_FS=y
CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y
CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
diff --git a/target/linux/bmips/bcm63268/target.mk b/target/linux/bmips/bcm63268/target.mk
new file mode 100644
index 0000000000..98cc6c533c
--- /dev/null
+++ b/target/linux/bmips/bcm63268/target.mk
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+SUBTARGET:=bcm63268
+BOARDNAME:=BCM63268 based boards
+FEATURES+=nand
+
+define Target/Description
+ Build firmware images for Broadcom BCM63268 based boards.
+endef
diff --git a/target/linux/bmips/generic/base-files/etc/board.d/02_network b/target/linux/bmips/bcm6328/base-files/etc/board.d/02_network
similarity index 67%
copy from target/linux/bmips/generic/base-files/etc/board.d/02_network
copy to target/linux/bmips/bcm6328/base-files/etc/board.d/02_network
index a5995849f0..792926fcf2 100644
--- a/target/linux/bmips/generic/base-files/etc/board.d/02_network
+++ b/target/linux/bmips/bcm6328/base-files/etc/board.d/02_network
@@ -5,15 +5,10 @@
board_config_update
case "$(board_name)" in
-comtrend,ar-5315u |\
-comtrend,ar-5387un |\
-comtrend,vr-3025u)
+comtrend,ar-5387un)
ucidef_set_bridge_device switch
ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
;;
-huawei,hg556a-b)
- ucidef_set_interface_lan "eth0"
- ;;
esac
board_config_flush
diff --git a/target/linux/bmips/generic/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bmips/bcm6328/base-files/etc/uci-defaults/09_fix_crc
similarity index 53%
copy from target/linux/bmips/generic/base-files/etc/uci-defaults/09_fix_crc
copy to target/linux/bmips/bcm6328/base-files/etc/uci-defaults/09_fix_crc
index 60227e7c34..3909947be6 100644
--- a/target/linux/bmips/generic/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/bmips/bcm6328/base-files/etc/uci-defaults/09_fix_crc
@@ -3,11 +3,9 @@
. /lib/functions.sh
case "$(board_name)" in
- comtrend,ar-5315u|\
- comtrend,ar-5387un|\
- comtrend,vr-3025u)
- mtd fixtrx firmware
- ;;
+comtrend,ar-5387un)
+ mtd fixtrx firmware
+ ;;
esac
exit 0
diff --git a/target/linux/bmips/generic/base-files/lib/upgrade/platform.sh b/target/linux/bmips/bcm6328/base-files/lib/upgrade/platform.sh
similarity index 72%
copy from target/linux/bmips/generic/base-files/lib/upgrade/platform.sh
copy to target/linux/bmips/bcm6328/base-files/lib/upgrade/platform.sh
index d731bb74d5..eb1d7fd0e5 100644
--- a/target/linux/bmips/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bmips/bcm6328/base-files/lib/upgrade/platform.sh
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
+. /lib/upgrade/cfe-jffs2-nand.sh
+
PART_NAME=firmware
REQUIRE_IMAGE_METADATA=1
@@ -9,8 +11,8 @@ platform_check_image() {
platform_do_upgrade() {
case "$(board_name)" in
- *)
- default_do_upgrade "$1"
- ;;
+ *)
+ default_do_upgrade "$1"
+ ;;
esac
}
diff --git a/target/linux/bmips/config-5.15 b/target/linux/bmips/bcm6328/config-5.15
similarity index 91%
copy from target/linux/bmips/config-5.15
copy to target/linux/bmips/bcm6328/config-5.15
index 3fc58d01dd..ea9898782a 100644
--- a/target/linux/bmips/config-5.15
+++ b/target/linux/bmips/bcm6328/config-5.15
@@ -10,7 +10,7 @@ CONFIG_B53_MMAP_DRIVER=y
CONFIG_B53_SPI_DRIVER=y
CONFIG_BCM6345_EXT_IRQ=y
CONFIG_BCM6345_L1_IRQ=y
-CONFIG_BCM6348_ENET=y
+# CONFIG_BCM6348_ENET is not set
CONFIG_BCM6368_ENETSW=y
CONFIG_BCM63XX_POWER=y
CONFIG_BCM7038_WDT=y
@@ -28,7 +28,7 @@ CONFIG_BLK_MQ_PCI=y
CONFIG_BLK_PM=y
CONFIG_BMIPS_GENERIC=y
CONFIG_CEVT_R4K=y
-CONFIG_CLK_BCM63268_TIMER=y
+# CONFIG_CLK_BCM63268_TIMER is not set
CONFIG_CLK_BCM_63XX_GATE=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_COMMON_CLK=y
@@ -53,6 +53,7 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y
CONFIG_CRASH_DUMP=y
CONFIG_CRC16=y
CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2
CONFIG_CRYPTO_LZO=y
@@ -116,8 +117,6 @@ CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
-CONFIG_HW_RANDOM=y
-CONFIG_HW_RANDOM_BCM2835=y
CONFIG_HZ_PERIODIC=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_IRQCHIP=y
@@ -164,7 +163,19 @@ CONFIG_MTD_CFI_BE_BYTE_SWAP=y
# CONFIG_MTD_CFI_NOSWAP is not set
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_NAND_BRCMNAND=y
+CONFIG_MTD_NAND_CORE=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_ECC_SW_HAMMING=y
# CONFIG_MTD_PARSER_IMAGETAG is not set
+CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_BCM63XX_FW=y
+CONFIG_MTD_SPLIT_BCM_WFI_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+CONFIG_MTD_UBI_BLOCK=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NET_DEVLINK=y
CONFIG_NET_DSA=y
@@ -190,7 +201,7 @@ CONFIG_OF_MDIO=y
CONFIG_PADATA=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_BCM6318=y
+# CONFIG_PCIE_BCM6318 is not set
CONFIG_PCIE_BCM6328=y
CONFIG_PCIE_PME=y
CONFIG_PCI_BCM6348=y
@@ -204,12 +215,12 @@ CONFIG_PHYSICAL_START=0x80010000
CONFIG_PHY_BCM63XX_USBH=y
# CONFIG_PHY_BRCM_SATA is not set
CONFIG_PINCTRL=y
-CONFIG_PINCTRL_BCM6318=y
-CONFIG_PINCTRL_BCM63268=y
+# CONFIG_PINCTRL_BCM6318 is not set
+# CONFIG_PINCTRL_BCM63268 is not set
CONFIG_PINCTRL_BCM6328=y
-CONFIG_PINCTRL_BCM6358=y
-CONFIG_PINCTRL_BCM6362=y
-CONFIG_PINCTRL_BCM6368=y
+# CONFIG_PINCTRL_BCM6358 is not set
+# CONFIG_PINCTRL_BCM6362 is not set
+# CONFIG_PINCTRL_BCM6368 is not set
CONFIG_PINCTRL_BCM63XX=y
CONFIG_PM=y
CONFIG_PM_CLK=y
@@ -241,20 +252,11 @@ CONFIG_SMP_UP=y
CONFIG_SOCK_RX_QUEUE_MAPPING=y
CONFIG_SOC_BCM63XX=y
CONFIG_SPI=y
-CONFIG_SPI_BCM63XX=y
+# CONFIG_SPI_BCM63XX is not set
CONFIG_SPI_BCM63XX_HSSPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SRCU=y
-CONFIG_SSB=y
-CONFIG_SSB_B43_PCI_BRIDGE=y
-CONFIG_SSB_BLOCKIO=y
-# CONFIG_SSB_DRIVER_MIPS is not set
-CONFIG_SSB_DRIVER_PCICORE=y
-CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
-CONFIG_SSB_PCIHOST=y
-CONFIG_SSB_PCIHOST_POSSIBLE=y
-CONFIG_SSB_SPROM=y
CONFIG_SWAP_IO_SPACE=y
CONFIG_SWPHY=y
CONFIG_SYNC_R4K=y
@@ -272,6 +274,7 @@ CONFIG_TARGET_ISA_REV=0
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TREE_RCU=y
CONFIG_TREE_SRCU=y
+CONFIG_UBIFS_FS=y
CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y
CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
diff --git a/target/linux/bmips/bcm6328/target.mk b/target/linux/bmips/bcm6328/target.mk
new file mode 100644
index 0000000000..a514130fc7
--- /dev/null
+++ b/target/linux/bmips/bcm6328/target.mk
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+SUBTARGET:=bcm6328
+BOARDNAME:=BCM6328 based boards
+FEATURES+=nand
+
+define Target/Description
+ Build firmware images for Broadcom BCM6328 based boards.
+endef
diff --git a/target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches b/target/linux/bmips/bcm6358/base-files/etc/board.d/01_leds
similarity index 53%
copy from target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches
copy to target/linux/bmips/bcm6358/base-files/etc/board.d/01_leds
index 75ac111b0c..74fdef28fb 100644
--- a/target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches
+++ b/target/linux/bmips/bcm6358/base-files/etc/board.d/01_leds
@@ -1,13 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-or-later
+. /lib/functions/leds.sh
. /lib/functions/uci-defaults.sh
board_config_update
case "$(board_name)" in
-sercomm,h500-s-lowi |\
-sercomm,h500-s-vfes)
- ucidef_add_gpio_switch "qtn_power" "Quantenna Module Power" "480" "1"
+huawei,hg556a-b)
+ ucidef_set_led_usbport "usb" "USB" "red:hspa" "1-1-port1" "1-1-port2" "usb1-port2" "usb2-port2"
;;
esac
diff --git a/target/linux/bmips/generic/base-files/etc/board.d/02_network b/target/linux/bmips/bcm6358/base-files/etc/board.d/02_network
similarity index 58%
copy from target/linux/bmips/generic/base-files/etc/board.d/02_network
copy to target/linux/bmips/bcm6358/base-files/etc/board.d/02_network
index a5995849f0..470d1b1bd0 100644
--- a/target/linux/bmips/generic/base-files/etc/board.d/02_network
+++ b/target/linux/bmips/bcm6358/base-files/etc/board.d/02_network
@@ -5,12 +5,6 @@
board_config_update
case "$(board_name)" in
-comtrend,ar-5315u |\
-comtrend,ar-5387un |\
-comtrend,vr-3025u)
- ucidef_set_bridge_device switch
- ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
- ;;
huawei,hg556a-b)
ucidef_set_interface_lan "eth0"
;;
diff --git a/target/linux/bmips/generic/base-files/lib/upgrade/platform.sh b/target/linux/bmips/bcm6358/base-files/lib/upgrade/platform.sh
similarity index 82%
copy from target/linux/bmips/generic/base-files/lib/upgrade/platform.sh
copy to target/linux/bmips/bcm6358/base-files/lib/upgrade/platform.sh
index d731bb74d5..1cf95be26a 100644
--- a/target/linux/bmips/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bmips/bcm6358/base-files/lib/upgrade/platform.sh
@@ -9,8 +9,8 @@ platform_check_image() {
platform_do_upgrade() {
case "$(board_name)" in
- *)
- default_do_upgrade "$1"
- ;;
+ *)
+ default_do_upgrade "$1"
+ ;;
esac
}
diff --git a/target/linux/bmips/config-5.15 b/target/linux/bmips/bcm6358/config-5.15
similarity index 89%
copy from target/linux/bmips/config-5.15
copy to target/linux/bmips/bcm6358/config-5.15
index 3fc58d01dd..62956398d5 100644
--- a/target/linux/bmips/config-5.15
+++ b/target/linux/bmips/bcm6358/config-5.15
@@ -6,29 +6,17 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_B53=y
CONFIG_B53_MDIO_DRIVER=y
-CONFIG_B53_MMAP_DRIVER=y
CONFIG_B53_SPI_DRIVER=y
CONFIG_BCM6345_EXT_IRQ=y
CONFIG_BCM6345_L1_IRQ=y
CONFIG_BCM6348_ENET=y
-CONFIG_BCM6368_ENETSW=y
-CONFIG_BCM63XX_POWER=y
+# CONFIG_BCM6368_ENETSW is not set
CONFIG_BCM7038_WDT=y
-CONFIG_BCMA=y
-CONFIG_BCMA_BLOCKIO=y
-# CONFIG_BCMA_DEBUG is not set
-# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
-# CONFIG_BCMA_DRIVER_MIPS is not set
-CONFIG_BCMA_DRIVER_PCI=y
-# CONFIG_BCMA_DRIVER_PCI_HOSTMODE is not set
-CONFIG_BCMA_HOST_PCI=y
-CONFIG_BCMA_HOST_PCI_POSSIBLE=y
-# CONFIG_BCMA_HOST_SOC is not set
CONFIG_BLK_MQ_PCI=y
CONFIG_BLK_PM=y
CONFIG_BMIPS_GENERIC=y
CONFIG_CEVT_R4K=y
-CONFIG_CLK_BCM63268_TIMER=y
+# CONFIG_CLK_BCM63268_TIMER is not set
CONFIG_CLK_BCM_63XX_GATE=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_COMMON_CLK=y
@@ -116,8 +104,6 @@ CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
-CONFIG_HW_RANDOM=y
-CONFIG_HW_RANDOM_BCM2835=y
CONFIG_HZ_PERIODIC=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_IRQCHIP=y
@@ -131,8 +117,7 @@ CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_MDIO_BUS=y
-CONFIG_MDIO_BUS_MUX=y
-CONFIG_MDIO_BUS_MUX_BCM6368=y
+# CONFIG_MDIO_BUS_MUX_BCM6368 is not set
CONFIG_MDIO_DEVICE=y
CONFIG_MDIO_DEVRES=y
CONFIG_MEMFD_CREATE=y
@@ -165,6 +150,9 @@ CONFIG_MTD_CFI_BE_BYTE_SWAP=y
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_JEDECPROBE=y
# CONFIG_MTD_PARSER_IMAGETAG is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_BCM63XX_FW=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NET_DEVLINK=y
CONFIG_NET_DSA=y
@@ -189,10 +177,8 @@ CONFIG_OF_KOBJ=y
CONFIG_OF_MDIO=y
CONFIG_PADATA=y
CONFIG_PCI=y
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_BCM6318=y
-CONFIG_PCIE_BCM6328=y
-CONFIG_PCIE_PME=y
+# CONFIG_PCIE_BCM6318 is not set
+# CONFIG_PCIE_BCM6328 is not set
CONFIG_PCI_BCM6348=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DRIVERS_LEGACY=y
@@ -204,17 +190,15 @@ CONFIG_PHYSICAL_START=0x80010000
CONFIG_PHY_BCM63XX_USBH=y
# CONFIG_PHY_BRCM_SATA is not set
CONFIG_PINCTRL=y
-CONFIG_PINCTRL_BCM6318=y
-CONFIG_PINCTRL_BCM63268=y
-CONFIG_PINCTRL_BCM6328=y
+# CONFIG_PINCTRL_BCM6318 is not set
+# CONFIG_PINCTRL_BCM63268 is not set
+# CONFIG_PINCTRL_BCM6328 is not set
CONFIG_PINCTRL_BCM6358=y
-CONFIG_PINCTRL_BCM6362=y
-CONFIG_PINCTRL_BCM6368=y
+# CONFIG_PINCTRL_BCM6362 is not set
+# CONFIG_PINCTRL_BCM6368 is not set
CONFIG_PINCTRL_BCM63XX=y
CONFIG_PM=y
CONFIG_PM_CLK=y
-CONFIG_PM_GENERIC_DOMAINS=y
-CONFIG_PM_GENERIC_DOMAINS_OF=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_POWER_RESET=y
@@ -239,10 +223,10 @@ CONFIG_SGL_ALLOC=y
CONFIG_SMP=y
CONFIG_SMP_UP=y
CONFIG_SOCK_RX_QUEUE_MAPPING=y
-CONFIG_SOC_BCM63XX=y
+# CONFIG_SOC_BCM63XX is not set
CONFIG_SPI=y
CONFIG_SPI_BCM63XX=y
-CONFIG_SPI_BCM63XX_HSSPI=y
+# CONFIG_SPI_BCM63XX_HSSPI is not set
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SRCU=y
diff --git a/target/linux/bmips/bcm6358/target.mk b/target/linux/bmips/bcm6358/target.mk
new file mode 100644
index 0000000000..d868d0a986
--- /dev/null
+++ b/target/linux/bmips/bcm6358/target.mk
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+SUBTARGET:=bcm6358
+BOARDNAME:=BCM6358 based boards
+FEATURES+=low_mem
+
+define Target/Description
+ Build firmware images for Broadcom BCM6358 based boards.
+endef
diff --git a/target/linux/bmips/bcm6362/base-files/etc/board.d/01_leds b/target/linux/bmips/bcm6362/base-files/etc/board.d/01_leds
new file mode 100644
index 0000000000..cb1d24ce89
--- /dev/null
+++ b/target/linux/bmips/bcm6362/base-files/etc/board.d/01_leds
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+. /lib/functions/leds.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$(board_name)" in
+huawei,hg253s-v2)
+ ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1"
+ ;;
+netgear,dgnd3700-v2)
+ ucidef_set_led_usbport "usb1" "USB1" "green:usb1" "usb1-port1" "usb2-port1"
+ ucidef_set_led_usbport "usb2" "USB2" "green:usb2" "usb1-port2" "usb2-port2"
+ ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches b/target/linux/bmips/bcm6362/base-files/etc/board.d/02_network
similarity index 54%
rename from target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches
rename to target/linux/bmips/bcm6362/base-files/etc/board.d/02_network
index 75ac111b0c..7986f78310 100644
--- a/target/linux/bmips/nand/base-files/etc/board.d/03_gpio_switches
+++ b/target/linux/bmips/bcm6362/base-files/etc/board.d/02_network
@@ -5,9 +5,10 @@
board_config_update
case "$(board_name)" in
-sercomm,h500-s-lowi |\
-sercomm,h500-s-vfes)
- ucidef_add_gpio_switch "qtn_power" "Quantenna Module Power" "480" "1"
+huawei,hg253s-v2 |\
+netgear,dgnd3700-v2)
+ ucidef_set_bridge_device switch
+ ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
esac
diff --git a/target/linux/bmips/generic/base-files/lib/upgrade/platform.sh b/target/linux/bmips/bcm6362/base-files/lib/upgrade/platform.sh
similarity index 55%
copy from target/linux/bmips/generic/base-files/lib/upgrade/platform.sh
copy to target/linux/bmips/bcm6362/base-files/lib/upgrade/platform.sh
index d731bb74d5..9175cf4255 100644
--- a/target/linux/bmips/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bmips/bcm6362/base-files/lib/upgrade/platform.sh
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
+. /lib/upgrade/cfe-jffs2-nand.sh
+
PART_NAME=firmware
REQUIRE_IMAGE_METADATA=1
@@ -9,8 +11,12 @@ platform_check_image() {
platform_do_upgrade() {
case "$(board_name)" in
- *)
- default_do_upgrade "$1"
- ;;
+ huawei,hg253s-v2 |\
+ netgear,dgnd3700-v2)
+ cfe_jffs2_nand_upgrade "$1"
+ ;;
+ *)
+ default_do_upgrade "$1"
+ ;;
esac
}
diff --git a/target/linux/bmips/config-5.15 b/target/linux/bmips/bcm6362/config-5.15
similarity index 91%
copy from target/linux/bmips/config-5.15
copy to target/linux/bmips/bcm6362/config-5.15
index 3fc58d01dd..325692e5f3 100644
--- a/target/linux/bmips/config-5.15
+++ b/target/linux/bmips/bcm6362/config-5.15
@@ -10,7 +10,7 @@ CONFIG_B53_MMAP_DRIVER=y
CONFIG_B53_SPI_DRIVER=y
CONFIG_BCM6345_EXT_IRQ=y
CONFIG_BCM6345_L1_IRQ=y
-CONFIG_BCM6348_ENET=y
+# CONFIG_BCM6348_ENET is not set
CONFIG_BCM6368_ENETSW=y
CONFIG_BCM63XX_POWER=y
CONFIG_BCM7038_WDT=y
@@ -28,7 +28,7 @@ CONFIG_BLK_MQ_PCI=y
CONFIG_BLK_PM=y
CONFIG_BMIPS_GENERIC=y
CONFIG_CEVT_R4K=y
-CONFIG_CLK_BCM63268_TIMER=y
+# CONFIG_CLK_BCM63268_TIMER is not set
CONFIG_CLK_BCM_63XX_GATE=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_COMMON_CLK=y
@@ -53,6 +53,7 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y
CONFIG_CRASH_DUMP=y
CONFIG_CRC16=y
CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2
CONFIG_CRYPTO_LZO=y
@@ -164,7 +165,19 @@ CONFIG_MTD_CFI_BE_BYTE_SWAP=y
# CONFIG_MTD_CFI_NOSWAP is not set
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_NAND_BRCMNAND=y
+CONFIG_MTD_NAND_CORE=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_ECC_SW_HAMMING=y
# CONFIG_MTD_PARSER_IMAGETAG is not set
+CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_BCM63XX_FW=y
+CONFIG_MTD_SPLIT_BCM_WFI_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+CONFIG_MTD_UBI_BLOCK=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NET_DEVLINK=y
CONFIG_NET_DSA=y
@@ -190,10 +203,10 @@ CONFIG_OF_MDIO=y
CONFIG_PADATA=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_BCM6318=y
+# CONFIG_PCIE_BCM6318 is not set
CONFIG_PCIE_BCM6328=y
CONFIG_PCIE_PME=y
-CONFIG_PCI_BCM6348=y
+# CONFIG_PCI_BCM6348 is not set
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DRIVERS_LEGACY=y
CONFIG_PERF_USE_VMALLOC=y
@@ -204,12 +217,12 @@ CONFIG_PHYSICAL_START=0x80010000
CONFIG_PHY_BCM63XX_USBH=y
# CONFIG_PHY_BRCM_SATA is not set
CONFIG_PINCTRL=y
-CONFIG_PINCTRL_BCM6318=y
-CONFIG_PINCTRL_BCM63268=y
-CONFIG_PINCTRL_BCM6328=y
-CONFIG_PINCTRL_BCM6358=y
+# CONFIG_PINCTRL_BCM6318 is not set
+# CONFIG_PINCTRL_BCM63268 is not set
+# CONFIG_PINCTRL_BCM6328 is not set
+# CONFIG_PINCTRL_BCM6358 is not set
CONFIG_PINCTRL_BCM6362=y
-CONFIG_PINCTRL_BCM6368=y
+# CONFIG_PINCTRL_BCM6368 is not set
CONFIG_PINCTRL_BCM63XX=y
CONFIG_PM=y
CONFIG_PM_CLK=y
@@ -246,15 +259,6 @@ CONFIG_SPI_BCM63XX_HSSPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SRCU=y
-CONFIG_SSB=y
-CONFIG_SSB_B43_PCI_BRIDGE=y
-CONFIG_SSB_BLOCKIO=y
-# CONFIG_SSB_DRIVER_MIPS is not set
-CONFIG_SSB_DRIVER_PCICORE=y
-CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
-CONFIG_SSB_PCIHOST=y
-CONFIG_SSB_PCIHOST_POSSIBLE=y
-CONFIG_SSB_SPROM=y
CONFIG_SWAP_IO_SPACE=y
CONFIG_SWPHY=y
CONFIG_SYNC_R4K=y
@@ -272,6 +276,7 @@ CONFIG_TARGET_ISA_REV=0
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TREE_RCU=y
CONFIG_TREE_SRCU=y
+CONFIG_UBIFS_FS=y
CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y
CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
diff --git a/target/linux/bmips/bcm6362/target.mk b/target/linux/bmips/bcm6362/target.mk
new file mode 100644
index 0000000000..81addd45f6
--- /dev/null
+++ b/target/linux/bmips/bcm6362/target.mk
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+SUBTARGET:=bcm6362
+BOARDNAME:=BCM6362 based boards
+FEATURES+=nand
+
+define Target/Description
+ Build firmware images for Broadcom BCM6362 based boards.
+endef
diff --git a/target/linux/bmips/generic/base-files/etc/board.d/02_network b/target/linux/bmips/bcm6368/base-files/etc/board.d/02_network
similarity index 72%
rename from target/linux/bmips/generic/base-files/etc/board.d/02_network
rename to target/linux/bmips/bcm6368/base-files/etc/board.d/02_network
index a5995849f0..14d6e56dd1 100644
--- a/target/linux/bmips/generic/base-files/etc/board.d/02_network
+++ b/target/linux/bmips/bcm6368/base-files/etc/board.d/02_network
@@ -5,15 +5,10 @@
board_config_update
case "$(board_name)" in
-comtrend,ar-5315u |\
-comtrend,ar-5387un |\
comtrend,vr-3025u)
ucidef_set_bridge_device switch
ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
;;
-huawei,hg556a-b)
- ucidef_set_interface_lan "eth0"
- ;;
esac
board_config_flush
diff --git a/target/linux/bmips/generic/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bmips/bcm6368/base-files/etc/uci-defaults/09_fix_crc
similarity index 53%
rename from target/linux/bmips/generic/base-files/etc/uci-defaults/09_fix_crc
rename to target/linux/bmips/bcm6368/base-files/etc/uci-defaults/09_fix_crc
index 60227e7c34..c66e4169fd 100644
--- a/target/linux/bmips/generic/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/bmips/bcm6368/base-files/etc/uci-defaults/09_fix_crc
@@ -3,11 +3,9 @@
. /lib/functions.sh
case "$(board_name)" in
- comtrend,ar-5315u|\
- comtrend,ar-5387un|\
- comtrend,vr-3025u)
- mtd fixtrx firmware
- ;;
+comtrend,vr-3025u)
+ mtd fixtrx firmware
+ ;;
esac
exit 0
diff --git a/target/linux/bmips/generic/base-files/lib/upgrade/platform.sh b/target/linux/bmips/bcm6368/base-files/lib/upgrade/platform.sh
similarity index 82%
rename from target/linux/bmips/generic/base-files/lib/upgrade/platform.sh
rename to target/linux/bmips/bcm6368/base-files/lib/upgrade/platform.sh
index d731bb74d5..1cf95be26a 100644
--- a/target/linux/bmips/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bmips/bcm6368/base-files/lib/upgrade/platform.sh
@@ -9,8 +9,8 @@ platform_check_image() {
platform_do_upgrade() {
case "$(board_name)" in
- *)
- default_do_upgrade "$1"
- ;;
+ *)
+ default_do_upgrade "$1"
+ ;;
esac
}
diff --git a/target/linux/bmips/config-5.15 b/target/linux/bmips/bcm6368/config-5.15
similarity index 89%
rename from target/linux/bmips/config-5.15
rename to target/linux/bmips/bcm6368/config-5.15
index 3fc58d01dd..06d72d9ebe 100644
--- a/target/linux/bmips/config-5.15
+++ b/target/linux/bmips/bcm6368/config-5.15
@@ -10,25 +10,14 @@ CONFIG_B53_MMAP_DRIVER=y
CONFIG_B53_SPI_DRIVER=y
CONFIG_BCM6345_EXT_IRQ=y
CONFIG_BCM6345_L1_IRQ=y
-CONFIG_BCM6348_ENET=y
+# CONFIG_BCM6348_ENET is not set
CONFIG_BCM6368_ENETSW=y
-CONFIG_BCM63XX_POWER=y
CONFIG_BCM7038_WDT=y
-CONFIG_BCMA=y
-CONFIG_BCMA_BLOCKIO=y
-# CONFIG_BCMA_DEBUG is not set
-# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
-# CONFIG_BCMA_DRIVER_MIPS is not set
-CONFIG_BCMA_DRIVER_PCI=y
-# CONFIG_BCMA_DRIVER_PCI_HOSTMODE is not set
-CONFIG_BCMA_HOST_PCI=y
-CONFIG_BCMA_HOST_PCI_POSSIBLE=y
-# CONFIG_BCMA_HOST_SOC is not set
CONFIG_BLK_MQ_PCI=y
CONFIG_BLK_PM=y
CONFIG_BMIPS_GENERIC=y
CONFIG_CEVT_R4K=y
-CONFIG_CLK_BCM63268_TIMER=y
+# CONFIG_CLK_BCM63268_TIMER is not set
CONFIG_CLK_BCM_63XX_GATE=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_COMMON_CLK=y
@@ -53,6 +42,7 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y
CONFIG_CRASH_DUMP=y
CONFIG_CRC16=y
CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2
CONFIG_CRYPTO_LZO=y
@@ -164,7 +154,20 @@ CONFIG_MTD_CFI_BE_BYTE_SWAP=y
# CONFIG_MTD_CFI_NOSWAP is not set
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_NAND_BRCMNAND=y
+CONFIG_MTD_NAND_CORE=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_ECC_SW_HAMMING=y
# CONFIG_MTD_PARSER_IMAGETAG is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_BCM63XX_FW=y
+CONFIG_MTD_SPLIT_BCM_WFI_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+CONFIG_MTD_UBI_BLOCK=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NET_DEVLINK=y
CONFIG_NET_DSA=y
@@ -189,10 +192,8 @@ CONFIG_OF_KOBJ=y
CONFIG_OF_MDIO=y
CONFIG_PADATA=y
CONFIG_PCI=y
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_BCM6318=y
-CONFIG_PCIE_BCM6328=y
-CONFIG_PCIE_PME=y
+# CONFIG_PCIE_BCM6318 is not set
+# CONFIG_PCIE_BCM6328 is not set
CONFIG_PCI_BCM6348=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DRIVERS_LEGACY=y
@@ -204,17 +205,15 @@ CONFIG_PHYSICAL_START=0x80010000
CONFIG_PHY_BCM63XX_USBH=y
# CONFIG_PHY_BRCM_SATA is not set
CONFIG_PINCTRL=y
-CONFIG_PINCTRL_BCM6318=y
-CONFIG_PINCTRL_BCM63268=y
-CONFIG_PINCTRL_BCM6328=y
-CONFIG_PINCTRL_BCM6358=y
-CONFIG_PINCTRL_BCM6362=y
+# CONFIG_PINCTRL_BCM6318 is not set
+# CONFIG_PINCTRL_BCM63268 is not set
+# CONFIG_PINCTRL_BCM6328 is not set
+# CONFIG_PINCTRL_BCM6358 is not set
+# CONFIG_PINCTRL_BCM6362 is not set
CONFIG_PINCTRL_BCM6368=y
CONFIG_PINCTRL_BCM63XX=y
CONFIG_PM=y
CONFIG_PM_CLK=y
-CONFIG_PM_GENERIC_DOMAINS=y
-CONFIG_PM_GENERIC_DOMAINS_OF=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_POWER_RESET=y
@@ -239,10 +238,10 @@ CONFIG_SGL_ALLOC=y
CONFIG_SMP=y
CONFIG_SMP_UP=y
CONFIG_SOCK_RX_QUEUE_MAPPING=y
-CONFIG_SOC_BCM63XX=y
+# CONFIG_SOC_BCM63XX is not set
CONFIG_SPI=y
CONFIG_SPI_BCM63XX=y
-CONFIG_SPI_BCM63XX_HSSPI=y
+# CONFIG_SPI_BCM63XX_HSSPI is not set
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SRCU=y
@@ -272,6 +271,7 @@ CONFIG_TARGET_ISA_REV=0
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TREE_RCU=y
CONFIG_TREE_SRCU=y
+CONFIG_UBIFS_FS=y
CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y
CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
diff --git a/target/linux/bmips/bcm6368/target.mk b/target/linux/bmips/bcm6368/target.mk
new file mode 100644
index 0000000000..950bf7224a
--- /dev/null
+++ b/target/linux/bmips/bcm6368/target.mk
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+SUBTARGET:=bcm6368
+BOARDNAME:=BCM6368 based boards
+FEATURES+=nand
+
+define Target/Description
+ Build firmware images for Broadcom BCM6368 based boards.
+endef
diff --git a/target/linux/bmips/generic/base-files/etc/board.d/01_leds b/target/linux/bmips/generic/base-files/etc/board.d/01_leds
deleted file mode 100644
index 3461eca10c..0000000000
--- a/target/linux/bmips/generic/base-files/etc/board.d/01_leds
+++ /dev/null
@@ -1,16 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-
-. /lib/functions/leds.sh
-. /lib/functions/uci-defaults.sh
-
-board_config_update
-
-led_usb="$(get_dt_led usb)"
-[ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1"
-
-led_usb2="$(get_dt_led usb2)"
-[ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1"
-
-board_config_flush
-
-exit 0
diff --git a/target/linux/bmips/generic/config-default b/target/linux/bmips/generic/config-default
deleted file mode 100644
index 33fa39715b..0000000000
--- a/target/linux/bmips/generic/config-default
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_SPI_NOR=y
-CONFIG_MTD_SPLIT_BCM63XX_FW=y
diff --git a/target/linux/bmips/generic/target.mk b/target/linux/bmips/generic/target.mk
deleted file mode 100644
index bd75426f69..0000000000
--- a/target/linux/bmips/generic/target.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-BOARDNAME:=generic
-
-define Target/Description
- BMIPS boards without NAND support
-endef
diff --git a/target/linux/bmips/image/Makefile b/target/linux/bmips/image/Makefile
index da328f7216..8369a86669 100644
--- a/target/linux/bmips/image/Makefile
+++ b/target/linux/bmips/image/Makefile
@@ -7,7 +7,15 @@ KERNEL_LOADADDR := 0x80010000 # RAM start + 64K
LOADER_ENTRY := 0x80a00000 # RAM start + 10M, for relocate
LZMA_TEXT_START := 0x81800000 # RAM start + 24M
+DEVICE_VARS += CFE_BOARD_ID CFE_EXTRAS
+DEVICE_VARS += CFE_PART_FLAGS CFE_PART_ID
+DEVICE_VARS += CFE_RAM_FILE
+DEVICE_VARS += CFE_RAM_JFFS2_NAME CFE_RAM_JFFS2_PAD
+DEVICE_VARS += CFE_WFI_CHIP_ID CFE_WFI_FLASH_TYPE
+DEVICE_VARS += CFE_WFI_FLAGS CFE_WFI_VERSION
DEVICE_VARS += CHIP_ID DEVICE_LOADADDR
+DEVICE_VARS += FLASH_MB IMAGE_OFFSET
+DEVICE_VARS += SERCOMM_FSVER SERCOMM_HWVER SERCOMM_SWVER
define Build/Compile
rm -rf $(KDIR)/relocate
@@ -253,11 +261,74 @@ define Device/Default
DEVICE_LOADADDR :=
endef
+define Device/bcm63xx-cfe
+ FILESYSTEMS := squashfs jffs2-64k jffs2-128k
+ KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma
+ KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-lzma elf
+ KERNEL_INITRAMFS_SUFFIX := .elf
+ IMAGES := cfe.bin sysupgrade.bin
+ IMAGE/cfe.bin := \
+ cfe-bin $$$$(if $$$$(FLASH_MB),--pad $$$$(shell expr $$$$(FLASH_MB) / 2))
+ IMAGE/sysupgrade.bin := cfe-bin | append-metadata
+ BLOCKSIZE := 0x10000
+ IMAGE_OFFSET :=
+ FLASH_MB :=
+ CFE_BOARD_ID :=
+ CFE_EXTRAS = --block-size $$(BLOCKSIZE) \
+ --image-offset $$(if $$(IMAGE_OFFSET),$$(IMAGE_OFFSET),$$(BLOCKSIZE))
+endef
+
+# Legacy CFEs with specific LZMA parameters and no length
+define Device/bcm63xx-cfe-legacy
+ $(Device/bcm63xx-cfe)
+ KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma-cfe
+endef
+
+# CFE expects a single JFFS2 partition with cferam and kernel. However,
+# it's possible to fool CFE into properly loading both cferam and kernel
+# from two different JFFS2 partitions by adding dummy files (see
+# cfe-jffs2-cferam and cfe-jffs2-kernel).
+# Separate JFFS2 partitions allow upgrading openwrt without reflashing cferam
+# JFFS2 partition, which is much safer in case anything goes wrong.
+define Device/bcm63xx-nand
+ FILESYSTEMS := squashfs ubifs
+ KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | cfe-jffs2-kernel
+ KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-lzma elf
+ KERNEL_INITRAMFS_SUFFIX := .elf
+ IMAGES := cfe.bin sysupgrade.bin
+ IMAGE/cfe.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) |\
+ cfe-jffs2-cferam | append-ubi | cfe-wfi-tag
+ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ KERNEL_SIZE := 5120k
+ CFE_PART_FLAGS :=
+ CFE_PART_ID :=
+ CFE_RAM_FILE :=
+ CFE_RAM_JFFS2_NAME :=
+ CFE_RAM_JFFS2_PAD :=
+ CFE_WFI_VERSION :=
+ CFE_WFI_CHIP_ID = 0x$$(CHIP_ID)
+ CFE_WFI_FLASH_TYPE :=
+ CFE_WFI_FLAGS :=
+ UBINIZE_OPTS := -E 5
+ DEVICE_PACKAGES += nand-utils
+endef
+
+define Device/sercomm-nand
+ $(Device/bcm63xx-nand)
+ IMAGES := factory.img sysupgrade.bin
+ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi |\
+ cfe-sercomm-part | gzip | cfe-sercomm-load | cfe-sercomm-crypto
+ SERCOMM_FSVER :=
+ SERCOMM_HWVER :=
+ SERCOMM_SWVER :=
+endef
+
+### Package helpers ###
ATH9K_PACKAGES := kmod-ath9k wpad-basic-mbedtls
B43_PACKAGES := kmod-b43 wpad-basic-mbedtls
-USB1_PACKAGES := kmod-usb-ohci kmod-ledtrig-usbdev
+USB1_PACKAGES := kmod-usb-ohci kmod-usb-ledtrig-usbport
USB2_PACKAGES := $(USB1_PACKAGES) kmod-usb2
-include bcm63xx_$(SUBTARGET).mk
+include $(SUBTARGET).mk
$(eval $(call BuildImage))
diff --git a/target/linux/bmips/image/bcm6318.mk b/target/linux/bmips/image/bcm6318.mk
new file mode 100644
index 0000000000..fc73eb4521
--- /dev/null
+++ b/target/linux/bmips/image/bcm6318.mk
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+define Device/comtrend_ar-5315u
+ $(Device/bcm63xx-cfe)
+ DEVICE_VENDOR := Comtrend
+ DEVICE_MODEL := AR-5315u
+ CHIP_ID := 6318
+ CFE_BOARD_ID := 96318A-1441N1
+ FLASH_MB := 16
+ DEVICE_PACKAGES += $(USB2_PACKAGES) $(B43_PACKAGES) \
+ kmod-leds-bcm6328
+endef
+TARGET_DEVICES += comtrend_ar-5315u
diff --git a/target/linux/bmips/image/bcm63268.mk b/target/linux/bmips/image/bcm63268.mk
new file mode 100644
index 0000000000..6f7cda7405
--- /dev/null
+++ b/target/linux/bmips/image/bcm63268.mk
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+define Device/comtrend_vr-3032u
+ $(Device/bcm63xx-nand)
+ DEVICE_VENDOR := Comtrend
+ DEVICE_MODEL := VR-3032u
+ CHIP_ID := 63268
+ SOC := bcm63168
+ CFE_RAM_FILE := comtrend,vr-3032u/cferam.000
+ CFE_RAM_JFFS2_NAME := cferam.000
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ SUBPAGESIZE := 512
+ VID_HDR_OFFSET := 2048
+ DEVICE_PACKAGES += $(USB2_PACKAGES) \
+ kmod-leds-bcm6328
+ CFE_WFI_FLASH_TYPE := 3
+ CFE_WFI_VERSION := 0x5732
+endef
+TARGET_DEVICES += comtrend_vr-3032u
+
+define Device/sercomm_h500-s-lowi
+ $(Device/sercomm-nand)
+ DEVICE_VENDOR := Sercomm
+ DEVICE_MODEL := H500-s
+ DEVICE_VARIANT := lowi
+ DEVICE_LOADADDR := $(KERNEL_LOADADDR)
+ KERNEL := kernel-bin | append-dtb | lzma | cfe-jffs2-kernel
+ CHIP_ID := 63268
+ SOC := bcm63167
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ SUBPAGESIZE := 512
+ VID_HDR_OFFSET := 2048
+ DEVICE_PACKAGES += $(USB2_PACKAGES) \
+ kmod-leds-bcm6328
+ SERCOMM_FSVER := 1001
+ SERCOMM_HWVER := 1434b31
+ SERCOMM_SWVER := 3305
+endef
+TARGET_DEVICES += sercomm_h500-s-lowi
+
+define Device/sercomm_h500-s-vfes
+ $(Device/sercomm-nand)
+ DEVICE_VENDOR := Sercomm
+ DEVICE_MODEL := H500-s
+ DEVICE_VARIANT := vfes
+ DEVICE_LOADADDR := $(KERNEL_LOADADDR)
+ KERNEL := kernel-bin | append-dtb | lzma | cfe-jffs2-kernel
+ CHIP_ID := 63268
+ SOC := bcm63167
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ SUBPAGESIZE := 512
+ VID_HDR_OFFSET := 2048
+ DEVICE_PACKAGES += $(USB2_PACKAGES) \
+ kmod-leds-bcm6328
+ SERCOMM_FSVER := 1001
+ SERCOMM_HWVER := 142584b
+ SERCOMM_SWVER := 3417
+endef
+TARGET_DEVICES += sercomm_h500-s-vfes
+
+define Device/sercomm_shg2500
+ $(Device/sercomm-nand)
+ DEVICE_VENDOR := Sercomm
+ DEVICE_MODEL := SHG2500
+ DEVICE_LOADADDR := $(KERNEL_LOADADDR)
+ KERNEL := kernel-bin | append-dtb | lzma | cfe-jffs2-kernel
+ CHIP_ID := 63268
+ SOC := bcm63168
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ SUBPAGESIZE := 512
+ VID_HDR_OFFSET := 2048
+ DEVICE_PACKAGES += $(USB2_PACKAGES) kmod-i2c-gpio \
+ kmod-leds-sercomm-msp430
+ SERCOMM_FSVER := 1001
+ SERCOMM_HWVER := 1424e4a
+ SERCOMM_SWVER := 3207
+endef
+TARGET_DEVICES += sercomm_shg2500
diff --git a/target/linux/bmips/image/bcm6328.mk b/target/linux/bmips/image/bcm6328.mk
new file mode 100644
index 0000000000..3a739a7e71
--- /dev/null
+++ b/target/linux/bmips/image/bcm6328.mk
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+define Device/comtrend_ar-5387un
+ $(Device/bcm63xx-cfe)
+ DEVICE_VENDOR := Comtrend
+ DEVICE_MODEL := AR-5387un
+ CHIP_ID := 6328
+ CFE_BOARD_ID := 96328A-1441N1
+ FLASH_MB := 16
+ DEVICE_PACKAGES += $(USB2_PACKAGES) $(B43_PACKAGES) \
+ kmod-leds-bcm6328
+endef
+TARGET_DEVICES += comtrend_ar-5387un
diff --git a/target/linux/bmips/image/bcm6358.mk b/target/linux/bmips/image/bcm6358.mk
new file mode 100644
index 0000000000..33c87f9ce4
--- /dev/null
+++ b/target/linux/bmips/image/bcm6358.mk
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+define Device/huawei_hg556a-b
+ $(Device/bcm63xx-cfe-legacy)
+ DEVICE_VENDOR := Huawei
+ DEVICE_MODEL := EchoLife HG556a
+ DEVICE_VARIANT := B
+ CHIP_ID := 6358
+ CFE_BOARD_ID := HW556
+ CFE_EXTRAS += --rsa-signature "EchoLife_HG556a" --tag-version 8
+ BLOCKSIZE := 0x20000
+ DEVICE_PACKAGES += $(USB2_PACKAGES) $(ATH9K_PACKAGES) \
+ kmod-leds-gpio
+endef
+TARGET_DEVICES += huawei_hg556a-b
diff --git a/target/linux/bmips/image/bcm6362.mk b/target/linux/bmips/image/bcm6362.mk
new file mode 100644
index 0000000000..d6b4b1ce60
--- /dev/null
+++ b/target/linux/bmips/image/bcm6362.mk
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+define Device/huawei_hg253s-v2
+ $(Device/bcm63xx-nand)
+ IMAGES := flash.bin sysupgrade.bin
+ IMAGE/flash.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | cfe-jffs2-cferam | append-ubi
+ DEVICE_VENDOR := Huawei
+ DEVICE_MODEL := HG253s
+ DEVICE_VARIANT := v2
+ CHIP_ID := 6362
+ CFE_PART_FLAGS := 1
+ CFE_PART_ID := 0x0001EFEE
+ CFE_RAM_FILE := huawei,hg253s-v2/cferam.000
+ CFE_RAM_JFFS2_NAME := cferam.000
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ SUBPAGESIZE := 512
+ VID_HDR_OFFSET := 2048
+ DEVICE_PACKAGES += $(USB2_PACKAGES) \
+ kmod-leds-bcm6328 kmod-leds-gpio
+ CFE_WFI_FLASH_TYPE := 3
+endef
+TARGET_DEVICES += huawei_hg253s-v2
+
+define Device/netgear_dgnd3700-v2
+ $(Device/bcm63xx-nand)
+ DEVICE_VENDOR := NETGEAR
+ DEVICE_MODEL := DGND3700
+ DEVICE_VARIANT := v2
+ CHIP_ID := 6362
+ CFE_RAM_FILE := netgear,dgnd3700-v2/cferam
+ CFE_RAM_JFFS2_NAME := cferam
+ CFE_RAM_JFFS2_PAD := 496k
+ BLOCKSIZE := 16k
+ PAGESIZE := 512
+ DEVICE_PACKAGES += $(USB2_PACKAGES) \
+ kmod-leds-bcm6328 kmod-leds-gpio
+ CFE_WFI_FLASH_TYPE := 2
+ CFE_WFI_VERSION := 0x5731
+endef
+TARGET_DEVICES += netgear_dgnd3700-v2
diff --git a/target/linux/bmips/image/bcm6368.mk b/target/linux/bmips/image/bcm6368.mk
new file mode 100644
index 0000000000..be4cc576db
--- /dev/null
+++ b/target/linux/bmips/image/bcm6368.mk
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+define Device/comtrend_vr-3025u
+ $(Device/bcm63xx-cfe)
+ DEVICE_VENDOR := Comtrend
+ DEVICE_MODEL := VR-3025u
+ CHIP_ID := 6368
+ CFE_BOARD_ID := 96368M-1541N
+ BLOCKSIZE := 0x20000
+ FLASH_MB := 32
+ DEVICE_PACKAGES += $(USB2_PACKAGES) $(B43_PACKAGES) \
+ kmod-leds-gpio
+endef
+TARGET_DEVICES += comtrend_vr-3025u
diff --git a/target/linux/bmips/image/bcm63xx_generic.mk b/target/linux/bmips/image/bcm63xx_generic.mk
deleted file mode 100644
index 2c832fe8ba..0000000000
--- a/target/linux/bmips/image/bcm63xx_generic.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-
-DEVICE_VARS += CFE_BOARD_ID CFE_EXTRAS
-DEVICE_VARS += FLASH_MB IMAGE_OFFSET
-
-define Device/bcm63xx-cfe
- FILESYSTEMS := squashfs jffs2-64k jffs2-128k
- KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma
- KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-lzma elf
- KERNEL_INITRAMFS_SUFFIX := .elf
- IMAGES := cfe.bin sysupgrade.bin
- IMAGE/cfe.bin := \
- cfe-bin $$$$(if $$$$(FLASH_MB),--pad $$$$(shell expr $$$$(FLASH_MB) / 2))
- IMAGE/sysupgrade.bin := cfe-bin | append-metadata
- BLOCKSIZE := 0x10000
- IMAGE_OFFSET :=
- FLASH_MB :=
- CFE_BOARD_ID :=
- CFE_EXTRAS = --block-size $$(BLOCKSIZE) \
- --image-offset $$(if $$(IMAGE_OFFSET),$$(IMAGE_OFFSET),$$(BLOCKSIZE))
-endef
-
-# Legacy CFEs with specific LZMA parameters and no length
-define Device/bcm63xx-cfe-legacy
- $(Device/bcm63xx-cfe)
- KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma-cfe
-endef
-
-define Device/comtrend_ar-5315u
- $(Device/bcm63xx-cfe)
- DEVICE_VENDOR := Comtrend
- DEVICE_MODEL := AR-5315u
- CHIP_ID := 6318
- CFE_BOARD_ID := 96318A-1441N1
- FLASH_MB := 16
- DEVICE_PACKAGES += $(USB2_PACKAGES) $(B43_PACKAGES) \
- kmod-leds-bcm6328
-endef
-TARGET_DEVICES += comtrend_ar-5315u
-
-define Device/comtrend_ar-5387un
- $(Device/bcm63xx-cfe)
- DEVICE_VENDOR := Comtrend
- DEVICE_MODEL := AR-5387un
- CHIP_ID := 6328
- CFE_BOARD_ID := 96328A-1441N1
- FLASH_MB := 16
- DEVICE_PACKAGES += $(USB2_PACKAGES) $(B43_PACKAGES) \
- kmod-leds-bcm6328
-endef
-TARGET_DEVICES += comtrend_ar-5387un
-
-define Device/comtrend_vr-3025u
- $(Device/bcm63xx-cfe)
- DEVICE_VENDOR := Comtrend
- DEVICE_MODEL := VR-3025u
- CHIP_ID := 6368
- CFE_BOARD_ID := 96368M-1541N
- BLOCKSIZE := 0x20000
- FLASH_MB := 32
- DEVICE_PACKAGES += $(USB2_PACKAGES) $(B43_PACKAGES) \
- kmod-leds-gpio
-endef
-TARGET_DEVICES += comtrend_vr-3025u
-
-define Device/huawei_hg556a-b
- $(Device/bcm63xx-cfe-legacy)
- DEVICE_VENDOR := Huawei
- DEVICE_MODEL := EchoLife HG556a
- DEVICE_VARIANT := B
- CHIP_ID := 6358
- CFE_BOARD_ID := HW556
- CFE_EXTRAS += --rsa-signature "EchoLife_HG556a" --tag-version 8
- BLOCKSIZE := 0x20000
- DEVICE_PACKAGES += $(USB2_PACKAGES) $(ATH9K_PACKAGES) \
- kmod-leds-gpio
-endef
-TARGET_DEVICES += huawei_hg556a-b
diff --git a/target/linux/bmips/image/bcm63xx_nand.mk b/target/linux/bmips/image/bcm63xx_nand.mk
deleted file mode 100644
index 732a5accdc..0000000000
--- a/target/linux/bmips/image/bcm63xx_nand.mk
+++ /dev/null
@@ -1,168 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-
-DEVICE_VARS += CFE_PART_FLAGS CFE_PART_ID
-DEVICE_VARS += CFE_RAM_FILE
-DEVICE_VARS += CFE_RAM_JFFS2_NAME CFE_RAM_JFFS2_PAD
-DEVICE_VARS += CFE_WFI_CHIP_ID CFE_WFI_FLASH_TYPE
-DEVICE_VARS += CFE_WFI_FLAGS CFE_WFI_VERSION
-DEVICE_VARS += SERCOMM_FSVER SERCOMM_HWVER SERCOMM_SWVER
-
-# CFE expects a single JFFS2 partition with cferam and kernel. However,
-# it's possible to fool CFE into properly loading both cferam and kernel
-# from two different JFFS2 partitions by adding dummy files (see
-# cfe-jffs2-cferam and cfe-jffs2-kernel).
-# Separate JFFS2 partitions allow upgrading openwrt without reflashing cferam
-# JFFS2 partition, which is much safer in case anything goes wrong.
-define Device/bcm63xx-nand
- FILESYSTEMS := squashfs ubifs
- KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | cfe-jffs2-kernel
- KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-lzma elf
- KERNEL_INITRAMFS_SUFFIX := .elf
- IMAGES := cfe.bin sysupgrade.bin
- IMAGE/cfe.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) |\
- cfe-jffs2-cferam | append-ubi | cfe-wfi-tag
- IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
- KERNEL_SIZE := 5120k
- CFE_PART_FLAGS :=
- CFE_PART_ID :=
- CFE_RAM_FILE :=
- CFE_RAM_JFFS2_NAME :=
- CFE_RAM_JFFS2_PAD :=
- CFE_WFI_VERSION :=
- CFE_WFI_CHIP_ID = 0x$$(CHIP_ID)
- CFE_WFI_FLASH_TYPE :=
- CFE_WFI_FLAGS :=
- UBINIZE_OPTS := -E 5
- DEVICE_PACKAGES += nand-utils
-endef
-
-define Device/sercomm-nand
- $(Device/bcm63xx-nand)
- IMAGES := factory.img sysupgrade.bin
- IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi |\
- cfe-sercomm-part | gzip | cfe-sercomm-load | cfe-sercomm-crypto
- SERCOMM_FSVER :=
- SERCOMM_HWVER :=
- SERCOMM_SWVER :=
-endef
-
-define Device/comtrend_vr-3032u
- $(Device/bcm63xx-nand)
- DEVICE_VENDOR := Comtrend
- DEVICE_MODEL := VR-3032u
- CHIP_ID := 63268
- SOC := bcm63168
- CFE_RAM_FILE := comtrend,vr-3032u/cferam.000
- CFE_RAM_JFFS2_NAME := cferam.000
- BLOCKSIZE := 128k
- PAGESIZE := 2048
- SUBPAGESIZE := 512
- VID_HDR_OFFSET := 2048
- DEVICE_PACKAGES += $(USB2_PACKAGES) \
- kmod-leds-bcm6328
- CFE_WFI_FLASH_TYPE := 3
- CFE_WFI_VERSION := 0x5732
-endef
-TARGET_DEVICES += comtrend_vr-3032u
-
-define Device/huawei_hg253s-v2
- $(Device/bcm63xx-nand)
- IMAGES := flash.bin sysupgrade.bin
- IMAGE/flash.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | cfe-jffs2-cferam | append-ubi
- DEVICE_VENDOR := Huawei
- DEVICE_MODEL := HG253s
- DEVICE_VARIANT := v2
- CHIP_ID := 6362
- CFE_PART_FLAGS := 1
- CFE_PART_ID := 0x0001EFEE
- CFE_RAM_FILE := huawei,hg253s-v2/cferam.000
- CFE_RAM_JFFS2_NAME := cferam.000
- BLOCKSIZE := 128k
- PAGESIZE := 2048
- SUBPAGESIZE := 512
- VID_HDR_OFFSET := 2048
- DEVICE_PACKAGES += $(USB2_PACKAGES) \
- kmod-leds-bcm6328 kmod-leds-gpio
- CFE_WFI_FLASH_TYPE := 3
-endef
-TARGET_DEVICES += huawei_hg253s-v2
-
-define Device/netgear_dgnd3700-v2
- $(Device/bcm63xx-nand)
- DEVICE_VENDOR := NETGEAR
- DEVICE_MODEL := DGND3700
- DEVICE_VARIANT := v2
- CHIP_ID := 6362
- CFE_RAM_FILE := netgear,dgnd3700-v2/cferam
- CFE_RAM_JFFS2_NAME := cferam
- CFE_RAM_JFFS2_PAD := 496k
- BLOCKSIZE := 16k
- PAGESIZE := 512
- DEVICE_PACKAGES += $(USB2_PACKAGES) $(B43_PACKAGES) \
- kmod-leds-bcm6328 kmod-leds-gpio
- CFE_WFI_FLASH_TYPE := 2
- CFE_WFI_VERSION := 0x5731
-endef
-TARGET_DEVICES += netgear_dgnd3700-v2
-
-define Device/sercomm_h500-s-lowi
- $(Device/sercomm-nand)
- DEVICE_VENDOR := Sercomm
- DEVICE_MODEL := H500-s
- DEVICE_VARIANT := lowi
- DEVICE_LOADADDR := $(KERNEL_LOADADDR)
- KERNEL := kernel-bin | append-dtb | lzma | cfe-jffs2-kernel
- CHIP_ID := 63268
- SOC := bcm63167
- BLOCKSIZE := 128k
- PAGESIZE := 2048
- SUBPAGESIZE := 512
- VID_HDR_OFFSET := 2048
- DEVICE_PACKAGES += $(USB2_PACKAGES) \
- kmod-leds-bcm6328
- SERCOMM_FSVER := 1001
- SERCOMM_HWVER := 1434b31
- SERCOMM_SWVER := 3305
-endef
-TARGET_DEVICES += sercomm_h500-s-lowi
-
-define Device/sercomm_h500-s-vfes
- $(Device/sercomm-nand)
- DEVICE_VENDOR := Sercomm
- DEVICE_MODEL := H500-s
- DEVICE_VARIANT := vfes
- DEVICE_LOADADDR := $(KERNEL_LOADADDR)
- KERNEL := kernel-bin | append-dtb | lzma | cfe-jffs2-kernel
- CHIP_ID := 63268
- SOC := bcm63167
- BLOCKSIZE := 128k
- PAGESIZE := 2048
- SUBPAGESIZE := 512
- VID_HDR_OFFSET := 2048
- DEVICE_PACKAGES += $(USB2_PACKAGES) \
- kmod-leds-bcm6328
- SERCOMM_FSVER := 1001
- SERCOMM_HWVER := 142584b
- SERCOMM_SWVER := 3417
-endef
-TARGET_DEVICES += sercomm_h500-s-vfes
-
-define Device/sercomm_shg2500
- $(Device/sercomm-nand)
- DEVICE_VENDOR := Sercomm
- DEVICE_MODEL := SHG2500
- DEVICE_LOADADDR := $(KERNEL_LOADADDR)
- KERNEL := kernel-bin | append-dtb | lzma | cfe-jffs2-kernel
- CHIP_ID := 63268
- SOC := bcm63168
- BLOCKSIZE := 128k
- PAGESIZE := 2048
- SUBPAGESIZE := 512
- VID_HDR_OFFSET := 2048
- DEVICE_PACKAGES += $(USB2_PACKAGES) kmod-i2c-gpio \
- kmod-leds-sercomm-msp430
- SERCOMM_FSVER := 1001
- SERCOMM_HWVER := 1424e4a
- SERCOMM_SWVER := 3207
-endef
-TARGET_DEVICES += sercomm_shg2500
diff --git a/target/linux/bmips/nand/base-files/etc/board.d/01_leds b/target/linux/bmips/nand/base-files/etc/board.d/01_leds
deleted file mode 100644
index 3461eca10c..0000000000
--- a/target/linux/bmips/nand/base-files/etc/board.d/01_leds
+++ /dev/null
@@ -1,16 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-
-. /lib/functions/leds.sh
-. /lib/functions/uci-defaults.sh
-
-board_config_update
-
-led_usb="$(get_dt_led usb)"
-[ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1"
-
-led_usb2="$(get_dt_led usb2)"
-[ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1"
-
-board_config_flush
-
-exit 0
diff --git a/target/linux/bmips/nand/config-default b/target/linux/bmips/nand/config-default
deleted file mode 100644
index eeb45b82f1..0000000000
--- a/target/linux/bmips/nand/config-default
+++ /dev/null
@@ -1,27 +0,0 @@
-CONFIG_CRC16=y
-CONFIG_CRYPTO_ACOMP2=y
-CONFIG_CRYPTO_DEFLATE=y
-CONFIG_CRYPTO_HASH_INFO=y
-CONFIG_CRYPTO_LZO=y
-CONFIG_CRYPTO_ZSTD=y
-CONFIG_JFFS2_FS_NAND=y
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-CONFIG_MTD_NAND_BRCMNAND=y
-CONFIG_MTD_NAND_CORE=y
-CONFIG_MTD_NAND_ECC_SW_HAMMING=y
-CONFIG_MTD_RAW_NAND=y
-CONFIG_MTD_SPLIT_BCM_WFI_FW=y
-CONFIG_MTD_UBI=y
-CONFIG_MTD_UBI_BEB_LIMIT=20
-CONFIG_MTD_UBI_BLOCK=y
-# CONFIG_MTD_UBI_FASTMAP is not set
-# CONFIG_MTD_UBI_GLUEBI is not set
-CONFIG_MTD_UBI_WL_THRESHOLD=4096
-CONFIG_SGL_ALLOC=y
-CONFIG_UBIFS_FS=y
-CONFIG_XXHASH=y
-CONFIG_ZLIB_DEFLATE=y
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZSTD_COMPRESS=y
-CONFIG_ZSTD_DECOMPRESS=y
diff --git a/target/linux/bmips/nand/target.mk b/target/linux/bmips/nand/target.mk
deleted file mode 100644
index da8ba0428a..0000000000
--- a/target/linux/bmips/nand/target.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-BOARDNAME:=nand
-FEATURES+=nand
-
-define Target/Description
- BMIPS boards with NAND support
-endef
More information about the lede-commits
mailing list