add openwrt 21.02.2 source tree

This commit is contained in:
gl-luochongjun 2022-03-14 11:05:18 +08:00
parent 5daed95668
commit b4f89a4edc
13 changed files with 4934 additions and 0 deletions

View File

@ -0,0 +1,8 @@
repo: https://github.com/openwrt/openwrt.git
branch: v21.02.2
git_clone_dir: openwrt-21.02/openwrt-21.02.2
openwrt_root_dir: openwrt-21.02/openwrt-21.02.2
revision: 30e2782e0647a837044ada77ce86b29c5af8a9f2
patch_folders:
- patches-21.02.2/

View File

@ -0,0 +1,602 @@
From 426542a5861386b9f85ca636d7eecd7374c7b82b Mon Sep 17 00:00:00 2001
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
Date: Fri, 17 Sep 2021 11:45:31 +0800
Subject: [PATCH 1/8] ath79: add support for gl xe300
---
include/image-commands.mk | 33 +++
scripts/sysupgrade-tar-compat-1806.sh | 79 +++++++
.../ath79/dts/qca9531_glinet_gl-xe300-iot.dts | 29 +++
.../dts/qca9531_glinet_gl-xe300-nor-nand.dts | 25 +++
.../ath79/dts/qca9531_glinet_gl-xe300-nor.dts | 18 ++
.../ath79/dts/qca9531_glinet_gl-xe300.dtsi | 199 ++++++++++++++++++
target/linux/ath79/dts/qca953x.dtsi | 2 +-
target/linux/ath79/image/Makefile | 2 +-
target/linux/ath79/image/nand.mk | 41 ++++
.../ath79/nand/base-files/etc/board.d/01_leds | 7 +
.../nand/base-files/etc/board.d/02_network | 5 +
.../etc/uci-defaults/04_led_migration | 4 +-
.../nand/base-files/lib/upgrade/platform.sh | 4 +
13 files changed, 444 insertions(+), 4 deletions(-)
create mode 100755 scripts/sysupgrade-tar-compat-1806.sh
create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-xe300-iot.dts
create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor-nand.dts
create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor.dts
create mode 100755 target/linux/ath79/dts/qca9531_glinet_gl-xe300.dtsi
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 4d54a14ba4..6908f5b5c1 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -64,6 +64,31 @@ define Build/append-metadata
}
endef
+metadata_gl_json = \
+ '{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \
+ "metadata_version": "1.0", \
+ "supported_devices":[$(call metadata_devices,$(1))], \
+ "version": { \
+ "release": "$(shell cat $(TOPDIR)/release)", \
+ "date": "$(shell TZ='Asia/Chongqing' date '+%Y%m%d%H%M%S')", \
+ "dist": "$(call json_quote,$(VERSION_DIST))", \
+ "version": "$(call json_quote,$(VERSION_NUMBER))", \
+ "revision": "$(call json_quote,$(REVISION))", \
+ "target": "$(call json_quote,$(TARGETID))", \
+ "board": "$(call json_quote,$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)))" \
+ }, \
+ }'
+
+define Build/append-gl-metadata
+ $(if $(SUPPORTED_DEVICES),-echo $(call metadata_gl_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
+ [ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \
+ cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
+ usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
+ ucert -A -c "$@.ucert" -x "$@.sig" ;\
+ fwtool -S "$@.ucert" "$@" ;\
+ }
+endef
+
define Build/append-rootfs
dd if=$(IMAGE_ROOTFS) >> $@
endef
@@ -377,6 +402,14 @@ define Build/sysupgrade-tar
$@
endef
+define Build/sysupgrade-tar-compat-1806
+ sh $(TOPDIR)/scripts/sysupgrade-tar-compat-1806.sh \
+ --board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
+ --kernel $(call param_get_default,kernel,$(1),$(IMAGE_KERNEL)) \
+ --rootfs $(call param_get_default,rootfs,$(1),$(IMAGE_ROOTFS)) \
+ $@
+endef
+
define Build/tplink-safeloader
-$(STAGING_DIR_HOST)/bin/tplink-safeloader \
-B $(TPLINK_BOARD_ID) \
diff --git a/scripts/sysupgrade-tar-compat-1806.sh b/scripts/sysupgrade-tar-compat-1806.sh
new file mode 100755
index 0000000000..c479688e55
--- /dev/null
+++ b/scripts/sysupgrade-tar-compat-1806.sh
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+board=""
+board1806=""
+kernel=""
+rootfs=""
+outfile=""
+err=""
+
+while [ "$1" ]; do
+ case "$1" in
+ "--board")
+ board="$2"
+ shift
+ shift
+ continue
+ ;;
+ "--kernel")
+ kernel="$2"
+ shift
+ shift
+ continue
+ ;;
+ "--rootfs")
+ rootfs="$2"
+ shift
+ shift
+ continue
+ ;;
+ *)
+ if [ ! "$outfile" ]; then
+ outfile=$1
+ shift
+ continue
+ fi
+ ;;
+ esac
+done
+
+if [ ! -n "$board" -o ! -r "$kernel" -a ! -r "$rootfs" -o ! "$outfile" ]; then
+ echo "syntax: $0 [--board boardname] [--kernel kernelimage] [--rootfs rootfs] out"
+ exit 1
+fi
+
+tmpdir="$( mktemp -d 2> /dev/null )"
+if [ -z "$tmpdir" ]; then
+ # try OSX signature
+ tmpdir="$( mktemp -t 'ubitmp' -d )"
+fi
+
+if [ -z "$tmpdir" ]; then
+ exit 1
+fi
+
+echo "$tmpdir ########################################################"
+
+board1806="$(echo "$board"|cut -d '_' -f 2|awk -F '-' '{print $1 "-" $2}')"
+mkdir -p "${tmpdir}/sysupgrade-${board}"
+echo "BOARD=${board}" > "${tmpdir}/sysupgrade-${board}/CONTROL"
+mkdir -p "${tmpdir}/sysupgrade-${board1806}"
+echo "BOARD=${board1806}" > "${tmpdir}/sysupgrade-${board1806}/CONTROL"
+[ -z "${rootfs}" ] || cp "${rootfs}" "${tmpdir}/sysupgrade-${board}/root"
+[ -z "${kernel}" ] || cp "${kernel}" "${tmpdir}/sysupgrade-${board}/kernel"
+
+mtime=""
+if [ -n "$SOURCE_DATE_EPOCH" ]; then
+ mtime="--mtime=@${SOURCE_DATE_EPOCH}"
+fi
+
+(cd "$tmpdir"; tar --sort=name --owner=0 --group=0 --numeric-owner -cvf sysupgrade.tar sysupgrade-${board} sysupgrade-${board1806} ${mtime})
+err="$?"
+if [ -e "$tmpdir/sysupgrade.tar" ]; then
+ cp "$tmpdir/sysupgrade.tar" "$outfile"
+else
+ err=2
+fi
+rm -rf "$tmpdir"
+
+exit $err
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300-iot.dts b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-iot.dts
new file mode 100644
index 0000000000..461ec1720a
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-iot.dts
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "qca9531_glinet_gl-xe300.dtsi"
+
+/ {
+ compatible = "glinet,gl-xe300-iot", "qca,qca9531";
+ model = "GL.iNet GL-XE300 (NOR/NAND IOT)";
+};
+
+&nor_partitions {
+ partition@60000 {
+ label = "kernel";
+ reg = <0x060000 0x400000>;
+ };
+ parition@460000 {
+ label = "nor_reserved";
+ reg = <0x460000 0xba0000>;
+ };
+};
+
+&nand_ubi {
+ label = "ubi";
+};
+
+&bootargs {
+ bootargs="";
+};
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor-nand.dts b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor-nand.dts
new file mode 100644
index 0000000000..35117ad875
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor-nand.dts
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "qca9531_glinet_gl-xe300.dtsi"
+
+/ {
+ compatible = "glinet,gl-xe300-nor-nand", "qca,qca9531";
+ model = "GL.iNet GL-XE300 (NOR/NAND)";
+};
+
+&nor_partitions {
+ partition@60000 {
+ label = "kernel";
+ reg = <0x060000 0x400000>;
+ };
+ parition@460000 {
+ label = "nor_reserved";
+ reg = <0x460000 0xba0000>;
+ };
+};
+
+&nand_ubi {
+ label = "ubi";
+};
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor.dts b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor.dts
new file mode 100644
index 0000000000..9b67f49368
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor.dts
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "qca9531_glinet_gl-xe300.dtsi"
+
+/ {
+ compatible = "glinet,gl-xe300-nor", "qca,qca9531";
+ model = "GL.iNet GL-XE300 (NOR)";
+};
+
+&nor_partitions {
+ partition@60000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x060000 0xfa0000>;
+ };
+};
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dtsi
new file mode 100755
index 0000000000..07e4f9cd44
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dtsi
@@ -0,0 +1,199 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "qca953x.dtsi"
+
+/ {
+ compatible = "glinet,gl-xe300", "qca,qca9531";
+ model = "GL.iNet GL-XE300";
+
+ gl_hw {
+ compatible = "gl-hw-info";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "xe300";
+ wan = "eth1";
+ lan = "eth0";
+ build-in-modem = "1-1.2";
+ reset-button = "gpio-3";
+ usb-port = "1-1.3";
+ nand;
+ factory_data {
+ device_mac = "art";
+ device_ddns = "art", "0x10";
+ device_sn_bak = "art", "0x20";
+ device_sn = "art", "0x30";
+ country_code = "art", "0x88";
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys-polled";
+
+ poll-interval = <20>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&jtag_disable_pins>;
+
+ button0 {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ wan {
+ label = "gl-xe300:green:wan";
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+ };
+
+ lan {
+ label = "gl-xe300:green:lan";
+ gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan {
+ label = "gl-xe300:green:wlan";
+ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "phy0tpt";
+ };
+
+ lte {
+ label = "gl-xe300:green:lte";
+ gpios = <&gpio 13 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>;
+ };
+
+ gpio_sd_detect {
+ gpio-export,name = "sd_detect";
+ gpio-export,output = <0>;
+ gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ i2c: i2c {
+ compatible = "i2c-gpio";
+
+ sda-gpios = <&gpio 14 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&gpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ rtc@32 {
+ compatible = "rtc-sd2068";
+ reg = <0x32>;
+ };
+
+ };
+};
+
+&pcie0 {
+ status = "okay";
+};
+
+&uart {
+ status = "okay";
+};
+
+&usb0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ hub_port: port@1 {
+ reg = <1>;
+ #trigger-source-cells = <0>;
+ };
+};
+
+&usb_phy {
+ status = "okay";
+};
+
+&spi {
+ status = "okay";
+ num-cs = <2>;
+ cs-gpios = <0>, <0>;
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <25000000>;
+
+ nor_partitions: partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x000000 0x040000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "u-boot-env";
+ reg = <0x040000 0x010000>;
+ };
+
+ art: partition@50000 {
+ label = "art";
+ reg = <0x050000 0x010000>;
+ read-only;
+ };
+ };
+ };
+
+ flash_nand: flash@1 {
+ compatible = "spi-nand";
+ reg = <1>;
+ spi-max-frequency = <25000000>;
+
+ nand_partitions: partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ nand_ubi: partition@0 {
+ label = "nand_ubi";
+ reg = <0x000000 0x8000000>;
+ };
+ };
+ };
+
+};
+
+&eth0 {
+ status = "okay";
+ mtd-mac-address = <&art 0x0>;
+ phy-handle = <&swphy4>;
+ ifname = "eth1";
+};
+
+&eth1 {
+ mtd-mac-address = <&art 0x0>;
+ mtd-mac-address-increment = <1>;
+ ifname = "eth0";
+};
+
+&wmac {
+ status = "okay";
+ mtd-cal-data = <&art 0x1000>;
+ mtd-mac-address = <&art 0x1002>;
+};
diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi
index 801438be29..943e42437a 100644
--- a/target/linux/ath79/dts/qca953x.dtsi
+++ b/target/linux/ath79/dts/qca953x.dtsi
@@ -8,7 +8,7 @@
#address-cells = <1>;
#size-cells = <1>;
- chosen {
+ bootargs: chosen {
bootargs = "console=ttyS0,115200n8";
};
diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile
index 3c126f479e..439d1710e5 100644
--- a/target/linux/ath79/image/Makefile
+++ b/target/linux/ath79/image/Makefile
@@ -77,7 +77,7 @@ define Device/Default
COMPILE :=
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | \
- append-rootfs | pad-rootfs | append-metadata | check-size
+ append-rootfs | pad-rootfs | append-gl-metadata | check-size
endef
include $(SUBTARGET).mk
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index abf269a8ce..cfc07f14a3 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -107,6 +107,47 @@ define Device/glinet_gl-ar300m-nor
endef
TARGET_DEVICES += glinet_gl-ar300m-nor
+define Device/glinet_gl-xe300-common
+ SOC := qca9531
+ DEVICE_VENDOR := GL.iNet
+ DEVICE_MODEL := GL-XE300
+ DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341
+ SUPPORTED_DEVICES += gl-xe300 glinet,gl-xe300
+endef
+
+define Device/glinet_gl-xe300-nor
+ $(Device/glinet_gl-xe300-common)
+ DEVICE_VARIANT := NOR
+ IMAGE_SIZE := 16000k
+endef
+TARGET_DEVICES += glinet_gl-xe300-nor
+
+define Device/glinet_gl-xe300-nor-nand
+ $(Device/glinet_gl-xe300-common)
+ DEVICE_VARIANT := NOR/NAND
+ KERNEL_SIZE := 4096k
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ VID_HDR_OFFSET := 2048
+ IMAGES := factory.img sysupgrade.tar
+ IMAGE/sysupgrade.tar := sysupgrade-tar-compat-1806 | append-gl-metadata
+ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | append-gl-metadata
+endef
+TARGET_DEVICES += glinet_gl-xe300-nor-nand
+
+define Device/glinet_gl-xe300-iot
+ $(Device/glinet_gl-xe300-common)
+ DEVICE_VARIANT := NOR/NAND IOT
+ KERNEL_SIZE := 4096k
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ VID_HDR_OFFSET := 2048
+ IMAGES := factory.img sysupgrade.tar
+ IMAGE/sysupgrade.tar := sysupgrade-tar-compat-1806 | append-gl-metadata
+ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | append-gl-metadata
+endef
+TARGET_DEVICES += glinet_gl-xe300-iot
+
define Device/glinet_gl-ar750s-common
SOC := qca9563
DEVICE_VENDOR := GL.iNet
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
index 8eda666a81..4a90c4673f 100755
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -11,6 +11,13 @@ glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor)
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
;;
+glinet,gl-xe300-iot|\
+glinet,gl-xe300-nor|\
+glinet,gl-xe300-nor-nand)
+ ucidef_set_led_switch "lan" "LAN" "gl-xe300:green:lan" "switch0" "0x10"
+ ucidef_set_led_netdev "wan" "WAN" "gl-xe300:green:wan" "eth1"
+ ucidef_set_led_netdev "3gnet" "LTE" "gl-xe300:green:lte" "wwan0"
+ ;;
netgear,wndr3700-v4|\
netgear,wndr4300|\
netgear,wndr4300sw|\
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 910df517aa..17348e001b 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
@@ -21,6 +21,11 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:2" "3:lan:1" "1:wan"
;;
+ glinet,gl-xe300-iot|\
+ glinet,gl-xe300-nor|\
+ glinet,gl-xe300-nor-nand)
+ ucidef_set_interfaces_lan_wan "eth0" "eth1"
+ ;;
netgear,wndr3700-v4|\
netgear,wndr4300|\
netgear,wndr4300sw|\
diff --git a/target/linux/ath79/nand/base-files/etc/uci-defaults/04_led_migration b/target/linux/ath79/nand/base-files/etc/uci-defaults/04_led_migration
index 281d6ac0bc..3175ca9cb4 100644
--- a/target/linux/ath79/nand/base-files/etc/uci-defaults/04_led_migration
+++ b/target/linux/ath79/nand/base-files/etc/uci-defaults/04_led_migration
@@ -6,8 +6,8 @@ board=$(board_name)
case "$board" in
esac
-remove_devicename_leds
+#remove_devicename_leds
-migrations_apply system
+#migrations_apply system
exit 0
diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
index ea77345b06..c9b336898e 100644
--- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
@@ -22,6 +22,10 @@ platform_do_upgrade() {
glinet,gl-ar750s-nor-nand)
nand_nor_do_upgrade "$1"
;;
+ glinet,gl-xe300-iot|\
+ glinet,gl-xe300-nor-nand)
+ nand_nor_do_upgrade "$1"
+ ;;
*)
nand_do_upgrade "$1"
;;
--
2.17.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,322 @@
From 180dac974bb796e5e9a5b5350baa7404ff5e235d Mon Sep 17 00:00:00 2001
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
Date: Sat, 18 Sep 2021 14:19:35 +0800
Subject: [PATCH 3/8] add modem support
---
.../patches-5.4/701-add-modem-support.patch | 303 ++++++++++++++++++
1 file changed, 303 insertions(+)
create mode 100644 target/linux/ath79/patches-5.4/701-add-modem-support.patch
diff --git a/target/linux/ath79/patches-5.4/701-add-modem-support.patch b/target/linux/ath79/patches-5.4/701-add-modem-support.patch
new file mode 100644
index 0000000000..4c83520426
--- /dev/null
+++ b/target/linux/ath79/patches-5.4/701-add-modem-support.patch
@@ -0,0 +1,303 @@
+Index: b/drivers/net/usb/qmi_wwan.c
+===================================================================
+--- a/drivers/net/usb/qmi_wwan.c 2021-09-18 12:18:32.582950993 +0800
++++ b/drivers/net/usb/qmi_wwan.c 2021-09-18 12:18:32.578950684 +0800
+@@ -507,6 +507,24 @@ static const u8 default_modem_addr[ETH_A
+
+ static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00};
+
++#if 1 //Added by Quectel
++#include <linux/etherdevice.h>
++struct sk_buff *qmi_wwan_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
++{
++ if (dev->udev->descriptor.idVendor != cpu_to_le16(0x2C7C))
++ return skb;
++ // Skip Ethernet header from message
++ if (skb_pull(skb, ETH_HLEN)) {
++ return skb;
++ } else {
++ dev_err(&dev->intf->dev, "Packet Dropped ");
++ }
++ // Filter the packet out, release it
++ dev_kfree_skb_any(skb);
++ return NULL;
++}
++#endif
++
+ /* Make up an ethernet header if the packet doesn't have one.
+ *
+ * A firmware bug common among several devices cause them to send raw
+@@ -801,6 +819,20 @@ static int qmi_wwan_bind(struct usbnet *
+ }
+ dev->net->netdev_ops = &qmi_wwan_netdev_ops;
+ dev->net->sysfs_groups[0] = &qmi_wwan_sysfs_attr_group;
++#if 1 //Added by Quectel
++ if (dev->udev->descriptor.idVendor == cpu_to_le16(0x2C7C)) {
++ dev_info(&intf->dev, "QuectelEC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96&AG35 work on RawIP mode\n");
++ dev->net->flags |= IFF_NOARP;
++ usb_control_msg(
++ interface_to_usbdev(intf),
++ usb_sndctrlpipe(interface_to_usbdev(intf), 0),
++ 0x22, //USB_CDC_REQ_SET_CONTROL_LINE_STATE
++ 0x21, //USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE
++ 1, //active CDC DTR
++ intf->cur_altsetting->desc.bInterfaceNumber,
++ NULL, 0, 100);
++ }
++#endif
+ err:
+ return status;
+ }
+@@ -891,7 +923,10 @@ static const struct driver_info qmi_wwan
+ .bind = qmi_wwan_bind,
+ .unbind = qmi_wwan_unbind,
+ .manage_power = qmi_wwan_manage_power,
+- .rx_fixup = qmi_wwan_rx_fixup,
++ #if 1 //Added by Quectel
++ .tx_fixup = qmi_wwan_tx_fixup,
++ .rx_fixup = qmi_wwan_rx_fixup,
++ #endif
+ };
+
+ static const struct driver_info qmi_wwan_info_quirk_dtr = {
+@@ -938,6 +973,17 @@ static const struct driver_info qmi_wwan
+ .driver_info = (unsigned long)&qmi_wwan_info_quirk_dtr
+
+ static const struct usb_device_id products[] = {
++#if 1 //Added by Quectel
++ { QMI_FIXED_INTF(0x05C6, 0x9003, 4) }, /* Quectel UC20 */
++ { QMI_FIXED_INTF(0x2C7C, 0x0125, 4) }, /* Quectel EC25 */
++ { QMI_FIXED_INTF(0x2C7C, 0x0121, 4) }, /* Quectel EC21 */
++ { QMI_FIXED_INTF(0x05C6, 0x9215, 4) }, /* Quectel EC20 */
++ { QMI_FIXED_INTF(0x2C7C, 0x0191, 4) }, /* Quectel EG91 */
++ { QMI_FIXED_INTF(0x2C7C, 0x0195, 4) }, /* Quectel EG95 */
++ { QMI_FIXED_INTF(0x2C7C, 0x0306, 4) }, /* Quectel EG06/EP06/EM06 */
++ { QMI_FIXED_INTF(0x2C7C, 0x0296, 4) }, /* Quectel BG96 */
++ { QMI_FIXED_INTF(0x2C7C, 0x0435, 4) }, /* Quectel AG35 */
++#endif
+ /* 1. CDC ECM like devices match on the control interface */
+ { /* Huawei E392, E398 and possibly others sharing both device id and more... */
+ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 9),
+@@ -1396,7 +1442,6 @@ static const struct usb_device_id produc
+ {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
+ {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */
+ {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */
+- {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */
+ {QMI_FIXED_INTF(0x05c6, 0x9215, 4)}, /* Quectel EC20 Mini PCIe */
+ {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */
+ {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */
+Index: b/drivers/usb/serial/option.c
+===================================================================
+--- a/drivers/usb/serial/option.c 2021-09-18 12:18:32.582950993 +0800
++++ b/drivers/usb/serial/option.c 2021-09-18 12:20:11.062584026 +0800
+@@ -564,6 +564,23 @@ static void option_instat_callback(struc
+ #define WETELECOM_PRODUCT_WMD300 0x6803
+
+
++#define LONGSUNG_PRODUCT_U9300C 0x9b3c
++
++/* FORGE PRODUCT */
++#define FORGE_VENDOR_ID 0x05c6
++
++#define FORGE_PRODUCT_SLM750 0xf601
++
++/* NODECOM PRODUCT */
++#define NODECOM_VENDOR_ID 0x1508
++
++#define NODECOM_PRODUCT_NL660 0x1001
++
++/* NEOWAY PRODUCT */
++#define NEOWAY_VENDOR_ID 0x2949
++
++#define NEOWAY_PRODUCT_N720 0x8243
++
+ /* Device flags */
+
+ /* Highest interface number which can be used with NCTRL() and RSVD() */
+@@ -583,6 +600,29 @@ static void option_instat_callback(struc
+
+
+ static const struct usb_device_id option_ids[] = {
++#if 1 //Added by Quectel
++ { USB_DEVICE(0x05C6, 0x9090) }, /* Quectel UC15 */
++ { USB_DEVICE(0x05C6, 0x9003) }, /* Quectel UC20 */
++ { USB_DEVICE(0x2C7C, 0x0125) }, /* Quectel EC25 */
++ { USB_DEVICE(0x2C7C, 0x0121) }, /* Quectel EC21 */
++ { USB_DEVICE(0x05C6, 0x9215) }, /* Quectel EC20 */
++ { USB_DEVICE(0x2C7C, 0x0191) }, /* Quectel EG91 */
++ { USB_DEVICE(0x2C7C, 0x0195) }, /* Quectel EG95 */
++ { USB_DEVICE(0x2C7C, 0x0306) }, /* Quectel EG06/EP06/EM06 */
++ { USB_DEVICE(0x2C7C, 0x0700) }, /* Quectel BG95 */
++ { USB_DEVICE(0x2C7C, 0x0296) }, /* Quectel BG96 */
++ { USB_DEVICE(0x2C7C, 0x0435) }, /* Quectel AG35 */
++ { USB_DEVICE(0x2C7C, 0x6026) }, /* Quectel EC200t */
++#endif
++ { USB_DEVICE(0x19d2, 0x0536) },/* MZ386 */
++ { USB_DEVICE(0x19d2, 0x0117) },
++ { USB_DEVICE(0x19d2, 0x0199) },
++ { USB_DEVICE(0x19d2, 0x1476) },
++ { USB_DEVICE(LONGCHEER_VENDOR_ID, LONGSUNG_PRODUCT_U9300C) },
++ { USB_DEVICE(FORGE_VENDOR_ID, FORGE_PRODUCT_SLM750) },
++ { USB_DEVICE(NODECOM_VENDOR_ID, NODECOM_PRODUCT_NL660) },
++ { USB_DEVICE(NEOWAY_VENDOR_ID, NEOWAY_PRODUCT_N720) },
++
+ { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
+ { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
+ { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) },
+@@ -2114,6 +2154,9 @@ static struct usb_serial_driver option_1
+ #ifdef CONFIG_PM
+ .suspend = usb_wwan_suspend,
+ .resume = usb_wwan_resume,
++#if 1 //Added by Quectel
++ .reset_resume = usb_wwan_resume,
++#endif
+ #endif
+ };
+
+@@ -2136,6 +2179,7 @@ static int option_probe(struct usb_seria
+ {
+ struct usb_interface_descriptor *iface_desc =
+ &serial->interface->cur_altsetting->desc;
++ struct usb_device_descriptor *dev_desc = &serial->dev->descriptor;
+ unsigned long device_flags = id->driver_info;
+
+ /* Never bind to the CD-Rom emulation interface */
+@@ -2151,15 +2195,99 @@ static int option_probe(struct usb_seria
+ return -ENODEV;
+
+ /*
++ * Don't bind network interface on Samsung GT-B3730, it is handled by
++ * a separate module.
++ */
++ if (dev_desc->idVendor == cpu_to_le16(SAMSUNG_VENDOR_ID) &&
++ dev_desc->idProduct == cpu_to_le16(SAMSUNG_PRODUCT_GT_B3730) &&
++ iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA)
++ return -ENODEV;
++
++ /*
+ * Allow matching on bNumEndpoints for devices whose interface numbers
+ * can change (e.g. Quectel EP06).
+ */
+ if (device_flags & NUMEP2 && iface_desc->bNumEndpoints != 2)
+ return -ENODEV;
+
+- /* Store the device flags so we can use them during attach. */
+- usb_set_serial_data(serial, (void *)device_flags);
+-
++#if 1 //Added by Quectel
++ //Quectel UC20's interface 4 can be used as USB network device
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && \
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003) \
++ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
++ return -ENODEV;
++ //Quectel EC20's interface 4 can be used as USB network device
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && \
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215) \
++ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
++ return -ENODEV;
++ //Quectel EC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96/AG35's interface 4 can be used as USB network device
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C) && \
++ serial->dev->descriptor.idProduct != cpu_to_le16(0x6026) \
++ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
++ return -ENODEV;
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C) && \
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x6026) \
++ && serial->interface->cur_altsetting->desc.bInterfaceNumber<= 1)
++ return -ENODEV;
++#endif
++#if 1 //Added by Quectel
++ //For USB Auto Suspend
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) &&
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9090)) {
++ pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000);
++ usb_enable_autosuspend(serial->dev);
++ }
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) &&
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)) {
++ pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000);
++ usb_enable_autosuspend(serial->dev);
++ }
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) &&
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)) {
++ pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000);
++ usb_set_serial_data(serial, (void *)device_flags);
++ usb_enable_autosuspend(serial->dev);
++ }
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) {
++ pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000);
++ usb_enable_autosuspend(serial->dev);
++ }
++#endif
++#if 1 //Added by Quectel
++ //For USB Remote Wakeup
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) &&
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9090)) {
++ device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup
++ }
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) &&
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)) {
++ device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup
++ }
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) &&
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)) {
++ device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup
++ }
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) {
++ device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup
++ }
++#endif
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x19d2) &&
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x1476) &&
++ serial->interface->cur_altsetting->desc. bInterfaceNumber == 3)
++ return -ENODEV;
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x19d2) &&
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x1476) &&
++ serial->interface->cur_altsetting->desc. bInterfaceNumber == 4)
++ return -ENODEV;
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x19d2) &&
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x1509) &&
++ serial->interface->cur_altsetting->desc. bInterfaceNumber == 4)
++ return -ENODEV;
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x19d2) &&
++ serial->dev->descriptor.idProduct == cpu_to_le16(0x1509) &&
++ serial->interface->cur_altsetting->desc. bInterfaceNumber == 5)
++ return -ENODEV;
+ return 0;
+ }
+
+Index: b/drivers/usb/serial/qcserial.c
+===================================================================
+--- a/drivers/usb/serial/qcserial.c 2021-09-18 12:18:32.582950993 +0800
++++ b/drivers/usb/serial/qcserial.c 2021-09-18 12:18:32.582950993 +0800
+@@ -88,7 +88,6 @@ static const struct usb_device_id id_tab
+ {USB_DEVICE(0x03f0, 0x241d)}, /* HP Gobi 2000 QDL device (VP412) */
+ {USB_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */
+ {USB_DEVICE(0x05c6, 0x9214)}, /* Acer Gobi 2000 QDL device (VP413) */
+- {USB_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */
+ {USB_DEVICE(0x05c6, 0x9264)}, /* Asus Gobi 2000 QDL device (VR305) */
+ {USB_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */
+ {USB_DEVICE(0x05c6, 0x9234)}, /* Top Global Gobi 2000 QDL device (VR306) */
+Index: b/drivers/usb/serial/usb_wwan.c
+===================================================================
+--- a/drivers/usb/serial/usb_wwan.c 2021-09-18 12:18:32.582950993 +0800
++++ b/drivers/usb/serial/usb_wwan.c 2021-09-18 12:18:32.582950993 +0800
+@@ -476,6 +476,19 @@ static struct urb *usb_wwan_setup_urb(st
+ usb_fill_bulk_urb(urb, serial->dev,
+ usb_sndbulkpipe(serial->dev, endpoint) | dir,
+ buf, len, callback, ctx);
++#if 1 //Added by Quectel for zero packet
++ if (dir == USB_DIR_OUT) {
++ struct usb_device_descriptor *desc = &serial->dev->descriptor;
++ if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9090))
++ urb->transfer_flags |= URB_ZERO_PACKET;
++ if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9003))
++ urb->transfer_flags |= URB_ZERO_PACKET;
++ if (desc->idVendor == cpu_to_le16(0x05C6) && desc->idProduct == cpu_to_le16(0x9215))
++ urb->transfer_flags |= URB_ZERO_PACKET;
++ if (desc->idVendor == cpu_to_le16(0x2C7C))
++ urb->transfer_flags |= URB_ZERO_PACKET;
++ }
++#endif
+
+ if (intfdata->use_zlp && dir == USB_DIR_OUT)
+ urb->transfer_flags |= URB_ZERO_PACKET;
--
2.17.1

