Check SDMMC bus from u-boot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-04-21 7:24 AM
Here the output of some commands issued on our target at u-boot stage:
> STM32MP> mmc list
> STM32 SDMMC2: 0 (SD)
> STM32 SDMMC2: 1
>
> STM32MP> ls mmc 0:4
> <DIR> 1024 .
> <DIR> 1024 ..
> <DIR> 12288 lost+found
> 8192 uboot.env
> 6677056 uImage
> 71859 stm32mp151a-<myimage>-mx.dtb
> 583 boot.scr.uimg
>
> STM32MP> mmc list
> STM32 SDMMC2: 0 (SD)
> STM32 SDMMC2: 1 (eMMC)
Two questions:
- why the eMMC is not enumerated before trying to list anything in the SD device?
- why both are referred to the SDMMC2 bus? I'm expecting the SD card on SDMMC2 and eMMC on SDMMC1... in other words, how to check if the MPU finds the right device when changing the boot dip-switches to eMMC?
Solved! Go to Solution.
- Labels:
-
OpenSTLinux
-
SDIO-SDMMC
-
STM32MP15 Lines
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-04-30 12:08 AM
Answer for 2.
mmc is a U-Boot « class », with index starting at 0 (same logic than in Linux kernel).
And normally mmc “index�? are allocated in driver UCLASS_MMC, following the probe order.
“STM32 SDMMC2�? is a driver of UCLASS_MMC (SDMMCv2 in fact, the 2nd version of the ST IP SDMMC)
u-boot/drivers/mmc/sdmmc2 => .cf->name= “STM32 SDMMC2�?
But this name is not really clear.
In device tree you have
aliases {
mmc0 = &sdmmc1;
mmc1 = &sdmmc2;
}
With
sdmm1: sdmmc@0x58005000 {
}
Sdmm2: sdmmc@0x58007000 {
}
So in U-Boot, we have 2 instance of "STM32 SDMMC2" driver:
- > STM32MP> mmc list
- > STM32 SDMMC2: 0 (SD) => mmc0 = SDMMC1 is SD card on EV1 / DK1 / DK2
- > STM32 SDMMC2: 1 (eMMC) => mmc1 = SDMMC2 is eMMC on EV1
And at the end "ls mmc 0:4 “ => ls on the 4th partition of mmc instance 0 = 4th partition of SDMMC1: SD card
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-04-29 1:01 AM
Answer for 1.
In u-boot, all the driver are probed only when requested.
And eMMC is detected on mmc1 only if this mmc driver is probed
but is can be forced by "mmc dev [dev]" command
STM32MP> mmc dev 0
STM32MP> mmc dev 1
STM32MP> mmc list
But yes it is strange that mmc1 is probed just by "ls mmc" command,
I don't check the command (./fs/fs.c:739:int do_ls) to explain it
but it is a genric U-Boot behavior.
Regards
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-04-30 12:08 AM
Answer for 2.
mmc is a U-Boot « class », with index starting at 0 (same logic than in Linux kernel).
And normally mmc “index�? are allocated in driver UCLASS_MMC, following the probe order.
“STM32 SDMMC2�? is a driver of UCLASS_MMC (SDMMCv2 in fact, the 2nd version of the ST IP SDMMC)
u-boot/drivers/mmc/sdmmc2 => .cf->name= “STM32 SDMMC2�?
But this name is not really clear.
In device tree you have
aliases {
mmc0 = &sdmmc1;
mmc1 = &sdmmc2;
}
With
sdmm1: sdmmc@0x58005000 {
}
Sdmm2: sdmmc@0x58007000 {
}
So in U-Boot, we have 2 instance of "STM32 SDMMC2" driver:
- > STM32MP> mmc list
- > STM32 SDMMC2: 0 (SD) => mmc0 = SDMMC1 is SD card on EV1 / DK1 / DK2
- > STM32 SDMMC2: 1 (eMMC) => mmc1 = SDMMC2 is eMMC on EV1
And at the end "ls mmc 0:4 “ => ls on the 4th partition of mmc instance 0 = 4th partition of SDMMC1: SD card
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-04-30 12:20 AM
Thanks, now it's clear why it appears as SDMMC(v)2! I thought it was the MPU bus SDMMC2....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-04-30 5:57 AM
You are welcome,
For information, I will update this name....
