Commit 6ff5801a authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds
Browse files

m68k: reformat various m68k files



Reformat various m68k files, so they actually look like Linux sources.

Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b3e2fd9c
Loading
Loading
Loading
Loading
+536 −540
Original line number Original line Diff line number Diff line
@@ -22,9 +22,7 @@
#include <linux/vt_kern.h>
#include <linux/vt_kern.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#ifdef CONFIG_ZORRO
#include <linux/zorro.h>
#include <linux/zorro.h>
#endif


#include <asm/bootinfo.h>
#include <asm/bootinfo.h>
#include <asm/setup.h>
#include <asm/setup.h>
@@ -198,7 +196,7 @@ int amiga_parse_bootinfo(const struct bi_record *record)
	default:
	default:
		unknown = 1;
		unknown = 1;
	}
	}
    return(unknown);
	return unknown;
}
}


    /*
    /*
@@ -389,22 +387,18 @@ void __init config_amiga(void)
		mach_hwclk         = a3000_hwclk;
		mach_hwclk         = a3000_hwclk;
		rtc_resource.name = "A3000 RTC";
		rtc_resource.name = "A3000 RTC";
		request_resource(&iomem_resource, &rtc_resource);
		request_resource(&iomem_resource, &rtc_resource);
  }
	} else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
  else{ /* if (AMIGAHW_PRESENT(A2000_CLK)) */
		mach_hwclk         = a2000_hwclk;
		mach_hwclk         = a2000_hwclk;
		rtc_resource.name = "A2000 RTC";
		rtc_resource.name = "A2000 RTC";
		request_resource(&iomem_resource, &rtc_resource);
		request_resource(&iomem_resource, &rtc_resource);
	}
	}


  mach_max_dma_address = 0xffffffff; /*
	/*
				      * default MAX_DMA=0xffffffff
	 * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI
				      * on all machines. If we don't
	 * code will not be able to allocate any mem for transfers, unless we are
				      * do so, the SCSI code will not
	 * dealing with a Z2 mem only system.                  /Jes
				      * be able to allocate any mem
				      * for transfers, unless we are
				      * dealing with a Z2 mem only
				      * system.                  /Jes
	 */
	 */
	mach_max_dma_address = 0xffffffff;


	mach_set_clock_mmss  = amiga_set_clock_mmss;
	mach_set_clock_mmss  = amiga_set_clock_mmss;
	mach_get_ss          = amiga_get_ss;
	mach_get_ss          = amiga_get_ss;
