From patchwork Wed Nov 12 01:59:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Tobias X-Patchwork-Id: 409809 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 0AC3414017A for ; Wed, 12 Nov 2014 13:00:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C96154BA89; Wed, 12 Nov 2014 03:00:32 +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 HNNxuNdKMxbH; Wed, 12 Nov 2014 03:00:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D02964BADC; Wed, 12 Nov 2014 03:00:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5FB634BACD for ; Wed, 12 Nov 2014 03:00:19 +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 D1rFlLec8wtB for ; Wed, 12 Nov 2014 03:00:19 +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 mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by theia.denx.de (Postfix) with ESMTPS id 76C114BA9A for ; Wed, 12 Nov 2014 03:00:09 +0100 (CET) Received: by mail-pa0-f52.google.com with SMTP id fa1so11837627pad.11 for ; Tue, 11 Nov 2014 18:00:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=adoGEgQNqZBf5uv8xdaHAXBUksQSor72Ogg3T4ODpic=; b=okgCBWIoMLY21nwos+BHneADn4zWReIx8z+5hJ9xsVdBCI4cDIevOmLNVSnwZ9zd0T QWo/2jFkiMXJPBRHRXL7MOZA5eXdU2+GuqoYQXiraZJVbgVHmCnHl2M2VYDuVVPVk2oS 23JeJDmZJRQ2usJI1ZhM7XS6+eDhunXOqJm0otneljcABi6KDhquzuCybtKhrU76Bh4l BxgZz2arpLn9YJZlabkMQxt0UP7GgvcYfVweul5YnXBchJnyNdkVZVEyars6/ak1+e2W Km9CcF9rKgO66iQmkeRviTilCUiwmD4B2Ov3ZCfkJJ1O65E/f6guIAm8I16bw7BBq2Jd tcaQ== X-Received: by 10.68.225.131 with SMTP id rk3mr14738890pbc.157.1415757607880; Tue, 11 Nov 2014 18:00:07 -0800 (PST) Received: from localhost.localdomain (morse-p.static.monkeybrains.net. [208.90.214.40]) by mx.google.com with ESMTPSA id m5sm20567670pdi.24.2014.11.11.18.00.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Nov 2014 18:00:06 -0800 (PST) From: John Tobias To: festevam@gmail.com Date: Tue, 11 Nov 2014 17:59:53 -0800 Message-Id: <1415757594-64353-5-git-send-email-john.tobias.ph@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415757594-64353-1-git-send-email-john.tobias.ph@gmail.com> References: <1415757594-64353-1-git-send-email-john.tobias.ph@gmail.com> Cc: u-boot@lists.denx.de, jeroen@myspectrum.nl, otavio@ossystems.com.br Subject: [U-Boot] [PATCH v5 4/5] mmc: imx6: call spl_board_mmc_init 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 When the spl_mmc_load_image function being called, it will call mmc_initialize function. By default, it will call board_mmc_init. The main purpose of board_mmc_init (in practice) is to initialize all the mmc ports defined by CONFIG_SYS_FSL_USDHC_NUM. While, in spl_board_mmc_init, it will read the bootstrap to see which mmc port is active and configure it. Then, it pass the configuration to fsl_esdhc_initialize for initialization. Finally, the spl_mmc_load_image could load and run the u-boot.img Signed-off-by: John Tobias --- drivers/mmc/mmc.c | 9 ++++++--- include/mmc.h | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 44a4feb..88c1b03 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1441,11 +1441,14 @@ int mmc_initialize(bd_t *bis) INIT_LIST_HEAD (&mmc_devices); cur_dev_num = 0; - if (board_mmc_init(bis) < 0) +#ifdef CONFIG_SPL_BUILD + if (spl_board_mmc_init(bis) < 0) cpu_mmc_init(bis); +#else + if (board_mmc_init(bis) < 0) + cpu_mmc_init(bis); -#ifndef CONFIG_SPL_BUILD - print_mmc_devices(','); + print_mmc_devices(','); #endif do_preinit(); diff --git a/include/mmc.h b/include/mmc.h index d74a190..37119b8 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -388,6 +388,9 @@ int mmc_legacy_init(int verbose); int board_mmc_init(bd_t *bis); int cpu_mmc_init(bd_t *bis); int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr); +#ifdef CONFIG_SPL +int spl_board_mmc_init(bd_t *bis); +#endif /* Set block count limit because of 16 bit register limit on some hardware*/ #ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT