ARM: tegra: ardbeg: add support for xusb
Ajay Gupta [Tue, 4 Jun 2013 23:41:27 +0000 (16:41 -0700)]
Bug 1301052

Change-Id: I91a876fce3801de0221dc1abaefbdb82fb9d0b60
Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Reviewed-on: http://git-master/r/242030
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Tested-by: Seema Khowala <seemaj@nvidia.com>

arch/arm/mach-tegra/board-ardbeg.c

index 19dcebe..980e1f0 100644 (file)
@@ -68,6 +68,7 @@
 #include <asm/mach/arch.h>
 #include <mach/gpio-tegra.h>
 #include <mach/tegra_fiq_debugger.h>
+#include <mach/xusb.h>
 #include <linux/platform_data/tegra_usb_modem_power.h>
 
 #include "board.h"
@@ -593,6 +594,27 @@ static void ardbeg_usb_init(void)
        }
 }
 
+static struct tegra_xusb_board_data xusb_bdata = {
+       .portmap = TEGRA_XUSB_SS_P0 | TEGRA_XUSB_USB2_P0 |
+                       TEGRA_XUSB_SS_P1 | TEGRA_XUSB_USB2_P1,
+       /* ss_portmap[0:3] = SS0 map, ss_portmap[4:7] = SS1 map */
+       .ss_portmap = (TEGRA_XUSB_SS_PORT_MAP_USB2_P0 << 0) |
+                       (TEGRA_XUSB_SS_PORT_MAP_USB2_P1 << 4),
+};
+
+static void ardbeg_xusb_init(void)
+{
+       int usb_port_owner_info = tegra_get_usb_port_owner_info();
+
+       if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB))
+               xusb_bdata.portmap &= ~(TEGRA_XUSB_USB2_P0 | TEGRA_XUSB_SS_P0);
+
+       if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB))
+               xusb_bdata.portmap &= ~(TEGRA_XUSB_USB2_P1 | TEGRA_XUSB_SS_P1);
+
+       tegra_xusb_init(&xusb_bdata);
+}
+
 static void ardbeg_modem_init(void)
 {
        int modem_id = tegra_get_modem_id();
@@ -768,6 +790,7 @@ static void __init tegra_ardbeg_late_init(void)
                ardbeg_pinmux_init();
        ardbeg_usb_init();
        ardbeg_modem_init();
+       ardbeg_xusb_init();
        ardbeg_i2c_init();
        ardbeg_spi_init();
        ardbeg_uart_init();