Created
April 17, 2018 16:20
-
-
Save xc-racer99/59dad16d76598d8cfa6ba216a3fcf1ee to your computer and use it in GitHub Desktop.
VSG 1432 WIP OpenWRT/LEDE 17.01.4 patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 9ab510606a5962a4dcd318d030cd8856fbd4cf9f Mon Sep 17 00:00:00 2001 | |
From: xc-racer99 <[email protected]> | |
Date: Tue, 17 Apr 2018 09:18:26 -0700 | |
Subject: [PATCH] Initial attempt to VSG 1432 | |
Totally untested, on top of v17.01.4 | |
--- | |
.../brcm63xx/base-files/etc/board.d/02_network | 1 + | |
target/linux/brcm63xx/base-files/etc/diag.sh | 3 + | |
.../base-files/etc/uci-defaults/09_fix_crc | 1 + | |
target/linux/brcm63xx/base-files/lib/brcm63xx.sh | 3 + | |
target/linux/brcm63xx/dts/vsg1432.dts | 92 ++++++++++++++++++++++ | |
target/linux/brcm63xx/image/bcm63xx.mk | 16 ++++ | |
.../brcm63xx/patches-4.4/578-board_VSG1432.patch | 62 +++++++++++++++ | |
7 files changed, 178 insertions(+) | |
create mode 100644 target/linux/brcm63xx/dts/vsg1432.dts | |
create mode 100644 target/linux/brcm63xx/patches-4.4/578-board_VSG1432.patch | |
diff --git a/target/linux/brcm63xx/base-files/etc/board.d/02_network b/target/linux/brcm63xx/base-files/etc/board.d/02_network | |
index c83aa62080..afbc2f00fd 100755 | |
--- a/target/linux/brcm63xx/base-files/etc/board.d/02_network | |
+++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network | |
@@ -91,6 +91,7 @@ hg622 |\ | |
hg655b |\ | |
p870hw-51a_v2 |\ | |
r5010un_v2 |\ | |
+vsg1432 |\ | |
vr-3025un |\ | |
vr-3025u |\ | |
vr-3026e) | |
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh | |
index 3a858e4d85..b9fecfefb6 100644 | |
--- a/target/linux/brcm63xx/base-files/etc/diag.sh | |
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh | |
@@ -126,6 +126,9 @@ set_state() { | |
v2110) | |
status_led="V2110:power:green" | |
;; | |
+ vsg1432) | |
+ status_led="VSG1432:power:green" | |
+ ;; | |
esac | |
case "$1" in | |
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc | |
index 650db9da60..12e5650617 100644 | |
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc | |
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc | |
@@ -32,6 +32,7 @@ case "$(brcm63xx_board_name)" in | |
v2110 |\ | |
v2500v_bb |\ | |
vh4032n |\ | |
+ vsg1432 |\ | |
vr-3025u |\ | |
vr-3025un |\ | |
vr-3026e |\ | |
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh | |
index 3dce282fd2..20e17926e1 100755 | |
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh | |
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh | |
@@ -255,6 +255,9 @@ brcm63xx_dt_detect() { | |
"Zyxel P870HW-51a v2") | |
board_name="p870hw-51a_v2" | |
;; | |
+ "Zyxel VSG1432") | |
+ board_name="vsg1432" | |
+ ;; | |
*) | |
board_name="unknown" | |
;; | |
diff --git a/target/linux/brcm63xx/dts/vsg1432.dts b/target/linux/brcm63xx/dts/vsg1432.dts | |
new file mode 100644 | |
index 0000000000..f9ebff059c | |
--- /dev/null | |
+++ b/target/linux/brcm63xx/dts/vsg1432.dts | |
@@ -0,0 +1,92 @@ | |
+/dts-v1/; | |
+ | |
+#include "bcm6368.dtsi" | |
+ | |
+#include <dt-bindings/input/input.h> | |
+ | |
+/ { | |
+ model = "Zyxel VSG1432"; | |
+ compatible = "zyxel,vsg1432", "brcm,bcm6368"; | |
+ | |
+ chosen { | |
+ bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; | |
+ }; | |
+ | |
+ gpio-keys-polled { | |
+ compatible = "gpio-keys-polled"; | |
+ #address-cells = <1>; | |
+ #size-cells = <0>; | |
+ poll-interval = <20>; | |
+ debounce-interval = <60>; | |
+ | |
+ reset { | |
+ label = "reset"; | |
+ gpios = <&gpio1 2 1>; | |
+ linux,code = <0x198>; | |
+ }; | |
+ wps { | |
+ label = "wps"; | |
+ gpios = <&gpio1 1 1>; | |
+ linux,code = <0x211>; | |
+ }; | |
+ }; | |
+ | |
+ gpio-leds { | |
+ compatible = "gpio-leds"; | |
+ | |
+ power_green { | |
+ label = "vsg1432:green:power"; | |
+ gpios = <&gpio0 26 0>; | |
+ }; | |
+ lan1_green { | |
+ label = "VSG1432:green:lan1"; | |
+ gpios = <&gpio0 6 0>; | |
+ }; | |
+ lan2_green { | |
+ label = "VSG1432:green:lan2"; | |
+ gpios = <&gpio0 7 0>; | |
+ }; | |
+ lan3_green { | |
+ label = "VSG1432:green:lan3"; | |
+ gpios = <&gpio0 8 0>; | |
+ }; | |
+ lan4_green { | |
+ label = "VSG1432:green:lan4"; | |
+ gpios = <&gpio0 9 0>; | |
+ }; | |
+ dsl_green { | |
+ label = "VSG1432:green:dsl"; | |
+ gpios = <&gpio0 13 0>; | |
+ }; | |
+ inet_green { | |
+ label = "VSG1432:green:inet"; | |
+ gpios = <&gpio0 5 0>; | |
+ }; | |
+ usb_green { | |
+ label = "VSG1432:green:usb"; | |
+ gpios = <&gpio0 14 0>; | |
+ }; | |
+ }; | |
+}; | |
+ | |
+&pflash { | |
+ status = "ok"; | |
+ | |
+ linux,part-probe = "bcm63xxpart"; | |
+ | |
+ cfe@0 { | |
+ label = "CFE"; | |
+ reg = <0x000000 0x020000>; | |
+ read-only; | |
+ }; | |
+ | |
+ linux@20000 { | |
+ label = "linux"; | |
+ reg = <0x020000 0xfc0000>; | |
+ }; | |
+ | |
+ nvram@fe0000 { | |
+ label = "nvram"; | |
+ reg = <0xfe0000 0x020000>; | |
+ }; | |
+}; | |
diff --git a/target/linux/brcm63xx/image/bcm63xx.mk b/target/linux/brcm63xx/image/bcm63xx.mk | |
index 50478660d6..67191e00f4 100644 | |
--- a/target/linux/brcm63xx/image/bcm63xx.mk | |
+++ b/target/linux/brcm63xx/image/bcm63xx.mk | |
@@ -1096,3 +1096,19 @@ define Device/P870HW-51a_v2 | |
$(B43_PACKAGES) | |
endef | |
TARGET_DEVICES += P870HW-51a_v2 | |
+ | |
+define Device/VSG1432 | |
+ $(Device/bcm63xx) | |
+ IMAGES := factory.bin | |
+ IMAGE/factory.bin := cfe-bin | zyxel-bin | |
+ DEVICE_TITLE := ZyXEL VSG1432 | |
+ DEVICE_DTS := vsg1432 | |
+ CFE_BOARD_ID := 9668MVWG | |
+ CFE_CHIP_ID := 6368 | |
+ CFE_EXTRAS += --rsa-signature "ZyXEL" --signature "ZyXEL_4006_4005" | |
+ FLASH_MB := 16 | |
+ IMAGE_OFFSET := 0x20000 | |
+ DEVICE_PACKAGES := \ | |
+ $(B43_PACKAGES) $(USB2_PACKAGES) | |
+endef | |
+TARGET_DEVICES += VSG1432 | |
diff --git a/target/linux/brcm63xx/patches-4.4/578-board_VSG1432.patch b/target/linux/brcm63xx/patches-4.4/578-board_VSG1432.patch | |
new file mode 100644 | |
index 0000000000..55944fa540 | |
--- /dev/null | |
+++ b/target/linux/brcm63xx/patches-4.4/578-board_VSG1432.patch | |
@@ -0,0 +1,62 @@ | |
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c | |
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c | |
+@@ -2157,6 +2157,43 @@ static struct board_info __initdata board_P870HW51A_V2 = { | |
+ }, | |
+ }; | |
+ | |
++static struct board_info __initdata board_VSG1432 = { | |
++ .name = "VSG1432", | |
++ .expected_cpu_id = 0x6368, | |
++ | |
++ .has_uart0 = 1, | |
++ .has_pci = 1, | |
++ .has_ohci0 = 1, | |
++ .has_ehci0 = 1, | |
++ .num_usbh_ports = 1, | |
++ | |
++ .has_enetsw = 1, | |
++ .enetsw = { | |
++ .used_ports = { | |
++ [0] = { | |
++ .used = 1, | |
++ .phy_id = 1, | |
++ .name = "port1", | |
++ }, | |
++ [1] = { | |
++ .used = 1, | |
++ .phy_id = 2, | |
++ .name = "port2", | |
++ }, | |
++ [2] = { | |
++ .used = 1, | |
++ .phy_id = 3, | |
++ .name = "port3", | |
++ }, | |
++ [3] = { | |
++ .used = 1, | |
++ .phy_id = 4, | |
++ .name = "port4", | |
++ }, | |
++ }, | |
++ }, | |
++}; | |
++ | |
+ static struct board_info __initdata board_VR3025u = { | |
+ .name = "96368M-1541N", | |
+ .expected_cpu_id = 0x6368, | |
+@@ -2654,6 +2691,7 @@ static const struct board_info __initconst *bcm963xx_boards[] = { | |
+ &board_HG622, | |
+ &board_HG655b, | |
+ &board_P870HW51A_V2, | |
++ &board_VSG1432, | |
+ &board_VH4032N, | |
+ &board_VR3025u, | |
+ &board_VR3025un, | |
+@@ -2767,6 +2805,7 @@ static struct of_device_id const bcm963xx_boards_dt[] = { | |
+ { .compatible = "netgear,evg2000", .data = &board_EVG2000, }, | |
+ { .compatible = "observa,vh4032n", .data = &board_VH4032N, }, | |
+ { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, | |
++ { .compatible = "zyxel,vsg1432", .data = &board_VSG1432, }, | |
+ #endif | |
+ #ifdef CONFIG_BCM63XX_CPU_63268 | |
+ { .compatible = "brcm,bcm963268bu_p300", .data = &board_963268bu_p300, }, | |
-- | |
2.11.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment