Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDT pointer value is incorrectly set. #3

Open
Synoia opened this issue Sep 14, 2016 · 1 comment
Open

FDT pointer value is incorrectly set. #3

Synoia opened this issue Sep 14, 2016 · 1 comment

Comments

@Synoia
Copy link

Synoia commented Sep 14, 2016

FDT address: void* ptr = (char*) 0x100;

per this thread: https://www.raspberrypi.org/forums/viewtopic.php?t=134018

The DTB start address is size dependent. The aim is to copy the DTB as high as possible. Once the kernel starts it will "unflatten" the DTB into allocated memory and then re-use the space.
1
ARM memory starts at 0 in the VPU physical address space. The GPU memory sits at the top. This is how it works:

Code: Select all
ARMMEM_END = MEM_SIZE - GPU_MEM

// Leave 64KB for GRUB
free_end = ALIGN_DOWN(ARMMEM_END - 0x10000, 0x1000)

// Leave space for initramfs, if there is one
free_end = ALIGN_DOWN(free_end - initramfs_size, 0x1000)

device_tree_address = ALIGN_DOWN(free_end - device_tree_size, 0x100)

Don't forget that the address of the DTB is passed in register r2 to the kernel/U-boot entry point, with r0 holding 0 and r1 being 3138 (the BCM2708 machine id).

@Synoia
Copy link
Author

Synoia commented Sep 14, 2016

Code line referenced is at: github.com/msmuenchen/u-boot/blob/master/board/raspberrypi/rpi/rpi.c#L263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant