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, 08 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/console.h>
16 #include <linux/screen_info.h>
17 #include <linux/platform_device.h>
18 #include <linux/serial_8250.h>
21 #include <asm/jazzdma.h>
22 #include <asm/reboot.h>
23 #include <asm/pgtable.h>
24 #include <asm/tlbmisc.h>
26 extern asmlinkage
void jazz_handle_int(void);
28 extern void jazz_machine_restart(char *command
);
30 static struct resource jazz_io_resources
[] = {
35 .flags
= IORESOURCE_BUSY
40 .flags
= IORESOURCE_BUSY
44 .name
= "dma page reg",
45 .flags
= IORESOURCE_BUSY
50 .flags
= IORESOURCE_BUSY
54 void __init
plat_mem_setup(void)
58 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
59 add_wired_entry(0x02000017, 0x03c00017, 0xe0000000, PM_64K
);
60 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
61 add_wired_entry(0x02400017, 0x02440017, 0xe2000000, PM_16M
);
62 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
63 add_wired_entry(0x01800017, 0x01000017, 0xe4000000, PM_4M
);
65 set_io_port_base(JAZZ_PORT_BASE
);
70 /* request I/O space for devices used on all i[345]86 PCs */
71 for (i
= 0; i
< ARRAY_SIZE(jazz_io_resources
); i
++)
72 request_resource(&ioport_resource
, jazz_io_resources
+ i
);
74 /* The RTC is outside the port address space */
76 _machine_restart
= jazz_machine_restart
;
79 screen_info
= (struct screen_info
) {
80 .orig_video_cols
= 160,
81 .orig_video_lines
= 64,
82 .orig_video_points
= 16,
86 add_preferred_console("ttyS", 0, "9600");
89 #ifdef CONFIG_OLIVETTI_M700
90 #define UART_CLK 1843200
92 /* Some Jazz machines seem to have an 8MHz crystal clock but I don't know
93 exactly which ones ... XXX */
94 #define UART_CLK (8000000 / 16) /* ( 3072000 / 16) */
97 #define MEMPORT(_base, _irq) \
100 .membase = (void *)(_base), \
102 .uartclk = UART_CLK, \
103 .iotype = UPIO_MEM, \
104 .flags = UPF_BOOT_AUTOCONF, \
107 static struct plat_serial8250_port jazz_serial_data
[] = {
108 MEMPORT(JAZZ_SERIAL1_BASE
, JAZZ_SERIAL1_IRQ
),
109 MEMPORT(JAZZ_SERIAL2_BASE
, JAZZ_SERIAL2_IRQ
),
113 static struct platform_device jazz_serial8250_device
= {
114 .name
= "serial8250",
115 .id
= PLAT8250_DEV_PLATFORM
,
117 .platform_data
= jazz_serial_data
,
121 static struct resource jazz_esp_rsrc
[] = {
123 .start
= JAZZ_SCSI_BASE
,
124 .end
= JAZZ_SCSI_BASE
+ 31,
125 .flags
= IORESOURCE_MEM
128 .start
= JAZZ_SCSI_DMA
,
129 .end
= JAZZ_SCSI_DMA
,
130 .flags
= IORESOURCE_MEM
133 .start
= JAZZ_SCSI_IRQ
,
134 .end
= JAZZ_SCSI_IRQ
,
135 .flags
= IORESOURCE_IRQ
139 static struct platform_device jazz_esp_pdev
= {
141 .num_resources
= ARRAY_SIZE(jazz_esp_rsrc
),
142 .resource
= jazz_esp_rsrc
145 static struct resource jazz_sonic_rsrc
[] = {
147 .start
= JAZZ_ETHERNET_BASE
,
148 .end
= JAZZ_ETHERNET_BASE
+ 0xff,
149 .flags
= IORESOURCE_MEM
152 .start
= JAZZ_ETHERNET_IRQ
,
153 .end
= JAZZ_ETHERNET_IRQ
,
154 .flags
= IORESOURCE_IRQ
158 static struct platform_device jazz_sonic_pdev
= {
160 .num_resources
= ARRAY_SIZE(jazz_sonic_rsrc
),
161 .resource
= jazz_sonic_rsrc
164 static struct resource jazz_cmos_rsrc
[] = {
168 .flags
= IORESOURCE_IO
173 .flags
= IORESOURCE_IRQ
177 static struct platform_device jazz_cmos_pdev
= {
179 .num_resources
= ARRAY_SIZE(jazz_cmos_rsrc
),
180 .resource
= jazz_cmos_rsrc
183 static struct platform_device pcspeaker_pdev
= {
188 static int __init
jazz_setup_devinit(void)
190 platform_device_register(&jazz_serial8250_device
);
191 platform_device_register(&jazz_esp_pdev
);
192 platform_device_register(&jazz_sonic_pdev
);
193 platform_device_register(&jazz_cmos_pdev
);
194 platform_device_register(&pcspeaker_pdev
);
199 device_initcall(jazz_setup_devinit
);