RT-AC66 3.0.0.4.374.130 core
[tomato.git] / release / src-rt-6.x / linux / linux-2.6 / arch / mips / gt64120 / wrppmc / pci.c
blob0d5289bc1804c13b4979d48fbf00e7b40943b1bf
1 /*
2 * pci.c: GT64120 PCI support.
4 * Copyright (C) 2006, Wind River System Inc. Rongkai.Zhan <rongkai.zhan@windriver.com>
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10 #include <linux/init.h>
11 #include <linux/types.h>
12 #include <linux/pci.h>
13 #include <linux/kernel.h>
14 #include <asm/gt64120.h>
16 extern struct pci_ops gt64xxx_pci0_ops;
18 static struct resource pci0_io_resource = {
19 .name = "pci_0 io",
20 .start = GT_PCI_IO_BASE,
21 .end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1,
22 .flags = IORESOURCE_IO,
25 static struct resource pci0_mem_resource = {
26 .name = "pci_0 memory",
27 .start = GT_PCI_MEM_BASE,
28 .end = GT_PCI_MEM_BASE + GT_PCI_MEM_SIZE - 1,
29 .flags = IORESOURCE_MEM,
32 static struct pci_controller hose_0 = {
33 .pci_ops = &gt64xxx_pci0_ops,
34 .io_resource = &pci0_io_resource,
35 .mem_resource = &pci0_mem_resource,
38 static int __init gt64120_pci_init(void)
40 u32 tmp;
42 tmp = GT_READ(GT_PCI0_CMD_OFS); /* Huh??? -- Ralf */
43 tmp = GT_READ(GT_PCI0_BARE_OFS);
45 /* reset the whole PCI I/O space range */
46 ioport_resource.start = GT_PCI_IO_BASE;
47 ioport_resource.end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1;
49 register_pci_controller(&hose_0);
50 return 0;
53 arch_initcall(gt64120_pci_init);