diff options
Diffstat (limited to 'arch/mips/jazz/setup.c')
-rw-r--r-- | arch/mips/jazz/setup.c | 115 |
1 files changed, 112 insertions, 3 deletions
diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c index 798279e06691..5c6271ab927f 100644 --- a/arch/mips/jazz/setup.c +++ b/arch/mips/jazz/setup.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * | 7 | * |
8 | * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle | 8 | * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle |
9 | * Copyright (C) 2001 MIPS Technologies, Inc. | 9 | * Copyright (C) 2001 MIPS Technologies, Inc. |
10 | * Copyright (C) 2007 by Thomas Bogendoerfer | ||
10 | */ | 11 | */ |
11 | #include <linux/eisa.h> | 12 | #include <linux/eisa.h> |
12 | #include <linux/hdreg.h> | 13 | #include <linux/hdreg.h> |
@@ -20,6 +21,8 @@ | |||
20 | #include <linux/ide.h> | 21 | #include <linux/ide.h> |
21 | #include <linux/pm.h> | 22 | #include <linux/pm.h> |
22 | #include <linux/screen_info.h> | 23 | #include <linux/screen_info.h> |
24 | #include <linux/platform_device.h> | ||
25 | #include <linux/serial_8250.h> | ||
23 | 26 | ||
24 | #include <asm/bootinfo.h> | 27 | #include <asm/bootinfo.h> |
25 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
@@ -30,6 +33,7 @@ | |||
30 | #include <asm/pgtable.h> | 33 | #include <asm/pgtable.h> |
31 | #include <asm/time.h> | 34 | #include <asm/time.h> |
32 | #include <asm/traps.h> | 35 | #include <asm/traps.h> |
36 | #include <asm/mc146818-time.h> | ||
33 | 37 | ||
34 | extern asmlinkage void jazz_handle_int(void); | 38 | extern asmlinkage void jazz_handle_int(void); |
35 | 39 | ||
@@ -72,10 +76,8 @@ void __init plat_mem_setup(void) | |||
72 | 76 | ||
73 | /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */ | 77 | /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */ |
74 | add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K); | 78 | add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K); |
75 | |||
76 | /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */ | 79 | /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */ |
77 | add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M); | 80 | add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M); |
78 | |||
79 | /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */ | 81 | /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */ |
80 | add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M); | 82 | add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M); |
81 | 83 | ||
@@ -94,6 +96,7 @@ void __init plat_mem_setup(void) | |||
94 | 96 | ||
95 | _machine_restart = jazz_machine_restart; | 97 | _machine_restart = jazz_machine_restart; |
96 | 98 | ||
99 | #ifdef CONFIG_VT | ||
97 | screen_info = (struct screen_info) { | 100 | screen_info = (struct screen_info) { |
98 | 0, 0, /* orig-x, orig-y */ | 101 | 0, 0, /* orig-x, orig-y */ |
99 | 0, /* unused */ | 102 | 0, /* unused */ |
@@ -105,6 +108,112 @@ void __init plat_mem_setup(void) | |||
105 | 0, /* orig_video_isVGA */ | 108 | 0, /* orig_video_isVGA */ |
106 | 16 /* orig_video_points */ | 109 | 16 /* orig_video_points */ |
107 | }; | 110 | }; |
111 | #endif | ||
108 | 112 | ||
109 | vdma_init(); | 113 | add_preferred_console("ttyS", 0, "9600"); |
110 | } | 114 | } |
115 | |||
116 | #ifdef CONFIG_OLIVETTI_M700 | ||
117 | #define UART_CLK 1843200 | ||
118 | #else | ||
119 | /* Some Jazz machines seem to have an 8MHz crystal clock but I don't know | ||
120 | exactly which ones ... XXX */ | ||
121 | #define UART_CLK (8000000 / 16) /* ( 3072000 / 16) */ | ||
122 | #endif | ||
123 | |||
124 | #define MEMPORT(_base, _irq) \ | ||
125 | { \ | ||
126 | .mapbase = (_base), \ | ||
127 | .membase = (void *)(_base), \ | ||
128 | .irq = (_irq), \ | ||
129 | .uartclk = UART_CLK, \ | ||
130 | .iotype = UPIO_MEM, \ | ||
131 | .flags = UPF_BOOT_AUTOCONF, \ | ||
132 | } | ||
133 | |||
134 | static struct plat_serial8250_port jazz_serial_data[] = { | ||
135 | MEMPORT(JAZZ_SERIAL1_BASE, JAZZ_SERIAL1_IRQ), | ||
136 | MEMPORT(JAZZ_SERIAL2_BASE, JAZZ_SERIAL2_IRQ), | ||
137 | { }, | ||
138 | }; | ||
139 | |||
140 | static struct platform_device jazz_serial8250_device = { | ||
141 | .name = "serial8250", | ||
142 | .id = PLAT8250_DEV_PLATFORM, | ||
143 | .dev = { | ||
144 | .platform_data = jazz_serial_data, | ||
145 | }, | ||
146 | }; | ||
147 | |||
148 | static struct resource jazz_esp_rsrc[] = { | ||
149 | { | ||
150 | .start = JAZZ_SCSI_BASE, | ||
151 | .end = JAZZ_SCSI_BASE + 31, | ||
152 | .flags = IORESOURCE_MEM | ||
153 | }, | ||
154 | { | ||
155 | .start = JAZZ_SCSI_DMA, | ||
156 | .end = JAZZ_SCSI_DMA, | ||
157 | .flags = IORESOURCE_MEM | ||
158 | }, | ||
159 | { | ||
160 | .start = JAZZ_SCSI_IRQ, | ||
161 | .end = JAZZ_SCSI_IRQ, | ||
162 | .flags = IORESOURCE_IRQ | ||
163 | } | ||
164 | }; | ||
165 | |||
166 | static struct platform_device jazz_esp_pdev = { | ||
167 | .name = "jazz_esp", | ||
168 | .num_resources = ARRAY_SIZE(jazz_esp_rsrc), | ||
169 | .resource = jazz_esp_rsrc | ||
170 | }; | ||
171 | |||
172 | static struct resource jazz_sonic_rsrc[] = { | ||
173 | { | ||
174 | .start = JAZZ_ETHERNET_BASE, | ||
175 | .end = JAZZ_ETHERNET_BASE + 0xff, | ||
176 | .flags = IORESOURCE_MEM | ||
177 | }, | ||
178 | { | ||
179 | .start = JAZZ_ETHERNET_IRQ, | ||
180 | .end = JAZZ_ETHERNET_IRQ, | ||
181 | .flags = IORESOURCE_IRQ | ||
182 | } | ||
183 | }; | ||
184 | |||
185 | static struct platform_device jazz_sonic_pdev = { | ||
186 | .name = "jazzsonic", | ||
187 | .num_resources = ARRAY_SIZE(jazz_sonic_rsrc), | ||
188 | .resource = jazz_sonic_rsrc | ||
189 | }; | ||
190 | |||
191 | static struct resource jazz_cmos_rsrc[] = { | ||
192 | { | ||
193 | .start = 0x70, | ||
194 | .end = 0x71, | ||
195 | .flags = IORESOURCE_IO | ||
196 | }, | ||
197 | { | ||
198 | .start = 8, | ||
199 | .end = 8, | ||
200 | .flags = IORESOURCE_IRQ | ||
201 | } | ||
202 | }; | ||
203 | |||
204 | static struct platform_device jazz_cmos_pdev = { | ||
205 | .name = "rtc_cmos", | ||
206 | .num_resources = ARRAY_SIZE(jazz_cmos_rsrc), | ||
207 | .resource = jazz_cmos_rsrc | ||
208 | }; | ||
209 | |||
210 | static int __init jazz_setup_devinit(void) | ||
211 | { | ||
212 | platform_device_register(&jazz_serial8250_device); | ||
213 | platform_device_register(&jazz_esp_pdev); | ||
214 | platform_device_register(&jazz_sonic_pdev); | ||
215 | platform_device_register(&jazz_cmos_pdev); | ||
216 | return 0; | ||
217 | } | ||
218 | |||
219 | device_initcall(jazz_setup_devinit); | ||