patch-2.4.23 linux-2.4.23/arch/ppc/kernel/indirect_pci.c

Next file: linux-2.4.23/arch/ppc/kernel/irq.c
Previous file: linux-2.4.23/arch/ppc/kernel/idle_gen.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/arch/ppc/kernel/indirect_pci.c linux-2.4.23/arch/ppc/kernel/indirect_pci.c
@@ -24,6 +24,12 @@
 #define cfg_read(val, addr, type, op)	*val = op((type)(addr))
 #define cfg_write(val, addr, type, op)	op((type *)(addr), (val))
 
+#ifdef CONFIG_PPC_INDIRECT_PCI_BE
+#define PCI_CFG_OUT out_be32
+#else
+#define PCI_CFG_OUT out_le32
+#endif
+
 #define INDIRECT_PCI_OP(rw, size, type, op, mask)			 \
 static int								 \
 indirect_##rw##_config_##size(struct pci_dev *dev, int offset, type val) \
@@ -39,9 +45,9 @@
 		if (dev->bus->number != hose->first_busno)		 \
 			cfg_type = 1;					 \
 									 \
-	out_be32(hose->cfg_addr, 					 \
-		 (((offset & 0xfc) | cfg_type) << 24) | (dev->devfn << 16) \
-		 | ((dev->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)));	 \
 	cfg_##rw(val, hose->cfg_data + (offset & mask), type, op);	 \
 	return PCIBIOS_SUCCESSFUL;    					 \
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)