aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/pci/pci-yosemite.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/mips/pci/pci-yosemite.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/mips/pci/pci-yosemite.c')
-rw-r--r--arch/mips/pci/pci-yosemite.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/arch/mips/pci/pci-yosemite.c b/arch/mips/pci/pci-yosemite.c
new file mode 100644
index 000000000000..dac9ed4b0ccf
--- /dev/null
+++ b/arch/mips/pci/pci-yosemite.c
@@ -0,0 +1,60 @@
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/titan_dep.h>
13
14extern struct pci_ops titan_pci_ops;
15
16static 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#define TITAN_IO_BASE 0xe8000000UL
27
28static struct resource py_io_resource = {
29 "Titan IO MEM", 0x00001000UL, TITAN_IO_SIZE - 1, IORESOURCE_IO,
30};
31
32static struct pci_controller py_controller = {
33 .pci_ops = &titan_pci_ops,
34 .mem_resource = &py_mem_resource,
35 .mem_offset = 0x00000000UL,
36 .io_resource = &py_io_resource,
37 .io_offset = 0x00000000UL
38};
39
40static char ioremap_failed[] __initdata = "Could not ioremap I/O port range";
41
42static int __init pmc_yosemite_setup(void)
43{
44 unsigned long io_v_base;
45
46 io_v_base = (unsigned long) ioremap(TITAN_IO_BASE, TITAN_IO_SIZE);
47 if (!io_v_base)
48 panic(ioremap_failed);
49
50 set_io_port_base(io_v_base);
51 TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1);
52
53 ioport_resource.end = TITAN_IO_SIZE - 1;
54
55 register_pci_controller(&py_controller);
56
57 return 0;
58}
59
60arch_initcall(pmc_yosemite_setup);