[PATCH 2/2] f_sdp: Retry sourcing default FIT script

Sven Schwermer sven at svenschwermer.de
Fri Dec 31 15:11:39 CET 2021

"script at 1" is not a valid node name if the "reg" property is missing.
The yocto build system embeds the boot script as an image that's pointed
to by the "bootscr" property within the default configuration. That is
what we use here as the fallback when sourcing the "script at 1" fails.
This implementation should be backward-compatible with existing ITS

Signed-off-by: Sven Schwermer <sven at svenschwermer.de>
 drivers/usb/gadget/f_sdp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index e48aa2f90d..2eb85aa8a6 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -866,7 +866,11 @@ static int sdp_handle_in_ep(struct spl_image_info *spl_image)
 			/* In U-Boot, allow jumps to scripts */
-			image_source_script(sdp_func->jmp_address, "script at 1");
+#if defined(CONFIG_FIT)
+			if (image_source_script(sdp_func->jmp_address, "script at 1"))
+				/* Retry with default configuration script */
+				image_source_script(sdp_func->jmp_address, NULL);

More information about the U-Boot mailing list