From patchwork Tue Aug 18 13:47:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?77ygU1JDSEFDSy5PUkc=?= X-Patchwork-Id: 508311 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 D996214075A for ; Tue, 18 Aug 2015 23:48:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=VkiI84fo; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6D88928C60E; Tue, 18 Aug 2015 15:47:45 +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.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 3AE9D28C5FB for ; Tue, 18 Aug 2015 15:47:38 +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: .gmail. - helo: .mail-pa0-f50.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 18 Aug 2015 15:47:32 +0200 (CEST) Received: by pawq9 with SMTP id q9so36111868paw.3 for ; Tue, 18 Aug 2015 06:48:16 -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; bh=8S+7V1ZBGrq/6iApT1e34Wij/lD/YD2e2nI3AFwhWcA=; b=VkiI84foikIudoOSdtU9ATishKub05Gp3vhFUdqn9oXguQIxgffmfy8HvJOc7mZ/yL 1/nhywDJLxPO6tTLRROfTSexsAbMvnORg+8LhUFBWMxkG51Nve63diohkiO0Sfrcb8uj UDiP3XVkgu5bOYyhcHPCKS7Ie/soSorpJUVHF3Z1bE8KNqpXjkhZF3qAmr3baCkDvz0a 3NsXyNUNO0/n82VUEfCvkCFepTWJjkhwW/SdMJmgoUHNrteXDUYay0BC3g/0q9ydG/IU f1B9NWc3y5Neyb9pt/uG3KI/JbbQvKA2ALmldUHItzGMttuoDfO+QyY3ukuTzmME4qnA 5+iQ== X-Received: by 10.68.244.137 with SMTP id xg9mr13542828pbc.27.1439905695839; Tue, 18 Aug 2015 06:48:15 -0700 (PDT) Received: from mt7620.srchack.org (7c2945b5.i-revonet.jp. [124.41.69.181]) by smtp.gmail.com with ESMTPSA id pi4sm18268628pdb.60.2015.08.18.06.48.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Aug 2015 06:48:15 -0700 (PDT) From: YuheiOKAWA To: openwrt-devel@lists.openwrt.org Date: Tue, 18 Aug 2015 22:47:51 +0900 Message-Id: <1439905671-26850-1-git-send-email-tochiro.srchack@gmail.com> X-Mailer: git-send-email 1.9.1 Subject: [OpenWrt-Devel] [PATCH v3] ramips: add support for Planex DB-WRT01 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" This patch add support for Planex DB-WRT01. DANBOARD route on the MT7620A SoC with two Ethernet port and a 802.11n 2.4 GHz radio. DANBOARD is Cartoon character. Signed-off-by: YuheiOKAWA --- target/linux/ramips/base-files/etc/board.d/01_leds | 3 + .../linux/ramips/base-files/etc/board.d/02_network | 1 + target/linux/ramips/base-files/etc/diag.sh | 1 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/DB-WRT01.dts | 100 +++++++++++++++++++++ target/linux/ramips/image/Makefile | 2 + 7 files changed, 111 insertions(+) create mode 100644 target/linux/ramips/dts/DB-WRT01.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 71cf3ac..a9959e3 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -87,6 +87,9 @@ d105) ucidef_set_led_default "power" "POWER" "$board:red:power" "1" set_usb_led "$board:green:usb" ;; +db-wrt01) + ucidef_set_led_default "power" "power" "$board:orange:power" "1" + ;; dcs-930l-b1) ucidef_set_led_default "power" "POWER" "$board:red:power" "1" ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps" 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 6a2f042..02cd682 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -61,6 +61,7 @@ ramips_setup_interfaces() ;; 3g-6200n|\ ai-br100|\ + db-wrt01|\ dir-300-b7|\ dir-320-b1|\ dir-610-a1|\ diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index a4911b0..f886b5d 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -94,6 +94,7 @@ get_status_led() { y1s) status_led="$board:blue:power" ;; + db-wrt01|\ esr-9753) status_led="$board:orange:power" ;; diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 5cafd45..5b6808e 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -97,6 +97,9 @@ ramips_board_detect() { *"DAP-1350") name="dap-1350" ;; + *"DB-WRT01") + name="db-wrt01" + ;; *"DCS-930") name="dcs-930" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 53e7070..844ed5d 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -36,6 +36,7 @@ platform_check_image() { cf-wr800n|\ d105|\ dap-1350|\ + db-wrt01|\ dcs-930|\ dcs-930l-b1|\ dir-300-b1|\ diff --git a/target/linux/ramips/dts/DB-WRT01.dts b/target/linux/ramips/dts/DB-WRT01.dts new file mode 100644 index 0000000..d0fbaf3 --- /dev/null +++ b/target/linux/ramips/dts/DB-WRT01.dts @@ -0,0 +1,100 @@ +/dts-v1/; + +/include/ "mt7620a.dtsi" + +/ { + compatible = "ralink,mt7620a-soc"; + model = "Planex DB-WRT01"; + + palmbus@10000000 { + gpio1: gpio@638 { + status = "okay"; + }; + + spi@b00 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "en25q64"; + reg = <0 0>; + linux,modalias = "m25p80", "mx25l6405d"; + 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 0x7b0000>; + }; + }; + }; + }; + + pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "spi refclk", "rgmii1"; + ralink,function = "gpio"; + }; + }; + }; + + ethernet@10100000 { + pinctrl-names = "default"; + pinctrl-0 = <&ephy_pins>; + mtd-mac-address = <&factory 0x4>; + ralink,port-map = "llllw"; + }; + + gsw@10110000 { + ralink,port4 = "ephy"; + }; + + wmac@10180000 { + ralink,mtd-eeprom = <&factory 0>; + }; + + pcie@10140000 { + status = "okay"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + power { + label = "db-wrt01:orange:power"; + gpios = <&gpio1 1 1>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + s1 { + label = "wps"; + gpios = <&gpio0 2 1>; + linux,code = <0x211>; + }; + }; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 2f4d4cb..4632ad2 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -868,6 +868,7 @@ Image/Build/Profile/CF-WR800N=$(call BuildFirmware/Default8M/$(1),$(1),cf-wr800n Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size)) na930_mtd_size=20971520 Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size)) +Image/Build/Profile/DB-WRT01=$(call BuildFirmware/Default8M/$(1),$(1),db-wrt01,DB-WRT01) 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),y1,Y1) @@ -901,6 +902,7 @@ define Image/Build/Profile/Default $(call Image/Build/Profile/WHR300HP2,$(1)) $(call Image/Build/Profile/WHR600D,$(1)) $(call Image/Build/Profile/WHR1166D,$(1)) + $(call Image/Build/Profile/DB-WRT01,$(1)) $(call Image/Build/Profile/MZK-750DHP,$(1)) $(call Image/Build/Profile/NA930,$(1)) $(call Image/Build/Profile/OY-0001,$(1))