From patchwork Thu May 5 12:42:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_Gonz=C3=A1lez_Cabanelas?= X-Patchwork-Id: 618936 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r0vgy5lvXz9t3V for ; Thu, 5 May 2016 22:42:38 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=P49NyOl8; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B4B68B807CD; Thu, 5 May 2016 14:42:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) 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 autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Thu, 5 May 2016 14:42:31 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 8A039B807B3 for ; Thu, 5 May 2016 14:42:30 +0200 (CEST) X-policyd-weight: using cached result; rate:hard: -7 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 5 May 2016 14:42:30 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id e201so3199346wme.2 for ; Thu, 05 May 2016 05:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=yR79SCTy771j1vKjf2M0Idy+58u70lxl8C59G792TOM=; b=P49NyOl8VYLMp1T8Bd9/SwBhPjP8o+QF/JYFn0JUwB2975Ny+5aJWu2X4TxSPNFItJ 5BX1dr8e/9nZO3flnxIalWYAW6K+a16UCaFTmPQCNR9xxrgwZbAQm3D96evzUnUAht/j EmsKcLMcCioZZ3sPnttdgWKtZYiDBainV2S3UbBL6hYNW9mby3v8wbfpJqHtw+NhaYvr I77kQ+4srLbBH84ytCOZ5nvaPU7IzndfYFEhaGEto1DQc3oem9tdyOM+LVh2AsBWy98y Ccwov2szSVDHU2xxRF/NffBZLOMUYPLqIHPP3sr0mC/npedACxSdbe4Hgzre0piy8kXU u8Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=yR79SCTy771j1vKjf2M0Idy+58u70lxl8C59G792TOM=; b=XVM7r7SvFJ6ZZYkol+WUv5ZBTgA4abGjztFUPqKQt5Gg420cWsrtU3HbkImLGdRSnh 68vgaPLFENX9gO/aRIxQdZ5aty1cPO1b6GVKocETyiSOpRB6VSdf14/Icw+gCN6krKwk ig6KgphL5KM8ZwZJpwvZzfT13iXfXgX5FPUrY2HXVv6xNBvTSfHZbWi/ENxNINGxJfgH 75Az2Ef1oa6ERQr/hZZtLvDsuzPgKBXukB28kjqzTDpQetUHi3YuwbwBqeGgnCccmh6R Mxnrvw0H/1s8vTTZAFhngbDXE26kEzhLf9DKdGcOGeKqfaeZzttFZ0g+Z3GZFKUQ/tsP Zb7A== X-Gm-Message-State: AOPr4FX+A41YtqBJXbzqxYEXjGIfAuw0v78TdSOjEPlavwpEtVpilTTD4IPfalH4UV1pqA== X-Received: by 10.28.31.6 with SMTP id f6mr3115135wmf.69.1462452150060; Thu, 05 May 2016 05:42:30 -0700 (PDT) Received: from tool.localnet ([188.86.76.132]) by smtp.googlemail.com with ESMTPSA id t206sm3016287wmt.21.2016.05.05.05.42.28 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 May 2016 05:42:28 -0700 (PDT) From: dani To: openwrt-devel@lists.openwrt.org Date: Thu, 05 May 2016 14:42:27 +0200 Message-ID: <2161761.QmDFQ3OGFv@tool> User-Agent: KMail/4.14.10 (Linux/4.2.5-1-ARCH; KDE/4.14.14; x86_64; ; ) MIME-Version: 1.0 Subject: [OpenWrt-Devel] [PATCH] brcm63xx: add Observa VH4032N support X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 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" Add support for the Observa VH4032N router. It's a BCM6368 based board with 128MB RAM, 32MB flash. Equiped with an onboard USB hub. This hub has the RST# pin wired to the GPIO27 pin. For pulling the chip out of reset, we use ephy_reset since there isn't specific code for this function in the USB driver. The board has also switch LEDs, but they don't work as it happens with other bcm6368 boards. The GPIO pinmux still needs to be fixed for these hw controlled switch LEDs. Signed-off-by: Daniel Gonzalez diff -urN ./target/linux/brcm63xx/profiles/observa.mk ./target/linux/brcm63xx/profiles/observa.mk --- ./target/linux/brcm63xx/profiles/observa.mk 1970-01-01 01:00:00.000000000 +0100 +++ ./target/linux/brcm63xx/profiles/observa.mk 2016-04-20 21:13:56.680702590 +0200 @@ -0,0 +1,9 @@ +define Profile/VH4032N + NAME:=Observa Telecom VH4032N + PACKAGES:=kmod-b43 kmod-usb-core kmod-usb-ohci kmod-usb2 wpad-mini +endef +define Profile/VH4032N/Description + Package set for the Observa Telecom VH4032N +endef +$(eval $(call Profile,VH4032N)) + diff -urN ./target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc ./target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc --- ./target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc 2016-04-20 14:23:53.371339556 +0200 +++ ./target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc 2016-04-20 19:41:14.853717064 +0200 @@ -30,6 +30,7 @@ spw303v |\ v2110 |\ v2500v_bb |\ + vh4032n |\ vr-3025u |\ vr-3025un |\ vr-3026e |\ diff -urN ./target/linux/brcm63xx/base-files/etc/board.d/02_network ./target/linux/brcm63xx/base-files/etc/board.d/02_network --- ./target/linux/brcm63xx/base-files/etc/board.d/02_network 2016-04-20 14:23:53.371339556 +0200 +++ ./target/linux/brcm63xx/base-files/etc/board.d/02_network 2016-04-20 19:41:14.853717064 +0200 @@ -90,6 +90,7 @@ hg655b |\ p870hw-51a_v2 |\ r5010un_v2 |\ +vh4032n |\ vr-3025un |\ vr-3025u |\ vr-3026e) diff -urN ./target/linux/brcm63xx/base-files/etc/diag.sh ./target/linux/brcm63xx/base-files/etc/diag.sh --- ./target/linux/brcm63xx/base-files/etc/diag.sh 2016-04-20 14:23:53.371339556 +0200 +++ ./target/linux/brcm63xx/base-files/etc/diag.sh 2016-04-20 19:30:24.628933412 +0200 @@ -30,6 +30,9 @@ bcm96348gw-11) status_led="96348GW-11:green:power" ;; + vh4032n) + status_led="VH4032N:red:power" + ;; spw303v) status_led="spw303v:green:power+adsl" ;; diff -urN ./target/linux/brcm63xx/base-files/lib/brcm63xx.sh ./target/linux/brcm63xx/base-files/lib/brcm63xx.sh --- ./target/linux/brcm63xx/base-files/lib/brcm63xx.sh 2016-04-20 14:23:53.371339556 +0200 +++ ./target/linux/brcm63xx/base-files/lib/brcm63xx.sh 2016-04-20 20:53:21.196234734 +0200 @@ -186,6 +186,9 @@ "NuCom R5010UN v2") board_name="r5010un_v2" ;; + "Observa VH4032N") + board_name="vh4032n" + ;; "Pirelli A226G") board_name="a226g" ;; diff -urN ./target/linux/brcm63xx/dts/vh4032n.dts ./target/linux/brcm63xx/dts/vh4032n.dts --- ./target/linux/brcm63xx/dts/vh4032n.dts 1970-01-01 01:00:00.000000000 +0100 +++ ./target/linux/brcm63xx/dts/vh4032n.dts 2016-04-20 20:21:35.905231536 +0200 @@ -0,0 +1,89 @@ +/dts-v1/; + +#include "bcm6368.dtsi" + +#include + +/ { + model = "Observa VH4032N"; + compatible = "observa,vh4032n", "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"; + + dsl_blue { + label = "VH4032N:blue:dsl"; + gpios = <&gpio0 2 1>; + }; + dsl_red { + label = "VH4032N:red:dsl"; + gpios = <&gpio0 5 1>; + }; + hspa_blue { + label = "VH4032N:blue:hspa"; + gpios = <&gpio0 11 1>; + }; + hspa_red { + label = "VH4032N:red:hspa"; + gpios = <&gpio0 12 1>; + }; + power_blue { + label = "VH4032N:blue:power"; + gpios = <&gpio0 22 0>; + }; + power_red { + label = "VH4032N:red:power"; + gpios = <&gpio0 24 0>; + default-state = "on"; + }; + voice_blue { + label = "VH4032N:blue:voice"; + gpios = <&gpio0 25 1>; + }; + voice_red { + label = "VH4032N:red:voice"; + gpios = <&gpio0 26 1>; + }; + }; +}; + +&pflash { + status = "ok"; + + linux,part-probe = "bcm63xxpart"; + + cfe@0 { + label = "CFE"; + reg = <0x0000000 0x0020000>; + read-only; + }; + + linux@20000 { + label = "linux"; + reg = <0x0020000 0x1fc0000>; + }; + + nvram@1fe0000 { + label = "nvram"; + reg = <0x1fe0000 0x020000>; + }; +}; \ No newline at end of file diff -urN ./target/linux/brcm63xx/image/Makefile ./target/linux/brcm63xx/image/Makefile --- ./target/linux/brcm63xx/image/Makefile 2016-04-20 14:23:53.379343455 +0200 +++ ./target/linux/brcm63xx/image/Makefile 2016-04-20 20:59:38.543490836 +0200 @@ -595,6 +595,9 @@ $(eval $(call bcm63xxCfeNetgear,DGND3700v1_3800B,DGND3800B,dgnd3700v1,96368MVWG,6368,--image-offset 0x20000 --block-size 0x20000,U12L144T11_NETGEAR_NEWLED,1)) # NuCom R5010UNv2 $(eval $(call bcm63xxCfe,R5010UNV2,R5010UNv2,r5010unv2,96328ang,6328,--pad 8)) +# Observa VH4032N +$(eval $(call bcm63xxCfe,VH4032N,VH4032N,vh4032n,96368VVW,6368,--image-offset 0x20000 --block-size 0x20000 --pad 16)) +$(eval $(call bcm63xxCfe,VH4032N,VH4032N-sysupgrade,vh4032n,96368VVW,6368,--image-offset 0x20000 --block-size 0x20000)) # Pirelli Alice Gate VoIP 2 Plus Wi-Fi AGPF-S0 $(eval $(call bcm63xxCfe,AGPF_S0,AGV2+W,agpf-s0,AGPF-S0,6358,--block-size 0x20000 --image-offset 0x20000 --signature2 IMAGE --tag-version 8)) # Pirelli A226G diff -urN ./target/linux/brcm63xx/patches-4.1/575-board_VH4032N.patch ./target/linux/brcm63xx/patches-4.1/575-board_VH4032N.patch --- ./target/linux/brcm63xx/patches-4.1/575-board_VH4032N.patch 1970-01-01 01:00:00.000000000 +0100 +++ ./target/linux/brcm63xx/patches-4.1/575-board_VH4032N.patch 2016-04-20 21:09:05.696360759 +0200 @@ -0,0 +1,68 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c 2016-04-21 13:16:08.000000000 +0200 ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c 2016-04-22 12:39:36.540538748 +0200 +@@ -2309,6 +2309,49 @@ + }, + }; + ++static struct board_info __initdata board_VH4032N = { ++ .name = "VH4032N", ++ .expected_cpu_id = 0x6368, ++ ++ .has_uart0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, ++ ++ // Reset onboard USB hub chip using bcm63xx_enet driver. FIXME ++ .ephy_reset_gpio = 27, ++ .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, ++ ++ .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", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++}; ++ + static struct b53_platform_data WAP5813n_b53_pdata = { + .alias = "eth0", + }; +@@ -2613,6 +2672,7 @@ + &board_HG622, + &board_HG655b, + &board_P870HW51A_V2, ++ &board_VH4032N, + &board_VR3025u, + &board_VR3025un, + &board_VR3026e, +@@ -2722,6 +2782,7 @@ + { .compatible = "huawei,hg622", .data = &board_HG622, }, + { .compatible = "huawei,hg655b", .data = &board_HG655b, }, + { .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, }, ++ { .compatible = "observa,vh4032n", .data = &board_VH4032N, }, + { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, + #endif + #ifdef CONFIG_BCM63XX_CPU_63268 diff -urN ./target/linux/brcm63xx/patches-4.4/575-board_VH4032N.patch ./target/linux/brcm63xx/patches-4.4/575-board_VH4032N.patch --- ./target/linux/brcm63xx/patches-4.4/575-board_VH4032N.patch 1970-01-01 01:00:00.000000000 +0100 +++ ./target/linux/brcm63xx/patches-4.4/575-board_VH4032N.patch 2016-04-20 21:09:05.696360759 +0200 @@ -0,0 +1,68 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c 2016-04-21 13:16:08.000000000 +0200 ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c 2016-04-22 12:39:36.540538748 +0200 +@@ -2310,6 +2310,49 @@ + }, + }; + ++static struct board_info __initdata board_VH4032N = { ++ .name = "VH4032N", ++ .expected_cpu_id = 0x6368, ++ ++ .has_uart0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, ++ ++ // Reset onboard USB hub chip using bcm63xx_enet driver. FIXME ++ .ephy_reset_gpio = 27, ++ .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, ++ ++ .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", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++}; ++ + static struct b53_platform_data WAP5813n_b53_pdata = { + .alias = "eth0", + }; +@@ -2614,6 +2673,7 @@ + &board_HG622, + &board_HG655b, + &board_P870HW51A_V2, ++ &board_VH4032N, + &board_VR3025u, + &board_VR3025un, + &board_VR3026e, +@@ -2723,6 +2783,7 @@ + { .compatible = "huawei,hg622", .data = &board_HG622, }, + { .compatible = "huawei,hg655b", .data = &board_HG655b, }, + { .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, }, ++ { .compatible = "observa,vh4032n", .data = &board_VH4032N, }, + { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, + #endif + #ifdef CONFIG_BCM63XX_CPU_63268