summaryrefslogtreecommitdiffstats
path: root/sys/pci/pci.c
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1996-11-12 23:10:24 +0000
committerse <se@FreeBSD.org>1996-11-12 23:10:24 +0000
commitbb3b58af857086afe079fca68139fd585381bfff (patch)
treeb3fffe0d2e086f52bf8b84c982f3b239619f1681 /sys/pci/pci.c
parent74bda8433b8407a6199e7840fb48fde136cd1c8f (diff)
downloadFreeBSD-src-bb3b58af857086afe079fca68139fd585381bfff.zip
FreeBSD-src-bb3b58af857086afe079fca68139fd585381bfff.tar.gz
Fix PCI to PCI bridge register bit field masks.
Thanks to "Mike Durian" <durian@plutotech.com> for the very good problem report and his support as a beta tester of this patch.
Diffstat (limited to 'sys/pci/pci.c')
-rw-r--r--sys/pci/pci.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/sys/pci/pci.c b/sys/pci/pci.c
index d1d696d..2913c5b 100644
--- a/sys/pci/pci.c
+++ b/sys/pci/pci.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pci.c,v 1.56 1996/10/14 13:04:34 se Exp $
+** $Id: pci.c,v 1.57 1996/10/22 20:20:11 se Exp $
**
** General subroutines for the PCI bus.
** pci_configure ()
@@ -729,23 +729,14 @@ pci_bus_config (void)
** Bridge was configured by the bios.
** Read out the mapped io region.
*/
- u_int reg, data, mask;
+ unsigned reg;
reg = pci_conf_read (tag,
PCI_PCI_BRIDGE_IO_REG);
- pci_conf_write(tag,
- PCI_PCI_BRIDGE_IO_REG, 0xFFFF);
- data = pci_conf_read (tag,
- PCI_PCI_BRIDGE_IO_REG);
- pci_conf_write(tag,
- PCI_PCI_BRIDGE_IO_REG, reg & 0xffff);
-
- mask = (0xFF00 ^ (data & 0xFF00)) | 0xFF;
-
this->pcicb_iobase =
PCI_PPB_IOBASE_EXTRACT (reg);
this->pcicb_iolimit =
- PCI_PPB_IOLIMIT_EXTRACT(reg) | mask;
+ PCI_PPB_IOLIMIT_EXTRACT(reg);
/*
** Note the used io space.
@@ -760,25 +751,17 @@ pci_bus_config (void)
** Bridge was configured by the bios.
** Read out the mapped memory regions.
*/
- u_int reg, data, mask;
+ unsigned reg;
/*
** non prefetchable memory
*/
reg = pci_conf_read (tag,
PCI_PCI_BRIDGE_MEM_REG);
- pci_conf_write(tag,
- PCI_PCI_BRIDGE_MEM_REG, 0xFFFFFFFF);
- data = pci_conf_read (tag,
- PCI_PCI_BRIDGE_MEM_REG);
- pci_conf_write(tag,
- PCI_PCI_BRIDGE_MEM_REG, reg);
-
- mask = 0xFFFFFFFF ^ (data & 0xFFFF0000);
this->pcicb_membase =
PCI_PPB_MEMBASE_EXTRACT (reg);
this->pcicb_memlimit =
- PCI_PPB_MEMLIMIT_EXTRACT(reg) | mask;
+ PCI_PPB_MEMLIMIT_EXTRACT(reg);
/*
** Register used memory space.
@@ -792,18 +775,10 @@ pci_bus_config (void)
*/
reg = pci_conf_read (tag,
PCI_PCI_BRIDGE_PMEM_REG);
- pci_conf_write(tag,
- PCI_PCI_BRIDGE_PMEM_REG, 0xFFFFFFFF);
- data = pci_conf_read (tag,
- PCI_PCI_BRIDGE_PMEM_REG);
- pci_conf_write(tag,
- PCI_PCI_BRIDGE_PMEM_REG, reg);
-
- mask = 0xFFFFFFFF ^ (data & 0xFFFF0000);
this->pcicb_p_membase=
PCI_PPB_MEMBASE_EXTRACT (reg);
this->pcicb_p_memlimit=
- PCI_PPB_MEMLIMIT_EXTRACT(reg) | mask;
+ PCI_PPB_MEMLIMIT_EXTRACT(reg);
/*
** Register used memory space.
OpenPOWER on IntegriCloud