]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - drivers/mmc/tegra_mmc.c
Merge branch 'master' of git://www.denx.de/git/u-boot-imx
[people/ms/u-boot.git] / drivers / mmc / tegra_mmc.c
index ed67eec2527347740ea731153e368876e56e28f5..2bd36b0ee704a86308bfa0d3c7faa68cc506249a 100644 (file)
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>
+#include <asm/arch-tegra/mmc.h>
 #include <asm/arch-tegra/tegra_mmc.h>
 #include <mmc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-struct mmc_host mmc_host[MAX_HOSTS];
+struct mmc_host mmc_host[CONFIG_SYS_MMC_MAX_DEVICE];
 
 #ifndef CONFIG_OF_CONTROL
 #error "Please enable device tree support to use this driver"
@@ -292,7 +293,7 @@ static int mmc_send_cmd_bounced(struct mmc *mmc, struct mmc_cmd *cmd,
                                /* Transfer Complete */
                                debug("r/w is done\n");
                                break;
-                       } else if (get_timer(start) > 2000UL) {
+                       } else if (get_timer(start) > 8000UL) {
                                writel(mask, &host->reg->norintsts);
                                printf("%s: MMC Timeout\n"
                                       "    Interrupt status        0x%08x\n"
@@ -508,7 +509,7 @@ static int tegra_mmc_core_init(struct mmc *mmc)
        return 0;
 }
 
-int tegra_mmc_getcd(struct mmc *mmc)
+static int tegra_mmc_getcd(struct mmc *mmc)
 {
        struct mmc_host *host = mmc->priv;
 
@@ -669,13 +670,14 @@ static int process_nodes(const void *blob, int node_list[], int count)
 
 void tegra_mmc_init(void)
 {
-       int node_list[MAX_HOSTS], count;
+       int node_list[CONFIG_SYS_MMC_MAX_DEVICE], count;
        const void *blob = gd->fdt_blob;
        debug("%s entry\n", __func__);
 
        /* See if any Tegra124 MMC controllers are present */
        count = fdtdec_find_aliases_for_id(blob, "sdhci",
-               COMPAT_NVIDIA_TEGRA124_SDMMC, node_list, MAX_HOSTS);
+               COMPAT_NVIDIA_TEGRA124_SDMMC, node_list,
+               CONFIG_SYS_MMC_MAX_DEVICE);
        debug("%s: count of Tegra124 sdhci nodes is %d\n", __func__, count);
        if (process_nodes(blob, node_list, count)) {
                printf("%s: Error processing T30 mmc node(s)!\n", __func__);
@@ -684,7 +686,8 @@ void tegra_mmc_init(void)
 
        /* See if any Tegra30 MMC controllers are present */
        count = fdtdec_find_aliases_for_id(blob, "sdhci",
-               COMPAT_NVIDIA_TEGRA30_SDMMC, node_list, MAX_HOSTS);
+               COMPAT_NVIDIA_TEGRA30_SDMMC, node_list,
+               CONFIG_SYS_MMC_MAX_DEVICE);
        debug("%s: count of T30 sdhci nodes is %d\n", __func__, count);
        if (process_nodes(blob, node_list, count)) {
                printf("%s: Error processing T30 mmc node(s)!\n", __func__);
@@ -693,7 +696,8 @@ void tegra_mmc_init(void)
 
        /* Now look for any Tegra20 MMC controllers */
        count = fdtdec_find_aliases_for_id(blob, "sdhci",
-               COMPAT_NVIDIA_TEGRA20_SDMMC, node_list, MAX_HOSTS);
+               COMPAT_NVIDIA_TEGRA20_SDMMC, node_list,
+               CONFIG_SYS_MMC_MAX_DEVICE);
        debug("%s: count of T20 sdhci nodes is %d\n", __func__, count);
        if (process_nodes(blob, node_list, count)) {
                printf("%s: Error processing T20 mmc node(s)!\n", __func__);