From patchwork Fri Oct 21 11:53:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Niestroj X-Patchwork-Id: 685052 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3t0kcK5r3Gz9t0q for ; Fri, 21 Oct 2016 22:54:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5DE44B388E; Fri, 21 Oct 2016 13:54:24 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uagjmPqAUDzN; Fri, 21 Oct 2016 13:54:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BB11FB382D; Fri, 21 Oct 2016 13:54:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4C7EEA758E for ; Fri, 21 Oct 2016 13:54:21 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a40FMEAcedgZ for ; Fri, 21 Oct 2016 13:54:21 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp2.megiteam.pl (smtp2.megiteam.pl [213.189.52.193]) by theia.denx.de (Postfix) with ESMTPS id 19FF4A7548 for ; Fri, 21 Oct 2016 13:54:18 +0200 (CEST) Received: from [95.143.241.142] (helo=localhost.localdomain) by smtp.megiteam.pl with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1bxYOf-00030L-LV; Fri, 21 Oct 2016 13:54:12 +0200 From: Marcin Niestroj To: Albert Aribaud Date: Fri, 21 Oct 2016 13:53:54 +0200 Message-Id: <20161021115354.23517-1-m.niestroj@grinn-global.com> X-Mailer: git-send-email 2.10.0 Cc: Fabio Estevam , u-boot@lists.denx.de Subject: [U-Boot] [PATCH] ARM: mx6: add MMC2 boot device detection support in SPL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Check BOOT_CFG2[3:4] to determine which SD/MMC port is selected to boot from. If MMC2 is selected return BOOT_DEVICE_MMC2. In all other cases return BOOT_DEVICE_MMC1, as we do not have corresponding macro for MMC3 and MMC4. Signed-off-by: Marcin Niestroj --- arch/arm/imx-common/spl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c index bdcda7d..325ba26 100644 --- a/arch/arm/imx-common/spl.c +++ b/arch/arm/imx-common/spl.c @@ -14,6 +14,9 @@ #include #if defined(CONFIG_MX6) +#define MX6_MMC_PORT_MASK GENMASK(12, 11) +#define MX6_MMC_PORT_2 BIT(11) + /* determine boot device from SRC_SBMR1 (BOOT_CFG[4:1]) or SRC_GPR9 register */ u32 spl_boot_device(void) { @@ -55,10 +58,11 @@ u32 spl_boot_device(void) /* SD/eSD: 8.5.3, Table 8-15 */ case 0x4: case 0x5: - return BOOT_DEVICE_MMC1; /* MMC/eMMC: 8.5.3 */ case 0x6: case 0x7: + if ((reg & MX6_MMC_PORT_MASK) == MX6_MMC_PORT_2) + return BOOT_DEVICE_MMC2; return BOOT_DEVICE_MMC1; /* NAND Flash: 8.5.2 */ case 0x8 ... 0xf: