ath79: consistently use "info" label for default-mac partition
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sat, 12 Sep 2020 18:54:04 +0000 (20:54 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 16 Sep 2020 15:28:48 +0000 (17:28 +0200)
The tp-link safeloader devices typically contain a partition
"default-mac" which stores the MAC addresses. It is followed by other
partitions containing device info, like

  {"default-mac", 0x610000, 0x00020},
  {"pin", 0x610100, 0x00020},
  {"product-info", 0x611100, 0x01000},

In DTS, we typically assign a 0x10000 sized partition for these,
which is mostly labelled "mac" or "info". In rarer cases, the
partitions have been enclosed in a larger "tplink" or "config"
partition.

However, when comparing different devices, the implementation appears
relatively arbitrary at the moment.
Thus, this PR aims at harmonizing these partitions by always using
the name "info" for the DTS partition containing "default-mac".
"info" is preferred over "mac" as we never just have "default-mac"
alone, but always some other device-info partitions as well.

While at it, this also establishes a similar partitioning for the
few devices where the "info" partitions are part of a bigger
unspecific "config" partition or similar.

Besides the harmonization itself, this also allows to merge a few
cases in 11-ath10k-caldata.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
19 files changed:
target/linux/ath79/dts/ar9344_tplink_cpe.dtsi
target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts
target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts
target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts
target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts
target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts
target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts
target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts
target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts
target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts
target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi
target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts
target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts
target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi
target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-eu.dts
target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts
target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata

index e8a3bdc399fbe0d594df7f3662d562196cf0886b..044f6c5c1962b149c13343459866055c538f9f32 100644 (file)
        status = "okay";
 
        mtd-cal-data = <&art 0x1000>;
-       mtd-mac-address = <&info 0x08>;
+       mtd-mac-address = <&info 0x8>;
 };
 
 &eth0 {
index 0e338fe012b900e74f75d1eb714843dab774208e..6d9cdf8b3fd68bb94b5039635f0f4e0646f0dd1a 100644 (file)
                                reg = <0x020000 0x730000>;
                        };
 
-                       tplink: partition@750000 {
+                       info: partition@750000 {
+                               label = "info";
+                               reg = <0x750000 0x010000>;
+                               read-only;
+                       };
+
+                       partition@760000 {
                                label = "tplink";
-                               reg = <0x750000 0x0a0000>;
+                               reg = <0x760000 0x090000>;
                                read-only;
                        };
 
 
        phy-handle = <&swphy4>;
 
-       mtd-mac-address = <&tplink 0x8>;
+       mtd-mac-address = <&info 0x8>;
        mtd-mac-address-increment = <1>;
 };
 
        status = "okay";
 
        mtd-cal-data = <&art 0x1000>;
-       mtd-mac-address = <&tplink 0x8>;
+       mtd-mac-address = <&info 0x8>;
 };
 
 &pcie0 {
index e103b66cbdd69ed5072639530bf6aa1d0ff3b4fa..6f7f3cca79fa5c365ee50806678c6fa92d1a8326 100644 (file)
                                compatible = "tplink,firmware";
                        };
 
-                       config: partition@3b0000 {
+                       partition@3b0000 {
+                               label = "partition-table";
+                               reg = <0x3b0000 0x010000>;
+                               read-only;
+                       };
+
+                       info: partition@3c0000 {
+                               label = "info";
+                               reg = <0x3c0000 0x010000>;
+                               read-only;
+                       };
+
+                       partition@3d0000 {
                                label = "config";
-                               reg = <0x3b0000 0x040000>;
+                               reg = <0x3d0000 0x020000>;
                                read-only;
                        };
 
 
        phy-handle = <&swphy4>;
 
-       mtd-mac-address = <&config 0x10008>;
+       mtd-mac-address = <&info 0x8>;
 };
 
 &eth1 {
        status = "okay";
 
        mtd-cal-data = <&art 0x1000>;
-       mtd-mac-address = <&config 0x10008>;
+       mtd-mac-address = <&info 0x8>;
 };
index 887b6eea5f549f97f4bd913ebd5bba4f510b7c64..7c27c9793497152df994bb9de657e2a54494a767 100644 (file)
        phy-handle = <&phy4>;
        pll-data = <0x9e000000 0x80000101 0x80001313>;
 
-       mtd-mac-address = <&config 0x10008>;
+       mtd-mac-address = <&info 0x8>;
 
        gmac-config {
                device = <&gmac>;
                                reg = <0x020000 0xd70000>;
                        };
 
