+// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2011, Marvell Semiconductor Inc.
* Lei Wen <leiwen@marvell.com>
*
- * SPDX-License-Identifier: GPL-2.0+
- *
* Back ported to the 8xx platform (from the 8260 platform) by
* Murray.Jensen@cmst.csiro.au, 27-Jan-01.
*/
#include <net.h>
#include <malloc.h>
#include <asm/byteorder.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
#include <asm/io.h>
#include <asm/unaligned.h>
#include <linux/types.h>
.free_request = ci_ep_free_request,
};
+__weak void ci_init_after_reset(struct ehci_ctrl *ctrl)
+{
+}
+
/* Init values for USB endpoints. */
static const struct usb_ep ci_ep_init[5] = {
[0] = { /* EP 0 */
writel(USBCMD_ITC(MICRO_8FRAME) | USBCMD_RST, &udc->usbcmd);
udelay(200);
+ ci_init_after_reset(controller.ctrl);
+
writel((unsigned long)controller.epts, &udc->epinitaddr);
/* select DEVICE mode */
writel(0xffffffff, &udc->epflush);
/* Turn on the USB connection by enabling the pullup resistor */
- writel(USBCMD_ITC(MICRO_8FRAME) | USBCMD_RUN, &udc->usbcmd);
+ setbits_le32(&udc->usbcmd, USBCMD_ITC(MICRO_8FRAME) |
+ USBCMD_RUN);
} else {
udc_disconnect();
}
if (driver->speed != USB_SPEED_FULL && driver->speed != USB_SPEED_HIGH)
return -EINVAL;
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
ret = usb_setup_ehci_gadget(&controller.ctrl);
#else
ret = usb_lowlevel_init(0, USB_INIT_DEVICE, (void **)&controller.ctrl);