Subject: [PATCH] arm: mm: init: update checks for Integrator boards to use the DT

From: Ethan Nelson-Moore <[email-masked]>
Date: Sat, 9 May 2026 14:14:19 -0700

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.

Signed-off-by: Ethan Nelson-Moore <[email-masked]>
---
 arch/arm/mm/init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 0cc1bf04686d..a44b16b3c273 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -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);
 }
 
-- 
2.43.0