support ar300m

This commit is contained in:
Luo Chongjun 2023-04-28 12:11:00 +08:00
parent 388b28e32b
commit 45be709f19
8 changed files with 413 additions and 30 deletions

View File

@ -1,19 +1,22 @@
From fbf1d60d64f87dbc700dc23bf4f9a3b30b3ae6d4 Mon Sep 17 00:00:00 2001
From 0061eee4e7abd48c6e990a3b0d8acbce8529c817 Mon Sep 17 00:00:00 2001
From: Luo Chongjun <luochongjun@gl-inet.com>
Date: Wed, 26 Apr 2023 15:45:37 +0800
Date: Fri, 28 Apr 2023 10:59:00 +0800
Subject: [PATCH] ath79 adjust 01_led
---
.../ath79/nand/base-files/etc/board.d/01_leds | 25 ++++++++++++++++---
1 file changed, 21 insertions(+), 4 deletions(-)
.../ath79/nand/base-files/etc/board.d/01_leds | 27 +++++++++++++++----
1 file changed, 22 insertions(+), 5 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 8b5df624a4..af28c77f3e 100644
index 8b5df624a4..f7db42be66 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,10 +14,27 @@ glinet,gl-ar300m-nand|\
@@ -12,12 +12,29 @@ dongwon,dw02-412h-128m)
;;
glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor)
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
- ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
+ ucidef_set_led_switch "lan" "LAN" "gl-ar300m:green:lan" "switch0" "0x02"
;;
-glinet,gl-xe300)
- ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"

View File

@ -1,20 +1,22 @@
From 8f348fffc8390e3a93b591ff9bd9783fe2f154df Mon Sep 17 00:00:00 2001
From: niyin <yin.ni@gl-inet.com>
Date: Sat, 28 Jan 2023 22:24:55 -0800
From 5d50ac74cabf5168c2478f9ccd8a8c425ee457c0 Mon Sep 17 00:00:00 2001
From: Luo Chongjun <luochongjun@gl-inet.com>
Date: Fri, 28 Apr 2023 11:41:28 +0800
Subject: [PATCH] ath79 adjust 02_network
---
.../ath79/nand/base-files/etc/board.d/02_network | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
.../nand/base-files/etc/board.d/02_network | 18 ++++++++++++++++++
1 file changed, 18 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..99e6ce7f6c 100644
index 3c5627e2a4..a10013d8ae 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,11 @@ ath79_setup_interfaces()
@@ -69,6 +69,13 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
;;
+ glinet,gl-ar300m-nor|\
+ glinet,gl-ar300m-nand|\
+ glinet,gl-x750-nor|\
+ glinet,gl-x300b-nor|\
+ glinet,gl-x300b-nor-nand)
@ -23,7 +25,7 @@ index b533e5be6c..99e6ce7f6c 100644
*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
@@ -88,6 +93,17 @@ ath79_setup_macs()
@@ -92,6 +99,17 @@ ath79_setup_macs()
netgear,wndr4500-v3)
wan_mac=$(mtd_get_mac_binary caldata 0x6)
;;
@ -42,5 +44,5 @@ index b533e5be6c..99e6ce7f6c 100644
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
--
2.17.1
2.25.1

View File

@ -1,17 +1,36 @@
From 228ac127c439ab509a4341d9bbd962ba93b85928 Mon Sep 17 00:00:00 2001
From: niyin <yin.ni@gl-inet.com>
Date: Sat, 28 Jan 2023 22:24:55 -0800
From c7f914f2791da7884eddcf40538b57302e816395 Mon Sep 17 00:00:00 2001
From: Luo Chongjun <luochongjun@gl-inet.com>
Date: Fri, 28 Apr 2023 11:59:55 +0800
Subject: [PATCH] ath79 adjust nand.mk
---
target/linux/ath79/image/nand.mk | 79 ++++++++++++++++++++++++++++++--
1 file changed, 75 insertions(+), 4 deletions(-)
target/linux/ath79/image/nand.mk | 87 +++++++++++++++++++++++++++++---
1 file changed, 80 insertions(+), 7 deletions(-)
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 0f5b07225c..618083a8e9 100644
index 0f5b07225c..5284eae0b5 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -153,6 +153,36 @@ define Device/glinet_gl-ar300m-nor
@@ -139,10 +139,10 @@ define Device/glinet_gl-ar300m-nand
$(Device/glinet_gl-ar300m-common-nand)
DEVICE_VARIANT := NAND
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
+ 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-ar300m-nand
@@ -150,9 +150,41 @@ define Device/glinet_gl-ar300m-nor
$(Device/glinet_gl-ar300m-common-nand)
DEVICE_VARIANT := NOR
SUPPORTED_DEVICES += glinet,gl-ar300m-nand gl-ar300m
+ IMAGES := sysupgrade.bin
+ IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-gl-metadata | check-size $$$$(IMAGE_SIZE)
endef
TARGET_DEVICES += glinet_gl-ar300m-nor
@ -48,7 +67,7 @@ index 0f5b07225c..618083a8e9 100644
define Device/glinet_gl-ar750s-common
SOC := qca9563
DEVICE_VENDOR := GL.iNet
@@ -166,7 +196,12 @@ define Device/glinet_gl-ar750s-nor-nand
@@ -166,7 +198,12 @@ define Device/glinet_gl-ar750s-nor-nand
$(Device/glinet_gl-ar750s-common)
DEVICE_VARIANT := NOR/NAND
KERNEL_SIZE := 4096k
@ -62,7 +81,7 @@ index 0f5b07225c..618083a8e9 100644
SUPPORTED_DEVICES += glinet,gl-ar750s-nor
endef
TARGET_DEVICES += glinet_gl-ar750s-nor-nand
@@ -174,6 +209,7 @@ TARGET_DEVICES += glinet_gl-ar750s-nor-nand
@@ -174,6 +211,7 @@ TARGET_DEVICES += glinet_gl-ar750s-nor-nand
define Device/glinet_gl-ar750s-nor
$(Device/glinet_gl-ar750s-common)
DEVICE_VARIANT := NOR
@ -70,7 +89,7 @@ index 0f5b07225c..618083a8e9 100644
SUPPORTED_DEVICES += gl-ar750s glinet,gl-ar750s glinet,gl-ar750s-nor-nand
endef
TARGET_DEVICES += glinet_gl-ar750s-nor
@@ -189,9 +225,9 @@ define Device/glinet_gl-e750
@@ -189,9 +227,9 @@ define Device/glinet_gl-e750
PAGESIZE := 2048
VID_HDR_OFFSET := 2048
BLOCKSIZE := 128k
@ -83,7 +102,7 @@ index 0f5b07225c..618083a8e9 100644
endef
TARGET_DEVICES += glinet_gl-e750
@@ -231,6 +267,41 @@ define Device/linksys_ea4500-v3
@@ -231,6 +269,41 @@ define Device/linksys_ea4500-v3
endef
TARGET_DEVICES += linksys_ea4500-v3

View File