View File

@ -0,0 +1,102 @@
From d5bdb37fd02b420cc6a682bf9e51e7e50658c85b Mon Sep 17 00:00:00 2001
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
Date: Sat, 18 Sep 2021 14:44:13 +0800
Subject: [PATCH 4/8] add RS485 support
---
.../821-fix-glinet-rs485-auto-txrx.patch | 83 +++++++++++++++++++
1 file changed, 83 insertions(+)
create mode 100644 target/linux/ath79/patches-5.4/821-fix-glinet-rs485-auto-txrx.patch
diff --git a/target/linux/ath79/patches-5.4/821-fix-glinet-rs485-auto-txrx.patch b/target/linux/ath79/patches-5.4/821-fix-glinet-rs485-auto-txrx.patch
new file mode 100644
index 0000000000..2030cad53d
--- /dev/null
+++ b/target/linux/ath79/patches-5.4/821-fix-glinet-rs485-auto-txrx.patch
@@ -0,0 +1,83 @@
+Index: b/drivers/tty/serial/8250/8250.h
+===================================================================
+--- a/drivers/tty/serial/8250/8250.h 2021-08-26 20:55:22.000000000 +0800
++++ b/drivers/tty/serial/8250/8250.h 2021-09-18 14:30:46.200708724 +0800
+@@ -13,6 +13,8 @@
+
+ #include "../serial_mctrl_gpio.h"
+
++extern unsigned int rs485txen_gpio;
++
+ struct uart_8250_dma {
+ int (*tx_dma)(struct uart_8250_port *p);
+ int (*rx_dma)(struct uart_8250_port *p);
+Index: b/drivers/tty/serial/8250/8250_of.c
+===================================================================
+--- a/drivers/tty/serial/8250/8250_of.c 2021-08-26 20:55:22.000000000 +0800
++++ b/drivers/tty/serial/8250/8250_of.c 2021-09-18 14:41:02.964067786 +0800
+@@ -205,6 +205,7 @@ err_pmruntime:
+ /*
+ * Try to register a serial port
+ */
++unsigned int rs485txen_gpio = 0xff;
+ static int of_platform_serial_probe(struct platform_device *ofdev)
+ {
+ struct of_serial_info *info;
+@@ -246,6 +247,10 @@ static int of_platform_serial_probe(stru
+ &port8250.overrun_backoff_time_ms) != 0)
+ port8250.overrun_backoff_time_ms = 0;
+
++ if(!of_property_read_u32(ofdev->dev.of_node,"rs485_pin",&rs485txen_gpio)){
++ pr_info("Serial port to 485 enable,rs485txen_gpio = gpio%d \n",rs485txen_gpio);
++ }
++
+ ret = serial8250_register_8250_port(&port8250);
+ if (ret < 0)
+ goto err_dispose;
+Index: b/drivers/tty/serial/8250/8250_port.c
+===================================================================
+--- a/drivers/tty/serial/8250/8250_port.c 2021-08-26 20:55:22.000000000 +0800
++++ b/drivers/tty/serial/8250/8250_port.c 2021-09-18 14:36:49.548608917 +0800
+@@ -34,6 +34,7 @@
+ #include <linux/uaccess.h>
+ #include <linux/pm_runtime.h>
+ #include <linux/ktime.h>
++#include <linux/gpio/consumer.h>
+
+ #include <asm/io.h>
+ #include <asm/irq.h>
+@@ -1463,10 +1464,22 @@ static void __stop_tx_rs485(struct uart_
+ }
+ }
+
++static unsigned int serial8250_tx_empty(struct uart_port *port);
+ static inline void __do_stop_tx(struct uart_8250_port *p)
+ {
+- if (serial8250_clear_THRI(p))
++ if (serial8250_clear_THRI(p)){
++
+ serial8250_rpm_put_tx(p);
++
++ if(0xff != rs485txen_gpio){
++
++ while(!serial8250_tx_empty(&(p->port))){
++
++ ;
++ }
++ gpiod_set_value(gpio_to_desc(rs485txen_gpio),0);
++ }
++ }
+ }
+
+ static inline void __stop_tx(struct uart_8250_port *p)
+@@ -1510,6 +1523,10 @@ static void serial8250_stop_tx(struct ua
+
+ static inline void __start_tx(struct uart_port *port)
+ {
++ if(0xff != rs485txen_gpio){
++ gpiod_set_value(gpio_to_desc(rs485txen_gpio),1);
++ }
++
+ struct uart_8250_port *up = up_to_u8250p(port);
+
+ if (up->dma && !up->dma->tx_dma(up))
--
2.17.1

View File

@ -0,0 +1,79 @@
From 21020c2da30239e998d69c95c53bfbbc428f76a2 Mon Sep 17 00:00:00 2001
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
Date: Sat, 18 Sep 2021 15:52:56 +0800
Subject: [PATCH 5/8] add spinand support
---
.../499-mtd-spinand-add-support.patch | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
create mode 100644 target/linux/ath79/patches-5.4/499-mtd-spinand-add-support.patch
diff --git a/target/linux/ath79/patches-5.4/499-mtd-spinand-add-support.patch b/target/linux/ath79/patches-5.4/499-mtd-spinand-add-support.patch
new file mode 100644
index 0000000000..4a4b6e9bf0
--- /dev/null
+++ b/target/linux/ath79/patches-5.4/499-mtd-spinand-add-support.patch
@@ -0,0 +1,60 @@
+Index: b/drivers/mtd/nand/spi/gigadevice.c
+===================================================================
+--- a/drivers/mtd/nand/spi/gigadevice.c 2021-09-18 14:49:34.250500716 +0800
++++ b/drivers/mtd/nand/spi/gigadevice.c 2021-09-18 14:55:06.091509000 +0800
+@@ -278,6 +278,15 @@ static const struct spinand_info gigadev
+ SPINAND_HAS_QE_BIT,
+ SPINAND_ECCINFO(&gd5fxgq4_variant2_ooblayout,
+ gd5fxgq4uexxg_ecc_get_status)),
++ SPINAND_INFO("GD5F1GQ5UExxG", 0x51,
++ NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
++ NAND_ECCREQ(8, 512),
++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
++ &write_cache_variants,
++ &update_cache_variants),
++ SPINAND_HAS_QE_BIT,
++ SPINAND_ECCINFO(&gd5fxgq4_variant2_ooblayout,
++ gd5fxgq4uexxg_ecc_get_status)),
+ SPINAND_INFO("GD5F1GQ4UFxxG", 0xb148,
+ NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
+ NAND_ECCREQ(8, 512),
+Index: b/drivers/mtd/nand/spi/macronix.c
+===================================================================
+--- a/drivers/mtd/nand/spi/macronix.c 2021-08-26 20:55:22.000000000 +0800
++++ b/drivers/mtd/nand/spi/macronix.c 2021-09-18 15:06:07.031203336 +0800
+@@ -108,6 +108,15 @@ static const struct spinand_info macroni
+ SPINAND_HAS_QE_BIT,
+ SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ mx35lf1ge4ab_ecc_get_status)),
++ SPINAND_INFO("MX35LF1G24AD", 0x14,
++ NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
++ NAND_ECCREQ(4, 512),
++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
++ &write_cache_variants,
++ &update_cache_variants),
++ SPINAND_HAS_QE_BIT,
++ SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
++ mx35lf1ge4ab_ecc_get_status)),
+ SPINAND_INFO("MX35LF2GE4AB", 0x22,
+ NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 2, 1, 1),
+ NAND_ECCREQ(4, 512),
+Index: b/drivers/mtd/nand/spi/paragon.c
+===================================================================
+--- a/drivers/mtd/nand/spi/paragon.c 2021-08-26 20:55:22.000000000 +0800
++++ b/drivers/mtd/nand/spi/paragon.c 2021-09-18 15:01:02.476309144 +0800
+@@ -115,6 +115,15 @@ static const struct spinand_info paragon
+ 0,
+ SPINAND_ECCINFO(&pn26g0xa_ooblayout,
+ pn26g0xa_ecc_get_status)),
++ SPINAND_INFO("XT26G01xxxx", 0xf1,
++ NAND_MEMORG(1, 2048, 128, 64, 1024, 21, 1, 1, 1),
++ NAND_ECCREQ(8, 512),
++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
++ &write_cache_variants,
++ &update_cache_variants),
++ 0,
++ SPINAND_ECCINFO(&pn26g0xa_ooblayout,
++ pn26g0xa_ecc_get_status)),
+ };
+
+ static int paragon_spinand_detect(struct spinand_device *spinand)
--
2.17.1

