Topic: odd behaviour of uboot...

I've been seeing some odd behaviour in u-boot / linux kernel and the sdcard slots.

I'm on

- commit 633c219ff923ee6293825e5f8da43ad057e51823 - u-boot-imx6
- commit dd3635dab34fcd65410b6a3513999de379a29d5e - novena-linux

I have two microsd cards (sandisk ultra's, class 10, 8gb).

I have two linux distros, one is debian and one is ubuntu (so i can clearly distinguish which linux i'm in). If i have both sdcard's in their slots I expect the full sized sdcard to become the root and not the microsd card slot.

mmc dev 1
if fatload mmc 1 0x12000000 uImage
then
        fatload mmc 1 0x11ff0000 uImage.dtb
        setenv bootargs console=ttymxc1,115200 earlyprintk root=/dev/mmcblk1p2 rootwait rootfstype=ext4 splash consoleblank=0 init=/sbin/init
else
        mmc dev 0
        fatload mmc 0 0x12000000 uImage
        fatload mmc 0 0x11ff0000 uImage.dtb
        setenv bootargs console=ttymxc1,115200 earlyprintk root=/dev/mmcblk0p2 rootwait rootfstype=ext4 splash consoleblank=0 init=/sbin/init
fi

fdt addr 0x11ff0000; run prep_gbit; run prep_pcie; run prep_senoko; run prep_es8328; run prep_retina; run prep_pixelqi; run prep_hdmi

bootm 0x12000000 - 0x11ff0000

I would expect if i don't have the second card slot populated I would get debian, but when i have the second slot populated (the fullsized slot) it would boot into that. However instead of getting the second card too boot, I always end up booting the microsd card, and I can't mount the full sized card at all in the OS to look at what's going on, it's like the first slot got mapped to the second slot. So mounting mmcblk1p2 is really mmcblk0p2. I thought the above had worked at some point. Are there notes on the max/min requirements for booting off the microsd and sd card slots?

Re: odd behaviour of uboot...

Yes, this is a problem we'll need to fix before release.

The problem is that the external MMC slot is called USDHC2, and the internal slot is USDHC3.  I suspect they initialize numerically, so USDHC2 (the external slot) is probed first.  If a card is present, it gets assigned the next sequential node, i.e. mmcblk0.  Then it moves on to USDHC3, which is always present.  It'll get assigned the next sequential node, either mmcblk0 or mmcblk1.

U-Boot doesn't care, internal is always "0" and external is always "1".

The "proper" way to do this is to specify either the physical device path or the UUID of the partition with the root= kernel parameter.  I seem to recall this requires an initramfs, though, so I haven't looked into it.

Re: odd behaviour of uboot...

Ok, thats sound like a reasonable explaination. I will try creating an initrd next week to see if i can get it to reliably boot between sdcards. For now thanks for the notes and confirmation that I wasn't doing something silly.