summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/board-dalmore.c2
-rw-r--r--arch/arm/mach-tegra/board-pluto.c1
-rw-r--r--arch/arm/mach-tegra/board-roth.c2
-rw-r--r--arch/arm/mach-tegra/tegra11x_usb_phy.c36
-rw-r--r--include/linux/platform_data/tegra_usb.h1
5 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-dalmore.c b/arch/arm/mach-tegra/board-dalmore.c
index 4bf04f072744..6dd969346ead 100644
--- a/arch/arm/mach-tegra/board-dalmore.c
+++ b/arch/arm/mach-tegra/board-dalmore.c
@@ -494,6 +494,7 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
.xcvr_lsrslew = 2,
.xcvr_setup_offset = 0,
.xcvr_use_fuses = 1,
+ .vbus_oc_map = 0x4,
},
};
@@ -519,6 +520,7 @@ static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
.xcvr_lsrslew = 2,
.xcvr_setup_offset = 0,
.xcvr_use_fuses = 1,
+ .vbus_oc_map = 0x5,
},
};
diff --git a/arch/arm/mach-tegra/board-pluto.c b/arch/arm/mach-tegra/board-pluto.c
index 5d03034ad81a..b7caaf092a8b 100644
--- a/arch/arm/mach-tegra/board-pluto.c
+++ b/arch/arm/mach-tegra/board-pluto.c
@@ -534,6 +534,7 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
.xcvr_lsrslew = 2,
.xcvr_setup_offset = 0,
.xcvr_use_fuses = 1,
+ .vbus_oc_map = 0x7,
},
};
diff --git a/arch/arm/mach-tegra/board-roth.c b/arch/arm/mach-tegra/board-roth.c
index ff4090c2641e..7d80bdec3f67 100644
--- a/arch/arm/mach-tegra/board-roth.c
+++ b/arch/arm/mach-tegra/board-roth.c
@@ -473,6 +473,7 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
.xcvr_lsrslew = 2,
.xcvr_setup_offset = 0,
.xcvr_use_fuses = 1,
+ .vbus_oc_map = 0x4,
},
};
@@ -498,6 +499,7 @@ static struct tegra_usb_platform_data tegra_ehci3_utmi_pdata = {
.xcvr_lsrslew = 2,
.xcvr_setup_offset = 0,
.xcvr_use_fuses = 1,
+ .vbus_oc_map = 0x5,
},
};
diff --git a/arch/arm/mach-tegra/tegra11x_usb_phy.c b/arch/arm/mach-tegra/tegra11x_usb_phy.c
index a3627122a568..d1b33b7c7618 100644
--- a/arch/arm/mach-tegra/tegra11x_usb_phy.c
+++ b/arch/arm/mach-tegra/tegra11x_usb_phy.c
@@ -478,6 +478,16 @@
#define APB_MISC_GP_OBSCTRL_0 0x818
#define APB_MISC_GP_OBSDATA_0 0x81c
+#define PADCTL_SNPS_OC_MAP 0xC
+#define CONTROLLER_OC(inst, x) (((x) & 0x7) << (3 * (inst)))
+#define CONTROLLER_OC_P0(x) (((x) & 0x7) << 0)
+#define CONTROLLER_OC_P1(x) (((x) & 0x7) << 3)
+#define CONTROLLER_OC_P2(x) (((x) & 0x7) << 6)
+
+#define PADCTL_OC_DET 0x18
+#define ENABLE0_OC_MAP(x) (((x) & 0x7) << 10)
+#define ENABLE1_OC_MAP(x) (((x) & 0x7) << 13)
+
/* ULPI GPIO */
#define ULPI_STP TEGRA_GPIO_PY3
#define ULPI_DIR TEGRA_GPIO_PY1
@@ -1465,6 +1475,9 @@ static int utmi_phy_power_on(struct tegra_usb_phy *phy)
{
unsigned long val;
void __iomem *base = phy->regs;
+#ifdef CONFIG_ARCH_TEGRA_11x_SOC
+ void __iomem *padctl_base = IO_ADDRESS(TEGRA_XUSB_PADCTL_BASE);
+#endif
struct tegra_utmi_config *config = &phy->pdata->u_cfg.utmi;
PHY_DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst);
@@ -1592,6 +1605,20 @@ static int utmi_phy_power_on(struct tegra_usb_phy *phy)
utmip_powerup_pmc_wake_detect(phy);
phy->phy_clk_on = true;
phy->hw_accessible = true;
+
+#ifdef CONFIG_ARCH_TEGRA_11x_SOC
+ val = readl(padctl_base + PADCTL_SNPS_OC_MAP);
+ val |= CONTROLLER_OC(phy->inst, 0x4);
+ writel(val, padctl_base + PADCTL_SNPS_OC_MAP);
+
+ val = readl(padctl_base + PADCTL_OC_DET);
+ if (phy->inst == 0)
+ val |= ENABLE0_OC_MAP(config->vbus_oc_map);
+ if (phy->inst == 2)
+ val |= ENABLE1_OC_MAP(config->vbus_oc_map);
+ writel(val, padctl_base + PADCTL_OC_DET);
+#endif
+
PHY_DBG("%s(%d) End inst:[%d]\n", __func__, __LINE__, phy->inst);
return 0;
}
@@ -2201,6 +2228,9 @@ static int uhsic_phy_power_on(struct tegra_usb_phy *phy)
{
unsigned long val;
void __iomem *base = phy->regs;
+#ifdef CONFIG_ARCH_TEGRA_11x_SOC
+ void __iomem *padctl_base = IO_ADDRESS(TEGRA_XUSB_PADCTL_BASE);
+#endif
DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst);
@@ -2330,6 +2360,12 @@ static int uhsic_phy_power_on(struct tegra_usb_phy *phy)
writel(val, base + USB_TXFILLTUNING);
}
+#ifdef CONFIG_ARCH_TEGRA_11x_SOC
+ val = readl(padctl_base + PADCTL_SNPS_OC_MAP);
+ val |= CONTROLLER_OC(phy->inst, 0x7);
+ writel(val, padctl_base + PADCTL_SNPS_OC_MAP);
+#endif
+
return 0;
}
diff --git a/include/linux/platform_data/tegra_usb.h b/include/linux/platform_data/tegra_usb.h
index a37ceaef7076..5d9281c8de81 100644
--- a/include/linux/platform_data/tegra_usb.h
+++ b/include/linux/platform_data/tegra_usb.h
@@ -49,6 +49,7 @@ struct tegra_utmi_config {
signed char xcvr_setup_offset;
u8 xcvr_use_lsb;
u8 xcvr_use_fuses;
+ u8 vbus_oc_map;
};
/**