@@ -430,7 +424,8 @@ void __init config_amiga(void)
	if (AMIGAHW_PRESENT(ZORRO3)) {
	if (AMIGAHW_PRESENT(ZORRO3)) {
		int i, j;
		int i, j;
		u32 disabled_z2mem = 0;
		u32 disabled_z2mem = 0;
    for (i = 0; i < m68k_num_memory; i++)

		for (i = 0; i < m68k_num_memory; i++) {
			if (m68k_memory[i].addr < 16*1024*1024) {
			if (m68k_memory[i].addr < 16*1024*1024) {
				if (i == 0) {
				if (i == 0) {
					/* don't cut off the branch we're sitting on */
					/* don't cut off the branch we're sitting on */
@@ -443,6 +438,7 @@ void __init config_amiga(void)
					m68k_memory[j] = m68k_memory[j+1];
					m68k_memory[j] = m68k_memory[j+1];
				i--;
				i--;
			}
			}
		}
		if (disabled_z2mem)
		if (disabled_z2mem)
		printk("%dK of Zorro II memory will not be used as system memory\n",
		printk("%dK of Zorro II memory will not be used as system memory\n",
		disabled_z2mem>>10);
		disabled_z2mem>>10);
@@ -585,15 +581,15 @@ static int a2000_hwclk(int op, struct rtc_time *t)


	tod_2000.cntrl1 = TOD2000_CNTRL1_HOLD;
	tod_2000.cntrl1 = TOD2000_CNTRL1_HOLD;


	while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--)
	while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) {
	{
		tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
		tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
		udelay(70);
		udelay(70);
		tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
		tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
	}
	}


	if (!cnt)
	if (!cnt)
		printk(KERN_INFO "hwclk: timed out waiting for RTC (0x%x)\n", tod_2000.cntrl1);
		printk(KERN_INFO "hwclk: timed out waiting for RTC (0x%x)\n",
			tod_2000.cntrl1);


	if (!op) { /* read */
	if (!op) { /* read */
		t->tm_sec  = tod_2000.second1     * 10 + tod_2000.second2;
		t->tm_sec  = tod_2000.second1     * 10 + tod_2000.second2;
@@ -660,8 +656,7 @@ static int amiga_set_clock_mmss (unsigned long nowtime)


		tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
		tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;


		while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--)
		while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) {
		{
			tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
			tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
			udelay(70);
			udelay(70);
			tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
			tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
@@ -708,35 +703,36 @@ static void amiga_reset (void)
		/* Setup transparent translation registers for mapping
		/* Setup transparent translation registers for mapping
		 * of 16 MB kernel segment before disabling translation
		 * of 16 MB kernel segment before disabling translation
		 */
		 */
    __asm__ __volatile__
		asm volatile ("\n"
      ("movel    %0,%/d0\n\t"
			"	move.l	%0,%%d0\n"
       "andl     #0xff000000,%/d0\n\t"
			"	and.l	#0xff000000,%%d0\n"
       "orw      #0xe020,%/d0\n\t"   /* map 16 MB, enable, cacheable */
			"	or.w	#0xe020,%%d0\n"   /* map 16 MB, enable, cacheable */
       ".chip    68040\n\t"
			"	.chip	68040\n"
       "movec    %%d0,%%itt0\n\t"
			"	movec	%%d0,%%itt0\n"
       "movec    %%d0,%%dtt0\n\t"
			"	movec	%%d0,%%dtt0\n"
       ".chip    68k\n\t"
			"	.chip	68k\n"
       "jmp      %0@\n\t"
			"	jmp	%0@\n"
			: /* no outputs */
			: /* no outputs */
       : "a" (jmp_addr040));
			: "a" (jmp_addr040)
			: "d0");
	else
	else
		/* for 680[23]0, just disable translation and jump to the physical
		/* for 680[23]0, just disable translation and jump to the physical
		 * address of the label
		 * address of the label
		 */
		 */
    __asm__ __volatile__
		asm volatile ("\n"
      ("pmove  %/tc,%@\n\t"
			"	pmove	%%tc,%@\n"
       "bclr   #7,%@\n\t"
			"	bclr	#7,%@\n"
       "pmove  %@,%/tc\n\t"
			"	pmove	%@,%%tc\n"
       "jmp    %0@\n\t"
			"	jmp	%0@\n"
			: /* no outputs */
			: /* no outputs */
			: "a" (jmp_addr));
			: "a" (jmp_addr));
jmp_addr_label040:
jmp_addr_label040:
	/* disable translation on '040 now */
	/* disable translation on '040 now */
  __asm__ __volatile__
	asm volatile ("\n"
    ("moveq #0,%/d0\n\t"
		"	moveq	#0,%%d0\n"
     ".chip 68040\n\t"
		"	.chip	68040\n"
     "movec %%d0,%%tc\n\t"	/* disable MMU */
		"	movec	%%d0,%%tc\n"	/* disable MMU */
     ".chip 68k\n\t"
		"	.chip	68k\n"
		: /* no outputs */
		: /* no outputs */
		: /* no inputs */
		: /* no inputs */
		: "d0");
		: "d0");
@@ -745,21 +741,21 @@ static void amiga_reset (void)
	/* pickup reset address from AmigaOS ROM, reset devices and jump
	/* pickup reset address from AmigaOS ROM, reset devices and jump
	 * to reset address
	 * to reset address
	 */
	 */
  __asm__ __volatile__
	asm volatile ("\n"
    ("movew #0x2700,%/sr\n\t"
		"	move.w	#0x2700,%sr\n"
     "leal  0x01000000,%/a0\n\t"
		"	lea	0x01000000,%a0\n"
     "subl  %/a0@(-0x14),%/a0\n\t"
		"	sub.l	%a0@(-0x14),%a0\n"
     "movel %/a0@(4),%/a0\n\t"
		"	move.l	%a0@(4),%a0\n"
     "subql #2,%/a0\n\t"
		"	subq.l	#2,%a0\n"
     "bra   1f\n\t"
		"	jra	1f\n"
		/* align on a longword boundary */
		/* align on a longword boundary */
     __ALIGN_STR "\n"
		"	" __ALIGN_STR "\n"
     "1:\n\t"
		"1:\n"
     "reset\n\t"
		"	reset\n"
     "jmp   %/a0@" : /* Just that gcc scans it for % escapes */ );
		"	jmp   %a0@");

  for (;;);


	for (;;)
		;
}
}




@@ -977,5 +973,5 @@ static int amiga_get_hardware_list(char *buffer)


#undef AMIGAHW_ANNOUNCE
#undef AMIGAHW_ANNOUNCE


    return(len);
	return len;
}
}
+472 −517
Original line number Original line Diff line number Diff line
@@ -73,48 +73,6 @@ extern int atari_tt_set_clock_mmss (unsigned long);
extern void atari_debug_init(void);
extern void atari_debug_init(void);




/* I've moved hwreg_present() and hwreg_present_bywrite() out into
 * mm/hwtest.c, to avoid having multiple copies of the same routine
 * in the kernel [I wanted them in hp300 and they were already used
 * in the nubus code. NB: I don't have an Atari so this might (just
 * conceivably) break something.
 * I've preserved the #if 0 version of hwreg_present_bywrite() here
 * for posterity.
 *   -- Peter Maydell <pmaydell@chiark.greenend.org.uk>, 05/1998
 */

#if 0
static int __init
hwreg_present_bywrite(volatile void *regp, unsigned char val)
{
    int		ret;
    long	save_sp, save_vbr;
    static long tmp_vectors[3] = { [2] = (long)&&after_test };

    __asm__ __volatile__
	(	"movec	%/vbr,%2\n\t"	/* save vbr value            */
                "movec	%4,%/vbr\n\t"	/* set up temporary vectors  */
		"movel	%/sp,%1\n\t"	/* save sp                   */
		"moveq	#0,%0\n\t"	/* assume not present        */
		"moveb	%5,%3@\n\t"	/* write the hardware reg    */
		"cmpb	%3@,%5\n\t"	/* compare it                */
		"seq	%0"		/* comes here only if reg    */
                                        /* is present                */
		: "=d&" (ret), "=r&" (save_sp), "=r&" (save_vbr)
		: "a" (regp), "r" (tmp_vectors), "d" (val)
                );
  after_test:
    __asm__ __volatile__
      (	"movel	%0,%/sp\n\t"		/* restore sp                */
        "movec	%1,%/vbr"			/* restore vbr               */
        : : "r" (save_sp), "r" (save_vbr) : "sp"
	);

    return( ret );
}
#endif