-                       config: partition@d90000 {
+                       partition@d90000 {
+                               label = "partition-table";
+                               reg = <0xd90000 0x010000>;
+                               read-only;
+                       };
+
+                       info: partition@da0000 {
+                               label = "info";
+                               reg = <0xda0000 0x020000>;
+                               read-only;
+                       };
+
+                       partition@dc0000 {
                                label = "config";
-                               reg = <0xd90000 0x260000>;
+                               reg = <0xdc0000 0x230000>;
                                read-only;
                        };
 
        status = "okay";
 
        mtd-cal-data = <&art 0x1000>;
-       mtd-mac-address = <&config 0x10008>;
+       mtd-mac-address = <&info 0x8>;
 };
index db2e38bbcb873605740af689b304c31517c0ad13..dfd299b0a0117b90adbf273a9ec503734831e05f 100644 (file)
@@ -28,8 +28,8 @@
                                read-only;
                        };
 
-                       mac: partition@10000 {
-                               label = "mac";
+                       info: partition@10000 {
+                               label = "info";
                                reg = <0x010000 0x010000>;
                                read-only;
                        };
index 773b071a34f69b5e5e0f49b48f07bb543a2d436c..cb0dca59ee346cee74c3788efc152b0d431dd126 100644 (file)
@@ -52,8 +52,8 @@
                                read-only;
                        };
 
-                       mac: partition@10000 {
-                               label = "mac";
+                       info: partition@10000 {
+                               label = "info";
                                reg = <0x010000 0x010000>;
                                read-only;
                        };
index e70afbffd9d41f71c260a966fd7eb5c7155a863e..c2dad233fa6b94af09026b258e54b4ccf6428903 100644 (file)
@@ -58,8 +58,8 @@
                                read-only;
                        };
 
-                       mac: partition@30000 {
-                               label = "mac";
+                       info: partition@30000 {
+                               label = "info";
                                reg = <0x030000 0x010000>;
                                read-only;
                        };
index aa33d13c85bb396a49d84f013a2f00ab3a903902..06df553d490aa3b43a71a1ac6b4ed79bbad34320 100644 (file)
 
        phy-handle = <&swphy0>;
 
-       mtd-mac-address = <&mac 0x8>;
+       mtd-mac-address = <&info 0x8>;
        mtd-mac-address-increment = <1>;
 
        gmac-config {
 &eth1 {
        status = "okay";
 
-       mtd-mac-address = <&mac 0x8>;
+       mtd-mac-address = <&info 0x8>;
 };
 
 &wmac {
        status = "okay";
 
        mtd-cal-data = <&art 0x1000>;
-       mtd-mac-address = <&mac 0x8>;
+       mtd-mac-address = <&info 0x8>;
 };
index a83b5881d400f69ac05a498ae5cf602c1732ee7d..349c0623d60eccfa61e553f5eab6f40efe06d33a 100644 (file)
@@ -40,8 +40,8 @@
                                read-only;
                        };
 
-                       mac: partition@10000 {
-                               label = "mac";
+                       info: partition@10000 {
+                               label = "info";
                                reg = <0x010000 0x010000>;
                                read-only;
                        };
index c19e4e973dcc90a66901bf8e4c662bc54340559c..ebd5254a2c904ed47239a28adc6622faf0b87fea 100644 (file)
@@ -40,8 +40,8 @@
                                read-only;
                        };
 
-                       mac: partition@1fb00 {
-                               label = "mac";
+                       info: partition@1fb00 {
+                               label = "info";
                                reg = <0x01fb00 0x000500>;
                                read-only;
                        };
index 444d54b00076253b5f68839c4cdfa376dfbeabaf..3187bcda6352347c94447851f33e2da424ea643b 100644 (file)
@@ -35,8 +35,8 @@
                                read-only;
                        };
 
-                       mac: partition@1fb00 {
-                               label = "mac";
+                       info: partition@1fb00 {
+                               label = "info";
                                reg = <0x01fb00 0x000500>;
                                read-only;
                        };
index 993c6acc56b775013683ee6e0016b8f2de11cf37..b001938d923282a5f48aa19f149c14552ee5c98b 100644 (file)
 
        phy-handle = <&swphy4>;
 
-       mtd-mac-address = <&mac 0x8>;
+       mtd-mac-address = <&info 0x8>;
        mtd-mac-address-increment = <1>;
 };
 
 &eth1 {
        status = "okay";
 
-       mtd-mac-address = <&mac 0x8>;
+       mtd-mac-address = <&info 0x8>;
 };
 
 &wmac {
        status = "okay";
 
        mtd-cal-data = <&art 0x1000>;
-       mtd-mac-address = <&mac 0x8>;
+       mtd-mac-address = <&info 0x8>;
 };
index 3a6f00bf4e4e42878f7f8b4e39c1ea0e3df81db9..63185ca7e58041f6b39eaca65cdd764b8d36a700 100644 (file)
@@ -96,8 +96,8 @@
                                read-only;
                        };
 
