2 * Setup pointers to hardware-dependent routines.
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
8 * Copyright (C) 1996, 1997, 1998, 2001, 07 by Ralf Baechle
9 * Copyright (C) 2001 MIPS Technologies, Inc.
10 * Copyright (C) 2007 by Thomas Bogendoerfer
12 #include <linux/eisa.h>
13 #include <linux/init.h>
14 #include <linux/ioport.h>
15 #include <linux/sched.h>
16 #include <linux/interrupt.h>
18 #include <linux/console.h>
21 #include <linux/screen_info.h>
22 #include <linux/platform_device.h>
23 #include <linux/serial_8250.h>
25 #include <asm/bootinfo.h>
28 #include <asm/jazzdma.h>
29 #include <asm/reboot.h>
31 #include <asm/pgtable.h>
33 #include <asm/traps.h>
34 #include <asm/mc146818-time.h>
36 extern asmlinkage void jazz_handle_int(void);
38 extern void jazz_machine_restart(char *command);
40 static struct resource jazz_io_resources[] = {
45 .flags = IORESOURCE_BUSY
50 .flags = IORESOURCE_BUSY
54 .name = "dma page reg",
55 .flags = IORESOURCE_BUSY
60 .flags = IORESOURCE_BUSY
64 void __init plat_mem_setup(void)
68 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
69 add_wired_entry(0x02000017, 0x03c00017, 0xe0000000, PM_64K);
70 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
71 add_wired_entry(0x02400017, 0x02440017, 0xe2000000, PM_16M);
72 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
73 add_wired_entry(0x01800017, 0x01000017, 0xe4000000, PM_4M);
75 set_io_port_base(JAZZ_PORT_BASE);
80 /* request I/O space for devices used on all i[345]86 PCs */
81 for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++)
82 request_resource(&ioport_resource, jazz_io_resources + i);
84 /* The RTC is outside the port address space */
86 _machine_restart = jazz_machine_restart;
89 screen_info = (struct screen_info) {
90 0, 0, /* orig-x, orig-y */
92 0, /* orig_video_page */
93 0, /* orig_video_mode */
94 160, /* orig_video_cols */
95 0, 0, 0, /* unused, ega_bx, unused */
96 64, /* orig_video_lines */
97 0, /* orig_video_isVGA */
98 16 /* orig_video_points */
102 add_preferred_console("ttyS", 0, "9600");
105 #ifdef CONFIG_OLIVETTI_M700
106 #define UART_CLK 1843200
108 /* Some Jazz machines seem to have an 8MHz crystal clock but I don't know
109 exactly which ones ... XXX */
110 #define UART_CLK (8000000 / 16) /* ( 3072000 / 16) */
113 #define MEMPORT(_base, _irq) \
115 .mapbase = (_base), \
116 .membase = (void *)(_base), \
118 .uartclk = UART_CLK, \
119 .iotype = UPIO_MEM, \
120 .flags = UPF_BOOT_AUTOCONF, \
123 static struct plat_serial8250_port jazz_serial_data[] = {
124 MEMPORT(JAZZ_SERIAL1_BASE, JAZZ_SERIAL1_IRQ),
125 MEMPORT(JAZZ_SERIAL2_BASE, JAZZ_SERIAL2_IRQ),
129 static struct platform_device jazz_serial8250_device = {
130 .name = "serial8250",
131 .id = PLAT8250_DEV_PLATFORM,
133 .platform_data = jazz_serial_data,
137 static struct resource jazz_esp_rsrc[] = {
139 .start = JAZZ_SCSI_BASE,
140 .end = JAZZ_SCSI_BASE + 31,
141 .flags = IORESOURCE_MEM
144 .start = JAZZ_SCSI_DMA,
145 .end = JAZZ_SCSI_DMA,
146 .flags = IORESOURCE_MEM
149 .start = JAZZ_SCSI_IRQ,
150 .end = JAZZ_SCSI_IRQ,
151 .flags = IORESOURCE_IRQ
155 static struct platform_device jazz_esp_pdev = {
157 .num_resources = ARRAY_SIZE(jazz_esp_rsrc),
158 .resource = jazz_esp_rsrc
161 static struct resource jazz_sonic_rsrc[] = {
163 .start = JAZZ_ETHERNET_BASE,
164 .end = JAZZ_ETHERNET_BASE + 0xff,
165 .flags = IORESOURCE_MEM
168 .start = JAZZ_ETHERNET_IRQ,
169 .end = JAZZ_ETHERNET_IRQ,
170 .flags = IORESOURCE_IRQ
174 static struct platform_device jazz_sonic_pdev = {
176 .num_resources = ARRAY_SIZE(jazz_sonic_rsrc),
177 .resource = jazz_sonic_rsrc
180 static struct resource jazz_cmos_rsrc[] = {
184 .flags = IORESOURCE_IO
189 .flags = IORESOURCE_IRQ
193 static struct platform_device jazz_cmos_pdev = {
195 .num_resources = ARRAY_SIZE(jazz_cmos_rsrc),
196 .resource = jazz_cmos_rsrc
199 static struct platform_device pcspeaker_pdev = {
204 static int __init jazz_setup_devinit(void)
206 platform_device_register(&jazz_serial8250_device);
207 platform_device_register(&jazz_esp_pdev);
208 platform_device_register(&jazz_sonic_pdev);
209 platform_device_register(&jazz_cmos_pdev);
210 platform_device_register(&pcspeaker_pdev);
215 device_initcall(jazz_setup_devinit);