BPI-F3 :Kernel hangs on `Starting Kernel ...` with u-boot

I have built u-boot from source (which includes files such as FSBL, u-boot proper, and bootinfo_*). I have flashed the u-boot FSBL.bin to the emmc along with bootinfo file. The FSBL is working fine. I configured the FSBL to take u-boot proper through Y-modem instead of finding it in the partition.

Once the u-boot FSBL starts, I provide it with u-boot proper through UART Y-modem. The u-boot proper is also working fine and boots to the autoboot console. Then I use tftpboot to transfer the kernel uImage to the u-boot proper at the memory address which is indicated by “Image load offset from start of RAM when load kernel to RAM” option (by default it is 0x2000000). I also load the dtb to memory at a different offset from kernel. The loaded kernel is converted to uImage using following command before transferring to u-boot:

mkimage -A riscv -O linux -T kernel -C none -a 0x2000000 -e 0x2000000 -n "Linux Kernel" -d Image uImage

Now issue is that when I boot the kernel with dtb using bootm command on the u-boot proper which I transferred using Y-modem, the kernel stuck at Starting Kernel ...:

## Booting kernel from Legacy Image at 00200000 ...
[ 332.526]    Image Name:   Linux Kernel
[ 332.529]    Image Type:   RISC-V Linux Kernel Image (uncompressed)
[ 332.535]    Data Size:    34397696 Bytes = 32.8 MiB
[ 332.540]    Load Address: 00200000
[ 332.543]    Entry Point:  00200000
   Verifying Checksum ... OK
[ 332.702] ## Flattened Device Tree blob at 08000000
[ 332.704]    Booting using the fdt blob at 0x8000000
[ 332.709]    Loading Kernel Image
[ 332.735]    Loading Device Tree to 000000007dd7d000, end 000000007dd95167 ... OK

Starting kernel ...

This does not happen when I suspend the boot from bianbu linux and use its u-boot to boot the kernel from tftp.

Can someone tell me what am I doing wrong?

U-boot and linux which I am using are present on bianbu Linux link: Banana Pi BPI-F3 | BananaPi Docs

I am getting the same problem when manually booting my kernel from u-Boot via bootm or booti command. May someone from banana pi team give instructions how to make the right kernel format for u-boot and how to boot it? My own kernel is also stuck on Starting kernel …

Thanks.

Well. I tried using the Bianbu Linux U-boot to boot the kernel and it worked out alright. Makes me think the opensbi is the culprit here. Did you flash partition of sd card or emmc (whatever you are using) with opensbi fw_dynamic.bin? For testing purpose you can flash sd card with bianbu linux and interrupt the booting process by holding s key on keyboard before the kernel boots and it will take you straight to the u-boot. From there you can try to load the kernel

I’m using a custom u-boot. With the reverse engineered DDR Init. It does not boot the kernel sadly for me but gets into the u-boot environment successfully.

If you have not flashed opensbi to any partition, there will be nothing to handle the supervisor to machine mode calls and thus it stuck (that’s what my observation is)

Alright thank you, I see. Maybe that it the problem. I’ll try to check.