blob: 35748531327dac74710c653017395b73348014fc [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/m68k/amiga/config.c
3 *
4 * Copyright (C) 1993 Hamish Macdonald
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11/*
12 * Miscellaneous Amiga stuff
13 */
14
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/mm.h>
18#include <linux/tty.h>
19#include <linux/console.h>
20#include <linux/rtc.h>
21#include <linux/init.h>
22#include <linux/vt_kern.h>
23#include <linux/delay.h>
24#include <linux/interrupt.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <linux/zorro.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
27#include <asm/bootinfo.h>
28#include <asm/setup.h>
29#include <asm/system.h>
30#include <asm/pgtable.h>
31#include <asm/amigahw.h>
32#include <asm/amigaints.h>
33#include <asm/irq.h>
34#include <asm/rtc.h>
35#include <asm/machdep.h>
36#include <asm/io.h>
37
38unsigned long amiga_model;
39unsigned long amiga_eclock;
40unsigned long amiga_masterclock;
41unsigned long amiga_colorclock;
42unsigned long amiga_chipset;
43unsigned char amiga_vblank;
44unsigned char amiga_psfreq;
45struct amiga_hw_present amiga_hw_present;
46
47static char s_a500[] __initdata = "A500";
48static char s_a500p[] __initdata = "A500+";
49static char s_a600[] __initdata = "A600";
50static char s_a1000[] __initdata = "A1000";
51static char s_a1200[] __initdata = "A1200";
52static char s_a2000[] __initdata = "A2000";
53static char s_a2500[] __initdata = "A2500";
54static char s_a3000[] __initdata = "A3000";
55static char s_a3000t[] __initdata = "A3000T";
56static char s_a3000p[] __initdata = "A3000+";
57static char s_a4000[] __initdata = "A4000";
58static char s_a4000t[] __initdata = "A4000T";
59static char s_cdtv[] __initdata = "CDTV";
60static char s_cd32[] __initdata = "CD32";
61static char s_draco[] __initdata = "Draco";
62static char *amiga_models[] __initdata = {
Roman Zippel6ff58012007-05-01 22:32:43 +020063 [AMI_500-AMI_500] = s_a500,
64 [AMI_500PLUS-AMI_500] = s_a500p,
65 [AMI_600-AMI_500] = s_a600,
66 [AMI_1000-AMI_500] = s_a1000,
67 [AMI_1200-AMI_500] = s_a1200,
68 [AMI_2000-AMI_500] = s_a2000,
69 [AMI_2500-AMI_500] = s_a2500,
70 [AMI_3000-AMI_500] = s_a3000,
71 [AMI_3000T-AMI_500] = s_a3000t,
72 [AMI_3000PLUS-AMI_500] = s_a3000p,
73 [AMI_4000-AMI_500] = s_a4000,
74 [AMI_4000T-AMI_500] = s_a4000t,
75 [AMI_CDTV-AMI_500] = s_cdtv,
76 [AMI_CD32-AMI_500] = s_cd32,
77 [AMI_DRACO-AMI_500] = s_draco,
Linus Torvalds1da177e2005-04-16 15:20:36 -070078};
79
80static char amiga_model_name[13] = "Amiga ";
81
David Howells40220c12006-10-09 12:19:47 +010082static void amiga_sched_init(irq_handler_t handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -070083/* amiga specific irq functions */
Roman Zippel6ff58012007-05-01 22:32:43 +020084extern void amiga_init_IRQ(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070085static void amiga_get_model(char *model);
86static int amiga_get_hardware_list(char *buffer);
Linus Torvalds1da177e2005-04-16 15:20:36 -070087/* amiga specific timer functions */
Roman Zippel6ff58012007-05-01 22:32:43 +020088static unsigned long amiga_gettimeoffset(void);
89static int a3000_hwclk(int, struct rtc_time *);
90static int a2000_hwclk(int, struct rtc_time *);
91static int amiga_set_clock_mmss(unsigned long);
92static unsigned int amiga_get_ss(void);
93extern void amiga_mksound(unsigned int count, unsigned int ticks);
94static void amiga_reset(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070095extern void amiga_init_sound(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070096static void amiga_mem_console_write(struct console *co, const char *b,
97 unsigned int count);
98void amiga_serial_console_write(struct console *co, const char *s,
99 unsigned int count);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100#ifdef CONFIG_HEARTBEAT
101static void amiga_heartbeat(int on);
102#endif
103
104static struct console amiga_console_driver = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200105 .name = "debug",
106 .flags = CON_PRINTBUFFER,
107 .index = -1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108};
109
110
111 /*
112 * Motherboard Resources present in all Amiga models
113 */
114
115static struct {
Roman Zippel6ff58012007-05-01 22:32:43 +0200116 struct resource _ciab, _ciaa, _custom, _kickstart;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117} mb_resources = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200118 ._ciab = {
119 .name = "CIA B", .start = 0x00bfd000, .end = 0x00bfdfff
120 },
121 ._ciaa = {
122 .name = "CIA A", .start = 0x00bfe000, .end = 0x00bfefff
123 },
124 ._custom = {
125 .name = "Custom I/O", .start = 0x00dff000, .end = 0x00dfffff
126 },
127 ._kickstart = {
128 .name = "Kickstart ROM", .start = 0x00f80000, .end = 0x00ffffff
129 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130};
131
132static struct resource rtc_resource = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200133 .start = 0x00dc0000, .end = 0x00dcffff
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134};
135
136static struct resource ram_resource[NUM_MEMINFO];
137
138
139 /*
140 * Parse an Amiga-specific record in the bootinfo
141 */
142
143int amiga_parse_bootinfo(const struct bi_record *record)
144{
Roman Zippel6ff58012007-05-01 22:32:43 +0200145 int unknown = 0;
146 const unsigned long *data = record->data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147
Roman Zippel6ff58012007-05-01 22:32:43 +0200148 switch (record->tag) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 case BI_AMIGA_MODEL:
Roman Zippel6ff58012007-05-01 22:32:43 +0200150 amiga_model = *data;
151 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152
153 case BI_AMIGA_ECLOCK:
Roman Zippel6ff58012007-05-01 22:32:43 +0200154 amiga_eclock = *data;
155 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156
157 case BI_AMIGA_CHIPSET:
Roman Zippel6ff58012007-05-01 22:32:43 +0200158 amiga_chipset = *data;
159 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160
161 case BI_AMIGA_CHIP_SIZE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200162 amiga_chip_size = *(const int *)data;
163 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
165 case BI_AMIGA_VBLANK:
Roman Zippel6ff58012007-05-01 22:32:43 +0200166 amiga_vblank = *(const unsigned char *)data;
167 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168
169 case BI_AMIGA_PSFREQ:
Roman Zippel6ff58012007-05-01 22:32:43 +0200170 amiga_psfreq = *(const unsigned char *)data;
171 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172
173 case BI_AMIGA_AUTOCON:
174#ifdef CONFIG_ZORRO
Roman Zippel6ff58012007-05-01 22:32:43 +0200175 if (zorro_num_autocon < ZORRO_NUM_AUTO) {
176 const struct ConfigDev *cd = (struct ConfigDev *)data;
177 struct zorro_dev *dev = &zorro_autocon[zorro_num_autocon++];
178 dev->rom = cd->cd_Rom;
179 dev->slotaddr = cd->cd_SlotAddr;
180 dev->slotsize = cd->cd_SlotSize;
181 dev->resource.start = (unsigned long)cd->cd_BoardAddr;
182 dev->resource.end = dev->resource.start + cd->cd_BoardSize - 1;
183 } else
184 printk("amiga_parse_bootinfo: too many AutoConfig devices\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185#endif /* CONFIG_ZORRO */
Roman Zippel6ff58012007-05-01 22:32:43 +0200186 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187
188 case BI_AMIGA_SERPER:
Roman Zippel6ff58012007-05-01 22:32:43 +0200189 /* serial port period: ignored here */
190 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191
192 default:
Roman Zippel6ff58012007-05-01 22:32:43 +0200193 unknown = 1;
194 }
195 return unknown;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196}
197
198 /*
199 * Identify builtin hardware
200 */
201
202static void __init amiga_identify(void)
203{
Roman Zippel6ff58012007-05-01 22:32:43 +0200204 /* Fill in some default values, if necessary */
205 if (amiga_eclock == 0)
206 amiga_eclock = 709379;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207
Roman Zippel6ff58012007-05-01 22:32:43 +0200208 memset(&amiga_hw_present, 0, sizeof(amiga_hw_present));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209
Roman Zippel6ff58012007-05-01 22:32:43 +0200210 printk("Amiga hardware found: ");
211 if (amiga_model >= AMI_500 && amiga_model <= AMI_DRACO) {
212 printk("[%s] ", amiga_models[amiga_model-AMI_500]);
213 strcat(amiga_model_name, amiga_models[amiga_model-AMI_500]);
214 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215
Roman Zippel6ff58012007-05-01 22:32:43 +0200216 switch (amiga_model) {
217 case AMI_UNKNOWN:
218 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219
Roman Zippel6ff58012007-05-01 22:32:43 +0200220 case AMI_600:
221 case AMI_1200:
222 AMIGAHW_SET(A1200_IDE);
223 AMIGAHW_SET(PCMCIA);
224 case AMI_500:
225 case AMI_500PLUS:
226 case AMI_1000:
227 case AMI_2000:
228 case AMI_2500:
229 AMIGAHW_SET(A2000_CLK); /* Is this correct for all models? */
230 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231
Roman Zippel6ff58012007-05-01 22:32:43 +0200232 case AMI_3000:
233 case AMI_3000T:
234 AMIGAHW_SET(AMBER_FF);
235 AMIGAHW_SET(MAGIC_REKICK);
236 /* fall through */
237 case AMI_3000PLUS:
238 AMIGAHW_SET(A3000_SCSI);
239 AMIGAHW_SET(A3000_CLK);
240 AMIGAHW_SET(ZORRO3);
241 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242
Roman Zippel6ff58012007-05-01 22:32:43 +0200243 case AMI_4000T:
244 AMIGAHW_SET(A4000_SCSI);
245 /* fall through */
246 case AMI_4000:
247 AMIGAHW_SET(A4000_IDE);
248 AMIGAHW_SET(A3000_CLK);
249 AMIGAHW_SET(ZORRO3);
250 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251
Roman Zippel6ff58012007-05-01 22:32:43 +0200252 case AMI_CDTV:
253 case AMI_CD32:
254 AMIGAHW_SET(CD_ROM);
255 AMIGAHW_SET(A2000_CLK); /* Is this correct? */
256 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257
Roman Zippel6ff58012007-05-01 22:32:43 +0200258 Generic:
259 AMIGAHW_SET(AMI_VIDEO);
260 AMIGAHW_SET(AMI_BLITTER);
261 AMIGAHW_SET(AMI_AUDIO);
262 AMIGAHW_SET(AMI_FLOPPY);
263 AMIGAHW_SET(AMI_KEYBOARD);
264 AMIGAHW_SET(AMI_MOUSE);
265 AMIGAHW_SET(AMI_SERIAL);
266 AMIGAHW_SET(AMI_PARALLEL);
267 AMIGAHW_SET(CHIP_RAM);
268 AMIGAHW_SET(PAULA);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269
Roman Zippel6ff58012007-05-01 22:32:43 +0200270 switch (amiga_chipset) {
271 case CS_OCS:
272 case CS_ECS:
273 case CS_AGA:
274 switch (amiga_custom.deniseid & 0xf) {
275 case 0x0c:
276 AMIGAHW_SET(DENISE_HR);
277 break;
278 case 0x08:
279 AMIGAHW_SET(LISA);
280 break;
281 }
282 break;
283 default:
284 AMIGAHW_SET(DENISE);
285 break;
286 }
287 switch ((amiga_custom.vposr>>8) & 0x7f) {
288 case 0x00:
289 AMIGAHW_SET(AGNUS_PAL);
290 break;
291 case 0x10:
292 AMIGAHW_SET(AGNUS_NTSC);
293 break;
294 case 0x20:
295 case 0x21:
296 AMIGAHW_SET(AGNUS_HR_PAL);
297 break;
298 case 0x30:
299 case 0x31:
300 AMIGAHW_SET(AGNUS_HR_NTSC);
301 break;
302 case 0x22:
303 case 0x23:
304 AMIGAHW_SET(ALICE_PAL);
305 break;
306 case 0x32:
307 case 0x33:
308 AMIGAHW_SET(ALICE_NTSC);
309 break;
310 }
311 AMIGAHW_SET(ZORRO);
312 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313
Roman Zippel6ff58012007-05-01 22:32:43 +0200314 case AMI_DRACO:
315 panic("No support for Draco yet");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316
Roman Zippel6ff58012007-05-01 22:32:43 +0200317 default:
318 panic("Unknown Amiga Model");
319 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320
Roman Zippel6ff58012007-05-01 22:32:43 +0200321#define AMIGAHW_ANNOUNCE(name, str) \
322 if (AMIGAHW_PRESENT(name)) \
323 printk(str)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324
Roman Zippel6ff58012007-05-01 22:32:43 +0200325 AMIGAHW_ANNOUNCE(AMI_VIDEO, "VIDEO ");
326 AMIGAHW_ANNOUNCE(AMI_BLITTER, "BLITTER ");
327 AMIGAHW_ANNOUNCE(AMBER_FF, "AMBER_FF ");
328 AMIGAHW_ANNOUNCE(AMI_AUDIO, "AUDIO ");
329 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "FLOPPY ");
330 AMIGAHW_ANNOUNCE(A3000_SCSI, "A3000_SCSI ");
331 AMIGAHW_ANNOUNCE(A4000_SCSI, "A4000_SCSI ");
332 AMIGAHW_ANNOUNCE(A1200_IDE, "A1200_IDE ");
333 AMIGAHW_ANNOUNCE(A4000_IDE, "A4000_IDE ");
334 AMIGAHW_ANNOUNCE(CD_ROM, "CD_ROM ");
335 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "KEYBOARD ");
336 AMIGAHW_ANNOUNCE(AMI_MOUSE, "MOUSE ");
337 AMIGAHW_ANNOUNCE(AMI_SERIAL, "SERIAL ");
338 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "PARALLEL ");
339 AMIGAHW_ANNOUNCE(A2000_CLK, "A2000_CLK ");
340 AMIGAHW_ANNOUNCE(A3000_CLK, "A3000_CLK ");
341 AMIGAHW_ANNOUNCE(CHIP_RAM, "CHIP_RAM ");
342 AMIGAHW_ANNOUNCE(PAULA, "PAULA ");
343 AMIGAHW_ANNOUNCE(DENISE, "DENISE ");
344 AMIGAHW_ANNOUNCE(DENISE_HR, "DENISE_HR ");
345 AMIGAHW_ANNOUNCE(LISA, "LISA ");
346 AMIGAHW_ANNOUNCE(AGNUS_PAL, "AGNUS_PAL ");
347 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "AGNUS_NTSC ");
348 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "AGNUS_HR_PAL ");
349 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "AGNUS_HR_NTSC ");
350 AMIGAHW_ANNOUNCE(ALICE_PAL, "ALICE_PAL ");
351 AMIGAHW_ANNOUNCE(ALICE_NTSC, "ALICE_NTSC ");
352 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "MAGIC_REKICK ");
353 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA ");
354 if (AMIGAHW_PRESENT(ZORRO))
355 printk("ZORRO%s ", AMIGAHW_PRESENT(ZORRO3) ? "3" : "");
356 printk("\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357
358#undef AMIGAHW_ANNOUNCE
359}
360
361 /*
362 * Setup the Amiga configuration info
363 */
364
365void __init config_amiga(void)
366{
Roman Zippel6ff58012007-05-01 22:32:43 +0200367 int i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368
Roman Zippel6ff58012007-05-01 22:32:43 +0200369 amiga_identify();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370
Roman Zippel6ff58012007-05-01 22:32:43 +0200371 /* Yuk, we don't have PCI memory */
372 iomem_resource.name = "Memory";
373 for (i = 0; i < 4; i++)
374 request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375
Roman Zippel6ff58012007-05-01 22:32:43 +0200376 mach_sched_init = amiga_sched_init;
377 mach_init_IRQ = amiga_init_IRQ;
378 mach_get_model = amiga_get_model;
379 mach_get_hardware_list = amiga_get_hardware_list;
380 mach_gettimeoffset = amiga_gettimeoffset;
381 if (AMIGAHW_PRESENT(A3000_CLK)) {
382 mach_hwclk = a3000_hwclk;
383 rtc_resource.name = "A3000 RTC";
384 request_resource(&iomem_resource, &rtc_resource);
385 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
386 mach_hwclk = a2000_hwclk;
387 rtc_resource.name = "A2000 RTC";
388 request_resource(&iomem_resource, &rtc_resource);
389 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390
Roman Zippel6ff58012007-05-01 22:32:43 +0200391 /*
392 * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI
393 * code will not be able to allocate any mem for transfers, unless we are
394 * dealing with a Z2 mem only system. /Jes
395 */
396 mach_max_dma_address = 0xffffffff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397
Roman Zippel6ff58012007-05-01 22:32:43 +0200398 mach_set_clock_mmss = amiga_set_clock_mmss;
399 mach_get_ss = amiga_get_ss;
400 mach_reset = amiga_reset;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
Roman Zippel6ff58012007-05-01 22:32:43 +0200402 mach_beep = amiga_mksound;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403#endif
404
405#ifdef CONFIG_HEARTBEAT
Roman Zippel6ff58012007-05-01 22:32:43 +0200406 mach_heartbeat = amiga_heartbeat;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407#endif
408
Roman Zippel6ff58012007-05-01 22:32:43 +0200409 /* Fill in the clock values (based on the 700 kHz E-Clock) */
410 amiga_masterclock = 40*amiga_eclock; /* 28 MHz */
411 amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412
Roman Zippel6ff58012007-05-01 22:32:43 +0200413 /* clear all DMA bits */
414 amiga_custom.dmacon = DMAF_ALL;
415 /* ensure that the DMA master bit is set */
416 amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700417
Roman Zippel6ff58012007-05-01 22:32:43 +0200418 /* don't use Z2 RAM as system memory on Z3 capable machines */
419 if (AMIGAHW_PRESENT(ZORRO3)) {
420 int i, j;
421 u32 disabled_z2mem = 0;
422
423 for (i = 0; i < m68k_num_memory; i++) {
424 if (m68k_memory[i].addr < 16*1024*1024) {
425 if (i == 0) {
426 /* don't cut off the branch we're sitting on */
427 printk("Warning: kernel runs in Zorro II memory\n");
428 continue;
429 }
430 disabled_z2mem += m68k_memory[i].size;
431 m68k_num_memory--;
432 for (j = i; j < m68k_num_memory; j++)
433 m68k_memory[j] = m68k_memory[j+1];
434 i--;
435 }
436 }
437 if (disabled_z2mem)
438 printk("%dK of Zorro II memory will not be used as system memory\n",
439 disabled_z2mem>>10);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700440 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700441
Roman Zippel6ff58012007-05-01 22:32:43 +0200442 /* request all RAM */
443 for (i = 0; i < m68k_num_memory; i++) {
444 ram_resource[i].name =
445 (m68k_memory[i].addr >= 0x01000000) ? "32-bit Fast RAM" :
446 (m68k_memory[i].addr < 0x00c00000) ? "16-bit Fast RAM" :
447 "16-bit Slow RAM";
448 ram_resource[i].start = m68k_memory[i].addr;
449 ram_resource[i].end = m68k_memory[i].addr+m68k_memory[i].size-1;
450 request_resource(&iomem_resource, &ram_resource[i]);
451 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452
Roman Zippel6ff58012007-05-01 22:32:43 +0200453 /* initialize chipram allocator */
454 amiga_chip_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455
Roman Zippel6ff58012007-05-01 22:32:43 +0200456 /* our beloved beeper */
457 if (AMIGAHW_PRESENT(AMI_AUDIO))
458 amiga_init_sound();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459
Roman Zippel6ff58012007-05-01 22:32:43 +0200460 /*
461 * if it is an A3000, set the magic bit that forces
462 * a hard rekick
463 */
464 if (AMIGAHW_PRESENT(MAGIC_REKICK))
465 *(unsigned char *)ZTWO_VADDR(0xde0002) |= 0x80;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700466}
467
468static unsigned short jiffy_ticks;
469
David Howells40220c12006-10-09 12:19:47 +0100470static void __init amiga_sched_init(irq_handler_t timer_routine)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471{
472 static struct resource sched_res = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200473 .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700474 };
475 jiffy_ticks = (amiga_eclock+HZ/2)/HZ;
476
477 if (request_resource(&mb_resources._ciab, &sched_res))
Roman Zippel6ff58012007-05-01 22:32:43 +0200478 printk("Cannot allocate ciab.ta{lo,hi}\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479 ciab.cra &= 0xC0; /* turn off timer A, continuous mode, from Eclk */
480 ciab.talo = jiffy_ticks % 256;
481 ciab.tahi = jiffy_ticks / 256;
482
483 /* install interrupt service routine for CIAB Timer A
484 *
485 * Please don't change this to use ciaa, as it interferes with the
486 * SCSI code. We'll have to take a look at this later
487 */
488 request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL);
489 /* start timer */
490 ciab.cra |= 0x11;
491}
492
493#define TICK_SIZE 10000
494
495/* This is always executed with interrupts disabled. */
Roman Zippel6ff58012007-05-01 22:32:43 +0200496static unsigned long amiga_gettimeoffset(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497{
498 unsigned short hi, lo, hi2;
499 unsigned long ticks, offset = 0;
500
501 /* read CIA B timer A current value */
502 hi = ciab.tahi;
503 lo = ciab.talo;
504 hi2 = ciab.tahi;
505
506 if (hi != hi2) {
507 lo = ciab.talo;
508 hi = hi2;
509 }
510
511 ticks = hi << 8 | lo;
512
513 if (ticks > jiffy_ticks / 2)
514 /* check for pending interrupt */
515 if (cia_set_irq(&ciab_base, 0) & CIA_ICR_TA)
516 offset = 10000;
517
518 ticks = jiffy_ticks - ticks;
519 ticks = (10000 * ticks) / jiffy_ticks;
520
521 return ticks + offset;
522}
523
524static int a3000_hwclk(int op, struct rtc_time *t)
525{
526 tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD;
527
528 if (!op) { /* read */
529 t->tm_sec = tod_3000.second1 * 10 + tod_3000.second2;
530 t->tm_min = tod_3000.minute1 * 10 + tod_3000.minute2;
531 t->tm_hour = tod_3000.hour1 * 10 + tod_3000.hour2;
532 t->tm_mday = tod_3000.day1 * 10 + tod_3000.day2;
533 t->tm_wday = tod_3000.weekday;
534 t->tm_mon = tod_3000.month1 * 10 + tod_3000.month2 - 1;
535 t->tm_year = tod_3000.year1 * 10 + tod_3000.year2;
536 if (t->tm_year <= 69)
537 t->tm_year += 100;
538 } else {
539 tod_3000.second1 = t->tm_sec / 10;
540 tod_3000.second2 = t->tm_sec % 10;
541 tod_3000.minute1 = t->tm_min / 10;
542 tod_3000.minute2 = t->tm_min % 10;
543 tod_3000.hour1 = t->tm_hour / 10;
544 tod_3000.hour2 = t->tm_hour % 10;
545 tod_3000.day1 = t->tm_mday / 10;
546 tod_3000.day2 = t->tm_mday % 10;
547 if (t->tm_wday != -1)
548 tod_3000.weekday = t->tm_wday;
549 tod_3000.month1 = (t->tm_mon + 1) / 10;
550 tod_3000.month2 = (t->tm_mon + 1) % 10;
551 if (t->tm_year >= 100)
552 t->tm_year -= 100;
553 tod_3000.year1 = t->tm_year / 10;
554 tod_3000.year2 = t->tm_year % 10;
555 }
556
557 tod_3000.cntrl1 = TOD3000_CNTRL1_FREE;
558
559 return 0;
560}
561
562static int a2000_hwclk(int op, struct rtc_time *t)
563{
564 int cnt = 5;
565
566 tod_2000.cntrl1 = TOD2000_CNTRL1_HOLD;
567
Roman Zippel6ff58012007-05-01 22:32:43 +0200568 while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) {
569 tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
570 udelay(70);
571 tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700572 }
573
574 if (!cnt)
Roman Zippel6ff58012007-05-01 22:32:43 +0200575 printk(KERN_INFO "hwclk: timed out waiting for RTC (0x%x)\n",
576 tod_2000.cntrl1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700577
578 if (!op) { /* read */
579 t->tm_sec = tod_2000.second1 * 10 + tod_2000.second2;
580 t->tm_min = tod_2000.minute1 * 10 + tod_2000.minute2;
581 t->tm_hour = (tod_2000.hour1 & 3) * 10 + tod_2000.hour2;
582 t->tm_mday = tod_2000.day1 * 10 + tod_2000.day2;
583 t->tm_wday = tod_2000.weekday;
584 t->tm_mon = tod_2000.month1 * 10 + tod_2000.month2 - 1;
585 t->tm_year = tod_2000.year1 * 10 + tod_2000.year2;
586 if (t->tm_year <= 69)
587 t->tm_year += 100;
588
Roman Zippel6ff58012007-05-01 22:32:43 +0200589 if (!(tod_2000.cntrl3 & TOD2000_CNTRL3_24HMODE)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590 if (!(tod_2000.hour1 & TOD2000_HOUR1_PM) && t->tm_hour == 12)
591 t->tm_hour = 0;
592 else if ((tod_2000.hour1 & TOD2000_HOUR1_PM) && t->tm_hour != 12)
593 t->tm_hour += 12;
594 }
595 } else {
596 tod_2000.second1 = t->tm_sec / 10;
597 tod_2000.second2 = t->tm_sec % 10;
598 tod_2000.minute1 = t->tm_min / 10;
599 tod_2000.minute2 = t->tm_min % 10;
600 if (tod_2000.cntrl3 & TOD2000_CNTRL3_24HMODE)
601 tod_2000.hour1 = t->tm_hour / 10;
602 else if (t->tm_hour >= 12)
603 tod_2000.hour1 = TOD2000_HOUR1_PM +
604 (t->tm_hour - 12) / 10;
605 else
606 tod_2000.hour1 = t->tm_hour / 10;
607 tod_2000.hour2 = t->tm_hour % 10;
608 tod_2000.day1 = t->tm_mday / 10;
609 tod_2000.day2 = t->tm_mday % 10;
610 if (t->tm_wday != -1)
611 tod_2000.weekday = t->tm_wday;
612 tod_2000.month1 = (t->tm_mon + 1) / 10;
613 tod_2000.month2 = (t->tm_mon + 1) % 10;
614 if (t->tm_year >= 100)
615 t->tm_year -= 100;
616 tod_2000.year1 = t->tm_year / 10;
617 tod_2000.year2 = t->tm_year % 10;
618 }
619
620 tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
621
622 return 0;
623}
624
Roman Zippel6ff58012007-05-01 22:32:43 +0200625static int amiga_set_clock_mmss(unsigned long nowtime)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626{
627 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
628
629 if (AMIGAHW_PRESENT(A3000_CLK)) {
630 tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD;
631
632 tod_3000.second1 = real_seconds / 10;
633 tod_3000.second2 = real_seconds % 10;
634 tod_3000.minute1 = real_minutes / 10;
635 tod_3000.minute2 = real_minutes % 10;
636
637 tod_3000.cntrl1 = TOD3000_CNTRL1_FREE;
638 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
639 int cnt = 5;
640
641 tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
642
Roman Zippel6ff58012007-05-01 22:32:43 +0200643 while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700644 tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
645 udelay(70);
646 tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
647 }
648
649 if (!cnt)
650 printk(KERN_INFO "set_clock_mmss: timed out waiting for RTC (0x%x)\n", tod_2000.cntrl1);
651
652 tod_2000.second1 = real_seconds / 10;
653 tod_2000.second2 = real_seconds % 10;
654 tod_2000.minute1 = real_minutes / 10;
655 tod_2000.minute2 = real_minutes % 10;
656
657 tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
658 }
659
660 return 0;
661}
662
Roman Zippel6ff58012007-05-01 22:32:43 +0200663static unsigned int amiga_get_ss(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700664{
665 unsigned int s;
666
667 if (AMIGAHW_PRESENT(A3000_CLK)) {
668 tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD;
669 s = tod_3000.second1 * 10 + tod_3000.second2;
670 tod_3000.cntrl1 = TOD3000_CNTRL1_FREE;
671 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
672 s = tod_2000.second1 * 10 + tod_2000.second2;
673 }
674 return s;
675}
676
Roman Zippel6ff58012007-05-01 22:32:43 +0200677static NORET_TYPE void amiga_reset(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700678 ATTRIB_NORET;
679
Roman Zippel6ff58012007-05-01 22:32:43 +0200680static void amiga_reset(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700681{
Roman Zippel6ff58012007-05-01 22:32:43 +0200682 unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
683 unsigned long jmp_addr = virt_to_phys(&&jmp_addr_label);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700684
Roman Zippel6ff58012007-05-01 22:32:43 +0200685 local_irq_disable();
686 if (CPU_IS_040_OR_060)
687 /* Setup transparent translation registers for mapping
688 * of 16 MB kernel segment before disabling translation
689 */
690 asm volatile ("\n"
691 " move.l %0,%%d0\n"
692 " and.l #0xff000000,%%d0\n"
693 " or.w #0xe020,%%d0\n" /* map 16 MB, enable, cacheable */
694 " .chip 68040\n"
695 " movec %%d0,%%itt0\n"
696 " movec %%d0,%%dtt0\n"
697 " .chip 68k\n"
698 " jmp %0@\n"
699 : /* no outputs */
700 : "a" (jmp_addr040)
701 : "d0");
702 else
703 /* for 680[23]0, just disable translation and jump to the physical
704 * address of the label
705 */
706 asm volatile ("\n"
707 " pmove %%tc,%@\n"
708 " bclr #7,%@\n"
709 " pmove %@,%%tc\n"
710 " jmp %0@\n"
711 : /* no outputs */
712 : "a" (jmp_addr));
713jmp_addr_label040:
714 /* disable translation on '040 now */
715 asm volatile ("\n"
716 " moveq #0,%%d0\n"
717 " .chip 68040\n"
718 " movec %%d0,%%tc\n" /* disable MMU */
719 " .chip 68k\n"
720 : /* no outputs */
721 : /* no inputs */
722 : "d0");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700723
Roman Zippel6ff58012007-05-01 22:32:43 +0200724 jmp_addr_label:
725 /* pickup reset address from AmigaOS ROM, reset devices and jump
726 * to reset address
727 */
728 asm volatile ("\n"
729 " move.w #0x2700,%sr\n"
730 " lea 0x01000000,%a0\n"
731 " sub.l %a0@(-0x14),%a0\n"
732 " move.l %a0@(4),%a0\n"
733 " subq.l #2,%a0\n"
734 " jra 1f\n"
735 /* align on a longword boundary */
736 " " __ALIGN_STR "\n"
737 "1:\n"
738 " reset\n"
739 " jmp %a0@");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700740
Roman Zippel6ff58012007-05-01 22:32:43 +0200741 for (;;)
742 ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700743}
744
745
746 /*
747 * Debugging
748 */
749
750#define SAVEKMSG_MAXMEM 128*1024
751
752#define SAVEKMSG_MAGIC1 0x53415645 /* 'SAVE' */
753#define SAVEKMSG_MAGIC2 0x4B4D5347 /* 'KMSG' */
754
755struct savekmsg {
Roman Zippel6ff58012007-05-01 22:32:43 +0200756 unsigned long magic1; /* SAVEKMSG_MAGIC1 */
757 unsigned long magic2; /* SAVEKMSG_MAGIC2 */
758 unsigned long magicptr; /* address of magic1 */
759 unsigned long size;
760 char data[0];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700761};
762
763static struct savekmsg *savekmsg;
764
765static void amiga_mem_console_write(struct console *co, const char *s,
766 unsigned int count)
767{
Roman Zippel6ff58012007-05-01 22:32:43 +0200768 if (savekmsg->size + count <= SAVEKMSG_MAXMEM-sizeof(struct savekmsg)) {
769 memcpy(savekmsg->data + savekmsg->size, s, count);
770 savekmsg->size += count;
771 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700772}
773
Roman Zippeld6713b42007-05-01 22:32:45 +0200774static int __init amiga_savekmsg_setup(char *arg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775{
Roman Zippel6ff58012007-05-01 22:32:43 +0200776 static struct resource debug_res = { .name = "Debug" };
Linus Torvalds1da177e2005-04-16 15:20:36 -0700777
Roman Zippeld6713b42007-05-01 22:32:45 +0200778 if (!MACH_IS_AMIGA || strcmp(arg, "mem"))
779 goto done;
780
781 if (!AMIGAHW_PRESENT(CHIP_RAM)) {
782 printk("Warning: no chipram present for debugging\n");
783 goto done;
784 }
785
Roman Zippel6ff58012007-05-01 22:32:43 +0200786 savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res);
787 savekmsg->magic1 = SAVEKMSG_MAGIC1;
788 savekmsg->magic2 = SAVEKMSG_MAGIC2;
789 savekmsg->magicptr = ZTWO_PADDR(savekmsg);
790 savekmsg->size = 0;
Roman Zippeld6713b42007-05-01 22:32:45 +0200791
792 amiga_console_driver.write = amiga_mem_console_write;
793 register_console(&amiga_console_driver);
794
795done:
796 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700797}
798
Roman Zippeld6713b42007-05-01 22:32:45 +0200799early_param("debug", amiga_savekmsg_setup);
800
Linus Torvalds1da177e2005-04-16 15:20:36 -0700801static void amiga_serial_putc(char c)
802{
Roman Zippel6ff58012007-05-01 22:32:43 +0200803 amiga_custom.serdat = (unsigned char)c | 0x100;
804 while (!(amiga_custom.serdatr & 0x2000))
805 ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700806}
807
808void amiga_serial_console_write(struct console *co, const char *s,
Roman Zippel6ff58012007-05-01 22:32:43 +0200809 unsigned int count)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810{
Roman Zippel6ff58012007-05-01 22:32:43 +0200811 while (count--) {
812 if (*s == '\n')
813 amiga_serial_putc('\r');
814 amiga_serial_putc(*s++);
815 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816}
817
818#ifdef CONFIG_SERIAL_CONSOLE
819void amiga_serial_puts(const char *s)
820{
Roman Zippel6ff58012007-05-01 22:32:43 +0200821 amiga_serial_console_write(NULL, s, strlen(s));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700822}
823
824int amiga_serial_console_wait_key(struct console *co)
825{
Roman Zippel6ff58012007-05-01 22:32:43 +0200826 int ch;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700827
Roman Zippel6ff58012007-05-01 22:32:43 +0200828 while (!(amiga_custom.intreqr & IF_RBF))
829 barrier();
830 ch = amiga_custom.serdatr & 0xff;
831 /* clear the interrupt, so that another character can be read */
832 amiga_custom.intreq = IF_RBF;
833 return ch;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700834}
835
836void amiga_serial_gets(struct console *co, char *s, int len)
837{
Roman Zippel6ff58012007-05-01 22:32:43 +0200838 int ch, cnt = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700839
Roman Zippel6ff58012007-05-01 22:32:43 +0200840 while (1) {
841 ch = amiga_serial_console_wait_key(co);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700842
Roman Zippel6ff58012007-05-01 22:32:43 +0200843 /* Check for backspace. */
844 if (ch == 8 || ch == 127) {
845 if (cnt == 0) {
846 amiga_serial_putc('\007');
847 continue;
848 }
849 cnt--;
850 amiga_serial_puts("\010 \010");
851 continue;
852 }
853
854 /* Check for enter. */
855 if (ch == 10 || ch == 13)
856 break;
857
858 /* See if line is too long. */
859 if (cnt >= len + 1) {
860 amiga_serial_putc(7);
861 cnt--;
862 continue;
863 }
864
865 /* Store and echo character. */
866 s[cnt++] = ch;
867 amiga_serial_putc(ch);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700868 }
Roman Zippel6ff58012007-05-01 22:32:43 +0200869 /* Print enter. */
870 amiga_serial_puts("\r\n");
871 s[cnt] = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700872}
873#endif
874
Roman Zippeld6713b42007-05-01 22:32:45 +0200875static int __init amiga_debug_setup(char *arg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700876{
Roman Zippeld6713b42007-05-01 22:32:45 +0200877 if (MACH_IS_AMIGA && !strcmp(arg, "ser")) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700878 /* no initialization required (?) */
879 amiga_console_driver.write = amiga_serial_console_write;
880 register_console(&amiga_console_driver);
881 }
Roman Zippeld6713b42007-05-01 22:32:45 +0200882 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700883}
884
Roman Zippeld6713b42007-05-01 22:32:45 +0200885early_param("debug", amiga_debug_setup);
886
Linus Torvalds1da177e2005-04-16 15:20:36 -0700887#ifdef CONFIG_HEARTBEAT
888static void amiga_heartbeat(int on)
889{
Roman Zippel6ff58012007-05-01 22:32:43 +0200890 if (on)
891 ciaa.pra &= ~2;
892 else
893 ciaa.pra |= 2;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700894}
895#endif
896
897 /*
898 * Amiga specific parts of /proc
899 */
900
901static void amiga_get_model(char *model)
902{
Roman Zippel6ff58012007-05-01 22:32:43 +0200903 strcpy(model, amiga_model_name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700904}
905
906
907static int amiga_get_hardware_list(char *buffer)
908{
Roman Zippel6ff58012007-05-01 22:32:43 +0200909 int len = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700910
Roman Zippel6ff58012007-05-01 22:32:43 +0200911 if (AMIGAHW_PRESENT(CHIP_RAM))
912 len += sprintf(buffer+len, "Chip RAM:\t%ldK\n", amiga_chip_size>>10);
913 len += sprintf(buffer+len, "PS Freq:\t%dHz\nEClock Freq:\t%ldHz\n",
914 amiga_psfreq, amiga_eclock);
915 if (AMIGAHW_PRESENT(AMI_VIDEO)) {
916 char *type;
917 switch (amiga_chipset) {
918 case CS_OCS:
919 type = "OCS";
920 break;
921 case CS_ECS:
922 type = "ECS";
923 break;
924 case CS_AGA:
925 type = "AGA";
926 break;
927 default:
928 type = "Old or Unknown";
929 break;
930 }
931 len += sprintf(buffer+len, "Graphics:\t%s\n", type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700932 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700933
934#define AMIGAHW_ANNOUNCE(name, str) \
Roman Zippel6ff58012007-05-01 22:32:43 +0200935 if (AMIGAHW_PRESENT(name)) \
936 len += sprintf (buffer+len, "\t%s\n", str)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700937
Roman Zippel6ff58012007-05-01 22:32:43 +0200938 len += sprintf (buffer + len, "Detected hardware:\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700939
Roman Zippel6ff58012007-05-01 22:32:43 +0200940 AMIGAHW_ANNOUNCE(AMI_VIDEO, "Amiga Video");
941 AMIGAHW_ANNOUNCE(AMI_BLITTER, "Blitter");
942 AMIGAHW_ANNOUNCE(AMBER_FF, "Amber Flicker Fixer");
943 AMIGAHW_ANNOUNCE(AMI_AUDIO, "Amiga Audio");
944 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "Floppy Controller");
945 AMIGAHW_ANNOUNCE(A3000_SCSI, "SCSI Controller WD33C93 (A3000 style)");
946 AMIGAHW_ANNOUNCE(A4000_SCSI, "SCSI Controller NCR53C710 (A4000T style)");
947 AMIGAHW_ANNOUNCE(A1200_IDE, "IDE Interface (A1200 style)");
948 AMIGAHW_ANNOUNCE(A4000_IDE, "IDE Interface (A4000 style)");
949 AMIGAHW_ANNOUNCE(CD_ROM, "Internal CD ROM drive");
950 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "Keyboard");
951 AMIGAHW_ANNOUNCE(AMI_MOUSE, "Mouse Port");
952 AMIGAHW_ANNOUNCE(AMI_SERIAL, "Serial Port");
953 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "Parallel Port");
954 AMIGAHW_ANNOUNCE(A2000_CLK, "Hardware Clock (A2000 style)");
955 AMIGAHW_ANNOUNCE(A3000_CLK, "Hardware Clock (A3000 style)");
956 AMIGAHW_ANNOUNCE(CHIP_RAM, "Chip RAM");
957 AMIGAHW_ANNOUNCE(PAULA, "Paula 8364");
958 AMIGAHW_ANNOUNCE(DENISE, "Denise 8362");
959 AMIGAHW_ANNOUNCE(DENISE_HR, "Denise 8373");
960 AMIGAHW_ANNOUNCE(LISA, "Lisa 8375");
961 AMIGAHW_ANNOUNCE(AGNUS_PAL, "Normal/Fat PAL Agnus 8367/8371");
962 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "Normal/Fat NTSC Agnus 8361/8370");
963 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "Fat Hires PAL Agnus 8372");
964 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "Fat Hires NTSC Agnus 8372");
965 AMIGAHW_ANNOUNCE(ALICE_PAL, "PAL Alice 8374");
966 AMIGAHW_ANNOUNCE(ALICE_NTSC, "NTSC Alice 8374");
967 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "Magic Hard Rekick");
968 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA Slot");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700969#ifdef CONFIG_ZORRO
Roman Zippel6ff58012007-05-01 22:32:43 +0200970 if (AMIGAHW_PRESENT(ZORRO))
971 len += sprintf(buffer+len, "\tZorro II%s AutoConfig: %d Expansion "
972 "Device%s\n",
973 AMIGAHW_PRESENT(ZORRO3) ? "I" : "",
974 zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700975#endif /* CONFIG_ZORRO */
976
977#undef AMIGAHW_ANNOUNCE
978
Roman Zippel6ff58012007-05-01 22:32:43 +0200979 return len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700980}