Re: Atari TT
Michael Schmitz dixit:
>Does the other kernel show any boot progress on the screen at all, after the
>bootstrap has finished loading and passed control to the kernel?
Coloured pixels.
>Can you send me the contents of arch/m68k/atari/config.c and
>arch/m68k/atari/atariints.c from the patched source tree you used for these
>kernels?
Sure:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# ataints.c
# config.c
#
echo x - ataints.c
sed 's/^X//' >ataints.c << 'END-of-ataints.c'
X/*
X * arch/m68k/atari/ataints.c -- Atari Linux interrupt handling code
X *
X * 5/2/94 Roman Hodek:
X * Added support for TT interrupts; setup for TT SCU (may someone has
X * twiddled there and we won't get the right interrupts :-()
X *
X * Major change: The device-independent code in m68k/ints.c didn't know
X * about non-autovec ints yet. It hardcoded the number of possible ints to
X * 7 (IRQ1...IRQ7). But the Atari has lots of non-autovec ints! I made the
X * number of possible ints a constant defined in interrupt.h, which is
X * 47 for the Atari. So we can call request_irq() for all Atari interrupts
X * just the normal way. Additionally, all vectors >= 48 are initialized to
X * call trap() instead of inthandler(). This must be changed here, too.
X *
X * 1995-07-16 Lars Brinkhoff <f93labr@dd.chalmers.se>:
X * Corrected a bug in atari_add_isr() which rejected all SCC
X * interrupt sources if there were no TT MFP!
X *
X * 12/13/95: New interface functions atari_level_triggered_int() and
X * atari_register_vme_int() as support for level triggered VME interrupts.
X *
X * 02/12/96: (Roman)
X * Total rewrite of Atari interrupt handling, for new scheme see comments
X * below.
X *
X * 1996-09-03 lars brinkhoff <f93labr@dd.chalmers.se>:
X * Added new function atari_unregister_vme_int(), and
X * modified atari_register_vme_int() as well as IS_VALID_INTNO()
X * to work with it.
X *
X * This file is subject to the terms and conditions of the GNU General Public
X * License. See the file COPYING in the main directory of this archive
X * for more details.
X *
X */
X
X#include <linux/types.h>
X#include <linux/kernel.h>
X#include <linux/kernel_stat.h>
X#include <linux/init.h>
X#include <linux/seq_file.h>
X#include <linux/module.h>
X
X#include <asm/traps.h>
X
X#include <asm/atarihw.h>
X#include <asm/atariints.h>
X#include <asm/atari_stdma.h>
X#include <asm/irq.h>
X#include <asm/entry.h>
X
X
X/*
X * Atari interrupt handling scheme:
X * --------------------------------
X *
X * All interrupt source have an internal number (defined in
X * <asm/atariints.h>): Autovector interrupts are 1..7, then follow ST-MFP,
X * TT-MFP, SCC, and finally VME interrupts. Vector numbers for the latter can
X * be allocated by atari_register_vme_int().
X */
X
X/*
X * Bitmap for free interrupt vector numbers
X * (new vectors starting from 0x70 can be allocated by
X * atari_register_vme_int())
X */
Xstatic int free_vme_vec_bitmap;
X
X/* GK:
X * HBL IRQ handler for Falcon. Nobody needs it :-)
X * ++andreas: raise ipl to disable further HBLANK interrupts.
X */
Xasmlinkage void falcon_hblhandler(void);
Xasm(".text\n"
X__ALIGN_STR "\n\t"
X"falcon_hblhandler:\n\t"
X "orw #0x200,%sp@\n\t" /* set saved ipl to 2 */
X "rte");
X
Xextern void atari_microwire_cmd(int cmd);
X
Xstatic unsigned int atari_irq_startup(struct irq_data *data)
X{
X unsigned int irq = data->irq;
X
X m68k_irq_startup(data);
X atari_turnon_irq(irq);
X atari_enable_irq(irq);
X return 0;
X}
X
Xstatic void atari_irq_shutdown(struct irq_data *data)
X{
X unsigned int irq = data->irq;
X
X atari_disable_irq(irq);
X atari_turnoff_irq(irq);
X m68k_irq_shutdown(data);
X
X if (irq == IRQ_AUTO_4)
X vectors[VEC_INT4] = falcon_hblhandler;
X}
X
Xstatic void atari_irq_enable(struct irq_data *data)
X{
X atari_enable_irq(data->irq);
X}
X
Xstatic void atari_irq_disable(struct irq_data *data)
X{
X atari_disable_irq(data->irq);
X}
X
Xstatic struct irq_chip atari_irq_chip = {
X .name = "atari",
X .irq_startup = atari_irq_startup,
X .irq_shutdown = atari_irq_shutdown,
X .irq_enable = atari_irq_enable,
X .irq_disable = atari_irq_disable,
X};
X
X/*
X * void atari_init_IRQ (void)
X *
X * Parameters: None
X *
X * Returns: Nothing
X *
X * This function should be called during kernel startup to initialize
X * the atari IRQ handling routines.
X */
X
Xvoid __init atari_init_IRQ(void)
X{
X m68k_setup_user_interrupt(VEC_USER, NUM_ATARI_SOURCES - IRQ_USER);
X m68k_setup_irq_controller(&atari_irq_chip, handle_simple_irq, 1,
X NUM_ATARI_SOURCES - 1);
X
X /* Initialize the MFP(s) */
X
X#ifdef ATARI_USE_SOFTWARE_EOI
X st_mfp.vec_adr = 0x48; /* Software EOI-Mode */
X#else
X st_mfp.vec_adr = 0x40; /* Automatic EOI-Mode */
X#endif
X st_mfp.int_en_a = 0x00; /* turn off MFP-Ints */
X st_mfp.int_en_b = 0x00;
X st_mfp.int_mk_a = 0xff; /* no Masking */
X st_mfp.int_mk_b = 0xff;
X
X if (ATARIHW_PRESENT(TT_MFP)) {
X#ifdef ATARI_USE_SOFTWARE_EOI
X tt_mfp.vec_adr = 0x58; /* Software EOI-Mode */
X#else
X tt_mfp.vec_adr = 0x50; /* Automatic EOI-Mode */
X#endif
X tt_mfp.int_en_a = 0x00; /* turn off MFP-Ints */
X tt_mfp.int_en_b = 0x00;
X tt_mfp.int_mk_a = 0xff; /* no Masking */
X tt_mfp.int_mk_b = 0xff;
X }
X
X if (ATARIHW_PRESENT(SCC) && !atari_SCC_reset_done) {
X atari_scc.cha_a_ctrl = 9;
X MFPDELAY();
X atari_scc.cha_a_ctrl = (char) 0xc0; /* hardware reset */
X }
X
X if (ATARIHW_PRESENT(SCU)) {
X /* init the SCU if present */
X tt_scu.sys_mask = 0x00;
X tt_scu.vme_mask = 0x60; /* enable MFP and SCC ints */
X } else {
X /* If no SCU and no Hades, the HSYNC interrupt needs to be
X * disabled this way. (Else _inthandler in kernel/sys_call.S
X * gets overruns)
X */
X
X vectors[VEC_INT2] = falcon_hblhandler;
X vectors[VEC_INT4] = falcon_hblhandler;
X }
X
X if (ATARIHW_PRESENT(PCM_8BIT) && ATARIHW_PRESENT(MICROWIRE)) {
X /* Initialize the LM1992 Sound Controller to enable
X the PSG sound. This is misplaced here, it should
X be in an atasound_init(), that doesn't exist yet. */
X atari_microwire_cmd(MW_LM1992_PSG_HIGH);
X }
X
X stdma_init();
X
X /* Initialize the PSG: all sounds off, both ports output */
X sound_ym.rd_data_reg_sel = 7;
X sound_ym.wd_data = 0xff;
X}
X
X
X/*
X * atari_register_vme_int() returns the number of a free interrupt vector for
X * hardware with a programmable int vector (probably a VME board).
X */
X
Xunsigned int atari_register_vme_int(void)
X{
X int i;
X
X for (i = 0; i < 32; i++)
X if ((free_vme_vec_bitmap & (1 << i)) == 0)
X break;
X
X if (i == 16)
X return 0;
X
X free_vme_vec_bitmap |= 1 << i;
X return VME_SOURCE_BASE + i;
X}
XEXPORT_SYMBOL(atari_register_vme_int);
X
X
Xvoid atari_unregister_vme_int(unsigned int irq)
X{
X if (irq >= VME_SOURCE_BASE && irq < VME_SOURCE_BASE + VME_MAX_SOURCES) {
X irq -= VME_SOURCE_BASE;
X free_vme_vec_bitmap &= ~(1 << irq);
X }
X}
XEXPORT_SYMBOL(atari_unregister_vme_int);
X
X
END-of-ataints.c
echo x - config.c
sed 's/^X//' >config.c << 'END-of-config.c'
X/*
X * linux/arch/m68k/atari/config.c
X *
X * Copyright (C) 1994 Bjoern Brauel
X *
X * 5/2/94 Roman Hodek:
X * Added setting of time_adj to get a better clock.
X *
X * 5/14/94 Roman Hodek:
X * gettod() for TT
X *
X * 5/15/94 Roman Hodek:
X * hard_reset_now() for Atari (and others?)
X *
X * 94/12/30 Andreas Schwab:
X * atari_sched_init fixed to get precise clock.
X *
X * This file is subject to the terms and conditions of the GNU General Public
X * License. See the file COPYING in the main directory of this archive
X * for more details.
X */
X
X/*
X * Miscellaneous atari stuff
X */
X
X#include <linux/types.h>
X#include <linux/mm.h>
X#include <linux/seq_file.h>
X#include <linux/console.h>
X#include <linux/init.h>
X#include <linux/delay.h>
X#include <linux/ioport.h>
X#include <linux/platform_device.h>
X#include <linux/vt_kern.h>
X#include <linux/module.h>
X
X#include <asm/bootinfo.h>
X#include <asm/setup.h>
X#include <asm/atarihw.h>
X#include <asm/atariints.h>
X#include <asm/atari_stram.h>
X#include <asm/machdep.h>
X#include <asm/hwtest.h>
X#include <asm/io.h>
X
Xu_long atari_mch_cookie;
XEXPORT_SYMBOL(atari_mch_cookie);
X
Xu_long atari_mch_type;
XEXPORT_SYMBOL(atari_mch_type);
X
Xstruct atari_hw_present atari_hw_present;
XEXPORT_SYMBOL(atari_hw_present);
X
Xu_long atari_switches;
XEXPORT_SYMBOL(atari_switches);
X
Xint atari_dont_touch_floppy_select;
XEXPORT_SYMBOL(atari_dont_touch_floppy_select);
X
Xint atari_rtc_year_offset;
X
X/* local function prototypes */
Xstatic void atari_reset(void);
Xstatic void atari_get_model(char *model);
Xstatic void atari_get_hardware_list(struct seq_file *m);
X
X/* atari specific irq functions */
Xextern void atari_init_IRQ (void);
Xextern void atari_mksound(unsigned int count, unsigned int ticks);
X#ifdef CONFIG_HEARTBEAT
Xstatic void atari_heartbeat(int on);
X#endif
X
X/* atari specific timer functions (in time.c) */
Xextern void atari_sched_init(irq_handler_t);
Xextern unsigned long atari_gettimeoffset (void);
Xextern int atari_mste_hwclk (int, struct rtc_time *);
Xextern int atari_tt_hwclk (int, struct rtc_time *);
Xextern int atari_mste_set_clock_mmss (unsigned long);
Xextern int atari_tt_set_clock_mmss (unsigned long);
X
X
X/* ++roman: This is a more elaborate test for an SCC chip, since the plain
X * Medusa board generates DTACK at the SCC's standard addresses, but a SCC
X * board in the Medusa is possible. Also, the addresses where the ST_ESCC
X * resides generate DTACK without the chip, too.
X * The method is to write values into the interrupt vector register, that
X * should be readable without trouble (from channel A!).
X */
X
Xstatic int __init scc_test(volatile char *ctla)
X{
X if (!hwreg_present(ctla))
X return 0;
X MFPDELAY();
X
X *ctla = 2;
X MFPDELAY();
X *ctla = 0x40;
X MFPDELAY();
X
X *ctla = 2;
X MFPDELAY();
X if (*ctla != 0x40)
X return 0;
X MFPDELAY();
X
X *ctla = 2;
X MFPDELAY();
X *ctla = 0x60;
X MFPDELAY();
X
X *ctla = 2;
X MFPDELAY();
X if (*ctla != 0x60)
X return 0;
X
X return 1;
X}
X
X
X /*
X * Parse an Atari-specific record in the bootinfo
X */
X
Xint __init atari_parse_bootinfo(const struct bi_record *record)
X{
X int unknown = 0;
X const u_long *data = record->data;
X
X switch (record->tag) {
X case BI_ATARI_MCH_COOKIE:
X atari_mch_cookie = *data;
X break;
X case BI_ATARI_MCH_TYPE:
X atari_mch_type = *data;
X break;
X default:
X unknown = 1;
X break;
X }
X return unknown;
X}
X
X
X/* Parse the Atari-specific switches= option. */
Xstatic int __init atari_switches_setup(char *str)
X{
X char switches[strlen(str) + 1];
X char *p;
X int ovsc_shift;
X char *args = switches;
X
X if (!MACH_IS_ATARI)
X return 0;
X
X /* copy string to local array, strsep works destructively... */
X strcpy(switches, str);
X atari_switches = 0;
X
X /* parse the options */
X while ((p = strsep(&args, ",")) != NULL) {
X if (!*p)
X continue;
X ovsc_shift = 0;
X if (strncmp(p, "ov_", 3) == 0) {
X p += 3;
X ovsc_shift = ATARI_SWITCH_OVSC_SHIFT;
X }
X
X if (strcmp(p, "ikbd") == 0) {
X /* RTS line of IKBD ACIA */
X atari_switches |= ATARI_SWITCH_IKBD << ovsc_shift;
X } else if (strcmp(p, "midi") == 0) {
X /* RTS line of MIDI ACIA */
X atari_switches |= ATARI_SWITCH_MIDI << ovsc_shift;
X } else if (strcmp(p, "snd6") == 0) {
X atari_switches |= ATARI_SWITCH_SND6 << ovsc_shift;
X } else if (strcmp(p, "snd7") == 0) {
X atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift;
X }
X }
X return 0;
X}
X
Xearly_param("switches", atari_switches_setup);
X
X
X /*
X * Setup the Atari configuration info
X */
X
Xvoid __init config_atari(void)
X{
X unsigned short tos_version;
X
X memset(&atari_hw_present, 0, sizeof(atari_hw_present));
X
X /* Change size of I/O space from 64KB to 4GB. */
X ioport_resource.end = 0xFFFFFFFF;
X
X mach_sched_init = atari_sched_init;
X mach_init_IRQ = atari_init_IRQ;
X mach_get_model = atari_get_model;
X mach_get_hardware_list = atari_get_hardware_list;
X mach_gettimeoffset = atari_gettimeoffset;
X mach_reset = atari_reset;
X mach_max_dma_address = 0xffffff;
X#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
X mach_beep = atari_mksound;
X#endif
X#ifdef CONFIG_HEARTBEAT
X mach_heartbeat = atari_heartbeat;
X#endif
X
X /* Set switches as requested by the user */
X if (atari_switches & ATARI_SWITCH_IKBD)
X acia.key_ctrl = ACIA_DIV64 | ACIA_D8N1S | ACIA_RHTID;
X if (atari_switches & ATARI_SWITCH_MIDI)
X acia.mid_ctrl = ACIA_DIV16 | ACIA_D8N1S | ACIA_RHTID;
X if (atari_switches & (ATARI_SWITCH_SND6|ATARI_SWITCH_SND7)) {
X sound_ym.rd_data_reg_sel = 14;
X sound_ym.wd_data = sound_ym.rd_data_reg_sel |
X ((atari_switches&ATARI_SWITCH_SND6) ? 0x40 : 0) |
X ((atari_switches&ATARI_SWITCH_SND7) ? 0x80 : 0);
X }
X
X /* ++bjoern:
X * Determine hardware present
X */
X
X printk("Atari hardware found: ");
X if (MACH_IS_MEDUSA) {
X /* There's no Atari video hardware on the Medusa, but all the
X * addresses below generate a DTACK so no bus error occurs! */
X } else if (hwreg_present(f030_xreg)) {
X ATARIHW_SET(VIDEL_SHIFTER);
X printk("VIDEL ");
X /* This is a temporary hack: If there is Falcon video
X * hardware, we assume that the ST-DMA serves SCSI instead of
X * ACSI. In the future, there should be a better method for
X * this...
X */
X ATARIHW_SET(ST_SCSI);
X printk("STDMA-SCSI ");
X } else if (hwreg_present(tt_palette)) {
X ATARIHW_SET(TT_SHIFTER);
X printk("TT_SHIFTER ");
X } else if (hwreg_present(&shifter.bas_hi)) {
X if (hwreg_present(&shifter.bas_lo) &&
X (shifter.bas_lo = 0x0aau, shifter.bas_lo == 0x0aau)) {
X ATARIHW_SET(EXTD_SHIFTER);
X printk("EXTD_SHIFTER ");
X } else {
X ATARIHW_SET(STND_SHIFTER);
X printk("STND_SHIFTER ");
X }
X }
X if (hwreg_present(&st_mfp.par_dt_reg)) {
X ATARIHW_SET(ST_MFP);
X printk("ST_MFP ");
X }
X if (hwreg_present(&tt_mfp.par_dt_reg)) {
X ATARIHW_SET(TT_MFP);
X printk("TT_MFP ");
X }
X if (hwreg_present(&tt_scsi_dma.dma_addr_hi)) {
X ATARIHW_SET(SCSI_DMA);
X printk("TT_SCSI_DMA ");
X }
X /*
X * The ST-DMA address registers aren't readable
X * on all Medusas, so the test below may fail
X */
X if (MACH_IS_MEDUSA ||
X (hwreg_present(&st_dma.dma_vhi) &&
X (st_dma.dma_vhi = 0x55) && (st_dma.dma_hi = 0xaa) &&
X st_dma.dma_vhi == 0x55 && st_dma.dma_hi == 0xaa &&
X (st_dma.dma_vhi = 0xaa) && (st_dma.dma_hi = 0x55) &&
X st_dma.dma_vhi == 0xaa && st_dma.dma_hi == 0x55)) {
X ATARIHW_SET(EXTD_DMA);
X printk("EXTD_DMA ");
X }
X if (hwreg_present(&tt_scsi.scsi_data)) {
X ATARIHW_SET(TT_SCSI);
X printk("TT_SCSI ");
X }
X if (hwreg_present(&sound_ym.rd_data_reg_sel)) {
X ATARIHW_SET(YM_2149);
X printk("YM2149 ");
X }
X if (!MACH_IS_MEDUSA && hwreg_present(&tt_dmasnd.ctrl)) {
X ATARIHW_SET(PCM_8BIT);
X printk("PCM ");
X }
X if (hwreg_present(&falcon_codec.unused5)) {
X ATARIHW_SET(CODEC);
X printk("CODEC ");
X }
X if (hwreg_present(&dsp56k_host_interface.icr)) {
X ATARIHW_SET(DSP56K);
X printk("DSP56K ");
X }
X if (hwreg_present(&tt_scc_dma.dma_ctrl) &&
X#if 0
X /* This test sucks! Who knows some better? */
X (tt_scc_dma.dma_ctrl = 0x01, (tt_scc_dma.dma_ctrl & 1) == 1) &&
X (tt_scc_dma.dma_ctrl = 0x00, (tt_scc_dma.dma_ctrl & 1) == 0)
X#else
X !MACH_IS_MEDUSA
X#endif
X ) {
X ATARIHW_SET(SCC_DMA);
X printk("SCC_DMA ");
X }
X if (scc_test(&atari_scc.cha_a_ctrl)) {
X ATARIHW_SET(SCC);
X printk("SCC ");
X }
X if (scc_test(&st_escc.cha_b_ctrl)) {
X ATARIHW_SET(ST_ESCC);
X printk("ST_ESCC ");
X }
X if (hwreg_present(&tt_scu.sys_mask)) {
X ATARIHW_SET(SCU);
X /* Assume a VME bus if there's a SCU */
X ATARIHW_SET(VME);
X printk("VME SCU ");
X }
X if (hwreg_present((void *)(0xffff9210))) {
X ATARIHW_SET(ANALOG_JOY);
X printk("ANALOG_JOY ");
X }
X if (hwreg_present(blitter.halftone)) {
X ATARIHW_SET(BLITTER);
X printk("BLITTER ");
X }
X if (hwreg_present((void *)0xfff00039)) {
X ATARIHW_SET(IDE);
X printk("IDE ");
X }
X#if 1 /* This maybe wrong */
X if (!MACH_IS_MEDUSA && hwreg_present(&tt_microwire.data) &&
X hwreg_present(&tt_microwire.mask) &&
X (tt_microwire.mask = 0x7ff,
X udelay(1),
X tt_microwire.data = MW_LM1992_PSG_HIGH | MW_LM1992_ADDR,
X udelay(1),
X tt_microwire.data != 0)) {
X ATARIHW_SET(MICROWIRE);
X while (tt_microwire.mask != 0x7ff)
X ;
X printk("MICROWIRE ");
X }
X#endif
X if (hwreg_present(&tt_rtc.regsel)) {
X ATARIHW_SET(TT_CLK);
X printk("TT_CLK ");
X mach_hwclk = atari_tt_hwclk;
X mach_set_clock_mmss = atari_tt_set_clock_mmss;
X }
X if (hwreg_present(&mste_rtc.sec_ones)) {
X ATARIHW_SET(MSTE_CLK);
X printk("MSTE_CLK ");
X mach_hwclk = atari_mste_hwclk;
X mach_set_clock_mmss = atari_mste_set_clock_mmss;
X }
X if (!MACH_IS_MEDUSA && hwreg_present(&dma_wd.fdc_speed) &&
X hwreg_write(&dma_wd.fdc_speed, 0)) {
X ATARIHW_SET(FDCSPEED);
X printk("FDC_SPEED ");
X }
X if (!ATARIHW_PRESENT(ST_SCSI)) {
X ATARIHW_SET(ACSI);
X printk("ACSI ");
X }
X printk("\n");
X
X if (CPU_IS_040_OR_060)
X /* Now it seems to be safe to turn of the tt0 transparent
X * translation (the one that must not be turned off in
X * head.S...)
X */
X asm volatile ("\n"
X " moveq #0,%%d0\n"
X " .chip 68040\n"
X " movec %%d0,%%itt0\n"
X " movec %%d0,%%dtt0\n"
X " .chip 68k"
X : /* no outputs */
X : /* no inputs */
X : "d0");
X
X /* allocator for memory that must reside in st-ram */
X atari_stram_init();
X
X /* Set up a mapping for the VMEbus address region:
X *
X * VME is either at phys. 0xfexxxxxx (TT) or 0xa00000..0xdfffff
X * (MegaSTE) In both cases, the whole 16 MB chunk is mapped at
X * 0xfe000000 virt., because this can be done with a single
X * transparent translation. On the 68040, lots of often unused
X * page tables would be needed otherwise. On a MegaSTE or similar,
X * the highest byte is stripped off by hardware due to the 24 bit
X * design of the bus.
X */
X
X if (CPU_IS_020_OR_030) {
X unsigned long tt1_val;
X tt1_val = 0xfe008543; /* Translate 0xfexxxxxx, enable, cache
X * inhibit, read and write, FDC mask = 3,
X * FDC val = 4 -> Supervisor only */
X asm volatile ("\n"
X " .chip 68030\n"
X " pmove %0,%/tt1\n"
X " .chip 68k"
X : : "m" (tt1_val));
X } else {
X asm volatile ("\n"
X " .chip 68040\n"
X " movec %0,%%itt1\n"
X " movec %0,%%dtt1\n"
X " .chip 68k"
X :
X : "d" (0xfe00a040)); /* Translate 0xfexxxxxx, enable,
X * supervisor only, non-cacheable/
X * serialized, writable */
X
X }
X
X /* Fetch tos version at Physical 2 */
X /*
X * We my not be able to access this address if the kernel is
X * loaded to st ram, since the first page is unmapped. On the
X * Medusa this is always the case and there is nothing we can do
X * about this, so we just assume the smaller offset. For the TT
X * we use the fact that in head.S we have set up a mapping
X * 0xFFxxxxxx -> 0x00xxxxxx, so that the first 16MB is accessible
X * in the last 16MB of the address space.
X */
X tos_version = (MACH_IS_MEDUSA) ?
X 0xfff : *(unsigned short *)0xff000002;
X atari_rtc_year_offset = (tos_version < 0x306) ? 70 : 68;
X}
X
X#ifdef CONFIG_HEARTBEAT
Xstatic void atari_heartbeat(int on)
X{
X unsigned char tmp;
X unsigned long flags;
X
X if (atari_dont_touch_floppy_select)
X return;
X
X local_irq_save(flags);
X sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
X tmp = sound_ym.rd_data_reg_sel;
X sound_ym.wd_data = on ? (tmp & ~0x02) : (tmp | 0x02);
X local_irq_restore(flags);
X}
X#endif
X
X/* ++roman:
X *
X * This function does a reset on machines that lack the ability to
X * assert the processor's _RESET signal somehow via hardware. It is
X * based on the fact that you can find the initial SP and PC values
X * after a reset at physical addresses 0 and 4. This works pretty well
X * for Atari machines, since the lowest 8 bytes of physical memory are
X * really ROM (mapped by hardware). For other 680x0 machines: don't
X * know if it works...
X *
X * To get the values at addresses 0 and 4, the MMU better is turned
X * off first. After that, we have to jump into physical address space
X * (the PC before the pmove statement points to the virtual address of
X * the code). Getting that physical address is not hard, but the code
X * becomes a bit complex since I've tried to ensure that the jump
X * statement after the pmove is in the cache already (otherwise the
X * processor can't fetch it!). For that, the code first jumps to the
X * jump statement with the (virtual) address of the pmove section in
X * an address register . The jump statement is surely in the cache
X * now. After that, that physical address of the reset code is loaded
X * into the same address register, pmove is done and the same jump
X * statements goes to the reset code. Since there are not many
X * statements between the two jumps, I hope it stays in the cache.
X *
X * The C code makes heavy use of the GCC features that you can get the
X * address of a C label. No hope to compile this with another compiler
X * than GCC!
X */
X
X/* ++andreas: no need for complicated code, just depend on prefetch */
X
Xstatic void atari_reset(void)
X{
X long tc_val = 0;
X long reset_addr;
X
X /*
X * On the Medusa, phys. 0x4 may contain garbage because it's no
X * ROM. See above for explanation why we cannot use PTOV(4).
X */
X reset_addr = MACH_IS_MEDUSA || MACH_IS_AB40 ? 0xe00030 :
X *(unsigned long *) 0xff000004;
X
X /* reset ACIA for switch off OverScan, if it's active */
X if (atari_switches & ATARI_SWITCH_OVSC_IKBD)
X acia.key_ctrl = ACIA_RESET;
X if (atari_switches & ATARI_SWITCH_OVSC_MIDI)
X acia.mid_ctrl = ACIA_RESET;
X
X /* processor independent: turn off interrupts and reset the VBR;
X * the caches must be left enabled, else prefetching the final jump
X * instruction doesn't work.
X */
X local_irq_disable();
X asm volatile ("movec %0,%%vbr"
X : : "d" (0));
X
X if (CPU_IS_040_OR_060) {
X unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
X if (CPU_IS_060) {
X /* 68060: clear PCR to turn off superscalar operation */
X asm volatile ("\n"
X " .chip 68060\n"
X " movec %0,%%pcr\n"
X " .chip 68k"
X : : "d" (0));
X }
X
X asm volatile ("\n"
X " move.l %0,%%d0\n"
X " and.l #0xff000000,%%d0\n"
X " or.w #0xe020,%%d0\n" /* map 16 MB, enable, cacheable */
X " .chip 68040\n"
X " movec %%d0,%%itt0\n"
X " movec %%d0,%%dtt0\n"
X " .chip 68k\n"
X " jmp %0@"
X : : "a" (jmp_addr040)
X : "d0");
X jmp_addr_label040:
X asm volatile ("\n"
X " moveq #0,%%d0\n"
X " nop\n"
X " .chip 68040\n"
X " cinva %%bc\n"
X " nop\n"
X " pflusha\n"
X " nop\n"
X " movec %%d0,%%tc\n"
X " nop\n"
X /* the following setup of transparent translations is needed on the
X * Afterburner040 to successfully reboot. Other machines shouldn't
X * care about a different tt regs setup, they also didn't care in
X * the past that the regs weren't turned off. */
X " move.l #0xffc000,%%d0\n" /* whole insn space cacheable */
X " movec %%d0,%%itt0\n"
X " movec %%d0,%%itt1\n"
X " or.w #0x40,%/d0\n" /* whole data space non-cacheable/ser. */
X " movec %%d0,%%dtt0\n"
X " movec %%d0,%%dtt1\n"
X " .chip 68k\n"
X " jmp %0@"
X : /* no outputs */
X : "a" (reset_addr)
X : "d0");
X } else
X asm volatile ("\n"
X " pmove %0,%%tc\n"
X " jmp %1@"
X : /* no outputs */
X : "m" (tc_val), "a" (reset_addr));
X}
X
X
Xstatic void atari_get_model(char *model)
X{
X strcpy(model, "Atari ");
X switch (atari_mch_cookie >> 16) {
X case ATARI_MCH_ST:
X if (ATARIHW_PRESENT(MSTE_CLK))
X strcat(model, "Mega ST");
X else
X strcat(model, "ST");
X break;
X case ATARI_MCH_STE:
X if (MACH_IS_MSTE)
X strcat(model, "Mega STE");
X else
X strcat(model, "STE");
X break;
X case ATARI_MCH_TT:
X if (MACH_IS_MEDUSA)
X /* Medusa has TT _MCH cookie */
X strcat(model, "Medusa");
X else
X strcat(model, "TT");
X break;
X case ATARI_MCH_FALCON:
X strcat(model, "Falcon");
X if (MACH_IS_AB40)
X strcat(model, " (with Afterburner040)");
X break;
X default:
X sprintf(model + strlen(model), "(unknown mach cookie 0x%lx)",
X atari_mch_cookie);
X break;
X }
X}
X
X
Xstatic void atari_get_hardware_list(struct seq_file *m)
X{
X int i;
X
X for (i = 0; i < m68k_num_memory; i++)
X seq_printf(m, "\t%3ld MB at 0x%08lx (%s)\n",
X m68k_memory[i].size >> 20, m68k_memory[i].addr,
X (m68k_memory[i].addr & 0xff000000 ?
X "alternate RAM" : "ST-RAM"));
X
X#define ATARIHW_ANNOUNCE(name, str) \
X if (ATARIHW_PRESENT(name)) \
X seq_printf(m, "\t%s\n", str)
X
X seq_printf(m, "Detected hardware:\n");
X ATARIHW_ANNOUNCE(STND_SHIFTER, "ST Shifter");
X ATARIHW_ANNOUNCE(EXTD_SHIFTER, "STe Shifter");
X ATARIHW_ANNOUNCE(TT_SHIFTER, "TT Shifter");
X ATARIHW_ANNOUNCE(VIDEL_SHIFTER, "Falcon Shifter");
X ATARIHW_ANNOUNCE(YM_2149, "Programmable Sound Generator");
X ATARIHW_ANNOUNCE(PCM_8BIT, "PCM 8 Bit Sound");
X ATARIHW_ANNOUNCE(CODEC, "CODEC Sound");
X ATARIHW_ANNOUNCE(TT_SCSI, "SCSI Controller NCR5380 (TT style)");
X ATARIHW_ANNOUNCE(ST_SCSI, "SCSI Controller NCR5380 (Falcon style)");
X ATARIHW_ANNOUNCE(ACSI, "ACSI Interface");
X ATARIHW_ANNOUNCE(IDE, "IDE Interface");
X ATARIHW_ANNOUNCE(FDCSPEED, "8/16 Mhz Switch for FDC");
X ATARIHW_ANNOUNCE(ST_MFP, "Multi Function Peripheral MFP 68901");
X ATARIHW_ANNOUNCE(TT_MFP, "Second Multi Function Peripheral MFP 68901");
X ATARIHW_ANNOUNCE(SCC, "Serial Communications Controller SCC 8530");
X ATARIHW_ANNOUNCE(ST_ESCC, "Extended Serial Communications Controller SCC 85230");
X ATARIHW_ANNOUNCE(ANALOG_JOY, "Paddle Interface");
X ATARIHW_ANNOUNCE(MICROWIRE, "MICROWIRE(tm) Interface");
X ATARIHW_ANNOUNCE(STND_DMA, "DMA Controller (24 bit)");
X ATARIHW_ANNOUNCE(EXTD_DMA, "DMA Controller (32 bit)");
X ATARIHW_ANNOUNCE(SCSI_DMA, "DMA Controller for NCR5380");
X ATARIHW_ANNOUNCE(SCC_DMA, "DMA Controller for SCC");
X ATARIHW_ANNOUNCE(TT_CLK, "Clock Chip MC146818A");
X ATARIHW_ANNOUNCE(MSTE_CLK, "Clock Chip RP5C15");
X ATARIHW_ANNOUNCE(SCU, "System Control Unit");
X ATARIHW_ANNOUNCE(BLITTER, "Blitter");
X ATARIHW_ANNOUNCE(VME, "VME Bus");
X ATARIHW_ANNOUNCE(DSP56K, "DSP56001 processor");
X}
X
X/*
X * MSch: initial platform device support for Atari, required for EtherNAT
X */
X
X#define ATARI_ETHERNAT_PHYS_ADDR 0x80000000
X#define ATARI_ETHERNAT_IRQ 0xc3
X
Xstatic struct resource smc91x_resources[] = {
X [0] = {
X .name = "smc91x-regs",
X .start = ATARI_ETHERNAT_PHYS_ADDR,
X .end = ATARI_ETHERNAT_PHYS_ADDR + 0xfffff,
X .flags = IORESOURCE_MEM,
X },
X [1] = {
X .name = "smc91x-irq",
X .start = ATARI_ETHERNAT_IRQ,
X .end = ATARI_ETHERNAT_IRQ,
X .flags = IORESOURCE_IRQ,
X },
X};
X
Xstatic struct platform_device smc91x_device = {
X .name = "smc91x",
X .id = -1,
X .num_resources = ARRAY_SIZE(smc91x_resources),
X .resource = smc91x_resources,
X};
X
Xstatic struct platform_device *atari_platform_devices[] __initdata = {
X &smc91x_device
X};
X
Xint __init atari_platform_init(void)
X{
X if (!MACH_IS_ATARI)
X return -ENODEV;
X
X return platform_add_devices(atari_platform_devices, ARRAY_SIZE(atari_platform_devices));
X}
X
Xarch_initcall(atari_platform_init);
END-of-config.c
exit
Reply to:
- Follow-Ups:
- Re: Atari TT
- From: Michael Schmitz <schmitz@mail.biophys.uni-duesseldorf.de>
- Re: Atari TT
- From: Michael Schmitz <schmitz@mail.biophys.uni-duesseldorf.de>
- References:
- Re: Atari TT
- From: Michael Schmitz <schmitz@mail.biophys.uni-duesseldorf.de>
- Re: Atari TT
- From: Thorsten Glaser <tg@mirbsd.de>
- Re: Atari TT
- From: Michael Schmitz <schmitz@mail.biophys.uni-duesseldorf.de>
- Re: Atari TT
- From: Thorsten Glaser <tg@mirbsd.de>
- Re: Atari TT
- From: Michael Schmitz <schmitz@mail.biophys.uni-duesseldorf.de>
- Re: Atari TT
- From: Thorsten Glaser <tg@mirbsd.de>
- Re: Atari TT
- From: Michael Schmitz <schmitz@mail.biophys.uni-duesseldorf.de>
- Re: Atari TT
- From: Thorsten Glaser <tg@mirbsd.de>
- Re: Atari TT
- From: Michael Schmitz <schmitz@mail.biophys.uni-duesseldorf.de>
- Re: Atari TT
- From: Thorsten Glaser <tg@mirbsd.de>
- Re: Atari TT
- From: Michael Schmitz <schmitz@mail.biophys.uni-duesseldorf.de>