From patchwork Tue Jan 10 15:39:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: FUKAUMI Naoki X-Patchwork-Id: 713314 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tybn83tqZz9sR9 for ; Wed, 11 Jan 2017 02:39:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="W78lR03n"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cQyWg-0003fU-Um; Tue, 10 Jan 2017 15:39:54 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQyWf-0003eX-1p for lede-dev@bombadil.infradead.org; Tue, 10 Jan 2017 15:39:53 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQyWb-0003qr-3g for lede-dev@lists.infradead.org; Tue, 10 Jan 2017 15:39:51 +0000 Received: by mail-pf0-x243.google.com with SMTP id 127so29495174pfg.0 for ; Tue, 10 Jan 2017 07:39:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=rvAzY/LQjrmgVuBKkzQX07wRYtbxixChueu0xedSpCA=; b=W78lR03nMD9Ua70q/STVW+yF2Vlpfvw2s0+lZ51LDzle2j7RvMgl4ERzCScPWuBU2o rANAU9PH8nJqIKV9P4VUnMGoYMCupvJv9B9PsDupjMpSTkD2qnBIHxuduaKybxushlOI QPvMGuRUcPbSHGjftNF6QwB5V4pBJ9nYZc2iX7ZVQbRkHSZoQHcGJGD/V9HqwdLzcmLd 4dwhJ5V3z8QmeYu5QAz1oNO6fa1H3iWTf5SLAC0qPCoyJS6lL6i4oGvyazgvNXgDhJ2V A9bbwPHiUVU0F2QXe5HIEjK0qO1TTXTV/QJeDzH0nsXADwB4hd/ZDdBokOp6HM9x1+KL zMIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rvAzY/LQjrmgVuBKkzQX07wRYtbxixChueu0xedSpCA=; b=p4t5ZbiUj/O+uhPaQJtCyr5w0Qd14WFUwGw4PWhMlIaA0nNREzENEo3Ol8D6DCHTwK 52IRZZb/71/zasyP4RTD7hPzf1xN0IGQnBq3V4hZ+kyLpnCmJPJGGw0xtHL5FZq6K66j bBGTGru5hiC0BjFouwE0ueMLC26jTCGNP/VccjHn8Gf0j3sVKEtr/Eyy5bvUW1bMBZtI pSbrnnbKnhS5elXTy7hA33/97+f3B2N5Qlc/Hwm8SRsTew73hc14UdAXTJ8HZz3WYpge zOzymoXHicAqnx6fsk+L76TO1MTWx1BlnwIPmBLFuj8P3RsAa2Q3E7tsrfRG7yWx4nOK QZpA== X-Gm-Message-State: AIkVDXIwjYm/H+HPIUfhlvaeA9D07xnQBnjDaBzICd/4ogXBNar3DNAT3HBG2SpYCMnWfw== X-Received: by 10.84.128.46 with SMTP id 43mr5887312pla.100.1484062766185; Tue, 10 Jan 2017 07:39:26 -0800 (PST) Received: from localhost.localdomain (sakura.naobsd.org. [160.16.200.221]) by smtp.gmail.com with ESMTPSA id 18sm6717585pgf.28.2017.01.10.07.39.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Jan 2017 07:39:25 -0800 (PST) From: FUKAUMI Naoki To: lede-dev@lists.infradead.org Date: Wed, 11 Jan 2017 00:39:17 +0900 Message-Id: <20170110153917.10350-1-naobsd@gmail.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170110_153949_323927_4FEB337C X-CRM114-Status: GOOD ( 16.95 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c00:0:0:0:243 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (naobsd[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [LEDE-DEV] [PATCH] ramips: add support for RATOC REX-WIFISD2 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: FUKAUMI Naoki MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org RATOC REX-WIFISD2 is a battery-powered wireless SD card reader with - MT7620A + MT7610E - 64MiB DDR2 SDRAM - 16MiB SPI flash - 2T2R 2.4GHz + 1T1R 5GHz Wi-Fi - 1x 10/100Mbps ethernet switch - 1x SD card - 1x USB 2.0 - 2x programmable LED - 1x button stock firmware is very similar to HooToo Tripmate travel routers. you can do almost anything as a root user with telnet and/or shell script (factory image or "EnterRouterMode.sh") on stock firmware. "EnterRouterMode.sh" will be the easiest way to install. put the following shell script into SD card (or USB storage) as "EnterRouterMode.sh" with "kernel.bin" and "rootfs.bin" files. ---- #!/bin/sh dir=`dirname $0` mtd_write write ${dir}/kernel.bin Kernel_RootFS mtd_write -r write ${dir}/rootfs.bin Rootfs ---- it will be run automatically when SD card is mounted on stock firmware. TFTP can also be used to flash kernel and rootfs. it will be run by press & hold RESET button while power on. (serverip=10.10.10.254) you may use all partitions between "kernel" and "rootfs" as a single "firmware" partition (please edit dts yourself), but "params" partition should be kept if you want to restore stock firmware. Signed-off-by: FUKAUMI Naoki --- .../linux/ramips/base-files/etc/board.d/02_network | 1 + target/linux/ramips/base-files/etc/diag.sh | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/REX-WIFISD2.dts | 145 +++++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 10 ++ 6 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/REX-WIFISD2.dts 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 daf9b33..d59a450 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -189,6 +189,7 @@ ramips_setup_interfaces() mzk-ex750np|\ na930|\ pbr-d1|\ + rex-wifisd2|\ wli-tx4-ag300n|\ wmr-300|\ wrh-300cr) diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index a22be5e..94be032 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -41,7 +41,8 @@ get_status_led() { xdxrn502j) status_led="$board:green:power" ;; - 3g-6200nl) + 3g-6200nl|\ + rex-wifisd2) status_led="$board:green:internet" ;; a5-v11|\ diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 9b82b2a..90f8370 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -400,6 +400,9 @@ ramips_board_detect() { *"RE6500") name="re6500" ;; + *"REX-WIFISD2") + name="rex-wifisd2" + ;; *"RN502J") name="xdxrn502j" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index c097cfa..87f4ecd 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -111,6 +111,7 @@ platform_check_image() { px-4885|\ rb750gr3|\ re6500|\ + rex-wifisd2|\ rp-n53|\ rt5350f-olinuxino|\ rt5350f-olinuxino-evb|\ diff --git a/target/linux/ramips/dts/REX-WIFISD2.dts b/target/linux/ramips/dts/REX-WIFISD2.dts new file mode 100644 index 0000000..ddf7e01 --- /dev/null +++ b/target/linux/ramips/dts/REX-WIFISD2.dts @@ -0,0 +1,145 @@ +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "ratoc,rex-wifisd2", "ralink,mt7620a-soc"; + model = "RATOC REX-WIFISD2"; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + internet { + label = "rex-wifisd2:green:internet"; + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; + }; + + wifi { + label = "rex-wifisd2:blue:wifi"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x2e>; + mediatek,portmap = "llllw"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&pcie { + status = "okay"; + + pcie-bridge { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&factory 0x8000>; + mediatek,2ghz = <0>; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "wled", "ephy"; + ralink,function = "gpio"; + }; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + 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 = "kernel"; + reg = <0x50000 0x180000>; + }; + + partition@1d0000 { + label = "params"; + reg = <0x1d0000 0x10000>; + }; + + partition@1e0000 { + label = "user_backup"; + reg = <0x1e0000 0x10000>; + }; + + partition@1f0000 { + label = "user"; + reg = <0x1f0000 0x10000>; + }; + + partition@200000 { + label = "rootfs"; + reg = <0x200000 0xe00000>; + }; + }; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 1889bcf..d479010 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -462,3 +462,13 @@ define Device/kng_rc zyimage -d 8997 -v "ZyXEL Keenetic Viva" endef TARGET_DEVICES += kng_rc + +define Device/rex-wifisd2 + DTS := REX-WIFISD2 + IMAGES := kernel.bin rootfs.bin + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-rootfs | pad-rootfs + DEVICE_TITLE := RATOC REX-WIFISD2 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += rex-wifisd2