From 900116c174da9407048feced55d5b6aef83f2725 Mon Sep 17 00:00:00 2001 From: Erik Gilling Date: Wed, 19 May 2010 14:19:01 -0700 Subject: [PATCH] HACK: [ARM] tegra: add 3d support to stingray board file Signed-off-by: Erik Gilling --- arch/arm/mach-tegra/board-stingray.c | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm/mach-tegra/board-stingray.c b/arch/arm/mach-tegra/board-stingray.c index a248da7eb5fe..9f61ef6d9d83 100644 --- a/arch/arm/mach-tegra/board-stingray.c +++ b/arch/arm/mach-tegra/board-stingray.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include @@ -285,6 +287,29 @@ static struct platform_device bq24617_device = { .num_resources = ARRAY_SIZE(bq24617_resources), }; +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 *stingray_devices[] __initdata = { &debug_uart, &tegra_otg, @@ -302,6 +327,7 @@ static struct platform_device *stingray_devices[] __initdata = { &tegra_spi_device2, &tegra_spi_device3, &tegra_spi_device4, + &tegra_gart_dev, }; extern struct tegra_sdhci_platform_data stingray_wifi_data; /* sdhci2 */ @@ -322,6 +348,10 @@ static struct tegra_sdhci_platform_data stingray_sdhci_platform_data4 = { static __initdata struct tegra_clk_init_table stingray_clk_init_table[] = { /* name parent rate enabled */ { "uartb", "clk_m", 26000000, true}, + { "host1x", "pll_m", 100000000, true}, + { "2d", "pll_m", 100000000, true}, + { "epp", "pll_m", 100000000, true}, + { "vi", "pll_m", 100000000, true}, { NULL, NULL, 0, 0}, }; @@ -420,6 +450,15 @@ static void __init tegra_stingray_init(void) clk = tegra_get_clock_by_name("uartb"); debug_uart_platform_data[0].uartclk = clk_get_rate(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(stingray_devices, ARRAY_SIZE(stingray_devices)); stingray_power_off_init(); -- 2.34.1