From patchwork Tue Sep 3 14:16:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1157033 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46N8D10YMdz9s7T for ; Wed, 4 Sep 2019 00:17:20 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id AE51CC21C50; Tue, 3 Sep 2019 14:17:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9F1DAC21D8A; Tue, 3 Sep 2019 14:17:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 36946C21D8A; Tue, 3 Sep 2019 14:17:11 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by lists.denx.de (Postfix) with ESMTPS id BE18EC21D83 for ; Tue, 3 Sep 2019 14:17:10 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46N8Cp2R8Vz1rW64; Tue, 3 Sep 2019 16:17:10 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46N8Cp0Lwkz1qqkB; Tue, 3 Sep 2019 16:17:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id V2ZxvYzeLHAZ; Tue, 3 Sep 2019 16:17:07 +0200 (CEST) X-Auth-Info: FSNez9v2VgTfUWLjzfqlVBhQ5s1E7Nm+72BHrxf40mI= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 3 Sep 2019 16:17:07 +0200 (CEST) From: Lukasz Majewski To: u-boot@lists.denx.de, Tom Rini Date: Tue, 3 Sep 2019 16:16:50 +0200 Message-Id: <20190903141650.5117-1-lukma@denx.de> X-Mailer: git-send-email 2.11.0 Cc: Marek Vasut , Mans Rullgard , Tien Fong Chee Subject: [U-Boot] [PATCH] spl: mmc: Add option to set eMMC HW boot partition X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Mans Rullgard This change allows setting pre-defined eMMC boot partition for SPL eMMC booting. It is necessary in the case when one wants to boot (through falcon boot) from eMMC after loading SPL from other memory (like SPI-NOR). Signed-off-by: Mans Rullgard [lukma: Edit the commit message] Signed-off-by: Lukasz Majewski Acked-by: Andreas Dannenberg --- common/spl/Kconfig | 6 ++++++ common/spl/spl_mmc.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index f467eca2be..5b7667ea16 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -314,6 +314,12 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR Address on the MMC to load U-Boot from, when the MMC is being used in raw mode. Units: MMC sectors (1 sector = 512 bytes). +config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION + int "Number of the eMMC boot partition to use" + default 1 + help + eMMC boot partition number to use when the eMMC in raw mode. + config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION bool "MMC Raw mode: by partition" help diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 2caceb5186..a4d2e63b82 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -334,6 +334,9 @@ int spl_mmc_load(struct spl_image_info *spl_image, err = -EINVAL; switch (boot_mode) { case MMCSD_MODE_EMMCBOOT: +#ifdef CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION + part = CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION; +#else /* * We need to check what the partition is configured to. * 1 and 2 match up to boot0 / boot1 and 7 is user data @@ -343,6 +346,7 @@ int spl_mmc_load(struct spl_image_info *spl_image, if (part == 7) part = 0; +#endif if (CONFIG_IS_ENABLED(MMC_TINY)) err = mmc_switch_part(mmc, part);