From patchwork Mon Nov 23 07:29:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: play4fun X-Patchwork-Id: 547393 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 0FEF814027C for ; Mon, 23 Nov 2015 18:29:46 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=qq.com header.i=@qq.com header.b=JIXq4/91; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id A88A328C032; Mon, 23 Nov 2015 08:27:27 +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, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6273828C031 for ; Mon, 23 Nov 2015 08:27:20 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from smtpproxy19.qq.com (smtpproxy19.qq.com [184.105.206.84]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 23 Nov 2015 08:27:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201307; t=1448263758; bh=9f0NbPdrhtRwNUVeFECg+LJOzWMPn+vXD/KMlcwl0cY=; h=From:To:Cc:Subject:Date:Message-Id; b=JIXq4/91Dp32tXt5bAteO6o8AWVgZkwE5BteGA7wSYwC0Q3GtCZFkhghTLnwanSoD brjdWkQNIuJ8U0/s2lzy827qXfqkZTe9783mlqPFQR1j+oDdqObjbzeYHMSNVlkvqt yeC39vehl9QAeKNsaTP8uCn8dyXV/m6VTC2Mr6ho= X-QQ-mid: esmtp31t1448263757t430t11846 Received: from ubuntu-desktop.lan (unknown [112.95.187.229]) by esmtp4.qq.com (ESMTP) with id ; Mon, 23 Nov 2015 15:29:09 +0800 (CST) X-QQ-SSF: B1010000000000F0F6501F00000000P X-QQ-FEAT: QX/rXDl9P1uBAt78y8WcxdYvlPZLHp2o7xERAZiAqf193huLSKLj+Uhhay558 fPcgCEO1K2cFOJP5Mi5E/liMLhQsyLH0mmD2VOHZ82W0ALrmH6FqQqsKLDJe0vZ49UXyDVo STHTArFJy6DsLv6d0X6h5yqqziYSNEG4xrwKXiRXQc78XPXq9oY/NJkNZFJeK/zOVz0T66N gF8eFcegRc6sIWCKtIttmmFMu7r/NuRNodWlXIbpJm1MCr6K3zqcvRI6b7PzxrRg= X-QQ-GoodBg: 0 From: Shonn Lu To: openwrt-devel@lists.openwrt.org Date: Mon, 23 Nov 2015 15:29:08 +0800 Message-Id: <1448263748-11950-1-git-send-email-countrysideboy@qq.com> X-Mailer: git-send-email 1.9.1 X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 Subject: [OpenWrt-Devel] [PATCH V2] ramips: add support for Youku YK1 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" Changes since V1: I resend this patch for current trunk.The former V1 patch is for CC branch. Signed-off-by: Shonn Lu --- target/linux/ramips/base-files/etc/board.d/01_leds | 5 + .../linux/ramips/base-files/etc/board.d/02_network | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 3 +- target/linux/ramips/dts/YOUKU-YK1.dts | 127 +++++++++++++++++++++ target/linux/ramips/image/Makefile | 2 + 6 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 target/linux/ramips/dts/YOUKU-YK1.dts diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 5627c8c..1c18ded 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -268,6 +268,11 @@ zbt-wr8305rt) zte-q7) set_wifi_led "$board:blue:status" ;; +youku-yk1) + ucidef_set_led_default "power" "power" "$board:blue:power" "1" + set_wifi_led "$board:blue:air" + set_usb_led "$board:blue:usb" + ;; esac board_config_flush 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 3821742..22809d1 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -84,7 +84,8 @@ ramips_setup_interfaces() wsr-600|\ wt1520|\ y1|\ - zbt-wg2626) + zbt-wg2626|\ + youku-yk1) ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ucidef_add_switch "switch0" "1" "1" ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t" diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index a1bcb72..d6fdeb9 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -460,6 +460,9 @@ ramips_board_detect() { *"ZBT-WR8305RT") name="zbt-wr8305rt" ;; + *"YK1") + name="youku-yk1" + ;; *) name="generic" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 0e8d619..0b9dd43 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -134,7 +134,8 @@ platform_check_image() { zbt-wa05|\ zbt-wg2626|\ zbt-wr8305rt|\ - zte-q7) + zte-q7|\ + youku-yk1) [ "$magic" != "27051956" ] && { echo "Invalid image type." return 1 diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts b/target/linux/ramips/dts/YOUKU-YK1.dts new file mode 100644 index 0000000..418351c --- /dev/null +++ b/target/linux/ramips/dts/YOUKU-YK1.dts @@ -0,0 +1,127 @@ +/dts-v1/; + +/include/ "mt7620a.dtsi" + +/ { + compatible = "YOUKU-YK1", "ralink,mt7620a-soc"; + model = "YOUKU YK1"; + + palmbus@10000000 { + + gpio0: gpio@600 { + status = "okay"; + }; + + gpio1: gpio@638 { + status = "okay"; + }; + + gpio2: gpio@660 { + status = "okay"; + }; + + gpio3: gpio@688 { + status = "okay"; + }; + + 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>; + + 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>; + }; + }; + }; + }; + + pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd"; + ralink,function = "gpio"; + }; + }; + }; + + ethernet@10100000 { + pinctrl-names = "default"; + pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + ralink,port-map = "llllw"; + }; + + wmac@10180000 { + ralink,mtd-eeprom = <&factory 0>; + }; + + sdhci@b0130000 { + status = "okay"; + }; + + ehci@101c0000 { + status = "okay"; + }; + + ohci@101c1000 { + status = "okay"; + }; + + gpio-leds { + compatible = "gpio-leds"; + wan { + label = "youku-yk1:blue:wan"; + gpios = <&gpio2 4 1>; + }; + air { + label = "youku-yk1:blue:air"; + gpios = <&gpio3 0 1>; + }; + usb { + label = "youku-yk1:blue:usb"; + gpios = <&gpio1 11 1>; + }; + power { + label = "youku-yk1:blue:power"; + gpios = <&gpio1 5 1>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio0 1 1>; + linux,code = <0x198>; + }; + }; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 5e19c3f..5a2b98c 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -900,6 +900,7 @@ Image/Build/Profile/WRTNODE=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode,WR Image/Build/Profile/WT3020=$(call BuildFirmware/PorayDualSize/$(1),$(1),wt3020,WT3020) Image/Build/Profile/MIWIFI-MINI=$(call BuildFirmware/Default16M/$(1),$(1),miwifi-mini,MIWIFI-MINI) Image/Build/Profile/ZTE-Q7=$(call BuildFirmware/Default8M/$(1),$(1),zte-q7,ZTE-Q7) +Image/Build/Profile/YOUKU-YK1=$(call BuildFirmware/Default16M/$(1),$(1),youku-yk1,YOUKU-YK1) Image/Build/Profile/ZBT-WA05=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wa05,ZBT-WA05) Image/Build/Profile/ZBT-WR8305RT=$(call BuildFirmware/Default8M/$(1),$(1),zbt-wr8305rt,ZBT-WR8305RT) Image/Build/Profile/ArcherC20i=$(call BuildFirmware/Tplink/$(1),$(1),ArcherC20i,ArcherC20i) @@ -939,6 +940,7 @@ define Image/Build/Profile/Default $(call Image/Build/Profile/WT3020,$(1)) $(call Image/Build/Profile/MIWIFI-MINI,$(1)) $(call Image/Build/Profile/ZTE-Q7,$(1)) + $(call Image/Build/Profile/YOUKU-YK1,$(1)) $(call Image/Build/Profile/ZBT-WA05,$(1)) $(call Image/Build/Profile/ZBT-WR8305RT,$(1)) $(call Image/Build/Profile/ArcherC20i,$(1))