Kernel does not recognize MMC controller... but u-boot does!
by MALDATA from LinuxQuestions.org on (#4WDRH)
I'm trying to get a custom board to boot from an SD card, and it's very close to working. U-boot is able to see the SD card, it loads the kernel, and the kernel starts booting. However, when it tries to mount the filesystem on the SD card, it fails to find the /dev/mmcblk0 device.
There's a lot of content related to that on the internet, but I can confirm that the exact same SD card, when inserted into a dev board (i.e., same SoC, similar reference circuit for the SD card, etc.), CAN properly boot.
So I'm struggling to understand what the problem is. The custom board's circuit between the SoC and the SD card slot must be ok because u-boot has no problem using it. The kernel must contain all the right drivers for the SoC's MMC controller because the dev board can use the same one successfully. And the device tree must be ok because the dev board and the custom board have the same SoC. However, on the custom board, the kernel loads only up until it tries to find a file system.
I've tried disabling the card-detect for the MMC in the device tree (i.e., by using "broken-cd"), but that did not change the behavior. I also tried setting the kernel boot parameter "root=/dev/mmcblk0" to mmcblk1 and mmcblk2, just in case the MMCs were being enumerated in a way I didn't expect. Still nothing.
I'm stumped here, because it seems like, if the dev board works and the custom board doesn't, then it's probably a problem with the circuit. But u-boot on the custom board finds and uses the MMC just fine.
If anyone out there is deeply familiar with u-boot and how it handles MMC controllers, please let me know. There's got to be some difference between u-boot's handling of them and the Linux kernel's, but I'm not familiar enough with u-boot's innards.
For reference, it's a sun8i SoC, kernel 4.20, and u-boot 2019.04.
Thanks!


There's a lot of content related to that on the internet, but I can confirm that the exact same SD card, when inserted into a dev board (i.e., same SoC, similar reference circuit for the SD card, etc.), CAN properly boot.
So I'm struggling to understand what the problem is. The custom board's circuit between the SoC and the SD card slot must be ok because u-boot has no problem using it. The kernel must contain all the right drivers for the SoC's MMC controller because the dev board can use the same one successfully. And the device tree must be ok because the dev board and the custom board have the same SoC. However, on the custom board, the kernel loads only up until it tries to find a file system.
I've tried disabling the card-detect for the MMC in the device tree (i.e., by using "broken-cd"), but that did not change the behavior. I also tried setting the kernel boot parameter "root=/dev/mmcblk0" to mmcblk1 and mmcblk2, just in case the MMCs were being enumerated in a way I didn't expect. Still nothing.
I'm stumped here, because it seems like, if the dev board works and the custom board doesn't, then it's probably a problem with the circuit. But u-boot on the custom board finds and uses the MMC just fine.
If anyone out there is deeply familiar with u-boot and how it handles MMC controllers, please let me know. There's got to be some difference between u-boot's handling of them and the Linux kernel's, but I'm not familiar enough with u-boot's innards.
For reference, it's a sun8i SoC, kernel 4.20, and u-boot 2019.04.
Thanks!