From patchwork Mon Mar 16 16:05:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 450640 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.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0399E1400D5 for ; Tue, 17 Mar 2015 03:05:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=qAwBfxot; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id A07A3281452; Mon, 16 Mar 2015 17:05:08 +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 0F16C281456 for ; Mon, 16 Mar 2015 17:04:57 +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-wg0-f43.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 16 Mar 2015 17:04:52 +0100 (CET) Received: by wgra20 with SMTP id a20so43892145wgr.3 for ; Mon, 16 Mar 2015 09:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=P6wgbvOJbUJr3PUt78cudaCwa9XCb0L5BJYy1srdi80=; b=qAwBfxotH3VAIl14PmfGu9JDsSijNG+xWb6XHkzyQ3Lx0J/C8DcFLWStStbhAJI6xj guuZzCk4XaG2BzMCH+F2qdSrRjooopKsnGjwd5O0d52bKj66fe1TNUQLHyypwJpnPRM7 Vz8+UG4hYwh4SS8pU5fiFJPJcKX5csLVnV6RVb9NUSk+Z9D6LeMrrw6Z5pstOUz0C/58 90N6gF9++bOnScQndyzxhU5cJ5nxQmrUUVKwMgJyO1LUTR2it8eoEwoEuM+xWELqadJo Jl/0ySA99rjRpadSm7LY2dV7PFD0zwTOQ8QfMDPMdep0acpEJDNnkIkJXVfQldREox7e aRZA== X-Received: by 10.194.82.226 with SMTP id l2mr126824545wjy.11.1426521917222; Mon, 16 Mar 2015 09:05:17 -0700 (PDT) Received: from skynet.lan (154.Red-83-46-235.dynamicIP.rima-tde.net. [83.46.235.154]) by mx.google.com with ESMTPSA id vh8sm16010414wjc.12.2015.03.16.09.05.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Mar 2015 09:05:16 -0700 (PDT) From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= To: openwrt-devel@lists.openwrt.org, jogo@openwrt.org Date: Mon, 16 Mar 2015 17:05:11 +0100 Message-Id: <1426521911-21626-2-git-send-email-noltari@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426521911-21626-1-git-send-email-noltari@gmail.com> References: <1425214407-17809-1-git-send-email-noltari@gmail.com> <1426521911-21626-1-git-send-email-noltari@gmail.com> MIME-Version: 1.0 Subject: [OpenWrt-Devel] [PATCH v2 2/2] brcm63xx: add Comtrend VR-3032u support 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" - Avoid bin image generation (only initramfs) - NAND/WiFi not working Signed-off-by: Álvaro Fernández Rojas --- target/linux/brcm63xx/base-files/etc/diag.sh | 3 + .../base-files/etc/uci-defaults/02_network | 3 +- target/linux/brcm63xx/base-files/lib/brcm63xx.sh | 3 + target/linux/brcm63xx/dts/vr-3032u.dts | 142 +++++++++++++++++++++ target/linux/brcm63xx/image/Makefile | 6 + .../brcm63xx/patches-3.18/569-board_VR-3032u.patch | 65 ++++++++++ target/linux/brcm63xx/profiles/comtrend.mk | 9 ++ 7 files changed, 230 insertions(+), 1 deletion(-) create mode 100644 target/linux/brcm63xx/dts/vr-3032u.dts create mode 100644 target/linux/brcm63xx/patches-3.18/569-board_VR-3032u.patch diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh index 928c02b..3d6531a 100644 --- a/target/linux/brcm63xx/base-files/etc/diag.sh +++ b/target/linux/brcm63xx/base-files/etc/diag.sh @@ -39,6 +39,9 @@ set_state() { vr-3025u) status_led="VR-3025u:green:power" ;; + vr-3032u) + status_led="VR-3032u:green:power" + ;; wap-5813n) status_led="WAP-5813n:green:power" ;; diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network index df4e293..f320d4d 100644 --- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network @@ -93,7 +93,8 @@ fast2504n |\ fast2704v2 |\ p870hw-51a_v2 |\ vr-3025un |\ -vr-3025u) +vr-3025u |\ +vr-3032u) ucidef_set_interface_lan "eth0.1" ucidef_add_switch "eth0" "1" "1" ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t" diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh index 2c18762..b64cb9e 100755 --- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh +++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh @@ -84,6 +84,9 @@ brcm63xx_dt_detect() { "Comtrend VR-3025un") board_name="vr-3025un" ;; + "Comtrend VR-3032u") + board_name="vr-3032u" + ;; "Comtrend WAP-5813n") board_name="wap-5813n" ;; diff --git a/target/linux/brcm63xx/dts/vr-3032u.dts b/target/linux/brcm63xx/dts/vr-3032u.dts new file mode 100644 index 0000000..0d56394 --- /dev/null +++ b/target/linux/brcm63xx/dts/vr-3032u.dts @@ -0,0 +1,142 @@ +/dts-v1/; + +/include/ "bcm63268.dtsi" + +/ { + model = "Comtrend VR-3032u"; + compatible = "comtrend,vr-3032u", "brcm,bcm63268"; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + debounce-interval = <60>; + + reset { + label = "reset"; + gpios = <&gpio1 0 1>; + linux,code = <0x198>; + }; + wps { + label = "wps"; + gpios = <&gpio1 1 1>; + linux,code = <0x211>; + }; + }; +}; + +&leds0 { + status = "ok"; + brcm,serial-leds; + + hw_gphy_spd0 { + compatible = "bcm6328-hw-led"; + reg = <0>; + act-low = <16>; + label = "gphy-spd0"; + }; + hw_gphy_spd1 { + compatible = "bcm6328-hw-led"; + reg = <1>; + act-low = <20>; + label = "gphy-spd1"; + }; + hw_ephy0_act { + compatible = "bcm6328-hw-led"; + reg = <9>; + label = "ephy0-act"; + }; + hw_ephy1_act { + compatible = "bcm6328-hw-led"; + reg = <10>; + label = "ephy1-act"; + }; + hw_ephy2_act { + compatible = "bcm6328-hw-led"; + reg = <11>; + label = "ephy2-act"; + }; + hw_gphy0_act { + compatible = "bcm6328-hw-led"; + reg = <12>; + label = "gphy0-act"; + }; + hw_ephy0_spd { + compatible = "bcm6328-hw-led"; + reg = <13>; + label = "ephy0-spd"; + }; + hw_ephy1_spd { + compatible = "bcm6328-hw-led"; + reg = <14>; + label = "ephy1-spd"; + }; + hw_ephy2_spd { + compatible = "bcm6328-hw-led"; + reg = <15>; + label = "ephy2-spd"; + }; + + inet_red { + compatible = "bcm6328-led"; + reg = <2>; + active-low; + label = "VR-3032u:red:inet"; + }; + dsl_green { + compatible = "bcm6328-led"; + reg = <3>; + active-low; + label = "VR-3032u:green:dsl"; + }; + usb_green { + compatible = "bcm6328-led"; + reg = <4>; + active-low; + label = "VR-3032u:green:usb"; + }; + wps_green { + compatible = "bcm6328-led"; + reg = <7>; + active-low; + label = "VR-3032u:green:wps"; + }; + inet_green { + compatible = "bcm6328-led"; + reg = <8>; + active-low; + label = "VR-3032u:green:inet"; + }; + lan2_green { + compatible = "bcm6328-led"; + reg = <9>; + active-low; + label = "VR-3032u:green:lan2"; + }; + lan3_green { + compatible = "bcm6328-led"; + reg = <10>; + active-low; + label = "VR-3032u:green:lan3"; + }; + lan4_green { + compatible = "bcm6328-led"; + reg = <11>; + active-low; + label = "VR-3032u:green:lan4"; + }; + lan1_green { + compatible = "bcm6328-led"; + reg = <12>; + active-low; + label = "VR-3032u:green:lan1"; + }; + power_green { + compatible = "bcm6328-led"; + reg = <20>; + active-low; + label = "VR-3032u:green:power"; + default-state = "on"; + }; +}; diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile index 3fb9b1c..afa2ec7 100755 --- a/target/linux/brcm63xx/image/Makefile +++ b/target/linux/brcm63xx/image/Makefile @@ -59,6 +59,10 @@ define Image/Build/CFEDTB --info2 $(1) $(6) endef +define Image/Build/NANDCFEDTB + # NAND images not supported, only initramfs +endef + define Image/Build/OLDCFEDTB # Generate the tagged image $(TOPDIR)/scripts/brcmImage.pl -t -p \ @@ -274,6 +278,8 @@ $(eval $(call ImageDTB,CFEDTB,CT6373,CT-6373,ct-6373,CT6373-1,6358)) $(eval $(call ImageDTB,CFEDTB,VR3025u,VR-3025u,vr-3025u,96368M-1541N,6368,--pad 16 --image-offset 0x20000 --block-size 0x20000)) # Comtrend VR-3025un $(eval $(call ImageDTB,CFEDTB,VR3025un,VR-3025un,vr-3025un,96368M-1341N,6368,--pad 4)) +# Comtrend VR-3032u +$(eval $(call ImageDTB,NANDCFEDTB,VR3032u,VR-3032u,vr-3032u,963168M-1841N1,63268)) # Comtrend WAP-5813n $(eval $(call ImageDTB,CFEDTB,WAP5813n,WAP-5813n,wap-5813n,96369R-1231N,6368,--pad 4)) # D-Link DSL-2640B, rev B2 diff --git a/target/linux/brcm63xx/patches-3.18/569-board_VR-3032u.patch b/target/linux/brcm63xx/patches-3.18/569-board_VR-3032u.patch new file mode 100644 index 0000000..9529921 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.18/569-board_VR-3032u.patch @@ -0,0 +1,65 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -2578,6 +2578,46 @@ static struct board_info __initdata boar + }, + }; + ++static struct board_info __initdata board_VR3032u = { ++ .name = "963168M-1841N1", ++ .expected_cpu_id = 0x63268, ++ ++ .has_uart0 = 1, ++ ++ .has_ehci0 = 1, ++ .has_ohci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "LAN2", ++ }, ++ ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "LAN3", ++ }, ++ ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "LAN4", ++ }, ++ ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "LAN1", ++ }, ++ }, ++ }, ++}; ++ + static struct board_info __initdata board_vw6339gu = { + .name = "VW6339GU", + .expected_cpu_id = 0x63268, +@@ -2774,6 +2814,7 @@ static const struct board_info __initcon + #ifdef CONFIG_BCM63XX_CPU_63268 + &board_963268bu_p300, + &board_963269bhr, ++ &board_VR3032u, + &board_vw6339gu, + #endif + }; +@@ -2861,6 +2902,7 @@ static struct of_device_id const bcm963x + #endif + #ifdef CONFIG_BCM63XX_CPU_63268 + { .compatible = "brcm,bcm963268bu_p300", .data = &board_963268bu_p300, }, ++ { .compatible = "comtrend,vr-3032u", .data = &board_VR3032u, }, + #endif + #endif /* CONFIG_OF */ + { }, diff --git a/target/linux/brcm63xx/profiles/comtrend.mk b/target/linux/brcm63xx/profiles/comtrend.mk index 8c1b862..4145899 100644 --- a/target/linux/brcm63xx/profiles/comtrend.mk +++ b/target/linux/brcm63xx/profiles/comtrend.mk @@ -73,6 +73,15 @@ define Profile/VR3025un/Description endef $(eval $(call Profile,VR3025un)) +define Profile/VR3032u + NAME:=Comtrend VR-3032u + PACKAGES:=kmod-usb2 kmod-usb-ohci +endef +define Profile/VR3032u/Description + Package set optimized for VR-3032u. +endef +$(eval $(call Profile,VR3032u)) + define Profile/WAP5813n NAME:=Comtrend WAP-5813n PACKAGES:=kmod-b43 wpad-mini \