Skip to content

Commit 45bb7de

Browse files
Heikki KrogerusFelipe Balbi
authored andcommitted
usb: dwc3: setup phys earlier
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>
1 parent c5cc74e commit 45bb7de

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/usb/dwc3/core.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,6 @@ static void dwc3_phy_setup(struct dwc3 *dwc)
436436

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

439-
mdelay(100);
440-
441439
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
442440

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

455453
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
456-
457-
mdelay(100);
458454
}
459455

460456
/**
@@ -569,8 +565,6 @@ static int dwc3_core_init(struct dwc3 *dwc)
569565

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

572-
dwc3_phy_setup(dwc);
573-
574568
ret = dwc3_alloc_scratch_buffers(dwc);
575569
if (ret)
576570
goto err1;
@@ -892,6 +886,8 @@ static int dwc3_probe(struct platform_device *pdev)
892886
platform_set_drvdata(pdev, dwc);
893887
dwc3_cache_hwparams(dwc);
894888

889+
dwc3_phy_setup(dwc);
890+
895891
ret = dwc3_core_get_phy(dwc);
896892
if (ret)
897893
goto err0;

0 commit comments

Comments
 (0)