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 55B3AC433EF for ; Wed, 6 Apr 2022 05:33:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E67E083CA3; Wed, 6 Apr 2022 07:33:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1649223202; bh=wes4WXpYp7fD9eaNkf/t/jbwpUefRIUwU3i43DHuwwE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XjoCB6PKyYl4SYUq7XfRW9a+SpDdZwF6Kymfs7JpIKRYlIoG6FcxoV6KmeFmp5CBy fhM7IelWky5xv4JDgIzckS9Z61nbwb/kq+iE+cQAMIn1i7NHP8REJrhMSf5yDiXU2p SPaaaQB+JHbhM1OTBPX7ST9tpcXw/k1r5AHfz4iemka5nMtIptRhumvXe1fZz7Bg4l c1ippv2RPP2Ag6XmKG9CurDzimeqxmv0HKqlK8p6sHbkRqLLZX638eGCmD2igvPvED 5miXC9ncjFOjqA5O5hnkLCiHyj+xLZxfA0+s4pXvYhJdGk1m6JjakUqf4UrQRcaE3N vysRdwwGyTMBw== Received: by phobos.denx.de (Postfix, from userid 109) id C5F0B83C35; Wed, 6 Apr 2022 07:33:18 +0200 (CEST) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [91.198.250.252]) (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 F371483C9E for ; Wed, 6 Apr 2022 07:33:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:105:465:1:4:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4KYCpc2t7gz9sRB; Wed, 6 Apr 2022 07:33:12 +0200 (CEST) Message-ID: Date: Wed, 6 Apr 2022 07:33:04 +0200 MIME-Version: 1.0 Subject: Re: [RFC PATCH 6/7] spl: Convert nor to spl_load Content-Language: en-US To: Sean Anderson , Simon Glass Cc: =?UTF-8?Q?Marek_Beh=c3=ban?= , u-boot@lists.denx.de, Marek Vasut , =?UTF-8?Q?Pali_Roh=c3=a1r?= References: <20220401190405.1932697-1-sean.anderson@seco.com> <20220401190405.1932697-7-sean.anderson@seco.com> From: Stefan Roese In-Reply-To: <20220401190405.1932697-7-sean.anderson@seco.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean On 4/1/22 21:04, Sean Anderson wrote: > This converts the nor load method to use spl_load. As a result it also > adds support LOAD_FIT_FULL. > > Signed-off-by: Sean Anderson Reviewed-by: Stefan Roese Thanks, Stefan > --- > > common/spl/spl_nor.c | 35 ++++++----------------------------- > 1 file changed, 6 insertions(+), 29 deletions(-) > > diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c > index 0f4fff8493..90ece77af1 100644 > --- a/common/spl/spl_nor.c > +++ b/common/spl/spl_nor.c > @@ -26,8 +26,11 @@ unsigned long __weak spl_nor_get_uboot_base(void) > static int spl_nor_load_image(struct spl_image_info *spl_image, > struct spl_boot_device *bootdev) > { > - __maybe_unused const struct image_header *header; > - __maybe_unused struct spl_load_info load; > + struct image_header *header = (void *)spl_nor_get_uboot_base(); > + struct spl_load_info load = { > + .bl_len = 1, > + .read = spl_nor_load_read, > + }; > > /* > * Loading of the payload to SDRAM is done with skipping of > @@ -91,32 +94,6 @@ static int spl_nor_load_image(struct spl_image_info *spl_image, > * Load real U-Boot from its location in NOR flash to its > * defined location in SDRAM > */ > -#ifdef CONFIG_SPL_LOAD_FIT > - header = (const struct image_header *)spl_nor_get_uboot_base(); > - if (image_get_magic(header) == FDT_MAGIC) { > - debug("Found FIT format U-Boot\n"); > - load.bl_len = 1; > - load.read = spl_nor_load_read; > - return spl_load_simple_fit(spl_image, &load, > - spl_nor_get_uboot_base(), > - (void *)header); > - } > -#endif > - if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER)) { > - load.bl_len = 1; > - load.read = spl_nor_load_read; > - return spl_load_imx_container(spl_image, &load, > - spl_nor_get_uboot_base()); > - } > - > - /* Legacy image handling */ > - if (IS_ENABLED(CONFIG_SPL_LEGACY_IMAGE_SUPPORT)) { > - load.bl_len = 1; > - load.read = spl_nor_load_read; > - return spl_load_legacy_img(spl_image, bootdev, &load, > - spl_nor_get_uboot_base()); > - } > - > - return 0; > + return spl_load(spl_image, bootdev, &load, header, 0, 0); > } > SPL_LOAD_IMAGE_METHOD("NOR", 0, BOOT_DEVICE_NOR, spl_nor_load_image); Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de