config.c 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. /*
  2. * linux/arch/m68k/atari/config.c
  3. *
  4. * Copyright (C) 1994 Bjoern Brauel
  5. *
  6. * 5/2/94 Roman Hodek:
  7. * Added setting of time_adj to get a better clock.
  8. *
  9. * 5/14/94 Roman Hodek:
  10. * gettod() for TT
  11. *
  12. * 5/15/94 Roman Hodek:
  13. * hard_reset_now() for Atari (and others?)
  14. *
  15. * 94/12/30 Andreas Schwab:
  16. * atari_sched_init fixed to get precise clock.
  17. *
  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.
  21. */
  22. /*
  23. * Miscellaneous atari stuff
  24. */
  25. #include <linux/types.h>
  26. #include <linux/mm.h>
  27. #include <linux/console.h>
  28. #include <linux/init.h>
  29. #include <linux/delay.h>
  30. #include <linux/ioport.h>
  31. #include <linux/vt_kern.h>
  32. #include <asm/bootinfo.h>
  33. #include <asm/setup.h>
  34. #include <asm/atarihw.h>
  35. #include <asm/atariints.h>
  36. #include <asm/atari_stram.h>
  37. #include <asm/system.h>
  38. #include <asm/machdep.h>
  39. #include <asm/hwtest.h>
  40. #include <asm/io.h>
  41. u_long atari_mch_cookie;
  42. u_long atari_mch_type;
  43. struct atari_hw_present atari_hw_present;
  44. u_long atari_switches;
  45. int atari_dont_touch_floppy_select;
  46. int atari_rtc_year_offset;
  47. /* local function prototypes */
  48. static void atari_reset( void );
  49. static void atari_get_model(char *model);
  50. static int atari_get_hardware_list(char *buffer);
  51. /* atari specific irq functions */
  52. extern void atari_init_IRQ (void);
  53. extern void atari_mksound( unsigned int count, unsigned int ticks );
  54. #ifdef CONFIG_HEARTBEAT
  55. static void atari_heartbeat( int on );
  56. #endif
  57. /* atari specific timer functions (in time.c) */
  58. extern void atari_sched_init(irq_handler_t );
  59. extern unsigned long atari_gettimeoffset (void);
  60. extern int atari_mste_hwclk (int, struct rtc_time *);
  61. extern int atari_tt_hwclk (int, struct rtc_time *);
  62. extern int atari_mste_set_clock_mmss (unsigned long);
  63. extern int atari_tt_set_clock_mmss (unsigned long);
  64. /* atari specific debug functions (in debug.c) */
  65. extern void atari_debug_init(void);
  66. /* I've moved hwreg_present() and hwreg_present_bywrite() out into
  67. * mm/hwtest.c, to avoid having multiple copies of the same routine
  68. * in the kernel [I wanted them in hp300 and they were already used
  69. * in the nubus code. NB: I don't have an Atari so this might (just
  70. * conceivably) break something.
  71. * I've preserved the #if 0 version of hwreg_present_bywrite() here
  72. * for posterity.
  73. * -- Peter Maydell <pmaydell@chiark.greenend.org.uk>, 05/1998
  74. */
  75. #if 0
  76. static int __init
  77. hwreg_present_bywrite(volatile void *regp, unsigned char val)
  78. {
  79. int ret;
  80. long save_sp, save_vbr;
  81. static long tmp_vectors[3] = { [2] = (long)&&after_test };
  82. __asm__ __volatile__
  83. ( "movec %/vbr,%2\n\t" /* save vbr value */
  84. "movec %4,%/vbr\n\t" /* set up temporary vectors */
  85. "movel %/sp,%1\n\t" /* save sp */
  86. "moveq #0,%0\n\t" /* assume not present */
  87. "moveb %5,%3@\n\t" /* write the hardware reg */
  88. "cmpb %3@,%5\n\t" /* compare it */
  89. "seq %0" /* comes here only if reg */
  90. /* is present */
  91. : "=d&" (ret), "=r&" (save_sp), "=r&" (save_vbr)
  92. : "a" (regp), "r" (tmp_vectors), "d" (val)
  93. );
  94. after_test:
  95. __asm__ __volatile__
  96. ( "movel %0,%/sp\n\t" /* restore sp */
  97. "movec %1,%/vbr" /* restore vbr */
  98. : : "r" (save_sp), "r" (save_vbr) : "sp"
  99. );
  100. return( ret );
  101. }
  102. #endif
  103. /* ++roman: This is a more elaborate test for an SCC chip, since the plain
  104. * Medusa board generates DTACK at the SCC's standard addresses, but a SCC
  105. * board in the Medusa is possible. Also, the addresses where the ST_ESCC
  106. * resides generate DTACK without the chip, too.
  107. * The method is to write values into the interrupt vector register, that
  108. * should be readable without trouble (from channel A!).
  109. */
  110. static int __init scc_test( volatile char *ctla )
  111. {
  112. if (!hwreg_present( ctla ))
  113. return( 0 );
  114. MFPDELAY();
  115. *ctla = 2; MFPDELAY();
  116. *ctla = 0x40; MFPDELAY();
  117. *ctla = 2; MFPDELAY();
  118. if (*ctla != 0x40) return( 0 );
  119. MFPDELAY();
  120. *ctla = 2; MFPDELAY();
  121. *ctla = 0x60; MFPDELAY();
  122. *ctla = 2; MFPDELAY();
  123. if (*ctla != 0x60) return( 0 );
  124. return( 1 );
  125. }
  126. /*
  127. * Parse an Atari-specific record in the bootinfo
  128. */
  129. int __init atari_parse_bootinfo(const struct bi_record *record)
  130. {
  131. int unknown = 0;
  132. const u_long *data = record->data;
  133. switch (record->tag) {
  134. case BI_ATARI_MCH_COOKIE:
  135. atari_mch_cookie = *data;
  136. break;
  137. case BI_ATARI_MCH_TYPE:
  138. atari_mch_type = *data;
  139. break;
  140. default:
  141. unknown = 1;
  142. }
  143. return(unknown);
  144. }
  145. /* Parse the Atari-specific switches= option. */
  146. void __init atari_switches_setup( const char *str, unsigned len )
  147. {
  148. char switches[len+1];
  149. char *p;
  150. int ovsc_shift;
  151. char *args = switches;
  152. /* copy string to local array, strsep works destructively... */
  153. strlcpy( switches, str, sizeof(switches) );
  154. atari_switches = 0;
  155. /* parse the options */
  156. while ((p = strsep(&args, ",")) != NULL) {
  157. if (!*p) continue;
  158. ovsc_shift = 0;
  159. if (strncmp( p, "ov_", 3 ) == 0) {
  160. p += 3;
  161. ovsc_shift = ATARI_SWITCH_OVSC_SHIFT;
  162. }
  163. if (strcmp( p, "ikbd" ) == 0) {
  164. /* RTS line of IKBD ACIA */
  165. atari_switches |= ATARI_SWITCH_IKBD << ovsc_shift;
  166. }
  167. else if (strcmp( p, "midi" ) == 0) {
  168. /* RTS line of MIDI ACIA */
  169. atari_switches |= ATARI_SWITCH_MIDI << ovsc_shift;
  170. }
  171. else if (strcmp( p, "snd6" ) == 0) {
  172. atari_switches |= ATARI_SWITCH_SND6 << ovsc_shift;
  173. }
  174. else if (strcmp( p, "snd7" ) == 0) {
  175. atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift;
  176. }
  177. }
  178. }
  179. /*
  180. * Setup the Atari configuration info
  181. */
  182. void __init config_atari(void)
  183. {
  184. unsigned short tos_version;
  185. memset(&atari_hw_present, 0, sizeof(atari_hw_present));
  186. atari_debug_init();
  187. ioport_resource.end = 0xFFFFFFFF; /* Change size of I/O space from 64KB
  188. to 4GB. */
  189. mach_sched_init = atari_sched_init;
  190. mach_init_IRQ = atari_init_IRQ;
  191. mach_get_model = atari_get_model;
  192. mach_get_hardware_list = atari_get_hardware_list;
  193. mach_gettimeoffset = atari_gettimeoffset;
  194. mach_reset = atari_reset;
  195. mach_max_dma_address = 0xffffff;
  196. #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
  197. mach_beep = atari_mksound;
  198. #endif
  199. #ifdef CONFIG_HEARTBEAT
  200. mach_heartbeat = atari_heartbeat;
  201. #endif
  202. /* Set switches as requested by the user */
  203. if (atari_switches & ATARI_SWITCH_IKBD)
  204. acia.key_ctrl = ACIA_DIV64 | ACIA_D8N1S | ACIA_RHTID;
  205. if (atari_switches & ATARI_SWITCH_MIDI)
  206. acia.mid_ctrl = ACIA_DIV16 | ACIA_D8N1S | ACIA_RHTID;
  207. if (atari_switches & (ATARI_SWITCH_SND6|ATARI_SWITCH_SND7)) {
  208. sound_ym.rd_data_reg_sel = 14;
  209. sound_ym.wd_data = sound_ym.rd_data_reg_sel |
  210. ((atari_switches&ATARI_SWITCH_SND6) ? 0x40 : 0) |
  211. ((atari_switches&ATARI_SWITCH_SND7) ? 0x80 : 0);
  212. }
  213. /* ++bjoern:
  214. * Determine hardware present
  215. */
  216. printk( "Atari hardware found: " );
  217. if (MACH_IS_MEDUSA || MACH_IS_HADES) {
  218. /* There's no Atari video hardware on the Medusa, but all the
  219. * addresses below generate a DTACK so no bus error occurs! */
  220. }
  221. else if (hwreg_present( f030_xreg )) {
  222. ATARIHW_SET(VIDEL_SHIFTER);
  223. printk( "VIDEL " );
  224. /* This is a temporary hack: If there is Falcon video
  225. * hardware, we assume that the ST-DMA serves SCSI instead of
  226. * ACSI. In the future, there should be a better method for
  227. * this...
  228. */
  229. ATARIHW_SET(ST_SCSI);
  230. printk( "STDMA-SCSI " );
  231. }
  232. else if (hwreg_present( tt_palette )) {
  233. ATARIHW_SET(TT_SHIFTER);
  234. printk( "TT_SHIFTER " );
  235. }
  236. else if (hwreg_present( &shifter.bas_hi )) {
  237. if (hwreg_present( &shifter.bas_lo ) &&
  238. (shifter.bas_lo = 0x0aau, shifter.bas_lo == 0x0aau)) {
  239. ATARIHW_SET(EXTD_SHIFTER);
  240. printk( "EXTD_SHIFTER " );
  241. }
  242. else {
  243. ATARIHW_SET(STND_SHIFTER);
  244. printk( "STND_SHIFTER " );
  245. }
  246. }
  247. if (hwreg_present( &mfp.par_dt_reg )) {
  248. ATARIHW_SET(ST_MFP);
  249. printk( "ST_MFP " );
  250. }
  251. if (hwreg_present( &tt_mfp.par_dt_reg )) {
  252. ATARIHW_SET(TT_MFP);
  253. printk( "TT_MFP " );
  254. }
  255. if (hwreg_present( &tt_scsi_dma.dma_addr_hi )) {
  256. ATARIHW_SET(SCSI_DMA);
  257. printk( "TT_SCSI_DMA " );
  258. }
  259. if (!MACH_IS_HADES && hwreg_present( &st_dma.dma_hi )) {
  260. ATARIHW_SET(STND_DMA);
  261. printk( "STND_DMA " );
  262. }
  263. if (MACH_IS_MEDUSA || /* The ST-DMA address registers aren't readable
  264. * on all Medusas, so the test below may fail */
  265. (hwreg_present( &st_dma.dma_vhi ) &&
  266. (st_dma.dma_vhi = 0x55) && (st_dma.dma_hi = 0xaa) &&
  267. st_dma.dma_vhi == 0x55 && st_dma.dma_hi == 0xaa &&
  268. (st_dma.dma_vhi = 0xaa) && (st_dma.dma_hi = 0x55) &&
  269. st_dma.dma_vhi == 0xaa && st_dma.dma_hi == 0x55)) {
  270. ATARIHW_SET(EXTD_DMA);
  271. printk( "EXTD_DMA " );
  272. }
  273. if (hwreg_present( &tt_scsi.scsi_data )) {
  274. ATARIHW_SET(TT_SCSI);
  275. printk( "TT_SCSI " );
  276. }
  277. if (hwreg_present( &sound_ym.rd_data_reg_sel )) {
  278. ATARIHW_SET(YM_2149);
  279. printk( "YM2149 " );
  280. }
  281. if (!MACH_IS_MEDUSA && !MACH_IS_HADES &&
  282. hwreg_present( &tt_dmasnd.ctrl )) {
  283. ATARIHW_SET(PCM_8BIT);
  284. printk( "PCM " );
  285. }
  286. if (!MACH_IS_HADES && hwreg_present( &falcon_codec.unused5 )) {
  287. ATARIHW_SET(CODEC);
  288. printk( "CODEC " );
  289. }
  290. if (hwreg_present( &dsp56k_host_interface.icr )) {
  291. ATARIHW_SET(DSP56K);
  292. printk( "DSP56K " );
  293. }
  294. if (hwreg_present( &tt_scc_dma.dma_ctrl ) &&
  295. #if 0
  296. /* This test sucks! Who knows some better? */
  297. (tt_scc_dma.dma_ctrl = 0x01, (tt_scc_dma.dma_ctrl & 1) == 1) &&
  298. (tt_scc_dma.dma_ctrl = 0x00, (tt_scc_dma.dma_ctrl & 1) == 0)
  299. #else
  300. !MACH_IS_MEDUSA && !MACH_IS_HADES
  301. #endif
  302. ) {
  303. ATARIHW_SET(SCC_DMA);
  304. printk( "SCC_DMA " );
  305. }
  306. if (scc_test( &scc.cha_a_ctrl )) {
  307. ATARIHW_SET(SCC);
  308. printk( "SCC " );
  309. }
  310. if (scc_test( &st_escc.cha_b_ctrl )) {
  311. ATARIHW_SET( ST_ESCC );
  312. printk( "ST_ESCC " );
  313. }
  314. if (MACH_IS_HADES)
  315. {
  316. ATARIHW_SET( VME );
  317. printk( "VME " );
  318. }
  319. else if (hwreg_present( &tt_scu.sys_mask )) {
  320. ATARIHW_SET(SCU);
  321. /* Assume a VME bus if there's a SCU */
  322. ATARIHW_SET( VME );
  323. printk( "VME SCU " );
  324. }
  325. if (hwreg_present( (void *)(0xffff9210) )) {
  326. ATARIHW_SET(ANALOG_JOY);
  327. printk( "ANALOG_JOY " );
  328. }
  329. if (!MACH_IS_HADES && hwreg_present( blitter.halftone )) {
  330. ATARIHW_SET(BLITTER);
  331. printk( "BLITTER " );
  332. }
  333. if (hwreg_present((void *)0xfff00039)) {
  334. ATARIHW_SET(IDE);
  335. printk( "IDE " );
  336. }
  337. #if 1 /* This maybe wrong */
  338. if (!MACH_IS_MEDUSA && !MACH_IS_HADES &&
  339. hwreg_present( &tt_microwire.data ) &&
  340. hwreg_present( &tt_microwire.mask ) &&
  341. (tt_microwire.mask = 0x7ff,
  342. udelay(1),
  343. tt_microwire.data = MW_LM1992_PSG_HIGH | MW_LM1992_ADDR,
  344. udelay(1),
  345. tt_microwire.data != 0)) {
  346. ATARIHW_SET(MICROWIRE);
  347. while (tt_microwire.mask != 0x7ff) ;
  348. printk( "MICROWIRE " );
  349. }
  350. #endif
  351. if (hwreg_present( &tt_rtc.regsel )) {
  352. ATARIHW_SET(TT_CLK);
  353. printk( "TT_CLK " );
  354. mach_hwclk = atari_tt_hwclk;
  355. mach_set_clock_mmss = atari_tt_set_clock_mmss;
  356. }
  357. if (!MACH_IS_HADES && hwreg_present( &mste_rtc.sec_ones)) {
  358. ATARIHW_SET(MSTE_CLK);
  359. printk( "MSTE_CLK ");
  360. mach_hwclk = atari_mste_hwclk;
  361. mach_set_clock_mmss = atari_mste_set_clock_mmss;
  362. }
  363. if (!MACH_IS_MEDUSA && !MACH_IS_HADES &&
  364. hwreg_present( &dma_wd.fdc_speed ) &&
  365. hwreg_write( &dma_wd.fdc_speed, 0 )) {
  366. ATARIHW_SET(FDCSPEED);
  367. printk( "FDC_SPEED ");
  368. }
  369. if (!MACH_IS_HADES && !ATARIHW_PRESENT(ST_SCSI)) {
  370. ATARIHW_SET(ACSI);
  371. printk( "ACSI " );
  372. }
  373. printk("\n");
  374. if (CPU_IS_040_OR_060)
  375. /* Now it seems to be safe to turn of the tt0 transparent
  376. * translation (the one that must not be turned off in
  377. * head.S...)
  378. */
  379. __asm__ volatile ("moveq #0,%/d0\n\t"
  380. ".chip 68040\n\t"
  381. "movec %%d0,%%itt0\n\t"
  382. "movec %%d0,%%dtt0\n\t"
  383. ".chip 68k"
  384. : /* no outputs */
  385. : /* no inputs */
  386. : "d0");
  387. /* allocator for memory that must reside in st-ram */
  388. atari_stram_init ();
  389. /* Set up a mapping for the VMEbus address region:
  390. *
  391. * VME is either at phys. 0xfexxxxxx (TT) or 0xa00000..0xdfffff
  392. * (MegaSTE) In both cases, the whole 16 MB chunk is mapped at
  393. * 0xfe000000 virt., because this can be done with a single
  394. * transparent translation. On the 68040, lots of often unused
  395. * page tables would be needed otherwise. On a MegaSTE or similar,
  396. * the highest byte is stripped off by hardware due to the 24 bit
  397. * design of the bus.
  398. */
  399. if (CPU_IS_020_OR_030) {
  400. unsigned long tt1_val;
  401. tt1_val = 0xfe008543; /* Translate 0xfexxxxxx, enable, cache
  402. * inhibit, read and write, FDC mask = 3,
  403. * FDC val = 4 -> Supervisor only */
  404. __asm__ __volatile__ ( ".chip 68030\n\t"
  405. "pmove %0@,%/tt1\n\t"
  406. ".chip 68k"
  407. : : "a" (&tt1_val) );
  408. }
  409. else {
  410. __asm__ __volatile__
  411. ( "movel %0,%/d0\n\t"
  412. ".chip 68040\n\t"
  413. "movec %%d0,%%itt1\n\t"
  414. "movec %%d0,%%dtt1\n\t"
  415. ".chip 68k"
  416. :
  417. : "g" (0xfe00a040) /* Translate 0xfexxxxxx, enable,
  418. * supervisor only, non-cacheable/
  419. * serialized, writable */
  420. : "d0" );
  421. }
  422. /* Fetch tos version at Physical 2 */
  423. /* We my not be able to access this address if the kernel is
  424. loaded to st ram, since the first page is unmapped. On the
  425. Medusa this is always the case and there is nothing we can do
  426. about this, so we just assume the smaller offset. For the TT
  427. we use the fact that in head.S we have set up a mapping
  428. 0xFFxxxxxx -> 0x00xxxxxx, so that the first 16MB is accessible
  429. in the last 16MB of the address space. */
  430. tos_version = (MACH_IS_MEDUSA || MACH_IS_HADES) ?
  431. 0xfff : *(unsigned short *)0xff000002;
  432. atari_rtc_year_offset = (tos_version < 0x306) ? 70 : 68;
  433. }
  434. #ifdef CONFIG_HEARTBEAT
  435. static void atari_heartbeat( int on )
  436. {
  437. unsigned char tmp;
  438. unsigned long flags;
  439. if (atari_dont_touch_floppy_select)
  440. return;
  441. local_irq_save(flags);
  442. sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
  443. tmp = sound_ym.rd_data_reg_sel;
  444. sound_ym.wd_data = on ? (tmp & ~0x02) : (tmp | 0x02);
  445. local_irq_restore(flags);
  446. }
  447. #endif
  448. /* ++roman:
  449. *
  450. * This function does a reset on machines that lack the ability to
  451. * assert the processor's _RESET signal somehow via hardware. It is
  452. * based on the fact that you can find the initial SP and PC values
  453. * after a reset at physical addresses 0 and 4. This works pretty well
  454. * for Atari machines, since the lowest 8 bytes of physical memory are
  455. * really ROM (mapped by hardware). For other 680x0 machines: don't
  456. * know if it works...
  457. *
  458. * To get the values at addresses 0 and 4, the MMU better is turned
  459. * off first. After that, we have to jump into physical address space
  460. * (the PC before the pmove statement points to the virtual address of
  461. * the code). Getting that physical address is not hard, but the code
  462. * becomes a bit complex since I've tried to ensure that the jump
  463. * statement after the pmove is in the cache already (otherwise the
  464. * processor can't fetch it!). For that, the code first jumps to the
  465. * jump statement with the (virtual) address of the pmove section in
  466. * an address register . The jump statement is surely in the cache
  467. * now. After that, that physical address of the reset code is loaded
  468. * into the same address register, pmove is done and the same jump
  469. * statements goes to the reset code. Since there are not many
  470. * statements between the two jumps, I hope it stays in the cache.
  471. *
  472. * The C code makes heavy use of the GCC features that you can get the
  473. * address of a C label. No hope to compile this with another compiler
  474. * than GCC!
  475. */
  476. /* ++andreas: no need for complicated code, just depend on prefetch */
  477. static void atari_reset (void)
  478. {
  479. long tc_val = 0;
  480. long reset_addr;
  481. /* On the Medusa, phys. 0x4 may contain garbage because it's no
  482. ROM. See above for explanation why we cannot use PTOV(4). */
  483. reset_addr = MACH_IS_HADES ? 0x7fe00030 :
  484. MACH_IS_MEDUSA || MACH_IS_AB40 ? 0xe00030 :
  485. *(unsigned long *) 0xff000004;
  486. /* reset ACIA for switch off OverScan, if it's active */
  487. if (atari_switches & ATARI_SWITCH_OVSC_IKBD)
  488. acia.key_ctrl = ACIA_RESET;
  489. if (atari_switches & ATARI_SWITCH_OVSC_MIDI)
  490. acia.mid_ctrl = ACIA_RESET;
  491. /* processor independent: turn off interrupts and reset the VBR;
  492. * the caches must be left enabled, else prefetching the final jump
  493. * instruction doesn't work. */
  494. local_irq_disable();
  495. __asm__ __volatile__
  496. ("moveq #0,%/d0\n\t"
  497. "movec %/d0,%/vbr"
  498. : : : "d0" );
  499. if (CPU_IS_040_OR_060) {
  500. unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
  501. if (CPU_IS_060) {
  502. /* 68060: clear PCR to turn off superscalar operation */
  503. __asm__ __volatile__
  504. ("moveq #0,%/d0\n\t"
  505. ".chip 68060\n\t"
  506. "movec %%d0,%%pcr\n\t"
  507. ".chip 68k"
  508. : : : "d0" );
  509. }
  510. __asm__ __volatile__
  511. ("movel %0,%/d0\n\t"
  512. "andl #0xff000000,%/d0\n\t"
  513. "orw #0xe020,%/d0\n\t" /* map 16 MB, enable, cacheable */
  514. ".chip 68040\n\t"
  515. "movec %%d0,%%itt0\n\t"
  516. "movec %%d0,%%dtt0\n\t"
  517. ".chip 68k\n\t"
  518. "jmp %0@\n\t"
  519. : /* no outputs */
  520. : "a" (jmp_addr040)
  521. : "d0" );
  522. jmp_addr_label040:
  523. __asm__ __volatile__
  524. ("moveq #0,%/d0\n\t"
  525. "nop\n\t"
  526. ".chip 68040\n\t"
  527. "cinva %%bc\n\t"
  528. "nop\n\t"
  529. "pflusha\n\t"
  530. "nop\n\t"
  531. "movec %%d0,%%tc\n\t"
  532. "nop\n\t"
  533. /* the following setup of transparent translations is needed on the
  534. * Afterburner040 to successfully reboot. Other machines shouldn't
  535. * care about a different tt regs setup, they also didn't care in
  536. * the past that the regs weren't turned off. */
  537. "movel #0xffc000,%%d0\n\t" /* whole insn space cacheable */
  538. "movec %%d0,%%itt0\n\t"
  539. "movec %%d0,%%itt1\n\t"
  540. "orw #0x40,%/d0\n\t" /* whole data space non-cacheable/ser. */
  541. "movec %%d0,%%dtt0\n\t"
  542. "movec %%d0,%%dtt1\n\t"
  543. ".chip 68k\n\t"
  544. "jmp %0@"
  545. : /* no outputs */
  546. : "a" (reset_addr)
  547. : "d0");
  548. }
  549. else
  550. __asm__ __volatile__
  551. ("pmove %0@,%/tc\n\t"
  552. "jmp %1@"
  553. : /* no outputs */
  554. : "a" (&tc_val), "a" (reset_addr));
  555. }
  556. static void atari_get_model(char *model)
  557. {
  558. strcpy(model, "Atari ");
  559. switch (atari_mch_cookie >> 16) {
  560. case ATARI_MCH_ST:
  561. if (ATARIHW_PRESENT(MSTE_CLK))
  562. strcat (model, "Mega ST");
  563. else
  564. strcat (model, "ST");
  565. break;
  566. case ATARI_MCH_STE:
  567. if (MACH_IS_MSTE)
  568. strcat (model, "Mega STE");
  569. else
  570. strcat (model, "STE");
  571. break;
  572. case ATARI_MCH_TT:
  573. if (MACH_IS_MEDUSA)
  574. /* Medusa has TT _MCH cookie */
  575. strcat (model, "Medusa");
  576. else if (MACH_IS_HADES)
  577. strcat(model, "Hades");
  578. else
  579. strcat (model, "TT");
  580. break;
  581. case ATARI_MCH_FALCON:
  582. strcat (model, "Falcon");
  583. if (MACH_IS_AB40)
  584. strcat (model, " (with Afterburner040)");
  585. break;
  586. default:
  587. sprintf (model + strlen (model), "(unknown mach cookie 0x%lx)",
  588. atari_mch_cookie);
  589. break;
  590. }
  591. }
  592. static int atari_get_hardware_list(char *buffer)
  593. {
  594. int len = 0, i;
  595. for (i = 0; i < m68k_num_memory; i++)
  596. len += sprintf (buffer+len, "\t%3ld MB at 0x%08lx (%s)\n",
  597. m68k_memory[i].size >> 20, m68k_memory[i].addr,
  598. (m68k_memory[i].addr & 0xff000000 ?
  599. "alternate RAM" : "ST-RAM"));
  600. #define ATARIHW_ANNOUNCE(name,str) \
  601. if (ATARIHW_PRESENT(name)) \
  602. len += sprintf (buffer + len, "\t%s\n", str)
  603. len += sprintf (buffer + len, "Detected hardware:\n");
  604. ATARIHW_ANNOUNCE(STND_SHIFTER, "ST Shifter");
  605. ATARIHW_ANNOUNCE(EXTD_SHIFTER, "STe Shifter");
  606. ATARIHW_ANNOUNCE(TT_SHIFTER, "TT Shifter");
  607. ATARIHW_ANNOUNCE(VIDEL_SHIFTER, "Falcon Shifter");
  608. ATARIHW_ANNOUNCE(YM_2149, "Programmable Sound Generator");
  609. ATARIHW_ANNOUNCE(PCM_8BIT, "PCM 8 Bit Sound");
  610. ATARIHW_ANNOUNCE(CODEC, "CODEC Sound");
  611. ATARIHW_ANNOUNCE(TT_SCSI, "SCSI Controller NCR5380 (TT style)");
  612. ATARIHW_ANNOUNCE(ST_SCSI, "SCSI Controller NCR5380 (Falcon style)");
  613. ATARIHW_ANNOUNCE(ACSI, "ACSI Interface");
  614. ATARIHW_ANNOUNCE(IDE, "IDE Interface");
  615. ATARIHW_ANNOUNCE(FDCSPEED, "8/16 Mhz Switch for FDC");
  616. ATARIHW_ANNOUNCE(ST_MFP, "Multi Function Peripheral MFP 68901");
  617. ATARIHW_ANNOUNCE(TT_MFP, "Second Multi Function Peripheral MFP 68901");
  618. ATARIHW_ANNOUNCE(SCC, "Serial Communications Controller SCC 8530");
  619. ATARIHW_ANNOUNCE(ST_ESCC, "Extended Serial Communications Controller SCC 85230");
  620. ATARIHW_ANNOUNCE(ANALOG_JOY, "Paddle Interface");
  621. ATARIHW_ANNOUNCE(MICROWIRE, "MICROWIRE(tm) Interface");
  622. ATARIHW_ANNOUNCE(STND_DMA, "DMA Controller (24 bit)");
  623. ATARIHW_ANNOUNCE(EXTD_DMA, "DMA Controller (32 bit)");
  624. ATARIHW_ANNOUNCE(SCSI_DMA, "DMA Controller for NCR5380");
  625. ATARIHW_ANNOUNCE(SCC_DMA, "DMA Controller for SCC");
  626. ATARIHW_ANNOUNCE(TT_CLK, "Clock Chip MC146818A");
  627. ATARIHW_ANNOUNCE(MSTE_CLK, "Clock Chip RP5C15");
  628. ATARIHW_ANNOUNCE(SCU, "System Control Unit");
  629. ATARIHW_ANNOUNCE(BLITTER, "Blitter");
  630. ATARIHW_ANNOUNCE(VME, "VME Bus");
  631. ATARIHW_ANNOUNCE(DSP56K, "DSP56001 processor");
  632. return(len);
  633. }
  634. /*
  635. * Local variables:
  636. * c-indent-level: 4
  637. * tab-width: 8
  638. * End:
  639. */