View File

@ -0,0 +1,59 @@
From aa487fa14318de14da3281023b8f45e7b6e7b0ff Mon Sep 17 00:00:00 2001
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
Date: Sat, 18 Sep 2021 16:40:41 +0800
Subject: [PATCH 6/8] led netdev trigger by wwanx
---
target/linux/ath79/dts/qca953x.dtsi | 2 +-
.../931-fix-led-netdev-trigger-by-wwanx.patch | 26 +++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
create mode 100644 target/linux/ath79/patches-5.4/931-fix-led-netdev-trigger-by-wwanx.patch
diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi
index 943e42437a..7774d073e7 100644
--- a/target/linux/ath79/dts/qca953x.dtsi
+++ b/target/linux/ath79/dts/qca953x.dtsi
@@ -240,7 +240,7 @@
builtin-switch;
builtin_switch: switch0@1f {
- compatible = "qca,ar8229";
+ compatible = "qca,ar8229-builtin";
reg = <0x1f>;
resets = <&rst 8>;
diff --git a/target/linux/ath79/patches-5.4/931-fix-led-netdev-trigger-by-wwanx.patch b/target/linux/ath79/patches-5.4/931-fix-led-netdev-trigger-by-wwanx.patch
new file mode 100644
index 0000000000..e4b5950faf
--- /dev/null
+++ b/target/linux/ath79/patches-5.4/931-fix-led-netdev-trigger-by-wwanx.patch
@@ -0,0 +1,26 @@
+Index: b/drivers/leds/trigger/ledtrig-netdev.c
+===================================================================
+--- a/drivers/leds/trigger/ledtrig-netdev.c 2021-08-26 20:55:22.000000000 +0800
++++ b/drivers/leds/trigger/ledtrig-netdev.c 2021-09-18 16:00:16.427666394 +0800
+@@ -109,6 +109,7 @@ static ssize_t device_name_store(struct
+ size_t size)
+ {
+ struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev);
++ unsigned int flags;
+
+ if (size >= IFNAMSIZ)
+ return -EINVAL;
+@@ -132,9 +133,11 @@ static ssize_t device_name_store(struct
+ dev_get_by_name(&init_net, trigger_data->device_name);
+
+ clear_bit(NETDEV_LED_MODE_LINKUP, &trigger_data->mode);
+- if (trigger_data->net_dev != NULL)
+- if (netif_carrier_ok(trigger_data->net_dev))
++ if (trigger_data->net_dev != NULL){
++ flags = dev_get_flags(trigger_data->net_dev);
++ if (flags & IFF_LOWER_UP)
+ set_bit(NETDEV_LED_MODE_LINKUP, &trigger_data->mode);
++ }
+
+ trigger_data->last_activity = 0;
+
--
2.17.1

View File

@ -0,0 +1,240 @@
From 35dfe90cd27e4070eb0dba1ee1d33618e2e8f4cb Mon Sep 17 00:00:00 2001
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
Date: Sat, 18 Sep 2021 18:14:38 +0800
Subject: [PATCH 7/8] ath79: add support for gl ar300m
---
.../ath79/dts/qca9531_glinet_gl-ar300m.dtsi | 42 +++++++++++++++----
.../generic/base-files/etc/board.d/01_leds | 2 -
.../generic/base-files/etc/board.d/02_network | 1 -
target/linux/ath79/image/generic.mk | 21 ----------
target/linux/ath79/image/nand.mk | 26 ++++++------
.../ath79/nand/base-files/etc/board.d/01_leds | 2 +-
.../nand/base-files/etc/board.d/02_network | 2 +
7 files changed, 49 insertions(+), 47 deletions(-)
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
index d0b0d88c48..2f747e5a30 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
@@ -12,6 +12,26 @@
label-mac-device = &eth0;
};
+ gl_hw {
+ compatible = "gl-hw-info";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "ar300m";
+ wan = "eth0";
+ lan = "eth1";
+ switch-button = "gpio-0";
+ reset-button = "gpio-3";
+ usb-port = "1-1";
+ factory_data {
+ device_mac = "art";
+ device_ddns = "art", "0x10";
+ device_sn_bak = "art", "0x20";
+ device_sn = "art", "0x30";
+ country_code = "art", "0x88";
+ };
+ };
+
keys {
compatible = "gpio-keys";
@@ -43,28 +63,31 @@
// Colors for non-Lite versions
led_status: status {
- label = "green:status";
+ label = "gl-ar300m:green:status";
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
};
lan {
- label = "green:lan";
+ label = "gl-ar300m:green:lan";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
led_wlan: wlan {
- label = "red:wlan";
+ label = "gl-ar300m:green:wlan";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
};
+ gpio-export {
+ compatible = "gpio-export";
- i2c: i2c {
- compatible = "i2c-gpio";
-
- sda-gpios = <&gpio 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
- scl-gpios = <&gpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ gpio_usb_power {
+ gpio-export,name = "usb_power";
+ gpio-export,output = <1>;
+ gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
+ };
};
+
};
&pcie0 {
@@ -147,14 +170,17 @@
phy-handle = <&swphy4>;
mtd-mac-address = <&art 0x0>;
+ ifname = "eth0";
};
&eth1 {
mtd-mac-address = <&art 0x0>;
mtd-mac-address-increment = <1>;
+ ifname = "eth1";
};
&wmac {
status = "okay";
mtd-cal-data = <&art 0x1000>;
+ mtd-mac-address = <&art 0x1002>;
};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
index 985adfc6a7..f3690897ee 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
@@ -16,8 +16,6 @@ alfa-network,ap121fe|\
avm,fritz450e|\
glinet,6408|\
glinet,6416|\
-glinet,gl-ar300m-lite|\
-glinet,gl-ar300m16|\
pcs,cap324|\
tplink,cpe610-v1|\
tplink,cpe610-v2)
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index c4d9d76941..f446ba28c2 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -38,7 +38,6 @@ ath79_setup_interfaces()
engenius,ecb1750|\
engenius,ecb600|\
enterasys,ws-ap3705i|\
- glinet,gl-ar300m-lite|\
glinet,gl-usb150|\
hak5,wifi-pineapple-nano|\
meraki,mr16|\
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 05ed698401..9fba9155df 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1167,27 +1167,6 @@ define Device/glinet_gl-ar150
endef
TARGET_DEVICES += glinet_gl-ar150
-define Device/glinet_gl-ar300m-common-nor
- SOC := qca9531
- DEVICE_VENDOR := GL.iNet
- DEVICE_PACKAGES := kmod-usb2
- IMAGE_SIZE := 16000k
- SUPPORTED_DEVICES += gl-ar300m
-endef
-
-define Device/glinet_gl-ar300m-lite
- $(Device/glinet_gl-ar300m-common-nor)
- DEVICE_MODEL := GL-AR300M
- DEVICE_VARIANT := Lite
-endef
-TARGET_DEVICES += glinet_gl-ar300m-lite
-
-define Device/glinet_gl-ar300m16
- $(Device/glinet_gl-ar300m-common-nor)
- DEVICE_MODEL := GL-AR300M16
-endef
-TARGET_DEVICES += glinet_gl-ar300m16
-
define Device/glinet_gl-ar750
SOC := qca9531
DEVICE_VENDOR := GL.iNet
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 0c6dd699f5..8f5c27d0fd 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -77,33 +77,31 @@ define Device/domywifi_dw33d
endef
TARGET_DEVICES += domywifi_dw33d
-define Device/glinet_gl-ar300m-common-nand
+define Device/glinet_gl-ar300m-common
SOC := qca9531
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-AR300M
- DEVICE_PACKAGES := kmod-usb2
- KERNEL_SIZE := 4096k
- IMAGE_SIZE := 16000k
- PAGESIZE := 2048
- VID_HDR_OFFSET := 2048
+ DEVICE_PACKAGES := kmod-usb-core kmod-usb2 block-mount kmod-usb-storage kmod-usb-ledtrig-usbport
+ SUPPORTED_DEVICES += gl-ar300m glinet,gl-ar300m
endef
define Device/glinet_gl-ar300m-nand
- $(Device/glinet_gl-ar300m-common-nand)
+ $(Device/glinet_gl-ar300m-common)
DEVICE_VARIANT := NAND
+ KERNEL_SIZE := 4096k
BLOCKSIZE := 128k
- IMAGES += factory.img
- IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
- IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
- SUPPORTED_DEVICES += glinet,gl-ar300m-nor
+ PAGESIZE := 2048
+ VID_HDR_OFFSET := 2048
+ IMAGES := factory.img sysupgrade.tar
+ IMAGE/sysupgrade.tar := sysupgrade-tar-compat-1806 | append-gl-metadata
+ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | append-gl-metadata
endef
TARGET_DEVICES += glinet_gl-ar300m-nand
define Device/glinet_gl-ar300m-nor
- $(Device/glinet_gl-ar300m-common-nand)
+ $(Device/glinet_gl-ar300m-common)
DEVICE_VARIANT := NOR
- BLOCKSIZE := 64k
- SUPPORTED_DEVICES += glinet,gl-ar300m-nand gl-ar300m
+ IMAGE_SIZE := 16000k
endef
TARGET_DEVICES += glinet_gl-ar300m-nor
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
index 16545083fb..eb9e5817e6 100755
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -9,7 +9,7 @@ board=$(board_name)
case "$board" in
glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor)
- ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
+ ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth1"
;;
glinet,gl-mifi)
ucidef_set_led_wlan "wlan" "WLAN" "gl-mifi:green:wlan" "phy0tpt"
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 73e23e5eb9..bee36cac1b 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
@@ -21,6 +21,8 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:2" "3:lan:1" "1:wan"
;;
+ glinet,gl-ar300m-nor|\
+ glinet,gl-ar300m-nand|\
glinet,gl-mifi)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
--
2.17.1

