summaryrefslogtreecommitdiff
path: root/firmware/target/arm/rk27xx/usb-rk27xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/rk27xx/usb-rk27xx.c')
-rw-r--r--firmware/target/arm/rk27xx/usb-rk27xx.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/target/arm/rk27xx/usb-rk27xx.c b/firmware/target/arm/rk27xx/usb-rk27xx.c
index 20bf867c8d..09c9090a3b 100644
--- a/firmware/target/arm/rk27xx/usb-rk27xx.c
+++ b/firmware/target/arm/rk27xx/usb-rk27xx.c
@@ -32,6 +32,20 @@ int usb_status = USB_EXTRACTED;
32 32
33void usb_init_device(void) 33void usb_init_device(void)
34{ 34{
35 /* enable UDC interrupt */
36 INTC_IMR |= (1<<16);
37 INTC_IECR |= (1<<16);
38
39 EN_INT = EN_SUSP_INTR | /* Enable Suspend Interrupt */
40 EN_RESUME_INTR | /* Enable Resume Interrupt */
41 EN_USBRST_INTR | /* Enable USB Reset Interrupt */
42 EN_OUT0_INTR | /* Enable OUT Token receive Interrupt EP0 */
43 EN_IN0_INTR | /* Enable IN Token transmits Interrupt EP0 */
44 EN_SETUP_INTR; /* Enable SETUP Packet Receive Interrupt */
45
46 /* configure INTCON */
47 INTCON = UDC_INTHIGH_ACT | /* interrupt high active */
48 UDC_INTEN; /* enable EP0 interrupts */
35} 49}
36 50
37void usb_attach(void) 51void usb_attach(void)