1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * Copyright (C) 2020 Rockchip Electronics Co., Ltd 4 */ 5 6 #include <asm/io.h> 7 #include <usb.h> 8 #include <dwc3-uboot.h> 9 #include <linux/usb/phy-rockchip-inno-usb3.h> 10 11 #if CONFIG_IS_ENABLED(USB_DWC3_GADGET) 12 static struct dwc3_device dwc3_device_data = { 13 .maximum_speed = USB_SPEED_SUPER, 14 .base = 0xff600000, 15 .dr_mode = USB_DR_MODE_PERIPHERAL, 16 .index = 0, 17 .dis_u2_susphy_quirk = 1, 18 .dis_u1u2_quirk = 1, 19 .usb2_phyif_utmi_width = 16, 20 }; 21 22 int usb_gadget_handle_interrupts(void) 23 { 24 dwc3_uboot_handle_interrupt(0); 25 return 0; 26 } 27 28 int board_usb_init(int index, enum usb_init_type init) 29 { 30 rockchip_u3phy_uboot_init(); 31 return dwc3_uboot_init(&dwc3_device_data); 32 } 33 #endif 34