-                       mac: partition@20000 {
-                               label = "mac";
+                       info: partition@20000 {
+                               label = "info";
                                reg = <0x020000 0x010000>;
                                read-only;
                        };
index e7ceec9b3736531f7204b6d33fed5f89ca70c780..7defe6a2a288e9048311e6f1e599fb528b0560e0 100644 (file)
@@ -96,8 +96,8 @@
                                read-only;
                        };
 
-                       mac: partition@20000 {
-                               label = "mac";
+                       info: partition@20000 {
+                               label = "info";
                                reg = <0x020000 0x010000>;
                                read-only;
                        };
index 275f71316c7ec1c75422d307c0ec584c1795d92d..15be4c2967f81f5a31f7144b5d1526a0a4199a06 100644 (file)
        phy-mode = "sgmii";
        phy-handle = <&phy0>;
 
-       mtd-mac-address = <&mac 0x8>;
+       mtd-mac-address = <&info 0x8>;
 };
 
 &wmac {
        status = "okay";
 
        mtd-cal-data = <&art 0x1000>;
-       mtd-mac-address = <&mac 0x8>;
+       mtd-mac-address = <&info 0x8>;
 };
index afcb471670c54588bcf52f1c6ac6c122136c647e..c205b78545572e0e13bfd43504674ff462d1ba8a 100644 (file)
@@ -9,8 +9,8 @@
 };
 
 &partitions {
-       mac: partition@630000 {
-               label = "mac";
+       info: partition@630000 {
+               label = "info";
                reg = <0x630000 0x010000>;
                read-only;
        };
index 8655283f5893cc10e77a42d84a88d3650b804ac8..9990a253ca922648486c71a0e07b709fb990cfa9 100644 (file)
@@ -15,8 +15,8 @@
                read-only;
        };
 
-       mac: partition@7e0000 {
-               label = "mac";
+       info: partition@7e0000 {
+               label = "info";
                reg = <0x7e0000 0x010000>;
                read-only;
        };
index 2d3128e037387ad0abe73fad81541748a9d11012..be691a843bc608693b5e775ed070adafa1083f48 100644 (file)
@@ -35,9 +35,9 @@
 };
 
 &eth0 {
-       mtd-mac-address = <&mac 0x8>;
+       mtd-mac-address = <&info 0x8>;
 };
 
 &wmac {
-       mtd-mac-address = <&mac 0x8>;
+       mtd-mac-address = <&info 0x8>;
 };
index 39b2d0ba494a4454684ce57ef2b01c869853d66e..89a64fbf35a5d5183025acb616a8f12c25fb194e 100644 (file)
@@ -98,7 +98,8 @@ case "$FIRMWARE" in
        tplink,archer-c2-v3|\
        tplink,archer-c7-v4|\
        tplink,archer-c7-v5|\
-       tplink,archer-c25-v1)
+       tplink,archer-c25-v1|\
+       tplink,tl-wr902ac-v1)
                caldata_extract "art" 0x5000 0x844
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1)
                ;;
@@ -118,7 +119,7 @@ case "$FIRMWARE" in
                ;;
        tplink,re350k-v1)
                caldata_extract "art" 0x5000 0x844
-               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary config 0x10008) +2)
+               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +2)
                ;;
        tplink,re355-v1|\
        tplink,re450-v1)
@@ -134,10 +135,6 @@ case "$FIRMWARE" in
                caldata_extract "art" 0x5000 0x844
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) +1)
                ;;
-       tplink,tl-wr902ac-v1)
-               caldata_extract "art" 0x5000 0x844
-               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary tplink 0x8) -1)
-               ;;
        esac
        ;;
 "ath10k/cal-pci-0000:01:00.0.bin")
@@ -195,18 +192,13 @@ case "$FIRMWARE" in
        tplink,archer-c6-v2|\
        tplink,archer-c6-v2-us)
                caldata_extract "art" 0x5000 0x2f20
-               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x8) -1)
+               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1)
                ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
                        /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
                ;;
+       tplink,eap225-wall-v2|\
        tplink,tl-wpa8630p-v2-eu|\
        tplink,tl-wpa8630p-v2-int)
-               caldata_extract "art" 0x5000 0x2f20
-               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x8) +1)
-               ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
-                       /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
-               ;;
-       tplink,eap225-wall-v2)
                caldata_extract "art" 0x5000 0x2f20
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
                ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \