]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
imx9: soc: Use livetree API for fdt access
authorPeng Fan <peng.fan@nxp.com>
Tue, 9 Jun 2026 08:36:28 +0000 (16:36 +0800)
committerFabio Estevam <festevam@gmail.com>
Fri, 26 Jun 2026 20:07:18 +0000 (17:07 -0300)
Use livetree API, otherwise it will fail to read properties from the device
tree when OF_LIVE is enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/mach-imx/imx9/soc.c

index 0c731e7632975a97ae89d08351b2625572d59158..dcf2fff1aa6ab05502ae4915b741b0d4b4636290 100644 (file)
@@ -21,6 +21,7 @@
 #include <asm/armv8/mmu.h>
 #include <dm/device.h>
 #include <dm/device_compat.h>
+#include <dm/ofnode.h>
 #include <dm/uclass.h>
 #include <env.h>
 #include <env_internal.h>
@@ -738,13 +739,16 @@ int arch_cpu_init(void)
 int imx9_probe_mu(void)
 {
        struct udevice *devp;
-       int node, ret;
+       ofnode node;
+       int ret;
        u32 res;
        struct ele_get_info_data info;
 
-       node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "fsl,imx93-mu-s4");
+       node = ofnode_by_compatible(ofnode_null(), "fsl,imx93-mu-s4");
+       if (!ofnode_valid(node))
+               return -ENODEV;
 
-       ret = uclass_get_device_by_of_offset(UCLASS_MISC, node, &devp);
+       ret = uclass_get_device_by_ofnode(UCLASS_MISC, node, &devp);
        if (ret)
                return ret;