]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra: usb_phy: enable coherency and mem_alignment
authorRohith Seelaboyina <rseelaboyina@nvidia.com>
Tue, 29 Jan 2013 14:03:28 +0000 (19:33 +0530)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 19:58:55 +0000 (12:58 -0700)
Enable coherency and mem_alignment as this issue is
fixed for T148.

Bug 1195770

Change-Id: Idd0e1e5bd044a9a87a1d6a3d029cef955aa7d256
Signed-off-by: Rohith Seelaboyina <rseelaboyina@nvidia.com>
Reviewed-on: http://git-master/r/195127
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
drivers/usb/phy/tegra11x_usb_phy.c

index 19f2c25359dc8222878e185dd044ab2aa4b2798c..29e31b98eca12af77cbf0267a852376feead074e 100644 (file)
 #define   UTMIP_WALK_PTR_P1    (1 << 2)
 #define   UTMIP_WALK_PTR_P0    (1 << 0)
 
+#if !defined(CONFIG_ARCH_TEGRA_14x_SOC)
 #define USB1_PREFETCH_ID               6
 #define USB2_PREFETCH_ID               18
 #define USB3_PREFETCH_ID               17
+#endif
 
 #define FUSE_USB_CALIB_0               0x1F0
 #define   XCVR_SETUP(x)        (((x) & 0x7F) << 0)
@@ -422,6 +424,14 @@ static int _usb_phy_init(struct tegra_usb_phy *phy)
        val |= USB_PORT_SUSPEND_EN;
        writel(val, base + USB_IF_SPARE);
 
+#if defined(CONFIG_ARCH_TEGRA_14x_SOC)
+if (phy->pdata->unaligned_dma_buf_supported == true) {
+       val = readl(base + USB_NEW_CONTROL);
+       val |= USB_COHRENCY_EN;
+       val |= USB_MEM_ALLIGNMENT_MUX_EN;
+       writel(val, base + USB_NEW_CONTROL);
+}
+#endif
        val =  readl(base + TEGRA_STREAM_DISABLE);
 #if !defined(CONFIG_TEGRA_SILICON_PLATFORM)
        val |= TEGRA_STREAM_DISABLE_OFFSET;
@@ -433,6 +443,7 @@ static int _usb_phy_init(struct tegra_usb_phy *phy)
        return 0;
 }
 
+#if !defined(CONFIG_ARCH_TEGRA_14x_SOC)
 static void usb_phy_fence_read(struct tegra_usb_phy *phy)
 {
        /* Fence read for coherency of AHB master intiated writes */
@@ -444,6 +455,7 @@ static void usb_phy_fence_read(struct tegra_usb_phy *phy)
                readb(IO_ADDRESS(IO_PPCS_PHYS + USB3_PREFETCH_ID));
        return;
 }
+#endif
 
 static int usb_phy_reset(struct tegra_usb_phy *phy)
 {
@@ -805,8 +817,9 @@ static int utmi_phy_irq(struct tegra_usb_phy *phy)
                DBG("USB_USBMODE[0x%x] USB_USBCMD[0x%x]\n",
                        readl(base + USB_USBMODE), readl(base + USB_USBCMD));
        }
-
+#if !defined(CONFIG_ARCH_TEGRA_14x_SOC)
        usb_phy_fence_read(phy);
+#endif
        /* check if it is pmc wake event */
        if (utmi_phy_remotewake_detected(phy))
                remote_wakeup = phy->pmc_remote_wakeup;
@@ -1641,7 +1654,9 @@ static void uhsic_phy_close(struct tegra_usb_phy *phy)
 static int uhsic_phy_irq(struct tegra_usb_phy *phy)
 {
        /* check if there is any remote wake event */
+#if !defined(CONFIG_ARCH_TEGRA_14x_SOC)
        usb_phy_fence_read(phy);
+#endif
        if (uhsic_phy_remotewake_detected(phy))
                DBG("%s: uhsic remote wake detected\n", __func__);
        return IRQ_HANDLED;