From patchwork Sun Dec 20 03:52:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Berdai X-Patchwork-Id: 559307 X-Patchwork-Delegate: jogo@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D14C814031D for ; Sun, 20 Dec 2015 14:52:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=GSMPGoFj; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D887C2815DF; Sun, 20 Dec 2015 04:52:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 197D6281456 for ; Sun, 20 Dec 2015 04:52:14 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-yk0-f175.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-yk0-f175.google.com (mail-yk0-f175.google.com [209.85.160.175]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sun, 20 Dec 2015 04:52:13 +0100 (CET) Received: by mail-yk0-f175.google.com with SMTP id p130so100751605yka.1 for ; Sat, 19 Dec 2015 19:52:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=RBtPFCysbVK+Xbxp9GJ0misIJ16zUU9oV9nvEsh7cE4=; b=GSMPGoFj+0Qu6/mq1A193YhuGOx2LcNoDuv/pyCsKRShIx6kXCn5NpIjG3HGt/iOVC k4anwZoPSxfy62isafJ+Avtj3WOSNIoaOu8agPczLiSe8mlEJnNwtMnDsUQChTqEUBDG NGsFe0vPf1Gx0v1YFz2rVBbYb4VYYem40UXTg+8JSm1CFxyfc01P5d6Cz2cPMG6aAVUf xij9KnWGKYNtM6xizHq+bu1x1vFI5RM8MY/vzFLgh+hNn0nq4pg9k9LoBE4a9VaCOiIg v5WLp06V6SiFsQg9oPfMWDCsIRGEK5hIIdk3iE/2WORPtyR0HU6vJ6lLk57hbKv8ime2 w13g== X-Received: by 10.13.255.70 with SMTP id p67mr9652112ywf.31.1450583549207; Sat, 19 Dec 2015 19:52:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.231.83 with HTTP; Sat, 19 Dec 2015 19:52:09 -0800 (PST) From: Mohammed Berdai Date: Sun, 20 Dec 2015 03:52:09 +0000 Message-ID: To: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH] brcm63xx: add support for ZyXEL P870HNU-51b X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" 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" -pad 8 --image-offset 0x20000 this patch is for Trunk (compiled and tested against trunk@47953 3c298f89-4303-0410-b956-a3cf2f4a3e73 ) 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 c01aba8..061871c 100755 --- a/target/linux/brcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network @@ -88,6 +88,7 @@ fast2504n |\ fast2704v2 |\ 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..fe16f4d 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 bc9ae21..13e01c0 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 @@ -23,6 +23,7 @@ case "$(brcm63xx_board_name)" in dsl-274xb-f |\ 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 7dc57fd..c315910 100755 --- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh +++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh @@ -246,6 +246,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 abf5b89..c516c64 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 @@ -25,6 +25,7 @@ set_preinit_iface() { hg520 |\ 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..b095a32 --- /dev/null +++ b/target/linux/brcm63xx/dts/p870hnu-51b.dts @@ -0,0 +1,77 @@ +/dts-v1/; + +#include "bcm6368.dtsi" + +#include + +/ { + 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 = ; + }; + wps { + label = "wps"; + gpios = <&gpio1 3 1>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + power_green { + label = "P870HNU-51b:green:power"; + gpios = <&gpio0 0 0>; + default-state = "on"; + }; + dsl_green { + label = "P870HNU-51b:green:dsl"; + gpios = <&gpio0 23 1>; + }; + inet_green { + label = "P870HNU-51b:green:inet"; + gpios = <&gpio0 22 1>; + }; + wps_orange { + label = "P870HNU-51b:orange:wps"; + gpios = <&gpio0 24 1>; + }; + inet_red { + label = "P870HNU-51b:red:inet"; + gpios = <&gpio1 1 1>; + }; + }; +}; + +&pflash { + status = "ok"; + + linux,part-probe = "bcm63xxpart"; + + cfe@0 { + label = "CFE"; + reg = <0x000000 0x020000>; + read-only; + }; + + linux@20000 { + label = "linux"; + reg = <0x020000 0xfd0000>; + }; + + nvram@ff0000 { + label = "nvram"; + reg = <0xff0000 0x010000>; + }; +}; diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile index 53e4c21..c7132c0 100644 --- a/target/linux/brcm63xx/image/Makefile +++ b/target/linux/brcm63xx/image/Makefile @@ -634,5 +634,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)) $(eval $(call BuildImage)) diff --git a/target/linux/brcm63xx/patches-4.1/574-board_P870HNU-51b.patch b/target/linux/brcm63xx/patches-4.1/574-board_P870HNU-51b.patch new file mode 100644 index 0000000..96ed543 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.1/574-board_P870HNU-51b.patch @@ -0,0 +1,68 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -2109,6 +2109,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, +@@ -2565,6 +2608,7 @@ static const struct board_info __initcon + &board_DGND3700v1_3800B, + &board_HG655b, + &board_P870HW51A_V2, ++ &board_P870HNU51B, + &board_VR3025u, + &board_VR3025un, + &board_VR3026e, +@@ -2674,6 +2718,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/574-board_P870HNU-51b.patch b/target/linux/brcm63xx/patches-4.4/574-board_P870HNU-51b.patch new file mode 100644 index 0000000..6dc974d --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/574-board_P870HNU-51b.patch @@ -0,0 +1,68 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -2110,6 +2110,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, +@@ -2566,6 +2609,7 @@ static const struct board_info __initcon + &board_DGND3700v1_3800B, + &board_HG655b, + &board_P870HW51A_V2, ++ &board_P870HNU51B, + &board_VR3025u, + &board_VR3025un, + &board_VR3026e, +@@ -2675,6 +2719,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..0735da6 100644 --- a/target/linux/brcm63xx/profiles/zyxel.mk +++ b/target/linux/brcm63xx/profiles/zyxel.mk @@ -13,3 +13,14 @@ 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)) +