diff mbox series

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

Message ID 20220419095614.88472-1-alban.bedel@aerq.com
State Superseded
Delegated to: Stefano Babic
Headers show
Series imx: spl: Default to SPD when booting from USB serial download | expand

Commit Message

Bedel, Alban April 19, 2022, 9:56 a.m. UTC
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(-)

Comments

Bedel, Alban June 16, 2022, 8:50 a.m. UTC | #1
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
diff mbox series

Patch

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;
 	}