From 0b66843cdd3c06448173dfea18dad8533e33a408 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 14 May 2019 00:58:28 +0800 Subject: [PATCH] bcm53xx: Add support for Arris SBR1900P/SBR-AC3200P --- .../bcm53xx/base-files/etc/board.d/02_network | 17 +++ target/linux/bcm53xx/image/Makefile | 12 ++ ...CM5301X-Add-DT-for-ARRIS-SBR-AC3200P.patch | 106 ++++++++++++++++++ ...U-port-fixes-for-devices-not-using-p.patch | 6 +- 4 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 target/linux/bcm53xx/patches-4.14/323-ARM-dts-BCM5301X-Add-DT-for-ARRIS-SBR-AC3200P.patch diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network index e3e15cc0b..ae2c1c178 100755 --- a/target/linux/bcm53xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network @@ -38,6 +38,11 @@ asus,rt-ac87u) ifname=eth1 etXmacaddr=$(nvram get et1macaddr) ;; +arris,sbr-ac1900p | \ +arris,sbr-ac3200p) + ifname=eth2 + etXmacaddr=$(nvram get et2macaddr) + ;; dlink,dir-885l | \ netgear,r7900 | \ netgear,r8000 | \ @@ -70,6 +75,18 @@ netgear,r8500) [ -n "$et2macaddr" ] && ucidef_set_interface_macaddr "lan" "$et2macaddr" [ -n "$wan_macaddr" ] && ucidef_set_interface_macaddr "wan" "$wan_macaddr" + board_config_flush + exit 0 + ;; +arris,sbr-ac1900p | \ +arris,sbr-ac3200p) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "7t@eth1" + #it seems a bug in b53, set cpu port from 8 to 7 and eth2 to eth1 + et2macaddr="$(nvram get et2macaddr)" + [ -n "$et2macaddr" ] && ucidef_set_interface_macaddr "lan" "$et2macaddr" + [ -n "$wan_macaddr" ] && ucidef_set_interface_macaddr "wan" "$wan_macaddr" + board_config_flush exit 0 ;; diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 3d16c1d65..b00854c08 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -320,6 +320,18 @@ define Device/phicomm-k3 endef TARGET_DEVICES += phicomm-k3 +define Device/arris-sbr-ac1900p + DEVICE_TITLE := ARRIS SBR-AC1900P + DEVICE_PACKAGES := $(USB3_PACKAGES) +endef +TARGET_DEVICES += arris-sbr-ac1900p + +define Device/arris-sbr-ac3200p + DEVICE_TITLE := ARRIS SBR-AC3200P + DEVICE_PACKAGES := $(BRCMFMAC_43602A1) $(USB3_PACKAGES) +endef +TARGET_DEVICES += arris-sbr-ac3200p + define Device/tenda-ac9 DEVICE_TITLE := Tenda AC9 DEVICE_PACKAGES := $(B43) $(USB2_PACKAGES) diff --git a/target/linux/bcm53xx/patches-4.14/323-ARM-dts-BCM5301X-Add-DT-for-ARRIS-SBR-AC3200P.patch b/target/linux/bcm53xx/patches-4.14/323-ARM-dts-BCM5301X-Add-DT-for-ARRIS-SBR-AC3200P.patch new file mode 100644 index 000000000..bc8797331 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/323-ARM-dts-BCM5301X-Add-DT-for-ARRIS-SBR-AC3200P.patch @@ -0,0 +1,106 @@ +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -106,6 +106,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4709-netgear-r8000.dtb \ + bcm4709-tplink-archer-c9-v1.dtb \ + bcm4709-arris-sbr-ac1900p.dtb \ ++ bcm4709-arris-sbr-ac3200p.dtb \ + bcm47094-dlink-dir-885l.dtb \ + bcm47094-linksys-panamera.dtb \ + bcm47094-luxul-abr-4500.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm4709-arris-sbr-ac3200p.dts +@@ -0,0 +1,82 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * DTS for ARRIS SBR-AC3200P ++ * ++ * Copyright (C) 2019 lostlonger ++ * Copyright (C) 2019 paldier ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4709.dtsi" ++#include "bcm5301x-nand-cs0-bch4.dtsi" ++ ++/ { ++ compatible = "arris,sbr-ac3200p", "brcm,bcm4709", "brcm,bcm4708"; ++ model = "ARRIS SBR-AC3200P"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ memory { ++ reg = <0x00000000 0x08000000 ++ 0x88000000 0x08000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&usb2 { ++ vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3 { ++ vcc-gpio = <&chipcommon 21 GPIO_ACTIVE_HIGH>; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&nandcs { ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "boot"; ++ reg = <0x0000000 0x0080000>; ++ read-only; ++ }; ++ ++ partition@80000 { ++ label = "nvram"; ++ reg = <0x0080000 0x0180000>; ++ }; ++ ++ partition@200000 { ++ label = "firmware"; ++ reg = <0x0200000 0x6600000>; ++ compatible = "brcm,trx"; ++ }; ++ ++ partition@6800000 { ++ label = "env"; ++ reg = <0x6800000 0x0200000>; ++ read-only; ++ }; ++ ++ partition@6a00000 { ++ label = "data"; ++ reg = <0x6a00000 0x1600000>; ++ }; ++ }; ++}; ++ diff --git a/target/linux/bcm53xx/patches-4.14/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch b/target/linux/bcm53xx/patches-4.14/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch index 91bb4fae1..9b96a78c0 100644 --- a/target/linux/bcm53xx/patches-4.14/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch +++ b/target/linux/bcm53xx/patches-4.14/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch @@ -21,7 +21,7 @@ Signed-off-by: Rafał Miłecki #include "b53_regs.h" #include "b53_priv.h" -@@ -1579,6 +1580,28 @@ static int b53_switch_init(struct b53_de +@@ -1579,6 +1580,32 @@ static int b53_switch_init(struct b53_de return ret; } @@ -34,6 +34,10 @@ Signed-off-by: Rafał Miłecki + sw_dev->cpu_port = 8; + else if (of_machine_is_compatible("netgear,r8500")) + sw_dev->cpu_port = 8; ++ else if (of_machine_is_compatible("arris,sbr-ac1900p")) ++ sw_dev->cpu_port = 7; ++ else if (of_machine_is_compatible("arris,sbr-ac3200p")) ++ sw_dev->cpu_port = 7; + + /* Enable extra ports */ + if (of_machine_is_compatible("tenda,ac9"))