U-boot & grub - mmc

Hi

so I managed to install grub-efi, and add trixie

I have the boot and efi on mmc partitions, and the root on the nvme.

I have now a problem as that /boot and /efi both on the mmcblk0p5 & mmcblk0p5 can’t be found during boot (they are on fstab)

[DEPEND] Dependency failed for systemd-fsck…ile System Check on /dev/mmcblk0p5.
[DEPEND] Dependency failed for boot.mount - /boot.
[DEPEND] Dependency failed for local-fs.target - Local File Systems.
[DEPEND] Dependency failed for boot-efi.mount - /boot/efi.
[ TIME ] Timed out waiting for device dev-mmcblk0p6.device - /dev/mmcblk0p6.
[DEPEND] Dependency failed for systemd-fsck…ile System Check on /dev/mmcblk0p6.

any clues why this is happening ? thank you

all works fine if I boot via u-boot and fit image

Is fsck.vfat installed? What is the output of

lsblk

yes all is installed - as said if I use u-boot with fit all is fine … when I use grub-efi the mmc is not loaded I check the dtb that is attached to the devicetree entry on grub and has the mmc …

Applied the sdmmc/emmc dts overlay?

I have the devicetree on the grub entry and run u-boot using the following command

rungrub=setenv kaddr 0x48000000;setenv dtaddr 0x50000000; load mmc 0:6 0x48000000 EFI/BOOT/grubaa64.efi;load mmc 0:5 0x50000000 bpi-r4-new1.dtb;bootefi ${kaddr} ${dtaddr}

grub entry

menuentry 'Debian (EFI) test' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-ccb30712-0dd6-447f-97de-d45ef39e3e76' {
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt5'
        insmod part_msdos
        insmod fat
        search --no-floppy --fs-uuid --set=root C6D9-D3B2
        echo 'Loading Linux ...'
        linux (hd0,gpt5)/Image.gz root=UUID=1c65c141-24ad-4de5-9bbf-623e26c53f51 rootfstype=ext4 rootwait console=ttyS0,115200n1 earlycon=uart8250,mmio32,0x11000000
        echo 'Loading initial ramdisk ...'
        initrd (hd0,gpt5)/initrd.img-6.17.0-bpi-r4-mda-main-gf81d87edf2f1-dirty
        echo 'Loading Devicetree ...'
        devicetree (hd0,gpt5)/bpi-r4-new1.dtb

Can you check the contents of bpi-r4-new1.dtb, using the dtc tool to output in text format?

Dump it here in a code block?

dtc -I dtb -O dts -o -  bpi-r4-new1.dtb  | grep -A4 -E 'mmc|sdhci|mmc@'
<stdout>: Warning (unit_address_vs_reg): /soc/t-phy@11c50000: node has a unit name, but no reg or ranges property
<stdout>: Warning (unit_address_vs_reg): /soc/xs-phy@11e10000: node has a unit name, but no reg or ranges property
<stdout>: Warning (simple_bus_reg): /soc/t-phy@11c50000: missing or empty reg/ranges property
<stdout>: Warning (simple_bus_reg): /soc/xs-phy@11e10000: missing or empty reg/ranges property
                        mmc0-emmc-45-pins {
                                phandle = <0x4b>;

                                mux {
                                        function = "flash";
                                        groups = "emmc_45";
                                };
                        };

                        mmc0-emmc-51-pins {
                                phandle = <0x4c>;

                                mux {
                                        function = "flash";
                                        groups = "emmc_51";
                                };
                        };

                        mmc0-sdcard-pins {
                                phandle = <0x4d>;

                                mux {
                                        function = "flash";
--
                mmc@11230000 {
                        compatible = "mediatek,mt7988-mmc";
                        reg = <0x00 0x11230000 0x00 0x1000 0x00 0x11d60000 0x00 0x1000>;
                        interrupts = <0x00 0x8f 0x04>;
                        clocks = <0x09 0x3f 0x09 0x40 0x09 0x42 0x09 0x41>;
                        assigned-clocks = <0x03 0x28 0x03 0x29>;
--
                mmc0_pins_emmc_45 = "/soc/pinctrl@1001f000/mmc0-emmc-45-pins";
                mmc0_pins_emmc_51 = "/soc/pinctrl@1001f000/mmc0-emmc-51-pins";
                mmc0_pins_sdcard = "/soc/pinctrl@1001f000/mmc0-sdcard-pins";
                spi0_flash_pins = "/soc/pinctrl@1001f000/spi0-flash-pins";
                pwm = "/soc/pwm@10048000";
                sgmiisys0 = "/soc/syscon@10060000";
                sgmiipcs0 = "/soc/syscon@10060000/pcs";
--
                mmc0 = "/soc/mmc@11230000";
                pcie2 = "/soc/pcie@11280000";
                pcie_intc2 = "/soc/pcie@11280000/interrupt-controller";
                pcie3 = "/soc/pcie@11290000";
                pcie_intc3 = "/soc/pcie@11290000/interrupt-controller";

Please show the entire (or full mmc node) output?

let me know if you want the entire dtb …

mmcblk0 is not listed with lsblk?

At least the

mmc@11230000 {
}

Full block

                mmc@11230000 {
                        compatible = "mediatek,mt7988-mmc";
                        reg = <0x00 0x11230000 0x00 0x1000 0x00 0x11d60000 0x00 0x1000>;
                        interrupts = <0x00 0x8f 0x04>;
                        clocks = <0x09 0x3f 0x09 0x40 0x09 0x42 0x09 0x41>;
                        assigned-clocks = <0x03 0x28 0x03 0x29>;
                        assigned-clock-parents = <0x03 0x11 0x1c 0x0b>;
                        clock-names = "source", "hclk", "axi_cg", "ahb_cg";
                        #address-cells = <0x01>;
                        #size-cells = <0x00>;
                        status = "disabled";
                        max-frequency = <0x3197500>;
                        phandle = <0x5f>;
                };

:slight_smile:

Fill some space…

This may explain it a bit.

The emmc overlay has not been applied. You can use the fdtoverlay command.

but this is exactly the same dtb i am using for u-boot and mmc show’s up there

ok so would it be something like ?

fdtoverlay -v -i bpi-r4-new1.dtb -o bpi-r4-new1-emmc-merged.dtb mt7988a-bananapi-bpi-r4-emmc.dtbo

Looks ok, just examine the result with dtc to text as you did before…

Athough I really appreciate the efforts and there is also much to gain, I do believe it is a more simple setup to enable distroboot in U-Boot. You can have ATF+U-Boot in emmc or nand and the boot partition on the nvme, or even just a boot folder on the rootfs, if it is btrfs, using just 1 partition in total on nvme. Distroboot should also support loading and applying the overlay by U-Boot (although I am already using the fdtoverlay command, because of other bootchain options.)

extlinux.conf also gives you a menu :wink:

See:;

all good thx @ericwoud