Skip to main content

Linux System Memory Usage

By default, the DDR range accessible to the Linux system is:

Start address: 0x8400_0000

End address: 0x8000_0000 + DDR capacity

The Linux Kernel device tree reserves a portion of memory for dedicated use by certain modules. The table below lists all memory reserved in the device tree:

Memory PartitionMemory PurposeMemory RegionMemory Size
kernel_ramStores kernel code and data0x8000_0000..0x87FFF_FFFF128MB (0x2000000)
uboot_log_reservedRetrieves boot logs within the kernel0x87FFC000..0x87FFFFFF16KB (0x4000)
cma_reservedUsed for CMA memory allocation0x88000000..0x9FDFFFFF382MB (0x17E00000)
firewall_ddr_defaultAddress automatically directed when a firewall access violation occurs0x9FE7F000..0x9FE7FFFF4KB (0x1000)
adsp_ddrMemory space used by ADSP firmware0x9FE80000..0xA207FFFF34MB (0x2200000)
ramoops_reservedUsed for ramoops temporary memory allocation0xA4080000..0xA40BFFFF256KB (0x40000)
ion_reservedUsed for ION memory allocation0xA4100000..0xD40FFFFF768MB (0x2E000000)
  • The reserved address space is defined in the arch/arm64/boot/dts/hobot/x5-memory.dtsi file under the kernel directory.
  • You can view the system memory allocation status using the cat /proc/iomem command.

By default, the reserved memory occupies approximately 1150MB of memory space.

The available memory displayed by the free command has already excluded this reserved portion, reflecting only the memory capacity actually usable by the kernel.

ION Memory

Overview

The ION system is a memory management subsystem within the Linux kernel used to manage memory sharing between devices.

In the RDK X5 system, ION memory is primarily used in the following four scenarios:

  • BPU subsystem
  • HIFI subsystem (DSP)
  • ION memory allocated by developers via the hbmem interface
  • Multimedia system: Includes hardware acceleration units such as VIN, ISP, VSE, GDC, VPU, OSD, GPU, and Display

Three main ION regions are used in the RDK X5: cma_reserved, carveout, and ion_cma.

  • cma_reserved primarily provides memory for the multimedia system.
  • carveout primarily provides memory for the BPU subsystem.
  • ion_cma serves as a backup region. When the above two regions have no available space, the ION management subsystem automatically allocates memory from the ion_cma region.

How to Adjust ION Region Size

The RDK X5 uses the srpi-config tool to adjust the size of ION regions. For specific operations, please refer to the ION memory section in srpi-config.