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=-8.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 17635C4338F for ; Sun, 1 Aug 2021 14:46:45 +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 4A6C4610A1 for ; Sun, 1 Aug 2021 14:46:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4A6C4610A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4005F832B1; Sun, 1 Aug 2021 16:46:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="lz+7pfvk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 63816832B7; Sun, 1 Aug 2021 16:46:40 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 BFE15832B1 for ; Sun, 1 Aug 2021 16:46:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id C3A1060F5A; Sun, 1 Aug 2021 14:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627829194; bh=j7pcYIUJiCPfhPCuATsQVm7udinXw61/7pQLzqU/z1M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lz+7pfvkquVDfg6g8HuHK7843JcD2ij68K3t+jn01rcYNd1HZJ0pyLy4oT8SOIohi f9RMzZ33FJj2PpqYSs3RKaGLXpJsekibgoH/g6emErjazTttxYmSAKar0LxLTDMQB4 jF21MH+wL8CpewSVqMgqoW3yVtracvdkIv8VCZxGO/A36S3iXuB3Rvj3zg/Ubgh+kN Hu4Piajk8p2ZGYbNgCP1wYPVtEMwXwDXBzulgaL017iECDCRIhyIdq2obWj7uhyo7l hfM+uMGN5psGUgFsyeqknBQiXHAUASXR059gxAaQD5X+jr/bulSU9ONflfs5wNiu45 X3SNXth5kM3Bg== Received: by pali.im (Postfix) id 84E5BEF9; Sun, 1 Aug 2021 16:46:31 +0200 (CEST) Date: Sun, 1 Aug 2021 16:46:31 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Tom Rini Cc: Stefan Roese , U-Boot Mailing List Subject: Re: Please pull u-boot-marvell/master Message-ID: <20210801144631.7r33bkbgp4af35ln@pali> References: <013c0841-58ff-1706-d52f-32b43e0e26bd@denx.de> <20210801032847.GK9379@bill-the-cat> <20210801104649.tkfal5jykph5k2pk@pali> <20210801143333.GM9379@bill-the-cat> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210801143333.GM9379@bill-the-cat> User-Agent: NeoMutt/20180716 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 Sunday 01 August 2021 10:33:33 Tom Rini wrote: > On Sun, Aug 01, 2021 at 12:46:49PM +0200, Pali Rohár wrote: > > On Sunday 01 August 2021 07:26:51 Stefan Roese wrote: > > > On 01.08.21 05:28, Tom Rini wrote: > > > > On Sat, Jul 31, 2021 at 12:04:01PM +0200, Stefan Roese wrote: > > > > > > > > > Hi Tom, > > > > > > > > > > please pull the next batch of Marvell MVEBU related patches. Here the > > > > > summary log: > > > > > > > > First off, I've applied the whole series to u-boot/master and pushed. > > > > > > > > Second, I see from: > > > > commit 5fce2875569d6e859443af7af3477c3aebfee383 > > > > Author: Pali Rohár > > > > Date: Fri Jul 23 11:14:27 2021 +0200 > > > > > > > > SPL: Add support for specifying offset between header and image > > > > > > > > That a number of boards are now doing: > > > > variscite_dart6ul: spl/u-boot-spl:all +144 spl/u-boot-spl:text +144 > > > > spl-u-boot-spl: add: 3/0, grow: 2/-1 bytes: 142/-4 (138) > > > > function old new delta > > > > memmove - 42 +42 > > > > spl_mmc_load 320 356 +36 > > > > __aeabi_uidivmod - 24 +24 > > > > __aeabi_idivmod - 24 +24 > > > > spl_parse_image_header 24 40 +16 > > > > board_init_r 220 216 -4 > > > > > > > > Which I think is because we need to use do_div and so rather than '/' and '%' > > > > directly in the code. Thanks! > > > > > > Pali, could you please take a look at this? > > > > And what we can do here? 32-bit arm does not have 32-bit division > > instruction, so it is needed to use some sort of *idiv* function. > > > > do_div() is macro which is doing 64-bit division by using 32-bit C > > operations '/' and '%', therefore it does not help with anything as this > > code is doing 32-bit math (not 64-bit). > > > > Moreover in do_div() implementation is already check that first passed > > argument is of 64-bit type, so we cannot use it for 32-bit values. > > > > Also note that in files which are touched by this commit are already > > used 32-bit division operations via C '/' operator. > > > > So I really do not know what is expected to do here... > > Thanks for checking. I saw block stuff and that typically does involve > a 64bit value somewhere along the way. So if the answer is: > - There's no 64-bit math here, really. > - There's no existing shift macros we can use instead (or that ends up > being larger!) > - There's no existing shift macros we just need to import from the > kernel. > > Then we're good. Well, "offset" member in mentioned commit is defined as "u32 offset". So it is not 64-bit for sure. And about shift macros... Problematic part is probably mmc->read_bl_len and stor_dev->blksz. I guess that storage block size is always power of two. Or are are some mmc / sata / usb / ... devices which have block / erase size which is not power of two? So these two members (read_bl_len and blksz) could stored as log2() value and then code can use shifts instead of division. But such change is big in U-Boot as it would touch whole U-Boot codebase. Maybe mmc and storage maintainers could decide if such thing is useful and try to do it? > > -- > Tom