patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / mips / vr41xx / nec-eagle / setup.c
1 /*
2  * arch/mips/vr41xx/nec-eagle/setup.c
3  *
4  * Setup for the NEC Eagle/Hawk board.
5  *
6  * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
7  *
8  * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
9  * the terms of the GNU General Public License version 2. This program
10  * is licensed "as is" without any warranty of any kind, whether express
11  * or implied.
12  */
13 #include <linux/config.h>
14 #include <linux/ioport.h>
15
16 #include <asm/io.h>
17 #include <asm/pci_channel.h>
18 #include <asm/vr41xx/eagle.h>
19
20 #ifdef CONFIG_PCI
21
22 extern void vrc4173_preinit(void);
23
24 static struct resource vr41xx_pci_io_resource = {
25         "PCI I/O space",
26         VR41XX_PCI_IO_START,
27         VR41XX_PCI_IO_END,
28         IORESOURCE_IO
29 };
30
31 static struct resource vr41xx_pci_mem_resource = {
32         "PCI memory space",
33         VR41XX_PCI_MEM_START,
34         VR41XX_PCI_MEM_END,
35         IORESOURCE_MEM
36 };
37
38 extern struct pci_ops vr41xx_pci_ops;
39
40 struct pci_controller vr41xx_controller = {
41         .pci_ops        = &vr41xx_pci_ops,
42         .io_resource    = &vr41xx_pci_io_resource,
43         .mem_resource   = &vr41xx_pci_mem_resource,
44 };
45
46 struct vr41xx_pci_address_space vr41xx_pci_mem1 = {
47         VR41XX_PCI_MEM1_BASE,
48         VR41XX_PCI_MEM1_MASK,
49         IO_MEM1_RESOURCE_START
50 };
51
52 struct vr41xx_pci_address_space vr41xx_pci_mem2 = {
53         VR41XX_PCI_MEM2_BASE,
54         VR41XX_PCI_MEM2_MASK,
55         IO_MEM2_RESOURCE_START
56 };
57
58 struct vr41xx_pci_address_space vr41xx_pci_io = {
59         VR41XX_PCI_IO_BASE,
60         VR41XX_PCI_IO_MASK,
61         IO_PORT_RESOURCE_START
62 };
63
64 static struct vr41xx_pci_address_map pci_address_map = {
65         &vr41xx_pci_mem1,
66         &vr41xx_pci_mem2,
67         &vr41xx_pci_io
68 };
69 #endif
70
71 const char *get_system_type(void)
72 {
73         return "NEC SDB-VR4122/VR4131(Eagle/Hawk)";
74 }
75
76 static int nec_eagle_setup(void)
77 {
78         set_io_port_base(IO_PORT_BASE);
79         ioport_resource.start = IO_PORT_RESOURCE_START;
80         ioport_resource.end = IO_PORT_RESOURCE_END;
81
82 #ifdef CONFIG_SERIAL_8250
83         vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
84         vr41xx_siu_init();
85         vr41xx_dsiu_init();
86 #endif
87
88 #ifdef CONFIG_PCI
89         vr41xx_pciu_init(&pci_address_map);
90
91         vrc4173_preinit();
92 #endif
93
94         return 0;
95 }
96
97 early_initcall(nec_eagle_setup);