From 4ddde9aa6779800974c0e7380e0f29c2ed89b7ff Mon Sep 17 00:00:00 2001 From: hxy Date: Fri, 27 Jul 2012 14:45:54 +0800 Subject: [PATCH] rk31: add ion support --- arch/arm/configs/rk31_fpga_defconfig | 2 ++ arch/arm/mach-rk30/board-rk31-fpga.c | 32 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/arch/arm/configs/rk31_fpga_defconfig b/arch/arm/configs/rk31_fpga_defconfig index 1647438bf279..5d2202df2120 100644 --- a/arch/arm/configs/rk31_fpga_defconfig +++ b/arch/arm/configs/rk31_fpga_defconfig @@ -75,6 +75,8 @@ CONFIG_SPI_FPGA_GPIO_NUM=0 CONFIG_SPI_FPGA_GPIO_IRQ_NUM=0 # CONFIG_HWMON is not set # CONFIG_MFD_SUPPORT is not set +CONFIG_ION=y +CONFIG_ION_ROCKCHIP=y CONFIG_FB=y CONFIG_BACKLIGHT_LCD_SUPPORT=y # CONFIG_LCD_CLASS_DEVICE is not set diff --git a/arch/arm/mach-rk30/board-rk31-fpga.c b/arch/arm/mach-rk30/board-rk31-fpga.c index 6f54f5fa0c36..cf9b9ee7d894 100644 --- a/arch/arm/mach-rk30/board-rk31-fpga.c +++ b/arch/arm/mach-rk30/board-rk31-fpga.c @@ -263,6 +263,32 @@ static struct platform_device rk29_device_backlight = { #endif +/*********************************************************** +* rk30 ion device +************************************************************/ +#ifdef CONFIG_ION +#define ION_RESERVE_SIZE (8 * SZ_1M) +static struct ion_platform_data rk30_ion_pdata = { + .nr = 1, + .heaps = { + { + .type = ION_HEAP_TYPE_CARVEOUT, + .id = ION_NOR_HEAP_ID, + .name = "norheap", + .size = ION_RESERVE_SIZE, + } + }, +}; + +static struct platform_device device_ion = { + .name = "ion-rockchip", + .id = 0, + .dev = { + .platform_data = &rk30_ion_pdata, + }, +}; +#endif + static struct platform_device *devices[] __initdata = { #if defined(CONFIG_FB_ROCKCHIP) &device_fb, @@ -270,6 +296,9 @@ static struct platform_device *devices[] __initdata = { #ifdef CONFIG_BACKLIGHT_RK29_BL &rk29_device_backlight, #endif +#ifdef CONFIG_ION + &device_ion, +#endif }; /************************************************************************************************** * SDMMC devices, include the module of SD,MMC,and sdio.noted by xbw at 2012-03-05 @@ -443,6 +472,9 @@ static void __init rk31_reserve(void) #if defined(CONFIG_FB_ROCKCHIP) resource_fb[0].start = board_mem_reserve_add("fb0", RK_FB_MEM_SIZE); resource_fb[0].end = resource_fb[0].start + RK_FB_MEM_SIZE - 1; +#endif +#ifdef CONFIG_ION + rk30_ion_pdata.heaps[0].base = board_mem_reserve_add("ion", ION_RESERVE_SIZE); #endif board_mem_reserved(); } -- 2.34.1