[ARM] tegra: stingray: add new nvmap support
authorRebecca Schultz Zavin <rebecca@android.com>
Fri, 8 Oct 2010 22:32:19 +0000 (15:32 -0700)
committerRebecca Schultz Zavin <rebecca@android.com>
Fri, 8 Oct 2010 23:07:53 +0000 (16:07 -0700)
Change-Id: Ib98ed9b8f6163c68d3e3023504d0b0e9c7d961bc
Signed-off-by: Gary King <gking@nvidia.com>
arch/arm/mach-tegra/board-stingray-panel.c
arch/arm/mach-tegra/board-stingray.c

index 1daa3e4d3bca28518dd7847ddff281e11e334614..35417b1d1eafdc987edf257919d9a9e6aa4bc883 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/resource.h>
 #include <linux/leds-lp8550.h>
 #include <linux/platform_device.h>
-#include <linux/nvhost.h>
 #include <linux/bootmem.h>
 #include <linux/earlysuspend.h>
 #include <asm/mach-types.h>
@@ -28,6 +27,7 @@
 #include <mach/iomap.h>
 #include <mach/dc.h>
 #include <mach/fb.h>
+#include <mach/nvhost.h>
 #include <linux/regulator/consumer.h>
 
 #include "board-stingray.h"
index 67fbdf1fbe3fe1b5a085e65e33d9b2524bc9b1ca..f7d107c6630548b5fd8d1cf96149b1b72bcd03cb 100644 (file)
@@ -52,6 +52,7 @@
 #include <mach/suspend.h>
 #include <mach/system.h>
 #include <mach/tegra_fiq_debugger.h>
+#include <mach/nvmap.h>
 
 #include <linux/usb/android_composite.h>
 
@@ -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;