12 #define __EXTERN_INLINE inline
15 #undef __EXTERN_INLINE
17 #include <linux/types.h>
18 #include <linux/pci.h>
19 #include <linux/sched.h>
24 #include <asm/ptrace.h>
26 #include <asm/cacheflush.h>
27 #include <asm/tlbflush.h>
36 #define DEBUG_CONFIG 0
39 # define DBG_CFG(args) printk args
41 # define DBG_CFG(args)
82 mk_conf_addr(
struct pci_bus *pbus,
unsigned int device_fn,
int where,
83 unsigned long *
pci_addr,
unsigned char *type1)
88 DBG_CFG((
"mk_conf_addr(bus=%d ,device_fn=0x%x, where=0x%x, "
89 "pci_addr=0x%p, type1=0x%p)\n",
90 bus, device_fn, where, pci_addr, type1));
94 addr = (bus << 16) | (device_fn << 8) | where;
98 DBG_CFG((
"mk_conf_addr: returning pci_addr 0x%lx\n", addr));
103 irongate_read_config(
struct pci_bus *
bus,
unsigned int devfn,
int where,
109 if (mk_conf_addr(bus, devfn, where, &addr, &type1))
120 *value = *(
vuip)addr;
128 irongate_write_config(
struct pci_bus *bus,
unsigned int devfn,
int where,
134 if (mk_conf_addr(bus, devfn, where, &addr, &type1))
160 .read = irongate_read_config,
161 .write = irongate_write_config,
167 unsigned int nmi_ctl=0;
168 unsigned int IRONGATE_jd;
172 printk(
"Iron stat_cmd %x\n", IRONGATE_jd);
178 printk(
"Iron ECC %x\n", IRONGATE_jd);
191 if (IRONGATE_jd & 0x300)
goto again;
196 #define IRONGATE_3GB 0xc0000000UL
202 albacore_init_arch(
void)
205 unsigned long pci_mem = (memtop + 0x1000000
UL) & ~0xffffffUL;
207 int pal_rev, pal_var;
217 if (alpha_using_srm &&
218 (pal_rev < 0x13e || (pal_rev == 0x13e && pal_var < 2)))
225 alpha_mv.min_mem_address = pci_mem;
226 if (memtop > pci_mem) {
227 #ifdef CONFIG_BLK_DEV_INITRD
229 extern void *move_initrd(
unsigned long);
232 if (initrd_end &&
__pa(initrd_end) > pci_mem) {
238 if (!move_initrd(pci_mem))
239 printk(
"irongate_init_arch: initrd too big "
240 "(%ldK)\ndisabling initrd\n",
246 printk(
"irongate_init_arch: temporarily reserving "
247 "region %08lx-%08lx for PCI\n", pci_mem, memtop - 1);
252 irongate_setup_agp(
void)
264 int amd761 = (
IRONGATE0->dev_vendor >> 16) > 0x7006;
271 albacore_init_arch();
273 irongate_setup_agp();
288 hose->sparse_mem_base = 0;
289 hose->sparse_io_base = 0;
295 hose->sg_isa = hose->sg_pci =
NULL;
305 #include <linux/agpgart.h>
306 #include <linux/export.h>
307 #include <asm/pgalloc.h>
309 #define GET_PAGE_DIR_OFF(addr) (addr >> 22)
310 #define GET_PAGE_DIR_IDX(addr) (GET_PAGE_DIR_OFF(addr))
312 #define GET_GATT_OFF(addr) ((addr & 0x003ff000) >> 12)
313 #define GET_GATT(addr) (gatt_pages[GET_PAGE_DIR_IDX(addr)])
320 unsigned long baddr,
last;
321 u32 *mmio_regs, *gatt_pages, *cur_gatt,
pte;
322 unsigned long gart_bus_addr;
337 if (addr >= gart_bus_addr && addr + size - 1 <
356 printk(
"AGP ioremap failed... addr not page aligned (0x%lx)\n",
360 last = addr + size - 1;
364 printk(
"irongate_ioremap(0x%lx, 0x%lx)\n", addr, size);
365 printk(
"irongate_ioremap: gart_bus_addr 0x%lx\n", gart_bus_addr);
366 printk(
"irongate_ioremap: gart_aper_size 0x%lx\n", gart_aper_size);
367 printk(
"irongate_ioremap: mmio_regs %p\n", mmio_regs);
368 printk(
"irongate_ioremap: gatt_pages %p\n", gatt_pages);
374 printk(
"irongate_ioremap: cur_gatt %p pte 0x%x\n",
383 if (!area)
return NULL;
385 for(baddr = addr,
vaddr = (
unsigned long)area->addr;
392 if (__alpha_remap_area_pages(
vaddr,
394 printk(
"AGP ioremap: FAILED to map...\n");
404 printk(
"irongate_ioremap(0x%lx, 0x%lx) returning 0x%lx\n",
414 unsigned long addr = (
unsigned long) xaddr;
415 if (((
long)addr >> 41) == -2)