From patchwork Tue Nov 11 22:50:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Tobias X-Patchwork-Id: 409698 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 88C4614012F for ; Wed, 12 Nov 2014 09:51:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3D5164B9E5; Tue, 11 Nov 2014 23:51:07 +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 lus-SiyykjEY; Tue, 11 Nov 2014 23:51:07 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E6C7D4B9E7; Tue, 11 Nov 2014 23:50:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 03DAB4B9A5 for ; Tue, 11 Nov 2014 23:50:47 +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 ShQnM21ShmGB for ; Tue, 11 Nov 2014 23:50:46 +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-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by theia.denx.de (Postfix) with ESMTPS id 9A1074B9BD for ; Tue, 11 Nov 2014 23:50:40 +0100 (CET) Received: by mail-pd0-f172.google.com with SMTP id r10so10932825pdi.17 for ; Tue, 11 Nov 2014 14:50:39 -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=0YsdIP5yMogajKakDrKJjfq/GjxPBpqEgkWC2u0nZfA=; b=uUeZdHhP3VgGerZoiFvH08l7tTnVKTMg/Os33q4l9Ity4Fr8OcvYyAC7IdjP+/VqP1 fj2d3Eqbhq+4nA2rzIhyVaX77sITFQqLhVc53zvrHPkOt8/KjyB2yOl3dnW0/P20pBUR qsYLv0xdTDt3a2RzbGqrv2n3ipq3XMRN1Dn4NS9XhJ4SgOKBM5mzDGSrnoTmaw9X2dc+ LOwuf/r5yfYyzxFC8NklOxw0Kd0iadIOW0p/N+BP+9iRq+bPUjSluUq/cLy45NSr6vkQ w2whl7rBQfxNEyOHIlH+n9GExTw0Iof7s9aMFM684+gcWjP4oN+nbh6+lFEtXBl8WoQ6 5kHg== X-Received: by 10.66.237.145 with SMTP id vc17mr43256350pac.34.1415746238975; Tue, 11 Nov 2014 14:50:38 -0800 (PST) Received: from localhost.localdomain (morse-p.static.monkeybrains.net. [208.90.214.40]) by mx.google.com with ESMTPSA id ri9sm20314272pbc.5.2014.11.11.14.50.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Nov 2014 14:50:37 -0800 (PST) From: John Tobias To: festevam@gmail.com Date: Tue, 11 Nov 2014 14:50:17 -0800 Message-Id: <1415746221-48062-4-git-send-email-john.tobias.ph@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415746221-48062-1-git-send-email-john.tobias.ph@gmail.com> References: <1415746221-48062-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 v4 3/7] 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 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