diff options
author | Krishna Yarlagadda <kyarlagadda@nvidia.com> | 2012-03-26 14:55:11 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-04-03 10:43:01 -0700 |
commit | c8755ec1291055904a53c6431e0462c263663c79 (patch) | |
tree | a08fbb34201c2ba6f71e4b1ccda72f47ca0123b0 /arch | |
parent | a6f76f1e275cc4df70ee2bf2d314c5ee4594d615 (diff) |
ARM: tegra: usb: AHB prefetch support calls
Support for AHB prefetch enable and disable.
These calls are used to avoid memory coherency issues
Bug 921109
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/92256
(cherry picked from commit c992fdbe0be6e2006d65e67e6eb821a054ad401c)
Change-Id: I1599ee11652b9241b2d05d565289632901f44f44
Reviewed-on: http://git-master/r/93817
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/include/mach/usb_phy.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/usb_phy.c | 36 |
2 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h index b5bf001d6132..3ad1128e2026 100644 --- a/arch/arm/mach-tegra/include/mach/usb_phy.h +++ b/arch/arm/mach-tegra/include/mach/usb_phy.h @@ -163,4 +163,8 @@ int __init tegra_usb_phy_init(struct usb_phy_plat_data *pdata, int size); bool tegra_usb_phy_is_remotewake_detected(struct tegra_usb_phy *phy); +void tegra_usb_phy_memory_prefetch_on(struct tegra_usb_phy *phy); + +void tegra_usb_phy_memory_prefetch_off(struct tegra_usb_phy *phy); + #endif /* __MACH_USB_PHY_H */ diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index 18a4aa073ef9..66e51b43fd98 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c @@ -603,6 +603,12 @@ static u32 utmip_rctrl_val, utmip_tctrl_val; #define CONNECT_DETECT_TIMEOUT 25000 +#define AHB_MEM_PREFETCH_CFG3 0xe0 +#define AHB_MEM_PREFETCH_CFG4 0xe4 +#define AHB_MEM_PREFETCH_CFG1 0xec +#define AHB_MEM_PREFETCH_CFG2 0xf0 +#define PREFETCH_ENB (1 << 31) + static DEFINE_SPINLOCK(utmip_pad_lock); static int utmip_pad_count; @@ -3155,6 +3161,36 @@ int __init tegra_usb_phy_init(struct usb_phy_plat_data *pdata, int size) return 0; } +void tegra_usb_phy_memory_prefetch_on(struct tegra_usb_phy *phy) +{ + void __iomem *ahb_gizmo = IO_ADDRESS(TEGRA_AHB_GIZMO_BASE); + unsigned long val; + + if (phy->instance == 0 && phy->mode == TEGRA_USB_PHY_MODE_DEVICE) { + val = readl(ahb_gizmo + AHB_MEM_PREFETCH_CFG1); + val |= PREFETCH_ENB; + writel(val, ahb_gizmo + AHB_MEM_PREFETCH_CFG1); + val = readl(ahb_gizmo + AHB_MEM_PREFETCH_CFG2); + val |= PREFETCH_ENB; + writel(val, ahb_gizmo + AHB_MEM_PREFETCH_CFG2); + } +} + +void tegra_usb_phy_memory_prefetch_off(struct tegra_usb_phy *phy) +{ + void __iomem *ahb_gizmo = IO_ADDRESS(TEGRA_AHB_GIZMO_BASE); + unsigned long val; + + if (phy->instance == 0 && phy->mode == TEGRA_USB_PHY_MODE_DEVICE) { + val = readl(ahb_gizmo + AHB_MEM_PREFETCH_CFG1); + val &= ~(PREFETCH_ENB); + writel(val, ahb_gizmo + AHB_MEM_PREFETCH_CFG1); + val = readl(ahb_gizmo + AHB_MEM_PREFETCH_CFG2); + val &= ~(PREFETCH_ENB); + writel(val, ahb_gizmo + AHB_MEM_PREFETCH_CFG2); + } +} + /* disable walk and wake events after resume from LP0 */ bool tegra_usb_phy_is_remotewake_detected(struct tegra_usb_phy *phy) { |