[BPI-R3 Mini] [SOLVED] Debian installer (upstream) stuck

Sure, that part is clear. U-boot can pass board specific devicetree to GRUB (EFI loader) correctly. But GRUB then not pass it to the kernel when it loads it. So the bootlog provided above pretty much what one get if try to load the kernel without devicetree.

Yes, right now the installer can boot successfully if I manually configure a valid devicetree path in GRUB. It successfully recognized the NVMe and installed Ubuntu into it.

1 Like

https://docs.kernel.org/admin-guide/efi-stub.html

Can add the commandline options initrd= and dtb= to the vmlinuz.efi if I understand correctly, using the correct path.

1 Like

Quick status update. I enabled bootefi command on your fork. Temporarly disabled non-R3 mini targets just to speed up the CI. The resulting u-boot is able to boot GRUB and then Linux from the NVMe.

The boot commands at u-boot:

usb start
pci enum
nvme scan
setenv kernel_addr_r 0x40008000
setenv fdt_addr_r 0x40000000
fatload usb 0:1 ${fdt_addr_r} mt7986a-bananapi-bpi-r3-mini.dtb
fatload nvme 0:1 ${kernel_addr_r} EFI/ubuntu/shimaa64.efi
bootefi ${kernel_addr_r} ${fdt_addr_r}

Before booting straight to the NVMe, I copied to devicetree into th NVMe rootfs (/boot/mt7986.dtb). This might not required as pointed out Eric in the previous comment. Contrary to my prevoius comments, GRUB might actually pass devicetree to the kernel, and the issue actually solved by the clk_ignore_unused pd_ignore_unused cma=128M argument. To be foolproof, I added it regardless.

Then I edited GRUB menuentry just to boot into the system:

menuentry 'Ubuntu BananaPi R3 mini' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-0bc688a8-9da8-4167-9a53-fff27df09ebe' {
	recordfail
	load_video
	gfxmode $linux_gfx_mode
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_gpt
	insmod ext2
	search --no-floppy --fs-uuid --set=root 0bc688a8-9da8-4167-9a53-fff27df09ebe
	devicetree /boot/mt7986.dtb
	linux	/boot/vmlinuz root=UUID=0bc688a8-9da8-4167-9a53-fff27df09ebe ro  console=ttyS0,115200n8 crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M clk_ignore_unused pd_ignore_unused cma=128M
	initrd	/boot/initrd.img
}

This boot straight to the system. Some TODO/missing pieces:

  • wifi driver not loaded at startup, the module have to loaded manually
  • eMMC not visible, lsblk only see the NVMe
  • ethernet not working, probably due to the missing firmware (the driver looking at the eMMC)

Hopefully I will have time to investigate these.

Both (wifi+ethernet) on r3mini need firmware in /lib/firmware on defined rootfs (nvme) to work and of course kernel modules in /lib/modules/$(uname -r). For modules you can add the module name to /etc/modules.conf or afair in modprobe.d