How to fix RAM size limit 256MB on realview-pbxa9 platform.

e.fedotov e.fedotov at
Thu Dec 22 12:40:42 CET 2011

Hello, All!

This post is about how to eliminate memory restriction 256MB in 
realview-pbxa9 platform (ARM Cortex A9 processor). The problem is that 
L4 bootstrap doesn't scan all RAM memory presented on this board. In 
QEMU source code for this platform (see hw/realview.c in QEMU source 
directory, function: realview_init) we can find that it can be 3 memory 
intervals in pbx a9:

1) base=0x00, size=min(sz, 256MB)
This is "SDRAM1"
2) base=0x20000000, size=sz-512MB   (appears when sz>512)
This is called "core tile ram"
3) base=0x70000000, size=512
This is "SDRAM2",
where sz is a total board memory, in QEMU specified via -m option.
If that memory map is true (I have no pbx-a9 board operator's manual), 
we can make a simple patch to L4 bootstrap (file 
that extends a basic 256MB memory to 256MB+512MB by overloading 
setup_memory_map virtual function.

/namespace {
class Platform_arm_rv : public Platform_single_region_ram
   bool probe() { return true; }

   //fix a memory limit 256MB in realview-pbxa9.platform.  Adds another 
memory chip of 512MB.
   //WARNING: this fix works only if 512MB memory chip (or more) is present!
   //In case of QEMU you must run it with -m 512 or higher.
   void setup_memory_map(l4util_mb_info_t *,
                         Region_list *ram, Region_list *)
     ram->add(Region::n(0x0,        0x10000000, ".ram", Region::Ram));  
//SDRAM as it defined in realview.c (QUEMU sources)
     ram->add(Region::n(0x70000000, 0x90000000, ".ram", Region::Ram));  
//the second 512MB SDRAM
     //TODO: add more RAM regions if you need it according to the the 
platform map.

   void init()
     static L4::Uart_pl011 _uart(36,36);

This is an example patch, it would be more correct (if total RAM size is 
less then 512) to find total memory size first, then add the memory 
regions, regarding a total memory size.
I hope it will be usefull.
Best regards, and happy cristmas&new year.

Evgeny Fedotov.
Samsung Research Center,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the l4-hackers mailing list