[U-Boot] arch/powerpc/lib/board.c:get_effective_memsize() for 4GB+ systems

Robert Thorhuus robert.thorhuus at ericsson.com
Fri Sep 21 12:21:08 CEST 2012


> -----Original Message-----
> From: Tabi Timur-B04825 [mailto:B04825 at freescale.com] 
> Sent: den 21 september 2012 00:38
> To: Robert Thorhuus
> Cc: Kumar Gala; u-boot at lists.denx.de
> Subject: Re: [U-Boot] 
> arch/powerpc/lib/board.c:get_effective_memsize() for 4GB+ systems
> 
> On Thu, Sep 20, 2012 at 3:24 PM, Robert Thorhuus 
> <robert.thorhuus at ericsson.com> wrote:
> 
> > I'm using 64 bit mpc85xx cores.
> 
> U-Boot runs in 32-bit mode even on a 64-bit code.
> 
> > Mapping the whole memory from the beginning was of course 
> just an initial thought.
> > But for me it looks like the code is just not able to deal 
> with more than 3.99GB mapped. U-Boot will not be able to be relocated.
> 
> I would be very surprised if U-Boot could handle a value of 
> CONFIG_MAX_MEM_MAPPED larger than 2GB, no matter what.  We 
> use the address space above 2GB for I/O addresses, like CCSR 
> and PCI memory.
> You would need to reshuffle your I/O memory mappings to use a 
> larger value.  And even then, we've never tested that, and so 
> who knows what obscure bugs are in the code.
> 
> Is there a reason why you need access to more than 2GB of RAM 
> from within U-Boot?
> 
> --
> Timur Tabi
> Linux kernel developer at Freescale
> 

Hello Timur!

Ok. Point taken.

I really see the advantage of keeping this map you have. It is of course more compatible with different OSEs and you do not need to do anything special with 32/64 bit cores. But at the same time you never take advantage of a 64 bit core with this approach.

How should I access my 24GB in U-Boot?
So really you are saying that I should have a 2GB map window in my 32-bit address space and then move this window depending on what memory I want to access? A bit cumbersome I must say. But ok.

How about the U-Boot relocation?
As I see the code, it is not easy to decide where it should relocate. It will be either relocated to end of RAM or if we have more than 4G it will be at 4GB end. What if you want to place U-Boot at 16MB for instance? Or if you do not want a memory map hole at 4GB just because U-Boot doesn't handle more than that?

Last AND least I just want to say I'm used to creating memory maps in bootloader which holds for the OS. It seems the time has come to annihilate my illusion...

Thanks
BR
Robert


More information about the U-Boot mailing list