added files
[bcm963xx.git] / kernel / linux / 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
7  *
8  */
9 #include <linux/init.h>
10 #include <linux/kernel.h>
11 #include <linux/types.h>
12 #include <linux/pci.h>
13 #include <asm/gt64240.h>
14 #include <asm/pci_channel.h>
15
16 extern struct pci_ops titan_pci_ops;
17
18 static struct resource py_mem_resource = {
19         "Titan PCI MEM", 0xe0000000UL, 0xe3ffffffUL, IORESOURCE_MEM
20 };
21
22 /*
23  * PMON really reserves 16MB of I/O port space but that's stupid, nothing
24  * needs that much since allocations are limited to 256 bytes per device
25  * anyway.  So we just claim 64kB here.
26  */
27 #define TITAN_IO_SIZE   0x0000ffffUL
28
29 static struct resource py_io_resource = {
30         "Titan IO MEM", 0x00001000UL, TITAN_IO_SIZE - 1, IORESOURCE_IO,
31 };
32
33 static struct pci_controller py_controller = {
34         .pci_ops        = &titan_pci_ops,
35         .mem_resource   = &py_mem_resource,
36         .mem_offset     = 0x00000000UL,
37         .io_resource    = &py_io_resource,
38         .io_offset      = 0x00000000UL
39 };
40
41 static char ioremap_failed[] __initdata = "Could not ioremap I/O port range";
42
43 static int __init pmc_yosemite_setup(void)
44 {
45         unsigned long io_v_base;
46
47         io_v_base = (unsigned long) ioremap(0xe0000000UL,TITAN_IO_SIZE);
48         if (!io_v_base)
49                 panic(ioremap_failed);
50
51         set_io_port_base(io_v_base);
52
53         ioport_resource.end = TITAN_IO_SIZE - 1;
54
55         register_pci_controller(&py_controller);
56
57         return 0;
58 }
59
60 arch_initcall(pmc_yosemite_setup);