23 #include <linux/pci.h>
24 #include <linux/kernel.h>
25 #include <linux/types.h>
27 #include <asm/addrspace.h>
28 #include <asm/debug.h>
32 #define RTABORT (0x1<<9)
33 #define RMABORT (0x1<<10)
34 #define EMMA2RH_PCI_SLOT_NUM 9
55 if ((*bus_num >= 64) || (
PCI_SLOT(devfn) >= 16))
61 static inline int set_pci_configuration_address(
unsigned char bus_num,
62 unsigned int devfn,
int where)
71 config_win0 = (1 << (22 +
PCI_SLOT(devfn))) | (5 << 9);
76 config_win0 = (bus_num << 26) | (
PCI_SLOT(devfn) << 22) |
84 static int pci_config_read(
struct pci_bus *
bus,
unsigned int devfn,
int where,
99 if (set_pci_configuration_address(bus_num, devfn, where) < 0)
104 (where & 0xfffffffc));
108 *val = (data >> ((where & 3) << 3)) & 0xffU;
111 *val = (data >> ((where & 2) << 3)) & 0xffffU;
129 static int pci_config_write(
struct pci_bus *bus,
unsigned int devfn,
int where,
143 if (set_pci_configuration_address(bus_num, devfn, where) < 0)
149 (where & 0xfffffffc));
153 shift = (where & 3) << 3;
154 data &= ~(0xff
U << shift);
155 data |= ((val & 0xff
U) << shift);
158 shift = (where & 2) << 3;
159 data &= ~(0xffff
U << shift);
160 data |= ((val & 0xffff
U) << shift);
170 (where & 0xfffffffc)) =
data;
180 .read = pci_config_read,
181 .write = pci_config_write,