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

2022-04-19 Thread Alban Bedel
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 
---
 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;
}
--
2.32.0


smime.p7s
Description: S/MIME cryptographic signature


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

2022-06-16 Thread Bedel, Alban
N¬ŠÆ§Kó0K"‚w™ë,j¸ó7ß^¼÷a8ïŽEPÁëÎ4÷¢æè¢Ùb²Ûz|]zæè¢Ùb²Ûz|]x ŸzË^½© 
™¨¥r‰ŸzË^½© 
™¨¥r‰®nŠ-ŠlgƗ(šæè¢Ø¦Æ|ir‰¬m¦âqקÅ׬m¦âqקÅג¹¸ÞrÔ^<Â)±²™Cyö®–ÛhHðð…
éÛ¢‹bžë¢eÇ«‰©]£  塧Cjד†íz&éöÓm´ó7ßí4Ó@¨ž×§´¶§‚æ 
yéÔH*'µéíO*^µìmþ™ZŠw!j»