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 13FF7C433F5 for ; Thu, 7 Apr 2022 15:10:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 29007803C8; Thu, 7 Apr 2022 17:10:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=seco.com 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=seco.com header.i=@seco.com header.b="2IPQOtFu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2201E803C8; Thu, 7 Apr 2022 17:10:28 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2060e.outbound.protection.outlook.com [IPv6:2a01:111:f400:7d00::60e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BFB20803C8 for ; Thu, 7 Apr 2022 17:10:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=seco.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sean.anderson@seco.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NWHpAw81QeZNTZ+XhMHZ8UcQ1MQtI1I1UqPr/by0ylfbk42077c97dwEKwcJLXpMYVUt3abS2SNtmQ/y47PFxApkat62H9mey3+Z+gJTwBfvBryausAYlYdiEEGWY9Ci9qoANCDWScBLTrvibAL6ZZ55EUUoDjQ2UlP2OwS+hpkRg1y6GC5OO+GVIIU/Qz/dhcbLrF7ICAubKcPNiR8rDFxx+qxxGMnF95lNvB0t6x0M++DKnIxWPHZYRq1o7ym5M3SKzBChS/So+ACJMHtcTogpzdoGUurwO/1fl1E1/rw2G8pVidKlD0yTatwBYCI7BuWE2lezFpCW5AbPSOiRZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sK4uzOcIFVqF5iGjL8O7TGYorM04+BISpN9IlQ5nwHM=; b=gAOyFAQV4R5j1ladDgOH+lWl/NizkpVpLJjKTKG+XGxkJbotdUOVRhZn7cxSllfF0rf6sd7XqXnCTvYHANZDJQUxrJSG6hFRgQxumLA8nMXWOd7ZT9AB1EOWm30a++TvGrXVGipe8Wt56dWGBT4T/rhZrINWZxWU3KUfikv4Mt2XqpQKukoTmUJna2PkTsPPRgPKsGrA4O9bWQR7MBoG+VkEM7BLIauxglNeXRXYbOLZTqNVbf32atqQ7ovsTFP5VR21kOEeyeSmPWWRAwFGtJaigR66uQO5AUdVHpZVeUixeHrHl0InFYl1SZ7lK2NgtlH30BnF5/TDMR6LigeZuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sK4uzOcIFVqF5iGjL8O7TGYorM04+BISpN9IlQ5nwHM=; b=2IPQOtFuCOc+s9jsp/szqXp1QC9ZLWO32jUl7aQJ0R8DLY1uAwWDlLBLyYovX00LarjHzJo1HbvLVax3v58XF+HAUA3z2EC1Mko32+PrW3CNVoYXudaV7zHKVShzGFGrEH9JHNTIVGj089EHiKHCB2vO8OGF9ZOtpEip0Au5yOB8oCArjuJpLN1JPnFnXPjUHi/mLuN5DU0KJq2pWTlbW3ZW6modkNu7uVvfAU9V0VQecrsu83n+KTblnLxCOFcDes67n2ZDse36ADJ9G0APQkPCRxnZnC8jT3iQgSJ05rTGvTPA7MLrW9VwmlU8u0hy0ett4stdpywI8QpxXKafwg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by AM7PR03MB6578.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Thu, 7 Apr 2022 15:10:22 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::fd2d:a04b:de07:33f8]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::fd2d:a04b:de07:33f8%6]) with mapi id 15.20.5144.019; Thu, 7 Apr 2022 15:10:22 +0000 Subject: Re: [RFC PATCH 1/7] spl: Add generic spl_load function To: Stefan Roese , 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-2-sean.anderson@seco.com> <0bc5fabd-1af1-05f4-f46b-d74747785b1c@denx.de> From: Sean Anderson Message-ID: Date: Thu, 7 Apr 2022 11:10:17 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: <0bc5fabd-1af1-05f4-f46b-d74747785b1c@denx.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MN2PR11CA0028.namprd11.prod.outlook.com (2603:10b6:208:23b::33) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6fe9aa5-f665-418b-6011-08da18a8bc98 X-MS-TrafficTypeDiagnostic: AM7PR03MB6578:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EIQOxNwHR6EgFgSXyOQT/onelOgQqiP4JkrC5ya/34YI/2l+AUMAKduGx/dRagq2ERo7ScRWocTyuzxlDEWQE7ppJW5yCi8KZOgpjEdRfvbOfMHyDPsSqb4oqGz+xKOFx9LscRjyq9/w8X3tzforuRrSOXqmNQXbdd1dJdMdjqdmHFpx5IAOxsE8mCvGqC2ACWIMC4WAempT/L+MJPOVocB+Kfd1vbMQa7KpNFFvZv+6cr/yLS6ZpgatAyVl3ePYsfnSMA512PvE2boczPCm7cSUYFbjuaVqAD4bvhXm3g4yOOn5EGmg73rjISyOewuCzR5Yc1jn/Ezu5Grl8304A2y2OPMGWoky3lW9chKlLtqGEyDECrmF2/oNFLLr6u1IKxH/zCRdP+7alI5yyfkpB99P61RTzqIxBw/lYGzDSprlJmAK1cmEipM7atM/QHPNROhLbYKb7Hve0Pr84e01nfWbaNVF8QdpNoFUYckmZNzKP5cLF/fmXo80ypDDYU9TiSkUoXBs0vwuRz8JnDI+I+MKwfgjkNXRpPt5572hJLKT30/BqPkV11J6E0iL7zxe112U+Ht+o3RLAd53jUhnBtLaLudJ2X4N7Vm6S2xFMagm35tYUkbki6fYm8wNq0+e1Z739e+ZVjoJI46Skb5Vba+3PRlpry/RIzu+UjETh3pZlm/pX9ozMJb5/DW83xmymc6Gus5mns+IoFVFEDszITB+hIq7lrPURkjBYZuNb6Pn/pX+ZbMu4QZXAbWTrpTQw7vLVrU4MnoNNShiRBNJjJJkGKEh2JRg3/OQSb0dFew= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4972.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(53546011)(2906002)(6506007)(26005)(186003)(52116002)(5660300002)(316002)(6512007)(44832011)(31686004)(38100700002)(31696002)(38350700002)(86362001)(2616005)(36756003)(4326008)(8676002)(8936002)(508600001)(54906003)(6666004)(110136005)(66476007)(6486002)(83380400001)(66946007)(66556008)(41533002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TmpZOEsvWlJZZHNWcC9TNU5MZURNZGdYM2l0elo5dE9kV0ltQ1ZlL3R1Vkg1?= =?utf-8?B?T2orSTR2YitrakRTSkZLcUVoMWVHcFh6NzJtaHNFVHFVOEJEdWpYZ3VvY0p2?= =?utf-8?B?aUNpc2k0NzB3ZE1hRFcyS0hIQnoxWjdha085bStpOTRodFQzRFFPdVRRSXRC?= =?utf-8?B?M2I3TjNsaXVNS0cxQzZieWtRc3lFL1Q5WDRtdVpoT1E1ck9Ib3dub0tsSnhp?= =?utf-8?B?a2tvcDlvM3BwSDk3MDZLUkgwVms5MUF1aXNicS9IYWVyT05lVVJLOEpla3Uz?= =?utf-8?B?T1RaWjkvc2RHT2hnUThBU3V3UXhtRzFFTklmK2pPcUtmckFLK2NMOTJGY2Ja?= =?utf-8?B?NkxTSjhSMStUMXdiSVplb1NxSlc4R29xMncxZ1lNRmtQRkFqQ011eVl1K2ho?= =?utf-8?B?Q1hxbzZGc1VsOWw4RjlRRDZLSU5DbGVmWUM3TnkwMFhIbndlMnQ3Z2pmTERU?= =?utf-8?B?QURhMUxGdXVjNnN6QjNtM3NFRlJKYWZFMFhtakdEbXFyMHBPWjl2S21GU2tn?= =?utf-8?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YNlY2czJtTERwYTk3M1Bhd1NM?= =?utf-8?Q?Gt1u6U48d7qbjv6E=3D?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6fe9aa5-f665-418b-6011-08da18a8bc98 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2022 15:10:22.5271 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7PQkuy5/r1WBQQLneAHlKvWu6cP+fNnPTFyUjWe/hsql8ms1MXNkwCQ0pUeIH0HqDH73UNRsn3T/DmweRH1eqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR03MB6578 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/6/22 1:30 AM, Stefan Roese wrote: > On 4/1/22 21:03, Sean Anderson wrote: >> Implementers of SPL_LOAD_IMAGE_METHOD have to correctly determine what >> type of image is being loaded and then call the appropriate image load >> function correctly. This is tricky, because some image load functions >> expect the whole image to already be loaded (CONFIG_SPL_LOAD_FIT_FULL), >> some will load the image automatically using spl_load_info.read() >> (CONFIG_SPL_LOAD_FIT/CONFIG_SPL_LOAD_IMX_CONTAINER), and some just parse >> the header and expect the caller to do the actual loading afterwards >> (legacy/raw images). Load methods often only support a subset of the >> above methods, meaning that not all image types can be used with all >> load methods. Further, the code to invoke these functions is >> duplicated between different load functions. >> >> To address this problem, this commit introduces a "spl_load" function. >> It aims to handle image detection and correct invocation of each of the >> parse/load functions. spl_simple_read is a wrapper around >> spl_load_info.read with get_aligned_image* functions inlined for size >> purposes. Additionally, we assume that bl_len is a power of 2 so we can >> do bitshifts instead of divisions (which is smaller and faster). >> >> Signed-off-by: Sean Anderson >> --- >> >>   common/spl/spl.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ >>   include/spl.h    | 30 +++++++++++++++++++++++- >>   2 files changed, 90 insertions(+), 1 deletion(-) >> >> diff --git a/common/spl/spl.c b/common/spl/spl.c >> index b452d4feeb..f26df7ac3f 100644 >> --- a/common/spl/spl.c >> +++ b/common/spl/spl.c >> @@ -398,6 +398,67 @@ int spl_parse_image_header(struct spl_image_info *spl_image, >>       return 0; >>   } >>   +static int spl_simple_read(struct spl_load_info *info, void *buf, size_t size, >> +               size_t offset) >> +{ >> +    int ret; >> +    size_t bl_len = info->filename ? ARCH_DMA_MINALIGN : bl_len; >> +    size_t bl_mask = bl_len - 1; >> +    size_t bl_shift = ffs(bl_mask); >> +    size_t overhead = offset & bl_mask; >> + > > Nitpicking comment: > > It's preferred in general to use the reverse XMAS tree ordering of the > declared variables. So I would expect at least to have "int ret" as > last statement above. If you address this, then please in the complete > series. I thought only Linux's net subsystem had this requirement. I can reorder things for you if you'd like. However, some of these variables have dependencies so they cannot all be reordered :) --Sean > Reviewed-by: Stefan Roese > > Thanks, > Stefan > >> +    buf -= overhead; >> +    size = (size + overhead + bl_mask) >> bl_shift; >> +    offset = offset >> bl_shift; >> + >> +    ret = info->read(info, offset, size, buf); >> +    return ret == size ? 0 : -EIO; >> +} >> + >> +int spl_load(struct spl_image_info *spl_image, >> +         const struct spl_boot_device *bootdev, struct spl_load_info *info, >> +         struct image_header *header, size_t size, size_t sector) >> +{ >> +    int ret; >> +    size_t offset = sector * info->bl_len; >> + >> +    if (image_get_magic(header) == FDT_MAGIC) { >> +        if (IS_ENABLED(CONFIG_SPL_LOAD_FIT_FULL)) { >> +            void *buf; >> + >> +            /* >> +             * In order to support verifying images in the FIT, we >> +             * need to load the whole FIT into memory. Try and >> +             * guess how much we need to load by using the total >> +             * size. This will fail for FITs with external data, >> +             * but there's not much we can do about that. >> +             */ >> +            if (!size) >> +                size = roundup(fdt_totalsize(header), 4); >> +            buf = spl_get_load_buffer(0, size); >> +            ret = spl_simple_read(info, buf, size, offset); >> +            if (ret) >> +                return ret; >> + >> +            return spl_parse_image_header(spl_image, bootdev, buf); >> +        } >> + >> +        if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) >> +            return spl_load_simple_fit(spl_image, info, sector, >> +                           header); >> +    } >> + >> +    if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER)) >> +        return spl_load_imx_container(spl_image, info, sector); >> + >> +    ret = spl_parse_image_header(spl_image, bootdev, header); >> +    if (ret) >> +        return ret; >> + >> +    return spl_simple_read(info, (void *)spl_image->load_addr, >> +                   spl_image->size, offset + spl_image->offset); >> +} >> + >>   __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) >>   { >>       typedef void __noreturn (*image_entry_noargs_t)(void); >> diff --git a/include/spl.h b/include/spl.h >> index 8ceb3c0f09..6606f4e5f6 100644 >> --- a/include/spl.h >> +++ b/include/spl.h >> @@ -236,7 +236,7 @@ struct spl_image_info { >>    * >>    * @dev: Pointer to the device, e.g. struct mmc * >>    * @priv: Private data for the device >> - * @bl_len: Block length for reading in bytes >> + * @bl_len: Block length for reading in bytes; must be a power of 2 >>    * @filename: Name of the fit image file. >>    * @read: Function to call to read from the device >>    */ >> @@ -608,6 +608,34 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image, >>                 struct spl_boot_device *bootdev, >>                 struct blk_desc *block_dev, int partition); >>   +/** >> + * spl_load() - Parse a header and load the image >> + * @spl_image: Image data which will be filled in by this function >> + * @bootdev: The device to load from >> + * @info: Describes how to load additional information from @bootdev. At the >> + *        minimum, read() and bl_len must be populated. >> + * @header: The image header. This should already have been loaded. It may be >> + *          clobbered by the load process (if e.g. the load address overlaps). >> + * @size: The size of the image, if it is known in advance. Some boot devices >> + *        (such as filesystems) know how big an image is before parsing the >> + *        header. If this information is unknown, then the size will be >> + *        determined from the header. >> + * @sectors: The offset from the start if @bootdev, in units of @info->bl_len. >> + *           This should have the offset @header was loaded from. It will be >> + *           added to any offsets passed to @info->read(). >> + * >> + * This function determines the image type (FIT, legacy, i.MX, raw, etc), calls >> + * the appropriate parsing function, determines the load address, and the loads >> + * the image from storage. It is designed to replace ad-hoc image loading which >> + * may not support all image types (especially when config options are >> + * involved). >> + * >> + * Return: 0 on success, or a negative error on failure >> + */ >> +int spl_load(struct spl_image_info *spl_image, >> +         const struct spl_boot_device *bootdev, struct spl_load_info *info, >> +         struct image_header *header, size_t size, size_t sector); >> + >>   /** >>    * spl_early_init() - Set up device tree and driver model in SPL if enabled >>    * > > Viele Grüße, > Stefan Roese >