Forums

Skip to content

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

[Solved] Kernel and DTS address requirements

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
3 posts • Page 1 of 1
Author
Message
TJNII
l33t
l33t
User avatar
Posts: 648
Joined: Sun Nov 09, 2003 3:16 am
Location: for(;;);

[Solved] Kernel and DTS address requirements

  • Quote

Post by TJNII » Sun Jun 16, 2024 2:45 pm

I'm trying to understand the requirements for the load address used in u-boot when booting the kernel, beyond just being a address in ram.

I have a OrangePi Zero H2+ booting using:

uImage: 0x4200:0000
DTB: 0x4300:0000

For the Allwinner H2+ (H3) the DDR RAM is mapped to 0x4000:0000 - 0xBFFF:FFFF.

So using the 0x4000:0000 range makes sense that the load command is loading the files into memory to be booted. However, I don't understand any address offset requirements within the RAM address space.

- For uImage I got 0x4200:0000 from Armbian U-Boot messages, I've been using a Armbian boot as a reference.
- I also used 0x4200:0000 for LOADADDR passed to the kernel `make uimage` command. I assume this should be the same as uses in U-Boot but that's an assumption.
- For the DTB file I just picked 0x4300:0000 as another address in RAM past the end of the kernel.

In searching I've been mostly finding examples of addresses, but no explanation of the offsets used within the ram space. Are there requirements that should be followed with these or does the kernel relocate off somewhere else and take over, such that the initial offsets don't matter? Why does the kernel uImage need the address baked in?
Last edited by TJNII on Thu Jun 20, 2024 2:26 pm, edited 1 time in total.
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2186
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

  • Quote

Post by pingtoo » Sun Jun 16, 2024 7:05 pm

TJNII,

Can you translate those 0xAAAA:BBBB notion into where in u-boot you set them? I am under impression that usually it is just a straight 0xAAAAA notion.

the LOADADDR in kernel build usually point to where the entry point to the kernel code. it is use to let u-boot know when u-boot finish load kernel into memory where to jump to transfer the execution.

DTB is kernel specific parameter, it is u-boot let kernel know where to find DT (device tree) so kernel can initialize. you can set it to anywhere as long as it is not overlapping with kernel address. usually is in lower address space. (kernel usually relocate itself to high address space)
Top
TJNII
l33t
l33t
User avatar
Posts: 648
Joined: Sun Nov 09, 2003 3:16 am
Location: for(;;);

  • Quote

Post by TJNII » Thu Jun 20, 2024 2:26 pm

> Can you translate those 0xAAAA:BBBB notion into where in u-boot you set them?

Those are the addresses, the 0x and : are just sugar for human readability.

Code: Select all

ext2load mmc 0:1 42000000 boot/uImage
ext2load mmc 0:1 43000000 boot/sun8i-h2-plus-orangepi-zero.dtb
bootm 42000000 - 43000000
Doing a bit more digging and reading I've learned a bit more:

- UBoot reserves 8MB of memory at the start of the range, so BASE_ADDRESS + 0x00 to BASE_ADDRESS + 0x007f:ffff is reserved.
- This SOC reserves an address range of 2GB, but the board only has 512MB. So the real usable address range is 0x4000:0000 - 0x5fff:ffff. Taking the U-Boot reservation into consideration that narrows to 0x4080:0000 - 0x5fff:ffff

This guide does into how the kernel boots on ARM: https://people.kernel.org/linusw/how-th ... compresses

I didn't find too much high level info on where the kernel decompresses, I got the impression the majority of users don't need to know or care, so there isn't much surface level discussion. There's several options on how the kernel might relocate, so there isn't a fixed & superficial "Relocate to within this range" setting. As for where the kernel relocates to I think I'm going to accept "It's complicated, involves multiple factors, and I don't have time to do the deep dive necessary to understand them right now." I think the spirit of my question has been answered, these addresses aren't critical as long as they're outside the U-Boot reserved range and reasonably low.
Top
Post Reply
  • Print view

3 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

 

 

magic