mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-27 00:31:26 +02:00
dm: usb: Change ehci_reset() to use a pointer
The index cannot be used with driver model, and isn't needed anyway. Change the parameter to a pointer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
This commit is contained in:
parent
deb8508c51
commit
aeca43e388
@ -176,16 +176,15 @@ static int handshake(uint32_t *ptr, uint32_t mask, uint32_t done, int usec)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ehci_reset(int index)
|
static int ehci_reset(struct ehci_ctrl *ctrl)
|
||||||
{
|
{
|
||||||
struct ehci_ctrl *ctrl = &ehcic[index];
|
|
||||||
uint32_t cmd;
|
uint32_t cmd;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
cmd = ehci_readl(&ehcic[index].hcor->or_usbcmd);
|
cmd = ehci_readl(&ctrl->hcor->or_usbcmd);
|
||||||
cmd = (cmd & ~CMD_RUN) | CMD_RESET;
|
cmd = (cmd & ~CMD_RUN) | CMD_RESET;
|
||||||
ehci_writel(&ehcic[index].hcor->or_usbcmd, cmd);
|
ehci_writel(&ctrl->hcor->or_usbcmd, cmd);
|
||||||
ret = handshake((uint32_t *)&ehcic[index].hcor->or_usbcmd,
|
ret = handshake((uint32_t *)&ctrl->hcor->or_usbcmd,
|
||||||
CMD_RESET, 0, 250 * 1000);
|
CMD_RESET, 0, 250 * 1000);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
printf("EHCI fail to reset\n");
|
printf("EHCI fail to reset\n");
|
||||||
@ -193,13 +192,13 @@ static int ehci_reset(int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ehci_is_TDI())
|
if (ehci_is_TDI())
|
||||||
ctrl->ops.set_usb_mode(&ehcic[index]);
|
ctrl->ops.set_usb_mode(ctrl);
|
||||||
|
|
||||||
#ifdef CONFIG_USB_EHCI_TXFIFO_THRESH
|
#ifdef CONFIG_USB_EHCI_TXFIFO_THRESH
|
||||||
cmd = ehci_readl(&ehcic[index].hcor->or_txfilltuning);
|
cmd = ehci_readl(&ctrl->hcor->or_txfilltuning);
|
||||||
cmd &= ~TXFIFO_THRESH_MASK;
|
cmd &= ~TXFIFO_THRESH_MASK;
|
||||||
cmd |= TXFIFO_THRESH(CONFIG_USB_EHCI_TXFIFO_THRESH);
|
cmd |= TXFIFO_THRESH(CONFIG_USB_EHCI_TXFIFO_THRESH);
|
||||||
ehci_writel(&ehcic[index].hcor->or_txfilltuning, cmd);
|
ehci_writel(&ctrl->hcor->or_txfilltuning, cmd);
|
||||||
#endif
|
#endif
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
@ -1108,7 +1107,7 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
|
|||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
/* EHCI spec section 4.1 */
|
/* EHCI spec section 4.1 */
|
||||||
if (ehci_reset(index))
|
if (ehci_reset(ctrl))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#if defined(CONFIG_EHCI_HCD_INIT_AFTER_RESET)
|
#if defined(CONFIG_EHCI_HCD_INIT_AFTER_RESET)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user