FROMLIST: board: evb-rk3399: add api to support dwc3 gadget

This patch add board_usb_init() and interrupt callback
for dwc3 gadget.

Change-Id: I1ea19c0ec7d3fd14904e7fcc97c6d19221206762
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
Kever Yang 2016-08-31 16:40:00 +08:00
parent 41933c04ad
commit da65ef61af
1 changed files with 23 additions and 0 deletions

View File

@ -10,6 +10,8 @@
#include <dm/uclass-internal.h>
#include <asm/arch/periph.h>
#include <power/regulator.h>
#include <usb.h>
#include <dwc3-uboot.h>
DECLARE_GLOBAL_DATA_PTR;
@ -67,3 +69,24 @@ int board_init(void)
out:
return 0;
}
#ifdef CONFIG_USB_DWC3
static struct dwc3_device dwc3_device_data = {
.maximum_speed = USB_SPEED_HIGH,
.base = 0xfe800000,
.dr_mode = USB_DR_MODE_PERIPHERAL,
.index = 0,
.dis_u2_susphy_quirk = 1,
};
int usb_gadget_handle_interrupts(void)
{
dwc3_uboot_handle_interrupt(0);
return 0;
}
int board_usb_init(int index, enum usb_init_type init)
{
return dwc3_uboot_init(&dwc3_device_data);
}
#endif