This router is a ZyXEL VDSL2 router and its board has :
chip ID: BCM6368B2, MIPS: 400MHz,
Total Flash size: 16384K with 128 sectors
Total Memory: 67108864 bytes (64MB)
Board Id (0-15): 96368MVWG

with a usb port, and wifi Broadcom bcm43222.
This router requires the image to have: --signature "ZyXEL_4004" --image-offset 
0x20000 --block-size 0x20000 --pad 8 

Signed-off-by: Mohammed Berdai <mohammed.ber...@gmail.com>
---
Change in v3:
adjusted LEDs GPIOs.

This patch is considered the final one unless you ask for any further 
adjustments. It was tested against many Trunk revisions more than a dozen times.


change in v2:

fixed white space and patch line breakage caused by email client
adjusted partitions layout due to a CRC error that appeared after commit: 
af7e198eee0260b7883c56d1d5076deb7fd3d609
---
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 f96da08..7df3fdd 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/02_network
+++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network
@@ -89,6 +89,7 @@ fast2704v2 |\
 hg622 |\
 hg655b |\
 p870hw-51a_v2 |\
+p870hnu-51b |\
 r5010un_v2 |\
 vr-3025un |\
 vr-3025u |\
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index b864964..3c65005 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -102,6 +102,9 @@ set_state() {
        p870hw-51a_v2)
                status_led="P870HW-51a:green:power"
                ;;
+       p870hnu-51b)
+               status_led="P870HNU-51b:green:power"
+               ;;
        r5010un_v2)
                status_led="R5010UNv2:green:power"
                ;;
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 70dbe2a..56a91de 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
@@ -24,6 +24,7 @@ case "$(brcm63xx_board_name)" in
        hg622 |\
        magic |\
        p870hw-51a_v2 |\
+       p870hnu-51b |\
        r5010un_v2 |\
        rta770bw |\
        rta770w |\
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index a2d6519..6669c7e 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -249,6 +249,9 @@ brcm63xx_dt_detect() {
        "Zyxel P870HW-51a v2")
                board_name="p870hw-51a_v2"
                ;;
+       "Zyxel P870HNU-51b")
+               board_name="p870hnu-51b"
+               ;;
        *)
                board_name="unknown"
                ;;
