From patchwork Mon Jul 6 07:24:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: younfan33 X-Patchwork-Id: 491447 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 80F38140D60 for ; Mon, 6 Jul 2015 17:24:54 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 37D9528073C; Mon, 6 Jul 2015 09:24:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 95AB7280158 for ; Mon, 6 Jul 2015 09:24:18 +0200 (CEST) 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: .hotmail. - helo: .blu004-omc2s22.hotmail. - helo-domain: .hotmail.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from BLU004-OMC2S22.hotmail.com (blu004-omc2s22.hotmail.com [65.55.111.97]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 6 Jul 2015 09:24:18 +0200 (CEST) Received: from BLU436-SMTP177 ([65.55.111.71]) by BLU004-OMC2S22.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Mon, 6 Jul 2015 00:24:31 -0700 X-TMN: [SBJDQloprPB77epzH3BZv4qRL+DmsciW] X-Originating-Email: [younfan33@hotmail.com] Message-ID: From: LiWeijian To: openwrt-devel@lists.openwrt.org Date: Mon, 6 Jul 2015 15:24:20 +0800 X-Mailer: git-send-email 1.7.9.5 X-OriginalArrivalTime: 06 Jul 2015 07:24:30.0683 (UTC) FILETIME=[CC8642B0:01D0B7BC] MIME-Version: 1.0 Subject: [OpenWrt-Devel] [PATCH] ramips: adding support for OY-0001 Wireless Router 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" From: Tom Deng <2579131212@qq.com> Adding support for OY-0001 Wireless Router. OY-0001 is a wireless router made by oyewifi.com. Below is the details: MT7620A, 128MB DDR2, 16MB FLASH, SD Slot, USB 2.0, 4 x LAN + 1 x WAN. Signed-off-by: Tom Deng <2579131212@qq.com> diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 74b8867..35a64dd 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -186,6 +186,9 @@ get_status_led() { f7c027) status_led="belkin:orange:status" ;; + oy-0001) + status_led="oy:green:wifi" + ;; na930) status_led="na930:blue:power" ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds b/target/linux/ramips/base-files/etc/uci-defaults/01_leds index 5d6ed2b..265525a 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds @@ -199,6 +199,10 @@ case $board in set_wifi_led "zbtlink:blue:air" set_usb_led "zbtlink:blue:usb" ;; + oy-0001) + ucidef_set_led_default "power" "power" "oy:green:power" "1" + set_wifi_led "oy:green:wifi" + ;; wr8305rt) ucidef_set_led_default "power" "power" "wr8305rt:sys" "1" set_usb_led "wr8305rt:usb" diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index c3ea489..b847a1b 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -104,6 +104,7 @@ ramips_setup_interfaces() dir-615-h1 | \ hlk-rm04 | \ mzk-w300nh2 | \ + oy-0001 | \ mzk-750dhp) ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ucidef_add_switch "switch0" "1" "1" @@ -221,6 +222,11 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_binary devdata 7) ;; + oy-0001) + lan_mac=$(mtd_get_mac_binary factory 40) + wan_mac=$(mtd_get_mac_binary factory 46) + ;; + w306r-v20) lan_mac=$(cat /sys/class/net/eth0/address) wan_mac=$(macaddr_add "$lan_mac" 5) diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index fd03423..f95adc5 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -325,6 +325,9 @@ ramips_board_detect() { *"Zbtlink ZBT-WA05") name="zbt-wa05" ;; + *"OY-0001") + name="oy-0001" + ;; *"ZBT WR8305RT") name="wr8305rt" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index ba69a89..ad35f9d 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -96,6 +96,7 @@ platform_check_image() { wmr300 |\ wr8305rt |\ wrtnode |\ + oy-0001 |\ x5 |\ x8 |\ zbt-wa05 |\ diff --git a/target/linux/ramips/dts/OY-0001.dts b/target/linux/ramips/dts/OY-0001.dts new file mode 100644 index 0000000..48b7099 --- /dev/null +++ b/target/linux/ramips/dts/OY-0001.dts @@ -0,0 +1,123 @@ +/dts-v1/; + +/include/ "mt7620a.dtsi" + +/ { + compatible = "ralink,mt7620a-soc"; + model = "OY-0001"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + palmbus@10000000 { + gpio2: gpio@660 { + status = "okay"; + }; + + gpio3: gpio@688 { + status = "okay"; + }; + + spi@b00 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "w25q128"; + reg = <0 0>; + linux,modalias = "m25p80", "w25q128"; + spi-max-frequency = <10000000>; + + 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 0xfb0000>; + }; + + }; + }; + }; + + pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd"; + ralink,function = "gpio"; + }; + }; + }; + + ethernet@10100000 { + pinctrl-names = "default"; + pinctrl-0 = <&ephy_pins>; + + ralink,port-map = "llllw"; + }; + + gsw@10110000 { + ralink,port4 = "ephy"; + }; + + wmac@10180000 { + ralink,mtd-eeprom = <&factory 0>; + }; + + gpio-leds { + compatible = "gpio-leds"; + powerled { + label = "oy:green:power"; + gpios = <&gpio0 9 1>; + }; + wifiled { + label = "oy:green:wifi"; + gpios = <&gpio3 0 1>; + }; + }; + + sdhci@10130000 { + status = "okay"; + }; + + ehci@101c0000 { + status = "okay"; + }; + + ohci@101c1000 { + status = "okay"; + }; + + pcie@10140000 { + status = "okay"; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + s1 { + label = "reset"; + gpios = <&gpio0 1 1>; + linux,code = <0x198>; + }; + }; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 86200ab..73ad961 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -724,6 +724,7 @@ Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l na930_mtd_size=20971520 Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size)) Image/Build/Profile/MZK-750DHP=$(call BuildFirmware/Default8M/$(1),$(1),mzk-750dhp,MZK-750DHP) +Image/Build/Profile/OY-0001=$(call BuildFirmware/Default16M/$(1),$(1),oy-0001,OY-0001) Image/Build/Profile/Y1=$(call BuildFirmware/Default16M/$(1),$(1),Lenovo-y1,Y1) Image/Build/Profile/Y1S=$(call BuildFirmware/Default16M/$(1),$(1),Lenovo-y1s,Y1S) @@ -740,6 +741,7 @@ define Image/Build/Profile/Default $(call Image/Build/Profile/WHR1166D,$(1)) $(call Image/Build/Profile/MZK-750DHP,$(1)) $(call Image/Build/Profile/NA930,$(1)) + $(call Image/Build/Profile/OY-0001,$(1)) $(call Image/Build/Profile/Y1,$(1)) $(call Image/Build/Profile/Y1S,$(1)) endef