fix ath79 patch quality

This commit is contained in:
niyin 2023-01-28 23:16:04 -08:00
parent 9c2d7ce26a
commit 71b7cf65f5
8 changed files with 218 additions and 377 deletions

View File

@ -0,0 +1,47 @@
From e1beb66a5e7e522d860ecdb210ddca2cb75c403f Mon Sep 17 00:00:00 2001
From: niyin <yin.ni@gl-inet.com>
Date: Sat, 28 Jan 2023 22:20:18 -0800
Subject: [PATCH] ath79 adjust 01_leds
---
.../ath79/nand/base-files/etc/board.d/01_leds | 24 ++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
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 e493298457..af28c77f3e 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -14,9 +14,27 @@ glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor)
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
;;
-glinet,gl-xe300)
- ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
- ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10"
+glinet,gl-ar750s-nor|\
+glinet,gl-ar750s-nor-nand)
+ ucidef_set_led_wlan "wlan2g" "WLAN2G" "gl-ar750s:green:wlan2g" "phy1tpt"
+ ucidef_set_led_wlan "wlan5g" "WLAN5G" "gl-ar750s:green:wlan5g" "phy0tpt"
+ ;;
+glinet,gl-xe300|\
+glinet,gl-xe300-nor-nand)
+ ucidef_set_led_netdev "wan" "WAN" "gl-xe300:green:wan" "eth1"
+ ucidef_set_led_switch "lan" "LAN" "gl-xe300:green:lan" "switch0" "0x10"
+ ucidef_set_led_netdev "3gnet" "LTE" "gl-xe300:green:lte" "wwan0"
+ ;;
+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"
+ ;;
+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"
;;
netgear,r6100)
ucidef_set_led_netdev "wan-green" "WAN (green)" "green:wan" "eth1"
--
2.25.1

View File

@ -0,0 +1,44 @@
From 0eff34f7bfbe57c7ce69aa8f02f6925d9691676f Mon Sep 17 00:00:00 2001
From: niyin <yin.ni@gl-inet.com>
Date: Sat, 28 Jan 2023 22:24:55 -0800
Subject: [PATCH] ath79 adjust 02_network
---
.../ath79/nand/base-files/etc/board.d/02_network | 14 ++++++++++++++
1 file changed, 14 insertions(+)
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 b533e5be6c..cfe5dd92c4 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network
@@ -65,6 +65,10 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
;;
+ glinet,gl-x300b-nor|\
+ glinet,gl-x300b-nor-nand)
+ ucidef_set_interfaces_lan_wan "eth1" "eth0"
+ ;;
*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
@@ -88,6 +92,16 @@ ath79_setup_macs()
netgear,wndr4500-v3)
wan_mac=$(mtd_get_mac_binary caldata 0x6)
;;
+ glinet,gl-x300b-nor|\
+ glinet,gl-x300b-nor-nand)
+ wan_mac=$(mtd_get_mac_binary art 0x0)
+ lan_mac=$(macaddr_add "$wan_mac" 1)
+ ;;
+ glinet,gl-ar750s-nor|\
+ glinet,gl-ar750s-nor-nand)
+ wan_mac=$(mtd_get_mac_binary art 0x0)
+ lan_mac=$(macaddr_add "$wan_mac" 1)
+ ;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
--
2.25.1

View File

@ -0,0 +1,73 @@
From 333a676598b8718e10432f2d6c47edb2068e2abb Mon Sep 17 00:00:00 2001
From: niyin <yin.ni@gl-inet.com>
Date: Sat, 28 Jan 2023 00:38:13 -0800
Subject: [PATCH] ath79 adjust nand.mk
---
target/linux/ath79/image/nand.mk | 36 +++++++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 1d086b1918..583d70ccbe 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -153,6 +153,34 @@ define Device/glinet_gl-ar300m-nor
endef
TARGET_DEVICES += glinet_gl-ar300m-nor
+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.bin := sysupgrade-tar | 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-ar750s-common
SOC := qca9563
DEVICE_VENDOR := GL.iNet
@@ -166,7 +194,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.bin := 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
@@ -174,6 +207,7 @@ TARGET_DEVICES += glinet_gl-ar750s-nor-nand
define Device/glinet_gl-ar750s-nor
$(Device/glinet_gl-ar750s-common)
DEVICE_VARIANT := NOR
+ BLOCKSIZE := 64k
SUPPORTED_DEVICES += gl-ar750s glinet,gl-ar750s glinet,gl-ar750s-nor-nand
endef
TARGET_DEVICES += glinet_gl-ar750s-nor
--
2.25.1

