[From nobody Thu Jun 25 05:54:59 2020
Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536])
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1gdXnv-0002j8-QZ
 for openwrt-devel@lists.openwrt.org; Sun, 30 Dec 2018 09:54:45 +0000
Received: by mail-ed1-x536.google.com with SMTP id b14so20677795edt.6
 for &lt;openwrt-devel@lists.openwrt.org&gt;; Sun, 30 Dec 2018 01:54:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=googlemail.com; s=20161025;
 h=from:to:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=kUfsw9vO06SC3+6gTfWGgZun48H7x4yG3ruxHxS0efY=;
 b=BlBjiO+DafcLtACd8rR4jbjbdN/dt5Fwlpbso+paEdB4CFGvHpvLiWMfvR/fXr7byN
 MEXRjvAZRrCbD4frv7V3B11EFBYTjxEGZ9fvVzJXUTdWd5DrKkL4tGOqOs01kfdmaOOT
 gXLkEb/gmr2tQMGcFqEVbICjjhG4iMui9GrqzT9JJDXA4nkuw8ZPEWHumS52UQMtlsRa
 CJBwy86xzO2SNQwePCk5Ms4yn7XMzt9kSPBPEo/o+PsvFH6ehLYx78NJzY4XiQzP82YR
 MeXyBOKfNSmpz+mio9m8fvhcOMstg6wzFmW7rOPGswSgTdLCRhZWp6lHK9n79Tlb9zkH
 eQLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=kUfsw9vO06SC3+6gTfWGgZun48H7x4yG3ruxHxS0efY=;
 b=XI3B5K+aFapyIF9O/0o+KQBsO536yURaB8uR1Ox5mM/bYOK9S6IgsvIwOd8v0lOPYo
 IeW/Mt+fpoEuDEdRjzfuAihpwxIM2PcjTIQCzwiHIIX18GXQJUfzVUxAnk0RAaQVdEx/
 uWURC99wkQjn2zj46qDZjUAjBJkI1LQq+9Kau0jP5HOn7cNpYZSgEm3l45uBA9sEgPlU
 iVOzR8zCKrinLgd4AzlzMt/tkigpPuOGFid4CciRkfbeuwmrnq3hpzWT13Z2/+J4udQc
 biWahYEpxjGlcX5acdWL46A1lde9TR7ovmVwZ/v2vcYuC+dG2cKT6Wf88BLZwcDozska
 TckA==
X-Gm-Message-State: AA+aEWYw9RCBu7L7F0fu+fhEErJkz8OcOQL4uKDTr1KXko/jbWLxsGeO
 Qn8jk6B+ohXggEZ+HeKU+GprEEryOgpbnw==
X-Google-Smtp-Source: AFSGD/W4mJ06JWK4mOP84Va6tJCZCy0MAKVhmN1j0Y85ROJpFZiwEjtqZsxxw8FSnkGItmbxLET09A==
X-Received: by 2002:a50:c20a:: with SMTP id n10mr29257742edf.60.1546163670559; 
 Sun, 30 Dec 2018 01:54:30 -0800 (PST)
