HACK: [ARM] tegra: add 3d support to olympus board file
authorErik Gilling <konkers@android.com>
Fri, 7 May 2010 22:05:29 +0000 (15:05 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:06 +0000 (16:33 -0700)
Signed-off-by: Erik Gilling <konkers@android.com>
arch/arm/mach-tegra/board-olympus.c

index 087b9397fa1a116a4a974d0a6fa252ab3a1c0860..4e914315814336d6412f55832c3a1ac535b5ba8f 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/fsl_devices.h>
 #include <linux/pda_power.h>
 #include <linux/gpio.h>
+#include <linux/delay.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -37,6 +38,7 @@
 #include <mach/iomap.h>
 #include <mach/sdhci.h>
 #include <mach/gpio.h>
+#include <mach/clk.h>
 
 #include <linux/usb/android_composite.h>
 
@@ -196,6 +198,33 @@ static struct platform_device pda_power_device = {
        },
 };
 
+
+static struct resource tegra_gart_resources[] = {
+    {
+        .name = "mc",
+        .flags = IORESOURCE_MEM,
+       .start = TEGRA_MC_BASE,
+       .end = TEGRA_MC_BASE + TEGRA_MC_SIZE - 1,
+    },
+    {
+        .name = "gart",
+        .flags = IORESOURCE_MEM,
+       .start = 0x58000000,
+       .end = 0x58000000 - 1 + 32 * 1024 * 1024,
+    }
+};
+
+
+static struct platform_device tegra_gart_dev = {
+    .name = "tegra_gart",
+    .id = -1,
+    .num_resources = ARRAY_SIZE(tegra_gart_resources),
+    .resource = tegra_gart_resources
+};
+
+
+
+
 static struct platform_device *olympus_devices[] __initdata = {
        &debug_uart,
        &tegra_otg,
@@ -210,6 +239,7 @@ static struct platform_device *olympus_devices[] __initdata = {
        &tegra_spi_device2,
        &tegra_spi_device3,
        &tegra_spi_device4,
+       &tegra_gart_dev,
 };
 
 extern struct tegra_sdhci_platform_data olympus_wifi_data; /* sdhci1 */
@@ -230,6 +260,10 @@ static struct tegra_sdhci_platform_data olympus_sdhci_platform_data4 = {
 static __initdata struct tegra_clk_init_table olympus_clk_init_table[] = {
        /* name         parent          rate            enabled */
        { "uartb",      "clk_m",        26000000,       true},
+       { "host1x",     "pll_p",        108000000,      true},
+       { "2d",         "pll_m",        50000000,       true},
+       { "epp",        "pll_m",        50000000,       true},
+       { "vi",         "pll_m",        50000000,       true},
        { NULL,         NULL,           0,              0},
 };
 
@@ -246,7 +280,6 @@ static void olympus_sdhci_init(void)
        platform_device_register(&tegra_sdhci_device4);
 }
 
-
 static void __init tegra_olympus_fixup(struct machine_desc *desc, struct tag *tags,
                                 char **cmdline, struct meminfo *mi)
 {
@@ -280,6 +313,20 @@ static void __init tegra_olympus_init(void)
        clk = tegra_get_clock_by_name("uartb");
        debug_uart_platform_data[0].uartclk = clk_get_rate(clk);
 
+       clk = clk_get_sys("dsi", NULL);
+       clk_enable(clk);
+       clk_put(clk);
+
+       clk = clk_get_sys("3d", NULL);
+       tegra_periph_reset_assert(clk);
+       writel(0x101, IO_ADDRESS(TEGRA_PMC_BASE) + 0x30);
+       clk_enable(clk);
+       udelay(10);
+       writel(1 << 1, IO_ADDRESS(TEGRA_PMC_BASE) + 0x34);
+       tegra_periph_reset_deassert(clk);
+       clk_put(clk);
+
+
        platform_add_devices(olympus_devices, ARRAY_SIZE(olympus_devices));
 
        olympus_keypad_init();