Files
wlan-ap/patches/0058-ramips-mt7621-add-mt7621-indio-um-305ax.patch
Shubham Vishwakarma d1e18425b0 ramips: mt7621: update mt7621 indio um-305ax patch file
Changelog:
- Fix MAC address assignment for Ethernet ports
- Fix Ethernet port configuration (was not working in the current DTS
  because GPIOs 23 and 24, used for LEDs, are RGMII2 pins)
- Add package kmod-7915-firmware to enable Wi-Fi

Signed-off-by: Shubham Vishwakarma <shubhamvis98@fossfrog.in>
2025-10-01 07:44:35 +02:00

302 lines
7.7 KiB
Diff
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 937c4ba769b4d3a0b5cb804e54fd8bece8efac47 Mon Sep 17 00:00:00 2001
From: Shubham Vishwakarma <shubhamvis98@fossfrog.in>
Date: Mon, 29 Sep 2025 10:35:54 +0530
Subject: [PATCH 58/68] ramips: mt7621: add mt7621 indio um-305ax
Changelog:
- Fix MAC address assignment for Ethernet ports
- Fix Ethernet port configuration (was not working in the current DTS
because GPIOs 23 and 24, used for LEDs, are RGMII2 pins)
- Add package kmod-7915-firmware to enable Wi-Fi
Signed-off-by: Shubham Vishwakarma <shubhamvis98@fossfrog.in>
---
target/linux/ath79/image/generic.mk | 22 +--
.../ramips/dts/mt7621_indio_um-305ax.dts | 168 ++++++++++++++++++
target/linux/ramips/image/mt7621.mk | 11 ++
.../mt7621/base-files/etc/board.d/02_network | 6 +
.../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 6 +
5 files changed, 202 insertions(+), 11 deletions(-)
create mode 100644 target/linux/ramips/dts/mt7621_indio_um-305ax.dts
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 5882feafcb..a98a5e816f 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1627,6 +1627,17 @@ define Device/hiwifi_hc6361
endef
TARGET_DEVICES += hiwifi_hc6361
+define Device/indio_um-305ac
+ SOC := qca9531
+ DEVICE_VENDOR := Indio Network
+ DEVICE_MODEL := UM-305AC
+ DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887
+ IMAGE_SIZE := 16000k
+ IMAGES += tftp.bin
+ IMAGE/tftp.bin := $$(IMAGE/sysupgrade.bin) | yuncore-tftp-header-16m
+endef
+TARGET_DEVICES += indio_um-305ac
+
define Device/iodata_etg3-r
SOC := ar9342
DEVICE_VENDOR := I-O DATA
@@ -2991,17 +3002,6 @@ define Device/yuncore_a770
endef
TARGET_DEVICES += yuncore_a770
-define Device/indio_um-305ac
- SOC := qca9531
- DEVICE_VENDOR := Indio Network
- DEVICE_MODEL := UM-305AC
- DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887
- IMAGE_SIZE := 16000k
- IMAGES += tftp.bin
- IMAGE/tftp.bin := $$(IMAGE/sysupgrade.bin) | yuncore-tftp-header-16m
-endef
-TARGET_DEVICES += indio_um-305ac
-
define Device/yuncore_a782
SOC := qca9563
DEVICE_VENDOR := YunCore
diff --git a/target/linux/ramips/dts/mt7621_indio_um-305ax.dts b/target/linux/ramips/dts/mt7621_indio_um-305ax.dts
new file mode 100644
index 0000000000..42837dd9fe
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_indio_um-305ax.dts
@@ -0,0 +1,168 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright (c) 2025, Shubham Vishwakarma <shubhamvis98@fossfrog.in>
+ */
+
+/dts-v1/;
+
+#include "mt7621.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ compatible = "indio,um-305ax", "mediatek,mt7621-soc";
+ model = "Indio UM-305AX";
+
+ aliases {
+ led-boot = &led_green;
+ led-failsafe = &led_green;
+ led-running = &led_green;
+ led-upgrade = &led_green;
+ };
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ bootargs-override = "console=ttyS0,115200";
+ };
+
+ leds {
+ /*
+ * GPIO 23 and 24 LEDs wont work because these pins are part of the RGMII2 pin group.
+ * To make the LEDs work, we need to change the &state_default nodes group variable
+ * to "rgmii2", which restores LED functionality but disables the Ethernet ports.
+ */
+ compatible = "gpio-leds";
+
+ led_blue: blue {
+ label = "blue";
+ gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+
+ led_red: red {
+ label = "red";
+ gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+
+ led_green: green {
+ label = "green";
+ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys-polled";
+ poll-interval = <50>;
+ pinctrl-names = "default";
+
+ reset {
+ label = "reset";
+ gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+};
+
+&state_default {
+ gpio {
+ groups = "jtag", "wdt";
+ function = "gpio";
+ };
+};
+
+&pcie {
+ status = "okay";
+};
+
+&pcie1 {
+ wifi@0,0 {
+ reg = <0x0 0 0 0 0>;
+ mediatek,mtd-eeprom = <&factory 0x0>;
+ };
+};
+
+&gmac0 {
+ status = "okay";
+ nvmem-cells = <&macaddr_offset>;
+ nvmem-cell-names = "mac-address";
+};
+
+&switch0 {
+ ports {
+ port@0 {
+ status = "okay";
+ label = "wan";
+ nvmem-cells = <&macaddr_offset>;
+ nvmem-cell-names = "mac-address";
+ mac-address-increment = <1>;
+ };
+
+ port@1 {
+ status = "okay";
+ label = "lan";
+ };
+ };
+};
+
+&spi0 {
+ status = "okay";
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <50000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "product";
+ reg = <0x40000 0x10000>;
+ read-only;
+ };
+
+ factory: partition@50000 {
+ label = "factory";
+ reg = <0x50000 0x40000>;
+ read-only;
+ };
+ partition@90000 {
+ compatible = "denx,fit";
+ label = "firmware";
+ reg = <0x90000 0xf60000>;
+ };
+
+ partition@ff0000 {
+ label = "certificates";
+ reg = <0xff0000 0x10000>;
+ };
+
+ };
+ };
+};
+
+&factory {
+ compatible = "nvmem-cells";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_offset: macaddr@4 {
+ reg = <0x4 0x6>;
+ };
+};
+
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 962d7ef440..8790a2fa50 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1148,6 +1148,17 @@ define Device/huasifei_ws1208v2
endef
TARGET_DEVICES += huasifei_ws1208v2
+define Device/indio_um-305ax
+ $(Device/dsa-migration)
+ DEVICE_VENDOR := INDIO
+ DEVICE_MODEL := UM-305AX
+ DEVICE_DTS_CONFIG := config@1
+ DEVICE_PACKAGES += kmod-mt7915e
+ KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+ IMAGE_SIZE := 15774k
+endef
+TARGET_DEVICES += indio_um-305ax
+
define Device/iodata_wn-ax1167gr
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index bd1d394892..0f6b7fd526 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -60,6 +60,7 @@ ramips_setup_interfaces()
;;
asiarf,ap7621-001|\
humax,e10|\
+ indio,um-305ax|\
wavlink,ws-wn572hp3-4g|\
winstars,ws-wn583a6)
ucidef_set_interfaces_lan_wan "lan" "wan"
@@ -148,6 +149,11 @@ ramips_setup_interfaces()
*)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
+ indio,um-305ax)
+ label_mac=$(mtd_get_mac_binary factory 0x4)
+ wan_mac=$(macaddr_add $label_mac 1)
+ lan_mac=$label_mac
+ ;;
esac
}
diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 3467e783f0..d5bd50fdf7 100644
--- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -60,6 +60,12 @@ case "$board" in
macaddr_setbit_la "$base_mac" > /sys${DEVPATH}/macaddress
fi
;;
+ indio,um-305ax)
+ [ "$PHYNBR" = "0" ] && \
+ macaddr_add "$(mtd_get_mac_binary factory 0x4)" 2 > /sys${DEVPATH}/macaddress
+ [ "$PHYNBR" = "1" ] && \
+ macaddr_add "$(mtd_get_mac_binary factory 0x4)" 3 > /sys${DEVPATH}/macaddress
+ ;;
glinet,gl-mt1300)
[ "$PHYNBR" = "1" ] && \
macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1 > /sys${DEVPATH}/macaddress
--
2.47.3