diff options
author | se <se@FreeBSD.org> | 1997-05-26 21:52:41 +0000 |
---|---|---|
committer | se <se@FreeBSD.org> | 1997-05-26 21:52:41 +0000 |
commit | b80cb4d64d11b258df01bec3f0222c521b02f189 (patch) | |
tree | 9d7469382d93c93393f12d59858bea241f8842db /sys/i386 | |
parent | d3b40e61a72f912d95e1d111dfde12fb8fc11155 (diff) | |
download | FreeBSD-src-b80cb4d64d11b258df01bec3f0222c521b02f189.zip FreeBSD-src-b80cb4d64d11b258df01bec3f0222c521b02f189.tar.gz |
Yet another fix for configuration mechanism 1 register accesses:
Adjust the data port address by adding the two low order bits of
the register number. The address port takes only a word address
(i.e. ignores the two low order bits written to it).
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/isa/pcibus.c | 9 | ||||
-rw-r--r-- | sys/i386/pci/pci_bus.c | 9 | ||||
-rw-r--r-- | sys/i386/pci/pci_cfgreg.c | 9 | ||||
-rw-r--r-- | sys/i386/pci/pci_pir.c | 9 |
4 files changed, 20 insertions, 16 deletions
diff --git a/sys/i386/isa/pcibus.c b/sys/i386/isa/pcibus.c index 7085c1e..b801abd 100644 --- a/sys/i386/isa/pcibus.c +++ b/sys/i386/isa/pcibus.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcibus.c,v 1.37 1997/05/26 21:11:05 se Exp $ + * $Id: pcibus.c,v 1.38 1997/05/26 21:25:24 se Exp $ * */ @@ -59,9 +59,10 @@ pci_cfgenable(unsigned bus, unsigned slot, unsigned func, int reg, int bytes) && (reg & (bytes -1)) == 0) { switch (cfgmech) { case 1: - outl(CONF1_ADDR_PORT, (1 << 31) | - (bus << 16) | (slot << 11) | (func << 8) | reg); - dataport = CONF1_DATA_PORT; + outl(CONF1_ADDR_PORT, (1 << 31) + | (bus << 16) | (slot << 11) + | (func << 8) | (reg & ~0x03)); + dataport = CONF1_DATA_PORT + (reg & 0x03); break; case 2: outb(CONF2_ENABLE_PORT, 0xf0 | (func << 1)); diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c index 7085c1e..b801abd 100644 --- a/sys/i386/pci/pci_bus.c +++ b/sys/i386/pci/pci_bus.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcibus.c,v 1.37 1997/05/26 21:11:05 se Exp $ + * $Id: pcibus.c,v 1.38 1997/05/26 21:25:24 se Exp $ * */ @@ -59,9 +59,10 @@ pci_cfgenable(unsigned bus, unsigned slot, unsigned func, int reg, int bytes) && (reg & (bytes -1)) == 0) { switch (cfgmech) { case 1: - outl(CONF1_ADDR_PORT, (1 << 31) | - (bus << 16) | (slot << 11) | (func << 8) | reg); - dataport = CONF1_DATA_PORT; + outl(CONF1_ADDR_PORT, (1 << 31) + | (bus << 16) | (slot << 11) + | (func << 8) | (reg & ~0x03)); + dataport = CONF1_DATA_PORT + (reg & 0x03); break; case 2: outb(CONF2_ENABLE_PORT, 0xf0 | (func << 1)); diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index 7085c1e..b801abd 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcibus.c,v 1.37 1997/05/26 21:11:05 se Exp $ + * $Id: pcibus.c,v 1.38 1997/05/26 21:25:24 se Exp $ * */ @@ -59,9 +59,10 @@ pci_cfgenable(unsigned bus, unsigned slot, unsigned func, int reg, int bytes) && (reg & (bytes -1)) == 0) { switch (cfgmech) { case 1: - outl(CONF1_ADDR_PORT, (1 << 31) | - (bus << 16) | (slot << 11) | (func << 8) | reg); - dataport = CONF1_DATA_PORT; + outl(CONF1_ADDR_PORT, (1 << 31) + | (bus << 16) | (slot << 11) + | (func << 8) | (reg & ~0x03)); + dataport = CONF1_DATA_PORT + (reg & 0x03); break; case 2: outb(CONF2_ENABLE_PORT, 0xf0 | (func << 1)); diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c index 7085c1e..b801abd 100644 --- a/sys/i386/pci/pci_pir.c +++ b/sys/i386/pci/pci_pir.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcibus.c,v 1.37 1997/05/26 21:11:05 se Exp $ + * $Id: pcibus.c,v 1.38 1997/05/26 21:25:24 se Exp $ * */ @@ -59,9 +59,10 @@ pci_cfgenable(unsigned bus, unsigned slot, unsigned func, int reg, int bytes) && (reg & (bytes -1)) == 0) { switch (cfgmech) { case 1: - outl(CONF1_ADDR_PORT, (1 << 31) | - (bus << 16) | (slot << 11) | (func << 8) | reg); - dataport = CONF1_DATA_PORT; + outl(CONF1_ADDR_PORT, (1 << 31) + | (bus << 16) | (slot << 11) + | (func << 8) | (reg & ~0x03)); + dataport = CONF1_DATA_PORT + (reg & 0x03); break; case 2: outb(CONF2_ENABLE_PORT, 0xf0 | (func << 1)); |