blob: 50f5daab46b7b53ecb282fc50a6e8bad8f3df2df [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>
Adrian Bunk8b169fa2008-02-04 22:30:25 -080026#include <linux/module.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
28#include <asm/bootinfo.h>
29#include <asm/setup.h>
30#include <asm/system.h>
31#include <asm/pgtable.h>
32#include <asm/amigahw.h>
33#include <asm/amigaints.h>
34#include <asm/irq.h>
35#include <asm/rtc.h>
36#include <asm/machdep.h>
37#include <asm/io.h>
38
39unsigned long amiga_model;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080040EXPORT_SYMBOL(amiga_model);
41
Linus Torvalds1da177e2005-04-16 15:20:36 -070042unsigned long amiga_eclock;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080043EXPORT_SYMBOL(amiga_eclock);
44
Linus Torvalds1da177e2005-04-16 15:20:36 -070045unsigned long amiga_masterclock;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080046
Linus Torvalds1da177e2005-04-16 15:20:36 -070047unsigned long amiga_colorclock;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080048EXPORT_SYMBOL(amiga_colorclock);
49
Linus Torvalds1da177e2005-04-16 15:20:36 -070050unsigned long amiga_chipset;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080051EXPORT_SYMBOL(amiga_chipset);
52
Linus Torvalds1da177e2005-04-16 15:20:36 -070053unsigned char amiga_vblank;
54unsigned char amiga_psfreq;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080055
Linus Torvalds1da177e2005-04-16 15:20:36 -070056struct amiga_hw_present amiga_hw_present;
Adrian Bunk8b169fa2008-02-04 22:30:25 -080057EXPORT_SYMBOL(amiga_hw_present);
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
59static char s_a500[] __initdata = "A500";
60static char s_a500p[] __initdata = "A500+";
61static char s_a600[] __initdata = "A600";
62static char s_a1000[] __initdata = "A1000";
63static char s_a1200[] __initdata = "A1200";
64static char s_a2000[] __initdata = "A2000";
65static char s_a2500[] __initdata = "A2500";
66static char s_a3000[] __initdata = "A3000";
67static char s_a3000t[] __initdata = "A3000T";
68static char s_a3000p[] __initdata = "A3000+";
69static char s_a4000[] __initdata = "A4000";
70static char s_a4000t[] __initdata = "A4000T";
71static char s_cdtv[] __initdata = "CDTV";
72static char s_cd32[] __initdata = "CD32";
73static char s_draco[] __initdata = "Draco";
74static char *amiga_models[] __initdata = {
Roman Zippel6ff58012007-05-01 22:32:43 +020075 [AMI_500-AMI_500] = s_a500,
76 [AMI_500PLUS-AMI_500] = s_a500p,
77 [AMI_600-AMI_500] = s_a600,
78 [AMI_1000-AMI_500] = s_a1000,
79 [AMI_1200-AMI_500] = s_a1200,
80 [AMI_2000-AMI_500] = s_a2000,
81 [AMI_2500-AMI_500] = s_a2500,
82 [AMI_3000-AMI_500] = s_a3000,
83 [AMI_3000T-AMI_500] = s_a3000t,
84 [AMI_3000PLUS-AMI_500] = s_a3000p,
85 [AMI_4000-AMI_500] = s_a4000,
86 [AMI_4000T-AMI_500] = s_a4000t,
87 [AMI_CDTV-AMI_500] = s_cdtv,
88 [AMI_CD32-AMI_500] = s_cd32,
89 [AMI_DRACO-AMI_500] = s_draco,
Linus Torvalds1da177e2005-04-16 15:20:36 -070090};
91
92static char amiga_model_name[13] = "Amiga ";
93
David Howells40220c12006-10-09 12:19:47 +010094static void amiga_sched_init(irq_handler_t handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -070095/* amiga specific irq functions */
Roman Zippel6ff58012007-05-01 22:32:43 +020096extern void amiga_init_IRQ(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070097static void amiga_get_model(char *model);
98static int amiga_get_hardware_list(char *buffer);
Linus Torvalds1da177e2005-04-16 15:20:36 -070099/* amiga specific timer functions */
Roman Zippel6ff58012007-05-01 22:32:43 +0200100static unsigned long amiga_gettimeoffset(void);
101static int a3000_hwclk(int, struct rtc_time *);
102static int a2000_hwclk(int, struct rtc_time *);
103static int amiga_set_clock_mmss(unsigned long);
104static unsigned int amiga_get_ss(void);
105extern void amiga_mksound(unsigned int count, unsigned int ticks);
106static void amiga_reset(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107extern void amiga_init_sound(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108static void amiga_mem_console_write(struct console *co, const char *b,
109 unsigned int count);
110void amiga_serial_console_write(struct console *co, const char *s,
111 unsigned int count);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112#ifdef CONFIG_HEARTBEAT
113static void amiga_heartbeat(int on);
114#endif
115
116static struct console amiga_console_driver = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200117 .name = "debug",
118 .flags = CON_PRINTBUFFER,
119 .index = -1,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120};
121
122
123 /*
124 * Motherboard Resources present in all Amiga models
125 */
126
127static struct {
Roman Zippel6ff58012007-05-01 22:32:43 +0200128 struct resource _ciab, _ciaa, _custom, _kickstart;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129} mb_resources = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200130 ._ciab = {
131 .name = "CIA B", .start = 0x00bfd000, .end = 0x00bfdfff
132 },
133 ._ciaa = {
134 .name = "CIA A", .start = 0x00bfe000, .end = 0x00bfefff
135 },
136 ._custom = {
137 .name = "Custom I/O", .start = 0x00dff000, .end = 0x00dfffff
138 },
139 ._kickstart = {
140 .name = "Kickstart ROM", .start = 0x00f80000, .end = 0x00ffffff
141 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142};
143
144static struct resource rtc_resource = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200145 .start = 0x00dc0000, .end = 0x00dcffff
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146};
147
148static struct resource ram_resource[NUM_MEMINFO];
149
150
151 /*
152 * Parse an Amiga-specific record in the bootinfo
153 */
154
155int amiga_parse_bootinfo(const struct bi_record *record)
156{
Roman Zippel6ff58012007-05-01 22:32:43 +0200157 int unknown = 0;
158 const unsigned long *data = record->data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159
Roman Zippel6ff58012007-05-01 22:32:43 +0200160 switch (record->tag) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161 case BI_AMIGA_MODEL:
Roman Zippel6ff58012007-05-01 22:32:43 +0200162 amiga_model = *data;
163 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
165 case BI_AMIGA_ECLOCK:
Roman Zippel6ff58012007-05-01 22:32:43 +0200166 amiga_eclock = *data;
167 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168
169 case BI_AMIGA_CHIPSET:
Roman Zippel6ff58012007-05-01 22:32:43 +0200170 amiga_chipset = *data;
171 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172
173 case BI_AMIGA_CHIP_SIZE:
Roman Zippel6ff58012007-05-01 22:32:43 +0200174 amiga_chip_size = *(const int *)data;
175 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176
177 case BI_AMIGA_VBLANK:
Roman Zippel6ff58012007-05-01 22:32:43 +0200178 amiga_vblank = *(const unsigned char *)data;
179 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180
181 case BI_AMIGA_PSFREQ:
Roman Zippel6ff58012007-05-01 22:32:43 +0200182 amiga_psfreq = *(const unsigned char *)data;
183 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184
185 case BI_AMIGA_AUTOCON:
186#ifdef CONFIG_ZORRO
Roman Zippel6ff58012007-05-01 22:32:43 +0200187 if (zorro_num_autocon < ZORRO_NUM_AUTO) {
188 const struct ConfigDev *cd = (struct ConfigDev *)data;
189 struct zorro_dev *dev = &zorro_autocon[zorro_num_autocon++];
190 dev->rom = cd->cd_Rom;
191 dev->slotaddr = cd->cd_SlotAddr;
192 dev->slotsize = cd->cd_SlotSize;
193 dev->resource.start = (unsigned long)cd->cd_BoardAddr;
194 dev->resource.end = dev->resource.start + cd->cd_BoardSize - 1;
195 } else
196 printk("amiga_parse_bootinfo: too many AutoConfig devices\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197#endif /* CONFIG_ZORRO */
Roman Zippel6ff58012007-05-01 22:32:43 +0200198 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199
200 case BI_AMIGA_SERPER:
Roman Zippel6ff58012007-05-01 22:32:43 +0200201 /* serial port period: ignored here */
202 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203
204 default:
Roman Zippel6ff58012007-05-01 22:32:43 +0200205 unknown = 1;
206 }
207 return unknown;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208}
209
210 /*
211 * Identify builtin hardware
212 */
213
214static void __init amiga_identify(void)
215{
Roman Zippel6ff58012007-05-01 22:32:43 +0200216 /* Fill in some default values, if necessary */
217 if (amiga_eclock == 0)
218 amiga_eclock = 709379;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219
Roman Zippel6ff58012007-05-01 22:32:43 +0200220 memset(&amiga_hw_present, 0, sizeof(amiga_hw_present));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221
Roman Zippel6ff58012007-05-01 22:32:43 +0200222 printk("Amiga hardware found: ");
223 if (amiga_model >= AMI_500 && amiga_model <= AMI_DRACO) {
224 printk("[%s] ", amiga_models[amiga_model-AMI_500]);
225 strcat(amiga_model_name, amiga_models[amiga_model-AMI_500]);
226 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700227
Roman Zippel6ff58012007-05-01 22:32:43 +0200228 switch (amiga_model) {
229 case AMI_UNKNOWN:
230 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231
Roman Zippel6ff58012007-05-01 22:32:43 +0200232 case AMI_600:
233 case AMI_1200:
234 AMIGAHW_SET(A1200_IDE);
235 AMIGAHW_SET(PCMCIA);
236 case AMI_500:
237 case AMI_500PLUS:
238 case AMI_1000:
239 case AMI_2000:
240 case AMI_2500:
241 AMIGAHW_SET(A2000_CLK); /* Is this correct for all models? */
242 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243
Roman Zippel6ff58012007-05-01 22:32:43 +0200244 case AMI_3000:
245 case AMI_3000T:
246 AMIGAHW_SET(AMBER_FF);
247 AMIGAHW_SET(MAGIC_REKICK);
248 /* fall through */
249 case AMI_3000PLUS:
250 AMIGAHW_SET(A3000_SCSI);
251 AMIGAHW_SET(A3000_CLK);
252 AMIGAHW_SET(ZORRO3);
253 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254
Roman Zippel6ff58012007-05-01 22:32:43 +0200255 case AMI_4000T:
256 AMIGAHW_SET(A4000_SCSI);
257 /* fall through */
258 case AMI_4000:
259 AMIGAHW_SET(A4000_IDE);
260 AMIGAHW_SET(A3000_CLK);
261 AMIGAHW_SET(ZORRO3);
262 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263
Roman Zippel6ff58012007-05-01 22:32:43 +0200264 case AMI_CDTV:
265 case AMI_CD32:
266 AMIGAHW_SET(CD_ROM);
267 AMIGAHW_SET(A2000_CLK); /* Is this correct? */
268 goto Generic;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269
Roman Zippel6ff58012007-05-01 22:32:43 +0200270 Generic:
271 AMIGAHW_SET(AMI_VIDEO);
272 AMIGAHW_SET(AMI_BLITTER);
273 AMIGAHW_SET(AMI_AUDIO);
274 AMIGAHW_SET(AMI_FLOPPY);
275 AMIGAHW_SET(AMI_KEYBOARD);
276 AMIGAHW_SET(AMI_MOUSE);
277 AMIGAHW_SET(AMI_SERIAL);
278 AMIGAHW_SET(AMI_PARALLEL);
279 AMIGAHW_SET(CHIP_RAM);
280 AMIGAHW_SET(PAULA);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281
Roman Zippel6ff58012007-05-01 22:32:43 +0200282 switch (amiga_chipset) {
283 case CS_OCS:
284 case CS_ECS:
285 case CS_AGA:
286 switch (amiga_custom.deniseid & 0xf) {
287 case 0x0c:
288 AMIGAHW_SET(DENISE_HR);
289 break;
290 case 0x08:
291 AMIGAHW_SET(LISA);
292 break;
293 }
294 break;
295 default:
296 AMIGAHW_SET(DENISE);
297 break;
298 }
299 switch ((amiga_custom.vposr>>8) & 0x7f) {
300 case 0x00:
301 AMIGAHW_SET(AGNUS_PAL);
302 break;
303 case 0x10:
304 AMIGAHW_SET(AGNUS_NTSC);
305 break;
306 case 0x20:
307 case 0x21:
308 AMIGAHW_SET(AGNUS_HR_PAL);
309 break;
310 case 0x30:
311 case 0x31:
312 AMIGAHW_SET(AGNUS_HR_NTSC);
313 break;
314 case 0x22:
315 case 0x23:
316 AMIGAHW_SET(ALICE_PAL);
317 break;
318 case 0x32:
319 case 0x33:
320 AMIGAHW_SET(ALICE_NTSC);
321 break;
322 }
323 AMIGAHW_SET(ZORRO);
324 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325
Roman Zippel6ff58012007-05-01 22:32:43 +0200326 case AMI_DRACO:
327 panic("No support for Draco yet");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328
Roman Zippel6ff58012007-05-01 22:32:43 +0200329 default:
330 panic("Unknown Amiga Model");
331 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332
Roman Zippel6ff58012007-05-01 22:32:43 +0200333#define AMIGAHW_ANNOUNCE(name, str) \
334 if (AMIGAHW_PRESENT(name)) \
335 printk(str)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336
Roman Zippel6ff58012007-05-01 22:32:43 +0200337 AMIGAHW_ANNOUNCE(AMI_VIDEO, "VIDEO ");
338 AMIGAHW_ANNOUNCE(AMI_BLITTER, "BLITTER ");
339 AMIGAHW_ANNOUNCE(AMBER_FF, "AMBER_FF ");
340 AMIGAHW_ANNOUNCE(AMI_AUDIO, "AUDIO ");
341 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "FLOPPY ");
342 AMIGAHW_ANNOUNCE(A3000_SCSI, "A3000_SCSI ");
343 AMIGAHW_ANNOUNCE(A4000_SCSI, "A4000_SCSI ");
344 AMIGAHW_ANNOUNCE(A1200_IDE, "A1200_IDE ");
345 AMIGAHW_ANNOUNCE(A4000_IDE, "A4000_IDE ");
346 AMIGAHW_ANNOUNCE(CD_ROM, "CD_ROM ");
347 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "KEYBOARD ");
348 AMIGAHW_ANNOUNCE(AMI_MOUSE, "MOUSE ");
349 AMIGAHW_ANNOUNCE(AMI_SERIAL, "SERIAL ");
350 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "PARALLEL ");
351 AMIGAHW_ANNOUNCE(A2000_CLK, "A2000_CLK ");
352 AMIGAHW_ANNOUNCE(A3000_CLK, "A3000_CLK ");
353 AMIGAHW_ANNOUNCE(CHIP_RAM, "CHIP_RAM ");
354 AMIGAHW_ANNOUNCE(PAULA, "PAULA ");
355 AMIGAHW_ANNOUNCE(DENISE, "DENISE ");
356 AMIGAHW_ANNOUNCE(DENISE_HR, "DENISE_HR ");
357 AMIGAHW_ANNOUNCE(LISA, "LISA ");
358 AMIGAHW_ANNOUNCE(AGNUS_PAL, "AGNUS_PAL ");
359 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "AGNUS_NTSC ");
360 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "AGNUS_HR_PAL ");
361 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "AGNUS_HR_NTSC ");
362 AMIGAHW_ANNOUNCE(ALICE_PAL, "ALICE_PAL ");
363 AMIGAHW_ANNOUNCE(ALICE_NTSC, "ALICE_NTSC ");
364 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "MAGIC_REKICK ");
365 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA ");
366 if (AMIGAHW_PRESENT(ZORRO))
367 printk("ZORRO%s ", AMIGAHW_PRESENT(ZORRO3) ? "3" : "");
368 printk("\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369
370#undef AMIGAHW_ANNOUNCE
371}
372
373 /*
374 * Setup the Amiga configuration info
375 */
376
377void __init config_amiga(void)
378{
Roman Zippel6ff58012007-05-01 22:32:43 +0200379 int i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380
Roman Zippel6ff58012007-05-01 22:32:43 +0200381 amiga_identify();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382
Roman Zippel6ff58012007-05-01 22:32:43 +0200383 /* Yuk, we don't have PCI memory */
384 iomem_resource.name = "Memory";
385 for (i = 0; i < 4; i++)
386 request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387
Roman Zippel6ff58012007-05-01 22:32:43 +0200388 mach_sched_init = amiga_sched_init;
389 mach_init_IRQ = amiga_init_IRQ;
390 mach_get_model = amiga_get_model;
391 mach_get_hardware_list = amiga_get_hardware_list;
392 mach_gettimeoffset = amiga_gettimeoffset;
393 if (AMIGAHW_PRESENT(A3000_CLK)) {
394 mach_hwclk = a3000_hwclk;
395 rtc_resource.name = "A3000 RTC";
396 request_resource(&iomem_resource, &rtc_resource);
397 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
398 mach_hwclk = a2000_hwclk;
399 rtc_resource.name = "A2000 RTC";
400 request_resource(&iomem_resource, &rtc_resource);
401 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700402
Roman Zippel6ff58012007-05-01 22:32:43 +0200403 /*
404 * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI
405 * code will not be able to allocate any mem for transfers, unless we are
406 * dealing with a Z2 mem only system. /Jes
407 */
408 mach_max_dma_address = 0xffffffff;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409
Roman Zippel6ff58012007-05-01 22:32:43 +0200410 mach_set_clock_mmss = amiga_set_clock_mmss;
411 mach_get_ss = amiga_get_ss;
412 mach_reset = amiga_reset;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700413#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
Roman Zippel6ff58012007-05-01 22:32:43 +0200414 mach_beep = amiga_mksound;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700415#endif
416
417#ifdef CONFIG_HEARTBEAT
Roman Zippel6ff58012007-05-01 22:32:43 +0200418 mach_heartbeat = amiga_heartbeat;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419#endif
420
Roman Zippel6ff58012007-05-01 22:32:43 +0200421 /* Fill in the clock values (based on the 700 kHz E-Clock) */
422 amiga_masterclock = 40*amiga_eclock; /* 28 MHz */
423 amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424
Roman Zippel6ff58012007-05-01 22:32:43 +0200425 /* clear all DMA bits */
426 amiga_custom.dmacon = DMAF_ALL;
427 /* ensure that the DMA master bit is set */
428 amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429
Roman Zippel6ff58012007-05-01 22:32:43 +0200430 /* don't use Z2 RAM as system memory on Z3 capable machines */
431 if (AMIGAHW_PRESENT(ZORRO3)) {
432 int i, j;
433 u32 disabled_z2mem = 0;
434
435 for (i = 0; i < m68k_num_memory; i++) {
436 if (m68k_memory[i].addr < 16*1024*1024) {
437 if (i == 0) {
438 /* don't cut off the branch we're sitting on */
439 printk("Warning: kernel runs in Zorro II memory\n");
440 continue;
441 }
442 disabled_z2mem += m68k_memory[i].size;
443 m68k_num_memory--;
444 for (j = i; j < m68k_num_memory; j++)
445 m68k_memory[j] = m68k_memory[j+1];
446 i--;
447 }
448 }
449 if (disabled_z2mem)
450 printk("%dK of Zorro II memory will not be used as system memory\n",
451 disabled_z2mem>>10);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700453
Roman Zippel6ff58012007-05-01 22:32:43 +0200454 /* request all RAM */
455 for (i = 0; i < m68k_num_memory; i++) {
456 ram_resource[i].name =
457 (m68k_memory[i].addr >= 0x01000000) ? "32-bit Fast RAM" :
458 (m68k_memory[i].addr < 0x00c00000) ? "16-bit Fast RAM" :
459 "16-bit Slow RAM";
460 ram_resource[i].start = m68k_memory[i].addr;
461 ram_resource[i].end = m68k_memory[i].addr+m68k_memory[i].size-1;
462 request_resource(&iomem_resource, &ram_resource[i]);
463 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464
Roman Zippel6ff58012007-05-01 22:32:43 +0200465 /* initialize chipram allocator */
466 amiga_chip_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467
Roman Zippel6ff58012007-05-01 22:32:43 +0200468 /* our beloved beeper */
469 if (AMIGAHW_PRESENT(AMI_AUDIO))
470 amiga_init_sound();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471
Roman Zippel6ff58012007-05-01 22:32:43 +0200472 /*
473 * if it is an A3000, set the magic bit that forces
474 * a hard rekick
475 */
476 if (AMIGAHW_PRESENT(MAGIC_REKICK))
477 *(unsigned char *)ZTWO_VADDR(0xde0002) |= 0x80;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478}
479
480static unsigned short jiffy_ticks;
481
David Howells40220c12006-10-09 12:19:47 +0100482static void __init amiga_sched_init(irq_handler_t timer_routine)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483{
484 static struct resource sched_res = {
Roman Zippel6ff58012007-05-01 22:32:43 +0200485 .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700486 };
487 jiffy_ticks = (amiga_eclock+HZ/2)/HZ;
488
489 if (request_resource(&mb_resources._ciab, &sched_res))
Roman Zippel6ff58012007-05-01 22:32:43 +0200490 printk("Cannot allocate ciab.ta{lo,hi}\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700491 ciab.cra &= 0xC0; /* turn off timer A, continuous mode, from Eclk */
492 ciab.talo = jiffy_ticks % 256;
493 ciab.tahi = jiffy_ticks / 256;
494
495 /* install interrupt service routine for CIAB Timer A
496 *
497 * Please don't change this to use ciaa, as it interferes with the
498 * SCSI code. We'll have to take a look at this later
499 */
500 request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL);
501 /* start timer */
502 ciab.cra |= 0x11;
503}
504
505#define TICK_SIZE 10000
506
507/* This is always executed with interrupts disabled. */
Roman Zippel6ff58012007-05-01 22:32:43 +0200508static unsigned long amiga_gettimeoffset(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700509{
510 unsigned short hi, lo, hi2;
511 unsigned long ticks, offset = 0;
512
513 /* read CIA B timer A current value */
514 hi = ciab.tahi;
515 lo = ciab.talo;
516 hi2 = ciab.tahi;
517
518 if (hi != hi2) {
519 lo = ciab.talo;
520 hi = hi2;
521 }
522
523 ticks = hi << 8 | lo;
524
525 if (ticks > jiffy_ticks / 2)
526 /* check for pending interrupt */
527 if (cia_set_irq(&ciab_base, 0) & CIA_ICR_TA)
528 offset = 10000;
529
530 ticks = jiffy_ticks - ticks;
531 ticks = (10000 * ticks) / jiffy_ticks;
532
533 return ticks + offset;
534}
535
536static int a3000_hwclk(int op, struct rtc_time *t)
537{
538 tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD;
539
540 if (!op) { /* read */
541 t->tm_sec = tod_3000.second1 * 10 + tod_3000.second2;
542 t->tm_min = tod_3000.minute1 * 10 + tod_3000.minute2;
543 t->tm_hour = tod_3000.hour1 * 10 + tod_3000.hour2;
544 t->tm_mday = tod_3000.day1 * 10 + tod_3000.day2;
545 t->tm_wday = tod_3000.weekday;
546 t->tm_mon = tod_3000.month1 * 10 + tod_3000.month2 - 1;
547 t->tm_year = tod_3000.year1 * 10 + tod_3000.year2;
548 if (t->tm_year <= 69)
549 t->tm_year += 100;
550 } else {
551 tod_3000.second1 = t->tm_sec / 10;
552 tod_3000.second2 = t->tm_sec % 10;
553 tod_3000.minute1 = t->tm_min / 10;
554 tod_3000.minute2 = t->tm_min % 10;
555 tod_3000.hour1 = t->tm_hour / 10;
556 tod_3000.hour2 = t->tm_hour % 10;
557 tod_3000.day1 = t->tm_mday / 10;
558 tod_3000.day2 = t->tm_mday % 10;
559 if (t->tm_wday != -1)
560 tod_3000.weekday = t->tm_wday;
561 tod_3000.month1 = (t->tm_mon + 1) / 10;
562 tod_3000.month2 = (t->tm_mon + 1) % 10;
563 if (t->tm_year >= 100)
564 t->tm_year -= 100;
565 tod_3000.year1 = t->tm_year / 10;
566 tod_3000.year2 = t->tm_year % 10;
567 }
568
569 tod_3000.cntrl1 = TOD3000_CNTRL1_FREE;
570
571 return 0;
572}
573
574static int a2000_hwclk(int op, struct rtc_time *t)
575{
576 int cnt = 5;
577
578 tod_2000.cntrl1 = TOD2000_CNTRL1_HOLD;
579
Roman Zippel6ff58012007-05-01 22:32:43 +0200580 while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) {
581 tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
582 udelay(70);
583 tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700584 }
585
586 if (!cnt)
Roman Zippel6ff58012007-05-01 22:32:43 +0200587 printk(KERN_INFO "hwclk: timed out waiting for RTC (0x%x)\n",
588 tod_2000.cntrl1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700589
590 if (!op) { /* read */
591 t->tm_sec = tod_2000.second1 * 10 + tod_2000.second2;
592 t->tm_min = tod_2000.minute1 * 10 + tod_2000.minute2;
593 t->tm_hour = (tod_2000.hour1 & 3) * 10 + tod_2000.hour2;
594 t->tm_mday = tod_2000.day1 * 10 + tod_2000.day2;
595 t->tm_wday = tod_2000.weekday;
596 t->tm_mon = tod_2000.month1 * 10 + tod_2000.month2 - 1;
597 t->tm_year = tod_2000.year1 * 10 + tod_2000.year2;
598 if (t->tm_year <= 69)
599 t->tm_year += 100;
600
Roman Zippel6ff58012007-05-01 22:32:43 +0200601 if (!(tod_2000.cntrl3 & TOD2000_CNTRL3_24HMODE)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700602 if (!(tod_2000.hour1 & TOD2000_HOUR1_PM) && t->tm_hour == 12)
603 t->tm_hour = 0;
604 else if ((tod_2000.hour1 & TOD2000_HOUR1_PM) && t->tm_hour != 12)
605 t->tm_hour += 12;
606 }
607 } else {
608 tod_2000.second1 = t->tm_sec / 10;
609 tod_2000.second2 = t->tm_sec % 10;
610 tod_2000.minute1 = t->tm_min / 10;
611 tod_2000.minute2 = t->tm_min % 10;
612 if (tod_2000.cntrl3 & TOD2000_CNTRL3_24HMODE)
613 tod_2000.hour1 = t->tm_hour / 10;
614 else if (t->tm_hour >= 12)
615 tod_2000.hour1 = TOD2000_HOUR1_PM +
616 (t->tm_hour - 12) / 10;
617 else
618 tod_2000.hour1 = t->tm_hour / 10;
619 tod_2000.hour2 = t->tm_hour % 10;
620 tod_2000.day1 = t->tm_mday / 10;
621 tod_2000.day2 = t->tm_mday % 10;
622 if (t->tm_wday != -1)
623 tod_2000.weekday = t->tm_wday;
624 tod_2000.month1 = (t->tm_mon + 1) / 10;
625 tod_2000.month2 = (t->tm_mon + 1) % 10;
626 if (t->tm_year >= 100)
627 t->tm_year -= 100;
628 tod_2000.year1 = t->tm_year / 10;
629 tod_2000.year2 = t->tm_year % 10;
630 }
631
632 tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
633
634 return 0;
635}
636
Roman Zippel6ff58012007-05-01 22:32:43 +0200637static int amiga_set_clock_mmss(unsigned long nowtime)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638{
639 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
640
641 if (AMIGAHW_PRESENT(A3000_CLK)) {
642 tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD;
643
644 tod_3000.second1 = real_seconds / 10;
645 tod_3000.second2 = real_seconds % 10;
646 tod_3000.minute1 = real_minutes / 10;
647 tod_3000.minute2 = real_minutes % 10;
648
649 tod_3000.cntrl1 = TOD3000_CNTRL1_FREE;
650 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
651 int cnt = 5;
652
653 tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
654
Roman Zippel6ff58012007-05-01 22:32:43 +0200655 while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656 tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
657 udelay(70);
658 tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
659 }
660
661 if (!cnt)
662 printk(KERN_INFO "set_clock_mmss: timed out waiting for RTC (0x%x)\n", tod_2000.cntrl1);
663
664 tod_2000.second1 = real_seconds / 10;
665 tod_2000.second2 = real_seconds % 10;
666 tod_2000.minute1 = real_minutes / 10;
667 tod_2000.minute2 = real_minutes % 10;
668
669 tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
670 }
671
672 return 0;
673}
674
Roman Zippel6ff58012007-05-01 22:32:43 +0200675static unsigned int amiga_get_ss(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700676{
677 unsigned int s;
678
679 if (AMIGAHW_PRESENT(A3000_CLK)) {
680 tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD;
681 s = tod_3000.second1 * 10 + tod_3000.second2;
682 tod_3000.cntrl1 = TOD3000_CNTRL1_FREE;
683 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
684 s = tod_2000.second1 * 10 + tod_2000.second2;
685 }
686 return s;
687}
688
Roman Zippel6ff58012007-05-01 22:32:43 +0200689static NORET_TYPE void amiga_reset(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700690 ATTRIB_NORET;
691
Roman Zippel6ff58012007-05-01 22:32:43 +0200692static void amiga_reset(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700693{
Roman Zippel6ff58012007-05-01 22:32:43 +0200694 unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
695 unsigned long jmp_addr = virt_to_phys(&&jmp_addr_label);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700696
Roman Zippel6ff58012007-05-01 22:32:43 +0200697 local_irq_disable();
698 if (CPU_IS_040_OR_060)
699 /* Setup transparent translation registers for mapping
700 * of 16 MB kernel segment before disabling translation
701 */
702 asm volatile ("\n"
703 " move.l %0,%%d0\n"
704 " and.l #0xff000000,%%d0\n"
705 " or.w #0xe020,%%d0\n" /* map 16 MB, enable, cacheable */
706 " .chip 68040\n"
707 " movec %%d0,%%itt0\n"
708 " movec %%d0,%%dtt0\n"
709 " .chip 68k\n"
710 " jmp %0@\n"
711 : /* no outputs */
712 : "a" (jmp_addr040)
713 : "d0");
714 else
715 /* for 680[23]0, just disable translation and jump to the physical
716 * address of the label
717 */
718 asm volatile ("\n"
719 " pmove %%tc,%@\n"
720 " bclr #7,%@\n"
721 " pmove %@,%%tc\n"
722 " jmp %0@\n"
723 : /* no outputs */
724 : "a" (jmp_addr));
725jmp_addr_label040:
726 /* disable translation on '040 now */
727 asm volatile ("\n"
728 " moveq #0,%%d0\n"
729 " .chip 68040\n"
730 " movec %%d0,%%tc\n" /* disable MMU */
731 " .chip 68k\n"
732 : /* no outputs */
733 : /* no inputs */
734 : "d0");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700735
Roman Zippel6ff58012007-05-01 22:32:43 +0200736 jmp_addr_label:
737 /* pickup reset address from AmigaOS ROM, reset devices and jump
738 * to reset address
739 */
740 asm volatile ("\n"
741 " move.w #0x2700,%sr\n"
742 " lea 0x01000000,%a0\n"
743 " sub.l %a0@(-0x14),%a0\n"
744 " move.l %a0@(4),%a0\n"
745 " subq.l #2,%a0\n"
746 " jra 1f\n"
747 /* align on a longword boundary */
748 " " __ALIGN_STR "\n"
749 "1:\n"
750 " reset\n"
751 " jmp %a0@");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700752
Roman Zippel6ff58012007-05-01 22:32:43 +0200753 for (;;)
754 ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700755}
756
757
758 /*
759 * Debugging
760 */
761
762#define SAVEKMSG_MAXMEM 128*1024
763
764#define SAVEKMSG_MAGIC1 0x53415645 /* 'SAVE' */
765#define SAVEKMSG_MAGIC2 0x4B4D5347 /* 'KMSG' */
766
767struct savekmsg {
Roman Zippel6ff58012007-05-01 22:32:43 +0200768 unsigned long magic1; /* SAVEKMSG_MAGIC1 */
769 unsigned long magic2; /* SAVEKMSG_MAGIC2 */
770 unsigned long magicptr; /* address of magic1 */
771 unsigned long size;
772 char data[0];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700773};
774
775static struct savekmsg *savekmsg;
776
777static void amiga_mem_console_write(struct console *co, const char *s,
778 unsigned int count)
779{
Roman Zippel6ff58012007-05-01 22:32:43 +0200780 if (savekmsg->size + count <= SAVEKMSG_MAXMEM-sizeof(struct savekmsg)) {
781 memcpy(savekmsg->data + savekmsg->size, s, count);
782 savekmsg->size += count;
783 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700784}
785
Roman Zippeld6713b42007-05-01 22:32:45 +0200786static int __init amiga_savekmsg_setup(char *arg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700787{
Roman Zippel6ff58012007-05-01 22:32:43 +0200788 static struct resource debug_res = { .name = "Debug" };
Linus Torvalds1da177e2005-04-16 15:20:36 -0700789
Roman Zippeld6713b42007-05-01 22:32:45 +0200790 if (!MACH_IS_AMIGA || strcmp(arg, "mem"))
791 goto done;
792
793 if (!AMIGAHW_PRESENT(CHIP_RAM)) {
794 printk("Warning: no chipram present for debugging\n");
795 goto done;
796 }
797
Roman Zippel6ff58012007-05-01 22:32:43 +0200798 savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res);
799 savekmsg->magic1 = SAVEKMSG_MAGIC1;
800 savekmsg->magic2 = SAVEKMSG_MAGIC2;
801 savekmsg->magicptr = ZTWO_PADDR(savekmsg);
802 savekmsg->size = 0;
Roman Zippeld6713b42007-05-01 22:32:45 +0200803
804 amiga_console_driver.write = amiga_mem_console_write;
805 register_console(&amiga_console_driver);
806
807done:
808 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700809}
810
Roman Zippeld6713b42007-05-01 22:32:45 +0200811early_param("debug", amiga_savekmsg_setup);
812
Linus Torvalds1da177e2005-04-16 15:20:36 -0700813static void amiga_serial_putc(char c)
814{
Roman Zippel6ff58012007-05-01 22:32:43 +0200815 amiga_custom.serdat = (unsigned char)c | 0x100;
816 while (!(amiga_custom.serdatr & 0x2000))
817 ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700818}
819
820void amiga_serial_console_write(struct console *co, const char *s,
Roman Zippel6ff58012007-05-01 22:32:43 +0200821 unsigned int count)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700822{
Roman Zippel6ff58012007-05-01 22:32:43 +0200823 while (count--) {
824 if (*s == '\n')
825 amiga_serial_putc('\r');
826 amiga_serial_putc(*s++);
827 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700828}
829
830#ifdef CONFIG_SERIAL_CONSOLE
831void amiga_serial_puts(const char *s)
832{
Roman Zippel6ff58012007-05-01 22:32:43 +0200833 amiga_serial_console_write(NULL, s, strlen(s));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700834}
835
836int amiga_serial_console_wait_key(struct console *co)
837{
Roman Zippel6ff58012007-05-01 22:32:43 +0200838 int ch;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700839
Roman Zippel6ff58012007-05-01 22:32:43 +0200840 while (!(amiga_custom.intreqr & IF_RBF))
841 barrier();
842 ch = amiga_custom.serdatr & 0xff;
843 /* clear the interrupt, so that another character can be read */
844 amiga_custom.intreq = IF_RBF;
845 return ch;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700846}
847
848void amiga_serial_gets(struct console *co, char *s, int len)
849{
Roman Zippel6ff58012007-05-01 22:32:43 +0200850 int ch, cnt = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700851
Roman Zippel6ff58012007-05-01 22:32:43 +0200852 while (1) {
853 ch = amiga_serial_console_wait_key(co);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700854
Roman Zippel6ff58012007-05-01 22:32:43 +0200855 /* Check for backspace. */
856 if (ch == 8 || ch == 127) {
857 if (cnt == 0) {
858 amiga_serial_putc('\007');
859 continue;
860 }
861 cnt--;
862 amiga_serial_puts("\010 \010");
863 continue;
864 }
865
866 /* Check for enter. */
867 if (ch == 10 || ch == 13)
868 break;
869
870 /* See if line is too long. */
871 if (cnt >= len + 1) {
872 amiga_serial_putc(7);
873 cnt--;
874 continue;
875 }
876
877 /* Store and echo character. */
878 s[cnt++] = ch;
879 amiga_serial_putc(ch);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700880 }
Roman Zippel6ff58012007-05-01 22:32:43 +0200881 /* Print enter. */
882 amiga_serial_puts("\r\n");
883 s[cnt] = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700884}
885#endif
886
Roman Zippeld6713b42007-05-01 22:32:45 +0200887static int __init amiga_debug_setup(char *arg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700888{
Roman Zippeld6713b42007-05-01 22:32:45 +0200889 if (MACH_IS_AMIGA && !strcmp(arg, "ser")) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700890 /* no initialization required (?) */
891 amiga_console_driver.write = amiga_serial_console_write;
892 register_console(&amiga_console_driver);
893 }
Roman Zippeld6713b42007-05-01 22:32:45 +0200894 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700895}
896
Roman Zippeld6713b42007-05-01 22:32:45 +0200897early_param("debug", amiga_debug_setup);
898
Linus Torvalds1da177e2005-04-16 15:20:36 -0700899#ifdef CONFIG_HEARTBEAT
900static void amiga_heartbeat(int on)
901{
Roman Zippel6ff58012007-05-01 22:32:43 +0200902 if (on)
903 ciaa.pra &= ~2;
904 else
905 ciaa.pra |= 2;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700906}
907#endif
908
909 /*
910 * Amiga specific parts of /proc
911 */
912
913static void amiga_get_model(char *model)
914{
Roman Zippel6ff58012007-05-01 22:32:43 +0200915 strcpy(model, amiga_model_name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700916}
917
918
919static int amiga_get_hardware_list(char *buffer)
920{
Roman Zippel6ff58012007-05-01 22:32:43 +0200921 int len = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700922
Roman Zippel6ff58012007-05-01 22:32:43 +0200923 if (AMIGAHW_PRESENT(CHIP_RAM))
924 len += sprintf(buffer+len, "Chip RAM:\t%ldK\n", amiga_chip_size>>10);
925 len += sprintf(buffer+len, "PS Freq:\t%dHz\nEClock Freq:\t%ldHz\n",
926 amiga_psfreq, amiga_eclock);
927 if (AMIGAHW_PRESENT(AMI_VIDEO)) {
928 char *type;
929 switch (amiga_chipset) {
930 case CS_OCS:
931 type = "OCS";
932 break;
933 case CS_ECS:
934 type = "ECS";
935 break;
936 case CS_AGA:
937 type = "AGA";
938 break;
939 default:
940 type = "Old or Unknown";
941 break;
942 }
943 len += sprintf(buffer+len, "Graphics:\t%s\n", type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700944 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700945
946#define AMIGAHW_ANNOUNCE(name, str) \
Roman Zippel6ff58012007-05-01 22:32:43 +0200947 if (AMIGAHW_PRESENT(name)) \
948 len += sprintf (buffer+len, "\t%s\n", str)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700949
Roman Zippel6ff58012007-05-01 22:32:43 +0200950 len += sprintf (buffer + len, "Detected hardware:\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700951
Roman Zippel6ff58012007-05-01 22:32:43 +0200952 AMIGAHW_ANNOUNCE(AMI_VIDEO, "Amiga Video");
953 AMIGAHW_ANNOUNCE(AMI_BLITTER, "Blitter");
954 AMIGAHW_ANNOUNCE(AMBER_FF, "Amber Flicker Fixer");
955 AMIGAHW_ANNOUNCE(AMI_AUDIO, "Amiga Audio");
956 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "Floppy Controller");
957 AMIGAHW_ANNOUNCE(A3000_SCSI, "SCSI Controller WD33C93 (A3000 style)");
958 AMIGAHW_ANNOUNCE(A4000_SCSI, "SCSI Controller NCR53C710 (A4000T style)");
959 AMIGAHW_ANNOUNCE(A1200_IDE, "IDE Interface (A1200 style)");
960 AMIGAHW_ANNOUNCE(A4000_IDE, "IDE Interface (A4000 style)");
961 AMIGAHW_ANNOUNCE(CD_ROM, "Internal CD ROM drive");
962 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "Keyboard");
963 AMIGAHW_ANNOUNCE(AMI_MOUSE, "Mouse Port");
964 AMIGAHW_ANNOUNCE(AMI_SERIAL, "Serial Port");
965 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "Parallel Port");
966 AMIGAHW_ANNOUNCE(A2000_CLK, "Hardware Clock (A2000 style)");
967 AMIGAHW_ANNOUNCE(A3000_CLK, "Hardware Clock (A3000 style)");
968 AMIGAHW_ANNOUNCE(CHIP_RAM, "Chip RAM");
969 AMIGAHW_ANNOUNCE(PAULA, "Paula 8364");
970 AMIGAHW_ANNOUNCE(DENISE, "Denise 8362");
971 AMIGAHW_ANNOUNCE(DENISE_HR, "Denise 8373");
972 AMIGAHW_ANNOUNCE(LISA, "Lisa 8375");
973 AMIGAHW_ANNOUNCE(AGNUS_PAL, "Normal/Fat PAL Agnus 8367/8371");
974 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "Normal/Fat NTSC Agnus 8361/8370");
975 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "Fat Hires PAL Agnus 8372");
976 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "Fat Hires NTSC Agnus 8372");
977 AMIGAHW_ANNOUNCE(ALICE_PAL, "PAL Alice 8374");
978 AMIGAHW_ANNOUNCE(ALICE_NTSC, "NTSC Alice 8374");
979 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "Magic Hard Rekick");
980 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA Slot");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700981#ifdef CONFIG_ZORRO
Roman Zippel6ff58012007-05-01 22:32:43 +0200982 if (AMIGAHW_PRESENT(ZORRO))
983 len += sprintf(buffer+len, "\tZorro II%s AutoConfig: %d Expansion "
984 "Device%s\n",
985 AMIGAHW_PRESENT(ZORRO3) ? "I" : "",
986 zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700987#endif /* CONFIG_ZORRO */
988
989#undef AMIGAHW_ANNOUNCE
990
Roman Zippel6ff58012007-05-01 22:32:43 +0200991 return len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700992}