From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A5F2C433F5 for ; Sat, 1 Jan 2022 18:46:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CBDDF83022; Sat, 1 Jan 2022 19:46:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=svenschwermer.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=svenschwermer.de header.i=@svenschwermer.de header.b="nlzBVzO/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5DD6C811B2; Sat, 1 Jan 2022 19:45:59 +0100 (CET) Received: from mail.schwermer.no (mail.schwermer.no [49.12.228.226]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D049A82F91 for ; Sat, 1 Jan 2022 19:45:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=svenschwermer.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sven@svenschwermer.de From: Sven Schwermer DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=svenschwermer.de; s=mail; t=1641062755; bh=VTKP2bvhU1m1VccnO15tmO6Ls5E3L0JWZyU1Dw/fKSU=; h=From:To:Cc:Subject:In-Reply-To:References; b=nlzBVzO/qoG97MJA9p+dTgHoyRlLZQOCbgsBpLGnrPUuugynfGlBl0XdLQzFAV3Da Oo4gM/P4ceoJNb+eLQYbCzqkqu9JMWrCUQ4ng+kXPk7BqWAj+2omCYcgllKZZROgg6 SdMcbh8oZaqdOdFf6PK8ePh9JYiDgGGPGyXDlrpvefk8mOawWOVSqlK3FDz30KyzzI 3Qk4de9Ytnz05AqGpDz2VFGhTiFsi5r+khMQeX12NNat0goyp568w7AwuK/gZla9DO tUOO+t/hNG5XPXgMMFefgFpOZR/5OrYjodX8h8ONp2Px8MEb92cVTVCGe8yg7v49iH aRUSJVBtM2bng== To: u-boot@lists.denx.de Cc: Sven Schwermer , Lukasz Majewski , Marek Vasut Subject: [PATCH v2 2/2] f_sdp: Retry sourcing default FIT script Date: Sat, 1 Jan 2022 19:45:40 +0100 Message-Id: <20220101184540.42491-2-sven@svenschwermer.de> In-Reply-To: <20220101184540.42491-1-sven@svenschwermer.de> References: <20220101184540.42491-1-sven@svenschwermer.de> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean "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 --- 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