From 7771b6d6cca65411aeb5f29e81e5d89a6090b2a6 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 6 Jan 2024 18:55:30 +0100 Subject: [PATCH] ath79: Fix mac addresses Signed-off-by: Sven Eckelmann --- ...841ND-N-8M-and-16M-variants-to-ath79.patch | 122 +++++++++++++++--- targets/ath79-generic | 40 ++++-- 2 files changed, 138 insertions(+), 24 deletions(-) diff --git a/patches/openwrt/0015-add-TL-WR841ND-N-8M-and-16M-variants-to-ath79.patch b/patches/openwrt/0015-add-TL-WR841ND-N-8M-and-16M-variants-to-ath79.patch index c3fb1e09cb..86e090c4a7 100644 --- a/patches/openwrt/0015-add-TL-WR841ND-N-8M-and-16M-variants-to-ath79.patch +++ b/patches/openwrt/0015-add-TL-WR841ND-N-8M-and-16M-variants-to-ath79.patch @@ -4,10 +4,10 @@ Subject: add TL-WR841ND/N 8M and 16M variants to ath79 diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8-16m.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8-16m.dts new file mode 100644 -index 0000000000000000000000000000000000000000..457d55122e545857fa31f6b3ba77ca8b1009116d +index 0000000000000000000000000000000000000000..5018a727466c2c6c812d5dc1093ccd56a814f869 --- /dev/null +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8-16m.dts -@@ -0,0 +1,61 @@ +@@ -0,0 +1,93 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9341_tplink.dtsi" @@ -16,6 +16,10 @@ index 0000000000000000000000000000000000000000..457d55122e545857fa31f6b3ba77ca8b + model = "TP-Link TL-WR841N/ND Mod (ATH79 16M) v8"; + compatible = "tplink,tl-wr841-v8-16m", "qca,ar9341"; + ++ aliases { ++ label-mac-device = &wmac; ++ }; ++ + keys { + compatible = "gpio-keys"; + @@ -69,12 +73,40 @@ index 0000000000000000000000000000000000000000..457d55122e545857fa31f6b3ba77ca8b + }; + }; +}; ++ ++ð0 { ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; ++ mac-address-increment = <(-1)>; ++}; ++ ++ð1 { ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&wmac { ++ mtd-cal-data = <&art 0x1000>; ++ ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&uboot { ++ compatible = "nvmem-cells"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ macaddr_uboot_1fc00: macaddr@1fc00 { ++ reg = <0x1fc00 0x6>; ++ }; ++}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8-8m.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8-8m.dts new file mode 100644 -index 0000000000000000000000000000000000000000..dc9f48f27b92bdb2f4d4328a14efbd1603c25e92 +index 0000000000000000000000000000000000000000..8b4b13c30fce3c39735fc51b8a0b52f3cb42f9ff --- /dev/null +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8-8m.dts -@@ -0,0 +1,61 @@ +@@ -0,0 +1,93 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9341_tplink.dtsi" @@ -83,6 +115,10 @@ index 0000000000000000000000000000000000000000..dc9f48f27b92bdb2f4d4328a14efbd16 + model = "TP-Link TL-WR841N/ND Mod (ATH79 8M) v8"; + compatible = "tplink,tl-wr841-v8-8m", "qca,ar9341"; + ++ aliases { ++ label-mac-device = &wmac; ++ }; ++ + keys { + compatible = "gpio-keys"; + @@ -136,12 +172,40 @@ index 0000000000000000000000000000000000000000..dc9f48f27b92bdb2f4d4328a14efbd16 + }; + }; +}; ++ ++ð0 { ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; ++ mac-address-increment = <(-1)>; ++}; ++ ++ð1 { ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&wmac { ++ mtd-cal-data = <&art 0x1000>; ++ ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&uboot { ++ compatible = "nvmem-cells"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ macaddr_uboot_1fc00: macaddr@1fc00 { ++ reg = <0x1fc00 0x6>; ++ }; ++}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-16m.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-16m.dtsi new file mode 100644 -index 0000000000000000000000000000000000000000..2c6ab9d3c277e90fae4798fe9fd91e2d2accb52d +index 0000000000000000000000000000000000000000..cefaf99bc6cc0dc79138bb0a75c395a6122a672b --- /dev/null +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-16m.dtsi -@@ -0,0 +1,124 @@ +@@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" @@ -252,26 +316,39 @@ index 0000000000000000000000000000000000000000..2c6ab9d3c277e90fae4798fe9fd91e2d + + phy-handle = <&swphy4>; + -+ mtd-mac-address = <&uboot 0x1fc00>; -+ mtd-mac-address-increment = <1>; ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; ++ mac-address-increment = <1>; +}; + +ð1 { -+ mtd-mac-address = <&uboot 0x1fc00>; ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; -+ mtd-mac-address = <&uboot 0x1fc00>; ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&uboot { ++ compatible = "nvmem-cells"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ macaddr_uboot_1fc00: macaddr@1fc00 { ++ reg = <0x1fc00 0x6>; ++ }; +}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-8m.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-8m.dtsi new file mode 100644 -index 0000000000000000000000000000000000000000..81317a37b8ee5251765d6eb3033749150187cc09 +index 0000000000000000000000000000000000000000..040f7e558566ebf50d7aa5ebd57b79bff18fed6f --- /dev/null +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-8m.dtsi -@@ -0,0 +1,124 @@ +@@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" @@ -382,19 +459,32 @@ index 0000000000000000000000000000000000000000..81317a37b8ee5251765d6eb303374915 + + phy-handle = <&swphy4>; + -+ mtd-mac-address = <&uboot 0x1fc00>; -+ mtd-mac-address-increment = <1>; ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; ++ mac-address-increment = <1>; +}; + +ð1 { -+ mtd-mac-address = <&uboot 0x1fc00>; ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; -+ mtd-mac-address = <&uboot 0x1fc00>; ++ nvmem-cells = <&macaddr_uboot_1fc00>; ++ nvmem-cell-names = "mac-address"; ++}; ++ ++&uboot { ++ compatible = "nvmem-cells"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ macaddr_uboot_1fc00: macaddr@1fc00 { ++ reg = <0x1fc00 0x6>; ++ }; +}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v10-16m.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v10-16m.dts new file mode 100644 diff --git a/targets/ath79-generic b/targets/ath79-generic index b33f4edb68..5b1683e656 100644 --- a/targets/ath79-generic +++ b/targets/ath79-generic @@ -514,42 +514,66 @@ device('tp-link-tl-wr810n-v1', 'tplink_tl-wr810n-v1') device('tp-link-tl-wr841n-nd-mod-ath79-8m-v8', 'tplink_tl-wr841-v8-8m', { factory = false, - manifest_aliases = {'tp-link-tl-wr841n-nd-mod-8m-v8', 'tp-link-tl-wr841n-nd-mod-8m-ath79-v8'}, + manifest_aliases = { + 'tp-link-tl-wr841n-nd-mod-8m-v8', + 'tp-link-tl-wr841n-nd-mod-8m-ath79-v8', + }, }) device('tp-link-tl-wr841n-nd-mod-ath79-16m-v8', 'tplink_tl-wr841-v8-16m', { factory = false, - manifest_aliases = {'tp-link-tl-wr841n-nd-mod-8m-v8', 'tp-link-tl-wr841n-nd-mod-16m-ath79-v8'}, + manifest_aliases = { + 'tp-link-tl-wr841n-nd-mod-16m-v8', + 'tp-link-tl-wr841n-nd-mod-16m-ath79-v8', + }, }) device('tp-link-tl-wr841n-nd-mod-ath79-8m-v9', 'tplink_tl-wr841-v9-8m', { factory = false, - manifest_aliases = {'tp-link-tl-wr841n-nd-mod-8m-v9', 'tp-link-tl-wr841n-nd-mod-8m-ath79-v9'}, + manifest_aliases = { + 'tp-link-tl-wr841n-nd-mod-8m-v9', + 'tp-link-tl-wr841n-nd-mod-8m-ath79-v9', + }, }) device('tp-link-tl-wr841n-nd-mod-ath79-16m-v9', 'tplink_tl-wr841-v9-16m', { factory = false, - manifest_aliases = {'tp-link-tl-wr841n-nd-mod-8m-v9', 'tp-link-tl-wr841n-nd-mod-16m-ath79-v9'}, + manifest_aliases = { + 'tp-link-tl-wr841n-nd-mod-16m-v9', + 'tp-link-tl-wr841n-nd-mod-16m-ath79-v9', + }, }) device('tp-link-tl-wr841n-nd-mod-ath79-8m-v10', 'tplink_tl-wr841-v10-8m', { factory = false, - manifest_aliases = {'tp-link-tl-wr841n-nd-mod-16m-v10', 'tp-link-tl-wr841n-nd-mod-8m-ath79-v10'}, + manifest_aliases = { + 'tp-link-tl-wr841n-nd-mod-8m-v10', + 'tp-link-tl-wr841n-nd-mod-8m-ath79-v10', + }, }) device('tp-link-tl-wr841n-nd-mod-ath79-16m-v10', 'tplink_tl-wr841-v10-16m', { factory = false, - manifest_aliases = {'tp-link-tl-wr841n-nd-mod-16m-v10', 'tp-link-tl-wr841n-nd-mod-16m-ath79-v10'}, + manifest_aliases = { + 'tp-link-tl-wr841n-nd-mod-16m-v10', + 'tp-link-tl-wr841n-nd-mod-16m-ath79-v10', + }, }) device('tp-link-tl-wr841n-nd-mod-ath79-8m-v11', 'tplink_tl-wr841-v11-8m', { factory = false, - manifest_aliases = {'tp-link-tl-wr841n-nd-mod-16m-v11', 'tp-link-tl-wr841n-nd-mod-8m-ath79-v11'}, + manifest_aliases = { + 'tp-link-tl-wr841n-nd-mod-8m-v11', + 'tp-link-tl-wr841n-nd-mod-8m-ath79-v11', + }, }) device('tp-link-tl-wr841n-nd-mod-ath79-16m-v11', 'tplink_tl-wr841-v11-16m', { factory = false, - manifest_aliases = {'tp-link-tl-wr841n-nd-mod-16m-v11', 'tp-link-tl-wr841n-nd-mod-16m-ath79-v11'}, + manifest_aliases = { + 'tp-link-tl-wr841n-nd-mod-16m-v11', + 'tp-link-tl-wr841n-nd-mod-16m-ath79-v11', + }, }) device('tp-link-tl-wr842n-v3', 'tplink_tl-wr842n-v3', {