Merge tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-starfive.git] / drivers / of / fdt.c
index 1c19361..0749656 100644 (file)
@@ -583,11 +583,6 @@ void __init early_init_fdt_scan_reserved_mem(void)
        if (!initial_boot_params)
                return;
 
-       /* Reserve the dtb region */
-       early_init_dt_reserve_memory_arch(__pa(initial_boot_params),
-                                         fdt_totalsize(initial_boot_params),
-                                         0);
-
        /* Process header /memreserve/ fields */
        for (n = 0; ; n++) {
                fdt_get_mem_rsv(initial_boot_params, n, &base, &size);
@@ -601,6 +596,20 @@ void __init early_init_fdt_scan_reserved_mem(void)
 }
 
 /**
+ * early_init_fdt_reserve_self() - reserve the memory used by the FDT blob
+ */
+void __init early_init_fdt_reserve_self(void)
+{
+       if (!initial_boot_params)
+               return;
+
+       /* Reserve the dtb region */
+       early_init_dt_reserve_memory_arch(__pa(initial_boot_params),
+                                         fdt_totalsize(initial_boot_params),
+                                         0);
+}
+
+/**
  * of_scan_flat_dt - scan flattened tree blob and call callback on each.
  * @it: callback function
  * @data: context data pointer