I am running stock (unpatched) u-boot and linux with a custom environment and device tree on a Colibri VF50. I am trying to understand how my kernel is picking up the MTD partitioning, as this isn’t defined in the kernel or my device tree, and I am not passing this information through the kernel command line.
I’ve figured out that the partitioning is derived from the u-boot
mtdparts command line. First of all, here is
dev: size erasesize name mtd0: 00020000 00020000 "vf-bcb" mtd1: 00160000 00020000 "u-boot" mtd2: 00080000 00020000 "u-boot-env" mtd3: 07e00000 00020000 "ubi"
and here is
mtdparts (and deleting this environment variable does indeed result in an unpartitioned
# printenv mtdparts mtdparts=mtdparts=vf610_nfc:128k(vf-bcb)ro,1408k(u-boot)ro,512k(u-boot-env),-(ubi)
So far so good … but how does the kernel know this? Not from the command line:
# cat /proc/cmdline ubi.mtd=ubi rdinit=/sbin/init root=/dev/ram initrd=0x82100000,0x2eaf4e
I’m failing to find the right documentation, this is clearly part of the hand-off from u-boot to linux.
Is U-boot injecting this information into the DTS? If so presumably it’s somewhere under
/sys/firmware/devicetree, and presumably this is documented somewhere?
I’m keen to understand this so I don’t break my system by accident in the future!