View File

@ -0,0 +1,341 @@
From f13cf41ee822127c8a42eb05a896f38724e0844f Mon Sep 17 00:00:00 2001
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
Date: Wed, 22 Sep 2021 11:53:08 +0800
Subject: [PATCH 8/8] ath79: add support for gl x300b
---
.../dts/qca9531_glinet_gl-x300b-nor-nand.dts | 25 +++
.../ath79/dts/qca9531_glinet_gl-x300b-nor.dts | 18 ++
.../ath79/dts/qca9531_glinet_gl-x300b.dtsi | 191 ++++++++++++++++++
target/linux/ath79/image/nand.mk | 28 +++
.../ath79/nand/base-files/etc/board.d/01_leds | 6 +
.../nand/base-files/etc/board.d/02_network | 2 +
6 files changed, 270 insertions(+)
create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-x300b-nor-nand.dts
create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-x300b-nor.dts
create mode 100755 target/linux/ath79/dts/qca9531_glinet_gl-x300b.dtsi
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x300b-nor-nand.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x300b-nor-nand.dts
new file mode 100644
index 0000000000..b50ed14f26
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-x300b-nor-nand.dts
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "qca9531_glinet_gl-x300b.dtsi"
+
+/ {
+ compatible = "glinet,gl-x300b-nor-nand", "qca,qca9531";
+ model = "GL.iNet GL-X300B (NOR/NAND)";
+};
+
+&nor_partitions {
+ partition@60000 {
+ label = "kernel";
+ reg = <0x060000 0x200000>;
+ };
+ parition@260000 {
+ label = "nor_reserved";
+ reg = <0x260000 0xbc0000>;
+ };
+};
+
+&nand_ubi {
+ label = "ubi";
+};
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x300b-nor.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x300b-nor.dts
new file mode 100644
index 0000000000..566df3c238
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-x300b-nor.dts
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "qca9531_glinet_gl-x300b.dtsi"
+
+/ {
+ compatible = "glinet,gl-x300b-nor", "qca,qca9531";
+ model = "GL.iNet GL-X300B (NOR)";
+};
+
+&nor_partitions {
+ partition@60000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x060000 0xfa0000>;
+ };
+};
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dtsi
new file mode 100755
index 0000000000..728b40dceb
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dtsi
@@ -0,0 +1,191 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "qca953x.dtsi"
+
+/ {
+ compatible = "glinet,gl-x300b", "qca,qca9531";
+ model = "GL.iNet GL-X300B";
+
+ gl_hw {
+ compatible = "gl-hw-info";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "x300b";
+ wan = "eth0";
+ lan = "eth1";
+ build-in-modem = "1-1";
+ reset-button = "gpio-3";
+ factory_data {
+ device_mac = "art";
+ device_ddns = "art", "0x10";
+ device_sn_bak = "art", "0x20";
+ device_sn = "art", "0x30";
+ country_code = "art", "0x88";
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys-polled";
+
+ poll-interval = <20>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&jtag_disable_pins>;
+
+ button0 {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ wlan2g {
+ label = "gl-x300b:green:wlan2g";
+ gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "phy0tpt";
+ };
+
+ wan {
+ label = "gl-x300b:green:wan";
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+ };
+
+ lte {
+ label = "gl-x300b:green:lte";
+ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+ };
+ };
+ gpio-export {
+ compatible = "gpio-export";
+
+ gpio_lte_power {
+ gpio-export,name = "gpio0";
+ gpio-export,output = <0>;
+ gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+ };
+
+ gpio_rs485tx_en {
+ gpio-export,name = "gpio1";
+ gpio-export,output = <0>;
+ gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
+ };
+
+ gpio_ble_rst {
+ gpio-export,name = "gpio16";
+ gpio-export,output = <0>;
+ gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
+ };
+
+ };
+ watchdog {
+ compatible = "hw_wdt";
+ dog_en_gpio= <12>;
+ feed_dog_gpio=<2>;
+ feed_dog_interval=<100000000>;
+ };
+
+};
+
+
+&uart {
+ status = "okay";
+ rs485_pin=<1>;
+};
+
+&usb0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ hub_port: port@1 {
+ reg = <1>;
+ #trigger-source-cells = <0>;
+ };
+};
+
+&usb_phy {
+ status = "okay";
+};
+
+&spi {
+ status = "okay";
+ num-cs = <2>;
+ cs-gpios = <0>, <0>;
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <25000000>;
+
+ nor_partitions: partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x000000 0x040000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "u-boot-env";
+ reg = <0x040000 0x010000>;
+ };
+
+ art: partition@50000 {
+ label = "art";
+ reg = <0x050000 0x010000>;
+ read-only;
+ };
+ };
+ };
+
+ flash_nand: flash@1 {
+ compatible = "spi-nand";
+ reg = <1>;
+ spi-max-frequency = <25000000>;
+
+ nand_partitions: partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ nand_ubi: partition@0 {
+ label = "nand_ubi";
+ reg = <0x000000 0x8000000>;
+ };
+ };
+ };
+
+};
+/*
+&bootargs {
+ bootargs="";
+};*/
+
+&eth0 {
+ status = "okay";
+ mtd-mac-address = <&art 0x0>;
+ phy-handle = <&swphy4>;
+ ifname = "eth0";
+};
+
+&eth1 {
+ mtd-mac-address = <&art 0x0>;
+ mtd-mac-address-increment = <1>;
+ ifname = "eth1";
+};
+
+&wmac {
+ status = "okay";
+ mtd-cal-data = <&art 0x1000>;
+ mtd-mac-address = <&art 0x1002>;
+};
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 8f5c27d0fd..32d8fb612f 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -77,6 +77,34 @@ define Device/domywifi_dw33d
endef
TARGET_DEVICES += domywifi_dw33d
+define Device/glinet_gl-x300b-common
+ SOC := qca9531
+ DEVICE_VENDOR := GL.iNet
+ DEVICE_MODEL := GL-X300B
+ DEVICE_PACKAGES := kmod-usb2 block-mount
+ SUPPORTED_DEVICES += gl-x300b glinet,gl-x300b
+endef
+
+define Device/glinet_gl-x300b-nor
+ $(Device/glinet_gl-x300b-common)
+ DEVICE_VARIANT := NOR
+ IMAGE_SIZE := 16000k
+endef
+TARGET_DEVICES += glinet_gl-x300b-nor
+
+define Device/glinet_gl-x300b-nor-nand
+ $(Device/glinet_gl-x300b-common)
+ DEVICE_VARIANT := NOR/NAND
+ KERNEL_SIZE := 4096k
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ VID_HDR_OFFSET := 2048
+ IMAGES := factory.img sysupgrade.tar
+ IMAGE/sysupgrade.tar := sysupgrade-tar-compat-1806 | append-gl-metadata
+ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | append-gl-metadata
+endef
+TARGET_DEVICES += glinet_gl-x300b-nor-nand
+
define Device/glinet_gl-ar300m-common
SOC := qca9531
DEVICE_VENDOR := GL.iNet
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
index eb9e5817e6..51cfe6562f 100755
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -17,6 +17,12 @@ glinet,gl-mifi)
ucidef_set_led_switch "lan" "LAN" "gl-mifi:green:lan" "switch0" "0x2"
ucidef_set_led_netdev "3gnet" "3GNET" "gl-mifi:green:net" "3g-wan"
;;
+glinet,gl-x300b-nor|\
+glinet,gl-x300b-nor-nand)
+ ucidef_set_led_netdev "wlan2g" "WLAN2G" "gl-x300b:green:wlan2g" "wlan0"
+ ucidef_set_led_netdev "wan" "WAN" "gl-x300b:green:wan" "eth0"
+ ucidef_set_led_netdev "3gnet" "3GNET" "gl-x300b:green:lte" "3g-wan"
+ ;;
glinet,gl-xe300-iot|\
glinet,gl-xe300-nor|\
glinet,gl-xe300-nor-nand)
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 bee36cac1b..37fafafb0d 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
@@ -23,6 +23,8 @@ ath79_setup_interfaces()
;;
glinet,gl-ar300m-nor|\
glinet,gl-ar300m-nand|\
+ glinet,gl-x300b-nor|\
+ glinet,gl-x300b-nor-nand|\
glinet,gl-mifi)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
--
2.17.1

