All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] imx: spl: Default to SPD when booting from USB serial download
@ 2022-04-19  9:56 Alban Bedel
  2022-06-16  8:50 ` Bedel, Alban
  0 siblings, 1 reply; 2+ messages in thread
From: Alban Bedel @ 2022-04-19  9:56 UTC (permalink / raw)
  To: u-boot; +Cc: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Alban Bedel

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

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

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3627 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] imx: spl: Default to SPD when booting from USB serial download
  2022-04-19  9:56 [PATCH] imx: spl: Default to SPD when booting from USB serial download Alban Bedel
@ 2022-06-16  8:50 ` Bedel, Alban
  0 siblings, 0 replies; 2+ messages in thread
From: Bedel, Alban @ 2022-06-16  8:50 UTC (permalink / raw)
  To: u-boot; +Cc: festevam, uboot-imx, sbabic

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

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


[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3627 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-16  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19  9:56 [PATCH] imx: spl: Default to SPD when booting from USB serial download Alban Bedel
2022-06-16  8:50 ` Bedel, Alban

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.