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 D3692C636D7 for ; Tue, 21 Feb 2023 20:49:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BADC085A7D; Tue, 21 Feb 2023 21:48:45 +0100 (CET) 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="jQmr0IyK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D639085A96; Tue, 21 Feb 2023 21:48:39 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (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 9BA2A85A9F for ; Tue, 21 Feb 2023 21:22:34 +0100 (CET) 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: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3A678611C2; Tue, 21 Feb 2023 20:22:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFE14C433AA; Tue, 21 Feb 2023 20:22:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677010951; bh=ubrFrCEADcsUzAVe7wchtiU/l2qLrT/91YOb2It/ZS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jQmr0IyK2K12FAlhT2MW/JqYsVhxgHnd5zxpFTKRyvB1doyN97mkd7wi2ZJcP4JvL aH8VDiIR4QtAUW5+bbditmoJM3FkszarULTNPdvEbLJoBFZPeQzcUlbT3UXzHGdUg8 O5Sc7GD35w+4bXDsXNu2oppny7hrDAJtHl1gyMuRx8BSY03Oy/XByUItIxp8o54TPd YzFkyVFx21yY23lgVlx3F/KkeoYV3EBxTSiaMK0z7KCziOr1yDAJ4sR7iwJqo1Jt8u +lL/W++kfiKbLgG4V5iXCXR2mEgB63TwFimLbl4lsI6P/XRgvr7rDOiMj802vlZfaa NTy2s2upkpXcg== Received: by pali.im (Postfix) id 1CFC3215C; Tue, 21 Feb 2023 21:22:29 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de Cc: Stefan Roese , Tony Dinh , Josua Mayer Subject: [PATCH RFC u-boot-mvebu 10/59] arm: mvebu: spl: Load proper U-Boot from selected eMMC boot partition Date: Tue, 21 Feb 2023 21:18:36 +0100 Message-Id: <20230221201925.9644-11-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230221201925.9644-1-pali@kernel.org> References: <20230221201925.9644-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.6 at phobos.denx.de X-Virus-Status: Clean When eMMC boot is selected then BootROM loads kwbimage header (U-Boot SPL) from the selected eMMC boot partition. So for eMMC boot ensure that U-Boot SPL loads U-Boot proper (from kwbimage) also from the same selected eMMC boot partition. Fixes: 2226ca173486 ("arm: mvebu: Load U-Boot proper binary in SPL code based on kwbimage header") Signed-off-by: Pali Rohár --- arch/arm/mach-mvebu/Kconfig | 1 + arch/arm/mach-mvebu/spl.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index 594e9a03d901..5303b1cbb965 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig @@ -330,6 +330,7 @@ config MVEBU_SPL_BOOT_DEVICE_MMC imply SPL_GPIO imply SPL_LIBDISK_SUPPORT imply SPL_MMC + select SUPPORT_EMMC_BOOT if SPL_MMC select SPL_BOOTROM_SUPPORT config MVEBU_SPL_BOOT_DEVICE_SATA diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c index e14c7a9c6cf2..0a809e91349c 100644 --- a/arch/arm/mach-mvebu/spl.c +++ b/arch/arm/mach-mvebu/spl.c @@ -41,6 +41,12 @@ * kwbimage main header. */ #ifdef CONFIG_SPL_MMC +#ifdef CONFIG_SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG +#error CONFIG_SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG is unsupported +#endif +#ifdef CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION +#error CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION is unsupported +#endif #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION #error CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is unsupported #endif @@ -98,7 +104,7 @@ struct kwbimage_main_hdr_v1 { #ifdef CONFIG_SPL_MMC u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) { - return MMCSD_MODE_RAW; + return MMCSD_MODE_EMMCBOOT; } #endif -- 2.20.1