]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: tegra: set CONFIG_SYS_MMC_MAX_DEVICE
authorStephen Warren <swarren@nvidia.com>
Fri, 18 Apr 2014 16:56:11 +0000 (10:56 -0600)
committerTom Warren <twarren@nvidia.com>
Tue, 13 May 2014 17:41:31 +0000 (10:41 -0700)
If CONFIG_API is ever to be enabled on Tegra, this define must be set,
since api/api_storage.c uses it.

A couple of annoyting things about CONFIG_SYS_MMC_MAX_DEVICE

1) It isn't documented in README. The same is true for a lot of similar
   defines used by api_storage.c.

2) It doesn't represent MAX_DEVICE but rather NUM_DEVICES, since the
   valid values are 0..n-1 not 0..n.

However, I this patch does not address those shortcomings.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/include/asm/arch-tegra/tegra_mmc.h
drivers/mmc/tegra_mmc.c
include/configs/tegra-common.h

index 310bbd7df9fe0bb492dfeab549e16dac626419b4..84e7b5553de16cb5ea8f5965079ec169d2459022 100644 (file)
@@ -14,8 +14,6 @@
 /* for mmc_config definition */
 #include <mmc.h>
 
-#define MAX_HOSTS              4       /* Max number of 'hosts'/controllers */
-
 #ifndef __ASSEMBLY__
 struct tegra_mmc {
        unsigned int    sysad;          /* _SYSTEM_ADDRESS_0 */
index ed67eec2527347740ea731153e368876e56e28f5..ca9c4aa15feea77686f8d5e87b7f24bdb8e1be89 100644 (file)
@@ -18,7 +18,7 @@
 
 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"
@@ -669,13 +669,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 +685,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 +695,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__);
index ae786cfd7a0f17e97f6bb9851fd069c0abd2853c..129acf2cbf81551c35608ffbba17b0f1228e7dbb 100644 (file)
 #define CONFIG_SYS_NS16550_REG_SIZE    (-4)
 #define CONFIG_SYS_NS16550_CLK         V_NS16550_CLK
 
+/*
+ * Common HW configuration.
+ * If this varies between SoCs later, move to tegraNN-common.h
+ * Note: This is number of devices, not max device ID.
+ */
+#define CONFIG_SYS_MMC_MAX_DEVICE 4
+
 /*
  * select serial console configuration
  */