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.

6678: Change available memory in linux-c6x

Hello all!

I have a custom board on TI C6678. I have latest clone linux-c6x running on core 0. On board placed 2GB of DDR3 RAM, but I can't change memory size via command line more than exist by default:  256MB. If I try to use 128MB or 192MB - size is changing (cat /proc/meminfo).

Please. tell me how I can pass correct command line parameters for kernel?

Here is example of my command line (from product folder):

./bootblob set-cmdline xxx.bin 'console=ttyS0,115200 earlyprintk \

ip=192.168.0.249:::255.255.254.0:target:eth0:off \

mem=512M@0x80000000'

May be I need change kernel source code, in addition to command line arguments?

Thank you.

  • Hi Vladimir,

    I'm not familiar with this Linux release, but most of distributions the kernel receive command line from u-boot. There are two more way to pass the linux command line. First of them is to stop in u-boot and from console to write the correct parameters. For example:
    setenv bootargs console=ttyO0,115200n8 consoleblank=0 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
    this is my old command line.
    Second is using a file. In a Sitara sdk this is file uEnv.txt where you can write the same command line.

    BR
    Ivan
  • Also you can pass the memory size:
    bootargs console=ttyO3,115200n8 root=/dev/mmcblk0p2 rw rootwait mem=512M ... (256M)
  • Hi, Ivan!
    Thank you for your reply. On linux-c6x instead u-boot using IBL and command line argument to kernel pass via special tools (parsing kernel images). I can't understand why I can decrease memory size and can't increase it :( I pass memory size as you mentioned via mem=512M@0x80000000 and some variations of this? but have no result.

  • Not needed to decrease and increase memory. Just I write for example, that you can write memory how you are needed. For the linux-c6x I'll asking some one and then will answer.

    BR
    Ivan
  • Ivan, sorry for my English! I meant that increase and decrease memory in linux via mem=XXX parameter. I will be wait your answer. Thank you.
  • I used to set the linux memory size as you. I have 512M physical RAM on board, when I set
    the RAM size to 256M by setting command line, it works. It also works for 512MB.
    The following is for 512MB:
    / # cat /proc/meminfo
    MemTotal: 515516 kB
    MemFree: 508144 kB
    Buffers: 0 kB
    Cached: 2064 kB
    SwapCached: 0 kB
    Active: 132 kB
    Inactive: 1932 kB
    Active(anon): 0 kB
    Inactive(anon): 0 kB
    Active(file): 132 kB
    Inactive(file): 1932 kB
    Unevictable: 0 kB
    Mlocked: 0 kB
    MmapCopy: 2592 kB
    SwapTotal: 0 kB
    SwapFree: 0 kB
    Dirty: 0 kB
    Writeback: 0 kB
    AnonPages: 0 kB
    Mapped: 0 kB
    Shmem: 0 kB
    Slab: 1636 kB
    SReclaimable: 528 kB
    SUnreclaim: 1108 kB
    KernelStack: 152 kB
    PageTables: 0 kB
    NFS_Unstable: 0 kB
    Bounce: 0 kB
    WritebackTmp: 0 kB
    CommitLimit: 257756 kB
    Committed_AS: 0 kB
    VmallocTotal: 0 kB
    VmallocUsed: 0 kB
    VmallocChunk: 0 kB

    The command line is like this:
    mem=512M console=ttyS0,115200 ...

    try to change "mem=512M" position, for example: put it on the beginning.

  • Hi, Murat! Thank you for your answer. You are working with linux-c6x on C6678? Can you provide your full command line?

    Here is part of my board booting messages:

    Linux version 2.6.34-evmc6678.el-dev-kva-20150324 (kva@InsysStudio) (gcc version 4.5.1 (Sourcery CodeBench Lite 4.5-124) ) #4 Tue Mar 24 16:07:39 MSK 2015
    Designed for the EVMC6678 board, Texas Instruments.
    c6x: End of EVMC6678 specific initialization
    CPU0: C66x rev 0x0, 1.2 volts, 1000MHz
    Initializing kernel
    c6x: Initialize memory
    _bss_start = 0x0
    _bss_end = 0x33343409
    c6x: memory_start: 0x807a7000
    c6x: memory_end : 0xc0000000
    c6x: memory_size : 0x3f859000
    c6x: Initialize command line
    physical RAM map changed by user
    DMA memory start: 0x8f000000
    DMA memory size: 0x1000000
    Coherent memory (DMA) region start=0x8f000000 end=0x90000000 (size=0x1000000)
    disabling caching for 0x8f000000 to 0x8fffffff
    c6x: Initialize bootmap allocator
    c6x: Free usable memory
    no initrd specified
    c6x: Initializing paging
    c6x: End of C6x arch dep initialization
    Built 1 zonelists in Zone order, mobility grouping on. Total pages: 60960
    Kernel command line: mem=512M console=ttyS0,115200n8 earlyprintk nfsrootdebug \
    root=/dev/nfs nfsroot=192.168.0.102:/home/kva/targetfs-c6x-abc,v3,tcp rw \
    ip=dhcp eth0:on eth1:on
    PID hash table entries: 1024 (order: 0, 4096 bytes)
    Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

    ********* ********  ********* ********** ***********

    eth0 Link encap:Ethernet HWaddr 00:17:EA:D5:82:19
    inet addr:192.168.0.210 Bcast:192.168.0.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:24 errors:0 dropped:0 overruns:0 frame:0
    TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:3265 (3.1 KiB) TX bytes:1180 (1.1 KiB)
    Interrupt:48

    System started.

    starting pid 1, tty '/dev/console': '/bin/sh'

    / # cat /proc/meminfo
    MemTotal: 238924 kB
    MemFree: 221088 kB
    Buffers: 0 kB
    Cached: 9860 kB
    SwapCached: 0 kB
    Active: 7928 kB
    Inactive: 1928 kB
    Active(anon): 0 kB
    Inactive(anon): 0 kB
    Active(file): 7928 kB
    Inactive(file): 1928 kB
    Unevictable: 0 kB
    Mlocked: 0 kB
    MmapCopy: 4928 kB
    SwapTotal: 0 kB
    SwapFree: 0 kB
    Dirty: 0 kB
    Writeback: 0 kB
    AnonPages: 0 kB
    Mapped: 0 kB
    Shmem: 0 kB
    Slab: 1928 kB
    SReclaimable: 760 kB
    SUnreclaim: 1168 kB
    KernelStack: 168 kB
    PageTables: 0 kB
    NFS_Unstable: 0 kB
    Bounce: 0 kB
    WritebackTmp: 0 kB
    CommitLimit: 119460 kB
    Committed_AS: 0 kB
    VmallocTotal: 0 kB
    VmallocUsed: 0 kB
    VmallocChunk: 0 kB
    / #

    Kernel command line and memory size are marked bold font.

  • hi,  Karakozov:

      Yes, I also work on 6678.

      My command line is:

    mem=256M console=ttyS0,115200 ip=192.168.1.100:192.168.1.101:192.168.1.1:255.255.255.0::eth0:on root=/dev/nfs nfsroot=192.168.1.101:/opt/c6678-master/Build/rootfs/mcsdk-demo-root-c6x-hf,v3,tcp rw

  • Hi, Vladimir,
    You will need to change the BOARD_RAM_SIZE in the arch/c6x/platforms/include/mach/board-evm6678.h file and recompile the kernel. In the code, it is defined as 0x2000 0000 (512MB).
    Rex