summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev2025-12-04 05:23:33 +0000
committerRobert Marko2026-02-17 19:56:27 +0000
commit27a673916c350909fa569835c9fc2a1349357141 (patch)
tree3a29d16ed2a8dd63f1c673e40a8d4b81cf86b823
parent77a7d1ce674825915bc803b24b3976666a230c4b (diff)
downloadopenwrt-27a673916c350909fa569835c9fc2a1349357141.tar.gz
ath79: mr18: use nvmem for MACs
NVMEM in UBI support has been present for a while. Use it to get the MACs. Seems caldata needs to continue to be obtained through userspace. This fixes label-mac-device as it needs a mac-address nvmem cell. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://github.com/openwrt/openwrt/pull/17068 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--target/linux/ath79/dts/qca9557_meraki_mr18.dts28
-rw-r--r--target/linux/ath79/nand/base-files/etc/board.d/02_network3
-rw-r--r--target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom3
-rw-r--r--target/linux/ath79/nand/config-default1
4 files changed, 29 insertions, 6 deletions
diff --git a/target/linux/ath79/dts/qca9557_meraki_mr18.dts b/target/linux/ath79/dts/qca9557_meraki_mr18.dts
index 4e9b3d1e9a..3fa4e57456 100644
--- a/target/linux/ath79/dts/qca9557_meraki_mr18.dts
+++ b/target/linux/ath79/dts/qca9557_meraki_mr18.dts
@@ -127,6 +127,24 @@
partition@1080000 {
label = "ubi";
reg = <0x1080000 0x6f00000>;
+
+ volumes {
+ ubi-volume-board-config {
+ volname = "board-config";
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_board_102: macaddr@102 {
+ compatible = "mac-base";
+ reg = <0x102 0x6>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
+ };
+ };
};
partition@7fe0000 {
@@ -158,6 +176,8 @@
compatible = "pci168c,0033";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
+ nvmem-cells = <&macaddr_board_102 2>;
+ nvmem-cell-names = "mac-address";
};
};
@@ -168,6 +188,8 @@
compatible = "pci168c,0033";
reg = <0x0000 0 0 0 0>;
qca,no-eeprom;
+ nvmem-cells = <&macaddr_board_102 3>;
+ nvmem-cell-names = "mac-address";
};
};
@@ -184,6 +206,9 @@
pll-data = <0xa6000000 0xa0000101 0x80001313>;
phy-handle = <&phy>;
+ nvmem-cells = <&macaddr_board_102 0>;
+ nvmem-cell-names = "mac-address";
+
gmac-config {
device = <&gmac>;
rgmii-enabled = <1>;
@@ -195,4 +220,7 @@
&wmac {
status = "okay";
qca,no-eeprom;
+
+ nvmem-cells = <&macaddr_board_102 1>;
+ nvmem-cell-names = "mac-address";
};
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 968a441617..362898630f 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
@@ -104,9 +104,6 @@ ath79_setup_macs()
wan_mac=$(mtd_get_mac_binary art 0x0)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
- meraki,mr18)
- lan_mac=$(mtd_get_mac_binary_ubi board-config 102)
- ;;
netgear,wndr3700-v4|\
netgear,wndr4300|\
netgear,wndr4300sw|\
diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index ca722040f6..d88bcb552f 100644
--- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -17,7 +17,6 @@ case "$FIRMWARE" in
else
caldata_extract "odm-caldata" 0x1000 0x440
fi
- ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) 1)
;;
*)
caldata_die "board $board is not supported yet"
@@ -34,7 +33,6 @@ case "$FIRMWARE" in
else
caldata_extract "odm-caldata" 0x5000 0x440
fi
- ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) 2)
;;
*)
caldata_die "board $board is not supported yet"
@@ -51,7 +49,6 @@ case "$FIRMWARE" in
else
caldata_extract "odm-caldata" 0x9000 0x440
fi
- ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) 3)
;;
*)
caldata_die "board $board is not supported yet"
diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default
index 71ce1caad7..10dc596693 100644
--- a/target/linux/ath79/nand/config-default
+++ b/target/linux/ath79/nand/config-default
@@ -16,6 +16,7 @@ CONFIG_MTD_SPI_NAND=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_BEB_LIMIT=20
CONFIG_MTD_UBI_BLOCK=y
+CONFIG_MTD_UBI_NVMEM=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
# CONFIG_PCI_AR71XX is not set
CONFIG_POWER_RESET=y