Search code examples
linuxkernelstm32

Kernel can't find rootfs on STM32MP151


I'm trying to get a board based on this module up and running using recent boot stages and kernel (6.1.*).
Can't use the manufacturer provided files, because those are atleast two years old and incomptatible.
This mainly comes down to writing the device tree and using these with Yocto following the ST guide. So far I've experienced a lot of issues which were mostly caused by migration or bad docs.

The current issue i'm trying to resolve, is that while trying to start the kernel it can't find the rootfs.

Starting systemd-udevd version 253.1^
root '/dev/disk/by-partuuid/491f6117-415d-4f53-88c9-6e0de54deac6' doesn't exist or does not contain a /dev.

First thing I checked is that the uuid of that partition is indeed correct.

According to mmc part used in u-boot (snippet):

 8     0x0002d000      0x00747bff      "rootfs"
        attrs:  0x0000000000000000
        type:   0fc63daf-8483-4772-8e79-3d69d8477de4
                (linux)
        guid:   491f6117-415d-4f53-88c9-6e0de54deac6

Which matches, so that's not it. With ums mmc 1 I confirmed that the rootfs indeed contains a folder named dev.

Other option was something wrong with the sdmmc node in the devicetree. But that's copy paste of the u-boot one and it found the bootfs that contains the kernel.

Next up was something wrong with the regulators in the device tree. Missing or incorrect 'compatible' setup. Changed it based on this and the pmic dtbindings but didn't make a difference either.

That was pretty much the only relevant thing I could find. Any ideas on what might cause this? The device tree in question can be found here.

Other things I've tried so far:

  • Build the kernel and rootfs without yocto, to have more control over it. Didn't help.
  • Build optee with debug level on 4, didn't provide new info.
  • Replaced 'partuid' (the word) with uuid in extlinux.conf, didn't make a difference.
  • Tried to figure out what happens between u-boot loading and it loading the kernel (so what does bootcmd actually do), everything works as expected.
  • Went through the docs again to see if i missed something, found one thing. That fixed something else, but not the rootfs issue.
  • The fs didn't seem to be resized to the partition size (no idea why), so tried manually doing that. Didn't resole it either.

Solution

  • Those three lines weren't inside the pmic: stpmic@33 node and caused all the issues...

    interrupts-extended = <&exti 55 IRQ_TYPE_EDGE_FALLING>;
    interrupt-controller;
    #interrupt-cells = <2>;