patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / mips / vr41xx / zao-capcella / setup.c
1 /*
2  *  setup.c, Setup for the ZAO Networks Capcella.
3  *
4  *  Copyright (C) 2002-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20 #include <linux/config.h>
21 #include <linux/ioport.h>
22
23 #include <asm/io.h>
24 #include <asm/pci_channel.h>
25 #include <asm/vr41xx/capcella.h>
26
27 #ifdef CONFIG_PCI
28 static struct resource vr41xx_pci_io_resource = {
29         "PCI I/O space",
30         VR41XX_PCI_IO_START,
31         VR41XX_PCI_IO_END,
32         IORESOURCE_IO
33 };
34
35 static struct resource vr41xx_pci_mem_resource = {
36         "PCI memory space",
37         VR41XX_PCI_MEM_START,
38         VR41XX_PCI_MEM_END,
39         IORESOURCE_MEM
40 };
41
42 extern struct pci_ops vr41xx_pci_ops;
43
44 struct pci_controller vr41xx_controller = {
45         .pci_ops        = &vr41xx_pci_ops,
46         .io_resource    = &vr41xx_pci_io_resource,
47         .mem_resource   = &vr41xx_pci_mem_resource,
48 };
49
50 struct vr41xx_pci_address_space vr41xx_pci_mem1 = {
51         VR41XX_PCI_MEM1_BASE,
52         VR41XX_PCI_MEM1_MASK,
53         IO_MEM1_RESOURCE_START
54 };
55
56 struct vr41xx_pci_address_space vr41xx_pci_mem2 = {
57         VR41XX_PCI_MEM2_BASE,
58         VR41XX_PCI_MEM2_MASK,
59         IO_MEM2_RESOURCE_START
60 };
61
62 struct vr41xx_pci_address_space vr41xx_pci_io = {
63         VR41XX_PCI_IO_BASE,
64         VR41XX_PCI_IO_MASK,
65         IO_PORT_RESOURCE_START
66 };
67
68 static struct vr41xx_pci_address_map pci_address_map = {
69         &vr41xx_pci_mem1,
70         &vr41xx_pci_mem2,
71         &vr41xx_pci_io
72 };
73 #endif
74
75 const char *get_system_type(void)
76 {
77         return "ZAO Networks Capcella";
78 }
79
80 static int zao_capcella_setup(void)
81 {
82         set_io_port_base(IO_PORT_BASE);
83         ioport_resource.start = IO_PORT_RESOURCE_START;
84         ioport_resource.end = IO_PORT_RESOURCE_END;
85
86 #ifdef CONFIG_SERIAL_8250
87         vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
88         vr41xx_siu_init();
89         vr41xx_dsiu_init();
90 #endif
91
92 #ifdef CONFIG_PCI
93         vr41xx_pciu_init(&pci_address_map);
94 #endif
95
96         return 0;
97 }
98
99 early_initcall(zao_capcella_setup);