1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun * Register PCI controller.
3*4882a593Smuzhiyun *
4*4882a593Smuzhiyun * This file is subject to the terms and conditions of the GNU General Public
5*4882a593Smuzhiyun * License. See the file "COPYING" in the main directory of this archive
6*4882a593Smuzhiyun * for more details.
7*4882a593Smuzhiyun *
8*4882a593Smuzhiyun * Copyright (C) 1996, 1997, 2004, 05 by Ralf Baechle (ralf@linux-mips.org)
9*4882a593Smuzhiyun * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv)
10*4882a593Smuzhiyun *
11*4882a593Smuzhiyun */
12*4882a593Smuzhiyun #include <linux/init.h>
13*4882a593Smuzhiyun #include <linux/pci.h>
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun #include <asm/gt64120.h>
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun extern struct pci_ops gt64xxx_pci0_ops;
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun static struct resource cobalt_mem_resource = {
20*4882a593Smuzhiyun .start = GT_DEF_PCI0_MEM0_BASE,
21*4882a593Smuzhiyun .end = GT_DEF_PCI0_MEM0_BASE + GT_DEF_PCI0_MEM0_SIZE - 1,
22*4882a593Smuzhiyun .name = "PCI memory",
23*4882a593Smuzhiyun .flags = IORESOURCE_MEM,
24*4882a593Smuzhiyun };
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun static struct resource cobalt_io_resource = {
27*4882a593Smuzhiyun .start = 0x1000,
28*4882a593Smuzhiyun .end = 0xffffffUL,
29*4882a593Smuzhiyun .name = "PCI I/O",
30*4882a593Smuzhiyun .flags = IORESOURCE_IO,
31*4882a593Smuzhiyun };
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun static struct pci_controller cobalt_pci_controller = {
34*4882a593Smuzhiyun .pci_ops = >64xxx_pci0_ops,
35*4882a593Smuzhiyun .mem_resource = &cobalt_mem_resource,
36*4882a593Smuzhiyun .io_resource = &cobalt_io_resource,
37*4882a593Smuzhiyun .io_offset = 0 - GT_DEF_PCI0_IO_BASE,
38*4882a593Smuzhiyun .io_map_base = CKSEG1ADDR(GT_DEF_PCI0_IO_BASE),
39*4882a593Smuzhiyun };
40*4882a593Smuzhiyun
cobalt_pci_init(void)41*4882a593Smuzhiyun static int __init cobalt_pci_init(void)
42*4882a593Smuzhiyun {
43*4882a593Smuzhiyun register_pci_controller(&cobalt_pci_controller);
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun return 0;
46*4882a593Smuzhiyun }
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun arch_initcall(cobalt_pci_init);
49