Skip to contentSkip to conversation

Memory layout on PXA

U-Boot-Users Geir Thomassen 4 participants 5 messages Feb 12, 2003 – Feb 13, 2003

lore
Share & tools
lore
#0 lore raw

I am porting u-boot to a custom PXA255 board.

Just a quick check, to see if I understand the code correctly:

1) u-boot is copied from flash into memory at TEXT_BASE (typ. 0xA3000000 on PXA).

2) The stack is below the u-boot code. From cpu/xscale/start.S, it looks like the stack is at TEXT_BASE - CFG_MALLOC_LEN - 12. I think the stack grows toward lower addresses on arm, is this correct ?

3) Memory for malloc() is supposed to be after the u-boot code (including initialized and initialized data) at address armboot_real_end. If I understand the code correct, it points 0xbadc0de. Some time, it has been set to armboot_end + CONFIG_STACKSIZE in cpu/xscale/cpu.c, but the code for doing so have been commented out (both in 0.2.0 and in CVS). There is room for putting the heap between the stack and the u-boot code ...

Sooo, if I understand this correct, this is a mess. How should it be done ? Are there any good reasons for a particular memory layout on PXA ?

BTW: Does u-boot run "out of the box" on any PXA hardware, I don't understand how it could unless the hardware have RAM at 0xBADC0DE ..

Signature · 1 line
Geir
#1 lore raw

Hi Geir,

Quoted 1 line · Geir Thomassen

I am porting u-boot to a custom PXA255 board.

I've recently sent several patches to Wolfgang for the PXA architecture; unfortunately he didn't have time to integrate them yet. If I don't forget it I can send you my patches against current CVS tomorrow.

Quoted 2 lines

1) u-boot is copied from flash into memory at TEXT_BASE (typ. 0xA3000000 on PXA).

Ack.

Quoted 4 lines

2) The stack is below the u-boot code. From cpu/xscale/start.S, it looks like the stack is at TEXT_BASE - CFG_MALLOC_LEN - 12. I think the stack grows toward lower addresses on arm, is this correct ?

In ARMboot the stack was above the relocated uboot code - I tried to change this for my PXA250 implementation. I know that there are code fragments left which assume that the stack is above - this is partly fixed in the patches I sent to Wolfgang.

Quoted 3 lines

3) Memory for malloc() is supposed to be after the u-boot code (including initialized and initialized data) at address armboot_real_end.

Not in my ports (CSB226, Innokom). I tried to follow the way which is outlined in the README document.

Quoted 3 lines

BTW: Does u-boot run "out of the box" on any PXA hardware, I don't understand how it could unless the hardware have RAM at 0xBADC0DE ..

At the moment I have it running on the plattforms mentioned above. If you don't get my patch tomorrow in the morning please ask back...

Robert

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Braunschweiger Str. 79,  31134 Hildesheim, Germany
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
    Phone: +49-5121-28619-0 |  Fax: +49-5121-28619-4
#2 lore raw
Quoted 3 lines · In message <[email protected]> you wrote:

I've recently sent several patches to Wolfgang for the PXA architecture; unfortunately he didn't have time to integrate them yet. If I don't

Sorry...

Quoted 6 lines

forget it I can send you my patches against current CVS tomorrow.

Quoted 2 lines

1) u-boot is copied from flash into memory at TEXT_BASE (typ. 0xA3000000 on PXA).

Ack.

NAK! This is NOT how it's intended to be. TEXT_BASE is the link address of the image in flash. You should dynamically determine the size of your RAM, and copy the u-boot code to the top of RAM, wherever that may be.

Quoted 2 lines
Quoted 2 lines

2) The stack is below the u-boot code. From cpu/xscale/start.S, it looks like the stack is at TEXT_BASE - CFG_MALLOC_LEN - 12. I

-12 ??? Aren't there any alignment requirements for XScale?

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Like winter snow on summer lawn, time past is time gone.
#3 lore raw
Quoted 1 line · Wolfgang Denk

Sorry...

No problem :-)

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

1) u-boot is copied from flash into memory at TEXT_BASE (typ. 0xA3000000 on PXA).

Ack.

NAK! This is NOT how it's intended to be. TEXT_BASE is the link address of the image in flash. You should dynamically determine the size of your RAM, and copy the u-boot code to the top of RAM, wherever that may be.

I know - just didn't have time to find out how to achieve this. This is how it worked in the other ports.

Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

2) The stack is below the u-boot code. From cpu/xscale/start.S, it looks like the stack is at TEXT_BASE - CFG_MALLOC_LEN - 12. I

-12 ??? Aren't there any alignment requirements for XScale?

12 bytes = 3 x 4 bytes = 3 32-bit-words...? This is for the abort-stack (however that does works exactly - I didn't use it yet).

Robert

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Braunschweiger Str. 79,  31134 Hildesheim, Germany
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
    Phone: +49-5121-28619-0 |  Fax: +49-5121-28619-4
#4 lore raw
In reply to Wolfgang Denk
Quoted 2 lines · Wolfgang Denk

You should dynamically determine the size of your RAM, and copy the u-boot code to the top of RAM, wherever that may be.

For PXA the RAM banks are in the 0xA000'0000 to 0xAFFF'FFFF area. How is the situation with other non-PXA XScales?

Robert

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Braunschweiger Str. 79,  31134 Hildesheim, Germany
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
    Phone: +49-5121-28619-0 |  Fax: +49-5121-28619-4