From patchwork Thu Dec 24 07:54:10 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: 560817 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 39EE1140C05 for ; Thu, 24 Dec 2015 18:54:59 +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=NPLlOEuh; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6613D28BB49; Thu, 24 Dec 2015 08:54:11 +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 5C3B528BA01 for ; Thu, 24 Dec 2015 08:53:52 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from homiemail-a28.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by arrakis.dune.hu (Postfix) with ESMTP for ; Thu, 24 Dec 2015 08:53:51 +0100 (CET) Received: from homiemail-a28.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a28.g.dreamhost.com (Postfix) with ESMTP id A90741B4059; Wed, 23 Dec 2015 23:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=wrtnode.com; h=message-id :date:subject:from:to:cc:mime-version:content-type: content-transfer-encoding; s=wrtnode.com; bh=qSGjlCRiJ9y6qy9W5zz beH6scgU=; b=NPLlOEuh8UfkvciLiQVue4YYgPkieFqWPhC7K/BspOKoskpNi4O 0MnKC3wyMIF9LOkZ7rjOES9WX7n0VVYDGT68tCqEZAwUw2S9hL/Q6mcV+Od79IWq F3/YkfPJfVyJqQhS/DLj/gMVYw8N5jGB0KhUZ7oc7NjqEgwkRctc8KOE= Received: from webmail.wrtnode.com (caiajhbihbdd.dreamhost.com [208.97.187.133]) (Authenticated sender: xzmu@wrtnode.com) by homiemail-a28.g.dreamhost.com (Postfix) with ESMTPA id 9FDFF1B4058; Wed, 23 Dec 2015 23:54:10 -0800 (PST) Received: from 119.81.178.102 (SquirrelMail authenticated user xzmu@wrtnode.com) by webmail.wrtnode.com with HTTP; Wed, 23 Dec 2015 23:54:10 -0800 Message-ID: <218c179df6c878eb0da2b766c5bfcc6d.squirrel@webmail.wrtnode.com> Date: Wed, 23 Dec 2015 23:54:10 -0800 From: xzmu@wrtnode.com To: blogic@openwrt.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH] add support for WRTnode2P and WRTnode2R 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" Hi blogic this is a patch is add WRTnode2P and WRTnode2R support by OpenWrt commit d0f7a56ed622a488926bb1705686b950dea34cce Author: xzmu Date: Thu Dec 24 15:30:07 2015 +0800 add support for WRTnode2P and WRTnode2R add led indicator support for WRTnode platform Signed-off-by: xzmu 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>; + }; + }; + +}; +