mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
rk: ion: rk3288/fpga reserve cma memory for ion from dts
This commit is contained in:
@@ -610,7 +610,7 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
ion: ion{
|
||||
ion{
|
||||
compatible = "rockchip,ion";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
@@ -87,6 +87,19 @@
|
||||
pa_enable_time = <1000>;
|
||||
};
|
||||
|
||||
ion {
|
||||
compatible = "rockchip,ion";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
rockchip,ion-heap@1 { /* CMA HEAP */
|
||||
compatible = "rockchip,ion-reserve";
|
||||
reg = <1>;
|
||||
memory-reservation = <0x00000000 0x04000000>; /* 64MB */
|
||||
};
|
||||
rockchip,ion-heap@3 { /* SYSTEM HEAP */
|
||||
reg = <3>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&fb {
|
||||
|
||||
@@ -287,7 +287,7 @@
|
||||
// pinctrl-0 = <&spdif_tx>;
|
||||
};
|
||||
|
||||
ion: ion {
|
||||
ion {
|
||||
compatible = "rockchip,ion";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
9
arch/arm/mach-rockchip/common.c
Normal file → Executable file
9
arch/arm/mach-rockchip/common.c
Normal file → Executable file
@@ -19,6 +19,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
#include <linux/rockchip/common.h>
|
||||
#include "cpu_axi.h"
|
||||
@@ -220,3 +221,11 @@ int (*ddr_change_freq)(uint32_t nMHz) = NULL;
|
||||
long (*ddr_round_rate)(uint32_t nMHz) = NULL;
|
||||
void (*ddr_set_auto_self_refresh)(bool en) = NULL;
|
||||
|
||||
extern int __init rockchip_ion_find_reserve_mem(unsigned long node,
|
||||
const char *uname, int depth, void *data);
|
||||
void __init rockchip_ion_reserve(void)
|
||||
{
|
||||
printk("%s\n", __func__);
|
||||
of_scan_flat_dt(rockchip_ion_find_reserve_mem, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <linux/rockchip/dvfs.h>
|
||||
#include <linux/rockchip/common.h>
|
||||
#include <linux/rockchip/cpu.h>
|
||||
@@ -263,12 +262,10 @@ 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);
|
||||
/* reserve memory for ION */
|
||||
rockchip_ion_reserve();
|
||||
}
|
||||
|
||||
static const char * const rk3188_dt_compat[] __initconst = {
|
||||
|
||||
7
arch/arm/mach-rockchip/rk3288.c
Normal file → Executable file
7
arch/arm/mach-rockchip/rk3288.c
Normal file → Executable file
@@ -216,6 +216,12 @@ static void __init rk3288_dt_init_timer(void)
|
||||
of_dvfs_init();
|
||||
}
|
||||
|
||||
static void __init rk3288_reserve(void)
|
||||
{
|
||||
/* reserve memory for ION */
|
||||
rockchip_ion_reserve();
|
||||
}
|
||||
|
||||
static const char * const rk3288_dt_compat[] __initconst = {
|
||||
"rockchip,rk3288",
|
||||
NULL,
|
||||
@@ -241,6 +247,7 @@ DT_MACHINE_START(RK3288_DT, "RK30board")
|
||||
.init_time = rk3288_dt_init_timer,
|
||||
.dt_compat = rk3288_dt_compat,
|
||||
.init_late = rockchip_suspend_init,
|
||||
.reserve = rk3288_reserve,
|
||||
.restart = rk3288_restart,
|
||||
MACHINE_END
|
||||
|
||||
|
||||
@@ -35,5 +35,6 @@ extern int rockchip_boot_mode(void);
|
||||
extern void __init rockchip_boot_mode_init(u32 flag, u32 mode);
|
||||
extern void rockchip_restart_get_boot_mode(const char *cmd, u32 *flag, u32 *mode);
|
||||
extern void __init rockchip_suspend_init(void);
|
||||
extern void __init rockchip_ion_reserve(void);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user