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