Added more verbose debugging output to uhci_run
This commit is contained in:
parent
3d8befc22d
commit
48f79d0e5c
@ -324,8 +324,19 @@ uhci_init(sc)
|
||||
UWRITE2(sc, UHCI_FRNUM, 0); /* set frame number to 0 */
|
||||
UWRITE4(sc, UHCI_FLBASEADDR, DMAADDR(&dma)); /* set frame list */
|
||||
|
||||
#ifdef USB_DEBUG
|
||||
/* PR1 */
|
||||
if ( UREAD4(sc, UHCI_FLBASEADDR) != DMAADDR(&dma) )
|
||||
printf("PR1:before busreset: FLBASEADDR = 0x%08x != DMADDR(&dma) = 0x%08x\n",
|
||||
UREAD4(sc, UHCI_FLBASEADDR), DMAADDR(&dma));
|
||||
#endif
|
||||
uhci_busreset(sc);
|
||||
|
||||
#ifdef USB_DEBUG
|
||||
/* PR1 */
|
||||
if ( UREAD4(sc, UHCI_FLBASEADDR) != DMAADDR(&dma) )
|
||||
printf("PR1:after busreset: FLBASEADDR = 0x%08x != DMADDR(&dma) = 0x%08x\n",
|
||||
UREAD4(sc, UHCI_FLBASEADDR), DMAADDR(&dma));
|
||||
#endif
|
||||
/* Allocate the dummy QH where bulk traffic will be queued. */
|
||||
bsqh = uhci_alloc_sqh(sc);
|
||||
if (!bsqh)
|
||||
@ -391,7 +402,7 @@ static void
|
||||
uhci_dumpregs(sc)
|
||||
uhci_softc_t *sc;
|
||||
{
|
||||
printf("%s; regs: cmd=%04x, sts=%04x, intr=%04x, frnum=%04x, "
|
||||
printf("%s: regs: cmd=%04x, sts=%04x, intr=%04x, frnum=%04x, "
|
||||
"flbase=%08x, sof=%02x, portsc1=%04x, portsc2=%04x, "
|
||||
"legsup=%04x\n",
|
||||
USBDEVNAME(sc->sc_bus.bdev),
|
||||
@ -937,11 +948,19 @@ uhci_run(sc, run)
|
||||
int run;
|
||||
{
|
||||
int s, n, running;
|
||||
#ifdef USB_DEBUG
|
||||
printf("PR1:uhci_run:start: ");
|
||||
uhci_dumpregs(sc);
|
||||
#endif
|
||||
|
||||
s = splusb();
|
||||
running = ((UREAD2(sc, UHCI_STS) & UHCI_STS_HCH) == 0);
|
||||
if (run == running) {
|
||||
splx(s);
|
||||
#ifdef USB_DEBUG
|
||||
printf("PR1:uhci_run:do_nothing: ");
|
||||
uhci_dumpregs(sc);
|
||||
#endif
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
}
|
||||
UWRITE2(sc, UHCI_CMD, run ? UHCI_CMD_RS : 0);
|
||||
@ -950,6 +969,10 @@ uhci_run(sc, run)
|
||||
/* return when we've entered the state we want */
|
||||
if (run == running) {
|
||||
splx(s);
|
||||
#ifdef USB_DEBUG
|
||||
printf("PR1:uhci_run:succeed(%d): ", n);
|
||||
uhci_dumpregs(sc);
|
||||
#endif
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
}
|
||||
usb_delay_ms(&sc->sc_bus, 1);
|
||||
@ -958,6 +981,7 @@ uhci_run(sc, run)
|
||||
printf("%s: cannot %s\n", USBDEVNAME(sc->sc_bus.bdev),
|
||||
run ? "start" : "stop");
|
||||
#ifdef USB_DEBUG
|
||||
printf("PR1:uhci_run:fail: ");
|
||||
uhci_dumpregs(sc);
|
||||
#endif
|
||||
return (USBD_IOERROR);
|
||||
|
Loading…
Reference in New Issue
Block a user