From patchwork Sat Jul 11 12:58:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luochongjun X-Patchwork-Id: 1327330 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=none (p=none dis=none) header.from=gl-inet.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=z2HBwkOA; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=d/mg0VSf; 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 4B3qlp3JDZz9sDX for ; Sat, 11 Jul 2020 23:00:54 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-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=HDOmgE9y67cfY/Zs+fVU3ixqJjwnaEdQYfQrqJ50pko=; b=z2HBwkOA7OoRkxQqnL7Ym0Nfvn RVbu8xbBDYYtE9KD91SUEmM63znxCepvnjNioOvlLuFFY1o9d5XitvC4dRgm1L6fDUbCPpLMxy0T/ N36rhckXOajICNsx/m9ZwXuLQI09IAhugGX8ssfAZuHZDk3tIQr98MHRXSDNW8wRhbyhLVbhtEhDc 5O3iOqjzz6f5HkpSclV8O8WGmb1RRtSvz09oOPn5BrtcUKaaZSabKO4pEVPiLswWxKa8lDdXjCsHI xQgOBkmd7OEeLOJnjuP9QGO6xR+VWT17qR+kNPd9ujL5swkjnJ8mHryuBzsks7po5MAOPWNTg1GwM E48kkroQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1juF6B-0006tr-Rh; Sat, 11 Jul 2020 12:59:23 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1juF68-0006tT-Kh for openwrt-devel@merlin.infradead.org; Sat, 11 Jul 2020 12:59:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=Da2njHuf9ftCtn/hESelUofv4l1rsnsM3s2t4Ncergg=; b=d/mg0VSfy4jww74EDPS0cubRgq F7gwbrPsxUADahLDAOa2CSnuTC8xSTtYonHCrOcF9HbxMizv/RxRt1Pl9/iVy3CgnnhJo7tDSpasM uL/2adiw9KJxzcaeQrXV25AzB4qb2BQmUVOcPm+nUCqoKzA+g80NRPlQreEY5To62RxChrla89rCy 9AGcvm4GfjmJOypd5c7KFI17zOYZH4GJuQlDdlrrT4Fuh9bHkuFg2YzxexvK2QYDrVYVEEpb8bv+3 Xve4Oejb20HGPCuQsEzc4MMEo1PoWaveU0GKlU049gg377RcXu9g34dGwFAdH8hht9/xzN//gPkaV 6yQqfxig==; Received: from smtpbg704.qq.com ([203.205.195.105] helo=smtpproxy21.qq.com) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1juF62-00043a-31 for openwrt-devel@lists.openwrt.org; Sat, 11 Jul 2020 12:59:18 +0000 X-QQ-mid: bizesmtp4t1594472329t9bgh7xm9 Received: from luo-B250M-D3H.lan (unknown [113.116.57.178]) by esmtp6.qq.com (ESMTP) with id ; Sat, 11 Jul 2020 20:58:49 +0800 (CST) X-QQ-SSF: 01100000002000Z0ZL20000A0000000 X-QQ-FEAT: pC1gbU7tx1mw3mDWdvyjPYfeaD/L75aIv6/0Y6El70TUYK8o32DoJKAlBBgyZ oXo5lCfWwmNG1AaOqQyuMuLdR4fuaYB1NUJXpIgFd36ZEs2Y2ggN8nBtWhiFH2hLg2NzG6F L/UfzQO5lOnjXYiuoy1Tg+TfzP1uMO0a2NCOM+JeD+48fWw+lT71llJijcA95pLz4oMfonD IrcRmFthPe21LdsOrh72dBPxu2pz+/okQDcMgqXLOSsQtNpMsvzf9kgbJ2jcEhMpgvlLzMG ocjOX+O/cXuYkvn4ZnLMTxbAYLBmOeBj32ZyDz0Lhf/moiKIx0k1AJs8AZOW5Skag8t+2IG Dw+jt6Z1lUABScQWs/AsY/S4nThmg== X-QQ-GoodBg: 0 From: Luochongjun To: openwrt-devel@lists.openwrt.org Subject: [PATCH v3] ath79: add support for gl-e750 Date: Sat, 11 Jul 2020 20:58:47 +0800 Message-Id: <1594472327-1975-1-git-send-email-luochongjun@gl-inet.com> X-Mailer: git-send-email 2.7.4 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:gl-inet.com:qybgforeign:qybgforeign7 X-QQ-Bgrelay: 1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200711_135914_822729_A019A947 X-CRM114-Status: GOOD ( 16.20 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [203.205.195.105 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [203.205.195.105 listed in wl.mailspike.net] 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 FORGED_SPF_HELO No description available. 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: Luochongjun MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The gl-e750 is a portable travel router that gives you safe access to the internet while traveling. Specifications: - SoC: Qualcomm Atheros AR9531 (650MHz) - RAM: 128 MB DDR2 - Flash: 16 MB SPI NOR (W25Q128FVSG) + 128 MB SPI NAND (GD5F1GQ4UFYIG) - Ethernet: 10/100: 1xLAN - Wireless: QCA9531 2.4GHz (bgn) + QCA9887 5GHz (ac) - USB: 1x USB 2.0 port - Switch: 1x switch - Button: 1x reset button - OLED Screen: 128*64 px MAC addresses based on vendor firmware: LAN *:a0 art 0x0 2.4GHz *:a1 art 0x1002 5GHz *:a2 art calculated from art 0x0 + 2 Flash firmware: Since openwrt's kernel already exceeds 2MB, upgrading from the official version of GL-inet (v3.100) using the sysupgrade command will break the kernel image. Users who are using version 3.100 can only upgrade via uboot. The official guidance for GL-inet is as follows: https://docs.gl-inet.com/en/3/troubleshooting/debrick/ In the future, GL-inet will modify the firmware to support the sysupgrade command, so users will be able to upgrade directly with the sysupgrade command in future releases. OLED screen control: OLED controller is connected to QCA9531 through serial port, and can send instructions to OLED controller directly through serial port. Refer to the links below for a list of supported instructions: https://github.com/gl-inet/GL-E750-MCU-instruction Signed-off-by: Luochongjun --- target/linux/ath79/dts/qca9531_glinet_gl-e750.dts | 139 +++++++++++++++++++++ target/linux/ath79/image/nand.mk | 18 +++ .../ath79/nand/base-files/etc/board.d/02_network | 3 +- .../etc/hotplug.d/ieee80211/10-fix-wifi-mac | 5 + 4 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-e750.dts diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts new file mode 100644 index 0000000..1fc96bc --- /dev/null +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "glinet,gl-e750", "qca,qca9531"; + model = "GL.iNet GL-E750"; + + aliases { + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + switch { + label = "switch"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_lte_power { + gpio-export,name = "lte_power"; + gpio-export,output = <1>; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <2>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + art: partition@50000 { + label = "art"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "kernel"; + reg = <0x60000 0x400000>; + }; + + partition@460000 { + label = "reserved"; + reg = <0x460000 0xba0000>; + }; + }; + }; + + flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0x8000000>; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + phy-handle = <&swphy4>; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index f7fc71d..a2cd460 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -147,6 +147,24 @@ define Device/glinet_gl-ar750s-nor endef TARGET_DEVICES += glinet_gl-ar750s-nor +define Device/glinet_gl-e750 + SOC := qca9531 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-E750 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-usb2 + SUPPORTED_DEVICES += gl-e750 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 131072k + PAGESIZE := 2048 + VID_HDR_OFFSET := 2048 + BLOCKSIZE := 128k + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | \ + append-ubi | check-kernel-size $$$$(KERNEL_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += glinet_gl-e750 + # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff) define Device/netgear_ath79_nand DEVICE_VENDOR := NETGEAR diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 84cdfd9..daba0e9 100755 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -8,7 +8,8 @@ ath79_setup_interfaces() local board="$1" case "$board" in - aerohive,hiveap-121) + aerohive,hiveap-121|\ + glinet,gl-e750) ucidef_set_interface_lan "eth0" ;; domywifi,dw33d) diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac index 6c61e5d..8fe4429 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac @@ -15,4 +15,9 @@ case $board in [ "$PHYNBR" -eq 1 ] && \ mtd_get_mac_ascii u-boot-env ethaddr > /sys${DEVPATH}/macaddress ;; + glinet,gl-e750) + # Set mac address for 5g device + [ "$PHYNBR" -eq 0 ] && \ + macaddr_add $(mtd_get_mac_binary art 0x0) 2 > /sys${DEVPATH}/macaddress + ;; esac