in atari/config.c [491:571]
static void atari_reset(void)
{
long tc_val = 0;
long reset_addr;
/*
* On the Medusa, phys. 0x4 may contain garbage because it's no
* ROM. See above for explanation why we cannot use PTOV(4).
*/
reset_addr = MACH_IS_MEDUSA || MACH_IS_AB40 ? 0xe00030 :
*(unsigned long *) 0xff000004;
/* reset ACIA for switch off OverScan, if it's active */
if (atari_switches & ATARI_SWITCH_OVSC_IKBD)
acia.key_ctrl = ACIA_RESET;
if (atari_switches & ATARI_SWITCH_OVSC_MIDI)
acia.mid_ctrl = ACIA_RESET;
/* processor independent: turn off interrupts and reset the VBR;
* the caches must be left enabled, else prefetching the final jump
* instruction doesn't work.
*/
local_irq_disable();
asm volatile ("movec %0,%%vbr"
: : "d" (0));
if (CPU_IS_040_OR_060) {
unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
if (CPU_IS_060) {
/* 68060: clear PCR to turn off superscalar operation */
asm volatile ("\n"
" .chip 68060\n"
" movec %0,%%pcr\n"
" .chip 68k"
: : "d" (0));
}
asm volatile ("\n"
" move.l %0,%%d0\n"
" and.l #0xff000000,%%d0\n"
" or.w #0xe020,%%d0\n" /* map 16 MB, enable, cacheable */
" .chip 68040\n"
" movec %%d0,%%itt0\n"
" movec %%d0,%%dtt0\n"
" .chip 68k\n"
" jmp %0@"
: : "a" (jmp_addr040)
: "d0");
jmp_addr_label040:
asm volatile ("\n"
" moveq #0,%%d0\n"
" nop\n"
" .chip 68040\n"
" cinva %%bc\n"
" nop\n"
" pflusha\n"
" nop\n"
" movec %%d0,%%tc\n"
" nop\n"
/* the following setup of transparent translations is needed on the
* Afterburner040 to successfully reboot. Other machines shouldn't
* care about a different tt regs setup, they also didn't care in
* the past that the regs weren't turned off. */
" move.l #0xffc000,%%d0\n" /* whole insn space cacheable */
" movec %%d0,%%itt0\n"
" movec %%d0,%%itt1\n"
" or.w #0x40,%/d0\n" /* whole data space non-cacheable/ser. */
" movec %%d0,%%dtt0\n"
" movec %%d0,%%dtt1\n"
" .chip 68k\n"
" jmp %0@"
: /* no outputs */
: "a" (reset_addr)
: "d0");
} else
asm volatile ("\n"
" pmove %0,%%tc\n"
" jmp %1@"
: /* no outputs */
: "m" (tc_val), "a" (reset_addr));
}