[U-Boot] [PATCH v4 4/4] Tegra: MMC: Add DT support to MMC driver for all T20 boards

Stephen Warren swarren at wwwdotorg.org
Tue Feb 19 18:32:14 CET 2013


On 02/18/2013 04:10 PM, Andy Fleming wrote:
> On Thu, Feb 14, 2013 at 3:04 PM, Tom Warren <twarren.nvidia at gmail.com>wrote:
> 
>> tegra_mmc_init() now parses the DT info for bus width, WP/CD GPIOs, etc.
>> Tested on Seaboard, fully functional.
>>
>> Tamonten boards (medcom-wide, plutux, and tec) use a different/new
>> dtsi file w/common settings.
...
>> +void tegra_mmc_init(void)
>> +{
>> +       int node_list[MAX_HOSTS], count;
>> +       const void *blob = gd->fdt_blob;
>> +       debug("%s entry\n", __func__);
>> +
>> +       count = fdtdec_find_aliases_for_id(blob, "sdhci",
>> +               COMPAT_NVIDIA_TEGRA20_SDMMC, node_list, MAX_HOSTS);
>> +       debug("%s: count of sdhci nodes is %d\n", __func__, count);
>> +
>> +       if (process_nodes(blob, node_list, count)) {
>> +               printf("%s: Error processing mmc node(s)!\n", __func__);
>> +               return;
>> +       }
>> +}
> 
> Hmmm.... what does fdtdec_find_aliases_for_id() do? It looks like you are
> attempting to go through all of the sdhci nodes, and I can't help but
> wonder why you wouldn't use the approach the kernel uses --
> for_each_compatible_node()? I'm a little worried that "aliases" are being
> overused, here.

IIRC, the implementation of fdtdec_find_aliases_for_id() basically is
for_each_compatible_node(), followed by looking up any alias definitions
for alias name "sdhci" that reference those nodes.


More information about the U-Boot mailing list