diff --git 
a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx 
b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
index 7e4dfcb..f17c497 100644
--- a/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
+++ b/target/linux/brcm63xx/base-files/lib/preinit/05_init_interfaces_brcm63xx
@@ -26,6 +26,7 @@ set_preinit_iface() {
        hg622 |\
        neufbox6 |\
        p870hw-51a_v2 |\
+       p870hnu-51b |\
        rta770bw |\
        rta770w |\
        spw303v |\
diff --git a/target/linux/brcm63xx/dts/p870hnu-51b.dts 
b/target/linux/brcm63xx/dts/p870hnu-51b.dts
new file mode 100644
index 0000000..451197c
--- /dev/null
+++ b/target/linux/brcm63xx/dts/p870hnu-51b.dts
@@ -0,0 +1,77 @@
+/dts-v1/;
+
+#include "bcm6368.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+       model = "Zyxel P870HNU-51b";
+       compatible = "zyxel,p870hnu-51b", "brcm,bcm6368";
+
+       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 = <KEY_RESTART>;
+               };
+               wps {
+                       label = "wps";
+                       gpios = <&gpio1 3 1>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               power_green {
+                       label = "P870HNU-51b:green:power";
+                       gpios = <&gpio0 2 1>;
+                       default-state = "on";
+               };
+               dsl_green {
+                       label = "P870HNU-51b:green:dsl";
+                       gpios = <&gpio0 23 1>;
+               };
+               dsl_orange {
+                       label = "P870HNU-51b:orange:dsl";
+                       gpios = <&gpio0 25 1>;
+               };
+               inet_red {
+                       label = "P870HNU-51b:red:inet";
+                       gpios = <&gpio1 1 0>;
+               };
+               wps_orange {
+                       label = "P870HNU-51b:orange:wps";
+                       gpios = <&gpio0 24 1>;
+               };
+       };
+};
+
+&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/Makefile 
b/target/linux/brcm63xx/image/Makefile
index e00b6fb..b4a4c85 100644
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -637,5 +637,7 @@ $(eval $(call 
bcm63xxCfe,TDW8900GB,TD-W8900GB,td-w8900gb,96348GW-11,6348,--rsa-s
 $(eval $(call bcm63xxCfe,USR9108,USR9108,usr9108,96348GW-A,6348))
 # ZyXEL P870HW-51a v2
 $(eval $(call 
bcm63xxCfeZyxel,P870HW_51a_v2,P870HW-51a_v2,p870hw-51a-v2,96368VVW,6368,--rsa-signature
 "ZyXEL" --signature "ZyXEL_0001"))
+# ZyXEL P870HNU-51B
+$(eval $(call 
bcm63xxCfeZyxel,P870HNU_51b,P870HNU-51b,p870hnu-51b,96368MVWG,6368,--rsa-signature
 "ZyXEL" --signature "ZyXEL_4004" --pad 8 --image-offset 0x20000 --block-size 
0x20000))
 
 $(eval $(call BuildImage))
diff --git a/target/linux/brcm63xx/patches-4.1/575-board_P870HNU-51b.patch 
b/target/linux/brcm63xx/patches-4.1/575-board_P870HNU-51b.patch
new file mode 100644
index 0000000..6040f13
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.1/575-board_P870HNU-51b.patch
@@ -0,0 +1,68 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2156,6 +2156,49 @@ static struct board_info __initdata boar
+       },
+ };
+
++static struct board_info __initdata board_P870HNU51B = {
++      .name                           = "P870HNU-51b",
++      .expected_cpu_id                = 0x6368,
++
++      .has_uart0                      = 1,
++      .has_pci                        = 1,
++      .use_fallback_sprom             = 1,
++      .has_ohci0                      = 1,
++      .has_ehci0                      = 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",
++                      },
++              },
++      },
++
++      .fallback_sprom = {
++              .type                           = SPROM_BCM4318,
++              .pci_bus                        = 0,
++              .pci_dev                        = 1,
++      },
++};
++
+ static struct board_info __initdata board_VR3025u = {
+       .name                                   = "96368M-1541N",
+       .expected_cpu_id                = 0x6368,
+@@ -2613,6 +2656,7 @@ static const struct board_info __initcon
+       &board_HG622,
+       &board_HG655b,
+       &board_P870HW51A_V2,
++      &board_P870HNU51B,
+       &board_VR3025u,
+       &board_VR3025un,
+       &board_VR3026e,
+@@ -2723,6 +2767,7 @@ static struct of_device_id const bcm963x
+       { .compatible = "huawei,hg655b", .data = &board_HG655b, },
+       { .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, 
},
+       { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
++      { .compatible = "zyxel,p870hnu-51b", .data = &board_P870HNU51B, },
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_63268
+       { .compatible = "brcm,bcm963268bu_p300", .data = &board_963268bu_p300, 
},
diff --git a/target/linux/brcm63xx/patches-4.4/575-board_P870HNU-51b.patch 
b/target/linux/brcm63xx/patches-4.4/575-board_P870HNU-51b.patch
new file mode 100644
index 0000000..635d2b7
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.4/575-board_P870HNU-51b.patch
@@ -0,0 +1,68 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2157,6 +2157,49 @@ static struct board_info __initdata boar
+       },
+ };
+
++static struct board_info __initdata board_P870HNU51B = {
++      .name                           = "P870HNU-51b",
++      .expected_cpu_id                = 0x6368,
++
++      .has_uart0                      = 1,
++      .has_pci                        = 1,
++      .use_fallback_sprom             = 1,
++      .has_ohci0                      = 1,
++      .has_ehci0                      = 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",
++                      },
++              },
++      },
++
++      .fallback_sprom = {
++              .type                           = SPROM_BCM4318,
++              .pci_bus                        = 0,
++              .pci_dev                        = 1,
++      },
++};
++
+ static struct board_info __initdata board_VR3025u = {
+       .name                                   = "96368M-1541N",
+       .expected_cpu_id                = 0x6368,
+@@ -2614,6 +2657,7 @@ static const struct board_info __initcon
+       &board_HG622,
+       &board_HG655b,
+       &board_P870HW51A_V2,
++      &board_P870HNU51B,
+       &board_VR3025u,
+       &board_VR3025un,
+       &board_VR3026e,
+@@ -2724,6 +2768,7 @@ static struct of_device_id const bcm963x
+       { .compatible = "huawei,hg655b", .data = &board_HG655b, },
+       { .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, 
},
+       { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
++      { .compatible = "zyxel,p870hnu-51b", .data = &board_P870HNU51B, },
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_63268
+       { .compatible = "brcm,bcm963268bu_p300", .data = &board_963268bu_p300, 
},
diff --git a/target/linux/brcm63xx/profiles/zyxel.mk 
b/target/linux/brcm63xx/profiles/zyxel.mk
index 3aca094..81968ff 100644
--- a/target/linux/brcm63xx/profiles/zyxel.mk
+++ b/target/linux/brcm63xx/profiles/zyxel.mk
@@ -13,3 +13,12 @@ define Profile/P870HW_51a_v2/Description
   Package set optimized for P870HW-51a v2.
 endef
 $(eval $(call Profile,P870HW_51a_v2))
+define Profile/P870HNU_51b
+  NAME:=ZyXEL P870HNU-51b
+  PACKAGES:=kmod-b43 wpad-mini \
+        kmod-usb2 kmod-usb-ohci
+endef
+define Profile/P870HNU_51b/Description
+  Package set optimized for P870HNU-51b.
+endef
+$(eval $(call Profile,P870HNU_51b))
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to