PowerPC/e500: how is FDT access supposed to work?
Daniel Wohllebe
daniel.wohllebe at nepdrive.de
Fri Nov 22 11:19:04 UTC 2024
Hello Chris,
apologies for the (very) late response, however, I was able to make a
lot of progress in the meantime and can now comment on this matter with
much more confidence.
Yes, do believe that amendents to the user manual would be helpful.
Before that, let me give you a little overview of what else I
encountered, since this will be relevant, too:
After managing to load the application, I was surprised to see, that the
qoriq_e500 BSP would not run on the QEMU emulator without hanging up
immediatly. The emulator models a machine with an e500v2 core, which is
the one present in the P2010 and P2020 chips indicated in the manual. I
found out that the issue is the extended 36-bit address space in
contrast to the 32-bit addressing scheme of the e500v1. For the emulated
machine this meant that addresses for peripheral units went into the
upper range, which the BSP has no way to access. This usually leads to a
memory access error whenever the serial ports have to be accessed to
print text.
I solved this issue for myself by modifying the linkcmds to use a
different qoriq base address (0xe000'0000) and amended some code in
bsps/powerpc/qoriq/start/mmu.c that would write 0xf to cur->mas7 in
qoriq_mmu_write_to_tlb1 when appropriate, thus giving me a way to reach
the needed 0xf'e000'0000 base address space.
Considering my earlier issues with booting up my application inside
QEMU, I also found out that I can save myself a lot of headaches by
simply declaring the application as a kernel, using this command line
for example:
`qemu-system-ppc -machine ppce500 -cpu e500v2 -nographic -kernel
<application_image>`
otherwise, if one wishes to enter the U-Boot menu, it is possible to use:
`qemu-system-ppc -machine ppce500 -cpu e500v2 -nographic -device
loader,file=<application_image>,addr=0x2000000,force-raw=on`
So, with all that I learned, I would suggest the following improvements
to the manual:
- Indicate that the BSP in the current state only supports machines that
use the 32-bit address space, which can be an issue with machines using
the e500v2 core.
- Add a note that the BSP is not compatible with the default ppce500
generic platform on QEMU (unless there is something that I missed).
Kind Regards,
Daniel
More information about the users
mailing list