From patchwork Tue Dec 16 11:00:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume GARDET X-Patchwork-Id: 421858 X-Patchwork-Delegate: panto@antoniou-consulting.com 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 0E61F140100 for ; Tue, 16 Dec 2014 22:00:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 865A44B6C7; Tue, 16 Dec 2014 12:00:55 +0100 (CET) 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 9v7mxHdt3bOe; Tue, 16 Dec 2014 12:00:55 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DC6D34B6B4; Tue, 16 Dec 2014 12:00:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5106B4B6B4 for ; Tue, 16 Dec 2014 12:00:51 +0100 (CET) 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 86dM+fzsWFEu for ; Tue, 16 Dec 2014 12:00:51 +0100 (CET) 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-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by theia.denx.de (Postfix) with ESMTPS id 309DA4B6A7 for ; Tue, 16 Dec 2014 12:00:48 +0100 (CET) Received: from OLI01.site (unknown [82.244.147.214]) by smtp2-g21.free.fr (Postfix) with ESMTP id E76834B01DD; Tue, 16 Dec 2014 11:59:53 +0100 (CET) From: Guillaume GARDET To: u-boot@lists.denx.de Date: Tue, 16 Dec 2014 12:00:44 +0100 Message-Id: <1418727644-12897-1-git-send-email-guillaume.gardet@free.fr> X-Mailer: git-send-email 1.8.4.5 Cc: Tom Rini Subject: [U-Boot] [PATCH] spl: mmc: Fix raw boot mode (related to commit 4c5bbc2328a24f5e1ee990c9a9527e48e5fb3b5f) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de As reported by Robert Nelson, commit 4c5bbc2328a24f5e1ee990c9a9527e48e5fb3b5f may break MMC RAW boot mode. This patch fixes the check path to fix MMC Raw boot mode. Tested raw boot mode and FS boot mode on a pandaboard (rev. A3). Reported-by: Robert Nelson Signed-off-by: Guillaume GARDET Cc: Tom Rini Cc: Robert Nelson Tested-by: Robert Nelson --- common/spl/spl_mmc.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 7bae16b..c2e596b 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -172,11 +172,24 @@ void spl_mmc_load_image(void) err = mmc_load_image_raw_sector(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #endif - } else { + } + + switch(boot_mode){ + case MMCSD_MODE_RAW: +#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT) + case MMCSD_MODE_FS: +#endif +#ifdef CONFIG_SUPPORT_EMMC_BOOT + case MMCSD_MODE_EMMCBOOT: +#endif + /* Boot mode is ok. Nothing to do. */ + break; + case MMCSD_MODE_UNDEFINED: + default: #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT - puts("spl: wrong MMC boot mode\n"); + puts("spl: wrong MMC boot mode\n"); #endif - hang(); + hang(); } if (err)