From cb6501435c3136c296e3477bc7f3b043e2a83a47 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 30 Aug 2022 10:57:26 +0200 Subject: [PATCH 01/10] mac80211: disable ft-over-ds by default Testing has shown it to be very unreliable in variety of configurations. It is not mandatory, so let's disable it by default until we have a better solution. Signed-off-by: Felix Fietkau (cherry-picked from commit 2984a0420649733662ff95b0aff720b8c2c19f8a) --- package/network/services/hostapd/files/hostapd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index e47ae46f98..3c08d55c5d 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -798,7 +798,7 @@ hostapd_set_bss_options() { json_get_vars mobility_domain ft_psk_generate_local ft_over_ds reassociation_deadline set_default mobility_domain "$(echo "$ssid" | md5sum | head -c 4)" - set_default ft_over_ds 1 + set_default ft_over_ds 0 set_default reassociation_deadline 1000 case "$auth_type" in From 4dca82b69c5b5b4d699d01c84a3a0d531fece653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 15 Mar 2022 14:30:20 +0100 Subject: [PATCH 02/10] uboot-bcm4908: update to the latest generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0625aad74d arm: dts: add ASUS GT-AX6000 6fb1cb624d arm: dts: add Netgear RAXE450 / RAXE550 Signed-off-by: Rafał Miłecki (cherry picked from commit 3592aa85664040a118654555afb78659af756a4e) --- package/boot/uboot-bcm4908/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/boot/uboot-bcm4908/Makefile b/package/boot/uboot-bcm4908/Makefile index dc862f4e32..b226096184 100644 --- a/package/boot/uboot-bcm4908/Makefile +++ b/package/boot/uboot-bcm4908/Makefile @@ -7,9 +7,9 @@ PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.openwrt.org/project/bcm63xx/u-boot.git -PKG_SOURCE_DATE:=2022-03-03 -PKG_SOURCE_VERSION:=92e9eca819c9c898d9d2010e1a217726c42c8c47 -PKG_MIRROR_HASH:=11c37fe4c18d55e799153600d1cfd8ee9ca7da8326d0024c1d825f4a327c5f0d +PKG_SOURCE_DATE:=2022-03-15 +PKG_SOURCE_VERSION:=0625aad74d1f5b6f9c068955ad3fd7f6df635e50 +PKG_MIRROR_HASH:=0602e0e4f101ead206940eccca832b75191905c1e81290340a89b07dbee7a6ce include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk From ee34451c4888e2f06a8991aa8ca4edf238b26744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 15 Mar 2022 18:41:03 +0100 Subject: [PATCH 03/10] uboot-bcm4908: add BCM4912 build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit f4c2dab544ec22fac6ab2de32aa5bb361c7566f7) --- package/boot/uboot-bcm4908/Makefile | 8 +++++++- .../200-configs-bcm94908-unset-CONFIG_SPL.patch | 14 +++++++++++++- ...support-for-ATF-when-compiling-U-Boot-wit.patch | 14 +++++++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/package/boot/uboot-bcm4908/Makefile b/package/boot/uboot-bcm4908/Makefile index b226096184..d6b689c9ce 100644 --- a/package/boot/uboot-bcm4908/Makefile +++ b/package/boot/uboot-bcm4908/Makefile @@ -25,8 +25,14 @@ define U-Boot/bcm4908 UBOOT_CONFIG:=bcm94908 endef +define U-Boot/bcm4912 + NAME:=Broadcom's BCM4912 + UBOOT_CONFIG:=bcm94912 +endef + UBOOT_TARGETS := \ - bcm4908 + bcm4908 \ + bcm4912 define Build/Prepare $(call Build/Prepare/Default) diff --git a/package/boot/uboot-bcm4908/patches/200-configs-bcm94908-unset-CONFIG_SPL.patch b/package/boot/uboot-bcm4908/patches/200-configs-bcm94908-unset-CONFIG_SPL.patch index 26189bc571..0b434f356a 100644 --- a/package/boot/uboot-bcm4908/patches/200-configs-bcm94908-unset-CONFIG_SPL.patch +++ b/package/boot/uboot-bcm4908/patches/200-configs-bcm94908-unset-CONFIG_SPL.patch @@ -23,7 +23,8 @@ shipped with every firmware. Signed-off-by: Rafał Miłecki --- configs/bcm94908_defconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + configs/bcm94912_defconfig | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) --- a/configs/bcm94908_defconfig +++ b/configs/bcm94908_defconfig @@ -36,3 +37,14 @@ Signed-off-by: Rafał Miłecki CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_ENV_VARS_UBOOT_CONFIG=y CONFIG_TPL_SYS_MALLOC_F_LEN=0x11000 +--- a/configs/bcm94912_defconfig ++++ b/configs/bcm94912_defconfig +@@ -22,7 +22,7 @@ CONFIG_TPL_LIBCOMMON_SUPPORT=y + CONFIG_TPL_LIBGENERIC_SUPPORT=y + CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000 + CONFIG_NR_DRAM_BANKS=2 +-CONFIG_SPL=y ++# CONFIG_SPL is not set + CONFIG_SPL_LIBDISK_SUPPORT=y + CONFIG_ENV_VARS_UBOOT_CONFIG=y + CONFIG_TPL_SYS_MALLOC_F_LEN=0x10000 diff --git a/package/boot/uboot-bcm4908/patches/201-Assume-TPL-support-for-ATF-when-compiling-U-Boot-wit.patch b/package/boot/uboot-bcm4908/patches/201-Assume-TPL-support-for-ATF-when-compiling-U-Boot-wit.patch index 1e59705ac0..187ee96b18 100644 --- a/package/boot/uboot-bcm4908/patches/201-Assume-TPL-support-for-ATF-when-compiling-U-Boot-wit.patch +++ b/package/boot/uboot-bcm4908/patches/201-Assume-TPL-support-for-ATF-when-compiling-U-Boot-wit.patch @@ -19,8 +19,9 @@ deal with compiling SPL or TPL. Signed-off-by: Rafał Miłecki --- arch/arm/mach-bcmbca/bcm4908/cpu.c | 2 +- + arch/arm/mach-bcmbca/bcm4912/cpu.c | 2 +- board/broadcom/bcmbca/board.c | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) + 3 files changed, 4 insertions(+), 4 deletions(-) --- a/arch/arm/mach-bcmbca/bcm4908/cpu.c +++ b/arch/arm/mach-bcmbca/bcm4908/cpu.c @@ -33,6 +34,17 @@ Signed-off-by: Rafał Miłecki void boot_secondary_cpu(unsigned long vector) { uint32_t cpu, nr_cpus = QUAD_CPUS; +--- a/arch/arm/mach-bcmbca/bcm4912/cpu.c ++++ b/arch/arm/mach-bcmbca/bcm4912/cpu.c +@@ -174,7 +174,7 @@ int bcmbca_get_boot_device(void) + return BOOT_DEVICE_NONE; + } + +-#if !defined(CONFIG_TPL_ATF) ++#if defined(CONFIG_TPL) && !defined(CONFIG_TPL_ATF) + void boot_secondary_cpu(unsigned long vector) + { + uint32_t cpu, nr_cpus = 4; --- a/board/broadcom/bcmbca/board.c +++ b/board/broadcom/bcmbca/board.c @@ -103,7 +103,7 @@ void board_spinor_init(void) From 5a31942f203ce4ae0fbeb70e8bc67ce65d8411dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 20 Jul 2022 13:47:06 +0200 Subject: [PATCH 04/10] uboot-bcm4908: include SoC in output files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes problem of overwriting BCM4908 U-Boot and DTB files by BCM4912 ones. That bug didn't allow booting BCM4908 devices. Fixes: f4c2dab544ec2 ("uboot-bcm4908: add BCM4912 build") Signed-off-by: Rafał Miłecki (cherry picked from commit a8e1e30543239e85ff5dc220368164b66cf73fba) --- package/boot/uboot-bcm4908/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/boot/uboot-bcm4908/Makefile b/package/boot/uboot-bcm4908/Makefile index d6b689c9ce..7eacd23a02 100644 --- a/package/boot/uboot-bcm4908/Makefile +++ b/package/boot/uboot-bcm4908/Makefile @@ -23,11 +23,13 @@ endef define U-Boot/bcm4908 NAME:=Broadcom's BCM4908 UBOOT_CONFIG:=bcm94908 + SOC:=bcm4908 endef define U-Boot/bcm4912 NAME:=Broadcom's BCM4912 UBOOT_CONFIG:=bcm94912 + SOC:=bcm4912 endef UBOOT_TARGETS := \ @@ -46,8 +48,8 @@ endef define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE)/u-boot - $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/u-boot/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/u-boot.dtb $(STAGING_DIR_IMAGE)/u-boot/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/u-boot/u-boot-$(SOC).bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/u-boot.dtb $(STAGING_DIR_IMAGE)/u-boot/u-boot-$(SOC).dtb $(INSTALL_BIN) $(PKG_BUILD_DIR)/arch/arm/dts/*.dtb $(STAGING_DIR_IMAGE)/u-boot/ endef From 114fc3620d3a6c556ec6b151350d59d83e7ebaa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 15 Mar 2022 18:42:15 +0100 Subject: [PATCH 05/10] bcm4908: include U-Boot DTB files for ASUS GT-AX6000 & Netgear RAX220 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit 2de86691b67ea73d858ec1c78757faae795691e4) --- target/linux/bcm4908/image/bootfs-generic.its | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/target/linux/bcm4908/image/bootfs-generic.its b/target/linux/bcm4908/image/bootfs-generic.its index bd566d5d22..d32e094eb5 100644 --- a/target/linux/bcm4908/image/bootfs-generic.its +++ b/target/linux/bcm4908/image/bootfs-generic.its @@ -62,6 +62,28 @@ }; }; + fdt_GTAX6000 { + description = "dtb"; + data = /incbin/("${images_dir}/u-boot/GTAX6000.dtb"); + type = "flat_dt"; + compression = "none"; + + hash-1 { + algo = "sha256"; + }; + }; + + fdt_uboot_RAX220 { + description = "dtb"; + data = /incbin/("${images_dir}/u-boot/RAX220.dtb"); + type = "flat_dt"; + compression = "none"; + + hash-1 { + algo = "sha256"; + }; + }; + fdt_linux_RAX220 { description = "dtb"; data = /incbin/("${dts_dir}/broadcom/bcm4908/bcm4908-netgear-raxe500.dtb"); @@ -80,6 +102,18 @@ loadables = "atf", "uboot"; }; + conf_ub_GTAX6000 { + description = "GTAX6000"; + fdt = "fdt_GTAX6000"; + loadables = "atf", "uboot"; + }; + + conf_ub_RAX220 { + description = "RAX220"; + fdt = "fdt_uboot_RAX220"; + loadables = "atf", "uboot"; + }; + conf_lx_RAX220 { description = "BRCM 63xxx linux"; kernel = "kernel"; From 1727e356f0c42222cefdb357d79c1c222a1defba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 20 Jul 2022 18:12:31 +0200 Subject: [PATCH 06/10] bcm4908: backport bcmbca DT patches queued for 5.20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit d63ef7c90f75393270ec4f5ff1b2563d6bd52066) --- ...dd-DTS-files-for-bcmbca-SoC-BCM63158.patch | 199 ++++++++++++++++++ ...Add-DTS-files-for-bcmbca-SoC-BCM4912.patch | 191 +++++++++++++++++ ...Add-DTS-files-for-bcmbca-SoC-BCM6858.patch | 184 ++++++++++++++++ ...dd-DTS-files-for-bcmbca-SoC-BCM63146.patch | 174 +++++++++++++++ ...Add-DTS-files-for-bcmbca-SoC-BCM6856.patch | 167 +++++++++++++++ ...Add-DTS-files-for-bcmbca-SoC-BCM6813.patch | 192 +++++++++++++++++ ...m-align-gpio-key-node-names-with-dt.patch} | 0 ...m-bcm4908-Fix-timer-node-for-BCM490.patch} | 0 ...m-bcm4908-Fix-cpu-node-for-smp-boot.patch} | 0 ...se-DTS-file-for-bcmbca-device-Asus-G.patch | 54 +++++ 10 files changed, 1161 insertions(+) create mode 100644 target/linux/bcm4908/patches-5.4/037-v5.20-0001-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63158.patch create mode 100644 target/linux/bcm4908/patches-5.4/037-v5.20-0002-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM4912.patch create mode 100644 target/linux/bcm4908/patches-5.4/037-v5.20-0003-ARM64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6858.patch create mode 100644 target/linux/bcm4908/patches-5.4/037-v5.20-0004-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63146.patch create mode 100644 target/linux/bcm4908/patches-5.4/037-v5.20-0005-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6856.patch create mode 100644 target/linux/bcm4908/patches-5.4/037-v5.20-0006-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6813.patch rename target/linux/bcm4908/patches-5.4/{037-v5.20-0001-arm64-dts-broadcom-align-gpio-key-node-names-with-dt.patch => 037-v5.20-0007-arm64-dts-broadcom-align-gpio-key-node-names-with-dt.patch} (100%) rename target/linux/bcm4908/patches-5.4/{037-v5.20-0002-arm64-dts-broadcom-bcm4908-Fix-timer-node-for-BCM490.patch => 037-v5.20-0008-arm64-dts-broadcom-bcm4908-Fix-timer-node-for-BCM490.patch} (100%) rename target/linux/bcm4908/patches-5.4/{037-v5.20-0003-arm64-dts-broadcom-bcm4908-Fix-cpu-node-for-smp-boot.patch => 037-v5.20-0009-arm64-dts-broadcom-bcm4908-Fix-cpu-node-for-smp-boot.patch} (100%) create mode 100644 target/linux/bcm4908/patches-5.4/037-v5.20-0010-arm64-dts-Add-base-DTS-file-for-bcmbca-device-Asus-G.patch diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0001-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63158.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0001-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63158.patch new file mode 100644 index 0000000000..81bc06eb3d --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/037-v5.20-0001-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63158.patch @@ -0,0 +1,199 @@ +From 076dcedc6628c6bf92bd17bfcf8fb7b1af62bfb6 Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 1 Jun 2022 15:56:51 -0700 +Subject: [PATCH] arm64: dts: Add DTS files for bcmbca SoC BCM63158 + +Add DTS for ARMv8 based broadband SoC BCM63158. bcm63158.dtsi is the +SoC description DTS header and bcm963158.dts is a simple DTS file for +Broadcom BCM963158 Reference board that only enable the UART port. + +Signed-off-by: William Zhang +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/Makefile | 1 + + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 2 + + .../boot/dts/broadcom/bcmbca/bcm63158.dtsi | 128 ++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm963158.dts | 30 ++++ + 4 files changed, 161 insertions(+) + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/Makefile + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts + +--- a/arch/arm64/boot/dts/broadcom/Makefile ++++ b/arch/arm64/boot/dts/broadcom/Makefile +@@ -5,5 +5,6 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rp + bcm2837-rpi-cm3-io3.dtb + + subdir-y += bcm4908 ++subdir-y += bcmbca + subdir-y += northstar2 + subdir-y += stingray +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -0,0 +1,2 @@ ++# SPDX-License-Identifier: GPL-2.0 ++dtb-$(CONFIG_ARCH_BCMBCA) += bcm963158.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi +@@ -0,0 +1,128 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++#include ++#include ++ ++/ { ++ compatible = "brcm,bcm63158", "brcm,bcmbca"; ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ++ interrupt-parent = <&gic>; ++ ++ cpus { ++ #address-cells = <2>; ++ #size-cells = <0>; ++ ++ B53_0: cpu@0 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x0>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_1: cpu@1 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x1>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_2: cpu@2 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x2>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_3: cpu@3 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x3>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ L2_0: l2-cache0 { ++ compatible = "cache"; ++ }; ++ }; ++ ++ timer { ++ compatible = "arm,armv8-timer"; ++ interrupts = , ++ , ++ , ++ ; ++ }; ++ ++ pmu: pmu { ++ compatible = "arm,cortex-a53-pmu"; ++ interrupts = , ++ , ++ , ++ ; ++ interrupt-affinity = <&B53_0>, <&B53_1>, ++ <&B53_2>, <&B53_3>; ++ }; ++ ++ clocks: clocks { ++ periph_clk: periph-clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; ++ uart_clk: uart-clk { ++ compatible = "fixed-factor-clock"; ++ #clock-cells = <0>; ++ clocks = <&periph_clk>; ++ clock-div = <4>; ++ clock-mult = <1>; ++ }; ++ }; ++ ++ psci { ++ compatible = "arm,psci-0.2"; ++ method = "smc"; ++ }; ++ ++ axi@81000000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0x81000000 0x8000>; ++ ++ gic: interrupt-controller@1000 { ++ compatible = "arm,gic-400"; ++ #interrupt-cells = <3>; ++ interrupt-controller; ++ interrupts = ; ++ reg = <0x1000 0x1000>, ++ <0x2000 0x2000>, ++ <0x4000 0x2000>, ++ <0x6000 0x2000>; ++ }; ++ }; ++ ++ bus@ff800000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0xff800000 0x800000>; ++ ++ uart0: serial@12000 { ++ compatible = "arm,pl011", "arm,primecell"; ++ reg = <0x12000 0x1000>; ++ interrupts = ; ++ clocks = <&uart_clk>, <&uart_clk>; ++ clock-names = "uartclk", "apb_pclk"; ++ status = "disabled"; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts +@@ -0,0 +1,30 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++/dts-v1/; ++ ++#include "bcm63158.dtsi" ++ ++/ { ++ model = "Broadcom BCM963158 Reference Board"; ++ compatible = "brcm,bcm963158", "brcm,bcm63158", "brcm,bcmbca"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x08000000>; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0002-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM4912.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0002-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM4912.patch new file mode 100644 index 0000000000..5cdb9d1df1 --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/037-v5.20-0002-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM4912.patch @@ -0,0 +1,191 @@ +From 1ba56aeb391401c4cb2126c39f90b3cdbfabdb3f Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 1 Jun 2022 13:17:34 -0700 +Subject: [PATCH] arm64: dts: Add DTS files for bcmbca SoC BCM4912 + +Add DTS for ARMv8 based broadband SoC BCM4912. bcm4912.dtsi is the +SoC description DTS header and bcm94912.dts is a simple DTS file for +Broadcom BCM94912 Reference board that only enable the UART port. + +Signed-off-by: William Zhang +Acked-by: Krzysztof Kozlowski +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 3 +- + .../boot/dts/broadcom/bcmbca/bcm4912.dtsi | 128 ++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm94912.dts | 30 ++++ + 3 files changed, 160 insertions(+), 1 deletion(-) + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -1,2 +1,3 @@ + # SPDX-License-Identifier: GPL-2.0 +-dtb-$(CONFIG_ARCH_BCMBCA) += bcm963158.dtb ++dtb-$(CONFIG_ARCH_BCMBCA) += bcm94912.dtb \ ++ bcm963158.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi +@@ -0,0 +1,128 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++#include ++#include ++ ++/ { ++ compatible = "brcm,bcm4912", "brcm,bcmbca"; ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ++ interrupt-parent = <&gic>; ++ ++ cpus { ++ #address-cells = <2>; ++ #size-cells = <0>; ++ ++ B53_0: cpu@0 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x0>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_1: cpu@1 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x1>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_2: cpu@2 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x2>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_3: cpu@3 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x3>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ L2_0: l2-cache0 { ++ compatible = "cache"; ++ }; ++ }; ++ ++ timer { ++ compatible = "arm,armv8-timer"; ++ interrupts = , ++ , ++ , ++ ; ++ }; ++ ++ pmu: pmu { ++ compatible = "arm,cortex-a53-pmu"; ++ interrupts = , ++ , ++ , ++ ; ++ interrupt-affinity = <&B53_0>, <&B53_1>, ++ <&B53_2>, <&B53_3>; ++ }; ++ ++ clocks: clocks { ++ periph_clk: periph-clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; ++ uart_clk: uart-clk { ++ compatible = "fixed-factor-clock"; ++ #clock-cells = <0>; ++ clocks = <&periph_clk>; ++ clock-div = <4>; ++ clock-mult = <1>; ++ }; ++ }; ++ ++ psci { ++ compatible = "arm,psci-0.2"; ++ method = "smc"; ++ }; ++ ++ axi@81000000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0x81000000 0x8000>; ++ ++ gic: interrupt-controller@1000 { ++ compatible = "arm,gic-400"; ++ #interrupt-cells = <3>; ++ interrupt-controller; ++ interrupts = ; ++ reg = <0x1000 0x1000>, ++ <0x2000 0x2000>, ++ <0x4000 0x2000>, ++ <0x6000 0x2000>; ++ }; ++ }; ++ ++ bus@ff800000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0xff800000 0x800000>; ++ ++ uart0: serial@12000 { ++ compatible = "arm,pl011", "arm,primecell"; ++ reg = <0x12000 0x1000>; ++ interrupts = ; ++ clocks = <&uart_clk>, <&uart_clk>; ++ clock-names = "uartclk", "apb_pclk"; ++ status = "disabled"; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts +@@ -0,0 +1,30 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4912.dtsi" ++ ++/ { ++ model = "Broadcom BCM94912 Reference Board"; ++ compatible = "brcm,bcm94912", "brcm,bcm4912", "brcm,bcmbca"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x08000000>; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0003-ARM64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6858.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0003-ARM64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6858.patch new file mode 100644 index 0000000000..f10a44f890 --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/037-v5.20-0003-ARM64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6858.patch @@ -0,0 +1,184 @@ +From e663e06bd3f21e64bc2163910f626af68add6308 Mon Sep 17 00:00:00 2001 +From: Anand Gore +Date: Wed, 1 Jun 2022 13:19:56 -0700 +Subject: [PATCH] ARM64: dts: Add DTS files for bcmbca SoC BCM6858 + +Add DTS for ARMv8 based broadband SoC BCM6858. bcm6858.dtsi is the SoC +description DTS header and bcm96858.dts is a simple DTS file for +Broadcom BCM96858 Reference board that only enables the UART port. + +Signed-off-by: Anand Gore +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 3 +- + .../boot/dts/broadcom/bcmbca/bcm6858.dtsi | 121 ++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm96858.dts | 30 +++++ + 3 files changed, 153 insertions(+), 1 deletion(-) + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -1,3 +1,4 @@ + # SPDX-License-Identifier: GPL-2.0 + dtb-$(CONFIG_ARCH_BCMBCA) += bcm94912.dtb \ +- bcm963158.dtb ++ bcm963158.dtb \ ++ bcm96858.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi +@@ -0,0 +1,121 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++#include ++#include ++ ++/ { ++ compatible = "brcm,bcm6858", "brcm,bcmbca"; ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ++ interrupt-parent = <&gic>; ++ ++ cpus { ++ #address-cells = <2>; ++ #size-cells = <0>; ++ ++ B53_0: cpu@0 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x0>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_1: cpu@1 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x1>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_2: cpu@2 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x2>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_3: cpu@3 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x3>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ L2_0: l2-cache0 { ++ compatible = "cache"; ++ }; ++ }; ++ ++ timer { ++ compatible = "arm,armv8-timer"; ++ interrupts = , ++ , ++ , ++ ; ++ }; ++ ++ pmu: pmu { ++ compatible = "arm,armv8-pmuv3"; ++ interrupts = , ++ , ++ , ++ ; ++ interrupt-affinity = <&B53_0>, <&B53_1>, ++ <&B53_2>, <&B53_3>; ++ }; ++ ++ clocks: clocks { ++ periph_clk:periph-clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; ++ }; ++ ++ psci { ++ compatible = "arm,psci-0.2"; ++ method = "smc"; ++ }; ++ ++ axi@81000000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0x81000000 0x8000>; ++ ++ gic: interrupt-controller@1000 { ++ compatible = "arm,gic-400"; ++ #interrupt-cells = <3>; ++ interrupt-controller; ++ reg = <0x1000 0x1000>, /* GICD */ ++ <0x2000 0x2000>, /* GICC */ ++ <0x4000 0x2000>, /* GICH */ ++ <0x6000 0x2000>; /* GICV */ ++ interrupts = ; ++ }; ++ }; ++ ++ bus@ff800000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0xff800000 0x62000>; ++ ++ uart0: serial@640 { ++ compatible = "brcm,bcm6345-uart"; ++ reg = <0x640 0x18>; ++ interrupts = ; ++ clocks = <&periph_clk>; ++ clock-names = "refclk"; ++ status = "disabled"; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts +@@ -0,0 +1,30 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++/dts-v1/; ++ ++#include "bcm6858.dtsi" ++ ++/ { ++ model = "Broadcom BCM96858 Reference Board"; ++ compatible = "brcm,bcm96858", "brcm,bcm6858", "brcm,bcmbca"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x08000000>; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0004-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63146.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0004-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63146.patch new file mode 100644 index 0000000000..793c5af738 --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/037-v5.20-0004-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63146.patch @@ -0,0 +1,174 @@ +From 82a58061ada60058ec00113c179380f945914709 Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 8 Jun 2022 11:00:59 -0700 +Subject: [PATCH] arm64: dts: Add DTS files for bcmbca SoC BCM63146 + +Add DTS for ARMv8 based broadband SoC BCM63146. bcm63146.dtsi is the +SoC description DTS header and bcm963146.dts is a simple DTS file for +Broadcom BCM963146 Reference board that only enable the UART port. + +Signed-off-by: William Zhang +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 3 +- + .../boot/dts/broadcom/bcmbca/bcm63146.dtsi | 110 ++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm963146.dts | 30 +++++ + 3 files changed, 142 insertions(+), 1 deletion(-) + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -1,4 +1,5 @@ + # SPDX-License-Identifier: GPL-2.0 + dtb-$(CONFIG_ARCH_BCMBCA) += bcm94912.dtb \ + bcm963158.dtb \ +- bcm96858.dtb ++ bcm96858.dtb \ ++ bcm963146.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi +@@ -0,0 +1,110 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++#include ++#include ++ ++/ { ++ compatible = "brcm,bcm63146", "brcm,bcmbca"; ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ++ interrupt-parent = <&gic>; ++ ++ cpus { ++ #address-cells = <2>; ++ #size-cells = <0>; ++ ++ B53_0: cpu@0 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x0>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_1: cpu@1 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x1>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ L2_0: l2-cache0 { ++ compatible = "cache"; ++ }; ++ }; ++ ++ timer { ++ compatible = "arm,armv8-timer"; ++ interrupts = , ++ , ++ , ++ ; ++ }; ++ ++ pmu: pmu { ++ compatible = "arm,cortex-a53-pmu"; ++ interrupts = , ++ ; ++ interrupt-affinity = <&B53_0>, <&B53_1>; ++ }; ++ ++ clocks: clocks { ++ periph_clk: periph-clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; ++ uart_clk: uart-clk { ++ compatible = "fixed-factor-clock"; ++ #clock-cells = <0>; ++ clocks = <&periph_clk>; ++ clock-div = <4>; ++ clock-mult = <1>; ++ }; ++ }; ++ ++ psci { ++ compatible = "arm,psci-0.2"; ++ method = "smc"; ++ }; ++ ++ axi@81000000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0x81000000 0x8000>; ++ ++ gic: interrupt-controller@1000 { ++ compatible = "arm,gic-400"; ++ #interrupt-cells = <3>; ++ interrupt-controller; ++ reg = <0x1000 0x1000>, ++ <0x2000 0x2000>, ++ <0x4000 0x2000>, ++ <0x6000 0x2000>; ++ interrupts = ; ++ }; ++ }; ++ ++ bus@ff800000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0xff800000 0x800000>; ++ ++ uart0: serial@12000 { ++ compatible = "arm,pl011", "arm,primecell"; ++ reg = <0x12000 0x1000>; ++ interrupts = ; ++ clocks = <&uart_clk>, <&uart_clk>; ++ clock-names = "uartclk", "apb_pclk"; ++ status = "disabled"; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts +@@ -0,0 +1,30 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++/dts-v1/; ++ ++#include "bcm63146.dtsi" ++ ++/ { ++ model = "Broadcom BCM963146 Reference Board"; ++ compatible = "brcm,bcm963146", "brcm,bcm63146", "brcm,bcmbca"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x08000000>; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0005-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6856.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0005-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6856.patch new file mode 100644 index 0000000000..0fdafb7f17 --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/037-v5.20-0005-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6856.patch @@ -0,0 +1,167 @@ +From 64eca7ad058cff861b48cdead8dee40dfc284e9e Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Wed, 8 Jun 2022 11:04:36 -0700 +Subject: [PATCH] arm64: dts: Add DTS files for bcmbca SoC BCM6856 + +Add DTS for ARMv8 based broadband SoC BCM6856. bcm6856.dtsi is the +SoC description DTS header and bcm96856.dts is a simple DTS file for +Broadcom BCM96956 Reference board that only enable the UART port. + +Signed-off-by: William Zhang +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 3 +- + .../boot/dts/broadcom/bcmbca/bcm6856.dtsi | 103 ++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm96856.dts | 30 +++++ + 3 files changed, 135 insertions(+), 1 deletion(-) + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -2,4 +2,5 @@ + dtb-$(CONFIG_ARCH_BCMBCA) += bcm94912.dtb \ + bcm963158.dtb \ + bcm96858.dtb \ +- bcm963146.dtb ++ bcm963146.dtb \ ++ bcm96856.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi +@@ -0,0 +1,103 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++#include ++#include ++ ++/ { ++ compatible = "brcm,bcm6856", "brcm,bcmbca"; ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ++ interrupt-parent = <&gic>; ++ ++ cpus { ++ #address-cells = <2>; ++ #size-cells = <0>; ++ ++ B53_0: cpu@0 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x0>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_1: cpu@1 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x1>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ L2_0: l2-cache0 { ++ compatible = "cache"; ++ }; ++ }; ++ ++ timer { ++ compatible = "arm,armv8-timer"; ++ interrupts = , ++ , ++ , ++ ; ++ }; ++ ++ pmu: pmu { ++ compatible = "arm,cortex-a53-pmu"; ++ interrupts = , ++ ; ++ interrupt-affinity = <&B53_0>, <&B53_1>; ++ }; ++ ++ clocks: clocks { ++ periph_clk:periph-clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; ++ }; ++ ++ psci { ++ compatible = "arm,psci-0.2"; ++ method = "smc"; ++ }; ++ ++ axi@81000000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0x81000000 0x8000>; ++ ++ gic: interrupt-controller@1000 { ++ compatible = "arm,gic-400"; ++ #interrupt-cells = <3>; ++ interrupt-controller; ++ reg = <0x1000 0x1000>, /* GICD */ ++ <0x2000 0x2000>, /* GICC */ ++ <0x4000 0x2000>, /* GICH */ ++ <0x6000 0x2000>; /* GICV */ ++ interrupts = ; ++ }; ++ }; ++ ++ bus@ff800000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0xff800000 0x800000>; ++ ++ uart0: serial@640 { ++ compatible = "brcm,bcm6345-uart"; ++ reg = <0x640 0x18>; ++ interrupts = ; ++ clocks = <&periph_clk>; ++ clock-names = "refclk"; ++ status = "disabled"; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts +@@ -0,0 +1,30 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++/dts-v1/; ++ ++#include "bcm6856.dtsi" ++ ++/ { ++ model = "Broadcom BCM96856 Reference Board"; ++ compatible = "brcm,bcm96856", "brcm,bcm6856", "brcm,bcmbca"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x08000000>; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0006-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6813.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0006-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6813.patch new file mode 100644 index 0000000000..58af85a68c --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/037-v5.20-0006-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6813.patch @@ -0,0 +1,192 @@ +From eab6bb0994b806525fc5e362e8b865f61c4a9e20 Mon Sep 17 00:00:00 2001 +From: William Zhang +Date: Thu, 9 Jun 2022 17:15:33 -0700 +Subject: [PATCH] arm64: dts: Add DTS files for bcmbca SoC BCM6813 + +Add DTS for ARMv8 based broadband SoC BCM6813. bcm6813.dtsi is the +SoC description DTS header and bcm96813.dts is a simple DTS file for +Broadcom BCM96813 Reference board that only enable the UART port. + +Signed-off-by: William Zhang +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 3 +- + .../boot/dts/broadcom/bcmbca/bcm6813.dtsi | 128 ++++++++++++++++++ + .../boot/dts/broadcom/bcmbca/bcm96813.dts | 30 ++++ + 3 files changed, 160 insertions(+), 1 deletion(-) + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -3,4 +3,5 @@ dtb-$(CONFIG_ARCH_BCMBCA) += bcm94912.dt + bcm963158.dtb \ + bcm96858.dtb \ + bcm963146.dtb \ +- bcm96856.dtb ++ bcm96856.dtb \ ++ bcm96813.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi +@@ -0,0 +1,128 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++#include ++#include ++ ++/ { ++ compatible = "brcm,bcm6813", "brcm,bcmbca"; ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ++ interrupt-parent = <&gic>; ++ ++ cpus { ++ #address-cells = <2>; ++ #size-cells = <0>; ++ ++ B53_0: cpu@0 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x0>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_1: cpu@1 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x1>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_2: cpu@2 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x2>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ B53_3: cpu@3 { ++ compatible = "brcm,brahma-b53"; ++ device_type = "cpu"; ++ reg = <0x0 0x3>; ++ next-level-cache = <&L2_0>; ++ enable-method = "psci"; ++ }; ++ ++ L2_0: l2-cache0 { ++ compatible = "cache"; ++ }; ++ }; ++ ++ timer { ++ compatible = "arm,armv8-timer"; ++ interrupts = , ++ , ++ , ++ ; ++ }; ++ ++ pmu: pmu { ++ compatible = "arm,cortex-a53-pmu"; ++ interrupts = , ++ , ++ , ++ ; ++ interrupt-affinity = <&B53_0>, <&B53_1>, ++ <&B53_2>, <&B53_3>; ++ }; ++ ++ clocks: clocks { ++ periph_clk: periph-clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <200000000>; ++ }; ++ uart_clk: uart-clk { ++ compatible = "fixed-factor-clock"; ++ #clock-cells = <0>; ++ clocks = <&periph_clk>; ++ clock-div = <4>; ++ clock-mult = <1>; ++ }; ++ }; ++ ++ psci { ++ compatible = "arm,psci-0.2"; ++ method = "smc"; ++ }; ++ ++ axi@81000000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0x81000000 0x8000>; ++ ++ gic: interrupt-controller@1000 { ++ compatible = "arm,gic-400"; ++ #interrupt-cells = <3>; ++ interrupt-controller; ++ interrupts = ; ++ reg = <0x1000 0x1000>, ++ <0x2000 0x2000>, ++ <0x4000 0x2000>, ++ <0x6000 0x2000>; ++ }; ++ }; ++ ++ bus@ff800000 { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges = <0x0 0x0 0xff800000 0x800000>; ++ ++ uart0: serial@12000 { ++ compatible = "arm,pl011", "arm,primecell"; ++ reg = <0x12000 0x1000>; ++ interrupts = ; ++ clocks = <&uart_clk>, <&uart_clk>; ++ clock-names = "uartclk", "apb_pclk"; ++ status = "disabled"; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts +@@ -0,0 +1,30 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright 2022 Broadcom Ltd. ++ */ ++ ++/dts-v1/; ++ ++#include "bcm6813.dtsi" ++ ++/ { ++ model = "Broadcom BCM96813 Reference Board"; ++ compatible = "brcm,bcm96813", "brcm,bcm6813", "brcm,bcmbca"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x0 0x0 0x0 0x08000000>; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0001-arm64-dts-broadcom-align-gpio-key-node-names-with-dt.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0007-arm64-dts-broadcom-align-gpio-key-node-names-with-dt.patch similarity index 100% rename from target/linux/bcm4908/patches-5.4/037-v5.20-0001-arm64-dts-broadcom-align-gpio-key-node-names-with-dt.patch rename to target/linux/bcm4908/patches-5.4/037-v5.20-0007-arm64-dts-broadcom-align-gpio-key-node-names-with-dt.patch diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0002-arm64-dts-broadcom-bcm4908-Fix-timer-node-for-BCM490.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0008-arm64-dts-broadcom-bcm4908-Fix-timer-node-for-BCM490.patch similarity index 100% rename from target/linux/bcm4908/patches-5.4/037-v5.20-0002-arm64-dts-broadcom-bcm4908-Fix-timer-node-for-BCM490.patch rename to target/linux/bcm4908/patches-5.4/037-v5.20-0008-arm64-dts-broadcom-bcm4908-Fix-timer-node-for-BCM490.patch diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0003-arm64-dts-broadcom-bcm4908-Fix-cpu-node-for-smp-boot.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0009-arm64-dts-broadcom-bcm4908-Fix-cpu-node-for-smp-boot.patch similarity index 100% rename from target/linux/bcm4908/patches-5.4/037-v5.20-0003-arm64-dts-broadcom-bcm4908-Fix-cpu-node-for-smp-boot.patch rename to target/linux/bcm4908/patches-5.4/037-v5.20-0009-arm64-dts-broadcom-bcm4908-Fix-cpu-node-for-smp-boot.patch diff --git a/target/linux/bcm4908/patches-5.4/037-v5.20-0010-arm64-dts-Add-base-DTS-file-for-bcmbca-device-Asus-G.patch b/target/linux/bcm4908/patches-5.4/037-v5.20-0010-arm64-dts-Add-base-DTS-file-for-bcmbca-device-Asus-G.patch new file mode 100644 index 0000000000..6f71c8b5fb --- /dev/null +++ b/target/linux/bcm4908/patches-5.4/037-v5.20-0010-arm64-dts-Add-base-DTS-file-for-bcmbca-device-Asus-G.patch @@ -0,0 +1,54 @@ +From f3f575c4bef95384e68de552c7b29938fd0d9201 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 13 Jul 2022 22:03:51 +0200 +Subject: [PATCH] arm64: dts: Add base DTS file for bcmbca device Asus + GT-AX6000 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It's a home router with 1 GiB of RAM, 6 Ethernet ports, 2 USB ports. + +Signed-off-by: Rafał Miłecki +Acked-by: William Zhang +Link: https://lore.kernel.org/r/20220713200351.28526-2-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm64/boot/dts/broadcom/bcmbca/Makefile | 4 +++- + .../bcmbca/bcm4912-asus-gt-ax6000.dts | 19 +++++++++++++++++++ + 2 files changed, 22 insertions(+), 1 deletion(-) + create mode 100644 arch/arm64/boot/dts/broadcom/bcmbca/bcm4912-asus-gt-ax6000.dts + +--- a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile +@@ -1,5 +1,7 @@ + # SPDX-License-Identifier: GPL-2.0 +-dtb-$(CONFIG_ARCH_BCMBCA) += bcm94912.dtb \ ++dtb-$(CONFIG_ARCH_BCMBCA) += \ ++ bcm4912-asus-gt-ax6000.dtb \ ++ bcm94912.dtb \ + bcm963158.dtb \ + bcm96858.dtb \ + bcm963146.dtb \ +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912-asus-gt-ax6000.dts +@@ -0,0 +1,19 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++/dts-v1/; ++ ++#include "bcm4912.dtsi" ++ ++/ { ++ compatible = "asus,gt-ax6000", "brcm,bcm4912", "brcm,bcmbca"; ++ model = "Asus GT-AX6000"; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00 0x00 0x00 0x40000000>; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; From 28ab4f395541ad4b969879042f58fd19d13a596a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 20 Jul 2022 20:03:56 +0200 Subject: [PATCH 07/10] bcm4908: prepare for Asus GT-AX6000 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It isn't tested & Linux DT will surely need more work. Signed-off-by: Rafał Miłecki (cherry picked from commit 3f2b2fe084c0019221a17e3217a01c41d003f6fd) --- target/linux/bcm4908/image/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/linux/bcm4908/image/Makefile b/target/linux/bcm4908/image/Makefile index 93a28b7e9d..ba7cdc3ae7 100644 --- a/target/linux/bcm4908/image/Makefile +++ b/target/linux/bcm4908/image/Makefile @@ -86,6 +86,16 @@ define Device/asus_gt-ac5300 endef TARGET_DEVICES += asus_gt-ac5300 +define Device/asus_gt-ax6000 + DEVICE_VENDOR := Asus + DEVICE_MODEL := GT-AX6000 + DEVICE_DTS := broadcom/bcmbca/bcm4912-asus-gt-ax6000 + IMAGES := pkgtb + IMAGE/pkgtb := append-rootfs | pkgtb + SOC := bcm4912 +endef +# TARGET_DEVICES += asus_gt-ax6000 + define Device/netgear_r8000p DEVICE_VENDOR := Netgear DEVICE_MODEL := R8000P From cc9c72529cdae95d03afdc6a52b9a24f6dedca90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 20 Jul 2022 13:47:05 +0200 Subject: [PATCH 08/10] bcm4908: build bootfs image per-SoC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In theory we could have just 1 bootfs image for all devices as each device has its own entry in the "configurations" node. It doesn't work well with default configuration though. If something goes wrong U-Boot SPL can be interrupted (by pressing A) to enter its minimalistic menu. It allows ignoring boardid. In such case bootfs default configuration is used. For above reason each SoC family (BCM4908, BCM4912) should have its own bootfs built. It allows each of them to have working default configuration. Signed-off-by: Rafał Miłecki (cherry picked from commit 6ae2f7ff4737ec8dbec026fc6c02f7d1850b521c) --- target/linux/bcm4908/image/Makefile | 19 +++---- target/linux/bcm4908/image/bootfs-bcm4908.its | 48 ++++++++++++++++++ target/linux/bcm4908/image/bootfs-bcm4912.its | 34 +++++++++++++ .../image/{bootfs-generic.its => bootfs.itsi} | 50 ------------------- 4 files changed, 92 insertions(+), 59 deletions(-) create mode 100644 target/linux/bcm4908/image/bootfs-bcm4908.its create mode 100644 target/linux/bcm4908/image/bootfs-bcm4912.its rename target/linux/bcm4908/image/{bootfs-generic.its => bootfs.itsi} (52%) diff --git a/target/linux/bcm4908/image/Makefile b/target/linux/bcm4908/image/Makefile index ba7cdc3ae7..aba4d377f8 100644 --- a/target/linux/bcm4908/image/Makefile +++ b/target/linux/bcm4908/image/Makefile @@ -5,19 +5,20 @@ include $(INCLUDE_DIR)/image.mk DEVICE_VARS += ASUS_PRODUCTID ASUS_BUILD_NO ASUS_FW_REV ASUS_EXT_NO DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_REGION -DEVICE_VARS += PKGTB_ITS +DEVICE_VARS += SOC define Image/Prepare - cp bootfs-generic.its $(KDIR)/ - sed -i "s=\$$$${images_dir}=$(STAGING_DIR_IMAGE)=" $(KDIR)/bootfs-generic.its - sed -i "s=\$$$${dts_dir}=$(DTS_DIR)=" $(KDIR)/bootfs-generic.its + cp bootfs*.its* $(KDIR)/ + sed -i "s=\$$$${images_dir}=$(STAGING_DIR_IMAGE)=" $(KDIR)/bootfs*.its* + sed -i "s=\$$$${dts_dir}=$(DTS_DIR)=" $(KDIR)/bootfs*.its* endef define Build/bootfs cat $@ | $(STAGING_DIR_HOST)/bin/lzma e -eos -si -so > $@.tmp mv $@.tmp $@ - sed -i "s=\$${kernel}=$@=" $(KDIR)/bootfs-generic.its - PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-generic.its $(KDIR)/bootfs-generic.itb + sed -i "s=\$${kernel}=$@=" $(KDIR)/bootfs*.its* + PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-bcm4908.its $(KDIR)/bootfs-bcm4908.itb + PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-bcm4912.its $(KDIR)/bootfs-bcm4912.itb endef define Build/bcm4908asus @@ -54,8 +55,8 @@ endef define Build/pkgtb mv $@ $@.rootfs - cp $(PKGTB_ITS) $@.its - sed -i "s=\$${bootfs}=$(KDIR)/bootfs-generic.itb=" $@.its + cp pkgtb-$(SOC).its $@.its + sed -i "s=\$${bootfs}=$(KDIR)/bootfs-$(SOC).itb=" $@.its sed -i "s=\$${rootfs}=$@.rootfs=" $@.its PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@ endef @@ -129,7 +130,7 @@ endef define Device/netgear_raxe500 DEVICE_MODEL := RAXE500 $(Device/netgear) - PKGTB_ITS := pkgtb-bcm4908.its + SOC := bcm4908 NETGEAR_BOARD_ID := U12H449T00_NETGEAR endef # TARGET_DEVICES += netgear_raxe500 diff --git a/target/linux/bcm4908/image/bootfs-bcm4908.its b/target/linux/bcm4908/image/bootfs-bcm4908.its new file mode 100644 index 0000000000..d5ac21fd6a --- /dev/null +++ b/target/linux/bcm4908/image/bootfs-bcm4908.its @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/include/ "bootfs.itsi" + +/ { + images { + uboot { + data = /incbin/("${images_dir}/u-boot/u-boot-bcm4908.bin"); + }; + + fdt_uboot { + data = /incbin/("${images_dir}/u-boot/u-boot-bcm4908.dtb"); + }; + + fdt_uboot_RAX220 { + description = "dtb"; + data = /incbin/("${images_dir}/u-boot/RAX220.dtb"); + type = "flat_dt"; + compression = "none"; + + hash-1 { + algo = "sha256"; + }; + }; + + fdt_linux_RAX220 { + description = "dtb"; + data = /incbin/("${dts_dir}/broadcom/bcm4908/bcm4908-netgear-raxe500.dtb"); + arch = "arm64"; + type = "flat_dt"; + compression = "none"; + }; + }; + + configurations { + conf_ub_RAX220 { + description = "RAX220"; + fdt = "fdt_uboot_RAX220"; + loadables = "atf", "uboot"; + }; + + conf_lx_RAX220 { + description = "BRCM 63xxx linux"; + kernel = "kernel"; + fdt = "fdt_linux_RAX220"; + }; + }; +}; diff --git a/target/linux/bcm4908/image/bootfs-bcm4912.its b/target/linux/bcm4908/image/bootfs-bcm4912.its new file mode 100644 index 0000000000..6f4548956c --- /dev/null +++ b/target/linux/bcm4908/image/bootfs-bcm4912.its @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/include/ "bootfs.itsi" + +/ { + images { + uboot { + data = /incbin/("${images_dir}/u-boot/u-boot-bcm4912.bin"); + }; + + fdt_uboot { + data = /incbin/("${images_dir}/u-boot/u-boot-bcm4912.dtb"); + }; + + fdt_GTAX6000 { + description = "dtb"; + data = /incbin/("${images_dir}/u-boot/GTAX6000.dtb"); + type = "flat_dt"; + compression = "none"; + + hash-1 { + algo = "sha256"; + }; + }; + }; + + configurations { + conf_ub_GTAX6000 { + description = "GTAX6000"; + fdt = "fdt_GTAX6000"; + loadables = "atf", "uboot"; + }; + }; +}; diff --git a/target/linux/bcm4908/image/bootfs-generic.its b/target/linux/bcm4908/image/bootfs.itsi similarity index 52% rename from target/linux/bcm4908/image/bootfs-generic.its rename to target/linux/bcm4908/image/bootfs.itsi index d32e094eb5..ceaaf10b2b 100644 --- a/target/linux/bcm4908/image/bootfs-generic.its +++ b/target/linux/bcm4908/image/bootfs.itsi @@ -24,7 +24,6 @@ uboot { description = "U-Boot"; - data = /incbin/("${images_dir}/u-boot/u-boot-nodtb.bin"); os = "U-Boot"; arch = "arm64"; compression = "none"; @@ -53,7 +52,6 @@ fdt_uboot { description = "dtb"; - data = /incbin/("${images_dir}/u-boot/u-boot.dtb"); type = "flat_dt"; compression = "none"; @@ -61,36 +59,6 @@ algo = "sha256"; }; }; - - fdt_GTAX6000 { - description = "dtb"; - data = /incbin/("${images_dir}/u-boot/GTAX6000.dtb"); - type = "flat_dt"; - compression = "none"; - - hash-1 { - algo = "sha256"; - }; - }; - - fdt_uboot_RAX220 { - description = "dtb"; - data = /incbin/("${images_dir}/u-boot/RAX220.dtb"); - type = "flat_dt"; - compression = "none"; - - hash-1 { - algo = "sha256"; - }; - }; - - fdt_linux_RAX220 { - description = "dtb"; - data = /incbin/("${dts_dir}/broadcom/bcm4908/bcm4908-netgear-raxe500.dtb"); - arch = "arm64"; - type = "flat_dt"; - compression = "none"; - }; }; configurations { @@ -101,23 +69,5 @@ fdt = "fdt_uboot"; loadables = "atf", "uboot"; }; - - conf_ub_GTAX6000 { - description = "GTAX6000"; - fdt = "fdt_GTAX6000"; - loadables = "atf", "uboot"; - }; - - conf_ub_RAX220 { - description = "RAX220"; - fdt = "fdt_uboot_RAX220"; - loadables = "atf", "uboot"; - }; - - conf_lx_RAX220 { - description = "BRCM 63xxx linux"; - kernel = "kernel"; - fdt = "fdt_linux_RAX220"; - }; }; }; From 36bab9266f40b2f98964ae637179fbcdee096dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 28 Jul 2022 17:46:33 +0200 Subject: [PATCH 09/10] bcm4908: enable & setup packet steering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without packet steering NAT masquarade speed on BCM4908 /jumps/ between two speeds: 1. 826 Mb/s (±3 Mb/s) 2. 909 Mb/s (±8 Mb/s) and it never reaches ~940 Mb/s. Proper packet steering can improve it. Below are testing results for running iperf TCP traffic from LAN to WAN. They were used to pick up golden values. ┌──────────┬──────────┬───────────┐ │ eth0 │ br-lan │ speed │ │ rps_cpus │ rps_cpus │ [Mbps] │ ├──────────┼──────────┼───────────┤ │ 0 │ 0 │ 743 / 804 │ │ 0 │ 1 │ 738 / 821 │ │ 0 │ 2 │ ✓ 940 │ │ 0 │ 4 │ ✓ 938 │ │ 0 │ 8 │ ✓ 941 │ ├──────────┼──────────┼───────────┤ │ 1 │ 0 │ 829 │ │ 1 │ 1 │ 829 │ │ 1 │ 2 │ ✓ 942 │ │ 1 │ 4 │ ✓ 941 │ │ 1 │ 8 │ ✓ 941 │ ├──────────┼──────────┼───────────┤ │ 2 │ 0 │ ✓ 942 │ │ 2 │ 1 │ 926 │ │ 2 │ 2 │ ✓ 942 │ │ 2 │ 4 │ ✓ 942 │ │ 2 │ 8 │ ✓ 941 │ ├──────────┼──────────┼───────────┤ │ 4 │ 0 │ ✓ 941 │ │ 4 │ 1 │ 925 │ │ 4 │ 2 │ ✓ 941 │ │ 4 │ 4 │ ✓ 941 │ │ 4 │ 8 │ ✓ 941 │ ├──────────┼──────────┼───────────┤ │ 8 │ 0 │ ✓ 942 │ │ 8 │ 1 │ 925 │ │ 8 │ 2 │ ✓ 941 │ │ 8 │ 4 │ ✓ 942 │ │ 8 │ 8 │ ✓ 942 │ └──────────┴──────────┴───────────┘ Ref: fcbd39689ebfe ("bcm53xx: enable & setup packet steering") Signed-off-by: Rafał Miłecki (cherry picked from commit 57cad53f4e52be987cdd61308ff7d2704baca539) --- .../bcm4908/base-files/etc/init.d/fastnetwork | 46 +++++++++++++++++++ .../etc/uci-defaults/05_packet_steering | 3 ++ 2 files changed, 49 insertions(+) create mode 100755 target/linux/bcm4908/base-files/etc/init.d/fastnetwork create mode 100644 target/linux/bcm4908/base-files/etc/uci-defaults/05_packet_steering diff --git a/target/linux/bcm4908/base-files/etc/init.d/fastnetwork b/target/linux/bcm4908/base-files/etc/init.d/fastnetwork new file mode 100755 index 0000000000..88f6075990 --- /dev/null +++ b/target/linux/bcm4908/base-files/etc/init.d/fastnetwork @@ -0,0 +1,46 @@ +#!/bin/sh /etc/rc.common + +START=25 +USE_PROCD=1 + +start_service() { + reload_service +} + +service_triggers() { + procd_add_reload_trigger "network" + procd_add_reload_trigger "firewall" + procd_add_reload_interface_trigger "lan" +} + +reload_service() { + local packet_steering="$(uci -q get network.@globals[0].packet_steering)" + local num_cpus="$(grep -c "^processor.*:" /proc/cpuinfo)" + local flow_offloading="$(uci -q get firewall.@defaults[0].flow_offloading)" + local flow_offloading_hw="$(uci -q get firewall.@defaults[0].flow_offloading_hw)" + local rps_eth0=0 + local rps_br_lan=0 + + [ "$num_cpus" -le 1 ] && return + + [ "$packet_steering" = 1 ] && { + if [ ${flow_offloading_hw:-0} -gt 0 ]; then + # HW offloading + # Not implemented + : + elif [ ${flow_offloading:-0} -gt 0 ]; then + # SW offloading + # BCM4908 always reaches ~940 Mb/s + : + else + # Default + case "$num_cpus" in + 2) rps_eth0=2; rps_br_lan=2;; + 4) rps_eth0=e; rps_br_lan=e;; + esac + fi + } + + echo $rps_eth0 > /sys/class/net/eth0/queues/rx-0/rps_cpus + echo $rps_br_lan > /sys/class/net/br-lan/queues/rx-0/rps_cpus +} diff --git a/target/linux/bcm4908/base-files/etc/uci-defaults/05_packet_steering b/target/linux/bcm4908/base-files/etc/uci-defaults/05_packet_steering new file mode 100644 index 0000000000..98c9497815 --- /dev/null +++ b/target/linux/bcm4908/base-files/etc/uci-defaults/05_packet_steering @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0-only + +uci set network.@globals[0].packet_steering="1" From 8d24ea3f31b4e60a342e579e3218e1adc282dba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 17 Aug 2022 11:04:29 +0200 Subject: [PATCH 10/10] kernel: rename 5.20 patches to 6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit 372ee1919d281dd3e86121996805291a6948c982) --- ...001-dt-bindings-leds-add-Broadcom-s-BCM63138-controller.patch} | 0 ...-0002-leds-bcm63138-add-support-for-BCM63138-controller.patch} | 0 ...01-dt-bindings-leds-leds-bcm63138-unify-full-stops-in-d.patch} | 0 ...v6.0-0002-leds-add-help-info-about-BCM63138-module-name.patch} | 0 ... => 846-v6.0-0003-leds-leds-bcm63138-get-rid-of-LED_OFF.patch} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/generic/backport-5.4/{800-v5.20-0001-dt-bindings-leds-add-Broadcom-s-BCM63138-controller.patch => 845-v6.0-0001-dt-bindings-leds-add-Broadcom-s-BCM63138-controller.patch} (100%) rename target/linux/generic/backport-5.4/{800-v5.20-0002-leds-bcm63138-add-support-for-BCM63138-controller.patch => 845-v6.0-0002-leds-bcm63138-add-support-for-BCM63138-controller.patch} (100%) rename target/linux/generic/backport-5.4/{846-v5.20-0001-dt-bindings-leds-leds-bcm63138-unify-full-stops-in-d.patch => 846-v6.0-0001-dt-bindings-leds-leds-bcm63138-unify-full-stops-in-d.patch} (100%) rename target/linux/generic/backport-5.4/{846-v5.20-0002-leds-add-help-info-about-BCM63138-module-name.patch => 846-v6.0-0002-leds-add-help-info-about-BCM63138-module-name.patch} (100%) rename target/linux/generic/backport-5.4/{846-v5.20-0003-leds-leds-bcm63138-get-rid-of-LED_OFF.patch => 846-v6.0-0003-leds-leds-bcm63138-get-rid-of-LED_OFF.patch} (100%) diff --git a/target/linux/generic/backport-5.4/800-v5.20-0001-dt-bindings-leds-add-Broadcom-s-BCM63138-controller.patch b/target/linux/generic/backport-5.4/845-v6.0-0001-dt-bindings-leds-add-Broadcom-s-BCM63138-controller.patch similarity index 100% rename from target/linux/generic/backport-5.4/800-v5.20-0001-dt-bindings-leds-add-Broadcom-s-BCM63138-controller.patch rename to target/linux/generic/backport-5.4/845-v6.0-0001-dt-bindings-leds-add-Broadcom-s-BCM63138-controller.patch diff --git a/target/linux/generic/backport-5.4/800-v5.20-0002-leds-bcm63138-add-support-for-BCM63138-controller.patch b/target/linux/generic/backport-5.4/845-v6.0-0002-leds-bcm63138-add-support-for-BCM63138-controller.patch similarity index 100% rename from target/linux/generic/backport-5.4/800-v5.20-0002-leds-bcm63138-add-support-for-BCM63138-controller.patch rename to target/linux/generic/backport-5.4/845-v6.0-0002-leds-bcm63138-add-support-for-BCM63138-controller.patch diff --git a/target/linux/generic/backport-5.4/846-v5.20-0001-dt-bindings-leds-leds-bcm63138-unify-full-stops-in-d.patch b/target/linux/generic/backport-5.4/846-v6.0-0001-dt-bindings-leds-leds-bcm63138-unify-full-stops-in-d.patch similarity index 100% rename from target/linux/generic/backport-5.4/846-v5.20-0001-dt-bindings-leds-leds-bcm63138-unify-full-stops-in-d.patch rename to target/linux/generic/backport-5.4/846-v6.0-0001-dt-bindings-leds-leds-bcm63138-unify-full-stops-in-d.patch diff --git a/target/linux/generic/backport-5.4/846-v5.20-0002-leds-add-help-info-about-BCM63138-module-name.patch b/target/linux/generic/backport-5.4/846-v6.0-0002-leds-add-help-info-about-BCM63138-module-name.patch similarity index 100% rename from target/linux/generic/backport-5.4/846-v5.20-0002-leds-add-help-info-about-BCM63138-module-name.patch rename to target/linux/generic/backport-5.4/846-v6.0-0002-leds-add-help-info-about-BCM63138-module-name.patch diff --git a/target/linux/generic/backport-5.4/846-v5.20-0003-leds-leds-bcm63138-get-rid-of-LED_OFF.patch b/target/linux/generic/backport-5.4/846-v6.0-0003-leds-leds-bcm63138-get-rid-of-LED_OFF.patch similarity index 100% rename from target/linux/generic/backport-5.4/846-v5.20-0003-leds-leds-bcm63138-get-rid-of-LED_OFF.patch rename to target/linux/generic/backport-5.4/846-v6.0-0003-leds-leds-bcm63138-get-rid-of-LED_OFF.patch