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