summaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/early.c
diff options
context:
space:
mode:
authorYinghai Lu2008-05-22 23:35:21 +0200
committerJesse Barnes2008-06-10 19:59:51 +0200
commite7891c733f9b26c851edde50cf886a30bd133dbd (patch)
tree586fcf54403d2d2b04e62f1665b33abc58bb09c1 /arch/x86/pci/early.c
parentImplement new suspend and hibernation callbacks for platform busses (diff)
downloadkernel-qcow2-linux-e7891c733f9b26c851edde50cf886a30bd133dbd.tar.gz
kernel-qcow2-linux-e7891c733f9b26c851edde50cf886a30bd133dbd.tar.xz
kernel-qcow2-linux-e7891c733f9b26c851edde50cf886a30bd133dbd.zip
PCI/x86: write_pci_config_byte fix offset
also add write_pci_config_16 Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/x86/pci/early.c')
-rw-r--r--arch/x86/pci/early.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/pci/early.c b/arch/x86/pci/early.c
index 42df4b6606df..8e2821e8dac5 100644
--- a/arch/x86/pci/early.c
+++ b/arch/x86/pci/early.c
@@ -49,7 +49,14 @@ void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val)
{
PDprintk("%x writing to %x: %x\n", slot, offset, val);
outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
- outb(val, 0xcfc);
+ outb(val, 0xcfc + (offset&3));
+}
+
+void write_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset, u16 val)
+{
+ PDprintk("%x writing to %x: %x\n", slot, offset, val);
+ outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
+ outw(val, 0xcfc + (offset&2));
}
int early_pci_allowed(void)