How to boot iMX6qSabreSD from eMMC with SD Card Present

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to boot iMX6qSabreSD from eMMC with SD Card Present

跳至解决方案
2,721 次查看
steveanderson
Contributor II

I have configured u-boot to use the eMMC device as the default for boot and for the environment save.

I am using yocto 1.6.2 with everything on the default settings except for adding an emmc u-boot configuration.

Everything boots just fine with no SD Card since the eMMC always enumerates as /dev/mmcblk0

However, if there is an SD Card present during boot the eMMC does not enumerate as /dev/mmcblk0 and the Kernel startup crashes because /dev/mmcblk0p2 no longer contains the root filesystem...

So, How do I get the eMMC to always enumerate first, or always enumerate to the same device as the Kernel boots?

Or is there a different question/answer that gets me to the same effect?

标记 (1)
0 项奖励
回复
1 解答
1,862 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Steve,

     Good job !

     All operations of devices are in .dtb file, you don't need to modify .c file, so your operation is correct .

Regards,

Weidong

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,862 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Steve,

     You can resolve the problem by adjusting the registration sequence of uSDHC device in BSP file. For example, if uSDHC4 ( eMMC connected) is firstly registered, the device will be /dev/mmcblk0, if SD card is connected to uSHDC3 port, second uSDHC device will be registered as /dev/mmcblk1 .....

Regards,

Weidong

1,862 次查看
steveanderson
Contributor II

Thanks very much!  In the interest of making sure I am solving this in the best way, and the way you intended, I want to clarify how I have taken your suggestion:

Device enumeration, in this case, is done whilst parsing the device tree binary (registration is not from a board.c file)

Therefore, I must reorder the declaration of sdhc4 in the device tree to be the first sdhc device probed; we know that sdhc4 will always be found, after all, on the iMX6qSabreSD board.

To do this I have patched the file imx6qdl.dtsi putting "usdhc4: usdhc@0219c000 {...}" before "usdhc1: usdhc@02190000 {...}"

I confirmed the ordering in the dtb by decompiling back into a flat dts and looking for "0219c000" which is now the first usdhc device.

This has worked, I can boot the board now from eMMC with or without an SD Card in either slot.

This was done modifying the device tree by applying a patch locally at build time, there is no Kernel code change.

Was this your intended interpretation?

0 项奖励
回复
1,863 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Steve,

     Good job !

     All operations of devices are in .dtb file, you don't need to modify .c file, so your operation is correct .

Regards,

Weidong

0 项奖励
回复