[PATCH master 2/2] ARM: omap: fix cpu_is_omap on CONFIG_ARM_MULTIARCH configurations

Ahmad Fatoum a.fatoum at pengutronix.de
Tue May 20 05:17:38 PDT 2025


Normally, <mach/omap/generic.h> would only be included if we are running
on some OMAP SoC. This doesn't hold true anymore with CONFIG_ARM_MULTIARCH
or CONFIG_BOARD_ARM_GENERIC_DT, because we could have CONFIG_ARCH_AM33XX
enabled, but running on some other SoC, which the header doesn't know about.

This cpu_type scheme is only used on one other SoC and that's the i.MX
and there, there is a final #ifdef clause to fix this, so follow suit.

Reported-by: Roland Hieber <r.hieber at pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 include/mach/omap/generic.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/mach/omap/generic.h b/include/mach/omap/generic.h
index 2961c530bc93..9802087bf295 100644
--- a/include/mach/omap/generic.h
+++ b/include/mach/omap/generic.h
@@ -56,6 +56,15 @@ extern unsigned int __omap_cpu_type;
 # define cpu_is_am33xx()	(0)
 #endif
 
+#if defined(CONFIG_ARCH_MULTIARCH) || defined(CONFIG_BOARD_ARM_GENERIC_DT)
+# ifdef omap_cpu_type
+#  undef omap_cpu_type
+#  define omap_cpu_type __omap_cpu_type
+# else
+#  define omap_cpu_type 0
+# endif
+#endif
+
 #ifdef omap_cpu_type
 #define cpu_is_omap()			(omap_cpu_type > 0)
 #else
-- 
2.39.5




More information about the barebox mailing list