qualcommax: ipq50xx: load Linksys partition tables from SMEM
authorGeorge Moussalem <george.moussalem@outlook.com>
Tue, 9 Dec 2025 11:04:56 +0000 (15:04 +0400)
committerRobert Marko <robimarko@gmail.com>
Wed, 24 Dec 2025 09:42:39 +0000 (10:42 +0100)
The partition table on Linksys devices with a Qualcomm AX IPQ SoC is
stored in SMEM. As such, load partition table from SMEM rather than
statically defining them in their respective device trees. This helps
generalize the base template and requires less maintenance.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21038
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-mx-base.dtsi
target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata

index a69385e17ff8e66c3774b510e0d158d74f35bce2..76c038461792c98e56da3f1ecd3c4194c879e32a 100644 (file)
                nand-bus-width = <8>;
 
                partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
+                       compatible = "qcom,smem-part";
 
-                       partition@0 {
-                               label = "0:SBL1";
-                               reg = <0x00000000 0x80000>;
-                               read-only;
-                       };
-
-                       partition@80000 {
-                               label = "0:MIBIB";
-                               reg = <0x00080000 0x80000>;
-                               read-only;
-                       };
-
-                       partition@100000 {
-                               label = "0:QSEE";
-                               reg = <0x00100000 0x100000>;
-                               read-only;
-                       };
-
-                       partition@200000 {
-                               label = "0:DEVCFG";
-                               reg = <0x00200000 0x40000>;
-                               read-only;
-                       };
-
-                       partition@240000 {
-                               label = "0:CDT";
-                               reg = <0x00240000 0x40000>;
-                               read-only;
-                       };
-
-                       partition@280000 {
-                               label = "0:APPSBLENV";
-                               reg = <0x00280000 0x80000>;
-                       };
-
-                       partition@300000 {
-                               label = "0:APPSBL";
-                               reg = <0x00300000 0x140000>;
-                               read-only;
-                       };
-
-                       partition@440000 {
-                               label = "0:ART";
-                               reg = <0x00440000 0x100000>;
-                               read-only;
-                       };
-
-                       partition@540000 {
-                               label = "0:TRAINING";
-                               reg = <0x00540000 0x80000>;
-                               read-only;
-                       };
-
-                       partition@5c0000 {
-                               label = "u_env";
-                               reg = <0x005c0000 0x80000>;
-                       };
-
-                       partition@640000 {
-                               label = "s_env";
-                               reg = <0x00640000 0x40000>;
-                       };
-
-                       partition@680000 {
+                       partition-devinfo {
                                label = "devinfo";
-                               reg = <0x00680000 0x40000>;
                                read-only;
 
                                nvmem-layout {
 
                                        hw_mac_addr: hw_mac_addr {
                                                compatible = "mac-base";
-
                                                #nvmem-cell-cells = <1>;
                                        };
                                };
                        };
-
-                       partition@6c0000 {
-                               label = "kernel";
-                               reg = <0x006c0000 0x5200000>;
-                       };
-
-                       partition@ec0000 {
-                               label = "rootfs";
-                               reg = <0x0ec0000 0x4a00000>;
-                       };
-
-                       partition@58c0000 {
-                               label = "alt_kernel";
-                               reg = <0x058c0000 0x5200000>;
-                       };
-
-                       partition@60c0000 {
-                               label = "alt_rootfs";
-                               reg = <0x060c0000 0x4a00000>;
-                       };
-
-                       partition@aac0000 {
-                               label = "sysdiag";
-                               reg = <0x0aac0000 0x200000>;
-                               read-only;
-                       };
-
-                       partition@acc0000 {
-                               label = "syscfg";
-                               reg = <0x0acc0000 0x4400000>;
-                               read-only;
-                       };
                };
        };
 };
index c34aadf7d43f4702922732edfd91ab5f328a1f2a..6cd00bf53c28c7e904a7f91c407b0ff23d7b89f5 100644 (file)
@@ -25,7 +25,7 @@ case "$FIRMWARE" in
        linksys,mx2000|\
        linksys,mx5500|\
        linksys,spnmx56)
-               caldata_extract "0:ART" 0x1000 0x20000
+               caldata_extract "0:art" 0x1000 0x20000
                label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
                ath11k_patch_mac $(macaddr_add $label_mac 1) 0
                ath11k_remove_regdomain
@@ -59,7 +59,7 @@ case "$FIRMWARE" in
                ath11k_set_macflag
                ;;
        linksys,mx2000)
-               caldata_extract "0:ART" 0x26800 0x20000
+               caldata_extract "0:art" 0x26800 0x20000
                label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
                ath11k_patch_mac $(macaddr_add $label_mac 2) 0
                ath11k_remove_regdomain
@@ -79,7 +79,7 @@ case "$FIRMWARE" in
        linksys,mr5500|\
        linksys,mx5500|\
        linksys,spnmx56)
-               caldata_extract "0:ART" 0x26800 0x20000
+               caldata_extract "0:art" 0x26800 0x20000
                label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
                ath11k_patch_mac $(macaddr_add $label_mac 2) 0
                ath11k_remove_regdomain