SStar memory layout
SStar平台上特有的memory layout方式
DDR total memory = linux memory(cat /proc/meminfo的MemTotal) + mma(mma_heap_name0 + MMU_MMA) + kernel reserved
LX_MEM 是总内存64M,Kernel reserve 5M,所以正常可以使用的内存是59M
LX_MEM里的MMP HEAP,类似linux的cma,这部分内存是给MI SYS通过软件的方式动态分配给HW IP使用的内存池, 是给通用的HW IP使用, MMAP是专用的HW IP使用,比如摄像头或显示屏使用
分配内存大小,通过修改dts文件
/ { model = "INFINITY2M SSC011A-S01A-S"; compatible = "sstar,infinity2m"; /* memory setting will be replaced with LX_MEM*/ memory { reg = <0x20000000 0x03E00000>; }; /* this cmdline will be replaced with uboot bootargs*/ chosen { bootargs = "console=ttyS0,115200n8r androidboot.console=ttyS0 root=/dev/mtdblock2 init=/linuxrc cma=4m"; }; /*!!IMPORTANT!! The reserved memory must be 1MB aligned*/ reserved-memory { #address-cells = <1>; #size-cells = <1>; ranges; /*cma0 { compatible = "shared-dma-pool"; size = <0x400000>; reusable; alignment = <0x1000>; linux,cma-default; };*/ }; };
参考链接:
https://wx.comake.online/doc/doc/IKAYAKI_ZH/customer/development/reference/memory_layout.html#2-mmap
https://wx.comake.online/doc/syg27dk2rkls-SSD20X/customer/development/software/Px/zh/sys/mma.html
https://blog.csdn.net/wind0419/article/details/117332471