dts: change CMA layout [1/1]

PD#SWPL-1909

Problem:
On 32bit kernel, codec cma is located in normal zone by
"alloc-ranges" parameter with large size. This takse up
memory space for kernel and drivers. Sometimes we can see
memory allocation fail log but there are still enought
free pages. But most of these pages are CMA pages.

Solution:
Move codec cma location to high memzone. On 32bit, low
768MB memory is normal zone.
This change also correct first 1MB memory lost problem
for chips later than TXLX

Verify:
P212

Change-Id: I4592d34d08ee4dbb6700bbbfc4e0fadaceab0310
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
This commit is contained in:
tao zeng
2018-11-09 12:10:49 +08:00
committed by Jianxin Pan
parent d6aa1270e0
commit 8d0507c810
18 changed files with 131 additions and 119 deletions

View File

@@ -45,7 +45,7 @@
memory@00000000 {
device_type = "memory";
linux,usable-memory = <0x100000 0x7ff00000>;
linux,usable-memory = <0x000000 0x80000000>;
};
reserved-memory {
@@ -80,14 +80,14 @@
reusable;
size = <0x800000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
alloc-ranges = <0x30000000 0x50000000>;
};
ion_cma_reserved:linux,ion-dev {
compatible = "shared-dma-pool";
reusable;
size = <0x8000000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
alloc-ranges = <0x30000000 0x50000000>;
};
//di_reserved:linux,di {
//compatible = "amlogic, di-mem";
@@ -126,7 +126,7 @@
size = <0x13400000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x0 0x30000000>;
alloc-ranges = <0x30000000 0x50000000>;
};
/* codec shared reserved */
codec_mm_reserved:linux,codec_mm_reserved {

View File

@@ -45,7 +45,7 @@
memory@00000000 {
device_type = "memory";
linux,usable-memory = <0x100000 0x3ff00000>;
linux,usable-memory = <0x000000 0x40000000>;
};
reserved-memory {
@@ -82,6 +82,16 @@
alignment = <0x400000>;
alloc-ranges = <0x3f800000 0x800000>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xC400000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x30000000 0x10000000>;
};
ion_cma_reserved:linux,ion-dev {
compatible = "shared-dma-pool";
reusable;
@@ -112,6 +122,7 @@
*/
size = <0x02800000>;
alignment = <0x400000>;
alloc-ranges = <0x30000000 0x10000000>;
};
/* POST PROCESS MANAGER */
ppmgr_reserved:linux,ppmgr {
@@ -119,15 +130,6 @@
size = <0x0>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xC400000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x0 0x30000000>;
};
/* codec shared reserved */
codec_mm_reserved:linux,codec_mm_reserved {
compatible = "amlogic, codec-mm-reserved";
@@ -142,6 +144,7 @@
/* 1920x1080x2x4 =16+4 M */
size = <0x04000000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
};
/* vdin1 CMA pool */
vdin1_cma_reserved:linux,vdin1_cma {
@@ -150,6 +153,7 @@
/* 1920x1080x2x4 =16 M */
size = <0x04000000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
};
};

View File

@@ -45,7 +45,7 @@
memory@00000000 {
device_type = "memory";
linux,usable-memory = <0x100000 0x7ff00000>;
linux,usable-memory = <0x000000 0x80000000>;
};
reserved-memory {
@@ -80,7 +80,7 @@
reusable;
size = <0x800000>;
alignment = <0x400000>;
alloc-ranges = <0x7f700000 0x800000>;
alloc-ranges = <0x7f800000 0x800000>;
};
ion_cma_reserved:linux,ion-dev {
compatible = "shared-dma-pool";

View File

@@ -45,7 +45,7 @@
memory@00000000 {
device_type = "memory";
linux,usable-memory = <0x100000 0x3ff00000>;
linux,usable-memory = <0x000000 0x40000000>;
};
@@ -83,6 +83,15 @@
alignment = <0x400000>;
alloc-ranges = <0x3f800000 0x800000>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x30000000 0x10000000>;
};
ion_cma_reserved:linux,ion-dev {
compatible = "shared-dma-pool";
reusable;
@@ -113,6 +122,7 @@
*/
size = <0x02800000>;
alignment = <0x400000>;
alloc-ranges = <0x30000000 0x10000000>;
};
/* POST PROCESS MANAGER */
ppmgr_reserved:linux,ppmgr {
@@ -120,15 +130,6 @@
size = <0x0>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x00000000 0x30000000>;
};
/* codec shared reserved */
codec_mm_reserved:linux,codec_mm_reserved {
compatible = "amlogic, codec-mm-reserved";
@@ -151,6 +152,7 @@
/* 1920x1080x2x4 =16 M */
size = <0x01000000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
};
};