View File

@ -0,0 +1,255 @@
From 9d8aee76faf6c15a9259d57e99b76aa052187035 Mon Sep 17 00:00:00 2001
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
Date: Thu, 23 Sep 2021 11:48:04 +0800
Subject: [PATCH 1/2] ath79: add support for gl ar150
---
target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts | 74 +++++++++++++++++-----
target/linux/ath79/image/generic.mk | 10 ---
target/linux/ath79/image/nand.mk | 11 +++-
.../ath79/nand/base-files/etc/board.d/01_leds | 3 +
.../ath79/nand/base-files/etc/board.d/02_network | 1 +
5 files changed, 72 insertions(+), 27 deletions(-)
diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts
index 6a13c1b..42edf5a 100644
--- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts
+++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts
@@ -1,45 +1,63 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-
-#include "ar9330.dtsi"
+/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
+#include "ar9330_glinet.dtsi"
+
/ {
model = "GL.iNet GL-AR150";
compatible = "glinet,gl-ar150", "qca,ar9330";
aliases {
- led-boot = &led_power;
- led-failsafe = &led_power;
- led-running = &led_power;
- led-upgrade = &led_power;
- label-mac-device = &eth0;
+ serial0 = &uart;
+ };
+
+ gl_hw {
+ compatible = "gl-hw-info";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "ar150";
+ wan = "eth0";
+ lan = "eth1";
+ switch-button = "gpio-8";
+ reset-button = "gpio-11";
+ usb-port = "1-1";
+ factory_data {
+ device_mac = "art";
+ device_ddns = "art", "0x10";
+ device_sn_bak = "art", "0x20";
+ device_sn = "art", "0x30";
+ country_code = "art", "0x88";
+ };
};
leds {
compatible = "gpio-leds";
wlan {
- label = "orange:wlan";
+ label = "gl-ar150:red:wlan";
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy0tpt";
};
configurable {
- label = "green:configurable";
+ label = "gl-ar150:green:configurable";
gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
};
led_power: power {
- label = "green:power";
+ label = "gl-ar150:green:power";
gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
};
keys {
- compatible = "gpio-keys";
+ compatible = "gpio-keys-polled";
+ poll-interval = <100>;
manual {
label = "manual";
@@ -48,7 +66,7 @@
};
auto {
- label = "auto";
+ label = "BTN_8";
linux,code = <BTN_8>;
gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
};
@@ -59,6 +77,19 @@
gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
};
};
+ gpio-export {
+ compatible = "gpio-export";
+ gpio_usb_power {
+ gpio-export,name = "usb_power";
+ gpio-export,output = <1>;
+ gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+ };
+
+ };
+};
+
+&uart {
+ status = "okay";
};
&usb {
@@ -66,17 +97,27 @@
status = "okay";
};
+&usb {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ hub_port: port@1 {
+ reg = <1>;
+ #trigger-source-cells = <0>;
+ };
+};
&usb_phy {
status = "okay";
- gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
};
&spi {
+ num-chipselects = <1>;
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
- spi-max-frequency = <50000000>;
+ spi-max-frequency = <104000000>;
reg = <0>;
partitions {
@@ -114,13 +155,15 @@
status = "okay";
mtd-mac-address = <&art 0x0>;
+
+ ifname = "eth0";
};
&eth1 {
status = "okay";
mtd-mac-address = <&art 0x0>;
-
+ ifname = "eth1";
gmac-config {
device = <&gmac>;
@@ -131,7 +174,6 @@
&wmac {
status = "okay";
-
mtd-cal-data = <&art 0x1000>;
mtd-mac-address = <&art 0x0>;
};
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 9fba915..0799ae7 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1157,16 +1157,6 @@ define Device/glinet_6416
endef
TARGET_DEVICES += glinet_6416
-define Device/glinet_gl-ar150
- SOC := ar9330
- DEVICE_VENDOR := GL.iNet
- DEVICE_MODEL := GL-AR150
- DEVICE_PACKAGES := kmod-usb-chipidea2
- IMAGE_SIZE := 16000k
- SUPPORTED_DEVICES += gl-ar150
-endef
-TARGET_DEVICES += glinet_gl-ar150
-
define Device/glinet_gl-ar750
SOC := qca9531
DEVICE_VENDOR := GL.iNet
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 32d8fb6..f45877e 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -77,6 +77,15 @@ define Device/domywifi_dw33d
endef
TARGET_DEVICES += domywifi_dw33d
+define Device/glinet_gl-ar150
+ SOC := ar9330
+ DEVICE_TITLE := GL.iNet GL-AR150
+ DEVICE_PACKAGES := kmod-usb2 block-mount
+ IMAGE_SIZE := 16000k
+ SUPPORTED_DEVICES += gl-ar150 glinet,gl-ar150
+endef
+TARGET_DEVICES += glinet_gl-ar150
+
define Device/glinet_gl-x300b-common
SOC := qca9531
DEVICE_VENDOR := GL.iNet
@@ -136,7 +145,7 @@ TARGET_DEVICES += glinet_gl-ar300m-nor
define Device/glinet_gl-mifi
SOC := ar9331
DEVICE_VENDOR := GL.iNET
- DEVICE_MODEL := GL-MiFi
+ DEVICE_MODEL := GL-MIFI
DEVICE_PACKAGES := kmod-usb-chipidea2
IMAGE_SIZE := 16000k
SUPPORTED_DEVICES += gl-mifi glinet,gl-mifi
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
index 51cfe65..27f8ee2 100755
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -7,6 +7,9 @@ board_config_update
board=$(board_name)
case "$board" in
+glinet,gl-ar150)
+ ucidef_set_led_wlan "wlan" "WLAN" "gl-ar150:orange:wlan" "phy0tpt"
+ ;;
glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor)
ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth1"
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 37fafaf..9be5bef 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
@@ -25,6 +25,7 @@ ath79_setup_interfaces()
glinet,gl-ar300m-nand|\
glinet,gl-x300b-nor|\
glinet,gl-x300b-nor-nand|\
+ glinet,gl-ar150|\
glinet,gl-mifi)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
--
2.7.4