View File

@ -0,0 +1,26 @@
From fadb8f5b740ec0b685aa7ad271d492632e2f7ebe Mon Sep 17 00:00:00 2001
From: niyin <yin.ni@gl-inet.com>
Date: Sat, 28 Jan 2023 22:27:44 -0800
Subject: [PATCH] ath79 adjust platform.sh
---
target/linux/ath79/nand/base-files/lib/upgrade/platform.sh | 3 +++
1 file changed, 3 insertions(+)
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..3255b64d61 100644
--- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
@@ -18,6 +18,9 @@ platform_do_upgrade() {
glinet,gl-ar300m-nor)
glinet_nand_nor_do_upgrade "$1"
;;
+ glinet,gl-x300b-nor|\
+ glinet,gl-x300b-nor-nand|\
+ glinet,gl-x750-nor|\
glinet,gl-ar750s-nor|\
glinet,gl-ar750s-nor-nand)
nand_nor_do_upgrade "$1"
--
2.25.1

View File

@ -1,26 +1,18 @@
From e87a37af8288ad2faab7dd00e059e56c8f1d3ee4 Mon Sep 17 00:00:00 2001
From: lincolnzh <hongjian.zhang@gl-inet.com>
Date: Tue, 1 Nov 2022 17:05:03 +0800
Subject: [PATCH] add gl-x300b support
From a1ad78a863fc9673a802688ff4ae48f7c95d124c Mon Sep 17 00:00:00 2001
From: niyin <yin.ni@gl-inet.com>
Date: Sat, 28 Jan 2023 00:26:02 -0800
Subject: [PATCH] support x300b target
---
.../dts/qca9531_glinet_gl-x300b-nor-nand.dts | 25 +++
.../ath79/dts/qca9531_glinet_gl-x300b-nor.dts | 18 ++
.../ath79/dts/qca9531_glinet_gl-x300b.dts | 152 -------------
.../ath79/dts/qca9531_glinet_gl-x300b.dtsi | 205 ++++++++++++++++++
.../generic/base-files/etc/board.d/01_leds | 1 -
.../generic/base-files/etc/board.d/02_network | 5 -
target/linux/ath79/image/generic.mk | 9 -
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 | 9 +
.../etc/uci-defaults/04_led_migration | 2 +-
.../nand/base-files/lib/upgrade/platform.sh | 1 +
12 files changed, 293 insertions(+), 168 deletions(-)
.../ath79/dts/qca9531_glinet_gl-x300b.dtsi | 206 ++++++++++++++++++
4 files changed, 249 insertions(+), 152 deletions(-)
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
delete mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts
create mode 100755 target/linux/ath79/dts/qca9531_glinet_gl-x300b.dtsi
create mode 100644 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
@ -236,11 +228,11 @@ index 5f5646b3e0..0000000000
- };
-};
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..5b308c8754
new file mode 100644
index 0000000000..cf2735cb6b
--- /dev/null
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dtsi
@@ -0,0 +1,205 @@
@@ -0,0 +1,206 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
@ -261,6 +253,8 @@ index 0000000000..5b308c8754
+ model = "x300b";
+ wan = "eth0";
+ lan = "eth1";
+ flash_size = <16>;
+ radio = "mac80211";
+ build-in-modem = "1-1";
+ reset-button = "gpio-3";
+ factory_data {
@ -305,7 +299,7 @@ index 0000000000..5b308c8754
+ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+ };
+ };
+ gpio-export {
+ gpio-export {
+ compatible = "gpio-export";
+
+ minocie {
@ -445,163 +439,6 @@ index 0000000000..5b308c8754
+ 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 8b4c83fd2c..46f343b0d6 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
@@ -239,7 +239,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-x300b|\
glinet,gl-x750)
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
;;
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 4d3296c0af..ee5f4daa7f 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -297,11 +297,6 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan"
;;
- glinet,gl-x300b)
- ucidef_set_interface_wan "eth1"
- ucidef_add_switch "switch0" \
- "0@eth0" "4:lan"
- ;;
iodata,etg3-r|\
iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr|\
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index d9aa600410..67cb4d3995 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1342,15 +1342,6 @@ define Device/glinet_gl-usb150
endef
TARGET_DEVICES += glinet_gl-usb150
-define Device/glinet_gl-x300b
- SOC := qca9531
- DEVICE_VENDOR := GL.iNet
- DEVICE_MODEL := GL-X300B
- DEVICE_PACKAGES := kmod-usb2
- IMAGE_SIZE := 16000k
-endef
-TARGET_DEVICES += glinet_gl-x300b
-
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 1d086b1918..fc1054f19a 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -153,6 +153,34 @@ define Device/glinet_gl-ar300m-nor
endef
TARGET_DEVICES += glinet_gl-ar300m-nor
+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.bin := sysupgrade-tar | 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-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 e493298457..a7fb509137 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -18,6 +18,12 @@ glinet,gl-xe300)
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10"
;;
+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"
+ ;;
netgear,r6100)
ucidef_set_led_netdev "wan-green" "WAN (green)" "green:wan" "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 b533e5be6c..3f1ae6d7b2 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network
@@ -65,6 +65,10 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
;;
+ glinet,gl-x300b-nor|\
+ glinet,gl-x300b-nor-nand)
+ ucidef_set_interfaces_lan_wan "eth1" "eth0"
+ ;;
*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
@@ -88,6 +92,11 @@ ath79_setup_macs()
netgear,wndr4500-v3)
wan_mac=$(mtd_get_mac_binary caldata 0x6)
;;
+ glinet,gl-x300b-nor|\
+ glinet,gl-x300b-nor-nand)
+ wan_mac=$(mtd_get_mac_binary art 0x0)
+ lan_mac=$(macaddr_add "$wan_mac" 1)
+ ;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
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..0d20953919 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,7 +6,7 @@ board=$(board_name)
case "$board" in
esac
-remove_devicename_leds
+#remove_devicename_leds
migrations_apply system
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..b7b6b23b98 100644
--- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
@@ -19,6 +19,7 @@ platform_do_upgrade() {
glinet_nand_nor_do_upgrade "$1"
;;
glinet,gl-ar750s-nor|\
+ glinet,gl-x300b-nor-nand|\
glinet,gl-ar750s-nor-nand)
nand_nor_do_upgrade "$1"
;;
--
2.17.1
2.25.1

