summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorNikhil Badola <nikhil.badola@freescale.com>2014-10-19 13:13:06 (GMT)
committerMatthew Weigel <Matthew.Weigel@freescale.com>2014-12-11 18:38:21 (GMT)
commit4b18752d4b373ec8fc40ed948b76bdbc55d01a1b (patch)
treee6906339e4e6ea0c8a06c2319a6082024cb5bab1 /drivers/usb
parent3b481381670d3822afc1cab572d71a119887dd77 (diff)
downloadlinux-fsl-qoriq-4b18752d4b373ec8fc40ed948b76bdbc55d01a1b.tar.xz
drivers/usb : Port USB EHCI host driver for LS102xA
Change Power architecture specific APIs such as in_be32/out_be32 for registers read/write. Instead using ioread/writebe32 which are defined for power as well as arm architecture Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com> Change-Id: Ic5ecf4cb048dc4a6bae81bc0789b9bdb7d5c6ded Reviewed-on: http://git.am.freescale.net:8181/21815 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Ramneek Mehresh <ramneek.mehresh@freescale.com> Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-fsl.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index ec6f57c..5ffc186 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -30,6 +30,7 @@
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/fsl_devices.h>
+#include <linux/of_platform.h>
#ifdef CONFIG_PPC
#include <sysdev/fsl_soc.h>
#endif
@@ -60,7 +61,7 @@ static bool usb_phy_clk_valid(struct usb_hcd *hcd)
void __iomem *non_ehci = hcd->regs;
bool ret = true;
- if (!(in_be32(non_ehci + FSL_SOC_USB_CTRL) & PHY_CLK_VALID))
+ if (!(ioread32be(non_ehci + FSL_SOC_USB_CTRL) & PHY_CLK_VALID))
ret = false;
return ret;
@@ -201,7 +202,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
* controller reset for USB Controller version 2.5
*/
if (pdata->has_fsl_erratum_a007792) {
- writel_be(CTRL_UTMI_PHY_EN, hcd->regs + FSL_SOC_USB_CTRL);
+ setbits32(hcd->regs + FSL_SOC_USB_CTRL, CTRL_UTMI_PHY_EN);
writel(PORT_PTS_UTMI, hcd->regs + FSL_SOC_USB_PORTSC1);
}
@@ -380,9 +381,11 @@ static int ehci_fsl_usb_setup(struct ehci_hcd *ehci)
/* Setup Snooping for all the 4GB space */
/* SNOOP1 starts from 0x0, size 2G */
- out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x0 | SNOOP_SIZE_2GB);
+ iowrite32be(0x0 | SNOOP_SIZE_2GB, non_ehci +
+ FSL_SOC_USB_SNOOP1);
/* SNOOP2 starts from 0x80000000, size 2G */
- out_be32(non_ehci + FSL_SOC_USB_SNOOP2, 0x80000000 | SNOOP_SIZE_2GB);
+ iowrite32be(0x80000000 | SNOOP_SIZE_2GB, non_ehci +
+ FSL_SOC_USB_SNOOP2);
}
/* Deal with USB erratum A-005275 */
@@ -414,13 +417,13 @@ static int ehci_fsl_usb_setup(struct ehci_hcd *ehci)
if (pdata->have_sysif_regs) {
#ifdef CONFIG_FSL_SOC_BOOKE
- out_be32(non_ehci + FSL_SOC_USB_PRICTRL, 0x00000008);
- out_be32(non_ehci + FSL_SOC_USB_AGECNTTHRSH, 0x00000080);
+ iowrite32be(0x00000008, non_ehci + FSL_SOC_USB_PRICTRL);
+ iowrite32be(0x00000080, non_ehci + FSL_SOC_USB_AGECNTTHRSH);
#else
- out_be32(non_ehci + FSL_SOC_USB_PRICTRL, 0x0000000c);
- out_be32(non_ehci + FSL_SOC_USB_AGECNTTHRSH, 0x00000040);
+ iowrite32be(0x0000000c, non_ehci + FSL_SOC_USB_PRICTRL);
+ iowrite32be(0x00000040, non_ehci + FSL_SOC_USB_AGECNTTHRSH);
#endif
- out_be32(non_ehci + FSL_SOC_USB_SICTRL, 0x00000001);
+ iowrite32be(0x00000040, non_ehci + FSL_SOC_USB_SICTRL);
}
return 0;
@@ -496,7 +499,7 @@ static int ehci_fsl_save_context(struct usb_hcd *hcd)
return -ENOMEM;
_memcpy_fromio(ehci_fsl->saved_regs, ehci->regs,
sizeof(struct ehci_regs));
- ehci_fsl->usb_ctrl = in_be32(non_ehci + FSL_SOC_USB_CTRL);
+ ehci_fsl->usb_ctrl = ioread32be(non_ehci + FSL_SOC_USB_CTRL);
return 0;
}
@@ -511,7 +514,7 @@ static int ehci_fsl_restore_context(struct usb_hcd *hcd)
if (ehci_fsl->saved_regs) {
_memcpy_toio(ehci->regs, ehci_fsl->saved_regs,
sizeof(struct ehci_regs));
- out_be32(non_ehci + FSL_SOC_USB_CTRL, ehci_fsl->usb_ctrl);
+ iowrite32be(ehci_fsl->usb_ctrl, non_ehci + FSL_SOC_USB_CTRL);
kfree(ehci_fsl->saved_regs);
ehci_fsl->saved_regs = NULL;
}
@@ -700,7 +703,7 @@ static int ehci_fsl_drv_suspend(struct device *dev)
if (!fsl_deep_sleep())
return 0;
- ehci_fsl->usb_ctrl = in_be32(non_ehci + FSL_SOC_USB_CTRL);
+ ehci_fsl->usb_ctrl = ioread32be(non_ehci + FSL_SOC_USB_CTRL);
return 0;
}
@@ -744,7 +747,7 @@ static int ehci_fsl_drv_resume(struct device *dev)
usb_root_hub_lost_power(hcd->self.root_hub);
/* Restore USB PHY settings and enable the controller. */
- out_be32(non_ehci + FSL_SOC_USB_CTRL, ehci_fsl->usb_ctrl);
+ iowrite32be(ehci_fsl->usb_ctrl, non_ehci + FSL_SOC_USB_CTRL);
ehci_reset(ehci);
ehci_fsl_reinit(ehci);