Merge from NetBSD:
ohci.c: -r1.68 ohcireg.h: -r1.13 date: 2000/01/31 20:17:25; author: augustss; state: Exp; Fiddle with over-current protect when turning on port power to make things work for some OHCI controllers.
This commit is contained in:
parent
3bedcae34f
commit
851522be27
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ohci.c,v 1.65 2000/01/25 12:06:21 augustss Exp $ */
|
||||
/* $NetBSD: ohci.c,v 1.68 2000/01/31 20:17:25 augustss Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
@ -641,7 +641,7 @@ ohci_init(sc)
|
||||
ohci_soft_ed_t *sed, *psed;
|
||||
usbd_status err;
|
||||
int i;
|
||||
u_int32_t s, ctl, ival, hcr, fm, per, rev;
|
||||
u_int32_t s, ctl, ival, hcr, fm, per, rev, desca;
|
||||
|
||||
DPRINTF(("ohci_init: start\n"));
|
||||
#if defined(__OpenBSD__)
|
||||
@ -815,7 +815,12 @@ ohci_init(sc)
|
||||
per = OHCI_PERIODIC(ival); /* 90% periodic */
|
||||
OWRITE4(sc, OHCI_PERIODIC_START, per);
|
||||
|
||||
OWRITE4(sc, OHCI_RH_STATUS, OHCI_LPSC); /* Enable port power */
|
||||
/* Fiddle the No OverCurrent Protection bit to avoid chip bug. */
|
||||
desca = OREAD4(sc, OHCI_RH_DESCRIPTOR_A);
|
||||
OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca | OHCI_NOCP);
|
||||
OWRITE4(sc, OHCI_RH_STATUS, OHCI_LPSC); /* Enable port power */
|
||||
usb_delay_ms(&sc->sc_bus, 5);
|
||||
OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca);
|
||||
|
||||
sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A));
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ohcireg.h,v 1.11 2000/01/16 10:35:24 augustss Exp $ */
|
||||
/* $NetBSD: ohcireg.h,v 1.13 2000/01/31 20:17:26 augustss Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
|
||||
@ -110,6 +110,9 @@
|
||||
#define OHCI_GET_NDP(s) ((s) & 0xff)
|
||||
#define OHCI_PSM 0x0100 /* Power Switching Mode */
|
||||
#define OHCI_NPS 0x0200 /* No Power Switching */
|
||||
#define OHCI_DT 0x0400 /* Device Type */
|
||||
#define OHCI_OCPM 0x0800 /* Overcurrent Protection Mode */
|
||||
#define OHCI_NOCP 0x1000 /* No Overcurrent Protection */
|
||||
#define OHCI_GET_POTPGT(s) ((s) >> 24)
|
||||
#define OHCI_RH_DESCRIPTOR_B 0x4c
|
||||
#define OHCI_RH_STATUS 0x50
|
||||
|
Loading…
x
Reference in New Issue
Block a user