summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/platform/tegra/tegra_usb_pad_ctrl.c38
-rw-r--r--drivers/usb/host/xhci-tegra.c19
2 files changed, 30 insertions, 27 deletions
diff --git a/drivers/platform/tegra/tegra_usb_pad_ctrl.c b/drivers/platform/tegra/tegra_usb_pad_ctrl.c
index 34ac67c448fc..e9cc08d58374 100644
--- a/drivers/platform/tegra/tegra_usb_pad_ctrl.c
+++ b/drivers/platform/tegra/tegra_usb_pad_ctrl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -142,15 +142,11 @@ void tegra_xhci_ss_wake_signal(u32 portmap, bool enable)
/* Assert/Deassert clamp_en_early signals to SSP0/1 */
elpg_program0 = readl(pad_base + XUSB_PADCTL_ELPG_PROGRAM_0);
if (enable) {
- if (portmap & TEGRA_XUSB_SS_P0)
- elpg_program0 |= SSP0_ELPG_CLAMP_EN_EARLY;
- if (portmap & TEGRA_XUSB_SS_P1)
- elpg_program0 |= SSP1_ELPG_CLAMP_EN_EARLY;
+ elpg_program0 |= SSP0_ELPG_CLAMP_EN_EARLY;
+ elpg_program0 |= SSP1_ELPG_CLAMP_EN_EARLY;
} else {
- if (portmap & TEGRA_XUSB_SS_P0)
- elpg_program0 &= ~SSP0_ELPG_CLAMP_EN_EARLY;
- if (portmap & TEGRA_XUSB_SS_P1)
- elpg_program0 &= ~SSP1_ELPG_CLAMP_EN_EARLY;
+ elpg_program0 &= ~SSP0_ELPG_CLAMP_EN_EARLY;
+ elpg_program0 &= ~SSP1_ELPG_CLAMP_EN_EARLY;
}
writel(elpg_program0, pad_base + XUSB_PADCTL_ELPG_PROGRAM_0);
@@ -164,15 +160,11 @@ void tegra_xhci_ss_wake_signal(u32 portmap, bool enable)
elpg_program0 = readl(pad_base + XUSB_PADCTL_ELPG_PROGRAM_0);
if (enable) {
- if (portmap & TEGRA_XUSB_SS_P0)
- elpg_program0 |= SSP0_ELPG_CLAMP_EN;
- if (portmap & TEGRA_XUSB_SS_P1)
- elpg_program0 |= SSP1_ELPG_CLAMP_EN;
+ elpg_program0 |= SSP0_ELPG_CLAMP_EN;
+ elpg_program0 |= SSP1_ELPG_CLAMP_EN;
} else {
- if (portmap & TEGRA_XUSB_SS_P0)
- elpg_program0 &= ~SSP0_ELPG_CLAMP_EN;
- if (portmap & TEGRA_XUSB_SS_P1)
- elpg_program0 &= ~SSP1_ELPG_CLAMP_EN;
+ elpg_program0 &= ~SSP0_ELPG_CLAMP_EN;
+ elpg_program0 &= ~SSP1_ELPG_CLAMP_EN;
}
writel(elpg_program0, pad_base + XUSB_PADCTL_ELPG_PROGRAM_0);
@@ -195,15 +187,11 @@ void tegra_xhci_ss_vcore(u32 portmap, bool enable)
elpg_program0 = readl(pad_base + XUSB_PADCTL_ELPG_PROGRAM_0);
if (enable) {
- if (portmap & TEGRA_XUSB_SS_P0)
- elpg_program0 |= SSP0_ELPG_VCORE_DOWN;
- if (portmap & TEGRA_XUSB_SS_P1)
- elpg_program0 |= SSP1_ELPG_VCORE_DOWN;
+ elpg_program0 |= SSP0_ELPG_VCORE_DOWN;
+ elpg_program0 |= SSP1_ELPG_VCORE_DOWN;
} else {
- if (portmap & TEGRA_XUSB_SS_P0)
- elpg_program0 &= ~SSP0_ELPG_VCORE_DOWN;
- if (portmap & TEGRA_XUSB_SS_P1)
- elpg_program0 &= ~SSP1_ELPG_VCORE_DOWN;
+ elpg_program0 &= ~SSP0_ELPG_VCORE_DOWN;
+ elpg_program0 &= ~SSP1_ELPG_VCORE_DOWN;
}
writel(elpg_program0, pad_base + XUSB_PADCTL_ELPG_PROGRAM_0);
spin_unlock_irqrestore(&xusb_padctl_lock, flags);
diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index c83c0267d437..ddc1f3b8dde9 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -90,6 +90,7 @@
_reg, readl(_base + _reg))
#define PMC_PORTMAP_MASK(map, pad) (((map) >> 4*(pad)) & 0xF)
+#define GET_SS_PORTMAP(map, p) (((map) >> 4*(p)) & 0xF)
#define PMC_USB_DEBOUNCE_DEL_0 0xec
#define UTMIP_LINE_DEB_CNT(x) (((x) & 0xf) << 16)
@@ -179,7 +180,8 @@ struct cfgtbl {
u8 magic[8];
u32 SS_low_power_entry_timeout;
u8 num_hsic_port;
- u8 padding[139]; /* padding bytes to makeup 256-bytes cfgtbl */
+ u8 ss_portmap;
+ u8 padding[138]; /* padding bytes to makeup 256-bytes cfgtbl */
};
struct xusb_save_regs {
@@ -2189,6 +2191,14 @@ static void tegra_xhci_program_ss_pad(struct tegra_xhci_hcd *tegra,
(port ? TEGRA_XUSB_SS1_PORT_MAP : TEGRA_XUSB_SS0_PORT_MAP));
writel(reg, tegra->padctl_base + padregs->ss_port_map_0);
+ /* Make sure the SS port capability set correctly */
+ reg = readl(tegra->padctl_base + padregs->usb2_port_cap_0);
+ reg &= ~USB2_PORT_CAP_MASK(
+ GET_SS_PORTMAP(tegra->bdata->ss_portmap, port));
+ reg |= USB2_PORT_CAP_HOST(
+ GET_SS_PORTMAP(tegra->bdata->ss_portmap, port));
+ writel(reg, tegra->padctl_base + padregs->usb2_port_cap_0);
+
tegra_xhci_restore_dfe_context(tegra, port);
tegra_xhci_restore_ctle_context(tegra, port);
}
@@ -2450,6 +2460,11 @@ static int load_firmware(struct tegra_xhci_hcd *tegra, bool resetARU)
struct xhci_op_regs __iomem *op_regs;
int pad;
+ /* Program SS port map config */
+ cfg_tbl->ss_portmap = 0x0;
+ cfg_tbl->ss_portmap |=
+ (tegra->bdata->portmap & ((1 << XUSB_SS_PORT_COUNT) - 1));
+
/* enable mbox interrupt */
writel(readl(tegra->fpci_base + XUSB_CFG_ARU_MBOX_CMD) | MBOX_INT_EN,
tegra->fpci_base + XUSB_CFG_ARU_MBOX_CMD);
@@ -4532,7 +4547,7 @@ static int tegra_xhci_probe2(struct tegra_xhci_hcd *tegra)
unsigned port;
- ret = load_firmware(tegra, true /* do reset ARU */);
+ ret = load_firmware(tegra, false /* do reset ARU */);
if (ret < 0) {
dev_err(&pdev->dev, "failed to load firmware\n");
return -ENODEV;