Skip to content

Commit

Permalink
usb: dwc3: setup phys earlier
Browse files Browse the repository at this point in the history
This allows dwc3_phy_setup() to be more useful later. There
is nothing preventing the PHY configuration registers from
being programmed early. They do not loose their context in
soft reset.

There are however other PHY related operations that should
be executed before the driver request handles to the PHYs,
such as registering DWC3's ULPI interface, which can now be
done in dwc3_phy_setup().

Also, if there ever was need for the two 100ms delays in
dwc3_phy_setup() there isn't anymore. The PHYs are now reset
after the PHY interfaces are setup.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: David Cohen <david.a.cohen@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Heikki Krogerus authored and Felipe Balbi committed May 13, 2015
1 parent c5cc74e commit 45bb7de
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,6 @@ static void dwc3_phy_setup(struct dwc3 *dwc)

dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg);

mdelay(100);

reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));

/*
Expand All @@ -453,8 +451,6 @@ static void dwc3_phy_setup(struct dwc3 *dwc)
reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;

dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);

mdelay(100);
}

/**
Expand Down Expand Up @@ -569,8 +565,6 @@ static int dwc3_core_init(struct dwc3 *dwc)

dwc3_writel(dwc->regs, DWC3_GCTL, reg);

dwc3_phy_setup(dwc);

ret = dwc3_alloc_scratch_buffers(dwc);
if (ret)
goto err1;
Expand Down Expand Up @@ -892,6 +886,8 @@ static int dwc3_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dwc);
dwc3_cache_hwparams(dwc);

dwc3_phy_setup(dwc);

ret = dwc3_core_get_phy(dwc);
if (ret)
goto err0;
Expand Down

0 comments on commit 45bb7de

Please sign in to comment.