RT-AC56 3.0.0.4.374.37 core
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / mips / jazz / setup.c
blobff05303b6da3ed3ce7ff05f25c73c3bb8e852023
1 /*
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
6 * for more details.
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>
20 #include <asm/jazz.h>
21 #include <asm/jazzdma.h>
22 #include <asm/reboot.h>
23 #include <asm/pgtable.h>
25 extern asmlinkage void jazz_handle_int(void);
27 extern void jazz_machine_restart(char *command);
29 static struct resource jazz_io_resources[] = {
31 .start = 0x00,
32 .end = 0x1f,
33 .name = "dma1",
34 .flags = IORESOURCE_BUSY
35 }, {
36 .start = 0x40,
37 .end = 0x5f,
38 .name = "timer",
39 .flags = IORESOURCE_BUSY
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
53 void __init plat_mem_setup(void)
55 int i;
57 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
58 add_wired_entry(0x02000017, 0x03c00017, 0xe0000000, PM_64K);
59 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
60 add_wired_entry(0x02400017, 0x02440017, 0xe2000000, PM_16M);
61 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
62 add_wired_entry(0x01800017, 0x01000017, 0xe4000000, PM_4M);
64 set_io_port_base(JAZZ_PORT_BASE);
65 #ifdef CONFIG_EISA
66 EISA_bus = 1;
67 #endif
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);
73 /* The RTC is outside the port address space */
75 _machine_restart = jazz_machine_restart;
77 #ifdef CONFIG_VT
78 screen_info = (struct screen_info) {
79 .orig_video_cols = 160,
80 .orig_video_lines = 64,
81 .orig_video_points = 16,
83 #endif
85 add_preferred_console("ttyS", 0, "9600");
88 #ifdef CONFIG_OLIVETTI_M700
89 #define UART_CLK 1843200
90 #else
91 #define UART_CLK (8000000 / 16) /* ( 3072000 / 16) */
92 #endif
94 #define MEMPORT(_base, _irq) \
95 { \
96 .mapbase = (_base), \
97 .membase = (void *)(_base), \
98 .irq = (_irq), \
99 .uartclk = UART_CLK, \
100 .iotype = UPIO_MEM, \
101 .flags = UPF_BOOT_AUTOCONF, \
104 static struct plat_serial8250_port jazz_serial_data[] = {
105 MEMPORT(JAZZ_SERIAL1_BASE, JAZZ_SERIAL1_IRQ),
106 MEMPORT(JAZZ_SERIAL2_BASE, JAZZ_SERIAL2_IRQ),
107 { },
110 static struct platform_device jazz_serial8250_device = {
111 .name = "serial8250",
112 .id = PLAT8250_DEV_PLATFORM,
113 .dev = {
114 .platform_data = jazz_serial_data,
118 static struct resource jazz_esp_rsrc[] = {
120 .start = JAZZ_SCSI_BASE,
121 .end = JAZZ_SCSI_BASE + 31,
122 .flags = IORESOURCE_MEM
125 .start = JAZZ_SCSI_DMA,
126 .end = JAZZ_SCSI_DMA,
127 .flags = IORESOURCE_MEM
130 .start = JAZZ_SCSI_IRQ,
131 .end = JAZZ_SCSI_IRQ,
132 .flags = IORESOURCE_IRQ
136 static struct platform_device jazz_esp_pdev = {
137 .name = "jazz_esp",
138 .num_resources = ARRAY_SIZE(jazz_esp_rsrc),
139 .resource = jazz_esp_rsrc
142 static struct resource jazz_sonic_rsrc[] = {
144 .start = JAZZ_ETHERNET_BASE,
145 .end = JAZZ_ETHERNET_BASE + 0xff,
146 .flags = IORESOURCE_MEM
149 .start = JAZZ_ETHERNET_IRQ,
150 .end = JAZZ_ETHERNET_IRQ,
151 .flags = IORESOURCE_IRQ
155 static struct platform_device jazz_sonic_pdev = {
156 .name = "jazzsonic",
157 .num_resources = ARRAY_SIZE(jazz_sonic_rsrc),
158 .resource = jazz_sonic_rsrc
161 static struct resource jazz_cmos_rsrc[] = {
163 .start = 0x70,
164 .end = 0x71,
165 .flags = IORESOURCE_IO
168 .start = 8,
169 .end = 8,
170 .flags = IORESOURCE_IRQ
174 static struct platform_device jazz_cmos_pdev = {
175 .name = "rtc_cmos",
176 .num_resources = ARRAY_SIZE(jazz_cmos_rsrc),
177 .resource = jazz_cmos_rsrc
180 static struct platform_device pcspeaker_pdev = {
181 .name = "pcspkr",
182 .id = -1,
185 static int __init jazz_setup_devinit(void)
187 platform_device_register(&jazz_serial8250_device);
188 platform_device_register(&jazz_esp_pdev);
189 platform_device_register(&jazz_sonic_pdev);
190 platform_device_register(&jazz_cmos_pdev);
191 platform_device_register(&pcspeaker_pdev);
193 return 0;
196 device_initcall(jazz_setup_devinit);