Power & Source of Big Ideas

nanopi-neo-plu2: mmcblk device numbering

Moderators: chensy, FATechsupport

Hi,

I've built my own kernel and u-boot as described here: http://wiki.friendlyarm.com/wiki/index. ... _and_Linux

When I come to boot the SD card, u-boot passes a "root=mmcblk0" command line parameter to the kernel, but when the kernel boots it enumerates the first mmc device as "mmcblk1" (and there's also an mmcblk2, the built-in eMMC). Since this doesn't match the rootfs passed in to the kernel, VFS panics.

How do I make the kernel's device enumeration start at mmcblk0? I've tried changing the node names in the .dts file and building a new sun50i-h5-nanopi-neo-plus2.dbt to no avail.
I was able to fix this by mounting the boot partition from the provided xenial sd-card image and examining their boot setup, which includes these two magic lines:

Code: Select all

fdt addr ${dtb_addr}
fdt set mmc${boot_mmc} boot_device <1>


"boot_device" is an undocumented (and poorly named?) DTB property. In the sun50i-h5-nanopi-neo-plus2.dts file provided it is set to <0> for both mmc0 and mmc2.

From reading the sunx_mmc source code, its purpose seems to be "make this device appear as mmcblk0".
blowback wrote:
I was able to fix this by mounting the boot partition from the provided xenial sd-card image and examining their boot setup, which includes these two magic lines:

Code: Select all

fdt addr ${dtb_addr}
fdt set mmc${boot_mmc} boot_device <1>


"boot_device" is an undocumented (and poorly named?) DTB property. In the sun50i-h5-nanopi-neo-plus2.dts file provided it is set to <0> for both mmc0 and mmc2.

From reading the sunx_mmc source code, its purpose seems to be "make this device appear as mmcblk0".


Check Armbian. It uses UUID since some time on all boards. You can also check how it is solved ...

Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 6 guests