More Makefile cleanups, otherwise mainly noticeable are the netfilter fix
[davej-history.git] / arch / m68k / atari / config.c
blob70a32fb65108766291db9adf97cfee116865fdc6
1 /*
2 * linux/arch/m68k/atari/config.c
4 * Copyright (C) 1994 Bjoern Brauel
6 * 5/2/94 Roman Hodek:
7 * Added setting of time_adj to get a better clock.
9 * 5/14/94 Roman Hodek:
10 * gettod() for TT
12 * 5/15/94 Roman Hodek:
13 * hard_reset_now() for Atari (and others?)
15 * 94/12/30 Andreas Schwab:
16 * atari_sched_init fixed to get precise clock.
18 * This file is subject to the terms and conditions of the GNU General Public
19 * License. See the file COPYING in the main directory of this archive
20 * for more details.
24 * Miscellaneous atari stuff
27 #include <linux/config.h>
28 #include <linux/types.h>
29 #include <linux/mm.h>
30 #include <linux/console.h>
31 #include <linux/init.h>
32 #include <linux/delay.h>
33 #include <linux/ioport.h>
35 #include <asm/bootinfo.h>
36 #include <asm/setup.h>
37 #include <asm/atarihw.h>
38 #include <asm/atariints.h>
39 #include <asm/atari_stram.h>
40 #include <asm/system.h>
41 #include <asm/machdep.h>
42 #include <asm/hwtest.h>
43 #include <asm/io.h>
45 u_long atari_mch_cookie;
46 u_long atari_mch_type = 0;
47 struct atari_hw_present atari_hw_present;
48 u_long atari_switches = 0;
49 int atari_dont_touch_floppy_select = 0;
50 int atari_rtc_year_offset;
52 /* local function prototypes */
53 static void atari_reset( void );
54 #ifdef CONFIG_ATARI_FLOPPY
55 extern void atari_floppy_setup(char *, int *);
56 #endif
57 static void atari_get_model(char *model);
58 static int atari_get_hardware_list(char *buffer);
60 /* atari specific keyboard functions */
61 extern int atari_keyb_init(void);
62 extern int atari_kbdrate (struct kbd_repeat *);
63 extern int atari_kbd_translate(unsigned char keycode, unsigned char *keycodep,
64 char raw_mode);
65 extern void atari_kbd_leds (unsigned int);
66 /* atari specific irq functions */
67 extern void atari_init_IRQ (void);
68 extern int atari_request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
69 unsigned long flags, const char *devname, void *dev_id);
70 extern void atari_free_irq (unsigned int irq, void *dev_id);
71 extern void atari_enable_irq (unsigned int);
72 extern void atari_disable_irq (unsigned int);
73 extern int atari_get_irq_list (char *buf);
74 extern void atari_mksound( unsigned int count, unsigned int ticks );
75 #ifdef CONFIG_HEARTBEAT
76 static void atari_heartbeat( int on );
77 #endif
79 /* atari specific timer functions (in time.c) */
80 extern void atari_sched_init(void (*)(int, void *, struct pt_regs *));
81 extern unsigned long atari_gettimeoffset (void);
82 extern void atari_mste_gettod (int *, int *, int *, int *, int *, int *);
83 extern void atari_tt_gettod (int *, int *, int *, int *, int *, int *);
84 extern int atari_mste_hwclk (int, struct hwclk_time *);
85 extern int atari_tt_hwclk (int, struct hwclk_time *);
86 extern int atari_mste_set_clock_mmss (unsigned long);
87 extern int atari_tt_set_clock_mmss (unsigned long);
89 /* atari specific debug functions (in debug.c) */
90 extern void atari_debug_init(void);
92 #ifdef CONFIG_MAGIC_SYSRQ
93 static char atari_sysrq_xlate[128] =
94 "\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
95 "qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
96 "dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
97 "bnm,./\000\000\000 \000\201\202\203\204\205" /* 0x30 - 0x3f */
98 "\206\207\210\211\212\000\000\000\000\000-\000\000\000+\000"/* 0x40 - 0x4f */
99 "\000\000\000\177\000\000\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
100 "\000\000\000()/*789456123" /* 0x60 - 0x6f */
101 "0.\r\000\000\000\000\000\000\000\000\000\000\000\000\000"; /* 0x70 - 0x7f */
102 #endif
104 extern void (*kd_mksound)(unsigned int, unsigned int);
106 /* I've moved hwreg_present() and hwreg_present_bywrite() out into
107 * mm/hwtest.c, to avoid having multiple copies of the same routine
108 * in the kernel [I wanted them in hp300 and they were already used
109 * in the nubus code. NB: I don't have an Atari so this might (just
110 * conceivably) break something.
111 * I've preserved the #if 0 version of hwreg_present_bywrite() here
112 * for posterity.
113 * -- Peter Maydell <pmaydell@chiark.greenend.org.uk>, 05/1998
116 #if 0
117 static int __init
118 hwreg_present_bywrite(volatile void *regp, unsigned char val)
120 int ret;
121 long save_sp, save_vbr;
122 static long tmp_vectors[3] = { 0, 0, (long)&&after_test };
124 __asm__ __volatile__
125 ( "movec %/vbr,%2\n\t" /* save vbr value */
126 "movec %4,%/vbr\n\t" /* set up temporary vectors */
127 "movel %/sp,%1\n\t" /* save sp */
128 "moveq #0,%0\n\t" /* assume not present */
129 "moveb %5,%3@\n\t" /* write the hardware reg */
130 "cmpb %3@,%5\n\t" /* compare it */
131 "seq %0" /* comes here only if reg */
132 /* is present */
133 : "=d&" (ret), "=r&" (save_sp), "=r&" (save_vbr)
134 : "a" (regp), "r" (tmp_vectors), "d" (val)
136 after_test:
137 __asm__ __volatile__
138 ( "movel %0,%/sp\n\t" /* restore sp */
139 "movec %1,%/vbr" /* restore vbr */
140 : : "r" (save_sp), "r" (save_vbr) : "sp"
143 return( ret );
145 #endif
148 /* ++roman: This is a more elaborate test for an SCC chip, since the plain
149 * Medusa board generates DTACK at the SCC's standard addresses, but a SCC
150 * board in the Medusa is possible. Also, the addresses where the ST_ESCC
151 * resides generate DTACK without the chip, too.
152 * The method is to write values into the interrupt vector register, that
153 * should be readable without trouble (from channel A!).
156 static int __init scc_test( volatile char *ctla )
158 if (!hwreg_present( ctla ))
159 return( 0 );
160 MFPDELAY();
162 *ctla = 2; MFPDELAY();
163 *ctla = 0x40; MFPDELAY();
165 *ctla = 2; MFPDELAY();
166 if (*ctla != 0x40) return( 0 );
167 MFPDELAY();
169 *ctla = 2; MFPDELAY();
170 *ctla = 0x60; MFPDELAY();
172 *ctla = 2; MFPDELAY();
173 if (*ctla != 0x60) return( 0 );
175 return( 1 );
180 * Parse an Atari-specific record in the bootinfo
183 int __init atari_parse_bootinfo(const struct bi_record *record)
185 int unknown = 0;
186 const u_long *data = record->data;
188 switch (record->tag) {
189 case BI_ATARI_MCH_COOKIE:
190 atari_mch_cookie = *data;
191 break;
192 case BI_ATARI_MCH_TYPE:
193 atari_mch_type = *data;
194 break;
195 default:
196 unknown = 1;
198 return(unknown);
202 /* Parse the Atari-specific switches= option. */
203 void __init atari_switches_setup( const char *str, unsigned len )
205 char switches[len+1];
206 char *p;
207 int ovsc_shift;
209 /* copy string to local array, strtok works destructively... */
210 strncpy( switches, str, len );
211 switches[len] = 0;
212 atari_switches = 0;
214 /* parse the options */
215 for( p = strtok( switches, "," ); p; p = strtok( NULL, "," ) ) {
216 ovsc_shift = 0;
217 if (strncmp( p, "ov_", 3 ) == 0) {
218 p += 3;
219 ovsc_shift = ATARI_SWITCH_OVSC_SHIFT;
222 if (strcmp( p, "ikbd" ) == 0) {
223 /* RTS line of IKBD ACIA */
224 atari_switches |= ATARI_SWITCH_IKBD << ovsc_shift;
226 else if (strcmp( p, "midi" ) == 0) {
227 /* RTS line of MIDI ACIA */
228 atari_switches |= ATARI_SWITCH_MIDI << ovsc_shift;
230 else if (strcmp( p, "snd6" ) == 0) {
231 atari_switches |= ATARI_SWITCH_SND6 << ovsc_shift;
233 else if (strcmp( p, "snd7" ) == 0) {
234 atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift;
241 * Setup the Atari configuration info
244 void __init config_atari(void)
246 unsigned short tos_version;
248 memset(&atari_hw_present, 0, sizeof(atari_hw_present));
250 atari_debug_init();
252 ioport_resource.end = 0xFFFFFFFF; /* Change size of I/O space from 64KB
253 to 4GB. */
255 mach_sched_init = atari_sched_init;
256 mach_keyb_init = atari_keyb_init;
257 mach_kbdrate = atari_kbdrate;
258 mach_kbd_translate = atari_kbd_translate;
259 SYSRQ_KEY = 0xff;
260 mach_kbd_leds = atari_kbd_leds;
261 mach_init_IRQ = atari_init_IRQ;
262 mach_request_irq = atari_request_irq;
263 mach_free_irq = atari_free_irq;
264 enable_irq = atari_enable_irq;
265 disable_irq = atari_disable_irq;
266 mach_get_model = atari_get_model;
267 mach_get_hardware_list = atari_get_hardware_list;
268 mach_get_irq_list = atari_get_irq_list;
269 mach_gettimeoffset = atari_gettimeoffset;
270 mach_reset = atari_reset;
271 #ifdef CONFIG_ATARI_FLOPPY
272 mach_floppy_setup = atari_floppy_setup;
273 #endif
274 #ifdef CONFIG_DUMMY_CONSOLE
275 conswitchp = &dummy_con;
276 #endif
277 mach_max_dma_address = 0xffffff;
278 kd_mksound = atari_mksound;
279 #ifdef CONFIG_MAGIC_SYSRQ
280 mach_sysrq_key = 98; /* HELP */
281 mach_sysrq_shift_state = 8; /* Alt */
282 mach_sysrq_shift_mask = 0xff; /* all modifiers except CapsLock */
283 mach_sysrq_xlate = atari_sysrq_xlate;
284 #endif
285 #ifdef CONFIG_HEARTBEAT
286 mach_heartbeat = atari_heartbeat;
287 #endif
289 /* Set switches as requested by the user */
290 if (atari_switches & ATARI_SWITCH_IKBD)
291 acia.key_ctrl = ACIA_DIV64 | ACIA_D8N1S | ACIA_RHTID;
292 if (atari_switches & ATARI_SWITCH_MIDI)
293 acia.mid_ctrl = ACIA_DIV16 | ACIA_D8N1S | ACIA_RHTID;
294 if (atari_switches & (ATARI_SWITCH_SND6|ATARI_SWITCH_SND7)) {
295 sound_ym.rd_data_reg_sel = 14;
296 sound_ym.wd_data = sound_ym.rd_data_reg_sel |
297 ((atari_switches&ATARI_SWITCH_SND6) ? 0x40 : 0) |
298 ((atari_switches&ATARI_SWITCH_SND7) ? 0x80 : 0);
301 /* ++bjoern:
302 * Determine hardware present
305 printk( "Atari hardware found: " );
306 if (MACH_IS_MEDUSA || MACH_IS_HADES) {
307 /* There's no Atari video hardware on the Medusa, but all the
308 * addresses below generate a DTACK so no bus error occurs! */
310 else if (hwreg_present( f030_xreg )) {
311 ATARIHW_SET(VIDEL_SHIFTER);
312 printk( "VIDEL " );
313 /* This is a temporary hack: If there is Falcon video
314 * hardware, we assume that the ST-DMA serves SCSI instead of
315 * ACSI. In the future, there should be a better method for
316 * this...
318 ATARIHW_SET(ST_SCSI);
319 printk( "STDMA-SCSI " );
321 else if (hwreg_present( tt_palette )) {
322 ATARIHW_SET(TT_SHIFTER);
323 printk( "TT_SHIFTER " );
325 else if (hwreg_present( &shifter.bas_hi )) {
326 if (hwreg_present( &shifter.bas_lo ) &&
327 (shifter.bas_lo = 0x0aau, shifter.bas_lo == 0x0aau)) {
328 ATARIHW_SET(EXTD_SHIFTER);
329 printk( "EXTD_SHIFTER " );
331 else {
332 ATARIHW_SET(STND_SHIFTER);
333 printk( "STND_SHIFTER " );
336 if (hwreg_present( &mfp.par_dt_reg )) {
337 ATARIHW_SET(ST_MFP);
338 printk( "ST_MFP " );
340 if (hwreg_present( &tt_mfp.par_dt_reg )) {
341 ATARIHW_SET(TT_MFP);
342 printk( "TT_MFP " );
344 if (hwreg_present( &tt_scsi_dma.dma_addr_hi )) {
345 ATARIHW_SET(SCSI_DMA);
346 printk( "TT_SCSI_DMA " );
348 if (!MACH_IS_HADES && hwreg_present( &st_dma.dma_hi )) {
349 ATARIHW_SET(STND_DMA);
350 printk( "STND_DMA " );
352 if (MACH_IS_MEDUSA || /* The ST-DMA address registers aren't readable
353 * on all Medusas, so the test below may fail */
354 (hwreg_present( &st_dma.dma_vhi ) &&
355 (st_dma.dma_vhi = 0x55) && (st_dma.dma_hi = 0xaa) &&
356 st_dma.dma_vhi == 0x55 && st_dma.dma_hi == 0xaa &&
357 (st_dma.dma_vhi = 0xaa) && (st_dma.dma_hi = 0x55) &&
358 st_dma.dma_vhi == 0xaa && st_dma.dma_hi == 0x55)) {
359 ATARIHW_SET(EXTD_DMA);
360 printk( "EXTD_DMA " );
362 if (hwreg_present( &tt_scsi.scsi_data )) {
363 ATARIHW_SET(TT_SCSI);
364 printk( "TT_SCSI " );
366 if (hwreg_present( &sound_ym.rd_data_reg_sel )) {
367 ATARIHW_SET(YM_2149);
368 printk( "YM2149 " );
370 if (!MACH_IS_MEDUSA && !MACH_IS_HADES &&
371 hwreg_present( &tt_dmasnd.ctrl )) {
372 ATARIHW_SET(PCM_8BIT);
373 printk( "PCM " );
375 if (!MACH_IS_HADES && hwreg_present( &codec.unused5 )) {
376 ATARIHW_SET(CODEC);
377 printk( "CODEC " );
379 if (hwreg_present( &dsp56k_host_interface.icr )) {
380 ATARIHW_SET(DSP56K);
381 printk( "DSP56K " );
383 if (hwreg_present( &tt_scc_dma.dma_ctrl ) &&
384 #if 0
385 /* This test sucks! Who knows some better? */
386 (tt_scc_dma.dma_ctrl = 0x01, (tt_scc_dma.dma_ctrl & 1) == 1) &&
387 (tt_scc_dma.dma_ctrl = 0x00, (tt_scc_dma.dma_ctrl & 1) == 0)
388 #else
389 !MACH_IS_MEDUSA && !MACH_IS_HADES
390 #endif
392 ATARIHW_SET(SCC_DMA);
393 printk( "SCC_DMA " );
395 if (scc_test( &scc.cha_a_ctrl )) {
396 ATARIHW_SET(SCC);
397 printk( "SCC " );
399 if (scc_test( &st_escc.cha_b_ctrl )) {
400 ATARIHW_SET( ST_ESCC );
401 printk( "ST_ESCC " );
403 if (MACH_IS_HADES)
405 ATARIHW_SET( VME );
406 printk( "VME " );
408 else if (hwreg_present( &tt_scu.sys_mask )) {
409 ATARIHW_SET(SCU);
410 /* Assume a VME bus if there's a SCU */
411 ATARIHW_SET( VME );
412 printk( "VME SCU " );
414 if (hwreg_present( (void *)(0xffff9210) )) {
415 ATARIHW_SET(ANALOG_JOY);
416 printk( "ANALOG_JOY " );
418 if (!MACH_IS_HADES && hwreg_present( blitter.halftone )) {
419 ATARIHW_SET(BLITTER);
420 printk( "BLITTER " );
422 if (hwreg_present((void *)0xfff00039)) {
423 ATARIHW_SET(IDE);
424 printk( "IDE " );
426 #if 1 /* This maybe wrong */
427 if (!MACH_IS_MEDUSA && !MACH_IS_HADES &&
428 hwreg_present( &tt_microwire.data ) &&
429 hwreg_present( &tt_microwire.mask ) &&
430 (tt_microwire.mask = 0x7ff,
431 udelay(1),
432 tt_microwire.data = MW_LM1992_PSG_HIGH | MW_LM1992_ADDR,
433 udelay(1),
434 tt_microwire.data != 0)) {
435 ATARIHW_SET(MICROWIRE);
436 while (tt_microwire.mask != 0x7ff) ;
437 printk( "MICROWIRE " );
439 #endif
440 if (hwreg_present( &tt_rtc.regsel )) {
441 ATARIHW_SET(TT_CLK);
442 printk( "TT_CLK " );
443 mach_gettod = atari_tt_gettod;
444 mach_hwclk = atari_tt_hwclk;
445 mach_set_clock_mmss = atari_tt_set_clock_mmss;
447 if (!MACH_IS_HADES && hwreg_present( &mste_rtc.sec_ones)) {
448 ATARIHW_SET(MSTE_CLK);
449 printk( "MSTE_CLK ");
450 mach_gettod = atari_mste_gettod;
451 mach_hwclk = atari_mste_hwclk;
452 mach_set_clock_mmss = atari_mste_set_clock_mmss;
454 if (!MACH_IS_MEDUSA && !MACH_IS_HADES &&
455 hwreg_present( &dma_wd.fdc_speed ) &&
456 hwreg_write( &dma_wd.fdc_speed, 0 )) {
457 ATARIHW_SET(FDCSPEED);
458 printk( "FDC_SPEED ");
460 if (!MACH_IS_HADES && !ATARIHW_PRESENT(ST_SCSI)) {
461 ATARIHW_SET(ACSI);
462 printk( "ACSI " );
464 printk("\n");
466 if (CPU_IS_040_OR_060)
467 /* Now it seems to be safe to turn of the tt0 transparent
468 * translation (the one that must not be turned off in
469 * head.S...)
471 __asm__ volatile ("moveq #0,%/d0\n\t"
472 ".chip 68040\n\t"
473 "movec %%d0,%%itt0\n\t"
474 "movec %%d0,%%dtt0\n\t"
475 ".chip 68k"
476 : /* no outputs */
477 : /* no inputs */
478 : "d0");
480 /* allocator for memory that must reside in st-ram */
481 atari_stram_init ();
483 /* Set up a mapping for the VMEbus address region:
485 * VME is either at phys. 0xfexxxxxx (TT) or 0xa00000..0xdfffff
486 * (MegaSTE) In both cases, the whole 16 MB chunk is mapped at
487 * 0xfe000000 virt., because this can be done with a single
488 * transparent translation. On the 68040, lots of often unused
489 * page tables would be needed otherwise. On a MegaSTE or similar,
490 * the highest byte is stripped off by hardware due to the 24 bit
491 * design of the bus.
494 if (CPU_IS_020_OR_030) {
495 unsigned long tt1_val;
496 tt1_val = 0xfe008543; /* Translate 0xfexxxxxx, enable, cache
497 * inhibit, read and write, FDC mask = 3,
498 * FDC val = 4 -> Supervisor only */
499 __asm__ __volatile__ ( ".chip 68030\n\t"
500 "pmove %0@,%/tt1\n\t"
501 ".chip 68k"
502 : : "a" (&tt1_val) );
504 else {
505 __asm__ __volatile__
506 ( "movel %0,%/d0\n\t"
507 ".chip 68040\n\t"
508 "movec %%d0,%%itt1\n\t"
509 "movec %%d0,%%dtt1\n\t"
510 ".chip 68k"
512 : "g" (0xfe00a040) /* Translate 0xfexxxxxx, enable,
513 * supervisor only, non-cacheable/
514 * serialized, writable */
515 : "d0" );
519 /* Fetch tos version at Physical 2 */
520 /* We my not be able to access this address if the kernel is
521 loaded to st ram, since the first page is unmapped. On the
522 Medusa this is always the case and there is nothing we can do
523 about this, so we just assume the smaller offset. For the TT
524 we use the fact that in head.S we have set up a mapping
525 0xFFxxxxxx -> 0x00xxxxxx, so that the first 16MB is accessible
526 in the last 16MB of the address space. */
527 tos_version = (MACH_IS_MEDUSA || MACH_IS_HADES) ?
528 0xfff : *(unsigned short *)0xff000002;
529 atari_rtc_year_offset = (tos_version < 0x306) ? 70 : 68;
532 #ifdef CONFIG_HEARTBEAT
533 static void atari_heartbeat( int on )
535 unsigned char tmp;
536 unsigned long flags;
538 if (atari_dont_touch_floppy_select)
539 return;
541 save_flags(flags);
542 cli();
543 sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
544 tmp = sound_ym.rd_data_reg_sel;
545 sound_ym.wd_data = on ? (tmp & ~0x02) : (tmp | 0x02);
546 restore_flags(flags);
548 #endif
550 /* ++roman:
552 * This function does a reset on machines that lack the ability to
553 * assert the processor's _RESET signal somehow via hardware. It is
554 * based on the fact that you can find the initial SP and PC values
555 * after a reset at physical addresses 0 and 4. This works pretty well
556 * for Atari machines, since the lowest 8 bytes of physical memory are
557 * really ROM (mapped by hardware). For other 680x0 machines: don't
558 * know if it works...
560 * To get the values at addresses 0 and 4, the MMU better is turned
561 * off first. After that, we have to jump into physical address space
562 * (the PC before the pmove statement points to the virtual address of
563 * the code). Getting that physical address is not hard, but the code
564 * becomes a bit complex since I've tried to ensure that the jump
565 * statement after the pmove is in the cache already (otherwise the
566 * processor can't fetch it!). For that, the code first jumps to the
567 * jump statement with the (virtual) address of the pmove section in
568 * an address register . The jump statement is surely in the cache
569 * now. After that, that physical address of the reset code is loaded
570 * into the same address register, pmove is done and the same jump
571 * statements goes to the reset code. Since there are not many
572 * statements between the two jumps, I hope it stays in the cache.
574 * The C code makes heavy use of the GCC features that you can get the
575 * address of a C label. No hope to compile this with another compiler
576 * than GCC!
579 /* ++andreas: no need for complicated code, just depend on prefetch */
581 static void atari_reset (void)
583 long tc_val = 0;
584 long reset_addr;
586 /* On the Medusa, phys. 0x4 may contain garbage because it's no
587 ROM. See above for explanation why we cannot use PTOV(4). */
588 reset_addr = MACH_IS_HADES ? 0x7fe00030 :
589 MACH_IS_MEDUSA || MACH_IS_AB40 ? 0xe00030 :
590 *(unsigned long *) 0xff000004;
592 /* reset ACIA for switch off OverScan, if it's active */
593 if (atari_switches & ATARI_SWITCH_OVSC_IKBD)
594 acia.key_ctrl = ACIA_RESET;
595 if (atari_switches & ATARI_SWITCH_OVSC_MIDI)
596 acia.mid_ctrl = ACIA_RESET;
598 /* processor independent: turn off interrupts and reset the VBR;
599 * the caches must be left enabled, else prefetching the final jump
600 * instruction doesn't work. */
601 cli();
602 __asm__ __volatile__
603 ("moveq #0,%/d0\n\t"
604 "movec %/d0,%/vbr"
605 : : : "d0" );
607 if (CPU_IS_040_OR_060) {
608 unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
609 if (CPU_IS_060) {
610 /* 68060: clear PCR to turn off superscalar operation */
611 __asm__ __volatile__
612 ("moveq #0,%/d0\n\t"
613 ".chip 68060\n\t"
614 "movec %%d0,%%pcr\n\t"
615 ".chip 68k"
616 : : : "d0" );
619 __asm__ __volatile__
620 ("movel %0,%/d0\n\t"
621 "andl #0xff000000,%/d0\n\t"
622 "orw #0xe020,%/d0\n\t" /* map 16 MB, enable, cacheable */
623 ".chip 68040\n\t"
624 "movec %%d0,%%itt0\n\t"
625 "movec %%d0,%%dtt0\n\t"
626 ".chip 68k\n\t"
627 "jmp %0@\n\t"
628 : /* no outputs */
629 : "a" (jmp_addr040)
630 : "d0" );
631 jmp_addr_label040:
632 __asm__ __volatile__
633 ("moveq #0,%/d0\n\t"
634 "nop\n\t"
635 ".chip 68040\n\t"
636 "cinva %%bc\n\t"
637 "nop\n\t"
638 "pflusha\n\t"
639 "nop\n\t"
640 "movec %%d0,%%tc\n\t"
641 "nop\n\t"
642 /* the following setup of transparent translations is needed on the
643 * Afterburner040 to successfully reboot. Other machines shouldn't
644 * care about a different tt regs setup, they also didn't care in
645 * the past that the regs weren't turned off. */
646 "movel #0xffc000,%%d0\n\t" /* whole insn space cacheable */
647 "movec %%d0,%%itt0\n\t"
648 "movec %%d0,%%itt1\n\t"
649 "orw #0x40,%/d0\n\t" /* whole data space non-cacheable/ser. */
650 "movec %%d0,%%dtt0\n\t"
651 "movec %%d0,%%dtt1\n\t"
652 ".chip 68k\n\t"
653 "jmp %0@"
654 : /* no outputs */
655 : "a" (reset_addr)
656 : "d0");
658 else
659 __asm__ __volatile__
660 ("pmove %0@,%/tc\n\t"
661 "jmp %1@"
662 : /* no outputs */
663 : "a" (&tc_val), "a" (reset_addr));
667 static void atari_get_model(char *model)
669 strcpy(model, "Atari ");
670 switch (atari_mch_cookie >> 16) {
671 case ATARI_MCH_ST:
672 if (ATARIHW_PRESENT(MSTE_CLK))
673 strcat (model, "Mega ST");
674 else
675 strcat (model, "ST");
676 break;
677 case ATARI_MCH_STE:
678 if (MACH_IS_MSTE)
679 strcat (model, "Mega STE");
680 else
681 strcat (model, "STE");
682 break;
683 case ATARI_MCH_TT:
684 if (MACH_IS_MEDUSA)
685 /* Medusa has TT _MCH cookie */
686 strcat (model, "Medusa");
687 else if (MACH_IS_HADES)
688 strcat(model, "Hades");
689 else
690 strcat (model, "TT");
691 break;
692 case ATARI_MCH_FALCON:
693 strcat (model, "Falcon");
694 if (MACH_IS_AB40)
695 strcat (model, " (with Afterburner040)");
696 break;
697 default:
698 sprintf (model + strlen (model), "(unknown mach cookie 0x%lx)",
699 atari_mch_cookie);
700 break;
705 static int atari_get_hardware_list(char *buffer)
707 int len = 0, i;
709 for (i = 0; i < m68k_num_memory; i++)
710 len += sprintf (buffer+len, "\t%3ld MB at 0x%08lx (%s)\n",
711 m68k_memory[i].size >> 20, m68k_memory[i].addr,
712 (m68k_memory[i].addr & 0xff000000 ?
713 "alternate RAM" : "ST-RAM"));
715 #define ATARIHW_ANNOUNCE(name,str) \
716 if (ATARIHW_PRESENT(name)) \
717 len += sprintf (buffer + len, "\t%s\n", str)
719 len += sprintf (buffer + len, "Detected hardware:\n");
720 ATARIHW_ANNOUNCE(STND_SHIFTER, "ST Shifter");
721 ATARIHW_ANNOUNCE(EXTD_SHIFTER, "STe Shifter");
722 ATARIHW_ANNOUNCE(TT_SHIFTER, "TT Shifter");
723 ATARIHW_ANNOUNCE(VIDEL_SHIFTER, "Falcon Shifter");
724 ATARIHW_ANNOUNCE(YM_2149, "Programmable Sound Generator");
725 ATARIHW_ANNOUNCE(PCM_8BIT, "PCM 8 Bit Sound");
726 ATARIHW_ANNOUNCE(CODEC, "CODEC Sound");
727 ATARIHW_ANNOUNCE(TT_SCSI, "SCSI Controller NCR5380 (TT style)");
728 ATARIHW_ANNOUNCE(ST_SCSI, "SCSI Controller NCR5380 (Falcon style)");
729 ATARIHW_ANNOUNCE(ACSI, "ACSI Interface");
730 ATARIHW_ANNOUNCE(IDE, "IDE Interface");
731 ATARIHW_ANNOUNCE(FDCSPEED, "8/16 Mhz Switch for FDC");
732 ATARIHW_ANNOUNCE(ST_MFP, "Multi Function Peripheral MFP 68901");
733 ATARIHW_ANNOUNCE(TT_MFP, "Second Multi Function Peripheral MFP 68901");
734 ATARIHW_ANNOUNCE(SCC, "Serial Communications Controller SCC 8530");
735 ATARIHW_ANNOUNCE(ST_ESCC, "Extended Serial Communications Controller SCC 85230");
736 ATARIHW_ANNOUNCE(ANALOG_JOY, "Paddle Interface");
737 ATARIHW_ANNOUNCE(MICROWIRE, "MICROWIRE(tm) Interface");
738 ATARIHW_ANNOUNCE(STND_DMA, "DMA Controller (24 bit)");
739 ATARIHW_ANNOUNCE(EXTD_DMA, "DMA Controller (32 bit)");
740 ATARIHW_ANNOUNCE(SCSI_DMA, "DMA Controller for NCR5380");
741 ATARIHW_ANNOUNCE(SCC_DMA, "DMA Controller for SCC");
742 ATARIHW_ANNOUNCE(TT_CLK, "Clock Chip MC146818A");
743 ATARIHW_ANNOUNCE(MSTE_CLK, "Clock Chip RP5C15");
744 ATARIHW_ANNOUNCE(SCU, "System Control Unit");
745 ATARIHW_ANNOUNCE(BLITTER, "Blitter");
746 ATARIHW_ANNOUNCE(VME, "VME Bus");
747 ATARIHW_ANNOUNCE(DSP56K, "DSP56001 processor");
749 return(len);
753 * Local variables:
754 * c-indent-level: 4
755 * tab-width: 8
756 * End: