gl-infra-builder-FUjr/patches-22.03.4/4007-support-ar300m-target.patch
2023-05-04 19:36:47 +08:00

178 lines
4.6 KiB
Diff

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";
+ 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