[U-Boot-Users] PXA (XScale) memory layout

Hi folks,
is there any particular reason why the PXA uses a different memory layout than the other ARMs?
It seems to be causing a certain amount of grief (and dirty workarounds, like e.g. in board/wepep250/wepep250.c lines 43..53) that cpu/pxa/start.S places stack (and heap) below the code instead of above.
I'd be grateful if somebody could enlighten me on this.
cheers Anders

On Thu, Sep 11, 2003 at 04:02:52PM +0200, Anders Larsen wrote:
is there any particular reason why the PXA uses a different memory layout than the other ARMs?
The boards I have ported use the memory layout which is documented in the README. Unfortunately, due to historical reasons the old ARMboot code uses another scheme and nobody had the time to fix this "the right way".
It seems to be causing a certain amount of grief (and dirty workarounds, like e.g. in board/wepep250/wepep250.c lines 43..53) that cpu/pxa/start.S places stack (and heap) below the code instead of above.
My -ptx patches have a hack for this, but I agree with Wolfgang that somebody should fix it correctly instead of applying workarounds...
Robert

Robert Schwebel robert@schwebel.de schreibt:
The boards I have ported use the memory layout which is documented in the README. Unfortunately, due to historical reasons the old ARMboot code uses another scheme and nobody had the time to fix this "the right way".
Hi Robert,
even the relatively new (added sometime after 0.4.0) ARM925T code uses the old scheme...
I fully agree, though, that the documented scheme is better (having the stack grow downwards towards the code can lead to interesting side- effects ;-)
It seems to be causing a certain amount of grief (and dirty workarounds, like e.g. in board/wepep250/wepep250.c lines 43..53) that cpu/pxa/start.S places stack (and heap) below the code instead of above.
My -ptx patches have a hack for this, but I agree with Wolfgang that somebody should fix it correctly instead of applying workarounds...
AFAICT, cpu/pxa/cpu.c just needs to set
_armboot_real_end = TEXT_BASE - CFG_MALLOC_LEN;
in cpu_init(), then no further "würgarounds" are needed for PXA boards.
After that, it's not too much work to fix the other ARMs, since the entire magic plays in cpu/.../
Or did I miss something?
Cheers Anders

In message fc.004c4e48001c9311004c4e48001c9311.1c932e@rea.de you wrote:
is there any particular reason why the PXA uses a different memory layout than the other ARMs?
It's just that the ARM port (which comes from the ARMBoot project) was implemented differently than everything else. So far, nobody had enough resources to clean this up.
It seems to be causing a certain amount of grief (and dirty workarounds, like e.g. in board/wepep250/wepep250.c lines 43..53) that cpu/pxa/start.S places stack (and heap) below the code instead of above.
It is CORRECT to have stack and heap below the code.
I'd be grateful if somebody could enlighten me on this.
It's just hysterical reasons - ARMBoot was implemented that way. I don't know why they broke the PPCBoot style.
Best regards,
Wolfgang Denk

On Thu, Sep 11, 2003 at 09:52:36PM +0200, Wolfgang Denk wrote:
It is CORRECT to have stack and heap below the code.
The README has a nice chapter about how it _should_ be (and is in -ptx).
It's just hysterical reasons - ARMBoot was implemented that way. I don't know why they broke the PPCBoot style.
s/hysterical/historical/ :-)
Robert

In message 20030912051035.GX8367@pengutronix.de you wrote:
It's just hysterical reasons - ARMBoot was implemented that way. I don't know why they broke the PPCBoot style.
s/hysterical/historical/ :-)
Oops. Seems my spelcheker is brocken ;-)
Best regards,
Wolfgang Denk

Wolfgang Denk wd@denx.de schreibt:
In message fc.004c4e48001c9311004c4e48001c9311.1c932e@rea.de you wrote:
It seems to be causing a certain amount of grief (and dirty workarounds, like e.g. in board/wepep250/wepep250.c lines 43..53) that cpu/pxa/start.S places stack (and heap) below the code instead of above.
It is CORRECT to have stack and heap below the code.
I fully agree - only, the PXA implementation is incomplete; it places the stack below the code and reserves space for the heap below the code too, but it does not set the heap start address (which lib_arm/board.c expects to find in _armboot_real_end), so U-Boot crashes when start_armboot() calls mem_malloc_init(_armboot_real_end)!
board/wepep250/wepep250.c contains an incorrect workaround, which places the heap above the code (leaving a huge hole below the code), the other PXA boards cannot work as is (so they probably haven't been tested after the code was copied from ARMboot).
BTW, the problem is partly documented with a FIXME comment in cpu/pxa/cpu.c
As soon as I've figured out exactly how to initialize IRQ_STACK_START and FIQ_STACK_START consistently, I'll submit a patch.
If you wish, I'd volunteer to fix the other ARM implementations, too (but I only have access to PXA hardware for testing).
Cheers Anders

On Fri, Sep 12, 2003 at 10:02:36AM +0200, Anders Larsen wrote:
If you wish, I'd volunteer to fix the other ARM implementations, too (but I only have access to PXA hardware for testing).
If you want to have access to a testbed tell me when you want to hack on the code. I can setup a PXA machine in our Remote Lab.
Robert

Dear Anders,
in message fc.004c4e48001c970e3b9aca00f6c2ed17.1c9734@rea.de you wrote:
I fully agree - only, the PXA implementation is incomplete; it places the stack below the code and reserves space for the heap below the code too, but it does not set the heap start address (which lib_arm/board.c expects to find in _armboot_real_end), so U-Boot crashes when start_armboot() calls mem_malloc_init(_armboot_real_end)!
I know, but I don't have a PXA board here to test anything myself. Patches are welcome (they should try not to break the other ARM based systems, though).
As soon as I've figured out exactly how to initialize IRQ_STACK_START and FIQ_STACK_START consistently, I'll submit a patch.
Thanks n advance.
If you wish, I'd volunteer to fix the other ARM implementations, too (but I only have access to PXA hardware for testing).
That would be excellent. I can test on some ARM9 systems. For the rest, the names and email addresses of the board maintainers are in the MAINATINERS files.
Best regards,
Wolfgang Denk
participants (4)
-
Anders Larsen
-
Robert Schwebel
-
Robert Schwebel
-
Wolfgang Denk