Building for Banana PI R2 => Kernel not booting

Hi all,

I am building the recent OpenWRT branch for Banana PI R2 and the build process completes successfully. Unfortunately I am not able to get the kernel to boot. Here is the output of the boot proecess:

bootargs=console=earlyprintk console=ttyS0,115200 console=tty1 fbcon=map:0 root=/dev/mmcblk1p2 rootfstype=ext4 rootwait vmalloc=496M debug=7 initcall_debug=0 video=1920x1080 drm.debug=0x7
3114208 bytes read in 156 ms (19 MiB/s)
## Booting kernel from Legacy Image at 80200000 ...
   Image Name:   MIPS OpenWrt Linux
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3114144 Bytes = 3 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

I have tried various settings already in the kernel_menuconfig screen but it does not work. The process I am using to create uImage file is as follows:

mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n 'MIPS OpenWrt Linux'  -d build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_mt7623/zImage ./uImage

Any idea why the kernel is not starting?

Thanks!

Bye

In image Makefile
KERNEL_LOADADDR:=0x40008000
Why do you load kernel at 8000800?

Thanks for that hint! I have changed the generation of uImage file and now the boot process gives the following output:

bootargs=console=earlyprintk console=ttyS0,115200 console=tty1 fbcon=map:0 root=/dev/mmcblk1p2 rootfstype=ext4 rootwait vmalloc=496M debug=7 initcall_debug=0 video=1920x1080 drm.debug=0x7
3114208 bytes read in 155 ms (19.2 MiB/s)
## Booting kernel from Legacy Image at 80200000 ...
   Image Name:   MIPS OpenWrt Linux
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3114144 Bytes = 3 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

undefined instruction
pc : [<8000007c>]          lr : [<fff99bed>]
reloc pc : [<01e6707c>]    lr : [<81e00bed>]
sp : ffb93778  ip : ffb9851a     fp : 00000400
r10: 00000000  r9 : ffb96ee0     r8 : 80200040
r7 : 00000000  r6 : 40008000     r5 : fffd6dac  r4 : 00000000
r3 : ffb96fb0  r2 : 80000100     r1 : 00000000  r0 : 00000000
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Code: 0000001b 0000001c 0000001d 0000001e (0000001f)
Resetting CPU ...

resetting ...

So now I get more output, but unfortunately it still doesn't work...

Do you know what are the correct settings for the kernel boot options during compilation? I have activated the following ones:

Also, what about dtb file? Do I need to merge it into uImage file?

Thanks!

Bye

Hi all,

I solved the issue myself. The missing part was to add dtb information into the uImage file:

cat build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_mt7623/zImage build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_mt7623/image-mt7623n-bananapi-bpi-r2.dtb > zImage-dtb

staging_dir/host/bin/mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n 'MIPS OpenWrt Linux'  -d zImage-dtb uImage

Maybe that helps somebody in the future.

Bye

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.