/* ++roman: This is a more elaborate test for an SCC chip, since the plain
/* ++roman: This is a more elaborate test for an SCC chip, since the plain
 * Medusa board generates DTACK at the SCC's standard addresses, but a SCC
 * Medusa board generates DTACK at the SCC's standard addresses, but a SCC
 * board in the Medusa is possible. Also, the addresses where the ST_ESCC
 * board in the Medusa is possible. Also, the addresses where the ST_ESCC
@@ -126,23 +84,31 @@ hwreg_present_bywrite(volatile void *regp, unsigned char val)
static int __init scc_test(volatile char *ctla)
static int __init scc_test(volatile char *ctla)
{
{
	if (!hwreg_present(ctla))
	if (!hwreg_present(ctla))
		return( 0 );
		return 0;
	MFPDELAY();
	MFPDELAY();


	*ctla = 2; MFPDELAY();
	*ctla = 2;
	*ctla = 0x40; MFPDELAY();
	MFPDELAY();
	*ctla = 0x40;
	MFPDELAY();


	*ctla = 2; MFPDELAY();
	*ctla = 2;
	if (*ctla != 0x40) return( 0 );
	MFPDELAY();
	if (*ctla != 0x40)
		return 0;
	MFPDELAY();
	MFPDELAY();


	*ctla = 2; MFPDELAY();
	*ctla = 2;
	*ctla = 0x60; MFPDELAY();
	MFPDELAY();
	*ctla = 0x60;
	MFPDELAY();


	*ctla = 2; MFPDELAY();
	*ctla = 2;
	if (*ctla != 0x60) return( 0 );
	MFPDELAY();
	if (*ctla != 0x60)
		return 0;


	return( 1 );
	return 1;
}
}




@@ -164,8 +130,9 @@ int __init atari_parse_bootinfo(const struct bi_record *record)
		break;
		break;
	default:
	default:
		unknown = 1;
		unknown = 1;
		break;
	}
	}
    return(unknown);
	return unknown;
}
}




@@ -183,7 +150,8 @@ void __init atari_switches_setup( const char *str, unsigned len )


	/* parse the options */
	/* parse the options */
	while ((p = strsep(&args, ",")) != NULL) {
	while ((p = strsep(&args, ",")) != NULL) {
	if (!*p) continue;
		if (!*p)
			continue;
		ovsc_shift = 0;
		ovsc_shift = 0;
		if (strncmp(p, "ov_", 3) == 0) {
		if (strncmp(p, "ov_", 3) == 0) {
			p += 3;
			p += 3;
@@ -193,15 +161,12 @@ void __init atari_switches_setup( const char *str, unsigned len )
		if (strcmp(p, "ikbd") == 0) {
		if (strcmp(p, "ikbd") == 0) {
			/* RTS line of IKBD ACIA */
			/* RTS line of IKBD ACIA */
			atari_switches |= ATARI_SWITCH_IKBD << ovsc_shift;
			atari_switches |= ATARI_SWITCH_IKBD << ovsc_shift;
	}
		} else if (strcmp(p, "midi") == 0) {
	else if (strcmp( p, "midi" ) == 0) {
			/* RTS line of MIDI ACIA */
			/* RTS line of MIDI ACIA */
			atari_switches |= ATARI_SWITCH_MIDI << ovsc_shift;
			atari_switches |= ATARI_SWITCH_MIDI << ovsc_shift;
	}
		} else if (strcmp(p, "snd6") == 0) {
	else if (strcmp( p, "snd6" ) == 0) {
			atari_switches |= ATARI_SWITCH_SND6 << ovsc_shift;
			atari_switches |= ATARI_SWITCH_SND6 << ovsc_shift;
	}
		} else if (strcmp(p, "snd7") == 0) {
	else if (strcmp( p, "snd7" ) == 0) {
			atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift;
			atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift;
		}
		}
	}
	}
@@ -220,8 +185,8 @@ void __init config_atari(void)


	atari_debug_init();
	atari_debug_init();


    ioport_resource.end  = 0xFFFFFFFF;  /* Change size of I/O space from 64KB
	/* Change size of I/O space from 64KB to 4GB. */
                                           to 4GB. */
	ioport_resource.end  = 0xFFFFFFFF;


	mach_sched_init      = atari_sched_init;
	mach_sched_init      = atari_sched_init;
	mach_init_IRQ        = atari_init_IRQ;
	mach_init_IRQ        = atari_init_IRQ;
@@ -257,8 +222,7 @@ void __init config_atari(void)
	if (MACH_IS_MEDUSA || MACH_IS_HADES) {
	if (MACH_IS_MEDUSA || MACH_IS_HADES) {
		/* There's no Atari video hardware on the Medusa, but all the
		/* There's no Atari video hardware on the Medusa, but all the
		 * addresses below generate a DTACK so no bus error occurs! */
		 * addresses below generate a DTACK so no bus error occurs! */
    }
	} else if (hwreg_present(f030_xreg)) {
    else if (hwreg_present( f030_xreg )) {
		ATARIHW_SET(VIDEL_SHIFTER);
		ATARIHW_SET(VIDEL_SHIFTER);
		printk("VIDEL ");
		printk("VIDEL ");
		/* This is a temporary hack: If there is Falcon video
		/* This is a temporary hack: If there is Falcon video
@@ -268,18 +232,15 @@ void __init config_atari(void)
		 */
		 */
		ATARIHW_SET(ST_SCSI);
		ATARIHW_SET(ST_SCSI);
		printk("STDMA-SCSI ");
		printk("STDMA-SCSI ");
    }
	} else if (hwreg_present(tt_palette)) {
    else if (hwreg_present( tt_palette )) {
		ATARIHW_SET(TT_SHIFTER);
		ATARIHW_SET(TT_SHIFTER);
		printk("TT_SHIFTER ");
		printk("TT_SHIFTER ");
    }
	} else if (hwreg_present(&shifter.bas_hi)) {
    else if (hwreg_present( &shifter.bas_hi )) {
		if (hwreg_present(&shifter.bas_lo) &&
		if (hwreg_present(&shifter.bas_lo) &&
		    (shifter.bas_lo = 0x0aau, shifter.bas_lo == 0x0aau)) {
		    (shifter.bas_lo = 0x0aau, shifter.bas_lo == 0x0aau)) {
			ATARIHW_SET(EXTD_SHIFTER);
			ATARIHW_SET(EXTD_SHIFTER);
			printk("EXTD_SHIFTER ");
			printk("EXTD_SHIFTER ");
        }
		} else {
        else {
			ATARIHW_SET(STND_SHIFTER);
			ATARIHW_SET(STND_SHIFTER);
			printk("STND_SHIFTER ");
			printk("STND_SHIFTER ");
		}
		}
@@ -300,8 +261,11 @@ void __init config_atari(void)
		ATARIHW_SET(STND_DMA);
		ATARIHW_SET(STND_DMA);
		printk("STND_DMA ");
		printk("STND_DMA ");
	}
	}
    if (MACH_IS_MEDUSA || /* The ST-DMA address registers aren't readable
	/*
			   * on all Medusas, so the test below may fail */
	 * The ST-DMA address registers aren't readable
	 * on all Medusas, so the test below may fail
	 */
	if (MACH_IS_MEDUSA ||
	    (hwreg_present(&st_dma.dma_vhi) &&
	    (hwreg_present(&st_dma.dma_vhi) &&
	     (st_dma.dma_vhi = 0x55) && (st_dma.dma_hi = 0xaa) &&
	     (st_dma.dma_vhi = 0x55) && (st_dma.dma_hi = 0xaa) &&
	     st_dma.dma_vhi == 0x55 && st_dma.dma_hi == 0xaa &&
	     st_dma.dma_vhi == 0x55 && st_dma.dma_hi == 0xaa &&
@@ -351,12 +315,10 @@ void __init config_atari(void)
		ATARIHW_SET(ST_ESCC);
		ATARIHW_SET(ST_ESCC);
		printk("ST_ESCC ");
		printk("ST_ESCC ");
	}
	}
    if (MACH_IS_HADES)
	if (MACH_IS_HADES) {
    {
		ATARIHW_SET(VME);
		ATARIHW_SET(VME);
		printk("VME ");
		printk("VME ");
    }
	} else if (hwreg_present(&tt_scu.sys_mask)) {
    else if (hwreg_present( &tt_scu.sys_mask )) {
		ATARIHW_SET(SCU);
		ATARIHW_SET(SCU);
		/* Assume a VME bus if there's a SCU */
		/* Assume a VME bus if there's a SCU */
		ATARIHW_SET(VME);
		ATARIHW_SET(VME);
@@ -384,7 +346,8 @@ void __init config_atari(void)
	     udelay(1),
	     udelay(1),
	     tt_microwire.data != 0)) {
	     tt_microwire.data != 0)) {
		ATARIHW_SET(MICROWIRE);
		ATARIHW_SET(MICROWIRE);
	while (tt_microwire.mask != 0x7ff) ;
		while (tt_microwire.mask != 0x7ff)
			;
		printk("MICROWIRE ");
		printk("MICROWIRE ");
	}
	}
#endif
#endif
@@ -417,10 +380,11 @@ void __init config_atari(void)
		 * translation (the one that must not be turned off in
		 * translation (the one that must not be turned off in
		 * head.S...)
		 * head.S...)
		 */
		 */
        __asm__ volatile ("moveq #0,%/d0\n\t"
		asm volatile ("\n"
                          ".chip 68040\n\t"
			"	moveq	#0,%%d0\n"
			  "movec %%d0,%%itt0\n\t"
			"	.chip	68040\n"
			  "movec %%d0,%%dtt0\n\t"
			"	movec	%%d0,%%itt0\n"
			"	movec	%%d0,%%dtt0\n"
			"	.chip	68k"
			"	.chip	68k"
			: /* no outputs */
			: /* no outputs */
			: /* no inputs */
			: /* no inputs */
@@ -445,34 +409,34 @@ void __init config_atari(void)
		tt1_val = 0xfe008543;	/* Translate 0xfexxxxxx, enable, cache
		tt1_val = 0xfe008543;	/* Translate 0xfexxxxxx, enable, cache
					 * inhibit, read and write, FDC mask = 3,
					 * inhibit, read and write, FDC mask = 3,
					 * FDC val = 4 -> Supervisor only */
					 * FDC val = 4 -> Supervisor only */
        __asm__ __volatile__ ( ".chip 68030\n\t"
		asm volatile ("\n"
				"pmove	%0@,%/tt1\n\t"
			"	.chip	68030\n"
			"	pmove	%0@,%/tt1\n"
			"	.chip	68k"
			"	.chip	68k"
			: : "a" (&tt1_val));
			: : "a" (&tt1_val));
    }
	} else {
    else {
	        asm volatile ("\n"
        __asm__ __volatile__
			"	.chip	68040\n"
            ( "movel %0,%/d0\n\t"
			"	movec	%0,%%itt1\n"
	      ".chip 68040\n\t"
			"	movec	%0,%%dtt1\n"
	      "movec %%d0,%%itt1\n\t"
	      "movec %%d0,%%dtt1\n\t"
			"	.chip	68k"
			"	.chip	68k"
			:
			:
              : "g" (0xfe00a040)	/* Translate 0xfexxxxxx, enable,
			: "d" (0xfe00a040));	/* Translate 0xfexxxxxx, enable,
						 * supervisor only, non-cacheable/
						 * supervisor only, non-cacheable/
						 * serialized, writable */
						 * serialized, writable */
              : "d0" );


	}
	}


	/* Fetch tos version at Physical 2 */
	/* Fetch tos version at Physical 2 */
    /* We my not be able to access this address if the kernel is
	/*
       loaded to st ram, since the first page is unmapped.  On the
	 * We my not be able to access this address if the kernel is
       Medusa this is always the case and there is nothing we can do
	 * loaded to st ram, since the first page is unmapped.  On the
       about this, so we just assume the smaller offset.  For the TT
	 * Medusa this is always the case and there is nothing we can do
       we use the fact that in head.S we have set up a mapping
	 * about this, so we just assume the smaller offset.  For the TT
       0xFFxxxxxx -> 0x00xxxxxx, so that the first 16MB is accessible
	 * we use the fact that in head.S we have set up a mapping
       in the last 16MB of the address space. */
	 * 0xFFxxxxxx -> 0x00xxxxxx, so that the first 16MB is accessible
	 * in the last 16MB of the address space.
	 */
	tos_version = (MACH_IS_MEDUSA || MACH_IS_HADES) ?
	tos_version = (MACH_IS_MEDUSA || MACH_IS_HADES) ?
			0xfff : *(unsigned short *)0xff000002;
			0xfff : *(unsigned short *)0xff000002;
	atari_rtc_year_offset = (tos_version < 0x306) ? 70 : 68;
	atari_rtc_year_offset = (tos_version < 0x306) ? 70 : 68;
@@ -531,8 +495,10 @@ static void atari_reset (void)
	long tc_val = 0;
	long tc_val = 0;
	long reset_addr;
	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). */
	 * 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_HADES ? 0x7fe00030 :
	reset_addr = MACH_IS_HADES ? 0x7fe00030 :
		     MACH_IS_MEDUSA || MACH_IS_AB40 ? 0xe00030 :
		     MACH_IS_MEDUSA || MACH_IS_AB40 ? 0xe00030 :
		     *(unsigned long *) 0xff000004;
		     *(unsigned long *) 0xff000004;
@@ -545,67 +511,63 @@ static void atari_reset (void)


	/* processor independent: turn off interrupts and reset the VBR;
	/* processor independent: turn off interrupts and reset the VBR;
	 * the caches must be left enabled, else prefetching the final jump
	 * the caches must be left enabled, else prefetching the final jump
     * instruction doesn't work. */
	 * instruction doesn't work.
	 */
	local_irq_disable();
	local_irq_disable();
    __asm__ __volatile__
	asm volatile ("movec	%0,%%vbr"
	("moveq	#0,%/d0\n\t"
			: : "d" (0));
	 "movec	%/d0,%/vbr"
	 : : : "d0" );


	if (CPU_IS_040_OR_060) {
	if (CPU_IS_040_OR_060) {
		unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
		unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
		if (CPU_IS_060) {
		if (CPU_IS_060) {
			/* 68060: clear PCR to turn off superscalar operation */
			/* 68060: clear PCR to turn off superscalar operation */
	    __asm__ __volatile__
			asm volatile ("\n"
		("moveq	#0,%/d0\n\t"
				"	.chip 68060\n"
		 ".chip 68060\n\t"
				"	movec %0,%%pcr\n"
		 "movec %%d0,%%pcr\n\t"
				"	.chip 68k"
				"	.chip 68k"
		 : : : "d0" );
				: : "d" (0));
	}
		}


        __asm__ __volatile__
		asm volatile ("\n"
            ("movel    %0,%/d0\n\t"
			"	move.l	%0,%%d0\n"
             "andl     #0xff000000,%/d0\n\t"
			"	and.l	#0xff000000,%%d0\n"
             "orw      #0xe020,%/d0\n\t"   /* map 16 MB, enable, cacheable */
			"	or.w	#0xe020,%%d0\n"   /* map 16 MB, enable, cacheable */
             ".chip 68040\n\t"
			"	.chip	68040\n"
	     "movec    %%d0,%%itt0\n\t"
			"	movec	%%d0,%%itt0\n"
             "movec    %%d0,%%dtt0\n\t"
			"	movec	%%d0,%%dtt0\n"
	     ".chip 68k\n\t"
			"	.chip	68k\n"
             "jmp   %0@\n\t"
			"	jmp	%0@"
             : /* no outputs */
			: : "a" (jmp_addr040)
             : "a" (jmp_addr040)
			: "d0");
			: "d0");
	jmp_addr_label040:
	jmp_addr_label040:
        __asm__ __volatile__
		asm volatile ("\n"
          ("moveq #0,%/d0\n\t"
			"	moveq	#0,%%d0\n"
	   "nop\n\t"
			"	nop\n"
	   ".chip 68040\n\t"
			"	.chip	68040\n"
	   "cinva %%bc\n\t"
			"	cinva	%%bc\n"
	   "nop\n\t"
			"	nop\n"
	   "pflusha\n\t"
			"	pflusha\n"
	   "nop\n\t"
			"	nop\n"
	   "movec %%d0,%%tc\n\t"
			"	movec	%%d0,%%tc\n"
	   "nop\n\t"
			"	nop\n"
			/* the following setup of transparent translations is needed on the
			/* the following setup of transparent translations is needed on the
			 * Afterburner040 to successfully reboot. Other machines shouldn't
			 * Afterburner040 to successfully reboot. Other machines shouldn't
			 * care about a different tt regs setup, they also didn't care in
			 * care about a different tt regs setup, they also didn't care in
			 * the past that the regs weren't turned off. */
			 * the past that the regs weren't turned off. */
	   "movel #0xffc000,%%d0\n\t" /* whole insn space cacheable */
			"	move.l	#0xffc000,%%d0\n" /* whole insn space cacheable */
	   "movec %%d0,%%itt0\n\t"
			"	movec	%%d0,%%itt0\n"
	   "movec %%d0,%%itt1\n\t"
			"	movec	%%d0,%%itt1\n"
	   "orw   #0x40,%/d0\n\t" /* whole data space non-cacheable/ser. */
			"	or.w	#0x40,%/d0\n" /* whole data space non-cacheable/ser. */
	   "movec %%d0,%%dtt0\n\t"
			"	movec	%%d0,%%dtt0\n"
	   "movec %%d0,%%dtt1\n\t"
			"	movec	%%d0,%%dtt1\n"
	   ".chip 68k\n\t"
			"	.chip	68k\n"
			"	jmp	%0@"
			"	jmp	%0@"
			: /* no outputs */
			: /* no outputs */
			: "a" (reset_addr)
			: "a" (reset_addr)
			: "d0");
			: "d0");
    }
	} else
    else
		asm volatile ("\n"
        __asm__ __volatile__
			"	pmove	%0@,%%tc\n"
            ("pmove %0@,%/tc\n\t"
			"	jmp	%1@"
			"	jmp	%1@"
			: /* no outputs */
			: /* no outputs */
			: "a" (&tc_val), "a" (reset_addr));
			: "a" (&tc_val), "a" (reset_addr));
@@ -694,12 +656,5 @@ static int atari_get_hardware_list(char *buffer)
	ATARIHW_ANNOUNCE(VME, "VME Bus");
	ATARIHW_ANNOUNCE(VME, "VME Bus");
	ATARIHW_ANNOUNCE(DSP56K, "DSP56001 processor");
	ATARIHW_ANNOUNCE(DSP56K, "DSP56001 processor");


    return(len);
	return len;
}
}

