summaryrefslogtreecommitdiffstats
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;
void usb_init_device(void)
{
+ /* enable UDC interrupt */
+ INTC_IMR |= (1<<16);
+ INTC_IECR |= (1<<16);
+
+ EN_INT = EN_SUSP_INTR | /* Enable Suspend Interrupt */
+ EN_RESUME_INTR | /* Enable Resume Interrupt */
+ EN_USBRST_INTR | /* Enable USB Reset Interrupt */
+ EN_OUT0_INTR | /* Enable OUT Token receive Interrupt EP0 */
+ EN_IN0_INTR | /* Enable IN Token transmits Interrupt EP0 */
+ EN_SETUP_INTR; /* Enable SETUP Packet Receive Interrupt */
+
+ /* configure INTCON */
+ INTCON = UDC_INTHIGH_ACT | /* interrupt high active */
+ UDC_INTEN; /* enable EP0 interrupts */
}
void usb_attach(void)