[PATCH] imx: spl: Default to SPD when booting from USB serial download

On the iMX platforms the USB boot is in fact boot from USB serial download and not from a USB mass storage. So returning BOOT_DEVICE_USB typically doesn't make sense as USB SPD is then used to continue booting, for this we need to return BOOT_DEVICE_BOARD.
Still return BOOT_DEVICE_USB when USB mass storage support has been built in the SPL. With USB-C on both side, the programmer could switch back to device mode and use the exposed mass storage device after the serial download finished.
Signed-off-by: Alban Bedel alban.bedel@aerq.com --- arch/arm/mach-imx/spl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index 64ca29677212..2c2b2b126ad7 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -177,7 +177,8 @@ u32 spl_boot_device(void) case QSPI_BOOT: return BOOT_DEVICE_NOR; case USB_BOOT: - return BOOT_DEVICE_USB; + return IS_ENABLED(CONFIG_SPL_USB_STORAGE) ? + BOOT_DEVICE_USB : BOOT_DEVICE_BOARD; default: return BOOT_DEVICE_NONE; }

On Tue, 2022-04-19 at 11:56 +0200, Alban Bedel wrote:
On the iMX platforms the USB boot is in fact boot from USB serial download and not from a USB mass storage. So returning BOOT_DEVICE_USB typically doesn't make sense as USB SPD is then used to continue booting, for this we need to return BOOT_DEVICE_BOARD.
Still return BOOT_DEVICE_USB when USB mass storage support has been built in the SPL. With USB-C on both side, the programmer could switch back to device mode and use the exposed mass storage device after the serial download finished.
Can this patch please be considered? It still apply as is on master.
Alban
participants (2)
-
Alban Bedel
-
Bedel, Alban