/*
 * Local variables:
 *  c-indent-level: 4
 *  tab-width: 8
 * End:
 */
+234 −240
Original line number Original line Diff line number Diff line
@@ -97,7 +97,8 @@ static int ata_par_out (char c)


	while ((mfp.par_dt_reg & 1) && --i) /* wait for BUSY == L */
	while ((mfp.par_dt_reg & 1) && --i) /* wait for BUSY == L */
		;
		;
    if (!i) return( 0 );
	if (!i)
		return 0;


	sound_ym.rd_data_reg_sel = 15;	/* select port B */
	sound_ym.rd_data_reg_sel = 15;	/* select port B */
	sound_ym.wd_data = c;		/* put char onto port */
	sound_ym.wd_data = c;		/* put char onto port */
@@ -106,7 +107,7 @@ static int ata_par_out (char c)
	sound_ym.wd_data = tmp & ~0x20;	/* set strobe L */
	sound_ym.wd_data = tmp & ~0x20;	/* set strobe L */
	MFPDELAY();			/* wait a bit */
	MFPDELAY();			/* wait a bit */
	sound_ym.wd_data = tmp | 0x20;	/* set strobe H */
	sound_ym.wd_data = tmp | 0x20;	/* set strobe H */
    return( 1 );
	return 1;
}
}


