Skip to contentSkip to conversation

Malloc Problems

U-Boot-Users M. Awater 2 participants 3 messages Sep 12, 2006 – Sep 13, 2006

lore
Share & tools
lore

M. Awater

author
#0 lore raw

Hi,

I'm porting u-boot to an board quite similar to the lite5200 (the " IceCube", which I used as a basis for my board). I am, however, running into some problems with the malloc call. It returns an address which is inside the memory area which contains the relocated code (to be more accurate, it is inside the av_ table area). I'm assuming this can't possibly be correct, but am unable to locate the exact cause.
Below is u-boot's debug output:
*****
U-Boot 1.1.4 (Sep 12 2006 - 15:48:46)

CPU: MPC5200 v1.2 at 396 MHz

       Bus 132 MHz, IPB 66 MHz, PCI 33 MHz            
Board: Motorola MPC5200                       
I2C:   85 kHz, ready                                  
DRAM:  128 MB                                         
Top of RAM usable for U-Boot at: 08000000             
Reserving 503k for U-Boot at: 07f82000                
Reserving 192k for malloc() at: 07f52000              

Reserving 68 Bytes for Board Info at: 07f51fbc
Reserving 56 Bytes for Global Data at: 07f51f84
Stack Pointer at: 07f51f68
New Stack Pointer is: 07f51f68
Now running in RAM - U-Boot at: 07f82000
****

I'm also a bit in the dark as to the malloc_bin_reloc() call. It makes the pointers in the original av_ table point to the same table entries, in the relocated code's av_ table. Is this the correct behavior?

I'd be grateful if you could point me in the right direction on this one. if there are any questions or missing information, please ask away.

Marco Awater

#1 lore raw

Please fix your mailer setup, you're postring with an incorrect From:
address:

repl: bad addresses:
M.Awater <[email protected]> -- no at-sign after local-part (<)

[The ``M.Awater'' string must be quoted.]

Quoted 5 lines · In message <[email protected]> you wrote:

I'm porting u-boot to an board quite similar to the lite5200 (the " IceCube", which I used as a basis for my board). I am, however, running into some problems with the malloc call. It returns an address which is inside the memory area which contains the relocated code (to be more accurate, it is inside the av_

Where can this be seen in your debug output?

Quoted 2 lines

table area). I'm assuming this can't possibly be correct, but am unable to locate the exact cause.

Memory problems in general?

Quoted 3 lines

CPU: MPC5200 v1.2 at 396 MHz

       Bus 132 MHz, IPB 66 MHz, PCI 33 MHz            

Board: Motorola MPC5200

Is this indeed a Motorola MPC5200 board???

Quoted 4 lines
I2C:   85 kHz, ready                                  
DRAM:  128 MB                                         
Top of RAM usable for U-Boot at: 08000000             
Reserving 503k for U-Boot at: 07f82000                

Why is your U-Boot image so big???

Quoted 7 lines

Reserving 192k for malloc() at: 07f52000
Reserving 68 Bytes for Board Info at: 07f51fbc
Reserving 56 Bytes for Global Data at: 07f51f84
Stack Pointer at: 07f51f68
New Stack Pointer is: 07f51f68
Now running in RAM - U-Boot at: 07f82000
****

I cannot see any errors in this output???

Quoted 3 lines

I'm also a bit in the dark as to the malloc_bin_reloc() call. It makes the pointers in the original av_ table point to the same table entries, in the relocated code's av_ table. Is this the correct behavior?

What do you expect shall the relocation code do?

Quoted 2 lines

I'd be grateful if you could point me in the right direction on this one. if there are any questions or missing information, please ask away.

When or where does the problem happen, and what is it exactly?

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The flow chart is a most thoroughly oversold piece of  program  docu-
mentation.              -- Frederick Brooks, "The Mythical Man Month"
#2 lore raw

Hi,

Thanks for your response.
I posted through the Gmane site before, I hope that the mailer setup problem is now fixed. The problem appears to have been caused by an incorrect global variable setup on my part. It was very hard to track down, but it appears to be fixed now.

Thanks again,

Marco