View File

@@ -44,7 +44,7 @@
memory@00000000 {
device_type = "memory";
linux,usable-memory = <0x100000 0x7ff00000>;
linux,usable-memory = <0x000000 0x80000000>;
};
reserved-memory {
@@ -77,7 +77,7 @@
reusable;
size = <0x8000000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
alloc-ranges = <0x30000000 0x50000000>;
};
//di_reserved:linux,di {
//compatible = "amlogic, di-mem";
@@ -116,7 +116,7 @@
size = <0x13400000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x0 0x30000000>;
alloc-ranges = <0x30000000 0x50000000>;
};
/* codec shared reserved */
codec_mm_reserved:linux,codec_mm_reserved {

View File

@@ -45,7 +45,7 @@
memory@00000000 {
device_type = "memory";
linux,usable-memory = <0x100000 0x7ff00000>;
linux,usable-memory = <0x000000 0x80000000>;
};
reserved-memory {

View File

@@ -70,6 +70,16 @@
alignment = <0x400000>;
alloc-ranges = <0x3f800000 0x800000>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x30000000 0x10000000>;
};
//don't put other dts in front of logo_reserved
//di_reserved:linux,di {
@@ -84,13 +94,14 @@
/** 10x3133440=30M(0x1e) support 8bit **/
size = <0x2000000>;
alignment = <0x400000>;
alloc-ranges = <0x30000000 0x10000000>;
};
ion_reserved:linux,ion-dev {
compatible = "shared-dma-pool";
reusable;
size = <0x4C00000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x2ee00000>;
alloc-ranges = <0x0 0x30000000>;
};
/* vdin0 CMA pool */
@@ -109,6 +120,7 @@
/* 1920x1080x2x4 =16 M */
size = <0x01000000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
};
/* POST PROCESS MANAGER */
ppmgr_reserved:linux,ppmgr {
@@ -116,15 +128,6 @@
size = <0x0>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x12000000 0x13400000>;
};
picdec_cma_reserved:linux,picdec {
compatible = "shared-dma-pool";
reusable;

View File

@@ -99,7 +99,7 @@
reusable;
size = <0x7C00000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x2ee00000>;
alloc-ranges = <0x30000000 0x50000000>;
};
/* vdin0 CMA pool */
@@ -132,7 +132,7 @@
size = <0x13400000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x12000000 0x13400000>;
alloc-ranges = <0x30000000 0x50000000>;
};
picdec_cma_reserved:linux,picdec {
compatible = "shared-dma-pool";

View File

@@ -99,7 +99,7 @@
reusable;
size = <0x7C00000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x2ee00000>;
alloc-ranges = <0x30000000 0x50000000>;
};
/* vdin0 CMA pool */
@@ -132,7 +132,7 @@
size = <0x13400000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x12000000 0x13400000>;
alloc-ranges = <0x30000000 0x50000000>;
};
picdec_cma_reserved:linux,picdec {
compatible = "shared-dma-pool";

View File

@@ -79,6 +79,15 @@
alignment = <0x400000>;
alloc-ranges = <0x3fc00000 0x400000>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x30000000 0x10000000>;
};
//don't put other dts in front of logo_reserved
//di_reserved:linux,di {
@@ -96,13 +105,14 @@
/** 10x4074560=39M(0x27) support 10bit **/
size = <0x02400000>;
alignment = <0x400000>;
alloc-ranges = <0x30000000 0x10000000>;
};
ion_reserved:linux,ion-dev {
compatible = "shared-dma-pool";
reusable;
size = <0x4C00000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x2ee00000>;
alloc-ranges = <0x0 0x30000000>;
};
/* vdin0 CMA pool */
@@ -121,6 +131,7 @@
/* 1920x1080x2x4 =16 M */
size = <0x01000000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
};
/* POST PROCESS MANAGER */
ppmgr_reserved:linux,ppmgr {
@@ -129,15 +140,6 @@
multi-use;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x12000000 0x13400000>;
};
picdec_cma_reserved:linux,picdec {
compatible = "shared-dma-pool";
reusable;

View File

@@ -79,6 +79,16 @@
alignment = <0x400000>;
alloc-ranges = <0x3fc00000 0x400000>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x30000000 0x10000000>;
};
//don't put other dts in front of logo_reserved
//di_reserved:linux,di {
@@ -96,13 +106,14 @@
/** 10x4074560=39M(0x27) support 10bit **/
size = <0x02400000>;
alignment = <0x400000>;
alloc-ranges = <0x30000000 0x10000000>;
};
ion_reserved:linux,ion-dev {
compatible = "shared-dma-pool";
reusable;
size = <0x4C00000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x2ee00000>;
alloc-ranges = <0x0 0x30000000>;
};
/* vdin0 CMA pool */
@@ -121,6 +132,7 @@
/* 1920x1080x2x4 =16 M */
size = <0x01000000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
};
/* POST PROCESS MANAGER */
ppmgr_reserved:linux,ppmgr {
@@ -128,16 +140,6 @@
size = <0x0>;
multi-use;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x12000000 0x13400000>;
};
picdec_cma_reserved:linux,picdec {
compatible = "shared-dma-pool";
reusable;

View File

@@ -34,7 +34,7 @@
memory@00000000 {
device_type = "memory";
linux,usable-memory = <0x100000 0x7ff00000>;
linux,usable-memory = <0x000000 0x80000000>;
};
reserved-memory {
@@ -57,7 +57,7 @@
size = <0x13400000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x12000000 0x13400000>;
alloc-ranges = <0x30000000 0x50000000>;
};
/* codec shared reserved */
@@ -109,7 +109,7 @@
/* 2M-30M for emp or tmds to ddr */
size = <0x01e00000>;
alignment = <0x10000>;
alloc-ranges = <0x00200000 0x01e00000>;
alloc-ranges = <0x30000000 0x50000000>;
};
}; /* end of reserved-memory */

