Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213557
b: refs/heads/master
c: 65fd427
h: refs/heads/master
i:
  213555: 07d7fb8
v: v3
  • Loading branch information
Matthieu CASTET authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent fb5d865 commit aa355e7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eabf0f5f09b1f1538d22c14aa0a703c11791bd1e
refs/heads/master: 65fd42724aee31018b0bb53f4cb04971423be664
6 changes: 2 additions & 4 deletions trunk/drivers/usb/host/ehci-fsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ static void mpc83xx_usb_setup(struct usb_hcd *hcd)
mpc83xx_setup_phy(ehci, pdata->phy_mode, 1);
}

/* put controller in host mode. */
ehci_writel(ehci, 0x00000003, non_ehci + FSL_SOC_USB_USBMODE);
#ifdef CONFIG_PPC_85xx
out_be32(non_ehci + FSL_SOC_USB_PRICTRL, 0x00000008);
out_be32(non_ehci + FSL_SOC_USB_AGECNTTHRSH, 0x00000080);
Expand Down Expand Up @@ -270,6 +268,8 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
/* cache this readonly data; minimize chip reads */
ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);

hcd->has_tt = 1;

retval = ehci_halt(ehci);
if (retval)
return retval;
Expand All @@ -279,8 +279,6 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
if (retval)
return retval;

hcd->has_tt = 1;

ehci->sbrn = 0x20;

ehci_reset(ehci);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/usb/host/ehci-fsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#define PORT_PTS_SERIAL (3<<30)
#define PORT_PTS_PTW (1<<28)
#define FSL_SOC_USB_PORTSC2 0x188
#define FSL_SOC_USB_USBMODE 0x1a8
#define FSL_SOC_USB_SNOOP1 0x400 /* NOTE: big-endian */
#define FSL_SOC_USB_SNOOP2 0x404 /* NOTE: big-endian */
#define FSL_SOC_USB_AGECNTTHRSH 0x408 /* NOTE: big-endian */
Expand Down
15 changes: 15 additions & 0 deletions trunk/drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,17 @@ static int handshake (struct ehci_hcd *ehci, void __iomem *ptr,
return -ETIMEDOUT;
}

/* check TDI/ARC silicon is in host mode */
static int tdi_in_host_mode (struct ehci_hcd *ehci)
{
u32 __iomem *reg_ptr;
u32 tmp;

reg_ptr = (u32 __iomem *)(((u8 __iomem *)ehci->regs) + USBMODE);
tmp = ehci_readl(ehci, reg_ptr);
return (tmp & 3) == USBMODE_CM_HC;
}

/* force HC to halt state from unknown (EHCI spec section 2.3) */
static int ehci_halt (struct ehci_hcd *ehci)
{
Expand All @@ -202,6 +213,10 @@ static int ehci_halt (struct ehci_hcd *ehci)
/* disable any irqs left enabled by previous code */
ehci_writel(ehci, 0, &ehci->regs->intr_enable);

if (ehci_is_TDI(ehci) && tdi_in_host_mode(ehci) == 0) {
return 0;
}

if ((temp & STS_HALT) != 0)
return 0;

Expand Down
13 changes: 3 additions & 10 deletions trunk/drivers/usb/host/ehci-mxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#include <mach/mxc_ehci.h>

#define ULPI_VIEWPORT_OFFSET 0x170
#define PORTSC_OFFSET 0x184
#define USBMODE_OFFSET 0x1a8
#define USBMODE_CM_HOST 3

struct ehci_mxc_priv {
struct clk *usbclk, *ahbclk;
Expand All @@ -51,6 +48,8 @@ static int ehci_mxc_setup(struct usb_hcd *hcd)
/* cache this readonly data; minimize chip reads */
ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);

hcd->has_tt = 1;

retval = ehci_halt(ehci);
if (retval)
return retval;
Expand All @@ -60,8 +59,6 @@ static int ehci_mxc_setup(struct usb_hcd *hcd)
if (retval)
return retval;

hcd->has_tt = 1;

ehci->sbrn = 0x20;

ehci_reset(ehci);
Expand Down Expand Up @@ -191,12 +188,8 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
clk_enable(priv->ahbclk);
}

/* set USBMODE to host mode */
temp = readl(hcd->regs + USBMODE_OFFSET);
writel(temp | USBMODE_CM_HOST, hcd->regs + USBMODE_OFFSET);

/* set up the PORTSCx register */
writel(pdata->portsc, hcd->regs + PORTSC_OFFSET);
ehci_writel(ehci, pdata->portsc, &ehci->regs->port_status[0]);
mdelay(10);

/* setup specific usb hw */
Expand Down

0 comments on commit aa355e7

Please sign in to comment.