From: Stephen Warren <swarren@nvidia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6 2/5] tegra2: Move MMC clock initialization into MMC driver
Date: Wed, 12 Oct 2011 16:53:06 -0600 [thread overview]
Message-ID: <1318459989-24191-2-git-send-email-swarren@nvidia.com> (raw)
In-Reply-To: <1318459989-24191-1-git-send-email-swarren@nvidia.com>
This centralizes knowledge of MMC clocking into the MMC driver. This also
removes clock setup from the board files, which will simplify later changes
that modify the Harmony board to support the correct set of MMC controllers.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
---
board/nvidia/common/board.c | 13 +------------
drivers/mmc/tegra2_mmc.c | 12 +++++++++---
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index d13537d..370a259 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -102,16 +102,6 @@ static void pin_mux_uart(void)
#ifdef CONFIG_TEGRA2_MMC
/*
- * Routine: clock_init_mmc
- * Description: init the PLL and clocks for the SDMMC controllers
- */
-static void clock_init_mmc(void)
-{
- clock_start_periph_pll(PERIPH_ID_SDMMC4, CLOCK_ID_PERIPH, 20000000);
- clock_start_periph_pll(PERIPH_ID_SDMMC3, CLOCK_ID_PERIPH, 20000000);
-}
-
-/*
* Routine: pin_mux_mmc
* Description: setup the pin muxes/tristate values for the SDMMC(s)
*/
@@ -157,8 +147,7 @@ int board_init(void)
int board_mmc_init(bd_t *bd)
{
debug("board_mmc_init called\n");
- /* Enable clocks, muxes, etc. for SDMMC controllers */
- clock_init_mmc();
+ /* Enable muxes, etc. for SDMMC controllers */
pin_mux_mmc();
gpio_config_mmc();
diff --git a/drivers/mmc/tegra2_mmc.c b/drivers/mmc/tegra2_mmc.c
index 9e741f2..78b1190 100644
--- a/drivers/mmc/tegra2_mmc.c
+++ b/drivers/mmc/tegra2_mmc.c
@@ -435,14 +435,22 @@ static int mmc_core_init(struct mmc *mmc)
static int tegra2_mmc_initialize(int dev_index, int bus_width)
{
+ struct mmc_host *host;
struct mmc *mmc;
debug(" mmc_initialize called\n");
+ host = &mmc_host[dev_index];
+
+ host->clock = 0;
+ tegra2_get_setup(host, dev_index);
+
+ clock_start_periph_pll(host->mmc_id, CLOCK_ID_PERIPH, 20000000);
+
mmc = &mmc_dev[dev_index];
sprintf(mmc->name, "Tegra2 SD/MMC");
- mmc->priv = &mmc_host[dev_index];
+ mmc->priv = host;
mmc->send_cmd = mmc_send_cmd;
mmc->set_ios = mmc_set_ios;
mmc->init = mmc_core_init;
@@ -465,8 +473,6 @@ static int tegra2_mmc_initialize(int dev_index, int bus_width)
mmc->f_min = 375000;
mmc->f_max = 48000000;
- mmc_host[dev_index].clock = 0;
- tegra2_get_setup(&mmc_host[dev_index], dev_index);
mmc_register(mmc);
return 0;
--
1.7.0.4
next prev parent reply other threads:[~2011-10-12 22:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-12 22:53 [U-Boot] [PATCH v6 1/5] tegra2: Use cmd_link_o_target in board Makefiles Stephen Warren
2011-10-12 22:53 ` Stephen Warren [this message]
2011-10-28 17:25 ` [U-Boot] [PATCH v6 2/5] tegra2: Move MMC clock initialization into MMC driver Stephen Warren
2011-10-12 22:53 ` [U-Boot] [PATCH v6 3/5] tegra2: Move board_mmc_init into board files Stephen Warren
2011-10-12 22:53 ` [U-Boot] [PATCH v6 4/5] tegra2: Modify MMC driver to handle power and cd GPIOs Stephen Warren
2011-10-28 17:26 ` Stephen Warren
2011-10-12 22:53 ` [U-Boot] [PATCH v6 5/5] tegra2: Add support for Ventana Stephen Warren
2011-10-12 23:05 ` Simon Glass
2011-10-28 5:18 ` Albert ARIBAUD
2011-10-18 18:14 ` [U-Boot] [PATCH v6 1/5] tegra2: Use cmd_link_o_target in board Makefiles Stephen Warren
2011-10-18 18:31 ` Simon Glass
2011-10-18 20:07 ` Tom Warren
2011-10-18 20:51 ` Simon Glass
2011-10-28 5:35 ` Albert ARIBAUD
2011-10-28 6:25 ` Mike Frysinger
2011-10-29 0:00 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1318459989-24191-2-git-send-email-swarren@nvidia.com \
--to=swarren@nvidia.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox