From patchwork Thu Dec 24 08:56:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xzmu@wrtnode.com X-Patchwork-Id: 560826 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 A3B35140C33 for ; Thu, 24 Dec 2015 19:57:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=wrtnode.com header.i=@wrtnode.com header.b=V5RtByZh; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 9EE5E28BCC0; Thu, 24 Dec 2015 09:56:49 +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,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 ACAAC28BCD6 for ; Thu, 24 Dec 2015 09:56:40 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from homiemail-a67.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by arrakis.dune.hu (Postfix) with ESMTP for ; Thu, 24 Dec 2015 09:56:40 +0100 (CET) Received: from homiemail-a67.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a67.g.dreamhost.com (Postfix) with ESMTP id 7987927BC069; Thu, 24 Dec 2015 00:56:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=wrtnode.com; h=from:to:cc :subject:date:message-id; s=wrtnode.com; bh=hG2slWuOgGqUkkQUX6mj 1S13PmA=; b=V5RtByZhQrJE4fwmYebxazUsAVpY9Q6iNFZ67ZSthRXBO/dpbna0 Ii4dc54gr7Tx/T63+F371jxrdZjIZLopyBaJq/ZquBmnzBPL3p3Z1PcZtW3fygJb XLq4KGqa5Eub7xmY/Z0rhuPkDJV4ZpFwKosxewaN0bNc/YHZp9ej4/8= Received: from localhost (66.b2.5177.ip4.static.sl-reverse.com [119.81.178.102]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: xzmu@wrtnode.com) by homiemail-a67.g.dreamhost.com (Postfix) with ESMTPSA id EEA7827BC065; Thu, 24 Dec 2015 00:56:56 -0800 (PST) From: xzmu To: blogic@openwrt.org Date: Thu, 24 Dec 2015 16:56:03 +0800 Message-Id: <1450947363-24793-1-git-send-email-xzmu@wrtnode.com> X-Mailer: git-send-email 2.1.4 Cc: xzmu , openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH] add support for WRTnode2P and WRTnode2R add led support for wrtnode platform 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: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: xzmu --- .../linux/ramips/base-files/etc/board.d/02_network | 2 + target/linux/ramips/base-files/etc/diag.sh | 5 + target/linux/ramips/base-files/lib/ramips.sh | 6 ++ .../ramips/base-files/lib/upgrade/platform.sh | 2 + target/linux/ramips/dts/WRTNODE2P.dts | 99 ++++++++++++++++++ target/linux/ramips/dts/WRTNODE2R.dts | 114 +++++++++++++++++++++ 6 files changed, 228 insertions(+) create mode 100644 target/linux/ramips/dts/WRTNODE2P.dts create mode 100644 target/linux/ramips/dts/WRTNODE2R.dts diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index d7d016b..816a1a7 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -175,6 +175,8 @@ ramips_setup_interfaces() hg255d | \ rt-n14u | \ wrtnode | \ + wrtnode2p | \ + wrtnode2r | \ wt3020 | \ ur-326n4g | \ zbt-wa05) diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index a7e2501..d596b8a 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -253,6 +253,11 @@ get_status_led() { zte-q7) status_led="zte:red:status" ;; + wrtnode2r | \ + wrtnode2p | \ + wrtnode) + status_led="wrtnode:blue:indicator" + ;; esac } diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 4141ddd..6c74412 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -391,6 +391,12 @@ ramips_board_detect() { *"WRTNODE") name="wrtnode" ;; + *"WRTnode2R") + name="wrtnode2r" + ;; + *"WRTnode2P") + name="wrtnode2p" + ;; *"Wansview NCS601W") name="ncs601w" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 2f64d8c..0fc5c26 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -119,6 +119,8 @@ platform_check_image() { wr6202 |\ wr8305rt |\ wrtnode |\ + wrtnode2r |\ + wrtnode2p |\ wt1520 |\ wt3020 |\ x5 |\ diff --git a/target/linux/ramips/dts/WRTNODE2P.dts b/target/linux/ramips/dts/WRTNODE2P.dts new file mode 100644 index 0000000..59866dd --- /dev/null +++ b/target/linux/ramips/dts/WRTNODE2P.dts @@ -0,0 +1,99 @@ +/dts-v1/; + +/include/ "mt7628an.dtsi" + +/ { + compatible = "mediatek,wrtnode2p", "mediatek,mt7628an-soc"; + model = "WRTnode2P"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "gpio", "jtag"; + ralink,function = "gpio"; + }; + }; + }; + + palmbus@10000000 { + spi@b00 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "w25q256"; + reg = <0 0>; + linux,modalias = "m25p80", "w25q256"; + spi-max-frequency = <10000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x1fb0000>; + }; + }; + }; + + uart1@d00 { + status = "okay"; + }; + + }; + + ethernet@10100000 { + mtd-mac-address = <&factory 0x4>; + ralink,port-map = "llllw"; + }; + + sdhci@10130000 { + status = "okay"; + }; + + pcie@10140000 { + status = "okay"; + }; + + gpio-leds { + compatible = "gpio-leds"; + indicator { + label = "wrtnode:blue:indicator"; + gpios = <&gpio1 9 1>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio0 5 1>; + linux,code = <0x198>; + }; + }; +}; + diff --git a/target/linux/ramips/dts/WRTNODE2R.dts b/target/linux/ramips/dts/WRTNODE2R.dts new file mode 100644 index 0000000..7f383ad --- /dev/null +++ b/target/linux/ramips/dts/WRTNODE2R.dts @@ -0,0 +1,114 @@ +/dts-v1/; + +/include/ "mt7628an.dtsi" + +/ { + compatible = "mediatek,wrtnode2r", "mediatek,mt7628an-soc"; + model = "WRTnode2R"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "gpio", "wled_an"; + ralink,function = "gpio"; + }; + }; + }; + + palmbus@10000000 { + spi@b00 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "w25q256"; + reg = <0 0>; + linux,modalias = "m25p80", "w25q256"; + spi-max-frequency = <10000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x1fb0000>; + }; + }; + + + spidev@1 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spidev"; + reg = <1 0>; + linux,modalias = "spidev", "spidev"; + spi-max-frequency = <10000000>; + }; + }; + + uart1@d00 { + status = "okay"; + }; + + i2c@900 { + status = "okay"; + }; + + }; + + ethernet@10100000 { + mtd-mac-address = <&factory 0x4>; + ralink,port-map = "llllw"; + }; + + sdhci@10130000 { + status = "okay"; + }; + + pcie@10140000 { + status = "okay"; + }; + + gpio-leds { + compatible = "gpio-leds"; + indicator { + label = "wrtnode:blue:indicator"; + gpios = <&gpio1 12 1>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio0 5 1>; + linux,code = <0x198>; + }; + }; + +}; +