ARM: tegra: pcie: Remove dock detect variable
[linux-3.10.git] / arch / arm / mach-tegra / board-dalmore.c
index 9452556..455f315 100644 (file)
 #include <linux/edp.h>
 #include <linux/usb/tegra_usb_phy.h>
 #include <linux/clk/tegra.h>
+#include <linux/clocksource.h>
+#include <linux/irqchip.h>
+#include <linux/irqchip/tegra.h>
+#include <linux/tegra_fiq_debugger.h>
+#include <linux/platform_data/tegra_usb_modem_power.h>
 
 #include <mach/irqs.h>
 #include <mach/pinmux.h>
@@ -60,8 +65,6 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/gpio-tegra.h>
-#include <mach/tegra_fiq_debugger.h>
-#include <linux/platform_data/tegra_usb_modem_power.h>
 #include <mach/xusb.h>
 
 #include "board-touch-raydium.h"
 #include "board-dalmore.h"
 #include "devices.h"
 #include "gpio-names.h"
-#include "fuse.h"
 #include "iomap.h"
 #include "pm.h"
-#include "pm-irq.h"
 #include "common.h"
 #include "tegra-board-id.h"
+#include "tegra-of-dev-auxdata.h"
 
 static struct board_info board_info, display_board_info;
 
@@ -489,11 +491,16 @@ static void dalmore_usb_init(void)
        tegra_set_usb_wake_source();
 
        if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) {
-               tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
-               platform_device_register(&tegra_otg_device);
-               /* Setup the udc platform data */
-               tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
+               tegra_otg_pdata.is_xhci = false;
+               tegra_udc_pdata.u_data.dev.is_xhci = false;
+       } else {
+               tegra_otg_pdata.is_xhci = true;
+               tegra_udc_pdata.u_data.dev.is_xhci = true;
        }
+       tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
+       platform_device_register(&tegra_otg_device);
+       /* Setup the udc platform data */
+       tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
 
        if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)) {
                tegra_ehci3_device.dev.platform_data = &tegra_ehci3_utmi_pdata;
@@ -501,26 +508,19 @@ static void dalmore_usb_init(void)
        }
 }
 
