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 472CFC433F5 for ; Mon, 3 Jan 2022 13:27:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 57D8C81C08; Mon, 3 Jan 2022 14:27:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=akkea.ca header.i=@akkea.ca header.b="p+r7SJot"; dkim=pass (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="lfe352Hv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7F40E8141B; Mon, 3 Jan 2022 14:27:43 +0100 (CET) Received: from node.akkea.ca (li1434-30.members.linode.com [45.33.107.30]) (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 E036582FC8 for ; Mon, 3 Jan 2022 14:27:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=angus@akkea.ca Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 2FB144E200C; Mon, 3 Jan 2022 13:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1641216457; bh=DRWmYogjcSRsg4aT7KY6mPnC/PYzHATgt9l/k4pjps8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=p+r7SJotSEgOH1uyd9/hulfdy/MKvn86zIlXCQyOOzSFjLEh2jFtKr8MGigQeqvjd xzfgiOwETUPjNc+5ToCM5fI4ofpSol5iOSWdyZMW97mBmFm0FVy5MOz5zPc788/3H7 yQCTNpZA5SeejQN+/6BIeXufbvjC7nm9NuwkjPTk= Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29W_VgqQFNco; Mon, 3 Jan 2022 13:27:36 +0000 (UTC) Received: from www.akkea.ca (li1434-30.members.linode.com [45.33.107.30]) by node.akkea.ca (Postfix) with ESMTPSA id 605B24E2006; Mon, 3 Jan 2022 13:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1641216456; bh=DRWmYogjcSRsg4aT7KY6mPnC/PYzHATgt9l/k4pjps8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=lfe352HvcelggHvkIfU82VyJtr4PH/PuhnKVg7fI72pnJhhhgighRMkaAGyWBqKGW HNIdt6GXVhybmC3RDRHa6bOJTvc5iC1sALcNCeYn3bse06xrtvJiTzLE72XlfHBHcT owqWrXbxJ+8HSPiMghX6K/hsSxH+9ocD3x+gY3lQ= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 03 Jan 2022 05:27:36 -0800 From: Angus Ainslie To: Sean Anderson Cc: Oleh Kravchenko , u-boot@lists.denx.de, Simon Glass , Patrick Delaunay , Roman Stratiienko , Marek Szyprowski , kernel@puri.sm Subject: Re: [PATCH v2 1/1] fastboot: fb_getvar: Add getvar_logical_blocksize for NXP mfgtool In-Reply-To: <7650f622-efe5-0907-5399-f7fb8ab4cb66@seco.com> References: <20211219161516.118636-1-angus@akkea.ca> <20211219161516.118636-2-angus@akkea.ca> <906fabbf-4297-8b03-ea39-6ea0109723aa@seco.com> <5f4413d03f81d7d7ba113d34b76a6749@akkea.ca> <7650f622-efe5-0907-5399-f7fb8ab4cb66@seco.com> Message-ID: X-Sender: angus@akkea.ca User-Agent: Roundcube Webmail/1.3.6 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 Hi Sean, On 2021-12-30 08:21, Sean Anderson wrote: > On 12/29/21 8:35 AM, Angus Ainslie wrote: >> Hi Sean, >> >> On 2021-12-28 08:59, Sean Anderson wrote: >>> Hi Angus, >>> >>>> NXP's mfgtool queies the mmc blocksize and splits a sparse image >>>> into >>>> blocksize size pieces for the upload. >>> >>> It's still not clear to me why this is necessary. fastboot (for >>> example) >>> transfers in blocks of max-download-size. Using the actual block size >>> seems like it would result in unnecessary overhead. >>> >> >> The version of uuu that we are using requires the block-size for the >> sparse upload >> >> https://source.puri.sm/Librem5/mfgtools/-/blob/pureos/amber/libuuu/fastboot.cpp#L501 >> >> It looks like the upstream version will default to 4096 if the >> block-size is not provided >> >> https://github.com/NXPmicro/mfgtools/blob/5397913ad97db422c1d70f314dedff4cb7d976b9/libuuu/fastboot.cpp#L642 >> >> Instead of making assumptions about the block size wouldn't it be >> better to provide one if requested ? > > The block size is for the sparse image. This determines the granularity > of the sections of the image. For example, if the block size is 1K, > then > all sizes will be multiples of 1K. So if you have a block with 1 byte > of > data and 1023 bytes of 0 then the whole block will be transferred > instead of being replaced with a fill block. > Thanks for the explanation on how it works. > However, the sparse file block size size completely orthogonal to > the block size of the device being written to. The only thing it > affects > is the efficiency of the sparse image. For example, I generate my > sparse > files with a block size of 1M, because it is a nice convenient number. > Ok so the way the NXP's uuu uses the blocksize is not correct. However the tool is already out there in the wild. Can we add the block-size response to support that tool or will it be required that uuu needs to be upgraded to work with mainline u-boot ? Thanks Angus > --Sean