MLK-17781 arm: imx8: check SC_R_LAST when power off domains
authorPeng Fan <peng.fan@nxp.com>
Tue, 13 Mar 2018 01:40:37 +0000 (09:40 +0800)
committerPeng Fan <peng.fan@nxp.com>
Wed, 14 Mar 2018 01:29:13 +0000 (09:29 +0800)
To those who use power domains that take SC_R_LAST
as resource id, need to check that in case those
are error.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/cpu/armv8/imx8/cpu.c

index 178b72f..8c4dfd1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 NXP
+ * Copyright 2017-2018 NXP
  *
  * SPDX-License-Identifier:    GPL-2.0+
  *
@@ -861,6 +861,7 @@ static void update_fdt_with_owned_resources(void *blob)
        int depth, next_depth;
        unsigned int rsrc_id;
        const fdt32_t *php;
+       const char *name;
        int rc;
 
        for (offset = fdt_next_node(blob, offset, &depth); offset > 0;
@@ -898,6 +899,12 @@ static void update_fdt_with_owned_resources(void *blob)
                        addr = fdt_node_offset_by_phandle(blob, fdt32_to_cpu(*php));
                        rsrc_id = fdtdec_get_uint(blob, addr, "reg", 0);
 
+                       if (rsrc_id == SC_R_LAST) {
+                               name = fdt_get_name(blob, offset, NULL);
+                               printf("%s's power domain use SC_R_LAST\n", name);
+                               continue;
+                       }
+
                        debug("power-domains phandle 0x%x, addr 0x%x, resource id %u\n",
                                fdt32_to_cpu(*php), addr, rsrc_id);