* [U-Boot-Users] PXA (XScale) memory layout
@ 2003-09-11 14:02 Anders Larsen
2003-09-11 15:21 ` Robert Schwebel
2003-09-11 19:52 ` Wolfgang Denk
0 siblings, 2 replies; 9+ messages in thread
From: Anders Larsen @ 2003-09-11 14:02 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] PXA (XScale) memory layout
2003-09-11 14:02 [U-Boot-Users] PXA (XScale) memory layout Anders Larsen
@ 2003-09-11 15:21 ` Robert Schwebel
2003-09-11 15:38 ` Anders Larsen
2003-09-11 19:52 ` Wolfgang Denk
1 sibling, 1 reply; 9+ messages in thread
From: Robert Schwebel @ 2003-09-11 15:21 UTC (permalink / raw)
To: u-boot
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
--
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hornemannstra?e 12, 31137 Hildesheim, Germany
Phone: +49-5121-28619-0 | Fax: +49-5121-28619-4
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot-Users] PXA (XScale) memory layout
2003-09-11 15:21 ` Robert Schwebel
@ 2003-09-11 15:38 ` Anders Larsen
0 siblings, 0 replies; 9+ messages in thread
From: Anders Larsen @ 2003-09-11 15:38 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] PXA (XScale) memory layout
2003-09-11 14:02 [U-Boot-Users] PXA (XScale) memory layout Anders Larsen
2003-09-11 15:21 ` Robert Schwebel
@ 2003-09-11 19:52 ` Wolfgang Denk
2003-09-12 5:10 ` Robert Schwebel
2003-09-12 8:02 ` Anders Larsen
1 sibling, 2 replies; 9+ messages in thread
From: Wolfgang Denk @ 2003-09-11 19:52 UTC (permalink / raw)
To: u-boot
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
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
"One thing they don't tell you about doing experimental physics is
that sometimes you must work under adverse conditions... like a state
of sheer terror." - W. K. Hartmann
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] PXA (XScale) memory layout
2003-09-11 19:52 ` Wolfgang Denk
@ 2003-09-12 5:10 ` Robert Schwebel
2003-09-12 19:13 ` Wolfgang Denk
2003-09-12 8:02 ` Anders Larsen
1 sibling, 1 reply; 9+ messages in thread
From: Robert Schwebel @ 2003-09-12 5:10 UTC (permalink / raw)
To: u-boot
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
--
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hornemannstra?e 12, 31137 Hildesheim, Germany
Phone: +49-5121-28619-0 | Fax: +49-5121-28619-4
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot-Users] PXA (XScale) memory layout
2003-09-12 5:10 ` Robert Schwebel
@ 2003-09-12 19:13 ` Wolfgang Denk
0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2003-09-12 19:13 UTC (permalink / raw)
To: u-boot
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
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
"A dirty mind is a joy forever." - Randy Kunkee
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] PXA (XScale) memory layout
2003-09-11 19:52 ` Wolfgang Denk
2003-09-12 5:10 ` Robert Schwebel
@ 2003-09-12 8:02 ` Anders Larsen
2003-09-12 8:33 ` Robert Schwebel
2003-09-12 9:14 ` Wolfgang Denk
1 sibling, 2 replies; 9+ messages in thread
From: Anders Larsen @ 2003-09-12 8:02 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] PXA (XScale) memory layout
2003-09-12 8:02 ` Anders Larsen
@ 2003-09-12 8:33 ` Robert Schwebel
2003-09-12 9:14 ` Wolfgang Denk
1 sibling, 0 replies; 9+ messages in thread
From: Robert Schwebel @ 2003-09-12 8:33 UTC (permalink / raw)
To: u-boot
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
--
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hornemannstra?e 12, 31137 Hildesheim, Germany
Phone: +49-5121-28619-0 | Fax: +49-5121-28619-4
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot-Users] PXA (XScale) memory layout
2003-09-12 8:02 ` Anders Larsen
2003-09-12 8:33 ` Robert Schwebel
@ 2003-09-12 9:14 ` Wolfgang Denk
1 sibling, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2003-09-12 9:14 UTC (permalink / raw)
To: u-boot
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
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
A day without sunshine is like night.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2003-09-12 19:13 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-11 14:02 [U-Boot-Users] PXA (XScale) memory layout Anders Larsen
2003-09-11 15:21 ` Robert Schwebel
2003-09-11 15:38 ` Anders Larsen
2003-09-11 19:52 ` Wolfgang Denk
2003-09-12 5:10 ` Robert Schwebel
2003-09-12 19:13 ` Wolfgang Denk
2003-09-12 8:02 ` Anders Larsen
2003-09-12 8:33 ` Robert Schwebel
2003-09-12 9:14 ` Wolfgang Denk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.