]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cpu: imx8_cpu: fix the mpidr check
authorPeng Fan <peng.fan@nxp.com>
Fri, 5 Jun 2026 09:51:07 +0000 (17:51 +0800)
committerFabio Estevam <festevam@gmail.com>
Fri, 5 Jun 2026 15:57:02 +0000 (12:57 -0300)
The mpidr's type is u32, however dev_read_addr returns a value with type
fdt_addr_t(phys_addr_t) which is 64bit long. So the check never fail.

This patch we still keep mpidr as u32 type, because i.MX8 only has max
two cluster, the higher 32bit will always be 0. Use a variable addr
to do the check, if check pass, assign the lower 32 bit to plat->mpidr.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
drivers/cpu/imx8_cpu.c

index f8202d36fcdb4d8ff355098597f5cf86a7bd044f..d94a24ea30ab83044624e7ba09d5dbdc65e2b3c3 100644 (file)
@@ -377,6 +377,7 @@ static int imx_cpu_probe(struct udevice *dev)
 {
        struct cpu_imx_plat *plat = dev_get_plat(dev);
        u32 cpurev;
+       fdt_addr_t addr;
 
        set_core_data(dev);
        cpurev = get_cpu_rev();
@@ -384,12 +385,14 @@ static int imx_cpu_probe(struct udevice *dev)
        get_imx_rev_str(plat, cpurev & 0xFFF);
        plat->type = get_imx_type_str((cpurev & 0x1FF000) >> 12);
        plat->freq_mhz = imx_get_cpu_rate(dev) / 1000000;
-       plat->mpidr = dev_read_addr(dev);
-       if (plat->mpidr == FDT_ADDR_T_NONE) {
+       addr = dev_read_addr(dev);
+       if (addr == FDT_ADDR_T_NONE) {
                printf("%s: Failed to get CPU reg property\n", __func__);
                return -EINVAL;
        }
 
+       plat->mpidr = (u32)addr;
+
        return 0;
 }