Date: Mon, 23 Mar 2009 12:57:47 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 159671 for review Message-ID: <200903231257.n2NCvlTr004382@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=159671 Change 159671 by hselasky@hselasky_laptop001 on 2009/03/23 12:57:01 USB controller (ATMEGADCI): - fix some chip programming Affected files ... .. //depot/projects/usb/src/sys/dev/usb/controller/atmegadci.c#12 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/controller/atmegadci.c#12 (text+ko) ==== @@ -649,7 +649,7 @@ 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 @@ 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 @@ } /* 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 @@ 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);help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903231257.n2NCvlTr004382>
