How to boot iMX6qSabreSD from eMMC with SD Card Present

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to boot iMX6qSabreSD from eMMC with SD Card Present

Jump to solution
1,790 Views
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?

Tags (1)
0 Kudos
1 Solution
931 Views
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

View solution in original post

0 Kudos
3 Replies
931 Views
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

931 Views
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 Kudos
932 Views
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 Kudos