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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E8DEC6377D for ; Thu, 22 Jul 2021 08:50:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 014D56135D for ; Thu, 22 Jul 2021 08:50:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 014D56135D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 38DD382991; Thu, 22 Jul 2021 10:50:32 +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=1626943832; bh=ZlpWl/h0u97B9EvyEie1/ae1l3PAvCkBOGBREIvyfmI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BF1mqQwirJozdTGK/jfmdRHdHSC1dNQzHwopfJbrIHmDnPpEE9LuqcZHrkKTMiKeD EuioIfR28HWFalKe1QYD+2xY5IBqD+9e/JDFlpM5nvXyQvw0iasGiJt2g0tkx/z/eU Em7UzS1f2JmDUNFO/uX1nIquvqnFvuuc/g8CgKEy6Mlj9vEFqTS+19cDlHRAiJyYle 5UVn1FRu1ja/KMxPoPJpAoDJSfFiJXyOQhzQHFs4L5KVM962eD/h6/af+/cNDIXj3W DIVj3DIQPP3ulLhnCnB8yjDvk7nKpSdDx2XcvcWe/O0Eg2vS3cUaqEg9OdJaHctLNS FfX2nZTwvrr3g== Received: by phobos.denx.de (Postfix, from userid 109) id 453F1829EC; Thu, 22 Jul 2021 10:50:30 +0200 (CEST) Received: from mout-u-205.mailbox.org (mout-u-205.mailbox.org [91.198.250.254]) (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 273BB82991 for ; Thu, 22 Jul 2021 10:50:27 +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 smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (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-205.mailbox.org (Postfix) with ESMTPS id 4GVmPH0FZGzQkFn; Thu, 22 Jul 2021 10:50:27 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id XE88np0sOa71; Thu, 22 Jul 2021 10:50:21 +0200 (CEST) Subject: Re: [PATCH u-boot-mvebu v2 34/41] SPL: Add support for parsing board / BootROM specific image types To: =?UTF-8?Q?Marek_Beh=c3=ban?= , u-boot@lists.denx.de, Chris Packham , Baruch Siach , Dirk Eibach , Chris Packham Cc: Dennis Gilmore , Mario Six , Jon Nettleton , =?UTF-8?Q?Pali_Roh=c3=a1r?= References: <20210719122104.29698-1-marek.behun@nic.cz> <20210719122104.29698-35-marek.behun@nic.cz> From: Stefan Roese Message-ID: Date: Thu, 22 Jul 2021 10:50:18 +0200 MIME-Version: 1.0 In-Reply-To: <20210719122104.29698-35-marek.behun@nic.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A07418C0 X-Rspamd-UID: dbd384 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 On 19.07.21 14:20, Marek Behún wrote: > From: Pali Rohár > > Platform specific BootROM may use its own image type for loading SPL or > main U-Boot binary. In some cases it makes sense to not use BootROM > supplied code for booting main U-Boot binary but rather to use U-Boot SPL > to load main U-Boot binary, e.g. when U-Boot SPL can load main U-Boot > binary faster than BootROM. In this case it is required for platform board > code to parse and load U-Boot in BootROM specific image type. > > This change adds support for parsing platform / board / BootROM specific > image types via weak function spl_parse_board_header() which is called > before marking boot image as a raw. > > Signed-off-by: Pali Rohár > Reviewed-by: Marek Behún Reviewed-by: Stefan Roese Thanks, Stefan > --- > common/spl/spl.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/common/spl/spl.c b/common/spl/spl.c > index eba77cace6..555045eaf2 100644 > --- a/common/spl/spl.c > +++ b/common/spl/spl.c > @@ -296,6 +296,12 @@ static int spl_load_fit_image(struct spl_image_info *spl_image, > } > #endif > > +__weak int spl_parse_board_header(struct spl_image_info *spl_image, > + const void *image_header, size_t size) > +{ > + return -EINVAL; > +} > + > __weak int spl_parse_legacy_header(struct spl_image_info *spl_image, > const struct image_header *header) > { > @@ -348,6 +354,9 @@ int spl_parse_image_header(struct spl_image_info *spl_image, > } > #endif > > + if (!spl_parse_board_header(spl_image, (const void *)header, sizeof(*header))) > + return 0; > + > #ifdef CONFIG_SPL_RAW_IMAGE_SUPPORT > /* Signature not found - assume u-boot.bin */ > debug("mkimage signature not found - ih_magic = %x\n", > Viele Grüße, Stefan -- 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