diff options
author | Vishal Bhoj <vishal.bhoj@linaro.org> | 2014-05-22 13:50:24 +0530 |
---|---|---|
committer | Vishal Bhoj <vishal.bhoj@linaro.org> | 2014-05-22 15:47:50 +0530 |
commit | 7c1e7c4c398c3d18eaaaf99a4db0892ea3d1ba71 (patch) | |
tree | 276d4b76db5466e3c5c4c29d087619c0f1b89e63 /board | |
parent | d7782d06534fe4fa47a49fa7c106de5ba85a9687 (diff) |
ARM64: Add mmc support to Vexpress64 Platform
The patch adds the initialization routine for PL180 mmc controller
on Vexpress64 models available.
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/armltd/vexpress64/vexpress64.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c index 2ec3bc983..74a0d7ad9 100644 --- a/board/armltd/vexpress64/vexpress64.c +++ b/board/armltd/vexpress64/vexpress64.c @@ -11,6 +11,7 @@ #include <netdev.h> #include <asm/io.h> #include <linux/compiler.h> +#include "../drivers/mmc/arm_pl180_mmci.h" DECLARE_GLOBAL_DATA_PTR; @@ -54,3 +55,32 @@ int board_eth_init(bd_t *bis) #endif return rc; } + +/* + * Board specific mmc initialization routine. + */ +int cpu_mmc_init(bd_t *bis) +{ + int rc = 0; + (void) bis; +#ifdef CONFIG_ARM_PL180_MMCI + struct pl180_mmc_host *host; + + host = malloc(sizeof(struct pl180_mmc_host)); + if (!host) + return -ENOMEM; + memset(host, 0, sizeof(*host)); + + strcpy(host->name, "MMC"); + host->base = (struct sdi_registers *)CONFIG_ARM_PL180_MMCI_BASE; + host->pwr_init = INIT_PWR; + host->clkdiv_init = SDI_CLKCR_CLKDIV_INIT_V1 | SDI_CLKCR_CLKEN ; + host->voltages = VOLTAGE_WINDOW_MMC; + host->caps = 0; + host->clock_in = ARM_MCLK; + host->clock_min = ARM_MCLK / (2 * (SDI_CLKCR_CLKDIV_INIT_V1 + 1)); + host->clock_max = CONFIG_ARM_PL180_MMCI_CLOCK_FREQ; + rc = arm_pl180_mmci_init(host); +#endif + return rc; +} |