From b6cc8343abdcf747a3c70b94296cdec6e0085d42 Mon Sep 17 00:00:00 2001 From: Rebecca Schultz Zavin Date: Fri, 8 Oct 2010 15:32:19 -0700 Subject: [PATCH] [ARM] tegra: stingray: add new nvmap support Change-Id: Ib98ed9b8f6163c68d3e3023504d0b0e9c7d961bc Signed-off-by: Gary King --- arch/arm/mach-tegra/board-stingray-panel.c | 2 +- arch/arm/mach-tegra/board-stingray.c | 91 ++++++++-------------- 2 files changed, 34 insertions(+), 59 deletions(-) diff --git a/arch/arm/mach-tegra/board-stingray-panel.c b/arch/arm/mach-tegra/board-stingray-panel.c index 1daa3e4d3bca..35417b1d1eaf 100644 --- a/arch/arm/mach-tegra/board-stingray-panel.c +++ b/arch/arm/mach-tegra/board-stingray-panel.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -28,6 +27,7 @@ #include #include #include +#include #include #include "board-stingray.h" diff --git a/arch/arm/mach-tegra/board-stingray.c b/arch/arm/mach-tegra/board-stingray.c index 67fbdf1fbe3f..f7d107c66305 100644 --- a/arch/arm/mach-tegra/board-stingray.c +++ b/arch/arm/mach-tegra/board-stingray.c @@ -52,6 +52,7 @@ #include #include #include +#include #include @@ -60,7 +61,6 @@ #include "clock.h" #include "gpio-names.h" #include "devices.h" -#include "nv/include/linux/nvmem_ioctl.h" /* NVidia bootloader tags */ #define ATAG_NVIDIA 0x41000801 @@ -505,56 +505,6 @@ static struct platform_device tegra_gart_dev = { .resource = tegra_gart_resources }; -static struct resource tegra_grhost_resources[] = { - { - .start = TEGRA_HOST1X_BASE, - .end = TEGRA_HOST1X_BASE + TEGRA_HOST1X_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - { - .start = TEGRA_DISPLAY_BASE, - .end = TEGRA_DISPLAY_BASE + TEGRA_DISPLAY_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - { - .start = TEGRA_DISPLAY2_BASE, - .end = TEGRA_DISPLAY2_BASE + TEGRA_DISPLAY2_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - { - .start = TEGRA_VI_BASE, - .end = TEGRA_VI_BASE + TEGRA_VI_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - { - .start = TEGRA_ISP_BASE, - .end = TEGRA_ISP_BASE + TEGRA_ISP_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - { - .start = TEGRA_MPE_BASE, - .end = TEGRA_MPE_BASE + TEGRA_MPE_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - { - .start = INT_SYNCPT_THRESH_BASE, - .end = INT_SYNCPT_THRESH_BASE + INT_SYNCPT_THRESH_NR - 1, - .flags = IORESOURCE_IRQ, - }, - { - .start = INT_HOST1X_MPCORE_GENERAL, - .end = INT_HOST1X_MPCORE_GENERAL, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device tegra_grhost_dev = { - .name = "tegra_grhost", - .id = -1, - .resource = tegra_grhost_resources, - .num_resources = ARRAY_SIZE(tegra_grhost_resources), -}; - static struct platform_device bcm4329_rfkill = { .name = "bcm4329_rfkill", .id = -1, @@ -602,6 +552,36 @@ static struct platform_device ram_console_device = { .resource = ram_console_resources, }; +static struct nvmap_platform_carveout stingray_carveouts[] = { + [0] = { + .name = "iram", + .usage_mask = NVMAP_HEAP_CARVEOUT_IRAM, + .base = TEGRA_IRAM_BASE, + .size = TEGRA_IRAM_SIZE, + .buddy_size = 0, + }, + [1] = { + .name = "generic-0", + .usage_mask = NVMAP_HEAP_CARVEOUT_GENERIC, + .base = 0x1c600000, /* 1M aligned above disp1 fbmem */ + .size = SZ_64M - 0x600000, + .buddy_size = SZ_32K, + }, +}; + +static struct nvmap_platform_data stingray_nvmap_data = { + .carveouts = stingray_carveouts, + .nr_carveouts = ARRAY_SIZE(stingray_carveouts), +}; + +static struct platform_device stingray_nvmap_device = { + .name = "tegra-nvmap", + .id = -1, + .dev = { + .platform_data = &stingray_nvmap_data, + }, +}; + static struct platform_device *stingray_devices[] __initdata = { &cpcap_otg, &bq24617_device, @@ -615,7 +595,8 @@ static struct platform_device *stingray_devices[] __initdata = { &tegra_spi_device3, &tegra_spi_device4, &tegra_gart_dev, - &tegra_grhost_dev, + &stingray_nvmap_device, + &tegra_grhost_device, &ram_console_device, &tegra_camera, &tegra_i2s_device1, @@ -915,9 +896,6 @@ static void init_das(void) APB_MISC_DAS_DAC_INPUT_DATA_CLK_SEL_0 + 4); } -extern int nvmap_add_carveout_heap(unsigned long, size_t, const char *, - unsigned int); - static void __init tegra_stingray_init(void) { struct clk *clk; @@ -1010,9 +988,6 @@ static void __init tegra_stingray_init(void) tegra_serial_debug_init(TEGRA_UARTB_BASE, INT_UARTB, clk, INT_QUAD_RES_31, -1); - nvmap_add_carveout_heap(TEGRA_IRAM_BASE, TEGRA_IRAM_SIZE, "iram", - NVMEM_HEAP_CARVEOUT_IRAM); - init_das(); tegra_i2s_device1.dev.platform_data = &tegra_audio_pdata; tegra_i2s_device2.dev.platform_data = &tegra_audio2_pdata; -- 2.34.1