Received: from precision.congress.ccc.de ([151.217.213.156])
 by smtp.gmail.com with ESMTPSA id x30sm15203213edd.30.2018.12.30.01.54.29
 for &lt;openwrt-devel@lists.openwrt.org&gt;
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 30 Dec 2018 01:54:30 -0800 (PST)
From: Christoph Krapp &lt;achterin@googlemail.com&gt;
To: openwrt-devel@lists.openwrt.org
Subject: [PATCH] ath79: add support for GL.iNet GL-AR750S
Date: Sun, 30 Dec 2018 10:53:54 +0100
Message-Id: &lt;20181230095354.6954-1-achterin@googlemail.com&gt;
X-Mailer: git-send-email 2.19.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20181230_015443_890574_8022537E 
X-CRM114-Status: GOOD (  14.34  )
X-Spam-Score: -0.2 (/)
X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary:
 Content analysis details:   (-0.2 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/,
 no trust [2a00:1450:4864:20:0:0:0:536 listed in]
 [list.dnswl.org]
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (achterin[at]googlemail.com)
 -0.0 SPF_PASS               SPF: sender 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

This patch adds supports for GL-AR750S.

Specification:
- SOC: QCA9563 (775MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 2x 1Gbps LAN + 1x 1Gbps WAN
- Wireless: 2.4GHz (bgn) and 5GHz (ac)
- USB: 1x USB 2.0 port
- Button: 1x switch button, 1x reset button
- LED: 3x LEDS (green)

Flash instruction:
Upload image via uboot web recovery

Signed-off-by: Christoph Krapp &lt;achterin@googlemail.com&gt;
---
 .../ath79/base-files/etc/board.d/02_network   |   4 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |   9 +-
 .../linux/ath79/dts/qca9563_glinet_ar750s.dts | 153 ++++++++++++++++++
 target/linux/ath79/image/generic.mk           |  12 ++
 4 files changed, 174 insertions(+), 4 deletions(-)
 create mode 100644 target/linux/ath79/dts/qca9563_glinet_ar750s.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network
index 004ab59573..b9a0f356bf 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -93,6 +93,10 @@ ath79_setup_interfaces()
 	glinet,gl-x750)
 		ucidef_set_interfaces_lan_wan &quot;eth1&quot; &quot;eth0&quot;
 		;;
+	glinet,ar750s)
+		ucidef_add_switch &quot;switch0&quot; \
+			&quot;0@eth0&quot; &quot;2:lan:2&quot; &quot;3:lan:1&quot; &quot;1:wan&quot;
+		;;
 	nec,wg800hp)
 		ucidef_add_switch &quot;switch0&quot; \
 			&quot;0@eth0&quot; &quot;2:lan&quot; &quot;3:lan&quot; &quot;4:lan&quot; &quot;1:wan&quot;
diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 53f57be824..2118d2b06b 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -92,6 +92,11 @@ case &quot;$FIRMWARE&quot; in
 		ath10kcal_extract &quot;art&quot; 20480 2116
 		ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0) -1)
 		;;
+	glinet,ar750s|\
+	tplink,re450-v2)
+		ath10kcal_extract &quot;art&quot; 20480 2116
+		ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
+		;;
 	glinet,gl-x750)
 		ath10kcal_extract &quot;art&quot; 20480 2116
 		ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
@@ -122,10 +127,6 @@ case &quot;$FIRMWARE&quot; in
 		ath10kcal_extract &quot;art&quot; 20480 2116
 		ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -1)
 		;;
-	tplink,re450-v2)
-		ath10kcal_extract &quot;art&quot; 20480 2116
-		ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
-		;;
 	ubnt,unifiac-lite|\
 	ubnt,unifiac-mesh|\
 	ubnt,unifiac-mesh-pro|\
