13 #define __EXTERN_INLINE inline
16 #undef __EXTERN_INLINE
18 #include <linux/types.h>
19 #include <linux/pci.h>
22 #include <asm/ptrace.h>
39 #define DEBUG_CONFIG 0
42 # define DBGC(args) printk args
47 #define vuip volatile unsigned int *
92 mk_conf_addr(
struct pci_bus *pbus,
unsigned int device_fn,
int where,
93 unsigned long *
pci_addr,
unsigned char *type1)
98 DBGC((
"mk_conf_addr(bus=%d ,device_fn=0x%x, where=0x%x,"
99 " pci_addr=0x%p, type1=0x%p)\n",
100 bus, device_fn, where, pci_addr, type1));
103 int device = device_fn >> 3;
108 DBGC((
"mk_conf_addr: device (%d) > 20, returning -1\n",
114 addr = (device_fn << 8) | (where);
118 addr = (bus << 16) | (device_fn << 8) | (where);
121 DBGC((
"mk_conf_addr: returning pci_addr 0x%lx\n", addr));
129 unsigned int stat0,
value;
130 unsigned int haxr2 = 0;
134 DBGC((
"conf_read(addr=0x%lx, type1=%d)\n", addr, type1));
140 DBGC((
"conf_read: APECS DCSR was 0x%x\n", stat0));
147 DBGC((
"conf_read: TYPE1 access\n"));
158 asm volatile(
"ldl %0,%1; mb; mb" :
"=r"(
value) :
"m"(*(
vuip)
addr)
159 :
"$9",
"$10",
"$11",
"$12",
"$13",
"$14",
"memory");
180 DBGC((
"conf_read: APECS DCSR after read 0x%x\n", stat0));
183 if (stat0 & 0xffe0U) {
185 if (!(stat0 & 0x0800)) {
186 printk(
"apecs.c:conf_read: got stat0=%x\n", stat0);
208 conf_write(
unsigned long addr,
unsigned int value,
unsigned char type1)
212 unsigned int haxr2 = 0;
252 if (stat0 & 0xffe0U) {
254 if (!(stat0 & 0x0800)) {
255 printk(
"apecs.c:conf_write: got stat0=%x\n", stat0);
282 if (mk_conf_addr(bus, devfn, where, &pci_addr, &type1))
285 mask = (size - 1) * 8;
286 shift = (where & 3) * 8;
288 *value =
conf_read(addr, type1) >> (shift);
293 apecs_write_config(
struct pci_bus *bus,
unsigned int devfn,
int where,
300 if (mk_conf_addr(bus, devfn, where, &pci_addr, &type1))
303 mask = (size - 1) * 8;
305 conf_write(addr, value << ((where & 3) * 8), type1);
311 .read = apecs_read_config,
312 .write = apecs_write_config,
339 hose->sparse_io_base =
APECS_IO - IDENT_ADDR;
340 hose->dense_io_base = 0;
397 mchk_header = (
struct el_common *)la_ptr;
401 -
sizeof(mchk_procdata->
paltemp));
417 && (mchk_sysdata->
epic_dcsr & 0x0c00UL)));