View File

@ -1,13 +1,11 @@
From 78f1f12572faa76b7bc65c8a1bff68ba2a428aa3 Mon Sep 17 00:00:00 2001
From a9e608d23ddc98113ddeaf9f69d903e78f1b455d Mon Sep 17 00:00:00 2001
From: niyin <yin.ni@gl-inet.com>
Date: Fri, 16 Dec 2022 00:40:14 -0800
Subject: [PATCH] add xe300 support
Date: Sat, 28 Jan 2023 20:00:40 -0800
Subject: [PATCH] support xe300 target
---
.../dts/qca9531_glinet_gl-xe300-nor-nand.dts | 193 ++++++++++++++++++
target/linux/ath79/image/nand.mk | 17 ++
.../ath79/nand/base-files/etc/board.d/01_leds | 9 +-
3 files changed, 216 insertions(+), 3 deletions(-)
1 file changed, 193 insertions(+)
create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-xe300-nor-nand.dts
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
@ -209,55 +207,6 @@ index 0000000000..7c703c7c81
+ reg = <0x0 0x6>;
+ };
+};
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 583d70ccbe..c51e61d507 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -245,6 +245,23 @@ define Device/glinet_gl-xe300
endef
TARGET_DEVICES += glinet_gl-xe300
+define Device/glinet_gl-xe300-nor-nand
+ SOC := qca9531
+ DEVICE_VENDOR := GL.iNet
+ DEVICE_MODEL := GL-XE300-NOR-NAND
+ DEVICE_TITLE := GL.iNet GL-XE300 (NOR/NAND)
+ DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341
+ KERNEL_SIZE := 4096k
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ VID_HDR_OFFSET := 2048
+ IMAGES := factory.img sysupgrade.tar
+ IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
+ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | append-metadata
+ SUPPORTED_DEVICES += gl-xe300 glinet,gl-xe300
+endef
+TARGET_DEVICES += glinet_gl-xe300-nor-nand
+
# fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff)
define Device/netgear_ath79_nand
DEVICE_VENDOR := NETGEAR
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
index 8507425aaf..5c452c4b9f 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -19,10 +19,13 @@ glinet,gl-ar750s-nor-nand)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "gl-ar750s:green:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "gl-ar750s:green:wlan5g" "phy0tpt"
;;
-glinet,gl-xe300)
- ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
- ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10"
+glinet,gl-xe300|\
+glinet,gl-xe300-nor-nand)
+ ucidef_set_led_netdev "wan" "WAN" "gl-xe300:green:wan" "eth1"
+ ucidef_set_led_switch "lan" "LAN" "gl-xe300:green:lan" "switch0" "0x10"
+ ucidef_set_led_netdev "3gnet" "LTE" "gl-xe300:green:lte" "wwan0"
;;
+
glinet,gl-x300b-nor|\
glinet,gl-x300b-nor-nand)
ucidef_set_led_netdev "wlan2g" "WLAN2G" "gl-x300b:green:wlan2g" "wlan0"
--
2.25.1