static void atari_par_console_write(struct console *co, const char *str,
static void atari_par_console_write(struct console *co, const char *str,
@@ -118,11 +119,12 @@ static void atari_par_console_write (struct console *co, const char *str,
		return;
		return;


	while (count--) {
	while (count--) {
	if (*str == '\n')
		if (*str == '\n') {
			if (!ata_par_out('\r')) {
			if (!ata_par_out('\r')) {
				printer_present = 0;
				printer_present = 0;
				return;
				return;
			}
			}
		}
		if (!ata_par_out(*str++)) {
		if (!ata_par_out(*str++)) {
			printer_present = 0;
			printer_present = 0;
			return;
			return;
@@ -135,7 +137,7 @@ int atari_mfp_console_wait_key(struct console *co)
{
{
	while (!(mfp.rcv_stat & 0x80))	/* wait for rx buf filled */
	while (!(mfp.rcv_stat & 0x80))	/* wait for rx buf filled */
		barrier();
		barrier();
    return( mfp.usart_dta );
	return mfp.usart_dta;
}
}


int atari_scc_console_wait_key(struct console *co)
int atari_scc_console_wait_key(struct console *co)
@@ -144,28 +146,32 @@ int atari_scc_console_wait_key(struct console *co)
		MFPDELAY();
		MFPDELAY();
	} while (!(scc.cha_b_ctrl & 0x01)); /* wait for rx buf filled */
	} while (!(scc.cha_b_ctrl & 0x01)); /* wait for rx buf filled */
	MFPDELAY();
	MFPDELAY();
    return( scc.cha_b_data );
	return scc.cha_b_data;
}
}


int atari_midi_console_wait_key(struct console *co)
int atari_midi_console_wait_key(struct console *co)
{
{
	while (!(acia.mid_ctrl & ACIA_RDRF)) /* wait for rx buf filled */
	while (!(acia.mid_ctrl & ACIA_RDRF)) /* wait for rx buf filled */
		barrier();
		barrier();
    return( acia.mid_data );
	return acia.mid_data;
}
}
#endif
#endif


/* The following two functions do a quick'n'dirty initialization of the MFP or
/*
 * The following two functions do a quick'n'dirty initialization of the MFP or
 * SCC serial ports. They're used by the debugging interface, kgdb, and the
 * SCC serial ports. They're used by the debugging interface, kgdb, and the
 * serial console code. */
 * serial console code.
 */
#ifndef CONFIG_SERIAL_CONSOLE
#ifndef CONFIG_SERIAL_CONSOLE
static void __init atari_init_mfp_port(int cflag)
static void __init atari_init_mfp_port(int cflag)
#else
#else
void atari_init_mfp_port(int cflag)
void atari_init_mfp_port(int cflag)
#endif
#endif
{
{
    /* timer values for 1200...115200 bps; > 38400 select 110, 134, or 150
	/*
     * bps, resp., and work only correct if there's a RSVE or RSSPEED */
	 * timer values for 1200...115200 bps; > 38400 select 110, 134, or 150
	 * bps, resp., and work only correct if there's a RSVE or RSSPEED
	 */
	static int baud_table[9] = { 16, 11, 8, 4, 2, 1, 175, 143, 128 };
	static int baud_table[9] = { 16, 11, 8, 4, 2, 1, 175, 143, 128 };
	int baud = cflag & CBAUD;
	int baud = cflag & CBAUD;
	int parity = (cflag & PARENB) ? ((cflag & PARODD) ? 0x04 : 0x06) : 0;
	int parity = (cflag & PARENB) ? ((cflag & PARODD) ? 0x04 : 0x06) : 0;
@@ -251,9 +257,8 @@ void atari_init_scc_port( int cflag )
	(void)scc.cha_b_ctrl;		/* reset reg pointer */
	(void)scc.cha_b_ctrl;		/* reset reg pointer */
	SCC_WRITE(9, 0xc0);		/* reset */
	SCC_WRITE(9, 0xc0);		/* reset */
	LONG_DELAY();			/* extra delay after WR9 access */
	LONG_DELAY();			/* extra delay after WR9 access */
    SCC_WRITE( 4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 |
	SCC_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03)
		  0x04 /* 1 stopbit */ |
				      : 0 | 0x04 /* 1 stopbit */ | clkmode);
		  clkmode );
	SCC_WRITE(3, reg3);
	SCC_WRITE(3, reg3);
	SCC_WRITE(5, reg5);
	SCC_WRITE(5, reg5);
	SCC_WRITE(9, 0);		/* no interrupts */
	SCC_WRITE(9, 0);		/* no interrupts */
@@ -305,25 +310,21 @@ void __init atari_debug_init(void)
	if (!strcmp(m68k_debug_device, "ser")) {
	if (!strcmp(m68k_debug_device, "ser")) {
		/* defaults to ser2 for a Falcon and ser1 otherwise */
		/* defaults to ser2 for a Falcon and ser1 otherwise */
		strcpy(m68k_debug_device, MACH_IS_FALCON ? "ser2" : "ser1");
		strcpy(m68k_debug_device, MACH_IS_FALCON ? "ser2" : "ser1");

	}
	}


	if (!strcmp(m68k_debug_device, "ser1")) {
	if (!strcmp(m68k_debug_device, "ser1")) {
		/* ST-MFP Modem1 serial port */
		/* ST-MFP Modem1 serial port */
		atari_init_mfp_port(B9600|CS8);
		atari_init_mfp_port(B9600|CS8);
		atari_console_driver.write = atari_mfp_console_write;
		atari_console_driver.write = atari_mfp_console_write;
    }
	} else if (!strcmp(m68k_debug_device, "ser2")) {
    else if (!strcmp( m68k_debug_device, "ser2" )) {
		/* SCC Modem2 serial port */
		/* SCC Modem2 serial port */
		atari_init_scc_port(B9600|CS8);
		atari_init_scc_port(B9600|CS8);
		atari_console_driver.write = atari_scc_console_write;
		atari_console_driver.write = atari_scc_console_write;
    }
	} else if (!strcmp(m68k_debug_device, "midi")) {
    else if (!strcmp( m68k_debug_device, "midi" )) {
		/* MIDI port */
		/* MIDI port */
		atari_init_midi_port(B9600|CS8);
		atari_init_midi_port(B9600|CS8);
		atari_console_driver.write = atari_midi_console_write;
		atari_console_driver.write = atari_midi_console_write;
    }
	} else if (!strcmp(m68k_debug_device, "par")) {
    else if (!strcmp( m68k_debug_device, "par" )) {
		/* parallel printer */
		/* parallel printer */
		atari_turnoff_irq(IRQ_MFP_BUSY); /* avoid ints */
		atari_turnoff_irq(IRQ_MFP_BUSY); /* avoid ints */
		sound_ym.rd_data_reg_sel = 7;	/* select mixer control */
		sound_ym.rd_data_reg_sel = 7;	/* select mixer control */
@@ -337,10 +338,3 @@ void __init atari_debug_init(void)
	if (atari_console_driver.write)
	if (atari_console_driver.write)
		register_console(&atari_console_driver);
		register_console(&atari_console_driver);
}
}

/*
 * Local variables:
 *  c-indent-level: 4
 *  tab-width: 8
 * End:
 */
+187 −184
Original line number Original line Diff line number Diff line
@@ -133,9 +133,6 @@ extern void config_hp300(void);
extern void config_q40(void);
extern void config_q40(void);
extern void config_sun3x(void);
extern void config_sun3x(void);


extern void mac_debugging_short (int, short);
extern void mac_debugging_long  (int, long);

#define MASK_256K 0xfffc0000
#define MASK_256K 0xfffc0000


extern void paging_init(void);
extern void paging_init(void);
@@ -145,6 +142,7 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
	while (record->tag != BI_LAST) {
	while (record->tag != BI_LAST) {
		int unknown = 0;
		int unknown = 0;
		const unsigned long *data = record->data;
		const unsigned long *data = record->data;

		switch (record->tag) {
		switch (record->tag) {
		case BI_MACHTYPE:
		case BI_MACHTYPE:
		case BI_CPUTYPE:
		case BI_CPUTYPE:
@@ -168,7 +166,8 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
			break;
			break;


		case BI_COMMAND_LINE:
		case BI_COMMAND_LINE:
		strlcpy(m68k_command_line, (const char *)data, sizeof(m68k_command_line));
			strlcpy(m68k_command_line, (const char *)data,
				sizeof(m68k_command_line));
			break;
			break;


		default:
		default:
@@ -194,7 +193,8 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
		if (unknown)
		if (unknown)
			printk("m68k_parse_bootinfo: unknown tag 0x%04x ignored\n",
			printk("m68k_parse_bootinfo: unknown tag 0x%04x ignored\n",
			       record->tag);
			       record->tag);
	record = (struct bi_record *)((unsigned long)record+record->size);
		record = (struct bi_record *)((unsigned long)record +
					      record->size);
	}
	}


	m68k_realnum_memory = m68k_num_memory;
	m68k_realnum_memory = m68k_num_memory;
@@ -234,7 +234,7 @@ void __init setup_arch(char **cmdline_p)
	/* clear the fpu if we have one */
	/* clear the fpu if we have one */
	if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060)) {
	if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060)) {
		volatile int zero = 0;
		volatile int zero = 0;
		asm __volatile__ ("frestore %0" : : "m" (zero));
		asm volatile ("frestore %0" : : "m" (zero));
	}
	}
#endif
#endif


@@ -266,15 +266,17 @@ void __init setup_arch(char **cmdline_p)
		i = 0;
		i = 0;
		if (!strncmp(p, "debug=", 6)) {
		if (!strncmp(p, "debug=", 6)) {
			strlcpy(m68k_debug_device, p+6, sizeof(m68k_debug_device));
			strlcpy(m68k_debug_device, p+6, sizeof(m68k_debug_device));
		if ((q = strchr( m68k_debug_device, ' ' ))) *q = 0;
			q = strchr(m68k_debug_device, ' ');
			if (q)
				*q = 0;
			i = 1;
			i = 1;
		}
		}
#ifdef CONFIG_ATARI
#ifdef CONFIG_ATARI
		/* This option must be parsed very early */
		/* This option must be parsed very early */
		if (!strncmp(p, "switches=", 9)) {
		if (!strncmp(p, "switches=", 9)) {
			extern void atari_switches_setup(const char *, int);
			extern void atari_switches_setup(const char *, int);
		atari_switches_setup( p+9, (q = strchr( p+9, ' ' )) ?
			q = strchr(p + 9, ' ');
				           (q - (p+9)) : strlen(p+9) );
			atari_switches_setup(p + 9, q ? (q - (p + 9)) : strlen(p + 9));
			i = 1;
			i = 1;
		}
		}
#endif
#endif
@@ -286,7 +288,8 @@ void __init setup_arch(char **cmdline_p)
			else
			else
				*p = 0;
				*p = 0;
		} else {
		} else {
		if ((p = strchr( p, ' ' ))) ++p;
			if ((p = strchr(p, ' ')))
				++p;
		}
		}
	}
	}