View File

@ -0,0 +1,366 @@
From 21ee3befaa14358ee3587eb459c150c04f56cd78 Mon Sep 17 00:00:00 2001
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
Date: Thu, 23 Sep 2021 18:22:18 +0800
Subject: [PATCH 2/2] ath79: add support for gl usb150
---
target/linux/ath79/dts/ar9330_glinet_gl-usb150.dts | 136 +++++++++++++++++++++
target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts | 119 ------------------
.../generic/base-files/etc/board.d/02_network | 1 -
target/linux/ath79/image/generic.mk | 9 --
target/linux/ath79/image/nand.mk | 9 ++
.../ath79/nand/base-files/etc/board.d/01_leds | 4 +
.../ath79/nand/base-files/etc/board.d/02_network | 1 +
7 files changed, 150 insertions(+), 129 deletions(-)
create mode 100755 target/linux/ath79/dts/ar9330_glinet_gl-usb150.dts
delete mode 100644 target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts
diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-usb150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-usb150.dts
new file mode 100755
index 0000000..72848a5
--- /dev/null
+++ b/target/linux/ath79/dts/ar9330_glinet_gl-usb150.dts
@@ -0,0 +1,136 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "ar9330_glinet.dtsi"
+
+/ {
+ model = "GL.iNet GL-USB150";
+ compatible = "glinet,gl-usb150", "qca,ar9330";
+
+ aliases {
+ serial0 = &uart;
+ };
+
+ gl_hw {
+ compatible = "gl-hw-info";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "usb150";
+ lan = "eth0";
+ reset-button = "gpio-11";
+ factory_data {
+ device_mac = "art";
+ device_ddns = "art", "0x10";
+ device_sn_bak = "art", "0x20";
+ device_sn = "art", "0x30";
+ country_code = "art", "0x88";
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ wlan {
+ label = "gl-usb150:orange:wlan";
+ gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "phy0tpt";
+ };
+
+ led_power: power {
+ label = "gl-usb150:green:power";
+ gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys-polled";
+ poll-interval = <100>;
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+ };
+ };
+ gpio-export {
+ compatible = "gpio-export";
+ gpio_usb_power {
+ gpio-export,name = "gpio7";
+ gpio-export,output = <0>;
+ gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&uart {
+ status = "okay";
+};
+
+&spi {
+ num-chipselects = <1>;
+ status = "okay";
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ spi-max-frequency = <104000000>;
+ reg = <0>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x000000 0x040000>;
+ read-only;
+ };
+
+ partition@1 {
+ label = "u-boot-env";
+ reg = <0x040000 0x010000>;
+ };
+
+ partition@2 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x050000 0xfa0000>;
+ };
+
+ art: partition@3 {
+ label = "art";
+ reg = <0xff0000 0x010000>;
+ read-only;
+ };
+ };
+ };
+};
+
+&eth0 {
+ status = "okay";
+
+ mtd-mac-address = <&art 0x0>;
+
+ gmac-config {
+ device = <&gmac>;
+
+ switch-phy-addr-swap = <0>;
+ switch-phy-swap = <0>;
+ };
+};
+
+&eth1 {
+ status = "okay";
+ compatible = "syscon", "simple-mfd";
+};
+
+&wmac {
+ status = "okay";
+ mtd-cal-data = <&art 0x1000>;
+ mtd-mac-address = <&art 0x0>;
+};
diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts
deleted file mode 100644
index d1c2654..0000000
--- a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts
+++ /dev/null
@@ -1,119 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-
-#include "ar9331.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
-
-/ {
- compatible = "glinet,gl-usb150", "qca,ar9331";
- model = "GL.iNet GL-USB150";
-
- aliases {
- led-boot = &led_power;
- led-failsafe = &led_power;
- led-running = &led_power;
- led-upgrade = &led_power;
- label-mac-device = &eth0;
- };
-
- leds {
- compatible = "gpio-leds";
-
- wlan {
- label = "green:wlan";
- gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
- linux,default-trigger = "phy0tpt";
- };
-
- led_power: power {
- label = "green:power";
- gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
- default-state = "on";
- };
- };
-
- keys {
- compatible = "gpio-keys";
-
- reset {
- label = "reset";
- linux,code = <KEY_RESTART>;
- gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
- debounce-interval = <60>;
- };
- };
-
- gpio-export {
- compatible = "gpio-export";
-
- gpio_lan_reset {
- gpio-export,name = "lan:reset";
- gpio-export,output = <0>;
- gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
- };
- };
-};
-
-&eth0 {
- status = "okay";
-
- mtd-mac-address = <&art 0x0>;
-
- gmac-config {
- device = <&gmac>;
- switch-phy-addr-swap = <0>;
- switch-phy-swap = <0>;
- };
-};
-
-&eth1 {
- status = "okay";
-
- compatible = "syscon", "simple-mfd";
-};
-
-&spi {
- status = "okay";
-
- flash@0 {
- compatible = "jedec,spi-nor";
- spi-max-frequency = <33000000>;
- reg = <0>;
-
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x000000 0x040000>;
- read-only;
- };
-
- partition@40000 {
- label = "u-boot-env";
- reg = <0x040000 0x010000>;
- };
-
- partition@50000 {
- compatible = "denx,uimage";
- label = "firmware";
- reg = <0x050000 0xfa0000>;
- };
-
- art: partition@ff0000 {
- label = "art";
- reg = <0xff0000 0x010000>;
- read-only;
- };
- };
- };
-};
-
-&wmac {
- status = "okay";
-
- mtd-cal-data = <&art 0x1000>;
-};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index f446ba2..dedc9fc 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -38,7 +38,6 @@ ath79_setup_interfaces()
engenius,ecb1750|\
engenius,ecb600|\
enterasys,ws-ap3705i|\
- glinet,gl-usb150|\
hak5,wifi-pineapple-nano|\
meraki,mr16|\
netgear,ex6400|\
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 0799ae7..cf3fce3 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1167,15 +1167,6 @@ define Device/glinet_gl-ar750
endef
TARGET_DEVICES += glinet_gl-ar750
-define Device/glinet_gl-usb150
- SOC := ar9331
- DEVICE_VENDOR := GL.iNET
- DEVICE_MODEL := GL-USB150
- IMAGE_SIZE := 16000k
- SUPPORTED_DEVICES += gl-usb150
-endef
-TARGET_DEVICES += glinet_gl-usb150
-
define Device/glinet_gl-x750
SOC := qca9531
DEVICE_VENDOR := GL.iNet
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index f45877e..83ca331 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -86,6 +86,15 @@ define Device/glinet_gl-ar150
endef
TARGET_DEVICES += glinet_gl-ar150
+define Device/glinet_gl-usb150
+ SOC := ar9330
+ DEVICE_TITLE := GL.iNet GL-USB150
+ DEVICE_PACKAGES := kmod-usb2 block-mount
+ IMAGE_SIZE := 16000k
+ SUPPORTED_DEVICES += gl-usb150 glinet,gl-usb150
+endef
+TARGET_DEVICES += glinet_gl-usb150
+
define Device/glinet_gl-x300b-common
SOC := qca9531
DEVICE_VENDOR := GL.iNet
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
index 27f8ee2..24f03a0 100755
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -10,6 +10,10 @@ case "$board" in
glinet,gl-ar150)
ucidef_set_led_wlan "wlan" "WLAN" "gl-ar150:orange:wlan" "phy0tpt"
;;
+glinet,gl-usb150)
+ ucidef_set_led_wlan "wlan" "WLAN" "gl-usb150:green:wlan" "phy0tpt"
+ ucidef_set_led_default "power" "POWER" "gl-usb150:green:power" "1"
+ ;;
glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor)
ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth1"
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 9be5bef..06b664e 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
@@ -9,6 +9,7 @@ ath79_setup_interfaces()
case "$board" in
aerohive,hiveap-121|\
+ glinet,gl-usb150|\
glinet,gl-e750)
ucidef_set_interface_lan "eth0"
;;
--
2.7.4

