public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sven Schwermer <sven@svenschwermer.de>
To: u-boot@lists.denx.de
Cc: Sven Schwermer <sven@svenschwermer.de>,
	Lukasz Majewski <lukma@denx.de>, Marek Vasut <marex@denx.de>
Subject: [PATCH v2 2/2] f_sdp: Retry sourcing default FIT script
Date: Sat,  1 Jan 2022 19:45:40 +0100	[thread overview]
Message-ID: <20220101184540.42491-2-sven@svenschwermer.de> (raw)
In-Reply-To: <20220101184540.42491-1-sven@svenschwermer.de>

"script@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@1" fails.
This implementation should be backward-compatible with existing ITS
files.

Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
---

Changes in v2:
- Fixed patman issues

 drivers/usb/gadget/f_sdp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index e48aa2f90d..d97c017d90 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -865,8 +865,13 @@ static int sdp_handle_in_ep(struct spl_image_info *spl_image)
 			spl_parse_image_header(&spl_image, header);
 			jump_to_image_no_args(&spl_image);
 #else
-			/* In U-Boot, allow jumps to scripts */
-			image_source_script(sdp_func->jmp_address, "script@1");
+			/*
+			 * In U-Boot, allow jumps to scripts. Run/retry with default
+			 * configuration if FIT is disabled or script@1 is not found.
+			 */
+			if (!IS_ENABLED(CONFIG_FIT) ||
+			    image_source_script(sdp_func->jmp_address, "script@1"))
+				image_source_script(sdp_func->jmp_address, NULL);
 #endif
 		}
 
-- 
2.34.1


  reply	other threads:[~2022-01-01 18:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-01 18:45 [PATCH v2 1/2] cmd: source: Use script from default config Sven Schwermer
2022-01-01 18:45 ` Sven Schwermer [this message]
2022-01-18 13:29 ` Tom Rini
2022-01-22 20:36   ` Sven Schwermer
2022-01-24 18:08     ` Tom Rini
2022-01-24 20:31       ` Sven Schwermer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220101184540.42491-2-sven@svenschwermer.de \
    --to=sven@svenschwermer.de \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox