diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2023-03-01 14:18:42 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-03-07 10:39:30 +0100 |
commit | 561b373d7f7378a1f4d09f02c9f4832455f702a4 (patch) | |
tree | 379518bec6cf0f014d866c95aac0d1d7b7ccec39 /arch/arm/mach-omap | |
parent | 4e8f4c9b27cd5282e412bdd0facf5cbe3ec6a1ab (diff) | |
download | barebox-561b373d7f7378a1f4d09f02c9f4832455f702a4.tar.gz barebox-561b373d7f7378a1f4d09f02c9f4832455f702a4.tar.xz |
ARM: omap: Make multi-arch safe
Make sure the initcalls do not execute on foreign SoCs.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap')
-rw-r--r-- | arch/arm/mach-omap/omap_generic.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap/xload.c | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c index 59c1ce7666..36f2e80af2 100644 --- a/arch/arm/mach-omap/omap_generic.c +++ b/arch/arm/mach-omap/omap_generic.c @@ -113,6 +113,9 @@ static struct image_handler omap_barebox_handler = { static int omap_bootm_barebox(void) { + if (!cpu_is_omap()) + return 0; + return register_image_handler(&omap_barebox_handler); } device_initcall(omap_bootm_barebox); @@ -141,6 +144,9 @@ static int omap_env_init(void) struct cdev *cdev; const char *rootpath; + if (!cpu_is_omap()) + return 0; + if (bootsource_get() != BOOTSOURCE_MMC) return 0; @@ -203,7 +209,7 @@ static int omap_init(void) if (root) { __omap_cpu_type = omap_soc_from_dt(); if (!__omap_cpu_type) - hang(); + return 0; } if (cpu_is_omap3()) diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c index e61e2ce652..e632b53788 100644 --- a/arch/arm/mach-omap/xload.c +++ b/arch/arm/mach-omap/xload.c @@ -355,6 +355,9 @@ int omap_set_barebox_part(struct omap_barebox_part *part) static int omap_set_xload(void) { + if (!cpu_is_omap()) + return 0; + barebox_main = omap_xload; return 0; |