summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2023-03-01 14:13:48 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2023-03-07 10:39:30 +0100
commit4e8f4c9b27cd5282e412bdd0facf5cbe3ec6a1ab (patch)
tree2bb89b59de51ce38d88b905fab84aab007e11e43 /arch/arm/mach-omap
parentc041311a5f64ac5222066cf6615cead91695c91c (diff)
downloadbarebox-4e8f4c9b27cd5282e412bdd0facf5cbe3ec6a1ab.tar.gz
barebox-4e8f4c9b27cd5282e412bdd0facf5cbe3ec6a1ab.tar.xz
ARM: omap: usbboot: Enable USB communication when needed
Instead of activating USB communication unconditionally in an initcall, let the users activate it once they need it. This gets us rid of an initcall that is not protected against running 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/omap4_rom_usb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mach-omap/omap4_rom_usb.c b/arch/arm/mach-omap/omap4_rom_usb.c
index a3e447128f..01c5565a68 100644
--- a/arch/arm/mach-omap/omap4_rom_usb.c
+++ b/arch/arm/mach-omap/omap4_rom_usb.c
@@ -46,6 +46,9 @@ int omap4_usbboot_open(void)
int n;
u32 base;
+ if (omap4_usbboot_ready())
+ return 0;
+
if (omap4_revision() >= OMAP4460_ES1_0)
base = PUBLIC_API_BASE_4460;
else
@@ -82,7 +85,6 @@ int omap4_usbboot_open(void)
omap4_usbboot_puts("USB communications initialized\n");
return 0;
}
-core_initcall(omap4_usbboot_open);
int omap4_usbboot_ready(void){
return omap4_usbboot_data.ready;