From 42b1e4242fe772c093b7849f3b08921fdcbb8fe0 Mon Sep 17 00:00:00 2001 From: Erik Gilling Date: Fri, 7 May 2010 15:05:29 -0700 Subject: [PATCH] HACK: [ARM] tegra: add 3d support to olympus board file Signed-off-by: Erik Gilling --- arch/arm/mach-tegra/board-olympus.c | 49 ++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-tegra/board-olympus.c b/arch/arm/mach-tegra/board-olympus.c index 087b9397fa1a..4e9143158143 100644 --- a/arch/arm/mach-tegra/board-olympus.c +++ b/arch/arm/mach-tegra/board-olympus.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include @@ -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(); -- 2.34.1