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:
parent
41933c04ad
commit
da65ef61af
|
|
@ -10,6 +10,8 @@
|
||||||
#include <dm/uclass-internal.h>
|
#include <dm/uclass-internal.h>
|
||||||
#include <asm/arch/periph.h>
|
#include <asm/arch/periph.h>
|
||||||
#include <power/regulator.h>
|
#include <power/regulator.h>
|
||||||
|
#include <usb.h>
|
||||||
|
#include <dwc3-uboot.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
|
@ -67,3 +69,24 @@ int board_init(void)
|
||||||
out:
|
out:
|
||||||
return 0;
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue