Skip to contentSkip to conversation

arm: mm: init: update checks for Integrator boards to use the DT

PATCH New Ethan Nelson-Moore 1 participant 1 message May 9 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mm: init: update checks for Integrator boards to use the DT

arch/arm/mm/init.c contains two checks for ARM machine IDs via machine_is_*() macros. The two boards concerned now support only FDT booting, which does not use machine IDs, and therefore the code should be updated to check the DT compatible property instead. Non-DT booting support for these machines was removed in commit d7057e1de8d6 ("ARM: integrator: delete non-devicetree boot path"). The presence of these machine ID checks prevents the removal of machine IDs no longer used by the kernel from arch/arm/tools/mach-types, because the machine_is_*() macros are generated from mach-types. To resolve this issue, use of_machine_is_compatible() instead.

---
 arch/arm/mm/init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mm/init.c +3 -2
index 0cc1bf04686d..a44b16b3c273 100644
@@ -14,6 +14,7 @@
 #include <linux/export.h>
 #include <linux/nodemask.h>
 #include <linux/initrd.h>
+#include <linux/of.h>
 #include <linux/of_fdt.h>
 #include <linux/highmem.h>
 #include <linux/gfp.h>
@@ -25,7 +26,6 @@
 #include <linux/execmem.h>
 
 #include <asm/cp15.h>
-#include <asm/mach-types.h>
 #include <asm/memblock.h>
 #include <asm/page.h>
 #include <asm/prom.h>
@@ -415,7 +415,8 @@ void free_initmem(void)
 	fix_kernmem_perms();
 
 	poison_init_mem(__init_begin, __init_end - __init_begin);
-	if (!machine_is_integrator() && !machine_is_cintegrator())
+	if (!of_machine_is_compatible("arm,integrator-ap") &&
+	    !of_machine_is_compatible("arm,integrator-cp"))
 		free_initmem_default(-1);
 }
 
Signature · 1 line
2.43.0