How to fix RAM size limit 256MB on realview-pbxa9 platform.
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 <genode>/base-foc/contrib/l4/pkg/bootstrap/server/src/platform/rv.cc), 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); _uart.startup(0x10009000); set_stdio_uart(&_uart); } }; } REGISTER_PLATFORM(Platform_arm_rv); / 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, Moscow.
Hi, On Thu Dec 22, 2011 at 14:40:42 +0300, e.fedotov wrote:
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:
The first 512MB are at 0x70000000, at 0 there's just an alias of the first 256MB of that memory. So what can be done is this in the build-dir: $ make switch_ram_base RAM_BASE=0x70000000 Which will change the ram-base to 0x70000000 and make 512MB available. Adam -- Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/
participants (2)
-
Adam Lackorzynski -
e.fedotov