[U-Boot] "Writing to MMC(%d)... failed"

Przemyslaw Marczak p.marczak at samsung.com
Tue Apr 28 10:07:07 CEST 2015


Hello Nathan,

Sorry, I didn't reply last time, becouse I'm quite busy.

On 04/28/2015 07:39 AM, Nathan wrote:
> Still not sure where the problem lies. I thought I found an issue, but
> it didn't fix anything and caused a different issue.
>
> At first, after plugging in a bunch of printfs, I thought it was a
> simple issue in the dts (it appears not to be the issue):
> *****
> Getting a little back into it, I find an issue in:
> "./lib/libfdt/fdt_ro.c"
>    "fdt_path_offset()" where "-FDT_ERR_BADPATH" is returned for "path"
> = "sdhci at 12530000"
> when:
> "./lib/fdtdec.c"
>    "fdtdec_add_aliases_for_id()" is examining "mmc2"
>
> "fdt_path_offset()"
>    "_fdt_nodename_eq()" finds "aliases"
>
> But the issue comes from
> "./lib/libfdt/fdt_ro.c"
>    "_fdt_string_eq()"
> where
> "p" = "mmc2" <> "s" = "sdhci at 12530000"
>
> What I'm noticing different in the "exynos4412-odroid.dts" (odroid u2)
> and "exynos54xx.dtsi" is the "/" for the alias paths "mmc2" and
> "mmc4".
> *****

If I good remember, Exynos 54xx doesn't support sdhci, it has only dw mmc.

>
> The problem with that "finding" was:
> "fdtdec_add_aliases_for_id: warning: alias 'mmc2' points to a node
> 'sdhci at 12530000' that is missing or is not compatible  with
> 'samsung,exynos-dwmmc'"
> Not sure why it would even mention dwmmc for mmc2 when it is specified
> "exynos-mmc" in "exynos4.dtsi"
>
> A common issue with or without the slash is:
> "_gpio_request_by_name_nodev: Node 'sdhci at 12530000', property
> 'pwr-gpios', failed to request GPIO index 0: -2"
>

The "pwr-gpio" is okay - the pin is not defined and not required here.

For this board's config, there are two mmc drivers:
- exynos dwmmc(mmc/exynos_dw_mmc.c) - channel 0 - for eMMC card slot
- s5p sdhci(mmc/s5p_sdhci.c) - channel 2 - for SD card slot
Each driver has it's own compatible id, which you can see in the array:
lib/fdtdec.c - > compat_names[COMPAT_COUNT]

Note: This is quite different like for the drivers, which support the 
driver model. We don't bind those drivers with the driver model yet.

So now we init those drivers, by call the board_mmc_init() in 
board/samsung/common/board.c - as you probably know - most of samsung 
boards in U-Boot uses this common file, beside it's own board file.
If you not sure where to find the function, you can check, which common 
files are compiled for your config:
cd board/samsung
find -name "*.o"

>> I think the kicker is "No match for node 'sdhci at 12530000'".
>> I even manually set/forced the "status=okay" in the dts, but it still
>> says it's disabled.
>>
>> I shall continue to pursue this, working my way back from
>> "lists_bind_fdt()" in "lists.c"
>

And now, back to the issue with the warning, which you mentioned. This 
is okay. I'm sure, that sdhci driver init is fine. You can study the 
function: fdtdec_add_aliases_for_id() from lib/fdtdec.c
Remember, that this is the first introduced method for init the drivers 
with the FDT support. But we are going to move all subsystems into the 
driver model.

Let's look at the fdtdec_add_aliases_for_id():
- first we find all compatible nodes,
- next we have an array "nodes[maxcount]" with the compatible nodes only
- and next we look for the "path" for our "mmc*" aliases, but only for 
the compatible we can meet the condition: if (nodes[j] == node).
This is way you get the warning when init DWMMC driver.
This is ok.

Which compiler are you using?
We often use this U-Boot with SD cards and no one have such issue before.
What about your power supply?
Do you have eMMC card?
Any other accessory is connected?

Can you send me your binary (u-boot-dtb.bin)?

Best regards,
-- 
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com


More information about the U-Boot mailing list