diff --git a/target/linux/ath79/dts/qca9563_glinet_ar750s.dts b/target/linux/ath79/dts/qca9563_glinet_ar750s.dts
new file mode 100644
index 0000000000..64b346ae9c
--- /dev/null
+++ b/target/linux/ath79/dts/qca9563_glinet_ar750s.dts
@@ -0,0 +1,153 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include &lt;dt-bindings/gpio/gpio.h&gt;
+#include &lt;dt-bindings/input/input.h&gt;
+
+#include &quot;qca956x.dtsi&quot;
+
+/ {
+	compatible = &quot;glinet,ar750s&quot;, &quot;qca,qca9563&quot;;
+	model = &quot;GL.iNet GL-AR750S&quot;;
+
+  chosen {
+		bootargs = &quot;console=ttyS0,115200n8&quot;;
+	};
+
+	keys {
+		compatible = &quot;gpio-keys-polled&quot;;
+		poll-interval = &lt;20&gt;;
+		pinctrl-names = &quot;default&quot;;
+		pinctrl-0 = &lt;&amp;jtag_disable_pins&gt;;
+
+		button0 {
+			label = &quot;reset&quot;;
+			linux,code = &lt;KEY_RESTART&gt;;
+			gpios = &lt;&amp;gpio 2 GPIO_ACTIVE_LOW&gt;;
+		};
+
+    button1 {
+			label = &quot;button right&quot;;
+			linux,code = &lt;BTN_0&gt;;
+			gpios = &lt;&amp;gpio 8 GPIO_ACTIVE_LOW&gt;;
+		};
+
+	};
+
+	leds {
+		compatible = &quot;gpio-leds&quot;;
+
+		power {
+			label = &quot;gl-ar750s:green:power&quot;;
+			gpios = &lt;&amp;gpio 1 GPIO_ACTIVE_LOW&gt;;
+			default-state = &quot;keep&quot;;
+		};
+
+    usbpower {
+			label = &quot;gl-ar750s:green:wan&quot;;
+			gpios = &lt;&amp;gpio 7 GPIO_ACTIVE_LOW&gt;;
+		};
+
+		wlan2g {
+			label = &quot;gl-ar750s:green:wlan2g&quot;;
+			gpios = &lt;&amp;gpio 19 GPIO_ACTIVE_LOW&gt;;
+			linux,default-trigger = &quot;phy1tpt&quot;;
+		};
+
+		wlan5g {
+			label = &quot;gl-ar750s:green:wlan5g&quot;;
+			gpios = &lt;&amp;gpio 20 GPIO_ACTIVE_HIGH&gt;;
+			linux,default-trigger = &quot;phy0tpt&quot;;
+		};
+	};
+};
+
+&amp;spi {
+	status = &quot;okay&quot;;
+	num-cs = &lt;0&gt;;
+
+	flash@0 {
+		compatible = &quot;jedec,spi-nor&quot;;
+		reg = &lt;0&gt;;
+		spi-max-frequency = &lt;25000000&gt;;
+
+		partitions {
+			compatible = &quot;fixed-partitions&quot;;
+			#address-cells = &lt;1&gt;;
+			#size-cells = &lt;1&gt;;
+
+			partition@0 {
+				label = &quot;u-boot&quot;;
+				reg = &lt;0x000000 0x040000&gt;;
+				read-only;
+			};
+
+			partition@40000 {
+				label = &quot;u-boot-env&quot;;
+				reg = &lt;0x040000 0x010000&gt;;
+			};
+
+      art: partition@50000 {
+        label = &quot;art&quot;;
+        reg = &lt;0x050000 0x010000&gt;;
+      };
+
+			partition@60000 {
+				compatible = &quot;denx,uimage&quot;;
+				label = &quot;firmware&quot;;
+				reg = &lt;0x060000 0xfa0000&gt;;
+			};
+
+		};
+	};
+};
+
+&amp;pcie {
+	status = &quot;okay&quot;;
+};
+
+&amp;uart {
+	status = &quot;okay&quot;;
+};
+
+&amp;usb0 {
+	#address-cells = &lt;1&gt;;
+	#size-cells = &lt;0&gt;;
+	status = &quot;okay&quot;;
+
+	hub_port: port@1 {
+		reg = &lt;1&gt;;
+		#trigger-source-cells = &lt;0&gt;;
+	};
+};
+
+&amp;usb_phy0 {
+	status = &quot;okay&quot;;
+};
+
+&amp;mdio0 {
+	status = &quot;okay&quot;;
+	phy-mask = &lt;0&gt;;
+
+	phy0: ethernet-phy@0 {
+		reg = &lt;0&gt;;
+		phy-mode = &quot;sgmii&quot;;
+		qca,ar8327-initvals = &lt;
+			0x04 0x00080080 /* PORT0 PAD MODE CTRL */
+			0x7c 0x0000007e /* PORT0_STATUS */
+		&gt;;
+	};
+};
+
+&amp;eth0 {
+	status = &quot;okay&quot;;
+
+	mtd-mac-address = &lt;&amp;art 0x0&gt;;
+	phy-handle = &lt;&amp;phy0&gt;;
+};
+
+&amp;wmac {
+	status = &quot;okay&quot;;
+	mtd-cal-data = &lt;&amp;art 0x1000&gt;;
+	mtd-mac-address = &lt;&amp;art 0x1002&gt;;
+};
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index b2f83ba58c..1a53618f5c 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -237,6 +237,18 @@ define Device/glinet_ar300m-nor
 endef
 TARGET_DEVICES += glinet_ar300m-nor
 
+define Device/glinet_ar750s
+  ATH_SOC := qca9563
+  DEVICE_TITLE := GL.iNet GL-AR750S
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-usb-core \
+	kmod-usb2 kmod-usb-storage
+  IMAGE_SIZE := 16000k
+  SUPPORTED_DEVICES += gl-ar750s
+  IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+	append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
+endef
+TARGET_DEVICES += glinet_ar750s
+
 define Device/glinet_gl-x750
   ATH_SOC := qca9531
   DEVICE_TITLE := GL.iNet GL-X750
-- 
2.19.2


]