ISP Reserved Memory (RMEM) - themactep/thingino-firmware GitHub Wiki
Overview
Ingenic SoCs utilize a dedicated contiguous memory block called RMEM (Reserved Memory) for their Image Signal Processor (ISP) operations. This memory must be reserved at boot time, before the kernel initializes its page tables, to ensure the ISP hardware can access a truly contiguous physical memory space.
Configuration
RMEM is configured via U-Boot environment variables, alongside OSMEM (Operating System Memory), which defines the memory available to the Linux kernel:
fw_setenv osmem 84M@0x0
fw_setenv rmem 44M@0x5400000
This example allocates:
- 84MB starting at address 0x0 for the operating system
- 44MB starting at address 0x5400000 for the ISP subsystem
The current memory allocation can be verified by checking the kernel command line:
cat /proc/cmdline
Troubleshooting
If video streams fail to display at higher resolutions, insufficient RMEM allocation may be the cause. Increasing the RMEM size can resolve these issues.
On supported platforms, current RMEM usage can be monitored through:
cat /tmp/continuous_mem_info
Tools
For calculating optimal memory allocation parameters, use the Thingino RMEM Calculator: https://thingino.com/ramcalc
This tool helps determine the ideal OSMEM and RMEM, sizes based on your specific hardware and use case.
XBurst2 Platforms
Newer XBurst2-based SoCs introduce an additional memory requirement called NMEM (NPU Memory) for their Neural Processing Unit. Like RMEM, NMEM must be allocated as a contiguous memory block at boot time for optimal NPU operation.
Related Information
- Memory allocations are permanent for the duration of system uptime and cannot be changed without rebooting
- The total of OSMEM + RMEM (+ NMEM if applicable) must not exceed the total physical memory available
- Optimal allocation sizes depend on the specific use case and supported video resolutions