xref: /rk3399_rockchip-uboot/board/rockchip/evb_rv1103b/evb_rv1103b.c (revision d50ae2019e8c020d508dcfe7bf68a933dbd70e9e)
1 /*
2  * SPDX-License-Identifier:     GPL-2.0+
3  *
4  * (C) Copyright 2024 Rockchip Electronics Co., Ltd
5  */
6 
7 #include <common.h>
8 #include <asm/io.h>
9 #include <dwc3-uboot.h>
10 #include <usb.h>
11 
12 DECLARE_GLOBAL_DATA_PTR;
13 
14 #ifdef CONFIG_USB_DWC3
15 static struct dwc3_device dwc3_device_data = {
16 	.maximum_speed = USB_SPEED_HIGH,
17 	.base = 0x20b00000,
18 	.dr_mode = USB_DR_MODE_PERIPHERAL,
19 	.index = 0,
20 	.dis_u2_susphy_quirk = 1,
21 	.usb2_phyif_utmi_width = 16,
22 };
23 
24 int usb_gadget_handle_interrupts(void)
25 {
26 	dwc3_uboot_handle_interrupt(0);
27 	return 0;
28 }
29 
30 int board_usb_init(int index, enum usb_init_type init)
31 {
32 	return dwc3_uboot_init(&dwc3_device_data);
33 }
34 #endif
35