From: CMY Date: Wed, 12 Mar 2014 02:49:32 +0000 (+0800) Subject: rk: ion: get reserve cma memory for ion from device tree X-Git-Tag: firefly_0821_release~6129 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9e1d7022c3420569fb9a2de66fc87b9a43eec980;p=firefly-linux-kernel-4.4.55.git rk: ion: get reserve cma memory for ion from device tree restore default CMA size to 16M --- diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi index c702126c7b44..8cb508198112 100755 --- a/arch/arm/boot/dts/rk3188.dtsi +++ b/arch/arm/boot/dts/rk3188.dtsi @@ -615,7 +615,9 @@ #address-cells = <1>; #size-cells = <0>; rockchip,ion-heap@1 { /* CMA HEAP */ + compatible = "rockchip,ion-reserve"; reg = <1>; + memory-reservation = <0x00000000 0x10000000>; /* 256MB */ }; rockchip,ion-heap@3 { /* SYSTEM HEAP */ reg = <3>; diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 9eb911f9fdac..88231724bbb6 100755 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -292,7 +292,9 @@ #address-cells = <1>; #size-cells = <0>; rockchip,ion-heap@1 { /* CMA HEAP */ + compatible = "rockchip,ion-reserve"; reg = <1>; + memory-reservation = <0x00000000 0x10000000>; /* 256MB */ }; rockchip,ion-heap@3 { /* SYSTEM HEAP */ reg = <3>; diff --git a/arch/arm/configs/rockchip_defconfig b/arch/arm/configs/rockchip_defconfig index 56482e38f02c..f87bcbadc891 100755 --- a/arch/arm/configs/rockchip_defconfig +++ b/arch/arm/configs/rockchip_defconfig @@ -207,7 +207,7 @@ CONFIG_RFKILL=y CONFIG_RFKILL_RK=y CONFIG_DEVTMPFS=y CONFIG_CMA=y -CONFIG_CMA_SIZE_MBYTES=256 +CONFIG_CMA_SIZE_MBYTES=16 CONFIG_MTD=y CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_BLOCK=y diff --git a/arch/arm/mach-rockchip/rk3188.c b/arch/arm/mach-rockchip/rk3188.c old mode 100644 new mode 100755 index 976de3a29db1..1871cf6dd9ae --- a/arch/arm/mach-rockchip/rk3188.c +++ b/arch/arm/mach-rockchip/rk3188.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -262,6 +263,14 @@ static void __init rk3188_dt_init_timer(void) of_dvfs_init(); } +extern int __init rockchip_ion_find_reserve_mem(unsigned long node, + const char *uname, int depth, void *data); +static void __init rk3188_reserve(void) +{ + printk("%s\n", __func__); + of_scan_flat_dt(rockchip_ion_find_reserve_mem, NULL); +} + static const char * const rk3188_dt_compat[] __initconst = { "rockchip,rk3188", NULL, @@ -295,6 +304,7 @@ DT_MACHINE_START(RK3188_DT, "RK30board") .init_time = rk3188_dt_init_timer, .dt_compat = rk3188_dt_compat, .init_late = rockchip_suspend_init, + .reserve = rk3188_reserve, .restart = rk3188_restart, MACHINE_END diff --git a/drivers/staging/android/ion/rockchip/rockchip_ion.c b/drivers/staging/android/ion/rockchip/rockchip_ion.c index e537a55a8129..5cb1cd19f156 100755 --- a/drivers/staging/android/ion/rockchip/rockchip_ion.c +++ b/drivers/staging/android/ion/rockchip/rockchip_ion.c @@ -27,6 +27,7 @@ #include #include #include