View File

@@ -78,13 +78,24 @@
alloc-ranges = <0x3f800000 0x800000>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
/** alloc by self **/
alloc-ranges = <0x30000000 0x10000000>;
};
ion_reserved:linux,ion-dev {
compatible = "shared-dma-pool";
reusable;
size = <0x4C00000>;
alignment = <0x400000>;
/* alloc by self */
alloc-ranges = <0x0 0x2ee00000>;
alloc-ranges = <0x0 0x30000000>;
};
/*di CMA pool */
@@ -100,25 +111,13 @@
*/
size = <0x02800000>;
alignment = <0x400000>;
alloc-ranges = <0x32000000 0xc800000>;
alloc-ranges = <0x30000000 0x10000000>;
};
/* POST PROCESS MANAGER */
ppmgr_reserved:linux,ppmgr {
compatible = "amlogic, ppmgr_memory";
size = <0x0>;
alloc-ranges = <0x32000000 0xc800000>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
/** alloc by self **/
alloc-ranges = <0x0 0x2ee00000>;
};
picdec_cma_reserved:linux,picdec {
@@ -127,7 +126,6 @@
size = <0x0>;
alignment = <0x0>;
linux,contiguous-region;
alloc-ranges = <0x32000000 0xc800000>;
};
/* codec shared reserved */
@@ -144,7 +142,7 @@
/* 5M */
size = <0x0800000>;
alignment = <0x400000>;
alloc-ranges = <0x32000000 0xc800000>;
alloc-ranges = <0x00000000 0x30000000>;
};
/* vdin1 CMA pool */
@@ -155,7 +153,7 @@
size = <0x01000000>;
alignment = <0x400000>;
/** alloc by self **/
alloc-ranges = <0x32000000 0xc800000>;
alloc-ranges = <0x00000000 0x30000000>;
};
}; /* end of reserved-memory */

View File

