From 30fcb62840be0595f50e03e79eb166674fb0de47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 19 May 2020 08:05:22 +0200 Subject: [PATCH 01/13] scripts: cfe-bin-header: fix shebang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: e575a7f777ef ("scripts: support tags for CFE binaries") Signed-off-by: Álvaro Fernández Rojas --- scripts/cfe-bin-header.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cfe-bin-header.py b/scripts/cfe-bin-header.py index 476a36d8dd..3bf652bd0a 100755 --- a/scripts/cfe-bin-header.py +++ b/scripts/cfe-bin-header.py @@ -1,4 +1,4 @@ -#!/bin/env python3 +#!/usr/bin/env python3 import argparse import os From 258cb7f1695d7c512069f48571c95c3de8053639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 19 May 2020 08:06:29 +0200 Subject: [PATCH 02/13] scripts: cfe-wfi-tag: fix shebang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: 72985233a696 ("scripts: support CFE WFI images") Signed-off-by: Álvaro Fernández Rojas --- scripts/cfe-wfi-tag.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cfe-wfi-tag.py b/scripts/cfe-wfi-tag.py index 3b60dbfc5d..78ae869f1d 100755 --- a/scripts/cfe-wfi-tag.py +++ b/scripts/cfe-wfi-tag.py @@ -1,4 +1,4 @@ -#!/bin/env python3 +#!/usr/bin/env python3 """ Whole Flash Image Tag From 62e7342ddfba605722b1d6700eec3f0aaa9377e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 19 May 2020 08:55:06 +0200 Subject: [PATCH 03/13] bcm63xx: add NETGEAR DGND3700v2 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BCM6362 with 64M RAM, 32M NAND and BCM53125 switch. Switch is connected by MMAP, which is currently unsupported (no VLANs). More info: https://openwrt.org/toh/netgear/dgnd3700v2 Signed-off-by: Álvaro Fernández Rojas --- .../bcm63xx/base-files/etc/board.d/01_leds | 5 + .../bcm63xx/base-files/etc/board.d/02_network | 1 + .../base-files/lib/upgrade/platform.sh | 6 +- .../dts/bcm6362-netgear-dgnd3700-v2.dts | 216 ++++++++++++++++++ target/linux/bcm63xx/image/bcm63xx_nand.mk | 17 ++ .../patches-5.4/600-board-DGND3700v2.patch | 50 ++++ 6 files changed, 293 insertions(+), 2 deletions(-) create mode 100644 target/linux/bcm63xx/dts/bcm6362-netgear-dgnd3700-v2.dts create mode 100644 target/linux/bcm63xx/patches-5.4/600-board-DGND3700v2.patch diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index 3f73d914f9..cdbfa6319b 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -63,6 +63,11 @@ netgear,dgnd3700-v1) ucidef_set_led_usbdev "usb1" "USB1" "DGND3700v1_3800B:green:usb-back" "1-1" ucidef_set_led_usbdev "usb2" "USB2" "DGND3700v1_3800B:green:usb-front" "1-2" ;; +netgear,dgnd3700-v2) + ucidef_set_led_netdev "lan" "LAN" "dgnd3700-v2:green:ethernet" "eth0" + ucidef_set_led_usbdev "usb1" "USB1" "dgnd3700-v2:green:usb1" "1-1" + ucidef_set_led_usbdev "usb2" "USB2" "dgnd3700-v2:green:usb2" "1-2" + ;; netgear,evg2000) ucidef_set_led_netdev "lan" "LAN" "EVG2000:green:lan" "eth0" ucidef_set_led_netdev "wan" "WAN" "EVG2000:green:wan" "eth1" diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index 7203b1c3fc..928aff0498 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -12,6 +12,7 @@ actiontec,r1000h|\ dynalink,rta770bw|\ dynalink,rta770w|\ netgear,cvg834g|\ +netgear,dgnd3700-v2|\ netgear,evg2000|\ t-com,speedport-w-303v|\ t-com,speedport-w-500v) diff --git a/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh index 0debff28bb..202f55535a 100644 --- a/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh @@ -5,7 +5,8 @@ platform_check_image() { [ "$#" -gt 1 ] && return 1 case "$(board_name)" in - comtrend,vr-3032u) + comtrend,vr-3032u|\ + netgear,dgnd3700-v2) # NAND sysupgrade return 0 ;; @@ -61,7 +62,8 @@ cfe_jffs2_upgrade_tar() { platform_do_upgrade() { case "$(board_name)" in - comtrend,vr-3032u) + comtrend,vr-3032u|\ + netgear,dgnd3700-v2) REQUIRE_IMAGE_METADATA=1 cfe_jffs2_upgrade_tar "$1" ;; diff --git a/target/linux/bcm63xx/dts/bcm6362-netgear-dgnd3700-v2.dts b/target/linux/bcm63xx/dts/bcm6362-netgear-dgnd3700-v2.dts new file mode 100644 index 0000000000..07e5c1eff8 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6362-netgear-dgnd3700-v2.dts @@ -0,0 +1,216 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +/dts-v1/; + +#include "bcm6362.dtsi" + +#include + +/ { + model = "Netgear DGND3700v2"; + compatible = "netgear,dgnd3700-v2", "brcm,bcm6362"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,ubifs noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wlan { + label = "wlan"; + gpios = <&pinctrl 25 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 26 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led@28 { + label = "dgnd3700-v2:green:dsl"; + gpios = <&pinctrl 28 1>; + }; + + led@34 { + label = "dgnd3700-v2:red:power"; + gpios = <&pinctrl 34 1>; + }; + }; +}; + +&leds { + status = "okay"; + brcm,serial-leds; + brcm,serial-dat-low; + brcm,serial-shift-inv; + brcm,serial-mux; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds &pinctrl_serial_led>; + + led@1 { + reg = <1>; + active-low; + label = "dgnd3700-v2:green:internet"; + }; + + led_power_green: led@8 { + reg = <8>; + label = "dgnd3700-v2:green:power"; + default-state = "on"; + }; + + led@9 { + reg = <9>; + active-low; + label = "dgnd3700-v2:green:wps"; + }; + + led@10 { + reg = <10>; + active-low; + label = "dgnd3700-v2:green:usb1"; + }; + + led@11 { + reg = <11>; + active-low; + label = "dgnd3700-v2:green:usb2"; + }; + + led@12 { + reg = <12>; + active-low; + label = "dgnd3700-v2:amber:internet"; + }; + + led@13 { + reg = <13>; + active-low; + label = "dgnd3700-v2:green:ethernet"; + }; + + led@14 { + reg = <14>; + active-low; + label = "dgnd3700-v2:amber:dsl"; + }; + + led@16 { + reg = <16>; + active-low; + label = "dgnd3700-v2:amber:usb1"; + }; + + led@17 { + reg = <17>; + active-low; + label = "dgnd3700-v2:amber:usb2"; + }; + + led@18 { + reg = <18>; + active-low; + label = "dgnd3700-v2:amber:ethernet"; + }; +}; + +&nflash { + status = "ok"; + + nandcs@0 { + compatible = "brcm,nandcs"; + #size-cells = <1>; + #address-cells = <1>; + reg = <0>; + nand-ecc-step-size = <512>; + nand-ecc-strength = <15>; + nand-on-flash-bbt; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "cferom"; + reg = <0x0000000 0x0004000>; + read-only; + }; + + partition@4000 { + compatible = "brcm,wfi"; + label = "wfi"; + reg = <0x0004000 0x1c7c000>; + }; + + partition@1c80000 { + label = "flag"; + reg = <0x1c80000 0x0040000>; + read-only; + }; + + partition@1cc0000 { + label = "pcbasn"; + reg = <0x1cc0000 0x0040000>; + read-only; + }; + + partition@1d00000 { + label = "xxx"; + reg = <0x1d00000 0x0080000>; + read-only; + }; + + partition@1d80000 { + label = "language_dev"; + reg = <0x1d80000 0x0040000>; + read-only; + }; + + partition@1dc0000 { + label = "scnvram"; + reg = <0x1dc0000 0x0100000>; + read-only; + }; + }; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1"; + }; +}; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/bcm63xx/image/bcm63xx_nand.mk b/target/linux/bcm63xx/image/bcm63xx_nand.mk index 5be27a3f75..c0505aceaa 100644 --- a/target/linux/bcm63xx/image/bcm63xx_nand.mk +++ b/target/linux/bcm63xx/image/bcm63xx_nand.mk @@ -51,3 +51,20 @@ define Device/comtrend_vr-3032u CFE_WFI_FLASH_TYPE := 3 endef TARGET_DEVICES += comtrend_vr-3032u + +### Netgear ### +define Device/netgear_dgnd3700-v2 + $(Device/bcm63xx-nand) + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := DGND3700 + DEVICE_VARIANT := v2 + CFE_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 += $(B43_PACKAGES) $(USB2_PACKAGES) + CFE_WFI_FLASH_TYPE := 2 +endef +TARGET_DEVICES += netgear_dgnd3700-v2 diff --git a/target/linux/bcm63xx/patches-5.4/600-board-DGND3700v2.patch b/target/linux/bcm63xx/patches-5.4/600-board-DGND3700v2.patch new file mode 100644 index 0000000000..139d2104c5 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/600-board-DGND3700v2.patch @@ -0,0 +1,50 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -1820,6 +1820,31 @@ static struct board_info __initdata boar + }, + }; + ++static struct board_info __initdata board_dgnd3700v2 = { ++ .name = "96362ADVN2xh", ++ .expected_cpu_id = 0x6362, ++ ++ .has_pci = 1, ++ ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [4] = { ++ .used = 1, ++ .phy_id = 0xff, ++ .bypass_link = 1, ++ .force_speed = 1000, ++ .force_duplex_full = 1, ++ .name = "RGMII", ++ }, ++ }, ++ }, ++}; ++ + static struct board_info __initdata board_fast2504n = { + .name = "F@ST2504n", + .expected_cpu_id = 0x6362, +@@ -2820,6 +2845,7 @@ static const struct board_info __initcon + + #ifdef CONFIG_BCM63XX_CPU_6362 + &board_nb6, ++ &board_dgnd3700v2, + &board_fast2504n, + #endif + +@@ -2934,6 +2960,7 @@ static struct of_device_id const bcm963x + { .compatible = "bt,home-hub-2-a", .data = &board_homehub2a, }, + #endif + #ifdef CONFIG_BCM63XX_CPU_6362 ++ { .compatible = "netgear,dgnd3700-v2", .data = &board_dgnd3700v2, }, + { .compatible = "sagem,fast-2504n", .data = &board_fast2504n, }, + { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, + #endif From daee6b466146fc20505adb2ef9f4be831f96d972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 19 May 2020 10:21:46 +0200 Subject: [PATCH 04/13] bcm63xx: add Comtrend VG-8050 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BCM63169 with 128M RAM, 128M NAND and BCM53125 switch. Switch is connected by HSSPI to CS5. More info: https://openwrt.org/toh/comtrend/vg8050 Signed-off-by: Álvaro Fernández Rojas --- .../bcm63xx/base-files/etc/board.d/02_network | 4 + .../base-files/lib/upgrade/platform.sh | 2 + .../bcm63xx/dts/bcm63169-comtrend-vg-8050.dts | 198 ++++++++++++++++++ target/linux/bcm63xx/image/bcm63xx_nand.mk | 17 ++ .../patches-5.4/601-board-VG-8050.patch | 48 +++++ 5 files changed, 269 insertions(+) create mode 100644 target/linux/bcm63xx/dts/bcm63169-comtrend-vg-8050.dts create mode 100644 target/linux/bcm63xx/patches-5.4/601-board-VG-8050.patch diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index 928aff0498..d0c15a9f98 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -100,6 +100,10 @@ sagem,fast-2704n) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "8t@eth0" ;; +comtrend,vg-8050) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "8t@eth0" + ;; comtrend,vr-3032u) ucidef_add_switch "switch0" \ "0:lan:2" "1:lan:3" "2:lan:4" "3:lan:1" "8t@eth0" diff --git a/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh index 202f55535a..e92d025de7 100644 --- a/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh @@ -5,6 +5,7 @@ platform_check_image() { [ "$#" -gt 1 ] && return 1 case "$(board_name)" in + comtrend,vg-8050|\ comtrend,vr-3032u|\ netgear,dgnd3700-v2) # NAND sysupgrade @@ -62,6 +63,7 @@ cfe_jffs2_upgrade_tar() { platform_do_upgrade() { case "$(board_name)" in + comtrend,vg-8050|\ comtrend,vr-3032u|\ netgear,dgnd3700-v2) REQUIRE_IMAGE_METADATA=1 diff --git a/target/linux/bcm63xx/dts/bcm63169-comtrend-vg-8050.dts b/target/linux/bcm63xx/dts/bcm63169-comtrend-vg-8050.dts new file mode 100644 index 0000000000..4f54e9c842 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm63169-comtrend-vg-8050.dts @@ -0,0 +1,198 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +/dts-v1/; + +#include "bcm63268.dtsi" + +#include + +/ { + model = "Comtrend VG-8050"; + compatible = "comtrend,vg-8050", "brcm,bcm63268"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,ubifs noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&pinctrl 33 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 34 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&leds { + status = "ok"; + brcm,serial-leds; + brcm,serial-dat-low; + brcm,serial-shift-inv; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_serial_led>; + + led@2 { + reg = <2>; + active-low; + label = "vg-8050:red:internet"; + }; + + led@3 { + reg = <3>; + active-low; + label = "vg-8050:red:power"; + }; + + led_power_green: led@6 { + reg = <6>; + active-low; + label = "vg-8050:green:power"; + default-state = "on"; + }; + + led@7 { + reg = <7>; + active-low; + label = "vg-8050:green:wps"; + }; + + led@8 { + reg = <8>; + active-low; + label = "vg-8050:green:internet"; + }; + + led@10 { + reg = <10>; + active-low; + label = "vg-8050:green:voip"; + }; + + led@12 { + reg = <12>; + active-low; + label = "vg-8050:red:voip"; + }; + + led@14 { + reg = <14>; + active-low; + label = "vg-8050:red:wps"; + }; +}; + +&hsspi { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hsspi_cs5>; + + switch@0 { + compatible = "brcm,bcm53125"; + reg = <5>; + spi-max-frequency = <781000>; + spi-cpha; + spi-cpol; + + lede,alias = "eth0"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + lan@0 { + reg = <0>; + label = "lan4"; + }; + + lan@1 { + reg = <1>; + label = "lan3"; + }; + + lan@2 { + reg = <2>; + label = "lan2"; + }; + + lan@3 { + reg = <3>; + label = "lan1"; + }; + + wan@4 { + reg = <4>; + label = "wan"; + }; + + cpu@8 { + reg = <8>; + label = "cpu"; + + fixed-link { + speed = <1000>; + full-duplex; + asym-pause; + pause; + }; + }; + }; + }; +}; + +&nflash { + status = "okay"; + + nandcs@0 { + compatible = "brcm,nandcs"; + #size-cells = <1>; + #address-cells = <1>; + reg = <0>; + nand-ecc-step-size = <512>; + nand-ecc-strength = <15>; + nand-on-flash-bbt; + brcm,nand-oob-sector-size = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cferom@0 { + label = "cferom"; + reg = <0x0000000 0x0020000>; + read-only; + }; + + wfi@20000 { + compatible = "brcm,wfi"; + label = "wfi"; + reg = <0x0020000 0x7ee0000>; + }; + }; + }; +}; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/bcm63xx/image/bcm63xx_nand.mk b/target/linux/bcm63xx/image/bcm63xx_nand.mk index c0505aceaa..9ff2c989b8 100644 --- a/target/linux/bcm63xx/image/bcm63xx_nand.mk +++ b/target/linux/bcm63xx/image/bcm63xx_nand.mk @@ -52,6 +52,23 @@ define Device/comtrend_vr-3032u endef TARGET_DEVICES += comtrend_vr-3032u +define Device/comtrend_vg-8050 + $(Device/bcm63xx-nand) + DEVICE_VENDOR := Comtrend + DEVICE_MODEL := VG-8050 + CFE_CHIP_ID := 63268 + SOC := bcm63169 + CFE_RAM_FILE := comtrend,vg-8050/cferam.000 + CFE_RAM_JFFS2_NAME := cferam.000 + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 512 + VID_HDR_OFFSET := 2048 + DEVICE_PACKAGES += $(USB2_PACKAGES) + CFE_WFI_FLASH_TYPE := 3 +endef +TARGET_DEVICES += comtrend_vg-8050 + ### Netgear ### define Device/netgear_dgnd3700-v2 $(Device/bcm63xx-nand) diff --git a/target/linux/bcm63xx/patches-5.4/601-board-VG-8050.patch b/target/linux/bcm63xx/patches-5.4/601-board-VG-8050.patch new file mode 100644 index 0000000000..75fdf7a698 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/601-board-VG-8050.patch @@ -0,0 +1,48 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -2635,6 +2635,29 @@ static struct board_info __initdata boar + }, + }; + ++static struct board_info __initdata board_VG8050 = { ++ .name = "963169P-1861N5", ++ .expected_cpu_id = 0x63268, ++ ++ .has_ehci0 = 1, ++ .has_ohci0 = 1, ++ .num_usbh_ports = 2, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [6] = { ++ .used = 1, ++ .phy_id = 0xff, ++ .bypass_link = 1, ++ .force_speed = 1000, ++ .force_duplex_full = 1, ++ .name = "RGMII", ++ }, ++ }, ++ }, ++}; ++ + static struct board_info __initdata board_VR3032u = { + .name = "963168M-1841N1", + .expected_cpu_id = 0x63268, +@@ -2868,6 +2891,7 @@ static const struct board_info __initcon + #ifdef CONFIG_BCM63XX_CPU_63268 + &board_963268bu_p300, + &board_963269bhr, ++ &board_VG8050, + &board_VR3032u, + &board_vw6339gu, + &board_BSKYB_63168, +@@ -2983,6 +3007,7 @@ static struct of_device_id const bcm963x + #ifdef CONFIG_BCM63XX_CPU_63268 + { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, + { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, ++ { .compatible = "comtrend,vg-8050", .data = &board_VG8050, }, + { .compatible = "comtrend,vr-3032u", .data = &board_VR3032u, }, + { .compatible = "inteno,vg50", .data = &board_vw6339gu, }, + { .compatible = "sky,sr102", .data = &board_BSKYB_63168, }, From edafbe81e033f00d4248a856d5f40c04f6a13f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 19 May 2020 10:55:42 +0200 Subject: [PATCH 05/13] bcm63xx: bcm6328-leds: improve HW blinking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for second HW blinking interval. Signed-off-by: Álvaro Fernández Rojas --- ...-support-second-hw-blinking-interval.patch | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 target/linux/bcm63xx/patches-5.4/120-leds-bcm6328-support-second-hw-blinking-interval.patch diff --git a/target/linux/bcm63xx/patches-5.4/120-leds-bcm6328-support-second-hw-blinking-interval.patch b/target/linux/bcm63xx/patches-5.4/120-leds-bcm6328-support-second-hw-blinking-interval.patch new file mode 100644 index 0000000000..6ed26f2741 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/120-leds-bcm6328-support-second-hw-blinking-interval.patch @@ -0,0 +1,137 @@ +--- a/drivers/leds/leds-bcm6328.c ++++ b/drivers/leds/leds-bcm6328.c +@@ -24,12 +24,16 @@ + + #define BCM6328_LED_MAX_COUNT 24 + #define BCM6328_LED_DEF_DELAY 500 ++#define BCM6328_LED_INTERVAL_NUM 2 + #define BCM6328_LED_INTERVAL_MS 20 + + #define BCM6328_LED_INTV_MASK 0x3f +-#define BCM6328_LED_FAST_INTV_SHIFT 6 +-#define BCM6328_LED_FAST_INTV_MASK (BCM6328_LED_INTV_MASK << \ +- BCM6328_LED_FAST_INTV_SHIFT) ++#define BCM6328_LED_INTV1_SHIFT 0 ++#define BCM6328_LED_INTV1_MASK (BCM6328_LED_INTV_MASK << \ ++ BCM6328_LED_INTV1_SHIFT) ++#define BCM6328_LED_INTV2_SHIFT 6 ++#define BCM6328_LED_INTV2_MASK (BCM6328_LED_INTV_MASK << \ ++ BCM6328_LED_INTV2_SHIFT) + #define BCM6328_SERIAL_LED_EN BIT(12) + #define BCM6328_SERIAL_LED_MUX BIT(13) + #define BCM6328_SERIAL_LED_CLK_NPOL BIT(14) +@@ -45,8 +49,8 @@ + + #define BCM6328_LED_MODE_MASK 3 + #define BCM6328_LED_MODE_ON 0 +-#define BCM6328_LED_MODE_FAST 1 +-#define BCM6328_LED_MODE_BLINK 2 ++#define BCM6328_LED_MODE_INTV1 1 ++#define BCM6328_LED_MODE_INTV2 2 + #define BCM6328_LED_MODE_OFF 3 + #define BCM6328_LED_SHIFT(X) ((X) << 1) + +@@ -127,12 +131,18 @@ static void bcm6328_led_set(struct led_c + unsigned long flags; + + spin_lock_irqsave(led->lock, flags); +- *(led->blink_leds) &= ~BIT(led->pin); ++ ++ /* Remove LED from cached HW blinking intervals */ ++ led->blink_leds[0] &= ~BIT(led->pin); ++ led->blink_leds[1] &= ~BIT(led->pin); ++ ++ /* Set LED on/off */ + if ((led->active_low && value == LED_OFF) || + (!led->active_low && value != LED_OFF)) + bcm6328_led_mode(led, BCM6328_LED_MODE_ON); + else + bcm6328_led_mode(led, BCM6328_LED_MODE_OFF); ++ + spin_unlock_irqrestore(led->lock, flags); + } + +@@ -176,20 +186,59 @@ static int bcm6328_blink_set(struct led_ + } + + spin_lock_irqsave(led->lock, flags); +- if (*(led->blink_leds) == 0 || +- *(led->blink_leds) == BIT(led->pin) || +- *(led->blink_delay) == delay) { ++ /* ++ * Check if any of the two configurable HW blinking intervals is ++ * available: ++ * 1. No LEDs assigned to the HW blinking interval. ++ * 2. LEDs with the same delay assigned. ++ */ ++ if (led->blink_leds[0] == 0 || ++ led->blink_leds[0] == BIT(led->pin) || ++ led->blink_delay[0] == delay) { ++ unsigned long val; ++ ++ /* Add LED to the first HW blinking interval cache */ ++ led->blink_leds[0] |= BIT(led->pin); ++ ++ /* Remove LED from the second HW blinking interval cache */ ++ led->blink_leds[1] &= ~BIT(led->pin); ++ ++ /* Cache the LED in the first HW blinking interval delay */ ++ led->blink_delay[0] = delay; ++ ++ /* Update the delay for the first HW blinking interval */ ++ val = bcm6328_led_read(led->mem + BCM6328_REG_INIT); ++ val &= ~BCM6328_LED_INTV1_MASK; ++ val |= (delay << BCM6328_LED_INTV1_SHIFT); ++ bcm6328_led_write(led->mem + BCM6328_REG_INIT, val); ++ ++ /* Set the LED to first HW blinking interval */ ++ bcm6328_led_mode(led, BCM6328_LED_MODE_INTV1); ++ ++ rc = 0; ++ } else if (led->blink_leds[1] == 0 || ++ led->blink_leds[1] == BIT(led->pin) || ++ led->blink_delay[1] == delay) { + unsigned long val; + +- *(led->blink_leds) |= BIT(led->pin); +- *(led->blink_delay) = delay; ++ /* Remove LED from the first HW blinking interval */ ++ led->blink_leds[0] &= ~BIT(led->pin); ++ ++ /* Add LED to the second HW blinking interval */ ++ led->blink_leds[1] |= BIT(led->pin); + ++ /* Cache the LED in the first HW blinking interval delay */ ++ led->blink_delay[1] = delay; ++ ++ /* Update the delay for the second HW blinking interval */ + val = bcm6328_led_read(led->mem + BCM6328_REG_INIT); +- val &= ~BCM6328_LED_FAST_INTV_MASK; +- val |= (delay << BCM6328_LED_FAST_INTV_SHIFT); ++ val &= ~BCM6328_LED_INTV2_MASK; ++ val |= (delay << BCM6328_LED_INTV2_SHIFT); + bcm6328_led_write(led->mem + BCM6328_REG_INIT, val); + +- bcm6328_led_mode(led, BCM6328_LED_MODE_BLINK); ++ /* Set the LED to second HW blinking interval */ ++ bcm6328_led_mode(led, BCM6328_LED_MODE_INTV2); ++ + rc = 0; + } else { + dev_dbg(led_cdev->dev, +@@ -363,11 +412,13 @@ static int bcm6328_leds_probe(struct pla + if (!lock) + return -ENOMEM; + +- blink_leds = devm_kzalloc(dev, sizeof(*blink_leds), GFP_KERNEL); ++ blink_leds = devm_kcalloc(dev, BCM6328_LED_INTERVAL_NUM, ++ sizeof(*blink_leds), GFP_KERNEL); + if (!blink_leds) + return -ENOMEM; + +- blink_delay = devm_kzalloc(dev, sizeof(*blink_delay), GFP_KERNEL); ++ blink_delay = devm_kcalloc(dev, BCM6328_LED_INTERVAL_NUM, ++ sizeof(*blink_delay), GFP_KERNEL); + if (!blink_delay) + return -ENOMEM; + From 597df570f3e131055e4ab00f3516d50fb74e931c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 19 May 2020 11:07:24 +0200 Subject: [PATCH 06/13] bcm63xx: reorganize board patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's put some order on board patches. Signed-off-by: Álvaro Fernández Rojas --- .../{519_board_CPVA502plus.patch => 517_board_CPVA502plus.patch} | 0 ...rd.patch => 518-bcm63xx-add-support-for-96368MVWG-board.patch} | 0 ...d.patch => 519-bcm63xx-add-support-for-96368MVNgr-board.patch} | 0 ...patch => 520-MIPS-BCM63XX-add-96328avng-reference-board.patch} | 0 ...patch => 521-MIPS-BCM63XX-add-963281TAN-reference-board.patch} | 0 ...oard_dsl_274xb_rev_f.patch => 522-board_dsl_274xb_rev_f.patch} | 0 .../{525-board_96348w3.patch => 523-board_96348w3.patch} | 0 .../{526-board_CT6373-1.patch => 524-board_CT6373-1.patch} | 0 ...rd_dva-g3810bn-tl-1.patch => 525-board_dva-g3810bn-tl-1.patch} | 0 .../patches-5.4/{528-board_nb6.patch => 526-board_nb6.patch} | 0 .../{529-board_fast2604.patch => 527-board_fast2604.patch} | 0 .../{530-board_A4001N1.patch => 528-board_A4001N1.patch} | 0 .../{531-board_AR-5387un.patch => 529-board_AR-5387un.patch} | 0 .../{532-board_AR-5381u.patch => 530-board_AR-5381u.patch} | 0 .../{533-board_rta770bw.patch => 531-board_rta770bw.patch} | 0 .../patches-5.4/{534-board_hw556.patch => 532-board_hw556.patch} | 0 .../{535-board_rta770w.patch => 533-board_rta770w.patch} | 0 .../{536-board_fast2704.patch => 534-board_fast2704.patch} | 0 .../{537-board_fast2504n.patch => 535-board_fast2504n.patch} | 0 .../{555-board_96318ref.patch => 536-board_96318ref.patch} | 0 ...56-board_96318ref_p300.patch => 537-board_96318ref_p300.patch} | 0 ...{557-board_bcm963269bhr.patch => 538-board_bcm963269bhr.patch} | 0 .../{558-board_AR1004G.patch => 539-board_AR1004G.patch} | 0 .../{559-board_vw6339gu.patch => 540-board_vw6339gu.patch} | 0 ...60-board_963268gu_p300.patch => 541-board_963268gu_p300.patch} | 0 .../{561-board_WAP-5813n.patch => 542-board_WAP-5813n.patch} | 0 .../{562-board_VR-3025u.patch => 543-board_VR-3025u.patch} | 0 .../{563-board_VR-3025un.patch => 544-board_VR-3025un.patch} | 0 ...64-board_P870HW-51a_v2.patch => 545-board_P870HW-51a_v2.patch} | 0 .../patches-5.4/{565-board_hw520.patch => 546-board_hw520.patch} | 0 .../{566-board_A4001N.patch => 547-board_A4001N.patch} | 0 ...{567-board_dsl-2751b_e1.patch => 548-board_dsl-2751b_e1.patch} | 0 ...rd_DGND3700v1_3800B.patch => 549-board_DGND3700v1_3800B.patch} | 0 .../{569-board_homehub2a.patch => 550-board_homehub2a.patch} | 0 .../{570-board_HG655b.patch => 551-board_HG655b.patch} | 0 .../{571-board_fast2704n.patch => 552-board_fast2704n.patch} | 0 .../{572-board_VR-3026e.patch => 553-board_VR-3026e.patch} | 0 .../{573-board_R5010UNv2.patch => 554-board_R5010UNv2.patch} | 0 .../patches-5.4/{574-board_HG622.patch => 555-board_HG622.patch} | 0 .../{575-board_EVG2000.patch => 556-board_EVG2000.patch} | 0 .../{576-board_AV4202N.patch => 557-board_AV4202N.patch} | 0 .../{577-board_VH4032N.patch => 558-board_VH4032N.patch} | 0 .../{578-board_R1000H.patch => 559-board_R1000H.patch} | 0 .../{579-board_AR-5315u.patch => 560-board_AR-5315u.patch} | 0 .../{580-board_AD1018.patch => 561-board_AD1018.patch} | 0 .../patches-5.4/{598-board_sr102.patch => 562-board_sr102.patch} | 0 .../{599-board-VR-3032u.patch => 563-board-VR-3032u.patch} | 0 .../{600-board-DGND3700v2.patch => 564-board-DGND3700v2.patch} | 0 .../{601-board-VG-8050.patch => 565-board-VG-8050.patch} | 0 49 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/bcm63xx/patches-5.4/{519_board_CPVA502plus.patch => 517_board_CPVA502plus.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{520-bcm63xx-add-support-for-96368MVWG-board.patch => 518-bcm63xx-add-support-for-96368MVWG-board.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{521-bcm63xx-add-support-for-96368MVNgr-board.patch => 519-bcm63xx-add-support-for-96368MVNgr-board.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{522-MIPS-BCM63XX-add-96328avng-reference-board.patch => 520-MIPS-BCM63XX-add-96328avng-reference-board.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{523-MIPS-BCM63XX-add-963281TAN-reference-board.patch => 521-MIPS-BCM63XX-add-963281TAN-reference-board.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{524-board_dsl_274xb_rev_f.patch => 522-board_dsl_274xb_rev_f.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{525-board_96348w3.patch => 523-board_96348w3.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{526-board_CT6373-1.patch => 524-board_CT6373-1.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{527-board_dva-g3810bn-tl-1.patch => 525-board_dva-g3810bn-tl-1.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{528-board_nb6.patch => 526-board_nb6.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{529-board_fast2604.patch => 527-board_fast2604.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{530-board_A4001N1.patch => 528-board_A4001N1.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{531-board_AR-5387un.patch => 529-board_AR-5387un.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{532-board_AR-5381u.patch => 530-board_AR-5381u.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{533-board_rta770bw.patch => 531-board_rta770bw.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{534-board_hw556.patch => 532-board_hw556.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{535-board_rta770w.patch => 533-board_rta770w.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{536-board_fast2704.patch => 534-board_fast2704.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{537-board_fast2504n.patch => 535-board_fast2504n.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{555-board_96318ref.patch => 536-board_96318ref.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{556-board_96318ref_p300.patch => 537-board_96318ref_p300.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{557-board_bcm963269bhr.patch => 538-board_bcm963269bhr.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{558-board_AR1004G.patch => 539-board_AR1004G.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{559-board_vw6339gu.patch => 540-board_vw6339gu.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{560-board_963268gu_p300.patch => 541-board_963268gu_p300.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{561-board_WAP-5813n.patch => 542-board_WAP-5813n.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{562-board_VR-3025u.patch => 543-board_VR-3025u.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{563-board_VR-3025un.patch => 544-board_VR-3025un.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{564-board_P870HW-51a_v2.patch => 545-board_P870HW-51a_v2.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{565-board_hw520.patch => 546-board_hw520.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{566-board_A4001N.patch => 547-board_A4001N.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{567-board_dsl-2751b_e1.patch => 548-board_dsl-2751b_e1.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{568-board_DGND3700v1_3800B.patch => 549-board_DGND3700v1_3800B.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{569-board_homehub2a.patch => 550-board_homehub2a.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{570-board_HG655b.patch => 551-board_HG655b.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{571-board_fast2704n.patch => 552-board_fast2704n.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{572-board_VR-3026e.patch => 553-board_VR-3026e.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{573-board_R5010UNv2.patch => 554-board_R5010UNv2.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{574-board_HG622.patch => 555-board_HG622.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{575-board_EVG2000.patch => 556-board_EVG2000.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{576-board_AV4202N.patch => 557-board_AV4202N.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{577-board_VH4032N.patch => 558-board_VH4032N.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{578-board_R1000H.patch => 559-board_R1000H.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{579-board_AR-5315u.patch => 560-board_AR-5315u.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{580-board_AD1018.patch => 561-board_AD1018.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{598-board_sr102.patch => 562-board_sr102.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{599-board-VR-3032u.patch => 563-board-VR-3032u.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{600-board-DGND3700v2.patch => 564-board-DGND3700v2.patch} (100%) rename target/linux/bcm63xx/patches-5.4/{601-board-VG-8050.patch => 565-board-VG-8050.patch} (100%) diff --git a/target/linux/bcm63xx/patches-5.4/519_board_CPVA502plus.patch b/target/linux/bcm63xx/patches-5.4/517_board_CPVA502plus.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/519_board_CPVA502plus.patch rename to target/linux/bcm63xx/patches-5.4/517_board_CPVA502plus.patch diff --git a/target/linux/bcm63xx/patches-5.4/520-bcm63xx-add-support-for-96368MVWG-board.patch b/target/linux/bcm63xx/patches-5.4/518-bcm63xx-add-support-for-96368MVWG-board.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/520-bcm63xx-add-support-for-96368MVWG-board.patch rename to target/linux/bcm63xx/patches-5.4/518-bcm63xx-add-support-for-96368MVWG-board.patch diff --git a/target/linux/bcm63xx/patches-5.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch b/target/linux/bcm63xx/patches-5.4/519-bcm63xx-add-support-for-96368MVNgr-board.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch rename to target/linux/bcm63xx/patches-5.4/519-bcm63xx-add-support-for-96368MVNgr-board.patch diff --git a/target/linux/bcm63xx/patches-5.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch b/target/linux/bcm63xx/patches-5.4/520-MIPS-BCM63XX-add-96328avng-reference-board.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch rename to target/linux/bcm63xx/patches-5.4/520-MIPS-BCM63XX-add-96328avng-reference-board.patch diff --git a/target/linux/bcm63xx/patches-5.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch b/target/linux/bcm63xx/patches-5.4/521-MIPS-BCM63XX-add-963281TAN-reference-board.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch rename to target/linux/bcm63xx/patches-5.4/521-MIPS-BCM63XX-add-963281TAN-reference-board.patch diff --git a/target/linux/bcm63xx/patches-5.4/524-board_dsl_274xb_rev_f.patch b/target/linux/bcm63xx/patches-5.4/522-board_dsl_274xb_rev_f.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/524-board_dsl_274xb_rev_f.patch rename to target/linux/bcm63xx/patches-5.4/522-board_dsl_274xb_rev_f.patch diff --git a/target/linux/bcm63xx/patches-5.4/525-board_96348w3.patch b/target/linux/bcm63xx/patches-5.4/523-board_96348w3.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/525-board_96348w3.patch rename to target/linux/bcm63xx/patches-5.4/523-board_96348w3.patch diff --git a/target/linux/bcm63xx/patches-5.4/526-board_CT6373-1.patch b/target/linux/bcm63xx/patches-5.4/524-board_CT6373-1.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/526-board_CT6373-1.patch rename to target/linux/bcm63xx/patches-5.4/524-board_CT6373-1.patch diff --git a/target/linux/bcm63xx/patches-5.4/527-board_dva-g3810bn-tl-1.patch b/target/linux/bcm63xx/patches-5.4/525-board_dva-g3810bn-tl-1.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/527-board_dva-g3810bn-tl-1.patch rename to target/linux/bcm63xx/patches-5.4/525-board_dva-g3810bn-tl-1.patch diff --git a/target/linux/bcm63xx/patches-5.4/528-board_nb6.patch b/target/linux/bcm63xx/patches-5.4/526-board_nb6.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/528-board_nb6.patch rename to target/linux/bcm63xx/patches-5.4/526-board_nb6.patch diff --git a/target/linux/bcm63xx/patches-5.4/529-board_fast2604.patch b/target/linux/bcm63xx/patches-5.4/527-board_fast2604.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/529-board_fast2604.patch rename to target/linux/bcm63xx/patches-5.4/527-board_fast2604.patch diff --git a/target/linux/bcm63xx/patches-5.4/530-board_A4001N1.patch b/target/linux/bcm63xx/patches-5.4/528-board_A4001N1.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/530-board_A4001N1.patch rename to target/linux/bcm63xx/patches-5.4/528-board_A4001N1.patch diff --git a/target/linux/bcm63xx/patches-5.4/531-board_AR-5387un.patch b/target/linux/bcm63xx/patches-5.4/529-board_AR-5387un.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/531-board_AR-5387un.patch rename to target/linux/bcm63xx/patches-5.4/529-board_AR-5387un.patch diff --git a/target/linux/bcm63xx/patches-5.4/532-board_AR-5381u.patch b/target/linux/bcm63xx/patches-5.4/530-board_AR-5381u.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/532-board_AR-5381u.patch rename to target/linux/bcm63xx/patches-5.4/530-board_AR-5381u.patch diff --git a/target/linux/bcm63xx/patches-5.4/533-board_rta770bw.patch b/target/linux/bcm63xx/patches-5.4/531-board_rta770bw.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/533-board_rta770bw.patch rename to target/linux/bcm63xx/patches-5.4/531-board_rta770bw.patch diff --git a/target/linux/bcm63xx/patches-5.4/534-board_hw556.patch b/target/linux/bcm63xx/patches-5.4/532-board_hw556.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/534-board_hw556.patch rename to target/linux/bcm63xx/patches-5.4/532-board_hw556.patch diff --git a/target/linux/bcm63xx/patches-5.4/535-board_rta770w.patch b/target/linux/bcm63xx/patches-5.4/533-board_rta770w.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/535-board_rta770w.patch rename to target/linux/bcm63xx/patches-5.4/533-board_rta770w.patch diff --git a/target/linux/bcm63xx/patches-5.4/536-board_fast2704.patch b/target/linux/bcm63xx/patches-5.4/534-board_fast2704.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/536-board_fast2704.patch rename to target/linux/bcm63xx/patches-5.4/534-board_fast2704.patch diff --git a/target/linux/bcm63xx/patches-5.4/537-board_fast2504n.patch b/target/linux/bcm63xx/patches-5.4/535-board_fast2504n.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/537-board_fast2504n.patch rename to target/linux/bcm63xx/patches-5.4/535-board_fast2504n.patch diff --git a/target/linux/bcm63xx/patches-5.4/555-board_96318ref.patch b/target/linux/bcm63xx/patches-5.4/536-board_96318ref.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/555-board_96318ref.patch rename to target/linux/bcm63xx/patches-5.4/536-board_96318ref.patch diff --git a/target/linux/bcm63xx/patches-5.4/556-board_96318ref_p300.patch b/target/linux/bcm63xx/patches-5.4/537-board_96318ref_p300.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/556-board_96318ref_p300.patch rename to target/linux/bcm63xx/patches-5.4/537-board_96318ref_p300.patch diff --git a/target/linux/bcm63xx/patches-5.4/557-board_bcm963269bhr.patch b/target/linux/bcm63xx/patches-5.4/538-board_bcm963269bhr.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/557-board_bcm963269bhr.patch rename to target/linux/bcm63xx/patches-5.4/538-board_bcm963269bhr.patch diff --git a/target/linux/bcm63xx/patches-5.4/558-board_AR1004G.patch b/target/linux/bcm63xx/patches-5.4/539-board_AR1004G.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/558-board_AR1004G.patch rename to target/linux/bcm63xx/patches-5.4/539-board_AR1004G.patch diff --git a/target/linux/bcm63xx/patches-5.4/559-board_vw6339gu.patch b/target/linux/bcm63xx/patches-5.4/540-board_vw6339gu.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/559-board_vw6339gu.patch rename to target/linux/bcm63xx/patches-5.4/540-board_vw6339gu.patch diff --git a/target/linux/bcm63xx/patches-5.4/560-board_963268gu_p300.patch b/target/linux/bcm63xx/patches-5.4/541-board_963268gu_p300.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/560-board_963268gu_p300.patch rename to target/linux/bcm63xx/patches-5.4/541-board_963268gu_p300.patch diff --git a/target/linux/bcm63xx/patches-5.4/561-board_WAP-5813n.patch b/target/linux/bcm63xx/patches-5.4/542-board_WAP-5813n.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/561-board_WAP-5813n.patch rename to target/linux/bcm63xx/patches-5.4/542-board_WAP-5813n.patch diff --git a/target/linux/bcm63xx/patches-5.4/562-board_VR-3025u.patch b/target/linux/bcm63xx/patches-5.4/543-board_VR-3025u.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/562-board_VR-3025u.patch rename to target/linux/bcm63xx/patches-5.4/543-board_VR-3025u.patch diff --git a/target/linux/bcm63xx/patches-5.4/563-board_VR-3025un.patch b/target/linux/bcm63xx/patches-5.4/544-board_VR-3025un.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/563-board_VR-3025un.patch rename to target/linux/bcm63xx/patches-5.4/544-board_VR-3025un.patch diff --git a/target/linux/bcm63xx/patches-5.4/564-board_P870HW-51a_v2.patch b/target/linux/bcm63xx/patches-5.4/545-board_P870HW-51a_v2.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/564-board_P870HW-51a_v2.patch rename to target/linux/bcm63xx/patches-5.4/545-board_P870HW-51a_v2.patch diff --git a/target/linux/bcm63xx/patches-5.4/565-board_hw520.patch b/target/linux/bcm63xx/patches-5.4/546-board_hw520.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/565-board_hw520.patch rename to target/linux/bcm63xx/patches-5.4/546-board_hw520.patch diff --git a/target/linux/bcm63xx/patches-5.4/566-board_A4001N.patch b/target/linux/bcm63xx/patches-5.4/547-board_A4001N.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/566-board_A4001N.patch rename to target/linux/bcm63xx/patches-5.4/547-board_A4001N.patch diff --git a/target/linux/bcm63xx/patches-5.4/567-board_dsl-2751b_e1.patch b/target/linux/bcm63xx/patches-5.4/548-board_dsl-2751b_e1.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/567-board_dsl-2751b_e1.patch rename to target/linux/bcm63xx/patches-5.4/548-board_dsl-2751b_e1.patch diff --git a/target/linux/bcm63xx/patches-5.4/568-board_DGND3700v1_3800B.patch b/target/linux/bcm63xx/patches-5.4/549-board_DGND3700v1_3800B.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/568-board_DGND3700v1_3800B.patch rename to target/linux/bcm63xx/patches-5.4/549-board_DGND3700v1_3800B.patch diff --git a/target/linux/bcm63xx/patches-5.4/569-board_homehub2a.patch b/target/linux/bcm63xx/patches-5.4/550-board_homehub2a.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/569-board_homehub2a.patch rename to target/linux/bcm63xx/patches-5.4/550-board_homehub2a.patch diff --git a/target/linux/bcm63xx/patches-5.4/570-board_HG655b.patch b/target/linux/bcm63xx/patches-5.4/551-board_HG655b.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/570-board_HG655b.patch rename to target/linux/bcm63xx/patches-5.4/551-board_HG655b.patch diff --git a/target/linux/bcm63xx/patches-5.4/571-board_fast2704n.patch b/target/linux/bcm63xx/patches-5.4/552-board_fast2704n.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/571-board_fast2704n.patch rename to target/linux/bcm63xx/patches-5.4/552-board_fast2704n.patch diff --git a/target/linux/bcm63xx/patches-5.4/572-board_VR-3026e.patch b/target/linux/bcm63xx/patches-5.4/553-board_VR-3026e.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/572-board_VR-3026e.patch rename to target/linux/bcm63xx/patches-5.4/553-board_VR-3026e.patch diff --git a/target/linux/bcm63xx/patches-5.4/573-board_R5010UNv2.patch b/target/linux/bcm63xx/patches-5.4/554-board_R5010UNv2.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/573-board_R5010UNv2.patch rename to target/linux/bcm63xx/patches-5.4/554-board_R5010UNv2.patch diff --git a/target/linux/bcm63xx/patches-5.4/574-board_HG622.patch b/target/linux/bcm63xx/patches-5.4/555-board_HG622.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/574-board_HG622.patch rename to target/linux/bcm63xx/patches-5.4/555-board_HG622.patch diff --git a/target/linux/bcm63xx/patches-5.4/575-board_EVG2000.patch b/target/linux/bcm63xx/patches-5.4/556-board_EVG2000.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/575-board_EVG2000.patch rename to target/linux/bcm63xx/patches-5.4/556-board_EVG2000.patch diff --git a/target/linux/bcm63xx/patches-5.4/576-board_AV4202N.patch b/target/linux/bcm63xx/patches-5.4/557-board_AV4202N.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/576-board_AV4202N.patch rename to target/linux/bcm63xx/patches-5.4/557-board_AV4202N.patch diff --git a/target/linux/bcm63xx/patches-5.4/577-board_VH4032N.patch b/target/linux/bcm63xx/patches-5.4/558-board_VH4032N.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/577-board_VH4032N.patch rename to target/linux/bcm63xx/patches-5.4/558-board_VH4032N.patch diff --git a/target/linux/bcm63xx/patches-5.4/578-board_R1000H.patch b/target/linux/bcm63xx/patches-5.4/559-board_R1000H.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/578-board_R1000H.patch rename to target/linux/bcm63xx/patches-5.4/559-board_R1000H.patch diff --git a/target/linux/bcm63xx/patches-5.4/579-board_AR-5315u.patch b/target/linux/bcm63xx/patches-5.4/560-board_AR-5315u.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/579-board_AR-5315u.patch rename to target/linux/bcm63xx/patches-5.4/560-board_AR-5315u.patch diff --git a/target/linux/bcm63xx/patches-5.4/580-board_AD1018.patch b/target/linux/bcm63xx/patches-5.4/561-board_AD1018.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/580-board_AD1018.patch rename to target/linux/bcm63xx/patches-5.4/561-board_AD1018.patch diff --git a/target/linux/bcm63xx/patches-5.4/598-board_sr102.patch b/target/linux/bcm63xx/patches-5.4/562-board_sr102.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/598-board_sr102.patch rename to target/linux/bcm63xx/patches-5.4/562-board_sr102.patch diff --git a/target/linux/bcm63xx/patches-5.4/599-board-VR-3032u.patch b/target/linux/bcm63xx/patches-5.4/563-board-VR-3032u.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/599-board-VR-3032u.patch rename to target/linux/bcm63xx/patches-5.4/563-board-VR-3032u.patch diff --git a/target/linux/bcm63xx/patches-5.4/600-board-DGND3700v2.patch b/target/linux/bcm63xx/patches-5.4/564-board-DGND3700v2.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/600-board-DGND3700v2.patch rename to target/linux/bcm63xx/patches-5.4/564-board-DGND3700v2.patch diff --git a/target/linux/bcm63xx/patches-5.4/601-board-VG-8050.patch b/target/linux/bcm63xx/patches-5.4/565-board-VG-8050.patch similarity index 100% rename from target/linux/bcm63xx/patches-5.4/601-board-VG-8050.patch rename to target/linux/bcm63xx/patches-5.4/565-board-VG-8050.patch From a43cbfe2e3a11cbba3f0e92edb96f12531352825 Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Wed, 29 Apr 2020 07:23:34 +0800 Subject: [PATCH 07/13] ramips: remove default switch setup in 02_network ramips images now relies on explicit switch setup for proper failsafe functionality. Remove default cases where it relies on vlan setup in dts and add switch setup for devices affected. Signed-off-by: Chuanhong Guo --- .../mt7620/base-files/etc/board.d/02_network | 20 +-- .../mt76x8/base-files/etc/board.d/02_network | 3 - .../rt288x/base-files/etc/board.d/02_network | 3 - .../rt305x/base-files/etc/board.d/02_network | 159 ++++++++++-------- .../rt3883/base-files/etc/board.d/02_network | 3 - 5 files changed, 95 insertions(+), 93 deletions(-) diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index b780d48179..d024674c10 100755 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -16,11 +16,15 @@ ramips_setup_interfaces() dlink,dwr-116-a1|\ dlink,dwr-921-c1|\ dlink,dwr-922-e2|\ + dovado,tiny-ac|\ ohyeah,oy-0001|\ phicomm,psg1208|\ phicomm,psg1218a|\ planex,db-wrt01|\ planex,mzk-750dhp|\ + ralink,mt7620a-evb|\ + ralink,mt7620a-mt7610e-evb|\ + ralink,mt7620a-v22sg-evb|\ sanlinking,d240|\ youku,yk1|\ zbtlink,zbt-ape522ii|\ @@ -71,18 +75,17 @@ ramips_setup_interfaces() "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" ;; asus,rt-ac51u|\ - asus,rt-ac54u) - ucidef_add_switch "switch0" \ - "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" - ;; + asus,rt-ac54u|\ asus,rt-n14u|\ bdcom,wap2100-sk|\ + edimax,ew-7478apc|\ glinet,gl-mt300a|\ glinet,gl-mt300n|\ glinet,gl-mt750|\ hiwifi,hc5661|\ wrtnode,wrtnode|\ - zbtlink,zbt-wa05) + zbtlink,zbt-wa05|\ + zyxel,keenetic-omni-ii) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" ;; @@ -213,17 +216,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0" ;; - zyxel,keenetic-omni-ii) - ucidef_add_switch "switch0" \ - "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6@eth0" - ;; zyxel,keenetic-viva) ucidef_add_switch "switch1" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "7t@eth0" ;; - *) - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - ;; esac } diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index a6543fd38f..d758fe5543 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -122,9 +122,6 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan:2" "1:lan:1" "4:wan" "6@eth0" ;; - *) - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - ;; esac } diff --git a/target/linux/ramips/rt288x/base-files/etc/board.d/02_network b/target/linux/ramips/rt288x/base-files/etc/board.d/02_network index 0cc0e0b28b..134ac879cd 100755 --- a/target/linux/ramips/rt288x/base-files/etc/board.d/02_network +++ b/target/linux/ramips/rt288x/base-files/etc/board.d/02_network @@ -28,9 +28,6 @@ ramips_setup_interfaces() dlink,dap-1522-a1) ucidef_set_interface_lan "eth0" ;; - *) - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - ;; esac } diff --git a/target/linux/ramips/rt305x/base-files/etc/board.d/02_network b/target/linux/ramips/rt305x/base-files/etc/board.d/02_network index 5f18aa98f5..ae456077fa 100755 --- a/target/linux/ramips/rt305x/base-files/etc/board.d/02_network +++ b/target/linux/ramips/rt305x/base-files/etc/board.d/02_network @@ -4,47 +4,22 @@ . /lib/functions/uci-defaults.sh . /lib/functions/system.sh -ramips_setup_rt3x5x_vlans() -{ - if [ ! -x /sbin/swconfig ]; then - # legacy default - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - return - fi - local wanports="" - local lanports="" - for port in 5 4 3 2 1 0; do - if [ "$(swconfig dev rt305x port $port get disable)" = "1" ]; then - continue - fi - if [ "$(swconfig dev rt305x port $port get lan)" = "0" ]; then - wanports="$port:wan $wanports" - else - lanports="$port:lan $lanports" - fi - done - ucidef_add_switch "rt305x" $lanports $wanports "6t@eth0" -} - ramips_setup_interfaces() { local board="$1" case $board in - accton,wr6202|\ - alfa-network,w502u|\ - netcore,nw718|\ - petatel,psr-680w|\ - skyline,sl-r7205|\ - upvel,ur-336un) - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - ;; + 7links,px-4885-4m|\ + 7links,px-4885-8m|\ allnet,all0256n-4m|\ allnet,all0256n-8m|\ allnet,all5002|\ allnet,all5003|\ + belkin,f7c027|\ dlink,dcs-930l-b1|\ dlink,dcs-930|\ + edimax,3g-6200nl|\ + hame,mpr-a1|\ hame,mpr-a2|\ hauppauge,broadway|\ hootoo,ht-tm02|\ @@ -54,6 +29,7 @@ ramips_setup_interfaces() tenda,3g150b|\ tenda,3g300m|\ tenda,w150m|\ + trendnet,tew-714tru|\ unbranded,a5-v11|\ wansview,ncs601w|\ zorlik,zl5900v2) @@ -61,51 +37,102 @@ ramips_setup_interfaces() ucidef_add_switch_attr "switch0" "enable" "false" ucidef_set_interface_lan "eth0" ;; + 8devices,carambola) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "6@eth0" + ;; + accton,wr6202|\ + alfa-network,w502u|\ + argus,atp-52b|\ + asiarf,awm002-evb-4m|\ + asiarf,awm002-evb-8m|\ + asus,rt-n10-plus|\ + asus,wl-330n|\ + asus,wl-330n3g|\ + aztech,hw550-3g|\ + engenius,esr-9753|\ + jcg,jhr-n805r|\ + jcg,jhr-n825r|\ + jcg,jhr-n926r|\ + petatel,psr-680w|\ + planex,mzk-wdpr|\ + skyline,sl-r7205|\ + teltonika,rut5xx|\ + tenda,w306r-v2|\ + unbranded,xdx-rn502j|\ + upvel,ur-326n4g) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" + ;; + airlive,air3gii|\ + asus,rt-g32-b1|\ + asus,rt-n13u|\ + aximcom,mr-102n|\ + buffalo,whr-g300n|\ + dlink,dap-1350|\ + dlink,dir-300-b1|\ + dlink,dir-300-b7|\ + dlink,dir-320-b1|\ + dlink,dir-600-b1|\ + dlink,dir-610-a1|\ + dlink,dir-615-d|\ + dlink,dir-620-a1|\ + dlink,dir-620-d1|\ + dlink,dwr-512-b|\ + easyacc,wizard-8800|\ + edimax,3g-6200n|\ + fon,fonera-20n|\ + hilink,hlk-rm04|\ + mofinetwork,mofi3500-3gn|\ + netcore,nw718|\ + nexaira,bc2|\ + nixcore,x1-16m|\ + nixcore,x1-8m|\ + olimex,rt5350f-olinuxino|\ + olimex,rt5350f-olinuxino-evb|\ + omnima,miniembplug|\ + omnima,miniembwifi|\ + planex,mzk-w300nh2|\ + poray,ip2202|\ + poray,m3|\ + poray,m4-4m|\ + poray,m4-8m|\ + poray,x5|\ + poray,x8|\ + prolink,pwh2004|\ + ralink,v22rw-2x2|\ + unbranded,wr512-3gn-4m|\ + unbranded,wr512-3gn-8m|\ + upvel,ur-336un|\ + zyxel,keenetic|\ + zyxel,nbg-419n|\ + zyxel,nbg-419n-v2) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" + ;; alphanetworks,asl26555-8m|\ alphanetworks,asl26555-16m) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" ;; - argus,atp-52b|\ - asiarf,awm002-evb-4m|\ - asiarf,awm002-evb-8m|\ - jcg,jhr-n805r|\ - jcg,jhr-n825r|\ - jcg,jhr-n926r|\ - planex,mzk-wdpr|\ - upvel,ur-326n4g) + arcwireless,freestation5) + # FIXME: Which is the actual wan port? ucidef_add_switch "switch0" \ - "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" + "0:lan" "1:wan" "2:wan" "3:wan" "4:wan" "6@eth0" ;; asiarf,awapn2403) ucidef_add_switch "switch0" \ "0:lan" "1:wan" "6@eth0" ;; - asus,wl-330n|\ - easyacc,wizard-8800) - ucidef_set_interface_lan "eth0.1" + aximcom,mr-102n|\ + trendnet,tew-638apb-v2) + ucidef_add_switch "switch0" \ + "4:lan" "6@eth0" ;; - aximcom,mr-102n) - ucidef_set_interface_lan "eth0.2" - ;; - belkin,f5d8235-v2|\ - trendnet,tew-714tru) + belkin,f5d8235-v2) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0" ;; - buffalo,whr-g300n|\ - dlink,dir-300-b7|\ - dlink,dir-320-b1|\ - dlink,dir-610-a1|\ - edimax,3g-6200n|\ - hilink,hlk-rm04|\ - nixcore,x1-16m|\ - nixcore,x1-8m|\ - planex,mzk-w300nh2|\ - zyxel,keenetic) - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" - ;; dlink,dir-615-h1) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0" @@ -133,10 +160,6 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "6t@eth0" ;; - trendnet,tew-638apb-v2) - ucidef_add_switch "switch0" \ - "4:lan" "6@eth0" - ;; wiznet,wizfi630a) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:wan" "6@eth0" @@ -145,14 +168,6 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan:3" "1:lan:2" "2:lan:1" "3:lan:0" "4:wan" "6@eth0" ;; - *) - RT3X5X=$(grep -E "(RT3.5|RT5350)" /proc/cpuinfo) - if [ -n "${RT3X5X}" ]; then - ramips_setup_rt3x5x_vlans - else - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - fi - ;; esac } diff --git a/target/linux/ramips/rt3883/base-files/etc/board.d/02_network b/target/linux/ramips/rt3883/base-files/etc/board.d/02_network index 873c72cea3..7b73f93944 100755 --- a/target/linux/ramips/rt3883/base-files/etc/board.d/02_network +++ b/target/linux/ramips/rt3883/base-files/etc/board.d/02_network @@ -39,9 +39,6 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" ;; - *) - ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" - ;; esac } From 0a05d71f6f34d2e9101fa40e9643d4f7bc8e7501 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Tue, 28 Apr 2020 23:45:41 +0900 Subject: [PATCH 08/13] ramips: fix initramfs image for I-O DATA mt7621 devices This is additional fix of c998ae7f0e9bd51be4935055efbc3834a92698b1. The sysupgrade image of I-O DATA MT7621 devices manufactured by MSTC (MitraStar Technology Corp.) faced to the booting issue. This was caused by imcomplete extraction of large kernel image by U-Boot, and this issue is occurred in initramfs image after fixing of sysupgrade image. So, use lzma-loader for initramfs image to fix the issue. Signed-off-by: INAGAKI Hiroshi Co-developed-by: Yanase Yuki Signed-off-by: Yanase Yuki Tested-by: Yanase Yuki [wn-ax2033gr] --- target/linux/ramips/image/mt7621.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index e3ded2ebc2..94fc85ed1a 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -380,8 +380,8 @@ define Device/iodata_wn-ax1167gr2 $(Device/iodata_nand) UIMAGE_MAGIC := 0x434f4d42 DEVICE_MODEL := WN-AX1167GR2 - KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage 3.10(XBC.1)b10 | \ - iodata-mstc-header + KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \ + custom-initramfs-uimage 3.10(XBC.1)b10 | iodata-mstc-header DEVICE_PACKAGES := kmod-mt7615e wpad-basic endef TARGET_DEVICES += iodata_wn-ax1167gr2 @@ -390,8 +390,8 @@ define Device/iodata_wn-ax2033gr $(Device/iodata_nand) UIMAGE_MAGIC := 0x434f4d42 DEVICE_MODEL := WN-AX2033GR - KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage 3.10(VST.1)C10 | \ - iodata-mstc-header + KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \ + custom-initramfs-uimage 3.10(VST.1)C10 | iodata-mstc-header DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e wpad-basic endef TARGET_DEVICES += iodata_wn-ax2033gr @@ -400,8 +400,8 @@ define Device/iodata_wn-dx1167r $(Device/iodata_nand) UIMAGE_MAGIC := 0x434f4d43 DEVICE_MODEL := WN-DX1167R - KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage 3.10(XIK.1)b10 | \ - iodata-mstc-header + KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \ + custom-initramfs-uimage 3.10(XIK.1)b10 | iodata-mstc-header DEVICE_PACKAGES := kmod-mt7615e wpad-basic endef TARGET_DEVICES += iodata_wn-dx1167r From f7112a180f3655c56fb2c31eff286ee98983ca45 Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Sat, 25 Apr 2020 17:35:53 +0900 Subject: [PATCH 09/13] ramips: 5.4: handle ERR_PTR properly of_get_mac_address can return ERR_PTR since 5.2, so the return pointer should be checked before used. Otherwise it might cause an oops during boot. Signed-off-by: Sungbo Eo --- .../ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index 7191a7a382..358a8fc16d 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -1401,7 +1401,7 @@ static int __init fe_init(struct net_device *dev) fe_reset_phy(priv); mac_addr = of_get_mac_address(priv->dev->of_node); - if (mac_addr) + if (!IS_ERR_OR_NULL(mac_addr)) ether_addr_copy(dev->dev_addr, mac_addr); /* If the mac address is invalid, use random mac address */ From 31697f92a25f8a6700978eedc658cadaacd2e5f2 Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Sat, 25 Apr 2020 17:36:55 +0900 Subject: [PATCH 10/13] ramips: fix MAC address setup for RT5350F-OLinuXino devices Olimex RT5350F-OLinuXino devices do not have a default MAC address, and there is nothing at the 0x4 offset in the factory partition. Using a local address, which is randomly generated by the kernel, would be a better choice. Signed-off-by: Sungbo Eo --- target/linux/ramips/rt305x/base-files/etc/board.d/02_network | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ramips/rt305x/base-files/etc/board.d/02_network b/target/linux/ramips/rt305x/base-files/etc/board.d/02_network index ae456077fa..f34ade8f68 100755 --- a/target/linux/ramips/rt305x/base-files/etc/board.d/02_network +++ b/target/linux/ramips/rt305x/base-files/etc/board.d/02_network @@ -217,8 +217,6 @@ ramips_setup_macs() nexx,wt1520-8m|\ nixcore,x1-16m|\ nixcore,x1-8m|\ - olimex,rt5350f-olinuxino|\ - olimex,rt5350f-olinuxino-evb|\ omnima,miniembplug|\ planex,mzk-w300nh2|\ sitecom,wl-351|\ @@ -241,6 +239,8 @@ ramips_setup_macs() huawei,d105|\ hilink,hlk-rm04|\ nexaira,bc2|\ + olimex,rt5350f-olinuxino|\ + olimex,rt5350f-olinuxino-evb|\ petatel,psr-680w|\ skyline,sl-r7205) lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)") From f996377a265895a30265c10edb63e56e60a67f14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 19 May 2020 13:27:16 +0200 Subject: [PATCH 11/13] bcm63xx: bcm6328: fix strapbus boot sel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Boot selection bit is 18, not 28. Signed-off-by: Álvaro Fernández Rojas --- ...mips-bcm63xx-bcm6328-fix-strapbus-boot-sel.patch | 13 +++++++++++++ ...MIPS-BCM63XX-Register-SPI-flash-if-present.patch | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 target/linux/bcm63xx/patches-5.4/150-mips-bcm63xx-bcm6328-fix-strapbus-boot-sel.patch diff --git a/target/linux/bcm63xx/patches-5.4/150-mips-bcm63xx-bcm6328-fix-strapbus-boot-sel.patch b/target/linux/bcm63xx/patches-5.4/150-mips-bcm63xx-bcm6328-fix-strapbus-boot-sel.patch new file mode 100644 index 0000000000..17e9d7e888 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/150-mips-bcm63xx-bcm6328-fix-strapbus-boot-sel.patch @@ -0,0 +1,13 @@ +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h ++++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h +@@ -1367,8 +1367,8 @@ + #define MISC_STRAPBUS_6328_REG 0x240 + #define STRAPBUS_6328_FCVO_SHIFT 7 + #define STRAPBUS_6328_FCVO_MASK (0x1f << STRAPBUS_6328_FCVO_SHIFT) +-#define STRAPBUS_6328_BOOT_SEL_SERIAL (1 << 28) +-#define STRAPBUS_6328_BOOT_SEL_NAND (0 << 28) ++#define STRAPBUS_6328_BOOT_SEL_SERIAL (1 << 18) ++#define STRAPBUS_6328_BOOT_SEL_NAND (0 << 18) + + /************************************************************************* + * _REG relative to RSET_PCIE diff --git a/target/linux/bcm63xx/patches-5.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch b/target/linux/bcm63xx/patches-5.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch index 7912c26696..0a3b34b743 100644 --- a/target/linux/bcm63xx/patches-5.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch +++ b/target/linux/bcm63xx/patches-5.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch @@ -153,4 +153,4 @@ Signed-off-by: Jonas Gorski +#define STRAPBUS_6328_HSSPI_CLK_FAST (1 << 4) #define STRAPBUS_6328_FCVO_SHIFT 7 #define STRAPBUS_6328_FCVO_MASK (0x1f << STRAPBUS_6328_FCVO_SHIFT) - #define STRAPBUS_6328_BOOT_SEL_SERIAL (1 << 28) + #define STRAPBUS_6328_BOOT_SEL_SERIAL (1 << 18) From 5d3bb7ea9aaa1d9bfb1b9263a5a9bac0ab6d0440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 19 May 2020 13:28:06 +0200 Subject: [PATCH 12/13] kernel: mtdsplit: bcm_wfi: add sercomm support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SERCOMM creates separates partitions for cferam. Signed-off-by: Álvaro Fernández Rojas --- .../drivers/mtd/mtdsplit/mtdsplit_bcm_wfi.c | 70 +++++++++++++------ 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_bcm_wfi.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_bcm_wfi.c index 9fc3c8ac50..0298de7a2f 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_bcm_wfi.c +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_bcm_wfi.c @@ -24,7 +24,7 @@ #include "mtdsplit.h" -#define BCM_WFI_PARTS 4 +#define BCM_WFI_PARTS 3 #define CFERAM_NAME "cferam" #define CFERAM_NAME_LEN (sizeof(CFERAM_NAME) - 1) @@ -126,7 +126,10 @@ static int mtdsplit_parse_bcm_wfi(struct mtd_info *master, struct mtd_part_parser_data *data) { struct mtd_partition *parts; + struct device_node *mtd_node; loff_t cfe_off, kernel_off, rootfs_off; + bool cfe_part = true; + unsigned int num_parts = BCM_WFI_PARTS, cur_part = 0; uint8_t *buf; int ret; @@ -134,15 +137,29 @@ static int mtdsplit_parse_bcm_wfi(struct mtd_info *master, if (!buf) return -ENOMEM; - cfe_off = 0; - ret = jffs2_find_file(master, buf, CFERAM_NAME, CFERAM_NAME_LEN, - &cfe_off); - if (ret) { - kfree(buf); - return ret; + mtd_node = mtd_get_of_node(master); + if (!mtd_node) + return -EINVAL; + + if (of_device_is_compatible(mtd_node, "brcm,wfi-sercomm")) + cfe_part = false; + + if (cfe_part) { + num_parts++; + cfe_off = 0; + + ret = jffs2_find_file(master, buf, CFERAM_NAME, + CFERAM_NAME_LEN, &cfe_off); + if (ret) { + kfree(buf); + return ret; + } + + kernel_off = cfe_off + master->erasesize; + } else { + kernel_off = 0; } - kernel_off = cfe_off + master->erasesize; ret = jffs2_find_file(master, buf, KERNEL_NAME, KERNEL_NAME_LEN, &kernel_off); kfree(buf); @@ -154,34 +171,41 @@ static int mtdsplit_parse_bcm_wfi(struct mtd_info *master, if (ret) return ret; - parts = kzalloc(BCM_WFI_PARTS * sizeof(*parts), GFP_KERNEL); + parts = kzalloc(num_parts * sizeof(*parts), GFP_KERNEL); if (!parts) return -ENOMEM; - parts[0].name = "cferam"; - parts[0].mask_flags = MTD_WRITEABLE; - parts[0].offset = 0; - parts[0].size = kernel_off; + if (cfe_part) { + parts[cur_part].name = "cferam"; + parts[cur_part].mask_flags = MTD_WRITEABLE; + parts[cur_part].offset = 0; + parts[cur_part].size = kernel_off; + cur_part++; + } - parts[1].name = "firmware"; - parts[1].offset = kernel_off; - parts[1].size = master->size - kernel_off; + parts[cur_part].name = "firmware"; + parts[cur_part].offset = kernel_off; + parts[cur_part].size = master->size - kernel_off; + cur_part++; - parts[2].name = KERNEL_PART_NAME; - parts[2].offset = kernel_off; - parts[2].size = rootfs_off - kernel_off; + parts[cur_part].name = KERNEL_PART_NAME; + parts[cur_part].offset = kernel_off; + parts[cur_part].size = rootfs_off - kernel_off; + cur_part++; - parts[3].name = UBI_PART_NAME; - parts[3].offset = rootfs_off; - parts[3].size = master->size - rootfs_off; + parts[cur_part].name = UBI_PART_NAME; + parts[cur_part].offset = rootfs_off; + parts[cur_part].size = master->size - rootfs_off; + cur_part++; *pparts = parts; - return BCM_WFI_PARTS; + return num_parts; } static const struct of_device_id mtdsplit_fit_of_match_table[] = { { .compatible = "brcm,wfi" }, + { .compatible = "brcm,wfi-sercomm" }, { }, }; From 5f826919232db2ca2d3d7e9da00de93c5f6a95bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 19 May 2020 13:29:12 +0200 Subject: [PATCH 13/13] bcm63xx: add unmodded SERCOMM AD1018 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now only HW modded SPI flash version was supported. BCM6328 with 64M RAM and 128M NAND. More info: https://openwrt.org/toh/sercomm/ad1018 Signed-off-by: Álvaro Fernández Rojas --- .../bcm63xx/base-files/etc/board.d/01_leds | 1 + .../bcm63xx/base-files/etc/board.d/02_network | 1 + .../base-files/etc/uci-defaults/09_fix_crc | 3 + .../base-files/lib/upgrade/platform.sh | 6 +- .../bcm63xx/dts/bcm6328-sercomm-ad1018.dts | 210 ++++++++++++++++++ target/linux/bcm63xx/image/Makefile | 25 +++ target/linux/bcm63xx/image/bcm63xx_nand.mk | 18 ++ .../patches-5.4/561-board_AD1018.patch | 3 +- .../bcm63xx/patches-5.4/562-board_sr102.patch | 2 +- .../patches-5.4/563-board-VR-3032u.patch | 2 +- .../patches-5.4/564-board-DGND3700v2.patch | 2 +- .../patches-5.4/565-board-VG-8050.patch | 2 +- 12 files changed, 268 insertions(+), 7 deletions(-) create mode 100644 target/linux/bcm63xx/dts/bcm6328-sercomm-ad1018.dts diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index cdbfa6319b..89105866a4 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -84,6 +84,7 @@ sagem,fast-2704n) sagem,fast-2704-v2) ucidef_set_led_usbdev "usb" "USB" "F@ST2704V2:green:usb" "1-1" ;; +sercomm,ad1018|\ sercomm,ad1018-nor) ucidef_set_led_netdev "wlan0" "WLAN" "AD1018:green:wifi" "wlan0" ;; diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index d0c15a9f98..14eb1091f5 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -132,6 +132,7 @@ netgear,dgnd3700-v1) ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "8t@eth0" ;; +sercomm,ad1018|\ sercomm,ad1018-nor) ucidef_add_switch "switch0" \ "1:lan:3" "2:lan:2" "3:lan:1" "0:wan" "8t@eth0" diff --git a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc index c33e56f28e..813b51fb52 100644 --- a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc @@ -40,4 +40,7 @@ case "$(board_name)" in zyxel,p870hw-51a-v2) do_fixcrc ;; + sercomm,ad1018) + mtd erase bootflag2 + ;; esac diff --git a/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh index e92d025de7..093eba056e 100644 --- a/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm63xx/base-files/lib/upgrade/platform.sh @@ -7,7 +7,8 @@ platform_check_image() { case "$(board_name)" in comtrend,vg-8050|\ comtrend,vr-3032u|\ - netgear,dgnd3700-v2) + netgear,dgnd3700-v2|\ + sercomm,ad1018) # NAND sysupgrade return 0 ;; @@ -65,7 +66,8 @@ platform_do_upgrade() { case "$(board_name)" in comtrend,vg-8050|\ comtrend,vr-3032u|\ - netgear,dgnd3700-v2) + netgear,dgnd3700-v2|\ + sercomm,ad1018) REQUIRE_IMAGE_METADATA=1 cfe_jffs2_upgrade_tar "$1" ;; diff --git a/target/linux/bcm63xx/dts/bcm6328-sercomm-ad1018.dts b/target/linux/bcm63xx/dts/bcm6328-sercomm-ad1018.dts new file mode 100644 index 0000000000..7f9a6e2698 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-sercomm-ad1018.dts @@ -0,0 +1,210 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +/dts-v1/; + +#include "bcm6328.dtsi" + +#include + +/ { + model = "Sercomm AD1018"; + compatible = "sercomm,ad1018", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wifi { + label = "wifi"; + gpios = <&pinctrl 25 1>; + linux,code = ; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + gpios = <&pinctrl 31 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&leds { + status = "ok"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds &pinctrl_serial_led + &pinctrl_ephy0_spd_led &pinctrl_ephy1_act_led + &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; + + brcm,serial-leds; + brcm,serial-shift-inv; + brcm,serial-dat-low; + + led@0 { + reg = <0>; + active-low; + label = "ad1018:red:internet"; + }; + + led@1 { + reg = <1>; + active-low; + label = "ad1018:green:internet"; + }; + + led_power_green: led@8 { + reg = <8>; + active-low; + label = "ad1018:green:power"; + default-state = "on"; + }; + + led@10 { + reg = <10>; + active-low; + label = "ad1018:green:adsl"; + }; + + led@11 { + reg = <11>; + active-low; + label = "ad1018:red:adsl"; + }; + + led@12 { + reg = <12>; + active-low; + label = "ad1018:green:phone"; + }; + + led@13 { + reg = <13>; + active-low; + label = "ad1018:green:wps"; + }; + + led@14 { + reg = <14>; + active-low; + label = "ad1018:green:wifi"; + }; + + led@15 { + reg = <15>; + active-low; + label = "ad1018:green:usb"; + }; + + led@17 { + /* EPHY0 Spd */ + reg = <17>; + brcm,hardware-controlled; + }; +}; + +&nflash { + status = "okay"; + + nandcs@0 { + compatible = "brcm,nandcs"; + #size-cells = <1>; + #address-cells = <1>; + reg = <0>; + nand-ecc-step-size = <512>; + nand-ecc-strength = <15>; + nand-on-flash-bbt; + brcm,nand-oob-sector-size = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "cferom"; + reg = <0x0000000 0x0020000>; + read-only; + }; + + partition@20000 { + label = "mmap"; + reg = <0x0020000 0x00a0000>; + read-only; + }; + + partition@c0000 { + label = "cferam1"; + reg = <0x00c0000 0x0140000>; + read-only; + }; + + partition@200000 { + label = "cferam2"; + reg = <0x0200000 0x0140000>; + read-only; + }; + + partition@520000 { + compatible = "brcm,wfi-sercomm"; + label = "wfi"; + reg = <0x0520000 0x6400000>; + }; + + partition@6920000 { + label = "bootflag1"; + reg = <0x6920000 0x0140000>; + }; + + partition@6a60000 { + label = "bootflag2"; + reg = <0x6a60000 0x0140000>; + }; + + partition@6ba0000 { + label = "xml_cfg"; + reg = <0x6ba0000 0x0280000>; + read-only; + }; + + partition@6e20000 { + label = "app_dat"; + reg = <0x6e20000 0x0280000>; + read-only; + }; + }; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio0", "gpio1"; + }; +}; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/bcm63xx/image/Makefile b/target/linux/bcm63xx/image/Makefile index e392d99f2c..483e711a5d 100644 --- a/target/linux/bcm63xx/image/Makefile +++ b/target/linux/bcm63xx/image/Makefile @@ -95,6 +95,31 @@ define Image/FileSystemStrip $(firstword $(subst +,$(space),$(subst root.,,$(notdir $(1))))) endef +define Build/ad1018-jffs2-cferam + mv $@ $@.kernel + + rm -rf $@-cferam + mkdir -p $@-cferam + + # CFE RAM JFFS2 partition + cp $(KDIR)/bcm63xx-cfe/$(CFE_RAM_FILE) $@-cferam/$(CFE_RAM_JFFS2_NAME) + $(call Build/cfe-jffs2,$@-cferam) + mv $@ $@.cferam + + # First block of CFE RAM 1 will be destroyed by MMAP + dd if=$@.cferam bs=$(BLOCKSIZE) count=1 > $@ + dd if=$@.cferam >> $@ + $(call Build/pad-to,896k) + + # CFE RAM 2 + dd if=$@.cferam >> $@ + + # Append kernel @ 4M + $(call Build/pad-to,4096k) + dd if=$@.kernel >> $@ + rm -f $@.kernel +endef + define Build/cfe-bin $(STAGING_DIR_HOST)/bin/imagetag -i $(IMAGE_KERNEL) -f $(IMAGE_ROOTFS) \ --output $@ --boardid $(CFE_BOARD_ID) --chipid $(CFE_CHIP_ID) \ diff --git a/target/linux/bcm63xx/image/bcm63xx_nand.mk b/target/linux/bcm63xx/image/bcm63xx_nand.mk index 9ff2c989b8..012745bbac 100644 --- a/target/linux/bcm63xx/image/bcm63xx_nand.mk +++ b/target/linux/bcm63xx/image/bcm63xx_nand.mk @@ -85,3 +85,21 @@ define Device/netgear_dgnd3700-v2 CFE_WFI_FLASH_TYPE := 2 endef TARGET_DEVICES += netgear_dgnd3700-v2 + +### Sercomm ### +define Device/sercomm_ad1018 + $(Device/bcm63xx-nand) + IMAGE/cfe.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | ad1018-jffs2-cferam | append-ubi | cfe-wfi-tag + DEVICE_VENDOR := Sercomm + DEVICE_MODEL := AD1018 + CFE_CHIP_ID := 6328 + CFE_RAM_FILE := sercomm,ad1018/cferam + CFE_RAM_JFFS2_NAME := cferam + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 512 + VID_HDR_OFFSET := 2048 + DEVICE_PACKAGES += $(B43_PACKAGES) $(USB2_PACKAGES) + CFE_WFI_FLASH_TYPE := 3 +endef +TARGET_DEVICES += sercomm_ad1018 diff --git a/target/linux/bcm63xx/patches-5.4/561-board_AD1018.patch b/target/linux/bcm63xx/patches-5.4/561-board_AD1018.patch index a48ecf961c..f0c450de38 100644 --- a/target/linux/bcm63xx/patches-5.4/561-board_AD1018.patch +++ b/target/linux/bcm63xx/patches-5.4/561-board_AD1018.patch @@ -82,10 +82,11 @@ &board_AR5381u, &board_AR5387un, &board_963281TAN, -@@ -2719,6 +2787,7 @@ static struct of_device_id const bcm963x +@@ -2719,6 +2787,8 @@ static struct of_device_id const bcm963x { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, { .compatible = "nucom,r5010un-v2", .data = &board_R5010UNV2, }, { .compatible = "sagem,fast-2704-v2", .data = &board_FAST2704V2, }, ++ { .compatible = "sercomm,ad1018", .data = &board_AD1018, }, + { .compatible = "sercomm,ad1018-nor", .data = &board_AD1018, }, #endif #ifdef CONFIG_BCM63XX_CPU_6338 diff --git a/target/linux/bcm63xx/patches-5.4/562-board_sr102.patch b/target/linux/bcm63xx/patches-5.4/562-board_sr102.patch index c8db6c1366..d6af1e56b6 100644 --- a/target/linux/bcm63xx/patches-5.4/562-board_sr102.patch +++ b/target/linux/bcm63xx/patches-5.4/562-board_sr102.patch @@ -58,7 +58,7 @@ #endif }; -@@ -2874,6 +2918,7 @@ static struct of_device_id const bcm963x +@@ -2875,6 +2919,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, { .compatible = "inteno,vg50", .data = &board_vw6339gu, }, diff --git a/target/linux/bcm63xx/patches-5.4/563-board-VR-3032u.patch b/target/linux/bcm63xx/patches-5.4/563-board-VR-3032u.patch index fa63150a1d..a7e297d70e 100644 --- a/target/linux/bcm63xx/patches-5.4/563-board-VR-3032u.patch +++ b/target/linux/bcm63xx/patches-5.4/563-board-VR-3032u.patch @@ -53,7 +53,7 @@ &board_vw6339gu, &board_BSKYB_63168, #endif -@@ -2917,6 +2956,7 @@ static struct of_device_id const bcm963x +@@ -2918,6 +2957,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_63268 { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, diff --git a/target/linux/bcm63xx/patches-5.4/564-board-DGND3700v2.patch b/target/linux/bcm63xx/patches-5.4/564-board-DGND3700v2.patch index 139d2104c5..f17c7a843b 100644 --- a/target/linux/bcm63xx/patches-5.4/564-board-DGND3700v2.patch +++ b/target/linux/bcm63xx/patches-5.4/564-board-DGND3700v2.patch @@ -40,7 +40,7 @@ &board_fast2504n, #endif -@@ -2934,6 +2960,7 @@ static struct of_device_id const bcm963x +@@ -2935,6 +2961,7 @@ static struct of_device_id const bcm963x { .compatible = "bt,home-hub-2-a", .data = &board_homehub2a, }, #endif #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/bcm63xx/patches-5.4/565-board-VG-8050.patch b/target/linux/bcm63xx/patches-5.4/565-board-VG-8050.patch index 75fdf7a698..ceca653ac6 100644 --- a/target/linux/bcm63xx/patches-5.4/565-board-VG-8050.patch +++ b/target/linux/bcm63xx/patches-5.4/565-board-VG-8050.patch @@ -38,7 +38,7 @@ &board_VR3032u, &board_vw6339gu, &board_BSKYB_63168, -@@ -2983,6 +3007,7 @@ static struct of_device_id const bcm963x +@@ -2984,6 +3008,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_63268 { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, },