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?