Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

How do I boot custom kernel on BananaPI?

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
Author
Message
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

How do I boot custom kernel on BananaPI?

  • Quote

Post by szatox » 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):

Code: Select all

fatload mmc 0 0x43000000 board.dtb
fatload mmc 0 0x41000000 uImage
fatload mmc 0 0x45000000 uInitrd
bootm 0x41000000 0x45000000 0x43000000
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.

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_kernel

Code: 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
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.
Top
Roman_Gruber
Advocate
Advocate
Posts: 3854
Joined: Tue Oct 03, 2006 8:43 am
Location: Austro Bavaria

  • Quote

Post by Roman_Gruber » Wed Jun 29, 2016 10:34 pm

Generic answer: Please configure your bootloader.

*NIX run on most anything. And configuring is most of the time the same regardless the implementation.
The generated Image file is roughly twice as big.
Check what you have enabled and what you really need.
Check if you have choosen a proper compression for your kernel image.

Check and utilize if needed, the build in kernel command line and build in initramfs

GEneric answer: use a proper compression, set the needed parameters in the build in kernel command line, add any needed file in the build in kernel initramfs.


[/code]
Finally u-boot-sunxi succeeded and I burned it into SD card with dd
Nope and nope

You neeed to crosscompile software for your "target architecture"

We do not burn stuff to a SD card. it is flashed based. it is electronically earaseable. Burn is afaik used for worm media / optical media.

dd is just a special way to write to the SD card. And a very dangerous one. This can lead to data corruption when not done properly, with less knowledge / bad guide ...

http://linux-sunxi.org/U-Boot

Well i understand your pain because It seems to be some hardware hacks involved. And I doubt an ordinary user knows where to align those data sectors
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
ext2load mmc 0 0x43000000 script.bin
ext2load mmc 0 0x48000000 uImage
bootm 0x48000000
I nearly ruined a 400 dollars smartphone because of such insane nuts tutorials which could not explain / guide why those sectors are needed and such.

The guide for example lacks on how big the SD-Card in question should be and such.

--
U-Boot 2015.07+ won't start

If you're using a recent (device model based) U-Boot, and the SPL just hangs after initializing the DRAM (CPU: 912000000Hz, AXI/AHB/APB: 3/2/2 or something similar), chances are that your main U-Boot binary may be missing DTB information / a proper device tree. Depending on the (possibly outdated) instructions you followed: double-check that you're not incorrectly using u-boot.bin instead of u-boot-dtb.bin, or u-boot.img instead of u-boot-dtb.img.
--

Personal opinion:

Hardware hacks, lacks of proper explanation how and such. I had already my share of such stuff, If I were you I would stay away from such stuff.

It clearly visible that this hardware needs some machine readable section generated by the admin which later loads a payload which in your case is a bootloader, which payload later is the linux kernel ... and such.
--
Top
Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy