V4.5.x+ mmc re-numbering changes

With v4.5.x+ kernel’s, the mmc layer got a large change:

mmc: core: Optimize boot time by detecting cards simultaneously

mmc: block: Use the mmc host device index as the mmcblk device index

On devices such as the WandBoard:

4.5.5-armv7-x2     
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT 
mmcblk2     179:0    0 14.9G  0 disk 
└─mmcblk2p1 179:1    0 14.9G  0 part / 

4.4.11-armv7-x7 
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT 
mmcblk0     179:0    0 14.9G  0 disk 
└─mmcblk0p1 179:1    0 14.9G  0 part /

To fix this, i’ve patched u-boot to pass:

debian@arm:~$ cat /proc/cmdline 
console=ttymxc0,115200 root=PARTUUID=c670c72b-01 ro rootfstype=ext4 rootwait 

root=PARTUUID=c670c72b-01

Instead of:
root=/dev/mmcblk0p1

In linux this value can be found via blkid:

debian@arm:~$ sudo blkid 
/dev/mmcblk0p1: LABEL="rootfs" UUID="205eeeb8-402c-40d8-a51c-15657cfe76f0" TYPE="ext4" PARTUUID="c670c72b-01" 
/dev/mmcblk0: PTUUID="c670c72b" PTTYPE="dos" 

Or in u-boot via:

=> part uuid mmc 0:1
c670c72b-01

=> part list mmc 0
Partition Map for MMC device 0  --   Partition Type: DOS   

Part Start Sector Num Sectors UUID Type   
1 2048       31114240   c670c72b-01 83 Boot 

Device Table:

WandBoard:

mmc0 : Secondary microSD
mmc2 : Boot microSD

Only Boot microSD:
mmc2: /dev/mmcblk0 -> /dev/mmcblk2

Both microSD's:
mmc0: /dev/mmcblk0 -> /dev/mmcblk0
mmc2: /dev/mmcblk1 -> /dev/mmcblk2

Regards,

1 Like