This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RAM reporting 448MB instead of 1GB in omap4 based customized board

Hello all !!

I'm working on omap4 based customized board ..

It has 1GB RAM but it is reporting 448 MB ram on kernel dmesg..I don't know where the remaining memory has gone ?!

kernel command line: 

[ 0.000000] Kernel command line: console=ttyO2,115200n8 mem=1G vmalloc=768M androidboot.console=ttyO2 omap_wdt.timer_margin=30 console=ttyO2,115200n8 androidboot.console=ttyO2 mem=1G root=/dev/mmcblk0p2 rw rootdelay=2 init=/linuxrc vram=64M omapfb.vram=0:32M,1:32M omapdss.def_disp=lcd consoleblank=0 opp_sb_off

kernel dmesg :

[ 0.000000] Memory: 447MB 0MB = 447MB total
[ 0.000000] Memory: 435732k/871464k available, 1225688k reserved, 326656K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
[ 0.000000] vmalloc : 0xc8800000 - 0xf8000000 ( 760 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .init : 0xc0008000 - 0xc0431000 (4260 kB)
[ 0.000000] .text : 0xc0431000 - 0xc0b42000 (7236 kB)
[ 0.000000] .data : 0xc0b42000 - 0xc0bbf840 ( 503 kB)
[ 0.000000] .bss : 0xc0bbf864 - 0xc0d461e0 (1563 kB)

/ # cat /proc/meminfo


MemTotal: 439992 kB
MemFree: 424572 kB
Buffers: 1460 kB
Cached: 3488 kB
SwapCached: 0 kB
Active: 3036 kB
Inactive: 2912 kB
Active(anon): 1012 kB
Inactive(anon): 348 kB
Active(file): 2024 kB
Inactive(file): 2564 kB
Unevictable: 0 kB
Mlocked: 0 kB
HighTotal: 326656 kB
HighFree: 321556 kB
LowTotal: 113336 kB
LowFree: 103016 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 992 kB
Mapped: 896 kB
Shmem: 372 kB
Slab: 5768 kB
SReclaimable: 2488 kB
SUnreclaim: 3280 kB
KernelStack: 496 kB
PageTables: 112 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 219996 kB
Committed_AS: 2948 kB
VmallocTotal: 778240 kB
VmallocUsed: 74308 kB
VmallocChunk: 671676 kB

omap4_ion.h file has the below definitions

#define OMAP4_RAMCONSOLE_START (PLAT_PHYS_OFFSET + SZ_512M)
#define OMAP4_RAMCONSOLE_SIZE SZ_2M
#define OMAP4_ION_HEAP_SECURE_INPUT_SIZE (SZ_1M * 90)
#define OMAP4_ION_HEAP_TILER_SIZE (SZ_128M - SZ_32M)
#define OMAP4_ION_HEAP_NONSECURE_TILER_SIZE SZ_32M

#define PHYS_ADDR_SMC_SIZE (SZ_1M * 3)
#define PHYS_ADDR_SMC_MEM (0x80000000 + SZ_1G - PHYS_ADDR_SMC_SIZE)
#define PHYS_ADDR_DUCATI_SIZE (SZ_1M * 105)
#define PHYS_ADDR_DUCATI_MEM (PHYS_ADDR_SMC_MEM - PHYS_ADDR_DUCATI_SIZE - \
                                                                                           OMAP4_ION_HEAP_SECURE_INPUT_SIZE)

Observations

1) Even in panda4460 it is reporting 448MB of RAM

2) The Same happen in blaze4430 also.

Any help would be helpful.

Thanks & regards