View File

@ -0,0 +1,210 @@
From 19b1dfb78c50442878cd1926d49b00e5ea8829b6 Mon Sep 17 00:00:00 2001
From: Kaifeng Wei <kaifeng.wei@gl-inet.com>
Date: Sun, 26 Sep 2021 04:58:09 -0700
Subject: [PATCH] add support gl ar750 ar750s
---
target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts | 26 ++++++++++++++++++---
.../linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi | 27 +++++++++++++++++++---
target/linux/ath79/image/generic.mk | 2 +-
target/linux/ath79/image/nand.mk | 7 +++++-
.../ath79/nand/base-files/etc/board.d/01_leds | 4 ++++
.../ath79/nand/base-files/etc/board.d/02_network | 6 +++++
.../etc/hotplug.d/firmware/11-ath10k-caldata | 2 ++
7 files changed, 66 insertions(+), 8 deletions(-)
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
index 24dc8aa..5ab0340 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts
@@ -9,6 +9,26 @@
compatible = "glinet,gl-ar750", "qca,qca9531";
model = "GL.iNet GL-AR750";
+ gl_hw {
+ compatible = "gl-hw-info";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "ar750";
+ wan = "eth0";
+ lan = "eth1.1";
+ switch-button = "gpio-0";
+ reset-button = "gpio-3";
+ usb-port = "1-1.2";
+ factory_data {
+ device_mac = "art";
+ device_ddns = "art", "0x10";
+ device_sn_bak = "art", "0x20";
+ device_sn = "art", "0x30";
+ country_code = "art", "0x88";
+ };
+ };
+
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
@@ -40,19 +60,19 @@
compatible = "gpio-leds";
led_power: power {
- label = "white:power";
+ label = "gl-ar750:white:power";
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
default-state = "on";
};
wlan2g {
- label = "white:wlan2g";
+ label = "gl-ar750:white:wlan2g";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
wlan5g {
- label = "white:wlan5g";
+ label = "gl-ar750:white:wlan5g";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi
index 9226d37..d46b5ba 100644
--- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi
+++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi
@@ -9,6 +9,27 @@
compatible = "glinet,gl-ar750s", "qca,qca9563";
model = "GL.iNet GL-AR750S";
+ gl_hw {
+ compatible = "gl-hw-info";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "ar750s";
+ wan = "eth0.2";
+ lan = "eth0.1";
+ switch-button = "gpio-8";
+ reset-button = "gpio-2";
+ usb-port = "1-1";
+ nand;
+ factory_data {
+ device_mac = "art";
+ device_ddns = "art", "0x10";
+ device_sn_bak = "art", "0x20";
+ device_sn = "art", "0x30";
+ country_code = "art", "0x88";
+ };
+ };
+
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
@@ -41,19 +62,19 @@
compatible = "gpio-leds";
led_power: power {
- label = "green:power";
+ label = "gl-ar750s:green:power";
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
default-state = "keep";
};
led_wlan2g: wlan2g {
- label = "green:wlan2g";
+ label = "gl-ar750s:green:wlan2g";
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
led_wlan5g: wlan5g {
- label = "green:wlan5g";
+ label = "gl-ar750s:green:wlan5g";
gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy0tpt";
};
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index cf3fce3..d178f43 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1163,7 +1163,7 @@ define Device/glinet_gl-ar750
DEVICE_MODEL := GL-AR750
DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca9887-ct
IMAGE_SIZE := 16000k
- SUPPORTED_DEVICES += gl-ar750
+ SUPPORTED_DEVICES += gl-ar750 glinet,gl-ar750
endef
TARGET_DEVICES += glinet_gl-ar750
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 83ca331..9dd7a5b 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -215,7 +215,12 @@ define Device/glinet_gl-ar750s-nor-nand
$(Device/glinet_gl-ar750s-common)
DEVICE_VARIANT := NOR/NAND
KERNEL_SIZE := 4096k
- IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ VID_HDR_OFFSET := 2048
+ IMAGES := factory.img sysupgrade.tar
+ IMAGE/sysupgrade.tar := sysupgrade-tar | append-gl-metadata
+ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | append-gl-metadata
SUPPORTED_DEVICES += glinet,gl-ar750s-nor
endef
TARGET_DEVICES += glinet_gl-ar750s-nor-nand
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
index 24f03a0..9369f15 100755
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -37,6 +37,10 @@ glinet,gl-xe300-nor-nand)
ucidef_set_led_netdev "wan" "WAN" "gl-xe300:green:wan" "eth1"
ucidef_set_led_netdev "3gnet" "LTE" "gl-xe300:green:lte" "wwan0"
;;
+glinet,gl-ar750)
+ ucidef_set_led_wlan "wlan2g" "WLAN2G" "gl-ar750:white:wlan2g" "phy1tpt"
+ ucidef_set_led_wlan "wlan5g" "WLAN5G" "gl-ar750:white:wlan5g" "phy0tpt"
+ ;;
netgear,wndr3700-v4|\
netgear,wndr4300|\
netgear,wndr4300sw|\
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 06b664e..0b5a63d 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
@@ -17,6 +17,7 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:wan" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1"
;;
+ glinet,gl-ar750s|\
glinet,gl-ar750s-nor|\
glinet,gl-ar750s-nor-nand)
ucidef_add_switch "switch0" \
@@ -35,6 +36,11 @@ ath79_setup_interfaces()
glinet,gl-xe300-nor-nand)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
+ glinet,gl-ar750)
+ ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+ ucidef_add_switch "switch0" \
+ "0@eth1" "1:lan" "2:lan"
+ ;;
netgear,wndr3700-v4|\
netgear,wndr4300|\
netgear,wndr4300sw|\
diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index d5fd3db..3226d4f 100644
--- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -13,6 +13,8 @@ case "$FIRMWARE" in
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_binary art 0x12)
;;
+ glinet,gl-ar750|\
+ glinet,gl-ar750s|\
glinet,gl-ar750s-nor|\
glinet,gl-ar750s-nor-nand)
caldata_extract "art" 0x5000 0x844
--
2.7.4

View File

