diff options
author | Sven Schnelle <svens@stackframe.org> | 2019-02-18 19:19:28 +0100 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2019-02-18 20:06:08 +0100 |
commit | f04672a1a7688c6869403572c6a6ec8a7e3d065d (patch) | |
tree | 8ef34b1703110c4485575c726ae4e199ff613f3c | |
parent | d5740c31ea8e9a238c5564eadba23eb21d9e23a5 (diff) | |
download | seabios-hppa-f04672a1a7688c6869403572c6a6ec8a7e3d065d.zip seabios-hppa-f04672a1a7688c6869403572c6a6ec8a7e3d065d.tar.gz seabios-hppa-f04672a1a7688c6869403572c6a6ec8a7e3d065d.tar.bz2 |
dino: strip lower 2 bits from pci config address
Signed-off-by: Sven Schnelle <svens@stackframe.org>
-rw-r--r-- | src/parisc/hppa.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/parisc/hppa.h b/src/parisc/hppa.h index ea4cfbc..18dcd24 100644 --- a/src/parisc/hppa.h +++ b/src/parisc/hppa.h @@ -237,9 +237,9 @@ static inline void outb(u8 value, portaddr_t port) { *(volatile u8 *)(port) = value; } else { /* write PCI I/O address to Dino's PCI_CONFIG_ADDR */ - outl(port, DINO_HPA + 0x064); + outl(port & ~3U, DINO_HPA + 0x064); /* write value to PCI_IO_DATA */ - outb(value, DINO_HPA + 0x06c); + outb(value, DINO_HPA + 0x06c + (port & 3)); } } @@ -248,9 +248,9 @@ static inline u8 inb(portaddr_t port) { return *(volatile u8 *)(port); } else { /* write PCI I/O address to Dino's PCI_CONFIG_ADDR */ - outl(port, DINO_HPA + 0x064); + outl(port & ~3U, DINO_HPA + 0x064); /* read value to PCI_IO_DATA */ - return inb(DINO_HPA + 0x06c); + return inb(DINO_HPA + 0x06c + (port & 3)); } } @@ -259,9 +259,9 @@ static inline u16 inw(portaddr_t port) { return *(volatile u16 *)(port); } else { /* write PCI I/O address to Dino's PCI_CONFIG_ADDR */ - outl(port, DINO_HPA + 0x064); + outl(port & ~3U, DINO_HPA + 0x064); /* read value to PCI_IO_DATA */ - return inw(DINO_HPA + 0x06c); + return inw(DINO_HPA + 0x06c + (port & 3)); } } static inline u32 inl(portaddr_t port) { @@ -269,9 +269,9 @@ static inline u32 inl(portaddr_t port) { return *(volatile u32 *)(port); } else { /* write PCI I/O address to Dino's PCI_CONFIG_ADDR */ - outl(port, DINO_HPA + 0x064); + outl(port & ~3U, DINO_HPA + 0x064); /* read value to PCI_IO_DATA */ - return inl(DINO_HPA + 0x06c); + return inl(DINO_HPA + 0x06c + (port & 3)); } } |