From patchwork Fri Jan 29 16:01:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Berdai X-Patchwork-Id: 575682 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 8F5281402EC for ; Sat, 30 Jan 2016 03:02:45 +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=U2uN4h7w; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 04AA728BE68; Fri, 29 Jan 2016 17:02:22 +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 BC67B28BCAC for ; Fri, 29 Jan 2016 17:01:49 +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-wm0-f68.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 29 Jan 2016 17:01:49 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id p63so10676273wmp.1 for ; Fri, 29 Jan 2016 08:01:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=PEOv0hjmgGw2Ox/r9Bzf4VZlbBeoomrAheY7ucQHWnE=; b=U2uN4h7wb2ylK2Cc2uXi9/YvJqK+fT6HdIrn/WBR3ZxBEQfPyNtalePMejyG0apbgo Rz1YoXpd2KPGR4K8Gdzl1hRFIe4C24D8SgYhAiC6NDwwhwPycflQsdndoJud1VU2MmD6 Ufo1pwyFefqjt7ii0fgsgaSLnY+IbyG+JaBgTbQmYj+zKh6etqH8tRA+1FpRSz9x0fLh up2Sizia5+exB/9UVsWrQv/5ni4UeL2g41bKkdS/dc//W+Nhld5Cds1EIjA21LEA5UHa RYwUC4cj3gFQ3GHEPiMJvBwkMEWbS6d4ltodFxGMWK7X1WcmEeA0kfzNbstgxpk7GKgr Yi1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding; bh=PEOv0hjmgGw2Ox/r9Bzf4VZlbBeoomrAheY7ucQHWnE=; b=fSV8Z3rif8Rba6FGS72o+NGd9AQJu9ouACAoWixyyTmvciLramlvNNV78huxBa9/bZ fzEqSz9+VglGfy7JM3ayO7Q/6LDmloaHqLwoE7DHGi68ow/xaI0Cjjh/eGKw4nXaGp+3 T+VdDxWNO+gFi8D1VD6dYIn3oVhTH7EuSayHL8Qwlh1TGX8U1bxDvz0ufCBjWsvHK808 EhnWM2wUKba/Jc4qQxhhvon374gqE7o7ojn27dkal7kQLOapFWiwL7I1zuiChsCA8sl/ tTS0Aa2XP2VWmoasXyUzPF6lt3LLupTuUmywVfRyqLUsKJHk4RJn7UTpSYBqEcypg01b MiqQ== X-Gm-Message-State: AG10YOTGhE6W3MC0hhyGgImqYwEdKPgnLyTX+bZVKM0xVYNJZ/pfK5j4I0lfeOTPAjls4g== X-Received: by 10.28.140.142 with SMTP id o136mr9188943wmd.45.1454083308748; Fri, 29 Jan 2016 08:01:48 -0800 (PST) Received: from [192.168.1.67] ([41.142.123.109]) by smtp.gmail.com with ESMTPSA id l194sm8118245wmb.14.2016.01.29.08.01.47 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 08:01:48 -0800 (PST) To: openwrt-devel@lists.openwrt.org From: Mohammed Berdai Message-ID: <56AB8CE9.1050206@gmail.com> Date: Fri, 29 Jan 2016 16:01:45 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Cc: jogo@openwrt.org Subject: [OpenWrt-Devel] [PATCH v3] 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" --image-offset 0x20000 --block-size 0x20000 --pad 8 Signed-off-by: Mohammed Berdai --- 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 + +/ { + 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 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))