-static struct tegra_xusb_board_data xusb_bdata = {
-       .portmap = TEGRA_XUSB_SS_P0 | TEGRA_XUSB_USB2_P1,
-       /* ss_portmap[0:3] = SS0 map, ss_portmap[4:7] = SS1 map */
-       .ss_portmap = (TEGRA_XUSB_SS_PORT_MAP_USB2_P1 << 0),
-       .uses_external_pmic = false,
-       .supply = {
-               .s5p0v = "usb_vbus",
-               .s3p3v = "hvdd_usb",
-               .s1p8v = "avdd_usb_pll",
-               .vddio_hsic = "vddio_hsic",
-               .s1p05v = "avddio_usb",
-       },
+static struct tegra_xusb_platform_data xusb_pdata = {
+       .portmap = TEGRA_XUSB_SS_P0 | TEGRA_XUSB_USB2_P1 |
+                       TEGRA_XUSB_USB2_P0,
 };
 
 static void dalmore_xusb_init(void)
 {
        int usb_port_owner_info = tegra_get_usb_port_owner_info();
 
-       if (usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)
-               tegra_xusb_init(&xusb_bdata);
+       if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB))
+               xusb_pdata.portmap &= ~TEGRA_XUSB_USB2_P0;
+       if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB))
+               xusb_pdata.portmap &= ~(TEGRA_XUSB_USB2_P1 | TEGRA_XUSB_SS_P0);
 }
 
 static struct gpio modem_gpios[] = { /* Nemo modem */
@@ -568,9 +568,12 @@ static const struct tegra_modem_operations baseband_operations = {
 
 static struct tegra_usb_modem_power_platform_data baseband_pdata = {
        .ops = &baseband_operations,
+       .regulator_name = "vdd_modem_3v3",
        .wake_gpio = -1,
        .boot_gpio = MDM_COLDBOOT,
-       .boot_irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+       .boot_irq_flags = IRQF_TRIGGER_RISING |
+                                   IRQF_TRIGGER_FALLING |
+                                   IRQF_ONESHOT,
        .autosuspend_delay = 2000,
        .short_autosuspend_delay = 50,
        .tegra_ehci_device = &tegra_ehci2_device,
@@ -610,29 +613,6 @@ static void dalmore_audio_init(void)
        dalmore_audio_pdata.codec_dai_name = "rt5640-aif1";
 }
 
-#ifndef CONFIG_USE_OF
-static struct platform_device *dalmore_spi_devices[] __initdata = {
-        &tegra11_spi_device4,
-};
-
-static struct tegra_spi_platform_data dalmore_spi_pdata = {
-       .dma_req_sel            = 0,
-       .spi_max_frequency      = 25000000,
-       .clock_always_on        = false,
-};
-
-static void __init dalmore_spi_init(void)
-{
-       tegra11_spi_device4.dev.platform_data = &dalmore_spi_pdata;
-        platform_add_devices(dalmore_spi_devices,
-                                ARRAY_SIZE(dalmore_spi_devices));
-}
-#else
-static void __init dalmore_spi_init(void)
-{
-}
-#endif
-
 static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
        /* name         parent          rate            enabled */
        { "extern2",    "pll_p",        41000000,       false},
@@ -649,7 +629,7 @@ struct rm_spi_ts_platform_data rm31080ts_dalmore_data = {
 };
 
 static struct tegra_spi_device_controller_data dev_cdata = {
-       .rx_clk_tap_delay = 0,
+       .rx_clk_tap_delay = 16,
        .tx_clk_tap_delay = 16,
 };
 
@@ -717,18 +697,7 @@ struct of_dev_auxdata dalmore_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-i2c", 0x7000d000, "tegra11-i2c.4",
                                NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000d400, "spi-tegra114.0",
-                               NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000d600, "spi-tegra114.1",
-                               NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000d800, "spi-tegra114.2",
-                               NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000da00, "spi-tegra114.3",
-                               NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000dc00, "spi-tegra114.4",
-                               NULL),
-       OF_DEV_AUXDATA("nvidia,tegra114-spi", 0x7000de00, "spi-tegra114.5",
-                               NULL),
+       T114_SPI_OF_DEV_AUXDATA,
        OF_DEV_AUXDATA("nvidia,tegra114-apbdma", 0x6000a000, "tegra-apbdma",
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006000, "serial-tegra.0",
@@ -737,6 +706,8 @@ struct of_dev_auxdata dalmore_auxdata_lookup[] __initdata = {
                                NULL),
        OF_DEV_AUXDATA("nvidia,tegra114-hsuart", 0x70006200, "serial-tegra.2",
                                NULL),
+       OF_DEV_AUXDATA("nvidia,tegra114-xhci", 0x70090000, "tegra-xhci",
+                               &xusb_pdata),
        {}
 };
 #endif
@@ -750,10 +721,9 @@ static void __init tegra_dalmore_early_init(void)
 
 static void __init tegra_dalmore_late_init(void)
 {
-       platform_device_register(&tegra_pinmux_device);
+       platform_device_register(&tegra114_pinctrl_device);
        dalmore_pinmux_init();
        dalmore_i2c_init();
-       dalmore_spi_init();
        dalmore_usb_init();
        dalmore_xusb_init();
        dalmore_uart_init();
@@ -815,7 +785,7 @@ static void __init tegra_dalmore_reserve(void)
        /* 1920*1200*4*2 = 18432000 bytes */
        tegra_reserve(0, SZ_16M + SZ_2M, SZ_16M);
 #else
-       tegra_reserve(SZ_128M, SZ_16M + SZ_2M, SZ_4M);
+       tegra_reserve(SZ_512M, SZ_16M + SZ_2M, SZ_4M);
 #endif
        dalmore_ramconsole_reserve(SZ_1M);
 }
@@ -831,8 +801,8 @@ MACHINE_START(DALMORE, "dalmore")
        .map_io         = tegra_map_common_io,
        .reserve        = tegra_dalmore_reserve,
        .init_early     = tegra11x_init_early,
-       .init_irq       = tegra_dt_init_irq,
-       .init_time      = tegra_init_timer,
+       .init_irq       = irqchip_init,
+       .init_time      = clocksource_of_init,
        .init_machine   = tegra_dalmore_dt_init,
        .restart        = tegra_assert_system_reset,
        .dt_compat      = dalmore_dt_board_compat,