View File

@ -1,15 +1,11 @@
From 98f17c7e8048102b2b2c8b8ad3a07cc1f713d2d1 Mon Sep 17 00:00:00 2001
From 01ff4f79b4109678264d8a0328f3956b4857ef0b Mon Sep 17 00:00:00 2001
From: niyin <yin.ni@gl-inet.com>
Date: Wed, 28 Dec 2022 20:28:15 -0800
Subject: [PATCH] add x750 support
Date: Sat, 28 Jan 2023 22:09:24 -0800
Subject: [PATCH] support x750 target
---
.../ath79/dts/qca9531_glinet_gl-x750-nor.dts | 182 ++++++++++++++++++
target/linux/ath79/image/nand.mk | 22 +++
.../ath79/nand/base-files/etc/board.d/01_leds | 5 +
.../nand/base-files/etc/board.d/02_network | 1 +
.../nand/base-files/lib/upgrade/platform.sh | 1 +
5 files changed, 211 insertions(+)
1 file changed, 182 insertions(+)
create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-x750-nor.dts
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750-nor.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750-nor.dts
@ -200,79 +196,6 @@ index 0000000000..2bb4547c5c
+ reg = <0x0 0x6>;
+ };
+};
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index c51e61d507..d5b9a78628 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -262,6 +262,28 @@ define Device/glinet_gl-xe300-nor-nand
endef
TARGET_DEVICES += glinet_gl-xe300-nor-nand
+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
+ KERNEL_SIZE := 4096k
+ IMAGE_SIZE := 16064k
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ VID_HDR_OFFSET := 2048
+ IMAGES := factory.img sysupgrade.bin
+ IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-gl-metadata | check-size $$$$(IMAGE_SIZE)
+ IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | append-gl-metadata
+endef
+TARGET_DEVICES += glinet_gl-x750-nor
+
# fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff)
define Device/netgear_ath79_nand
DEVICE_VENDOR := NETGEAR
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
index 5c452c4b9f..3804b6898d 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -19,6 +19,11 @@ glinet,gl-ar750s-nor-nand)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "gl-ar750s:green:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "gl-ar750s:green: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"
+ ;;
glinet,gl-xe300|\
glinet,gl-xe300-nor-nand)
ucidef_set_led_netdev "wan" "WAN" "gl-xe300:green:wan" "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 522451e31e..72a99887fb 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network
@@ -66,6 +66,7 @@ ath79_setup_interfaces()
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
;;
glinet,gl-x300b-nor|\
+ glinet,gl-x750-nor|\
glinet,gl-x300b-nor-nand)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
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 b7b6b23b98..6caa30b637 100644
--- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
@@ -19,6 +19,7 @@ platform_do_upgrade() {
glinet_nand_nor_do_upgrade "$1"
;;
glinet,gl-ar750s-nor|\
+ glinet,gl-x750-nor|\
glinet,gl-x300b-nor-nand|\
glinet,gl-ar750s-nor-nand)
nand_nor_do_upgrade "$1"
--
2.25.1