@@ -75,8 +75,19 @@
reusable;
size = <0x400000>;
alignment = <0x400000>;
alloc-ranges = <0x3fc00000 0x400000>;
alloc-ranges = <0x0 0x30000000>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
/** alloc by self **/
alloc-ranges = <0x30000000 0x10000000>;
};
ion_reserved:linux,ion-dev {
compatible = "shared-dma-pool";
@@ -84,7 +95,7 @@
size = <0x4C00000>;
alignment = <0x400000>;
/* alloc by self */
alloc-ranges = <0x0 0x2ee00000>;
alloc-ranges = <0x0 0x30000000>;
};
/*di CMA pool */
@@ -100,25 +111,13 @@
*/
size = <0x02800000>;
alignment = <0x400000>;
alloc-ranges = <0x32000000 0xc800000>;
alloc-ranges = <0x30000000 0x10000000>;
};
/* POST PROCESS MANAGER */
ppmgr_reserved:linux,ppmgr {
compatible = "amlogic, ppmgr_memory";
size = <0x0>;
alloc-ranges = <0x32000000 0xc800000>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
/** alloc by self **/
alloc-ranges = <0x0 0x2ee00000>;
};
picdec_cma_reserved:linux,picdec {
@@ -127,7 +126,6 @@
size = <0x0>;
alignment = <0x0>;
linux,contiguous-region;
alloc-ranges = <0x32000000 0xc800000>;
};
/* codec shared reserved */
@@ -144,7 +142,7 @@
/* 5M */
size = <0x0800000>;
alignment = <0x400000>;
alloc-ranges = <0x32000000 0xc800000>;
alloc-ranges = <0x0 0x30000000>;
};
/* vdin1 CMA pool */
@@ -155,7 +153,7 @@
size = <0x01000000>;
alignment = <0x400000>;
/** alloc by self **/
alloc-ranges = <0x32000000 0xc800000>;
alloc-ranges = <0x0 0x30000000>;
};
}; /* end of reserved-memory */

View File

@@ -45,7 +45,7 @@
memory@00000000 {
device_type = "memory";
linux,usable-memory = <0x100000 0x7ff00000>;
linux,usable-memory = <0x000000 0x80000000>;
};
reserved-memory {

View File

@@ -46,7 +46,7 @@
memory@00000000 {
device_type = "memory";
linux,usable-memory = <0x100000 0x3ff00000>;
linux,usable-memory = <0x000000 0x40000000>;
};
reserved-memory {
@@ -92,12 +92,22 @@
// size = <0x0 0x1000>;
//};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x30000000 0x10000000>;
};
ion_reserved:linux,ion-dev {
compatible = "shared-dma-pool";
reusable;
size = <0x4C00000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x2ee00000>;
alloc-ranges = <0x0 0x30000000>;
};
/*di CMA pool */
@@ -113,6 +123,7 @@
*/
size = <0x02800000>;
alignment = <0x400000>;
alloc-ranges = <0x30000000 0x10000000>;
};
/* POST PROCESS MANAGER */
@@ -121,16 +132,6 @@
size = <0x0>;
};
codec_mm_cma:linux,codec_mm_cma {
compatible = "shared-dma-pool";
reusable;
/* ion_codec_mm max can alloc size 80M*/
size = <0xd000000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x12000000 0x13400000>;
};
picdec_cma_reserved:linux,picdec {
compatible = "shared-dma-pool";
reusable;
@@ -153,6 +154,7 @@
/* 5M */
size = <0x0800000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
};
/* vdin1 CMA pool */
@@ -163,6 +165,7 @@
/* 1920x1080x2x4 =16+4 M */
size = <0x01400000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x30000000>;
};
/*vbi reserved mem*/

View File

@@ -46,7 +46,7 @@
memory@00000000 {
device_type = "memory";
linux,usable-memory = <0x100000 0x7ff00000>;
linux,usable-memory = <0x000000 0x80000000>;
};
reserved-memory {
@@ -97,7 +97,7 @@
reusable;
size = <0x7C00000>;
alignment = <0x400000>;
alloc-ranges = <0x0 0x2ee00000>;
alloc-ranges = <0x30000000 0x50000000>;
};
/*di CMA pool */
@@ -128,7 +128,7 @@
size = <0x13400000>;
alignment = <0x400000>;
linux,contiguous-region;
alloc-ranges = <0x12000000 0x13400000>;
alloc-ranges = <0x30000000 0x50000000>;
};
picdec_cma_reserved:linux,picdec {

0
arch/arm64/boot/dts/amlogic/txl_t962_p321_720p.dts Executable file → Normal file
View File