diff options
author | Julian Elischer <julian@FreeBSD.org> | 1998-12-14 21:14:11 +0000 |
---|---|---|
committer | Julian Elischer <julian@FreeBSD.org> | 1998-12-14 21:14:11 +0000 |
commit | 6384b0f1bb77cfc4f79d471e78178023017afc68 (patch) | |
tree | d0800e4c83fb66f37877c67574885ccbe93ac1a4 /sys/dev/pci | |
parent | 072fd7d9e756230724f29e831f59dbb1a7c6115a (diff) | |
download | src-6384b0f1bb77cfc4f79d471e78178023017afc68.tar.gz src-6384b0f1bb77cfc4f79d471e78178023017afc68.zip |
The OHCI interfaces I have access to map their control regs etc. into
memory address space rather than IO space.. reflect this when looking for the
interface revision register.
If this is not true for them all then we probably need some smarter code.
Notes
Notes:
svn path=/head/; revision=41802
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/ohci_pci.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c index 0d3e325e19b2..30aa1585af98 100644 --- a/sys/dev/pci/ohci_pci.c +++ b/sys/dev/pci/ohci_pci.c @@ -1,5 +1,5 @@ /* $NetBSD: ohci_pci.c,v 1.5 1998/11/25 22:32:04 augustss Exp $ */ -/* FreeBSD $Id$ */ +/* FreeBSD $Id: ohci_pci.c,v 1.5 1998/12/14 09:40:14 n_hibma Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -226,6 +226,7 @@ ohci_pci_attach(pcici_t config_id, int unit) usbd_status r; ohci_softc_t *sc = NULL; int rev; + vm_offset_t pbase; sc = malloc(sizeof(ohci_softc_t), M_DEVBUF, M_NOWAIT); /* Do not free it below, intr might use the sc */ @@ -235,7 +236,11 @@ ohci_pci_attach(pcici_t config_id, int unit) } memset(sc, 0, sizeof(ohci_softc_t)); - sc->sc_iobase = pci_conf_read(config_id,PCI_OHCI_BASE_REG) & 0xfffff000; + if(!pci_map_mem(config_id, PCI_CBMEM, + (vm_offset_t *)&sc->sc_iobase, &pbase)) { + printf("usb%d: couldn't map memory\n", unit); + return; + } sc->unit = unit; if ( !pci_map_int(config_id, (pci_inthand_t *)ohci_intr, @@ -249,7 +254,7 @@ ohci_pci_attach(pcici_t config_id, int unit) #endif { /* XXX is this correct? Does the correct version show up? */ - rev = inw(sc->sc_iobase+OHCI_REVISION); + rev = *((unsigned int *)(sc->sc_iobase+OHCI_REVISION)); printf("usb%d: OHCI version %d%d, interrupting at %d\n", unit, OHCI_REV_HI(rev), OHCI_REV_LO(rev), (int)pci_conf_read(config_id,PCI_INTERRUPT_REG) & 0xff); |