View File

@ -1,15 +1,12 @@
From 70a3e219eccf25cd28484006a8a7d5b8667ebcb5 Mon Sep 17 00:00:00 2001
From: gl-yangweiping <weiping.yang@gl-inet.com>
Date: Thu, 15 Dec 2022 03:44:25 -0500
Subject: [PATCH] add-gl-ar750s-support
From e4d5eece3d766be6938d9ef5ae489774a8f84dad Mon Sep 17 00:00:00 2001
From: niyin <yin.ni@gl-inet.com>
Date: Fri, 27 Jan 2023 23:33:52 -0800
Subject: [PATCH] support ar750s target
---
.../ath79/dts/qca9563_glinet_gl-ar750s.dtsi | 47 ++++++++++++++-----
target/linux/ath79/image/nand.mk | 8 +++-
.../ath79/nand/base-files/etc/board.d/01_leds | 5 ++
.../nand/base-files/etc/board.d/02_network | 2 +
.../499-mtd-spinand-add-support.patch | 19 ++++++++
5 files changed, 68 insertions(+), 13 deletions(-)
2 files changed, 54 insertions(+), 12 deletions(-)
create mode 100644 target/linux/ath79/patches-5.10/499-mtd-spinand-add-support.patch
diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi
@ -94,61 +91,6 @@ index 878a740cfd..41c6cf5c63 100644
gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy0tpt";
};
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index fc1054f19a..583d70ccbe 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -194,7 +194,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.bin := 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
@@ -202,6 +207,7 @@ TARGET_DEVICES += glinet_gl-ar750s-nor-nand
define Device/glinet_gl-ar750s-nor
$(Device/glinet_gl-ar750s-common)
DEVICE_VARIANT := NOR
+ BLOCKSIZE := 64k
SUPPORTED_DEVICES += gl-ar750s glinet,gl-ar750s glinet,gl-ar750s-nor-nand
endef
TARGET_DEVICES += glinet_gl-ar750s-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 a7fb509137..8507425aaf 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -14,6 +14,11 @@ glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor)
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
;;
+glinet,gl-ar750s-nor|\
+glinet,gl-ar750s-nor-nand)
+ ucidef_set_led_wlan "wlan2g" "WLAN2G" "gl-ar750s:green:wlan2g" "phy1tpt"
+ ucidef_set_led_wlan "wlan5g" "WLAN5G" "gl-ar750s:green:wlan5g" "phy0tpt"
+ ;;
glinet,gl-xe300)
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10"
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 3f1ae6d7b2..522451e31e 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network
@@ -92,6 +92,8 @@ ath79_setup_macs()
netgear,wndr4500-v3)
wan_mac=$(mtd_get_mac_binary caldata 0x6)
;;
+ glinet,gl-ar750s-nor|\
+ glinet,gl-ar750s-nor-nand|\
glinet,gl-x300b-nor|\
glinet,gl-x300b-nor-nand)
wan_mac=$(mtd_get_mac_binary art 0x0)
diff --git a/target/linux/ath79/patches-5.10/499-mtd-spinand-add-support.patch b/target/linux/ath79/patches-5.10/499-mtd-spinand-add-support.patch
new file mode 100644
index 0000000000..1d161e812e
@ -175,5 +117,5 @@ index 0000000000..1d161e812e
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE, 0xb1, 0x48),
+ NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
--
2.17.1
2.25.1