From 8bd275334f93daeb18175b3995d9bc6c329c6d5a Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 7 Apr 2010 13:00:33 -0700 Subject: [PATCH] [ARM] tegra: olympus: Add test hsuart Change-Id: I05243c0cb27b9176d9add6e4b2007f92d92a55eb Signed-off-by: Colin Cross --- arch/arm/mach-tegra/board-olympus.c | 34 +++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-tegra/board-olympus.c b/arch/arm/mach-tegra/board-olympus.c index e824c8748a4a..57b04aab282d 100644 --- a/arch/arm/mach-tegra/board-olympus.c +++ b/arch/arm/mach-tegra/board-olympus.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -39,6 +40,7 @@ #include "board.h" #include "board-olympus.h" +#include "gpio-names.h" /* NVidia bootloader tags */ #define ATAG_NVIDIA 0x41000801 @@ -87,6 +89,25 @@ static struct platform_device debug_uart = { }, }; +static struct plat_serial8250_port hsuart_platform_data[] = { + { + .mapbase = TEGRA_UARTD_BASE, + .membase = IO_ADDRESS(TEGRA_UARTD_BASE), + .irq = INT_UARTD, + }, { + .flags = 0 + } +}; + +static struct platform_device hsuart = { + .name = "tegra_uart", + .id = 3, + .dev = { + .platform_data = hsuart_platform_data, + .coherent_dma_mask = 0xffffffff, + }, +}; + /* OTG gadget device */ static u64 tegra_otg_dmamask = DMA_BIT_MASK(32); @@ -176,6 +197,7 @@ static struct platform_device *olympus_devices[] __initdata = { &tegra_otg, &androidusb_device, &pda_power_device, + &hsuart, }; static void __init tegra_olympus_fixup(struct machine_desc *desc, struct tag *tags, @@ -196,6 +218,14 @@ static void __init tegra_olympus_init(void) tegra_common_init(); + /* Olympus has a USB switch that disconnects the usb port from the AP20 + unless a factory cable is used, the factory jumper is set, or the + usb_data_en gpio is set. + */ + tegra_gpio_enable(TEGRA_GPIO_PV6); + gpio_request(TEGRA_GPIO_PV6, "usb_data_en"); + gpio_direction_output(TEGRA_GPIO_PV6, 1); + clk = clk_get_sys(NULL, "pll_p"); clk_set_rate(clk, 216000000); clk_enable(clk); @@ -204,10 +234,6 @@ static void __init tegra_olympus_init(void) clk_set_rate(clk, 72000000); clk_enable(clk); - clk = clk_get_sys("uart.3", NULL); - clk_set_rate(clk, 216000000); - clk_enable(clk); - olympus_pinmux_init(); platform_add_devices(olympus_devices, ARRAY_SIZE(olympus_devices)); -- 2.34.1