From patchwork Tue Sep 13 10:56:04 2016 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: 669294 X-Patchwork-Delegate: blogic@openwrt.org 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 3sYMCn6Gbpz9sQw for ; Tue, 13 Sep 2016 21:00:37 +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=0Evu8Sun; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 21923B92BB4; Tue, 13 Sep 2016 13:00:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) 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 autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Tue, 13 Sep 2016 13:00:33 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D7018B92BAB for ; Tue, 13 Sep 2016 13:00:30 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-pf0-f193.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7 Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 13 Sep 2016 13:00:30 +0200 (CEST) Received: by mail-pf0-f193.google.com with SMTP id z84so1135325pfi.2 for ; Tue, 13 Sep 2016 04:00:30 -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=vi2BF3ZKRvqDHZAWL1ZkVk1YFnloU3x5hGOrfu05B9M=; b=0Evu8SunzwqYvwJbID4CeyzfYrqc7/gtL/+DKvpKAroVbcNRd2lHY+xGpDfA7rpDMO 9jgEdEqMWhaLeIT0sQsfUpt6mu/q5aPWtSDBrUVefbKp/iBfTAnjvXY2sbg7/gn7E/4B 9OPGInCxcVLfoYpeTQAqjRmJgWk7aCtX4zflwFnYT0z9cH5BIArO0MafgmPQl2jga23L gW3AANMoazYUl0HuhQmD70XhOktl0Ed63AESuplUbCx2a1hyx6aM5A+Uj7Kc1hsbDSrV 3Vs3hcaMnj3UXL3+VKKReWi8qKS3cRB17kXqAxK68QTpml+ZmqTtSNJFTQ/7WCwN48Zk IvFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vi2BF3ZKRvqDHZAWL1ZkVk1YFnloU3x5hGOrfu05B9M=; b=RHxWEbMMTkul9qoTzaP6t4HDavs3uilWrgrrUaZJYKdKbC8lUnYTMc57FT9Xk/9wlu 4UBVvl+uAsIkXAYGVEYBv22iF4uUAbCiI+qS6IovQd5DLX8RuhjALvRzTeoTHBCq9rqC mtoX0aSQ5dDm4ka9qI/riAeqOej931VKaIl6D0mBlm7LVOO/ISb0EoSB6v+kqk/uuR/S Z8CL+ZZrj2H1GA3AbBb6xQlBYAWcjX1VK1hKCPQMoQt+E3v0fgyvAG7vEMTHK02C7zx9 IvQ41PaSjbeo15oCl6DihxBoJXUbfVlURKP79YcVJosk+YZHE4J+FsgjGAiFR6dGwP4Z hZ9g== X-Gm-Message-State: AE9vXwNOVQMz57bS8L0mabHGpkZjByAdfA7/9Sa4NIMIigxUbFQW0LNjNxY9RU9cBSiRDw== X-Received: by 10.98.193.129 with SMTP id i123mr136755pfg.69.1473764428389; Tue, 13 Sep 2016 04:00:28 -0700 (PDT) Received: from dev.srchack.org (7c2945b5.i-revonet.jp. [124.41.69.181]) by smtp.gmail.com with ESMTPSA id d5sm30455043pfc.4.2016.09.13.04.00.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Sep 2016 04:00:27 -0700 (PDT) From: YuheiOKAWA To: openwrt-devel@lists.openwrt.org Date: Tue, 13 Sep 2016 19:56:04 +0900 Message-Id: <1473764164-17570-1-git-send-email-tochiro.srchack@gmail.com> X-Mailer: git-send-email 1.9.1 Subject: [OpenWrt-Devel] [PATCH] ramips: add support for Planex VR500. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 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" VR500 is Wired Router. non Wireless. - 256MiB RAM, 64MiB SPI Flash. - USB 3.0 x1, USB 2.0 x1 Issue: soft reboot problem. SPI Flash donot exit 4byte address mode. Signed-off-by: YuheiOKAWA --- target/linux/ramips/base-files/etc/board.d/01_leds | 3 +- .../linux/ramips/base-files/etc/board.d/02_network | 5 ++ 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/VR500.dts | 92 ++++++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 8 ++ 7 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/VR500.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 460253c..a96b0f0 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -133,7 +133,8 @@ mzk-ex300np) ;; dir-810l|\ mzk-750dhp|\ -mzk-dp150n) +mzk-dp150n|\ +vr500) ucidef_set_led_default "power" "power" "$board:green:power" "1" ;; ex2700) 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 6157d87..64082df 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -82,6 +82,7 @@ ramips_setup_interfaces() psg1208|\ sap-g3200u3|\ sk-wb8|\ + vr500|\ wf-2881|\ whr-300hp2|\ whr-600d|\ @@ -334,6 +335,10 @@ ramips_setup_macs() lan_mac=$(mtd_get_mac_ascii u-boot-env LAN_MAC_ADDR) wan_mac=$(mtd_get_mac_ascii u-boot-env WAN_MAC_ADDR) ;; + vr500) + lan_mac=$(mtd_get_mac_binary factory 57344) + wan_mac=$(mtd_get_mac_binary factory 57350) + ;; 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/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 0c5abb2..1eb726f 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -26,6 +26,7 @@ get_status_led() { mzk-w300nh2|\ nbg-419n|\ pwh2004|\ + vr500|\ wnce2001|\ wndr3700v5|\ x5|\ diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 10139d7..cb4d6c8 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -415,6 +415,9 @@ ramips_board_detect() { *"VoCore") name="vocore" ;; + *"VR500") + name="vr500" + ;; *"W150M") name="w150m" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index e3bea00..9017342 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -122,6 +122,7 @@ platform_check_image() { ur-336un|\ v22rw-2x2|\ vocore|\ + vr500|\ w150m|\ w306r-v20|\ w502u|\ diff --git a/target/linux/ramips/dts/VR500.dts b/target/linux/ramips/dts/VR500.dts new file mode 100644 index 0000000..3cddce6 --- /dev/null +++ b/target/linux/ramips/dts/VR500.dts @@ -0,0 +1,92 @@ +/dts-v1/; + +#include "mt7621.dtsi" + +/ { + compatible = "ralink,mt7621-eval-board", "ralink,mt7621-soc"; + model = "Planex VR500"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + power { + label = "vr500:green:power"; + gpios = <&gpio1 13 1>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 15 1>; + linux,code = <0x198>; + }; + }; +}; + +&xhci { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + linux,modalias = "m25p80"; + 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 0x3fb0000>; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci"; + ralink,function = "gpio"; + }; + }; +}; + +&pcie { + status = "disabled"; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 3175244..64cfa4a 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -171,6 +171,14 @@ define Device/sk-wb8 endef TARGET_DEVICES += sk-wb8 +define Device/vr500 + DTS := VR500 + IMAGE_SIZE := 66453504 + DEVICE_TITLE := Planex VR500 + DEVICE_PACKAGES := kmod-usb3 +endef +TARGET_DEVICES += vr500 + # FIXME: is this still needed? define Image/Prepare #define Build/Compile