summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Gala <galak@blarg.somerset.sps.mot.com>2004-02-15 23:27:13 -0600
committerKumar Gala <galak@blarg.somerset.sps.mot.com>2004-02-15 23:27:13 -0600
commit3be7424afbb5f028c6b9e214f4848435c585e774 (patch)
tree3b33ae774009c336bd01460ffd254cf3ea9f5f5b
parente93aa38371fff48b5fd95492c0903ca6bf1224fd (diff)
parent8b7febe9512065387b2e535da42f6b1eea45d362 (diff)
Merge http://linux.bkbits.net/linux-2.5
into blarg.somerset.sps.mot.com:/local0/bk/linux-2.5
-rw-r--r--arch/ppc/syslib/indirect_pci.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/ppc/syslib/indirect_pci.c b/arch/ppc/syslib/indirect_pci.c
index a012f65b3a4e..68a8b1ad2895 100644
--- a/arch/ppc/syslib/indirect_pci.c
+++ b/arch/ppc/syslib/indirect_pci.c
@@ -21,6 +21,12 @@
#include <asm/pci-bridge.h>
#include <asm/machdep.h>
+#ifdef CONFIG_PPC_INDIRECT_PCI_BE
+#define PCI_CFG_OUT out_be32
+#else
+#define PCI_CFG_OUT out_le32
+#endif
+
static int
indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 *val)
@@ -37,9 +43,10 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
if (bus->number != hose->first_busno)
cfg_type = 1;
- out_be32(hose->cfg_addr,
- (((offset & 0xfc) | cfg_type) << 24) | (devfn << 16)
- | ((bus->number - hose->bus_offset) << 8) | 0x80);
+ PCI_CFG_OUT(hose->cfg_addr,
+ (0x80000000 | ((dev->bus->number - hose->bus_offset) << 16)
+ | (dev->devfn << 8) | ((offset & 0xfc) | cfg_type)));
+
/*
* Note: the caller has already checked that offset is
* suitably aligned and that len is 1, 2 or 4.
@@ -75,9 +82,10 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
if (bus->number != hose->first_busno)
cfg_type = 1;
- out_be32(hose->cfg_addr,
- (((offset & 0xfc) | cfg_type) << 24) | (devfn << 16)
- | ((bus->number - hose->bus_offset) << 8) | 0x80);
+ PCI_CFG_OUT(hose->cfg_addr,
+ (0x80000000 | ((dev->bus->number - hose->bus_offset) << 16)
+ | (dev->devfn << 8) | ((offset & 0xfc) | cfg_type)));
+
/*
* Note: the caller has already checked that offset is
* suitably aligned and that len is 1, 2 or 4.