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>
19 #include <linux/dma-mapping.h>
20 #include <linux/pgtable.h>
23 #include <asm/jazzdma.h>
24 #include <asm/reboot.h>
25 #include <asm/tlbmisc.h>
27 extern asmlinkage
void jazz_handle_int(void);
29 extern void jazz_machine_restart(char *command
);
31 static struct resource jazz_io_resources
[] = {
36 .flags
= IORESOURCE_IO
| IORESOURCE_BUSY
41 .flags
= IORESOURCE_IO
| IORESOURCE_BUSY
45 .name
= "dma page reg",
46 .flags
= IORESOURCE_IO
| IORESOURCE_BUSY
51 .flags
= IORESOURCE_IO
| IORESOURCE_BUSY
55 void __init
plat_mem_setup(void)
59 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
60 add_wired_entry(0x02000017, 0x03c00017, 0xe0000000, PM_64K
);
61 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
62 add_wired_entry(0x02400017, 0x02440017, 0xe2000000, PM_16M
);
63 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
64 add_wired_entry(0x01800017, 0x01000017, 0xe4000000, PM_4M
);
66 set_io_port_base(JAZZ_PORT_BASE
);
71 /* request I/O space for devices used on all i[345]86 PCs */
72 for (i
= 0; i
< ARRAY_SIZE(jazz_io_resources
); i
++)
73 request_resource(&ioport_resource
, jazz_io_resources
+ i
);
75 /* The RTC is outside the port address space */
77 _machine_restart
= jazz_machine_restart
;
80 screen_info
= (struct screen_info
) {
81 .orig_video_cols
= 160,
82 .orig_video_lines
= 64,
83 .orig_video_points
= 16,
87 add_preferred_console("ttyS", 0, "9600");
90 #ifdef CONFIG_OLIVETTI_M700
91 #define UART_CLK 1843200
93 /* Some Jazz machines seem to have an 8MHz crystal clock but I don't know
94 exactly which ones ... XXX */
95 #define UART_CLK (8000000 / 16) /* ( 3072000 / 16) */
98 #define MEMPORT(_base, _irq) \
100 .mapbase = (_base), \
101 .membase = (void *)(_base), \
103 .uartclk = UART_CLK, \
104 .iotype = UPIO_MEM, \
105 .flags = UPF_BOOT_AUTOCONF, \
108 static struct plat_serial8250_port jazz_serial_data
[] = {
109 MEMPORT(JAZZ_SERIAL1_BASE
, JAZZ_SERIAL1_IRQ
),
110 MEMPORT(JAZZ_SERIAL2_BASE
, JAZZ_SERIAL2_IRQ
),
114 static struct platform_device jazz_serial8250_device
= {
115 .name
= "serial8250",
116 .id
= PLAT8250_DEV_PLATFORM
,
118 .platform_data
= jazz_serial_data
,
122 static struct resource jazz_esp_rsrc
[] = {
124 .start
= JAZZ_SCSI_BASE
,
125 .end
= JAZZ_SCSI_BASE
+ 31,
126 .flags
= IORESOURCE_MEM
129 .start
= JAZZ_SCSI_DMA
,
130 .end
= JAZZ_SCSI_DMA
,
131 .flags
= IORESOURCE_MEM
134 .start
= JAZZ_SCSI_IRQ
,
135 .end
= JAZZ_SCSI_IRQ
,
136 .flags
= IORESOURCE_IRQ
140 static u64 jazz_esp_dma_mask
= DMA_BIT_MASK(32);
142 static struct platform_device jazz_esp_pdev
= {
144 .num_resources
= ARRAY_SIZE(jazz_esp_rsrc
),
145 .resource
= jazz_esp_rsrc
,
147 .dma_mask
= &jazz_esp_dma_mask
,
148 .coherent_dma_mask
= DMA_BIT_MASK(32),
152 static struct resource jazz_sonic_rsrc
[] = {
154 .start
= JAZZ_ETHERNET_BASE
,
155 .end
= JAZZ_ETHERNET_BASE
+ 0xff,
156 .flags
= IORESOURCE_MEM
159 .start
= JAZZ_ETHERNET_IRQ
,
160 .end
= JAZZ_ETHERNET_IRQ
,
161 .flags
= IORESOURCE_IRQ
165 static u64 jazz_sonic_dma_mask
= DMA_BIT_MASK(32);
167 static struct platform_device jazz_sonic_pdev
= {
169 .num_resources
= ARRAY_SIZE(jazz_sonic_rsrc
),
170 .resource
= jazz_sonic_rsrc
,
172 .dma_mask
= &jazz_sonic_dma_mask
,
173 .coherent_dma_mask
= DMA_BIT_MASK(32),
177 static struct resource jazz_cmos_rsrc
[] = {
181 .flags
= IORESOURCE_IO
186 .flags
= IORESOURCE_IRQ
190 static struct platform_device jazz_cmos_pdev
= {
192 .num_resources
= ARRAY_SIZE(jazz_cmos_rsrc
),
193 .resource
= jazz_cmos_rsrc
196 static struct platform_device pcspeaker_pdev
= {
201 static int __init
jazz_setup_devinit(void)
203 platform_device_register(&jazz_serial8250_device
);
204 platform_device_register(&jazz_esp_pdev
);
205 platform_device_register(&jazz_sonic_pdev
);
206 platform_device_register(&jazz_cmos_pdev
);
207 platform_device_register(&pcspeaker_pdev
);
212 device_initcall(jazz_setup_devinit
);