2

I use the imx.6 sabresd board which can boot using sd-card or emmc. I can boot linux correctly with both of them using u-boot and give the appropriate bootargs with the correct location for the rootfs. But when booting Linux using the eMMC the device name change from /dev/mmcblk1 when the sd card is inserted to /dev/mmcblk0 when the sd card is not inserted.

Now how can I give the correct root= in u-boot using the bootargs parameter when I don't know which device to use?

Of course I can do some tests in u-boot to check if a sd-card is inserted and change the bootargs parameter (just an idea but not yet tested) but actually I was hoping that there was a more elegant solution for this? Any suggestions?

rpot
  • 21
  • 3

1 Answers1

1

If you kernel and rootfs locates at the same device (sd-card or emmc) you can try to boot in series firstly from sd-card and then from emmc . See idea:

boot_sdcard=setenv bootargs 'root=/dev/mmcblk1 ...'; run load_kernel_sdcard; bootm
boot_emmc=setenv bootargs 'root=/dev/mmcblk0 ...'; run load_kernel_emmc; bootm
bootcmd=run boot_sdcard; run boot_emmc

Kernel wouldn't start if there is no sdcard and u-boot continue boot form emmc.

SergA
  • 1,097
  • 13
  • 21
  • The idea is that the system always start from emmc with or without a sd-card inserted. Also the system has to start as quick as possible in an automatic way with or without a sd-card. – rpot Feb 09 '16 at 07:26