This commit was generated by cvs2svn to compensate for changes in r517,
[linux-2.6.git] / arch / mips / pci / pci-yosemite.c
1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
7  */
8 #include <linux/init.h>
9 #include <linux/kernel.h>
10 #include <linux/types.h>
11 #include <linux/pci.h>
12 #include <asm/gt64240.h>
13
14 extern struct pci_ops titan_pci_ops;
15
16 static struct resource py_mem_resource = {
17         "Titan PCI MEM", 0xe0000000UL, 0xe3ffffffUL, IORESOURCE_MEM
18 };
19
20 /*
21  * PMON really reserves 16MB of I/O port space but that's stupid, nothing
22  * needs that much since allocations are limited to 256 bytes per device
23  * anyway.  So we just claim 64kB here.
24  */
25 #define TITAN_IO_SIZE   0x0000ffffUL
26
27 static struct resource py_io_resource = {
28         "Titan IO MEM", 0x00001000UL, TITAN_IO_SIZE - 1, IORESOURCE_IO,
29 };
30
31 static struct pci_controller py_controller = {
32         .pci_ops        = &titan_pci_ops,
33         .mem_resource   = &py_mem_resource,
34         .mem_offset     = 0x00000000UL,
35         .io_resource    = &py_io_resource,
36         .io_offset      = 0x00000000UL
37 };
38
39 static char ioremap_failed[] __initdata = "Could not ioremap I/O port range";
40
41 static int __init pmc_yosemite_setup(void)
42 {
43         unsigned long io_v_base;
44
45         io_v_base = (unsigned long) ioremap(0xe0000000UL,TITAN_IO_SIZE);
46         if (!io_v_base)
47                 panic(ioremap_failed);
48
49         set_io_port_base(io_v_base);
50
51         ioport_resource.end = TITAN_IO_SIZE - 1;
52
53         register_pci_controller(&py_controller);
54
55         return 0;
56 }
57
58 arch_initcall(pmc_yosemite_setup);