config.c 19 KB

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