@ -0,0 +1,177 @@
From 31a55fb02dbf1172888fe45282635c6a9d1760d5 Mon Sep 17 00:00:00 2001
From: Luo Chongjun <luochongjun@gl-inet.com>
Date: Fri, 28 Apr 2023 10:55:12 +0800
Subject: [PATCH] ath79: support ar300m
---
.../dts/qca9531_glinet_gl-ar300m-lite.dts | 8 +--
.../dts/qca9531_glinet_gl-ar300m-nand.dts | 4 ++
.../dts/qca9531_glinet_gl-ar300m-nor.dts | 4 ++
.../ath79/dts/qca9531_glinet_gl-ar300m.dtsi | 53 ++++++++++++-------
.../ath79/dts/qca9531_glinet_gl-ar300m16.dts | 4 ++
5 files changed, 49 insertions(+), 24 deletions(-)
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts
index c712236114..e13ea9e8a0 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts
@@ -21,11 +21,7 @@
compatible = "syscon", "simple-mfd";
};
-&led_status {
- label = "red:status";
-};
-
-&led_wlan {
- label = "green:wlan";
+&glhw {
+ flash_size = <16>;
};
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts
index e08f66bf2a..edd748433d 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts
@@ -14,3 +14,7 @@
&nand_ubi {
label = "ubi";
};
+
+&glhw {
+ nand;
+};
\ No newline at end of file
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts
index 15cf1c57cb..dd47e4a1fb 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts
@@ -9,3 +9,7 @@
compatible = "denx,uimage";
label = "firmware";
};
+
+&glhw {
+ flash_size = <16>;
+};
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
index b6ea1080a4..5560d5a9df 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
@@ -5,13 +5,32 @@
/ {
aliases {
- led-boot = &led_status;
- led-failsafe = &led_status;
- led-running = &led_status;
- led-upgrade = &led_status;
label-mac-device = &eth0;
};
+ glhw: gl_hw {
+ compatible = "gl-hw-info";
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ model = "ar300m";
+ wan = "eth0";
+ lan = "eth1";
+ flash_size = <128>;
+ radio = "mac80211";
+ reset-button = "gpio-3";
+ usb-port = "1-1.3";
+ usb-reset = "usb_power,1";
+ switch-button = "gpio-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";
@@ -24,15 +43,9 @@
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
};
- right {
- label = "button right";
- linux,code = <BTN_0>;
- gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
- };
-
- left {
- label = "button left";
- linux,code = <BTN_1>;
+ switch {
+ label = "switch";
+ linux,code = <KEY_SETUP>;
gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
};
};
@@ -52,18 +65,19 @@
// Colors for non-Lite versions
- led_status: status {
- label = "green:status";
+ power {
+ label = "gl-ar300m:green:power";
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+ default-state = "on";
};
lan {
- label = "green:lan";
+ label = "gl-ar300m:green:lan";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
- led_wlan: wlan {
- label = "red:wlan";
+ wlan {
+ label = "gl-ar300m:red:wlan";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
@@ -158,17 +172,20 @@
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
+ ifname = "eth0";
};
&eth1 {
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
+ ifname = "eth1";
};
&wmac {
status = "okay";
mtd-cal-data = <&art 0x1000>;
+ mtd-mac-address = <&art 0x1002>;
};
&art {
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts
index 0851d414d6..cb24ba76a3 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts
@@ -13,3 +13,7 @@
compatible = "denx,uimage";
label = "firmware";
};
+
+&glhw {
+ flash_size = <16>;
+};
--
2.25.1

View File

@ -2,10 +2,172 @@
description: Add the glinet dependencies
feeds:
- name: glinet
path: ../feeds_dir/glinet
uri: https://gitlab.com/gl.sdk4.0/gl.router/gl-sdk4-collect.git
branch: master
packages:
- helloworld
- kmod-usb-storage
- kmod-usb-uhci
- kmod-usb2
- kmod-usb-ohci
- kmod-gl-sdk4-hw-info
- kmod-gl-sdk4-tertf
- dnsmasq-full
- mwan3
- curl
- iwinfo
- block-mount
- blkid
- ntfs-3g
- ntfs-3g-utils
- kmod-fs-ext4
- kmod-fs-ntfs
- kmod-fs-vfat
- kmod-fs-exfat
- kmod-inet-diag
- iptables-mod-tproxy
- iptables-mod-filter
- i2c-tools
- gl-sdk4-keepcfg
- gl-oui-rpc
- oui-librpc
- gl-sdk4-luci
- gl-sdk4-rtty
- gl-sdk4-cable
- gl-sdk4-clients
- gl-sdk4-modem
- gl-sdk4-wifi
- gl-sdk4-switch-button
- gl-sdk4-netmode
- gl-sdk4-base-files
- gl-sdk4-tethering
- gl-sdk4-upgrade
- gl-sdk4-ovpn-client
- gl-sdk4-ovpn-server
- gl-sdk4-wg-client
- gl-sdk4-wg-server
- gl-sdk4-macclone
- gl-sdk4-ddns
- gl-sdk4-plugins
- gl-sdk4-firewall
- gl-sdk4-repeater
- gl-sdk4-dns
- gl-sdk4-system
- gl-sdk4-network
- gl-sdk4-acl
- gl-sdk4-mqtt
- gl-sdk4-cloud
- gl-sdk4-lan
- gl-sdk4-ipv6
- gl-sdk4-upgrade
- gl-sdk4-vpn-policy
- gl-sdk4-logread
- gl-sdk4-qos
- gl-sdk4-cloud-batch-manage
- gl-sdk4-network-diag
- gl-sdk4-carrier-monitor
- gl-sdk4-init-portal
- gl-sdk4-s2s
- gl-sdk4-edgerouter
- gl-sdk4-mwan3
- gl-sdk4-timer
- gl-sdk4-igmp
- gl-sdk4-zerotier
- gl-sdk4-ui-adminpw
- gl-sdk4-ui-advanced
- gl-sdk4-ui-bridge
- gl-sdk4-ui-btnsettings
- gl-sdk4-ui-clients
- gl-sdk4-ui-cloud
- gl-sdk4-ui-core
- gl-sdk4-ui-dnsview
- gl-sdk4-ui-dynamicdns
- gl-sdk4-ui-edgerouter
- gl-sdk4-ui-firewallview
- gl-sdk4-ui-home
- gl-sdk4-ui-igmp
- gl-sdk4-ui-internet
- gl-sdk4-ui-ipv6
- gl-sdk4-ui-lanip
- gl-sdk4-ui-login
- gl-sdk4-ui-logview
- gl-sdk4-ui-macclone
- gl-sdk4-ui-modemmanage
- gl-sdk4-ui-multiwan
- gl-sdk4-ui-nasview
- gl-sdk4-ui-overview
- gl-sdk4-ui-ovpnclient
- gl-sdk4-ui-ovpnserver
- gl-sdk4-ui-plugins
- gl-sdk4-ui-process
- gl-sdk4-ui-reset
- gl-sdk4-ui-timedtask
- gl-sdk4-ui-timezone
- gl-sdk4-ui-upgrade
- gl-sdk4-ui-vlan
- gl-sdk4-ui-vpndashboard
- gl-sdk4-ui-welcome
- gl-sdk4-ui-wgclient
- gl-sdk4-ui-wgserver
- gl-sdk4-ui-wireless
- gl-sdk4-nas-utils
- gl-sdk4-nas-web
- gl-sdk4-exfat-utils
- gl-sdk4-webdav
- kmod-usb-storage-uas
- kmod-usb-storage-extras
- dosfstools
- e2fsprogs
- minidlna
diffconfig: |
CONFIG_SIGNATURE_CHECK=n
CONFIG_PACKAGE_dnsmasq=n
CONFIG_PACKAGE_wpad-basic=n
CONFIG_PACKAGE_wpad=n
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP=y
CONFIG_BUSYBOX_CONFIG_FLOAT_DURATION=y
CONFIG_NGINX_HTTP_CHARSET=n
CONFIG_NGINX_HTTP_GZIP=n
CONFIG_NGINX_HTTP_SSI=n
CONFIG_NGINX_HTTP_USERID=n
CONFIG_NGINX_HTTP_ACCESS=n
CONFIG_NGINX_HTTP_AUTH_BASIC=n
CONFIG_NGINX_HTTP_AUTOINDEX=n
CONFIG_NGINX_HTTP_GEO=n
CONFIG_NGINX_HTTP_MAP=n
CONFIG_NGINX_HTTP_SPLIT_CLIENTS=n
CONFIG_NGINX_HTTP_REFERER=n
CONFIG_NGINX_HTTP_REWRITE=n
CONFIG_NGINX_HTTP_FASTCGI=n
CONFIG_NGINX_HTTP_SCGI=n
CONFIG_NGINX_HTTP_MEMCACHED=n
CONFIG_NGINX_HTTP_LIMIT_CONN=n
CONFIG_NGINX_HTTP_LIMIT_REQ=n
CONFIG_NGINX_HTTP_EMPTY_GIF=n
CONFIG_NGINX_HTTP_BROWSER=n
CONFIG_NGINX_HTTP_UPSTREAM_HASH=n
CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH=n
CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN=n
CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE=n
CONFIG_NGINX_HTTP_CACHE=n
CONFIG_NGINX_NAXSI=n
CONFIG_NGINX_HEADERS_MORE=n
CONFIG_LIBCURL_MBEDTLS=n
CONFIG_LIBCURL_OPENSSL=y
CONFIG_OPENSSL_OPTIMIZE_SPEED=y
CONFIG_LUCI_LANG_zh_Hans=y
CONFIG_PACKAGE_wpad-basic-wolfssl=n
CONFIG_PACKAGE_libustream-wolfssl=n
CONFIG_PACKAGE_libustream-openssl=y
CONFIG_BUSYBOX_CONFIG_ADDGROUP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_ADDUSER_TO_GROUP=y
CONFIG_BUSYBOX_CONFIG_ADDUSER=y
CONFIG_BUSYBOX_CONFIG_CHPASSWD=y
CONFIG_BUSYBOX_CONFIG_DELUSER=y
CONFIG_BUSYBOX_CONFIG_DELGROUP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DEL_USER_FROM_GROUP=y
CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA=y
CONFIG_GL_SDK4_DNS_USE_DNSCRYPT_PROXY=y
CONFIG_ATH10K_THERMAL=y

View File

@ -5,3 +5,4 @@ diffconfig: |
CONFIG_IB=y
CONFIG_IB_STANDALONE=y
CONFIG_ALL_NONSHARED=y
CONFIG_SDK=y

View File

@ -3,3 +3,10 @@ profile: glinet_gl-ar300m-nand
target: ath79
subtarget: nand
description: Build image for the GL.iNET AR300M NAND Flash
feeds:
- name: gl_feeds_commmon
uri: https://github.com/gl-inet/gl-feeds.git
revision: 341ee97aaa761c0fc93a0d28fc8634d42f7f7c4c
- name: gl_feeds_22_03
uri: https://github.com/gl-inet/gl-feeds.git
revision: 195dca0e10af66665aa59e33dc17edb784379732

View File

@ -0,0 +1,12 @@
---
profile: glinet_gl-ar300m-nor
target: ath79
subtarget: nand
description: Build image for the GL.iNET AR300M NOR Flash
feeds:
- name: gl_feeds_commmon
uri: https://github.com/gl-inet/gl-feeds.git
revision: 341ee97aaa761c0fc93a0d28fc8634d42f7f7c4c
- name: gl_feeds_22_03
uri: https://github.com/gl-inet/gl-feeds.git
revision: 195dca0e10af66665aa59e33dc17edb784379732