summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-04-05 18:18:07 +0000
committerthompsa <thompsa@FreeBSD.org>2009-04-05 18:18:07 +0000
commit782adcb07d18f6d3dd00a93b67897ba313ec04c8 (patch)
tree31a14b7684178c9a2df1ffe1679fc404737fb7f3 /sys/dev/usb/controller
parentd60cc40660fe9b1c72d3127d41f6999c2b8a8d20 (diff)
downloadFreeBSD-src-782adcb07d18f6d3dd00a93b67897ba313ec04c8.zip
FreeBSD-src-782adcb07d18f6d3dd00a93b67897ba313ec04c8.tar.gz
MFp4 //depot/projects/usb@159671
Fix interrupt register setting on the atmegadci controller. Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb/controller')
-rw-r--r--sys/dev/usb/controller/atmegadci.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/usb/controller/atmegadci.c b/sys/dev/usb/controller/atmegadci.c
index 8eea576..57a091f 100644
--- a/sys/dev/usb/controller/atmegadci.c
+++ b/sys/dev/usb/controller/atmegadci.c
@@ -649,7 +649,7 @@ atmegadci_interrupt(struct atmegadci_softc *sc)
status = ATMEGA_READ_1(sc, ATMEGA_UDINT);
/* clear all set interrupts */
- ATMEGA_WRITE_1(sc, ATMEGA_UDINT, ~status);
+ ATMEGA_WRITE_1(sc, ATMEGA_UDINT, (~status) & 0x7D);
DPRINTFN(14, "UDINT=0x%02x\n", status);
@@ -719,7 +719,7 @@ atmegadci_interrupt(struct atmegadci_softc *sc)
status = ATMEGA_READ_1(sc, ATMEGA_USBINT);
/* clear all set interrupts */
- ATMEGA_WRITE_1(sc, ATMEGA_USBINT, ~status);
+ ATMEGA_WRITE_1(sc, ATMEGA_USBINT, (~status) & 0x03);
if (status & ATMEGA_USBINT_VBUSTI) {
uint8_t temp;
@@ -731,10 +731,7 @@ atmegadci_interrupt(struct atmegadci_softc *sc)
}
/* check for any endpoint interrupts */
status = ATMEGA_READ_1(sc, ATMEGA_UEINT);
-
- /* clear all set interrupts */
- ATMEGA_WRITE_1(sc, ATMEGA_UEINT, ~status);
-
+ /* the hardware will clear the UEINT bits automatically */
if (status) {
DPRINTFN(5, "real endpoint interrupt UEINT=0x%02x\n", status);
@@ -1249,6 +1246,12 @@ atmegadci_init(struct atmegadci_softc *sc)
ATMEGA_WRITE_1(sc, ATMEGA_UHWCON,
ATMEGA_UHWCON_UVREGE | ATMEGA_UHWCON_UIMOD);
#endif
+ /* make sure USB is enabled */
+ ATMEGA_WRITE_1(sc, ATMEGA_USBCON,
+ ATMEGA_USBCON_USBE |
+ ATMEGA_USBCON_OTGPADE |
+ ATMEGA_USBCON_VBUSTE);
+
/* turn on clocks */
(sc->sc_clocks_on) (&sc->sc_bus);
OpenPOWER on IntegriCloud