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

Alban Bedel alban.bedel at aerq.com
Tue Apr 19 11:56:14 CEST 2022


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 at 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;
 	}
-- 
2.32.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3627 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220419/ef1b156c/attachment.bin>


More information about the U-Boot mailing list