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 C6654C433F5 for ; Tue, 5 Apr 2022 23:03:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 055CB83C29; Wed, 6 Apr 2022 01:02:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id BCC4483C24; Wed, 6 Apr 2022 01:02:43 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 2B5D383B38 for ; Wed, 6 Apr 2022 01:02:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8B0D723A; Tue, 5 Apr 2022 16:02:32 -0700 (PDT) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5A6B43F718; Tue, 5 Apr 2022 16:02:31 -0700 (PDT) Date: Tue, 5 Apr 2022 23:59:29 +0100 From: Andre Przywara To: Jagan Teki Cc: Samuel Holland , Jernej Skrabec , Icenowy Zheng , Sunil Mohan Adapa , linux-sunxi@lists.linux.dev, u-boot@lists.denx.de Subject: Re: [RESEND PATCH v2 0/3] sunxi: Improve automatic eMMC boot partition support Message-ID: <20220405235929.2dffd0f5@slackpad.lan> In-Reply-To: <20210712100651.6912-1-andre.przywara@arm.com> References: <20210712100651.6912-1-andre.przywara@arm.com> Organization: Arm Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Mon, 12 Jul 2021 11:06:48 +0100 Andre Przywara wrote: > (resent to also include forgotten U-Boot list) > > The Allwinner BootROM supports loading the SPL from eMMC boot partitions, > but so far the SPL support for this case was a bit lacking, as it was a > compile time decision, and even required a manual config change. > This actually got accidentally fixed in v2021.04 (c0b417b2f1a3 "sunxi: > support loading with SPL > 32KB"), but still some gaps remain: When just > enabling an eMMC boot partition, but having no bootable code there, the > BROM will just continue with booting from the user data partition, but > U-Boot does not detect this and will try to load U-Boot proper from that > boot partition. > > This series fixes this, by replicating the BROMs decisions in the SPL, > to decide on the partition to continue loading from. > > Patch 1/3 prepares a generic function to take an extra argument, while > patch 2/3 implements the actual algorithm. > As this now allows to always have eMMC boot support on, patch 3/3 just > activates this for a number of boards I could test it on. > > I'd like to encourage other people to test this on boards with eMMC, to > enable this in the respective defconfig, maybe even centrally. > > Some more details on eMMC boot partition support and how to install > U-Boot in there can be found in the linux-sunxi Wiki: > http://linux-sunxi.org/Bootable_eMMC Rebased and updated patch 1/3, then merged into sunxi/master, which landed in mainline already. Thanks, Andre > > Cheers, > Andre > > Changelog v1 .. v2: > - drop patch 1/5 (bugfix): already merged > - drop patch 3/5, as it was obsoleted by c0b417b2f1a3 > - remove check for 32KB SPL limit (not applicable for H6 and beyond) > - remove extra sector offset adjustment (obsoleted by c0b417b2f1a3) > > Andre Przywara (3): > spl: mmc: extend spl_mmc_boot_mode() to take mmc argument > sunxi: eMMC: Improve automatic boot source detection > sunxi: defconfig: enable eMMC boot partition support > > arch/arm/mach-imx/spl.c | 2 +- > arch/arm/mach-k3/am6_init.c | 2 +- > arch/arm/mach-k3/j721e_init.c | 2 +- > arch/arm/mach-omap2/boot-common.c | 2 +- > arch/arm/mach-rockchip/spl.c | 2 +- > arch/arm/mach-socfpga/spl_a10.c | 2 +- > arch/arm/mach-socfpga/spl_gen5.c | 2 +- > arch/arm/mach-stm32mp/spl.c | 2 +- > arch/arm/mach-sunxi/board.c | 80 ++++++++++++++++++++++ > arch/arm/mach-uniphier/mmc-boot-mode.c | 5 +- > common/spl/spl_mmc.c | 4 +- > configs/bananapi_m64_defconfig | 1 + > configs/emlid_neutis_n5_devboard_defconfig | 1 + > configs/pine64-lts_defconfig | 1 + > configs/pine_h64_defconfig | 1 + > include/spl.h | 3 +- > 16 files changed, 97 insertions(+), 15 deletions(-) >