diff options
Diffstat (limited to 'drivers/usb/dwc3/core.c')
| -rw-r--r-- | drivers/usb/dwc3/core.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 1040bdb8dc88..c34452a7304f 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c | |||
| @@ -148,6 +148,8 @@ static void dwc3_core_soft_reset(struct dwc3 *dwc) | |||
| 148 | reg &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST; | 148 | reg &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST; |
| 149 | dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); | 149 | dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); |
| 150 | 150 | ||
| 151 | mdelay(100); | ||
| 152 | |||
| 151 | /* After PHYs are stable we can take Core out of reset state */ | 153 | /* After PHYs are stable we can take Core out of reset state */ |
| 152 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); | 154 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); |
| 153 | reg &= ~DWC3_GCTL_CORESOFTRESET; | 155 | reg &= ~DWC3_GCTL_CORESOFTRESET; |
| @@ -255,7 +257,7 @@ static int __devinit dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length) | |||
| 255 | * | 257 | * |
| 256 | * Returns 0 on success otherwise negative errno. | 258 | * Returns 0 on success otherwise negative errno. |
| 257 | */ | 259 | */ |
| 258 | static int __devinit dwc3_event_buffers_setup(struct dwc3 *dwc) | 260 | static int dwc3_event_buffers_setup(struct dwc3 *dwc) |
| 259 | { | 261 | { |
| 260 | struct dwc3_event_buffer *evt; | 262 | struct dwc3_event_buffer *evt; |
| 261 | int n; | 263 | int n; |
| @@ -266,6 +268,8 @@ static int __devinit dwc3_event_buffers_setup(struct dwc3 *dwc) | |||
| 266 | evt->buf, (unsigned long long) evt->dma, | 268 | evt->buf, (unsigned long long) evt->dma, |
| 267 | evt->length); | 269 | evt->length); |
| 268 | 270 | ||
| 271 | evt->lpos = 0; | ||
| 272 | |||
| 269 | dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), | 273 | dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), |
| 270 | lower_32_bits(evt->dma)); | 274 | lower_32_bits(evt->dma)); |
| 271 | dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), | 275 | dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), |
| @@ -285,6 +289,9 @@ static void dwc3_event_buffers_cleanup(struct dwc3 *dwc) | |||
| 285 | 289 | ||
| 286 | for (n = 0; n < dwc->num_event_buffers; n++) { | 290 | for (n = 0; n < dwc->num_event_buffers; n++) { |
| 287 | evt = dwc->ev_buffs[n]; | 291 | evt = dwc->ev_buffs[n]; |
| 292 | |||
| 293 | evt->lpos = 0; | ||
| 294 | |||
| 288 | dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), 0); | 295 | dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), 0); |
| 289 | dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), 0); | 296 | dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), 0); |
| 290 | dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(n), 0); | 297 | dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(n), 0); |
| @@ -328,8 +335,6 @@ static int __devinit dwc3_core_init(struct dwc3 *dwc) | |||
| 328 | } | 335 | } |
| 329 | dwc->revision = reg; | 336 | dwc->revision = reg; |
| 330 | 337 | ||
| 331 | dwc3_core_soft_reset(dwc); | ||
| 332 | |||
| 333 | /* issue device SoftReset too */ | 338 | /* issue device SoftReset too */ |
| 334 | timeout = jiffies + msecs_to_jiffies(500); | 339 | timeout = jiffies + msecs_to_jiffies(500); |
| 335 | dwc3_writel(dwc->regs, DWC3_DCTL, DWC3_DCTL_CSFTRST); | 340 | dwc3_writel(dwc->regs, DWC3_DCTL, DWC3_DCTL_CSFTRST); |
| @@ -347,6 +352,8 @@ static int __devinit dwc3_core_init(struct dwc3 *dwc) | |||
| 347 | cpu_relax(); | 352 | cpu_relax(); |
| 348 | } while (true); | 353 | } while (true); |
| 349 | 354 | ||
| 355 | dwc3_core_soft_reset(dwc); | ||
| 356 | |||
| 350 | dwc3_cache_hwparams(dwc); | 357 | dwc3_cache_hwparams(dwc); |
| 351 | 358 | ||
| 352 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); | 359 | reg = dwc3_readl(dwc->regs, DWC3_GCTL); |
