How do I boot custom kernel on BananaPI?
Posted: Sun Jun 26, 2016 11:47 am
Some time ago I got an old BananaPI board with some ancient linux on an SD card.
Replacing userland sort of works. I haven't figured out all the tricks with cross-compiling, but the minimal userland I stuffed in there does work.
Now I want to replace the kernel 3.4-sunxi with 4.5-gentoo (it comes with a default config for sunxi so it should work, right?). Or anything I can actually configure. U-boot appears to be the only bootloader for ARM out there, yet I can't really find any useful information on it.
When I build kernel with cross "make uimage", I get something u-boot recognizes and attempts to boot, but the output to UART drops afterwards ( I replaced uImage on the FAT boot partition)
When I attempt to create either kernel or initramfs manually with mkimage, u-boot complains it's in wrong format and falls back to builtin defaults.
Finally, it seems that there are 2 ways to boot: legacy one using script.bin, and a new one (for newer kernels) using dtb. I found examples of both ways for banana on sunxi's wiki, but neither works for me.
dtb example goes like this (of course replaced board.dtb with an actual filename):
So... Any ideas? How do you prepare and run your custom kernels on arm boards?
Also, how do numbers known to mkimage relate to numbers in uEnv.txt (or, do they)? Below is a working, legacy config running the provided kernel.
And one more... The uImage generated with make uimage is very similar in size to zImage. The generated Image file is roughly twice as big. Why does mkimage recognize this uImage as "uncompressed"?
I also tried compiling u-boot from a main git repo and snapshot. One was damaged, the other failed to build. Finally u-boot-sunxi succeeded and I burned it into SD card with dd, but I don't see any difference at all compared to the earlier one.
Replacing userland sort of works. I haven't figured out all the tricks with cross-compiling, but the minimal userland I stuffed in there does work.
Now I want to replace the kernel 3.4-sunxi with 4.5-gentoo (it comes with a default config for sunxi so it should work, right?). Or anything I can actually configure. U-boot appears to be the only bootloader for ARM out there, yet I can't really find any useful information on it.
When I build kernel with cross "make uimage", I get something u-boot recognizes and attempts to boot, but the output to UART drops afterwards ( I replaced uImage on the FAT boot partition)
When I attempt to create either kernel or initramfs manually with mkimage, u-boot complains it's in wrong format and falls back to builtin defaults.
Finally, it seems that there are 2 ways to boot: legacy one using script.bin, and a new one (for newer kernels) using dtb. I found examples of both ways for banana on sunxi's wiki, but neither works for me.
dtb example goes like this (of course replaced board.dtb with an actual filename):
Code: Select all
fatload mmc 0 0x43000000 board.dtb
fatload mmc 0 0x41000000 uImage
fatload mmc 0 0x45000000 uInitrd
bootm 0x41000000 0x45000000 0x43000000Also, how do numbers known to mkimage relate to numbers in uEnv.txt (or, do they)? Below is a working, legacy config running the provided kernel.
Code: Select all
# uEnv.txt
bootargs=console=ttyS0,115200 console=tty0 disp.screen0_output_mode=EDID:1280x720p50 hdmi.audio=EDID:0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
aload_script=fatload mmc 0 0x43000000 script.bin;
aload_kernel=fatload mmc 0 0x48000000 uImage; bootm 0x48000000;
uenvcmd=run aload_script aload_kernelCode: Select all
# mkimage
Image Name: Linux-3.4.90
Created: Wed Jul 23 04:10:11 2014
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4801560 Bytes = 4689.02 kB = 4.58 MB
Load Address: 40008000
Entry Point: 40008000
I also tried compiling u-boot from a main git repo and snapshot. One was damaged, the other failed to build. Finally u-boot-sunxi succeeded and I burned it into SD card with dd, but I don't see any difference at all compared to the earlier one.