SHAJIN.

 

  • Hi Shajin,

    I think the bootargs are not correct. Can you try replacing mem = 1G by mem=448M@0x80000000 mem=512M@0xA0000000 and see what it reports.

    Thanks & Best Regards,

    Venkat

  • Hi Venkat ,

    Thanks for your reply..

    I changed the bootargs as u suggested. but still the same result..The modified bootargs are as follows,

    / # cat /proc/cmdline
    console=ttyO2,115200n8 mem=1G vmalloc=768M androidboot.console=ttyO2 omap_wdt.timer_margin=30 console=ttyO2,115200n8 androidboot.console=ttyO2 mem=448M@0x80000000 mem=512M@0xA0000000 root=/dev/mmcblk0p2 rw rootdelay=2 init=/linuxrc vram=64M omapfb.vram=0:32M,1:32M omapdss.def_disp=lcd consoleblank=0 opp_sb_off

    Currently my work is based on the below link.

    http://omappedia.org/wiki/4AI.1.4-P1_OMAP4_Icecream_Sandwich_Release_Notes

    Thanks & Regards

    SHAJIN

  • Hi Shajin,

    You are based on an ICS release.
    In these releases, there are memory carveouts for Ducati that the system will not be able to allocate from.

    Please refer to below link for details.
    http://omappedia.org/wiki/Memory_Map_Information_-_Ducati

    This, plus memory used up by services that a brought up by the OS leaves the amount left for the system that you have captured.

    Regards,
    Atsuo 

  • Hi Atsuo,

    Thanks for your reply and valuable suggestion..

    I gone through the above link,The Board File Configuration in the link are the same in my case.

    We are developing our project based on this L27.IS.2.P2_OMAP4_Icecream_Sandwich_Release_Notes .

    correct me if was wrong,it is based on my understanding

    1) Kernel is allocating last 195Mb (105+90) of its 1GB RAM to Ducati.

    2) Ducati is assigning fixed RAM address starting from 0xB3A00000 to 0xBFD00000 (which kernel already allocates).

    3) Also i noticed that PHYS_MEM_IPC_VRING , PHYS_MEM_IPC_DATA ,PHYS_MEM_TEXT ,PHYS_MEM_DATA,PHYS_MEM_IOBUFS are in continuous fashion , not having any break.

    So i can conclude that 484Mb + 195Mb = 679Mb[approx] ,processor is using 679Mb. which means who is using the remaining ?

    Thanks & Regards,

    SHAJIN.

  • Hi Atsuo,

    One more Observation i found was ,

    I changed the initialisation of "omap ram console init"  from 512MB to 768MB.

    Then I found in kernel dmesg that total memory reporting is 634MB.

    [ 0.000000] Memory: 514MB 120MB = 634MB total 

    [ 0.000000] Memory: 626532k/626532k available, 422044k reserved, 0K highmem 

    Code i changed was,

    -> arch/arm/mach-omap2/omap4_ion.h

    #define OMAP4_RAMCONSOLE_START (PLAT_PHYS_OFFSET + SZ_512M + SZ_256M)
    #define OMAP4_RAMCONSOLE_SIZE SZ_2M

    -> arch/arm/mach-omap2/omap_ram_console.h

    #define OMAP_RAM_CONSOLE_START_DEFAULT (PLAT_PHYS_OFFSET + SZ_512M + SZ_256M)
    #define OMAP_RAM_CONSOLE_SIZE_DEFAULT SZ_2M

    If i try to increase to 832MB or 896MB the result is still the same,

    To my understanding , there is some other interface who is using RAM from 634MB to 830(approx),Hence it is reporting as Reserved memory.

    Any help on this issue will be thankful.

    Thanks & Regards

    SHAJIN.

  • Hi Shajin,

    You have the following:
    - 3MB for SMC Carveout (PHYS_ADDR_SMC_SIZE)
    - 90MB for 1D ION Heap Carveout (OMAP4_ION_HEAP_SECURE_INPUT_SIZE)
    - 105MB for Ducati Heap Carveout (PHYS_ADDR_DUCATI_SIZE)
    - 96MB 2D TILER Carveout for YUV data (OMAP4_ION_HEAP_TILER_SIZE)
    - 32MB 1D TILER region for UI surfaces (OMAP4_ION_HEAP_NONSECURE_TILER_SIZE)
    - 16MB for VRAM - depends on your display resolution
    - 2MB for RAM Console (OMAP4_RAMCONSOLE_SIZE)

    Note above regions vary slightly depending on release version, but idea is the same.
    So above is 344MB of space not available for OS to allocate from.

    The ION memory manager is responsible for allocating from the ION_HEAPs (either from ION userspace component or gralloc).

    Android services, when booted, can also take up a couple hundred megabytes.

    Regards,
    Atsuo 

  • Hi Atsuo,

    Thanks for your valuable time and answers.Finally i got the technical explanation of RAM usage..

    I was able to achieve 632 MB as total and 392MB as Reserved by various interfaces as you explained above.

    Thanks a lot.

    Regards

    SHAJIN