From patchwork Fri Jul 17 07:32:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robinson Wu X-Patchwork-Id: 1330881 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=qq.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=cPpkZPYV; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=qq.com header.i=@qq.com header.a=rsa-sha256 header.s=s201512 header.b=JC5ol087; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B7NHM0QSFz9sRW for ; Fri, 17 Jul 2020 17:37:03 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Message-ID:Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=DctsZGZJh3blNNo7zIMV//IyvO3FCCgCQK2BYksY8VM=; b=cPpkZPYVvyp94U GwTdVelXc6nX4IaO1Tn9i20wZYqVg1zPHOEOSNXc8H9NTfRkuCCb1Ob9d61eJhoaA53BZNBWKEJcf e8ND+QL2PrgrMZWOqQ4uE485IWXDAu6T9xWLXtuWd1HfnL7v37uXH/SGC1KWp/3i/xOsSl03sE3RF Ax1GdvM+aFGKCng+Uezu/BStq9DRzhm7twZaT1jHx3FNl5CfLnKAeWJ/BTsaweDT2saoG/ESCbVKf JN+mn4RXqeUWIs4suM7bGpgQpDIJi7CoQEOOknJe5gWVhIxZSfvcBJsIjGJO0QHAZE6G77JHeaGwd zo67K9zuxXP9CDbySdvg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwKtx-0006Pc-8q; Fri, 17 Jul 2020 07:35:25 +0000 Received: from out203-205-221-202.mail.qq.com ([203.205.221.202] helo=qq.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwKts-0006OW-ID for openwrt-devel@lists.openwrt.org; Fri, 17 Jul 2020 07:35:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1594971316; bh=6rp5cSnMlwkfx3hbAuf22VhjiMrSYKhbqEYjD3GKoIg=; h=From:To:Cc:Subject:Date; b=JC5ol087IZERRvYN2+nSQsovGpQxluwprsZRc+uK1ZsqOfdlHbLdVtECLczKl/Wzv WPEBo/lNFhxZrC0NgHdhjIL12uqHrFetw1l2MjPghJ3+EMUd4MeDtywhCsh0IqYYv6 b3kVQif1oo/Yg40qrGeAI7Oe4BEBFzSIpZEISflU= Received: from localhost.localdomain ([125.118.193.70]) by newxmesmtplogicsvrszb5.qq.com (NewEsmtp) with SMTP id 88010A47; Fri, 17 Jul 2020 15:34:00 +0800 X-QQ-mid: xmsmtpt1594971240tbmxmllfi Messag-ID: X-QQ-XMAILINFO: OG9J8Zd/DkDdA6KXaLmQwlsVHCltnZ3CsgFNGF+3H27/iMKt1tkXlzcfqcb/XY icBe+JDjQbDcbuGRmsKabGw/1A+dza5uxwBVDO0qzWLPCYbURyIQ2tU5+VK+Hh4tUD7WxIIRb2Fj dtgG9lQNj07F1rabOatcki9Jm8vpQJjJ7g+/w/4kVaDMr6cYAXgcKEQNAQHGlWJXKfjMQrpjiGD1 n6IpdZJmsk7HQbBH6f04/2RuyoJ8Z1EFHov3nttDRifuktwX11G/FMMIrPiMccAthNl+2V3QCETD IXlO/5VO70pC7q3j3NoaSs1tm0RLxWCyedZyilskuSYcP9X5xe2PKokZdGRSz75EnRbjUAAC91Dq mAbrFFF2tjWAwVZDw4nO9p2qmXqnONjG3z3rLz7H+wyT12pWBqwqMuhrij7ALVGL7sw6SIiynBoR DFn73/CTKB9KNM7ITIWr3U2t2WSTn3ieHiK4baRKPjYobfyH9Hl9eiWS3PWlX+0TTv/BiaGJKPlq d/6yYBZSIdsFhC1NZoYIDnZTcMnXmMe/4wbgPqk7YIi+AYGfpwFB4R6i+TQ/OOU9vOK+8D+xeXPG xxYRwzVSQFtNF8q+daqOqwz+b7Rdx/fC279zx/nnp4bXSQApTm8DoTuSXcK1yTyW67DptWnLHJQQ iQvtZCf+ndLKUC4wP+HdxfvBARA+JKOAgz6BFZJdlK0mDYVYDB+ocopoOg1jxtYVIxCQ== From: Robinson Wu To: openwrt-devel@lists.openwrt.org Subject: [PATCH v7] ramips: add support for JS76x8 series DEV boards Date: Fri, 17 Jul 2020 15:32:53 +0800 X-OQ-MSGID: <1594971173-24143-1-git-send-email-wurobinson@qq.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200717_033521_090875_AA4F32DD X-CRM114-Status: GOOD ( 13.06 ) X-Spam-Score: 0.3 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.221.202 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [wurobinson[at]qq.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 MISSING_MID Missing Message-Id: header 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robinson Wu MIME-Version: 1.0 Sender: "openwrt-devel" Message-ID: Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This commit adds support for the Jotale JS76x8 series development boards. These devices have the following specifications: - SOC: MT7628AN/NN, MT7688AN, MT7628DAN - RAM of MT7628AN/NN and MT7688AN: 64/128/256 MB (DDR2) - RAM of MT7628DAN: 64 MB (DDR2) - FLASH:8/16/32 MB (SPI NOR) - Ethernet:3x 10/100 Mbps ethernet ports (MT76x8 built-in switch) - WIFI:1x 2T2R 2.4 GHz Wi-Fi - LEDs:1x system status green LED, 1x wifi green LED, 3x ethernet green LED - Buttons:1x reset button, 2x user defined button - 1x microSD slot - 4x USB 2.0 port - 1x mini-usb debug UART - 1x DC jack for main power (DC 5V) - 1x TTL/RS232 UART - 1x TTL/RS485 UART - 13x GPIO header - 1x audio codec(wm8960) Installation via OpenWrt: The original firmware is OpenWrt, so both LuCI and sysupgrade can be used. Installation via U-boot web: 1. Power on board with reset button pressed, release it after wifi led start blinking. 2. Setup static IP 192.168.1.123/4 on your PC. 3. Go to 192.168.1.8 in browser and upload "sysupgrade" image. Installation via U-boot tftp: 1. Connect to serial console at the mini usb, which has been connected to UART0 on board (115200 8N1) 2. Setup static IP 192.168.1.123/4 on your PC. 3. Place openwrt-firmware.bin on your PC tftp server (192.168.1.123). 3. Connect one of LAN ports on board to your PC. 4. Start terminal software (e.g. screen /dev/ttyUSB0 115200) on PC. 5. Apply power to board. 6. Interrupt U-boot with keypress of "2". 7. At u-boot prompts: Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N) Y Input device IP (192.168.1.8) ==:192.168.1.8 Input server IP (192.168.1.123) ==:192.168.1.123 Input Linux Kernel filename (root_uImage) ==:openwrt-firmware.bin 8. board will download file from tftp server, write it to flash and reboot. Signed-off-by: Robinson Wu --- .../ramips/dts/mt7628an_jotale_js76x8-16m.dts | 12 ++ .../ramips/dts/mt7628an_jotale_js76x8-32m.dts | 12 ++ .../linux/ramips/dts/mt7628an_jotale_js76x8-8m.dts | 12 ++ .../linux/ramips/dts/mt7628an_jotale_js76x8.dtsi | 145 +++++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 27 ++++ .../ramips/mt76x8/base-files/etc/board.d/01_leds | 6 + .../mt76x8/base-files/etc/board.d/02_network | 6 + 7 files changed, 220 insertions(+) create mode 100644 target/linux/ramips/dts/mt7628an_jotale_js76x8-16m.dts create mode 100644 target/linux/ramips/dts/mt7628an_jotale_js76x8-32m.dts create mode 100644 target/linux/ramips/dts/mt7628an_jotale_js76x8-8m.dts create mode 100644 target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8-16m.dts b/target/linux/ramips/dts/mt7628an_jotale_js76x8-16m.dts new file mode 100644 index 0000000..53ed6d8 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8-16m.dts @@ -0,0 +1,12 @@ +/dts-v1/; + +#include "mt7628an_jotale_js76x8.dtsi" + +/ { + compatible = "jotale,js76x8-16m", "jotale,js76x8", "mediatek,mt7628an-soc"; + model = "Jotale JS76x8 (16M)"; +}; + +&firmware { + reg = <0x50000 0xfb0000>; +}; diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8-32m.dts b/target/linux/ramips/dts/mt7628an_jotale_js76x8-32m.dts new file mode 100644 index 0000000..851e6db --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8-32m.dts @@ -0,0 +1,12 @@ +/dts-v1/; + +#include "mt7628an_jotale_js76x8.dtsi" + +/ { + compatible = "jotale,js76x8-32m", "jotale,js76x8", "mediatek,mt7628an-soc"; + model = "Jotale JS76x8 (32M)"; +}; + +&firmware { + reg = <0x50000 0x1fb0000>; +}; diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8-8m.dts b/target/linux/ramips/dts/mt7628an_jotale_js76x8-8m.dts new file mode 100644 index 0000000..8cac3fb --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8-8m.dts @@ -0,0 +1,12 @@ +/dts-v1/; + +#include "mt7628an_jotale_js76x8.dtsi" + +/ { + compatible = "jotale,js76x8-8m", "mediatek,mt7628an-soc"; + model = "Jotale JS76x8 (8M)"; +}; + +&firmware { + reg = <0x50000 0x7b0000>; +}; diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi b/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi new file mode 100644 index 0000000..cc858a9 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi @@ -0,0 +1,145 @@ +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "jotale,js76x8", "mediatek,mt7628an-soc"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "js76x8:green:system"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + }; + + wifi { + label = "js76x8:green:wifi"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + group = "gpio","p3led_an","p4led_an", + "pwm0","pwm1","refclk","wdt","wled_an"; + function = "gpio"; + }; + + p0led { + group = "p0led_an"; + function = "p0led_an"; + }; + + p1led { + group = "p1led_an"; + function = "p1led_an"; + }; + + p2led { + group = "p2led_an"; + function = "p2led_an"; + }; + + i2s { + group = "i2s"; + function = "i2s"; + }; + }; +}; + +&spi0 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&spi_pins>, <&spi_cs1_pins>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + m25p,chunked-io = <32>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + 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; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + }; + }; + }; +}; + +&i2c { + status = "okay"; +}; + +&i2s { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&sdhci { + status = "okay"; + mediatek,cd-low; +}; + +&wmac { + status = "okay"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index de92c98..90dd418 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -160,6 +160,33 @@ define Device/iptime_a604m endef TARGET_DEVICES += iptime_a604m +define Device/jotale_js76x8 + DEVICE_VENDOR := Jotale + DEVICE_MODEL := JS76x8 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef + +define Device/jotale_js76x8-8m + $(Device/jotale_js76x8) + IMAGE_SIZE := 7872k + DEVICE_VARIANT := 8M +endef +TARGET_DEVICES += jotale_js76x8-8m + +define Device/jotale_js76x8-16m + $(Device/jotale_js76x8) + IMAGE_SIZE := 16064k + DEVICE_VARIANT := 16M +endef +TARGET_DEVICES += jotale_js76x8-16m + +define Device/jotale_js76x8-32m + $(Device/jotale_js76x8) + IMAGE_SIZE := 32448k + DEVICE_VARIANT := 32M +endef +TARGET_DEVICES += jotale_js76x8-32m + define Device/mediatek_linkit-smart-7688 IMAGE_SIZE := 32448k DEVICE_VENDOR := MediaTek diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index 1e478df..afffd31 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -46,6 +46,12 @@ hiwifi,hc5661a|\ hiwifi,hc5761a) ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10" ;; +jotale,js76x8-8m|\ +jotale,js76x8-16m|\ +jotale,js76x8-32m) + ucidef_set_led_timer "system" "system" "js76x8:green:system" "1000" "1000" + set_wifi_led "js76x8:green:wifi" + ;; mediatek,linkit-smart-7688) ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt" ;; diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index e3d18b5..f7a7d8b 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -32,6 +32,9 @@ ramips_setup_interfaces() asus,rt-n11p-b1|\ asus,rt-n12-vp-b1|\ hiwifi,hc5661a|\ + jotale,js76x8-8m|\ + jotale,js76x8-16m|\ + jotale,js76x8-32m|\ mediatek,mt7628an-eval-board|\ mercury,mac1200r-v2|\ totolink,lr1200|\ @@ -192,6 +195,9 @@ ramips_setup_macs() wiznet,wizfi630s) wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 1) ;; + jotale,js76x8-8m|\ + jotale,js76x8-16m|\ + jotale,js76x8-32m|\ skylab,skw92a|\ totolink,lr1200) wan_mac=$(mtd_get_mac_binary factory 0x2e)