[ARM] tegra: olympus: Add test hsuart
authorColin Cross <ccross@android.com>
Wed, 7 Apr 2010 20:00:33 +0000 (13:00 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:32:52 +0000 (16:32 -0700)
Change-Id: I05243c0cb27b9176d9add6e4b2007f92d92a55eb
Signed-off-by: Colin Cross <ccross@android.com>
arch/arm/mach-tegra/board-olympus.c

index e824c8748a4aca87b7c0013cf03bf57d77eb5995..57b04aab282dc2da6191bd9b29b6776485ed2607 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/fsl_devices.h>
 #include <linux/pda_power.h>
+#include <linux/gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -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));