@ -0,0 +1,463 @@
From 4afa87a602f9af8be38494237c4e758009d5c142 Mon Sep 17 00:00:00 2001
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
Date: Tue, 28 Sep 2021 14:19:45 +0800
Subject: [PATCH] ath79: add support for gl x750
---
.../dts/qca9531_glinet_gl-x750-nor-nand.dts | 25 +++++
.../ath79/dts/qca9531_glinet_gl-x750-nor.dts | 18 +++
...l-x750.dts => qca9531_glinet_gl-x750.dtsi} | 105 ++++++++++++++----
target/linux/ath79/dts/qca953x.dtsi | 3 +-
.../generic/base-files/etc/board.d/01_leds | 3 -
.../etc/hotplug.d/firmware/11-ath10k-caldata | 3 +-
target/linux/ath79/image/generic.mk | 9 --
target/linux/ath79/image/nand.mk | 30 ++++-
.../ath79/nand/base-files/etc/board.d/01_leds | 5 +
.../nand/base-files/etc/board.d/02_network | 2 +
.../etc/hotplug.d/firmware/11-ath10k-caldata | 6 +-
.../nand/base-files/lib/upgrade/platform.sh | 6 +-
12 files changed, 174 insertions(+), 41 deletions(-)
create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-x750-nor-nand.dts
create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-x750-nor.dts
rename target/linux/ath79/dts/{qca9531_glinet_gl-x750.dts => qca9531_glinet_gl-x750.dtsi} (51%)
mode change 100644 => 100755
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750-nor-nand.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750-nor-nand.dts
new file mode 100644
index 0000000000..1926ff8626
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750-nor-nand.dts
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "qca9531_glinet_gl-x750.dtsi"
+
+/ {
+ compatible = "glinet,gl-x750-nor-nand", "qca,qca9531";
+ model = "GL.iNet GL-X750 (NOR/NAND)";
+};
+
+&nor_partitions {
+ partition@60000 {
+ label = "kernel";
+ reg = <0x060000 0x200000>;
+ };
+ parition@260000 {
+ label = "nor_reserved";
+ reg = <0x260000 0xbc0000>;
+ };
+};
+
+&nand_ubi {
+ label = "ubi";
+};
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750-nor.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750-nor.dts
new file mode 100644
index 0000000000..14be3e13a5
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750-nor.dts
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "qca9531_glinet_gl-x750.dtsi"
+
+/ {
+ compatible = "glinet,gl-x750-nor", "qca,qca9531";
+ model = "GL.iNet GL-X750 (NOR)";
+};
+
+&nor_partitions {
+ partition@60000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x060000 0xfa0000>;
+ };
+};
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dtsi
old mode 100644
new mode 100755
similarity index 51%
rename from target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
rename to target/linux/ath79/dts/qca9531_glinet_gl-x750.dtsi
index c755e00033..89a109addc
--- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dtsi
@@ -1,21 +1,43 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-
-#include "qca953x.dtsi"
+/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
+#include "qca953x.dtsi"
+
/ {
compatible = "glinet,gl-x750", "qca,qca9531";
model = "GL.iNet GL-X750";
+ gl_hw {
+ compatible = "gl-hw-info";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "x750";
+ wan = "eth0";
+ lan = "eth1";
+ build-in-modem = "1-1.2";
+ reset-button = "gpio-3";
+ usb-port = "1-1.3";
+ factory_data {
+ device_mac = "art";
+ device_ddns = "art", "0x10";
+ device_sn_bak = "art", "0x20";
+ device_sn = "art", "0x30";
+ country_code = "art", "0x88";
+ };
+ };
+
keys {
- compatible = "gpio-keys";
+ compatible = "gpio-keys-polled";
+ poll-interval = <20>;
pinctrl-names = "default";
pinctrl-0 = <&jtag_disable_pins>;
- reset {
+ button0 {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
@@ -26,39 +48,66 @@
compatible = "gpio-leds";
power {
- label = "green:power";
+ label = "gl-x750:green:power";
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
default-state = "on";
};
wlan2g {
- label = "green:wlan2g";
+ label = "gl-x750:green:wlan2g";
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
wlan5g {
- label = "green:wlan5g";
+ label = "gl-x750:green:wlan5g";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
wan {
- label = "green:wan";
+ label = "gl-x750:green:wan";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
};
- 4g {
- label = "green:4g";
+ lte {
+ label = "gl-x750:green:lte";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
};
};
+
+ gpio-export {
+ compatible = "gpio-export";
+
+ gpio_pci_power {
+ gpio-export,name = "pci_power";
+ gpio-export,output = <0>;
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
+ };
+
+ gpio_usb_power {
+ gpio-export,name = "usb_power";
+ gpio-export,output = <0>;
+ gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+ };
+
+ gpio_ble_reset {
+ //set name as gpio1 to compat 1806 gpio name
+ gpio-export,name = "gpio1";
+ gpio-export,output = <0>;
+ gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
+ };
+ };
};
&pcie0 {
status = "okay";
};
+&uart {
+ status = "okay";
+};
+
&usb0 {
#address-cells = <1>;
#size-cells = <0>;
@@ -76,13 +125,15 @@
&spi {
status = "okay";
+ num-cs = <2>;
+ cs-gpios = <0>, <0>;
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
- partitions {
+ nor_partitions: partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
@@ -103,31 +154,47 @@
reg = <0x050000 0x010000>;
read-only;
};
+ };
+ };
+
+ flash_nand: flash@1 {
+ compatible = "spi-nand";
+ reg = <1>;
+ spi-max-frequency = <25000000>;
+
+ nand_partitions: partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
- partition@60000 {
- compatible = "denx,uimage";
- label = "firmware";
- reg = <0x060000 0xfa0000>;
+ nand_ubi: partition@0 {
+ label = "nand_ubi";
+ reg = <0x000000 0x8000000>;
};
};
};
+
+};
+
+&bootargs {
+ bootargs = "console=null";
};
&eth0 {
status = "okay";
-
- phy-handle = <&swphy4>;
-
mtd-mac-address = <&art 0x0>;
+ phy-handle = <&swphy4>;
+ ifname = "eth0";
};
&eth1 {
mtd-mac-address = <&art 0x0>;
mtd-mac-address-increment = <1>;
+ ifname = "eth1";
};
&wmac {
status = "okay";
-
mtd-cal-data = <&art 0x1000>;
+ mtd-mac-address = <&art 0x1002>;
};
diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi
index 7774d073e7..3bbd7acfd8 100644
--- a/target/linux/ath79/dts/qca953x.dtsi
+++ b/target/linux/ath79/dts/qca953x.dtsi
@@ -246,8 +246,7 @@
resets = <&rst 8>;
reset-names = "switch";
phy-mode = "gmii";
- qca,phy4-mii-enable;
- qca,mib-poll-interval = <500>;
+ phy4-mii-enable;
mdio-bus {
#address-cells = <1>;
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
index f3690897ee..0782f9c980 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
@@ -211,9 +211,6 @@ qxwlan,e750a-v4-16m)
ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x02"
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
;;
-glinet,gl-x750)
- ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
- ;;
hak5,lan-turtle)
ucidef_set_led_netdev "wan" "WAN" "orange:system" "eth1"
;;
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 783895525b..cbca18fef4 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -12,8 +12,7 @@ case "$FIRMWARE" in
case $board in
allnet,all-wap02860ac|\
engenius,eap1200h|\
- engenius,enstationac-v1|\
- glinet,gl-x750)
+ engenius,enstationac-v1)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
;;
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index d178f437ca..7ea12da0b2 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1167,15 +1167,6 @@ define Device/glinet_gl-ar750
endef
TARGET_DEVICES += glinet_gl-ar750
-define Device/glinet_gl-x750
- SOC := qca9531
- DEVICE_VENDOR := GL.iNet
- DEVICE_MODEL := GL-X750
- DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca9887-ct
- IMAGE_SIZE := 16000k
-endef
-TARGET_DEVICES += glinet_gl-x750
-
define Device/hak5_lan-turtle
$(Device/tplink-16mlzma)
SOC := ar9331
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 9dd7a5b6ff..4831a13ab9 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -153,7 +153,7 @@ TARGET_DEVICES += glinet_gl-ar300m-nor
define Device/glinet_gl-mifi
SOC := ar9331
- DEVICE_VENDOR := GL.iNET
+ DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-MIFI
DEVICE_PACKAGES := kmod-usb-chipidea2
IMAGE_SIZE := 16000k
@@ -202,6 +202,34 @@ define Device/glinet_gl-xe300-iot
endef
TARGET_DEVICES += glinet_gl-xe300-iot
+define Device/glinet_gl-x750-common
+ SOC := qca9531
+ DEVICE_VENDOR := GL.iNet
+ DEVICE_MODEL := GL-X750
+ DEVICE_PACKAGES := kmod-usb2 kmod-ath10k ath10k-firmware-qca9887 block-mount PCI_SUPPORT kmod-usb-storage
+ SUPPORTED_DEVICES += gl-x750 glinet,gl-x750
+endef
+
+define Device/glinet_gl-x750-nor
+ $(Device/glinet_gl-x750-common)
+ DEVICE_VARIANT := NOR
+ IMAGE_SIZE := 16000k
+endef
+TARGET_DEVICES += glinet_gl-x750-nor
+
+define Device/glinet_gl-x750-nor-nand
+ $(Device/glinet_gl-x750-common)
+ DEVICE_VARIANT := NOR/NAND
+ KERNEL_SIZE := 4096k
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ VID_HDR_OFFSET := 2048
+ IMAGES := factory.img sysupgrade.tar
+ IMAGE/sysupgrade.tar := sysupgrade-tar | append-gl-metadata
+ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | append-gl-metadata
+endef
+TARGET_DEVICES += glinet_gl-x750-nor-nand
+
define Device/glinet_gl-ar750s-common
SOC := qca9563
DEVICE_VENDOR := GL.iNet
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
index 9369f15f89..d9917bb3d2 100755
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -41,6 +41,11 @@ glinet,gl-ar750)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "gl-ar750:white:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "gl-ar750:white:wlan5g" "phy0tpt"
;;
+glinet,gl-x750-nor|\
+glinet,gl-x750-nor-nand)
+ ucidef_set_led_netdev "wan" "WAN" "gl-x750:green:wan" "eth0"
+ ucidef_set_led_netdev "3gnet" "LTE" "gl-x750:green:lte" "wwan0"
+ ;;
netgear,wndr3700-v4|\
netgear,wndr4300|\
netgear,wndr4300sw|\
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 0b5a63d4f5..5912a4504a 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
@@ -27,6 +27,8 @@ ath79_setup_interfaces()
glinet,gl-ar300m-nand|\
glinet,gl-x300b-nor|\
glinet,gl-x300b-nor-nand|\
+ glinet,gl-x750-nor|\
+ glinet,gl-x750-nor-nand|\
glinet,gl-ar150|\
glinet,gl-mifi)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 3226d4f7b1..c1c1c18500 100644
--- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -14,12 +14,16 @@ case "$FIRMWARE" in
ath10k_patch_mac $(mtd_get_mac_binary art 0x12)
;;
glinet,gl-ar750|\
- glinet,gl-ar750s|\
glinet,gl-ar750s-nor|\
glinet,gl-ar750s-nor-nand)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
;;
+ glinet,gl-x750-nor|\
+ glinet,gl-x750-nor-nand)
+ caldata_extract "art" 0x5000 0x844
+ ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +3)
+ ;;
zyxel,nbg6716)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
index c9b336898e..21951ceba2 100644
--- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
@@ -18,10 +18,8 @@ platform_do_upgrade() {
glinet,gl-ar300m-nor)
glinet_nand_nor_do_upgrade "$1"
;;
- glinet,gl-ar750s-nor|\
- glinet,gl-ar750s-nor-nand)
- nand_nor_do_upgrade "$1"
- ;;
+ glinet,gl-x750-nor-nand|\
+ glinet,gl-ar750s-nor-nand|\
glinet,gl-xe300-iot|\
glinet,gl-xe300-nor-nand)
nand_nor_do_upgrade "$1"
--
2.17.1