[source] lantiq: fix avm fritz box mac addresses

LEDE Commits lede-commits at lists.infradead.org
Sat May 6 01:50:52 PDT 2017


mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/d49920e45044dfb635a93f317e5b965b5c8afdad

commit d49920e45044dfb635a93f317e5b965b5c8afdad
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Mar 26 10:53:35 2017 +0200

    lantiq: fix avm fritz box mac addresses
    
    It has been shown that the Fritz boxes have the correct mac address set
    in the wireless calibration data/eeeprom. Use this mac address as base
    for the ethernet and xdsl interface increment/decrement the address to
    match the values stored in the tffs.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/base-files/etc/board.d/02_network            | 9 +++++++++
 .../lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom     | 7 +------
 target/linux/lantiq/dts/FRITZ3370.dts                            | 5 +++--
 target/linux/lantiq/dts/FRITZ7320.dts                            | 2 ++
 target/linux/lantiq/dts/FRITZ7360SL.dts                          | 3 ++-
 5 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network
index 41d6b7f..6140a16 100755
--- a/target/linux/lantiq/base-files/etc/board.d/02_network
+++ b/target/linux/lantiq/base-files/etc/board.d/02_network
@@ -93,7 +93,16 @@ EASY80920NAND|EASY80920NOR)
 		"0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t at eth0"
 	;;
 
+FRITZ3370)
+	wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2439)" 1)
+	;;
+
+FRITZ7320)
+	wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1)
+	;;
+
 FRITZ7360SL)
+	wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1)
 	ucidef_add_switch "switch0" \
 		"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t at eth0"
 	;;
diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
index 1c6b066..26b5551 100644
--- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
+++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
@@ -139,13 +139,8 @@ case "$FIRMWARE" in
 				ath9k_eeprom_extract "calibration" 61440 0
 				ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot-env ethaddr) +2) 524
 				;;
-			FRITZ3370)
+			FRITZ3370|FRITZ7320|FRITZ7360SL)
 				ath9k_eeprom_extract "urlader" 2437 0
-				ath9k_patch_fw_mac "00:00:00:00:00:00" 2
-				;;
-			FRITZ7320|FRITZ7360SL)
-				ath9k_eeprom_extract "urlader" 2437 0
-				ath9k_patch_fw_mac_crc "00:00:00:00:00:00" 268
 				;;
 			TDW8970|TDW8980)
 				ath9k_eeprom_extract "boardconfig" 135168 0
diff --git a/target/linux/lantiq/dts/FRITZ3370.dts b/target/linux/lantiq/dts/FRITZ3370.dts
index 1e2e90c..3f57f45 100644
--- a/target/linux/lantiq/dts/FRITZ3370.dts
+++ b/target/linux/lantiq/dts/FRITZ3370.dts
@@ -189,7 +189,7 @@
 		reg = <4 0>;
 		spi-max-frequency = <1000000>;
 
-		partition at 0 {
+		urlader: partition at 0 {
 			reg = <0x0 0x20000>;
 			label = "urlader";
 			read-only;
@@ -215,7 +215,8 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		reg = <0>;
-		mac-address = [ 00 11 22 33 44 55 ];
+		mtd-mac-address = <&urlader 0x987>;
+		mtd-mac-address-increment = <(-2)>;
 		lantiq,switch;
 
 		ethernet at 0 {
diff --git a/target/linux/lantiq/dts/FRITZ7320.dts b/target/linux/lantiq/dts/FRITZ7320.dts
index 1d3e02f..491baee 100644
--- a/target/linux/lantiq/dts/FRITZ7320.dts
+++ b/target/linux/lantiq/dts/FRITZ7320.dts
@@ -90,6 +90,8 @@
 
 		etop at E180000 {
 			phy-mode = "mii";
+			mtd-mac-address = <&ath9k_cal 0xa91>;
+			mtd-mac-address-increment = <(-2)>;
 		};
 
 		ifxhcd at E101000 {
diff --git a/target/linux/lantiq/dts/FRITZ7360SL.dts b/target/linux/lantiq/dts/FRITZ7360SL.dts
index b4b1224..31a9527 100644
--- a/target/linux/lantiq/dts/FRITZ7360SL.dts
+++ b/target/linux/lantiq/dts/FRITZ7360SL.dts
@@ -155,7 +155,8 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		reg = <0>;
-		mac-address = [ 00 11 22 33 44 55 ];
+		mtd-mac-address = <&urlader 0xa91>;
+		mtd-mac-address-increment = <(-2)>;
 		lantiq,switch;
 
 		ethernet at 0 {



More information about the lede-commits mailing list