Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt...
[deliverable/linux.git] / arch / mips / jazz / setup.c
CommitLineData
1da177e4
LT
1/*
2 * Setup pointers to hardware-dependent routines.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
89ef3e85 8 * Copyright (C) 1996, 1997, 1998, 2001, 07, 08 by Ralf Baechle
1da177e4 9 * Copyright (C) 2001 MIPS Technologies, Inc.
ea202c63 10 * Copyright (C) 2007 by Thomas Bogendoerfer
1da177e4 11 */
1da177e4 12#include <linux/eisa.h>
1da177e4
LT
13#include <linux/init.h>
14#include <linux/ioport.h>
1da177e4 15#include <linux/console.h>
06e80113 16#include <linux/screen_info.h>
ea202c63
TB
17#include <linux/platform_device.h>
18#include <linux/serial_8250.h>
fcdb27ad 19
1da177e4
LT
20#include <asm/jazz.h>
21#include <asm/jazzdma.h>
1da177e4 22#include <asm/reboot.h>
1da177e4 23#include <asm/pgtable.h>
1da177e4
LT
24
25extern asmlinkage void jazz_handle_int(void);
26
27extern void jazz_machine_restart(char *command);
1da177e4 28
1da177e4 29static struct resource jazz_io_resources[] = {
2cf69e76
RB
30 {
31 .start = 0x00,
32 .end = 0x1f,
33 .name = "dma1",
34 .flags = IORESOURCE_BUSY
35 }, {
36 .start = 0x40,
37 .end = 0x5f,
38 .name = "timer",
5da44ad5 39 .flags = IORESOURCE_BUSY
2cf69e76
RB
40 }, {
41 .start = 0x80,
42 .end = 0x8f,
43 .name = "dma page reg",
44 .flags = IORESOURCE_BUSY
45 }, {
46 .start = 0xc0,
47 .end = 0xdf,
48 .name = "dma2",
49 .flags = IORESOURCE_BUSY
50 }
1da177e4
LT
51};
52
2925aba4 53void __init plat_mem_setup(void)
1da177e4
LT
54{
55 int i;
56
57 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
49a89efb 58 add_wired_entry(0x02000017, 0x03c00017, 0xe0000000, PM_64K);
1da177e4 59 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
49a89efb 60 add_wired_entry(0x02400017, 0x02440017, 0xe2000000, PM_16M);
1da177e4 61 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
49a89efb 62 add_wired_entry(0x01800017, 0x01000017, 0xe4000000, PM_4M);
1da177e4
LT
63
64 set_io_port_base(JAZZ_PORT_BASE);
65#ifdef CONFIG_EISA
c6607295 66 EISA_bus = 1;
1da177e4 67#endif
1da177e4
LT
68
69 /* request I/O space for devices used on all i[345]86 PCs */
70 for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++)
71 request_resource(&ioport_resource, jazz_io_resources + i);
72
1da177e4
LT
73 /* The RTC is outside the port address space */
74
75 _machine_restart = jazz_machine_restart;
1da177e4 76
ea202c63 77#ifdef CONFIG_VT
1da177e4
LT
78 screen_info = (struct screen_info) {
79 0, 0, /* orig-x, orig-y */
80 0, /* unused */
81 0, /* orig_video_page */
82 0, /* orig_video_mode */
83 160, /* orig_video_cols */
84 0, 0, 0, /* unused, ega_bx, unused */
85 64, /* orig_video_lines */
86 0, /* orig_video_isVGA */
87 16 /* orig_video_points */
88 };
ea202c63 89#endif
1da177e4 90
ea202c63 91 add_preferred_console("ttyS", 0, "9600");
1da177e4 92}
ea202c63
TB
93
94#ifdef CONFIG_OLIVETTI_M700
95#define UART_CLK 1843200
96#else
97/* Some Jazz machines seem to have an 8MHz crystal clock but I don't know
98 exactly which ones ... XXX */
99#define UART_CLK (8000000 / 16) /* ( 3072000 / 16) */
100#endif
101
102#define MEMPORT(_base, _irq) \
103 { \
104 .mapbase = (_base), \
105 .membase = (void *)(_base), \
106 .irq = (_irq), \
107 .uartclk = UART_CLK, \
108 .iotype = UPIO_MEM, \
109 .flags = UPF_BOOT_AUTOCONF, \
110 }
111
112static struct plat_serial8250_port jazz_serial_data[] = {
113 MEMPORT(JAZZ_SERIAL1_BASE, JAZZ_SERIAL1_IRQ),
114 MEMPORT(JAZZ_SERIAL2_BASE, JAZZ_SERIAL2_IRQ),
115 { },
116};
117
118static struct platform_device jazz_serial8250_device = {
119 .name = "serial8250",
120 .id = PLAT8250_DEV_PLATFORM,
121 .dev = {
122 .platform_data = jazz_serial_data,
123 },
124};
125
126static struct resource jazz_esp_rsrc[] = {
127 {
128 .start = JAZZ_SCSI_BASE,
129 .end = JAZZ_SCSI_BASE + 31,
130 .flags = IORESOURCE_MEM
131 },
132 {
133 .start = JAZZ_SCSI_DMA,
134 .end = JAZZ_SCSI_DMA,
135 .flags = IORESOURCE_MEM
136 },
137 {
138 .start = JAZZ_SCSI_IRQ,
139 .end = JAZZ_SCSI_IRQ,
140 .flags = IORESOURCE_IRQ
141 }
142};
143
144static struct platform_device jazz_esp_pdev = {
145 .name = "jazz_esp",
146 .num_resources = ARRAY_SIZE(jazz_esp_rsrc),
147 .resource = jazz_esp_rsrc
148};
149
150static struct resource jazz_sonic_rsrc[] = {
151 {
152 .start = JAZZ_ETHERNET_BASE,
153 .end = JAZZ_ETHERNET_BASE + 0xff,
154 .flags = IORESOURCE_MEM
155 },
156 {
157 .start = JAZZ_ETHERNET_IRQ,
158 .end = JAZZ_ETHERNET_IRQ,
159 .flags = IORESOURCE_IRQ
160 }
161};
162
163static struct platform_device jazz_sonic_pdev = {
164 .name = "jazzsonic",
165 .num_resources = ARRAY_SIZE(jazz_sonic_rsrc),
166 .resource = jazz_sonic_rsrc
167};
168
169static struct resource jazz_cmos_rsrc[] = {
170 {
171 .start = 0x70,
172 .end = 0x71,
173 .flags = IORESOURCE_IO
174 },
175 {
176 .start = 8,
177 .end = 8,
178 .flags = IORESOURCE_IRQ
179 }
180};
181
182static struct platform_device jazz_cmos_pdev = {
183 .name = "rtc_cmos",
184 .num_resources = ARRAY_SIZE(jazz_cmos_rsrc),
185 .resource = jazz_cmos_rsrc
186};
187
19388fb0
RB
188static struct platform_device pcspeaker_pdev = {
189 .name = "pcspkr",
190 .id = -1,
191};
192
ea202c63
TB
193static int __init jazz_setup_devinit(void)
194{
195 platform_device_register(&jazz_serial8250_device);
196 platform_device_register(&jazz_esp_pdev);
197 platform_device_register(&jazz_sonic_pdev);
198 platform_device_register(&jazz_cmos_pdev);
19388fb0
RB
199 platform_device_register(&pcspeaker_pdev);
200
ea202c63
TB
201 return 0;
202}
203
204device_initcall(jazz_setup_devinit);
This page took 0.43621 seconds and 5 git commands to generate.