@@ -532,7 +535,7 @@ int get_hardware_list(char *buffer)
	if (mach_get_hardware_list)
	if (mach_get_hardware_list)
		len += mach_get_hardware_list(buffer + len);
		len += mach_get_hardware_list(buffer + len);


    return(len);
	return len;
}
}


void check_bugs(void)
void check_bugs(void)
+81 −80
Original line number Original line Diff line number Diff line
@@ -142,8 +142,9 @@ int __init mac_parse_bootinfo(const struct bi_record *record)
		break;
		break;
	default:
	default:
		unknown = 1;
		unknown = 1;
		break;
	}
	}
    return(unknown);
	return unknown;
}
}


/*
/*
@@ -155,6 +156,7 @@ int __init mac_parse_bootinfo(const struct bi_record *record)
static void mac_cache_card_flush(int writeback)
static void mac_cache_card_flush(int writeback)
{
{
	unsigned long flags;
	unsigned long flags;

	local_irq_save(flags);
	local_irq_save(flags);
	via_flush_cache();
	via_flush_cache();
	local_irq_restore(flags);
	local_irq_restore(flags);
@@ -162,9 +164,8 @@ static void mac_cache_card_flush(int writeback)


void __init config_mac(void)
void __init config_mac(void)
{
{
	if (!MACH_IS_MAC) {
	if (!MACH_IS_MAC)
		printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
		printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
	}


	mach_sched_init = mac_sched_init;
	mach_sched_init = mac_sched_init;
	mach_init_IRQ = mac_init_IRQ;
	mach_init_IRQ = mac_init_IRQ;
@@ -199,14 +200,15 @@ void __init config_mac(void)
	mac_identify();
	mac_identify();
	mac_report_hardware();
	mac_report_hardware();


	/* AFAIK only the IIci takes a cache card.  The IIfx has onboard
	/*
	   cache ... someone needs to figure out how to tell if it's on or
	 * AFAIK only the IIci takes a cache card.  The IIfx has onboard
	   not. */
	 * cache ... someone needs to figure out how to tell if it's on or
	 * not.
	 */


	if (macintosh_config->ident == MAC_MODEL_IICI
	if (macintosh_config->ident == MAC_MODEL_IICI
	    || macintosh_config->ident == MAC_MODEL_IIFX) {
	    || macintosh_config->ident == MAC_MODEL_IIFX)
		mach_l2_flush = mac_cache_card_flush;
		mach_l2_flush = mac_cache_card_flush;
	}


	/*
	/*
	 * Check for machine specific fixups.
	 * Check for machine specific fixups.
@@ -233,8 +235,7 @@ void __init config_mac(void)
struct mac_model *macintosh_config;
struct mac_model *macintosh_config;
EXPORT_SYMBOL(macintosh_config);
EXPORT_SYMBOL(macintosh_config);


static struct mac_model mac_data_table[]=
static struct mac_model mac_data_table[] = {
{
	/*
	/*
	 *	We'll pretend to be a Macintosh II, that's pretty safe.
	 *	We'll pretend to be a Macintosh II, that's pretty safe.
	 */
	 */
@@ -844,8 +845,8 @@ void mac_identify(void)
		printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
		printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
		MACHW_SET(MAC_SCSI_80);
		MACHW_SET(MAC_SCSI_80);
		break;
		break;

	}
	}

	iop_init();
	iop_init();
	via_init();
	via_init();
	oss_init();
	oss_init();
Loading