diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/arch/m68k/config.in linuxvme-2.1.72/arch/m68k/config.in --- linux68k-2.1.72+/arch/m68k/config.in Tue Dec 23 20:05:01 1997 +++ linuxvme-2.1.72/arch/m68k/config.in Tue Dec 23 20:21:51 1997 @@ -33,14 +33,7 @@ bool 'Apollo support' CONFIG_APOLLO bool 'VME (Motorola and BVM) support' CONFIG_VME if [ "$CONFIG_VME" = "y" ]; then -# bool 'MVME162 support' CONFIG_MVME162 -# if [ "$CONFIG_MVME162" = "y" ]; then -# define_bool CONFIG_MVME16x y -# fi - bool 'MVME166 and MVME167 support' CONFIG_MVME167 - if [ "$CONFIG_MVME167" = "y" ]; then - define_bool CONFIG_MVME16x y - fi + bool 'MVME162, 166 and 167 support' CONFIG_MVME16x # bool 'BVME4000 and BVME6000 support' CONFIG_BVME6000 fi @@ -204,7 +197,7 @@ fi #dep_tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG $CONFIG_SCSI -if [ "$CONFIG_MVME16x" = "y" ]; then +if [ "$CONFIG_VME" = "y" -a "$CONFIG_MVME16x" = "y" ]; then bool 'NCR53C710 SCSI driver for MVME16x' CONFIG_MVME16x_SCSI fi @@ -250,8 +243,8 @@ tristate 'PAMsNet support' CONFIG_ATARI_PAMSNET fi fi -if [ "$CONFIG_MVME16x" = "y" ]; then - bool 'MVME16x Ethernet support' CONFIG_I596 +if [ "$CONFIG_VME" = "y" -a "$CONFIG_MVME16x" = "y" ]; then + bool 'MVME16x Ethernet support' CONFIG_APRICOT fi fi endmenu @@ -329,9 +322,8 @@ fi if [ "$CONFIG_VME" = "y" ]; then define_bool CONFIG_SERIAL_CONSOLE y - if [ "$CONFIG_MVME167" = "y" ]; then - bool 'CD2401 support for MVME166/7 serial ports' CONFIG_SERIAL167 y - fi + bool 'CD2401 support for MVME166/7 serial ports' CONFIG_SERIAL167 + bool 'SCC support for MVME162 serial ports' CONFIG_MVME162_SCC fi if [ "$CONFIG_APOLLO" = "y" ]; then bool 'Support for DN serial port (dummy)' CONFIG_SERIAL diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/arch/m68k/kernel/head.S linuxvme-2.1.72/arch/m68k/kernel/head.S --- linux68k-2.1.72+/arch/m68k/kernel/head.S Tue Dec 23 20:05:49 1997 +++ linuxvme-2.1.72/arch/m68k/kernel/head.S Tue Dec 23 20:12:58 1997 @@ -73,7 +73,7 @@ #include .globl SYMBOL_NAME(kernel_pg_dir), SYMBOL_NAME(kpt) -.globl SYMBOL_NAME(availmem) +.globl SYMBOL_NAME(availmem), SYMBOL_NAME(mvme_bdid_ptr) .globl SYMBOL_NAME(m68k_pgtable_cachemode) .globl SYMBOL_NAME(kernel_pmd_table), SYMBOL_NAME(swapper_pg_dir) @@ -145,8 +145,7 @@ #define is_not_amiga(lab) moveq &MACH_AMIGA,%d7; cmpl %d4,%d7; jne lab #define is_not_atari(lab) moveq &MACH_ATARI,%d7; cmpl %d4,%d7; jne lab -#define is_not_mvme16x(lab) moveq &MACH_MVME162,%d7; cmpl %d4,%d7; jeq 1f; \ - moveq &MACH_MVME167,%d7; cmpl %d4,%d7; jne lab;1: +#define is_not_mvme16x(lab) moveq &MACH_MVME16x,%d7; cmpl %d4,%d7; jne lab #define is_040_or_060(lab) btst &D6B_0460,%d6; jne lab #define is_not_040_or_060(lab) btst &D6B_0460,%d6; jeq lab @@ -164,7 +163,7 @@ .long BOOTINFOV_MAGIC .long MACH_AMIGA, AMIGA_BOOTI_VERSION .long MACH_ATARI, ATARI_BOOTI_VERSION - .long MACH_MVME167, MVME16x_BOOTI_VERSION + .long MACH_MVME16x, MVME16x_BOOTI_VERSION .long 0 1: jra SYMBOL_NAME(_start) @@ -616,9 +615,16 @@ Lnotatari: #endif -#if defined(CONFIG_MVME162) || defined(CONFIG_MVME167) +#if defined(CONFIG_MVME16x) is_not_mvme16x(Lnot16x) + /* Get pointer to board ID data */ + movel %d2,%sp@- + .long 0x4e4f0070 /* trap 0x70 - .BRD_ID */ + movel %sp@+,%d2 + lea %pc@(SYMBOL_NAME(mvme_bdid_ptr)),%a0 + movel %d2,%a0@ + /* * On MVME16x we have already created kernel page tables for * 4MB of RAM at address 0, so now need to do a transparent @@ -827,7 +833,7 @@ Lmapphysnotatari: #endif -#if defined(CONFIG_MVME162) || defined(CONFIG_MVME167) +#if defined(CONFIG_MVME16x) is_not_mvme16x(Lmapphysnot16x) /* * save physaddr of phys mem in register a3 @@ -1062,16 +1068,11 @@ */ Lserial_putc: moveml %a0/%a1,%sp@- -#if defined(CONFIG_MVME162) || defined(CONFIG_MVME167) - cmpil #MACH_MVME162,%d4 - jeq 1f - cmpil #MACH_MVME167,%d4 +#if defined(CONFIG_MVME16x) + cmpil #MACH_MVME16x,%d4 jne 2f -1: - moveml %d0-%d7/%a2-%a6,%sp@- moveb %d7,%sp@- .long 0x4e4f0020 - moveml %sp@+,%d0-%d7/%a2-%a6 2: #endif #ifdef CONFIG_AMIGA @@ -1197,4 +1198,6 @@ SYMBOL_NAME_LABEL(availmem) .long 0 SYMBOL_NAME_LABEL(m68k_pgtable_cachemode) + .long 0 +SYMBOL_NAME_LABEL(mvme_bdid_ptr) .long 0 diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/arch/m68k/kernel/ints.c linuxvme-2.1.72/arch/m68k/kernel/ints.c --- linux68k-2.1.72+/arch/m68k/kernel/ints.c Fri May 16 17:47:10 1997 +++ linuxvme-2.1.72/arch/m68k/kernel/ints.c Tue Dec 23 20:12:58 1997 @@ -25,6 +25,7 @@ * which must be served /Roman Zippel */ +#include #include #include #include @@ -212,11 +213,14 @@ asmlinkage void process_int(unsigned long vec, struct pt_regs *fp) { +#if !defined(CONFIG_MVME16x) if (vec >= VEC_INT1 && vec <= VEC_INT7) { vec -= VEC_SPUR; kstat.interrupts[vec]++; irq_list[vec].handler(vec, irq_list[vec].dev_id, fp); - } else { + } else +#endif + { if (mach_process_int) mach_process_int(vec, fp); else diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/arch/m68k/kernel/setup.c linuxvme-2.1.72/arch/m68k/kernel/setup.c --- linux68k-2.1.72+/arch/m68k/kernel/setup.c Tue Dec 23 20:05:41 1997 +++ linuxvme-2.1.72/arch/m68k/kernel/setup.c Tue Dec 23 20:23:50 1997 @@ -243,8 +243,7 @@ break; #endif #ifdef CONFIG_MVME16x - case MACH_MVME162: - case MACH_MVME167: + case MACH_MVME16x: config_mvme16x(); break; #endif diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/arch/m68k/kernel/time.c linuxvme-2.1.72/arch/m68k/kernel/time.c --- linux68k-2.1.72+/arch/m68k/kernel/time.c Tue Dec 23 20:05:41 1997 +++ linuxvme-2.1.72/arch/m68k/kernel/time.c Tue Dec 23 20:12:59 1997 @@ -7,6 +7,7 @@ * Most of the stuff is located in the machine specific files. */ +#include #include #include #include diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/arch/m68k/kernel/traps.c linuxvme-2.1.72/arch/m68k/kernel/traps.c --- linux68k-2.1.72+/arch/m68k/kernel/traps.c Sat Dec 20 17:19:21 1997 +++ linuxvme-2.1.72/arch/m68k/kernel/traps.c Tue Dec 23 20:24:34 1997 @@ -41,6 +41,9 @@ #include #endif +extern void mvme16x_set_vectors(void); +extern void bvme6000_set_vectors(void); + /* assembler routines */ asmlinkage void system_call(void); asmlinkage void buserr(void); @@ -67,6 +70,13 @@ __initfunc(void base_trap_init(void)) { + /* If running on an MVME16x, copy 16xBug vectors so abort, + * breakpoints, and debug still work... before we modify the VBR */ + if (MACH_IS_MVME16x) + mvme16x_set_vectors(); + else if (MACH_IS_BVME6000) + bvme6000_set_vectors(); + /* setup the exception vector table */ __asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)vectors)); diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/arch/m68k/mvme16x/config.c linuxvme-2.1.72/arch/m68k/mvme16x/config.c --- linux68k-2.1.72+/arch/m68k/mvme16x/config.c Sat Dec 20 17:19:21 1997 +++ linuxvme-2.1.72/arch/m68k/mvme16x/config.c Tue Dec 23 20:13:01 1997 @@ -14,6 +14,7 @@ * for more details. */ +#include #include #include #include @@ -23,11 +24,13 @@ #include #include #include +#include #include #include #include #include +#include #include #include @@ -47,6 +50,9 @@ #define RTC_READ 0x40 #define RTC_STOP 0x20 +int atari_SCC_reset_done = 1; /* So SCC doesn't get reset */ +u_long atari_mch_cookie = 0; + MK48T08 * volatile rtc = (MK48T08 *)0xfffc1ff8; extern void mvme16x_process_int (int level, struct pt_regs *regs); @@ -55,6 +61,8 @@ extern int mvme16x_get_irq_list (char *); extern void mvme16x_enable_irq (unsigned int); extern void mvme16x_disable_irq (unsigned int); +static void mvme16x_get_model(char *model); +static int mvme16x_get_hardware_list(char *buffer); extern int mvme16x_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id); extern void mvme16x_sched_init(void (*handler)(int, void *, struct pt_regs *)); extern int mvme16x_keyb_init(void); @@ -100,12 +108,46 @@ static void mvme16x_get_model(char *model) { - strcpy(model, "Motorola MVME16x"); + p_bdid p = (p_bdid)mvme_bdid_ptr; + char suf[4]; + + suf[1] = p->brdsuffix[0]; + suf[2] = p->brdsuffix[1]; + suf[3] = '\0'; + suf[0] = suf[1] ? '-' : '\0'; + + sprintf(model, "Motorola MVME%x%s", p->brdno, suf); +} + + +static int mvme16x_get_hardware_list(char *buffer) +{ + p_bdid p = (p_bdid)mvme_bdid_ptr; + int len = 0; + + if (p->brdno == 0x0162 || p->brdno == 0x0172) + { + unsigned char rev = *(unsigned char *)MVME162_VERSION_REG; + + len += sprintf (buffer+len, "VMEchip2 %spresent\n", + rev & MVME16x_CONFIG_NO_VMECHIP2 ? "NOT " : ""); + len += sprintf (buffer+len, "SCSI interface %spresent\n", + rev & MVME16x_CONFIG_NO_SCSICHIP ? "NOT " : ""); + len += sprintf (buffer+len, "Ethernet i/f %spresent\n", + rev & MVME16x_CONFIG_NO_ETHERNET ? "NOT " : ""); + } + else + *buffer = '\0'; + + return (len); } __initfunc(void config_mvme16x(void)) { + p_bdid p = (p_bdid)mvme_bdid_ptr; + char id[40]; + mach_sched_init = mvme16x_sched_init; mach_keyb_init = mvme16x_keyb_init; mach_kbdrate = mvme16x_kbdrate; @@ -123,16 +165,26 @@ enable_irq = mvme16x_enable_irq; disable_irq = mvme16x_disable_irq; mach_get_model = mvme16x_get_model; + mach_get_hardware_list = mvme16x_get_hardware_list; /* Report board revision */ - if (m68k_machtype == MACH_MVME162) + if (strncmp("BDID", p->bdid, 4)) + { + printk ("\n\nBug call .BRD_ID returned garbage - giving up\n\n"); + while (1) + ; + } + mvme16x_get_model(id); + printk ("\nBRD_ID: %s BUG %x.%x %02x/%02x/%02x\n", id, p->rev>>4, + p->rev&0xf, p->yr, p->mth, p->day); + if (p->brdno == 0x0162 || p->brdno == 0x172) { unsigned char rev = *(unsigned char *)MVME162_VERSION_REG; mvme16x_config = rev | MVME16x_CONFIG_GOT_SCCA; - printk ("MVME162 Hardware status:\n"); + printk ("MVME%x Hardware status:\n", p->brdno); printk (" CPU Type 68%s040\n", rev & MVME16x_CONFIG_GOT_FPU ? "" : "LC"); printk (" CPU clock %dMHz\n", @@ -255,3 +307,97 @@ { return 0; } + +void mvme16x_set_vectors (void) +{ + p_bdid p = (p_bdid)mvme_bdid_ptr; + unsigned long *new = (unsigned long *)vectors; + unsigned long *old = (unsigned long *)0xffe00000;; + + *(new+4) = *(old+4); /* Illegal instruction */ + *(new+9) = *(old+9); /* Trace */ + *(new+47) = *(old+47); /* Trap #15 */ + + if (p->brdno == 0x0162 || p->brdno == 0x172) + *(new+0x5e) = *(old+0x5e); /* ABORT switch */ + else + *(new+0x6e) = *(old+0x6e); /* ABORT switch */ +} + +/*------------------- Serial console stuff ------------------------*/ + +extern void mvme167_serial_console_setup(int cflag); +extern void serial167_write(struct console *co, const char *str, unsigned cnt); +extern void vme_scc_write(struct console *co, const char *str, unsigned cnt); + + +void mvme16x_init_console_port (struct console *co, int cflag) +{ + p_bdid p = (p_bdid)mvme_bdid_ptr; + + switch (p->brdno) + { +#ifdef CONFIG_MVME162_SCC + case 0x0162: + case 0x0172: + co->write = vme_scc_write; + return; +#endif +#ifdef CONFIG_SERIAL167 + case 0x0166: + case 0x0167: + case 0x0176: + case 0x0177: + co->write = serial167_write; + mvme167_serial_console_setup (cflag); + return; +#endif + default: + panic ("No console support for MVME%x\n", p->brdno); + } + return; +} + + +#ifdef CONFIG_MVME162_SCC + +static void scc_delay (void) +{ + int n; + char i; + + for (n = 0; n < 20; n++) + i = *(volatile char *)0; +} + +static void scc_write (char ch) +{ + volatile char *p = (volatile char *)SCC_A_ADDR; + + do { + scc_delay(); + } + while (!(*p & 4)); + scc_delay(); + *p = 8; + scc_delay(); + *p = ch; +} + + +void vme_scc_write (struct console *co, const char *str, unsigned count) +{ + unsigned long flags; + + save_flags(flags); + cli(); + + while (count--) + { + if (*str == '\n') + scc_write ('\r'); + scc_write (*str++); + } + restore_flags(flags); +} +#endif diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/drivers/char/Makefile linuxvme-2.1.72/drivers/char/Makefile --- linux68k-2.1.72+/drivers/char/Makefile Sat Dec 20 17:19:33 1997 +++ linuxvme-2.1.72/drivers/char/Makefile Tue Dec 23 20:13:01 1997 @@ -544,6 +544,10 @@ L_OBJS += serial167.o endif +ifeq ($(CONFIG_MVME162_SCC),y) +L_OBJS += m68kserial.o atari_SCC.o +endif + include $(TOPDIR)/Rules.make fastdep: diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/drivers/char/atari_SCC.c linuxvme-2.1.72/drivers/char/atari_SCC.c --- linux68k-2.1.72+/drivers/char/atari_SCC.c Sat Dec 20 17:21:29 1997 +++ linuxvme-2.1.72/drivers/char/atari_SCC.c Tue Dec 23 20:13:02 1997 @@ -9,6 +9,8 @@ * * Adapted to 1.2 by Andreas Schwab * + * Adapted to support MVME162 by Richard Hirst + * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive * for more details. @@ -50,8 +52,13 @@ #include #include +#ifdef CONFIG_MVME162_SCC +#include +#endif +#ifdef CONFIG_ATARI_SCC #include #include +#endif #include #include @@ -82,6 +89,9 @@ /* Shadows for all SCC write registers */ static unsigned char SCC_shadow[2][16]; +/* Location to access for SCC register access delay */ +static volatile unsigned char *scc_del; + /* To keep track of STATUS_REG state for detection of Ext/Status int source */ static unsigned char SCC_last_status_reg[2]; @@ -133,9 +143,11 @@ * */ +#ifdef CONFIG_ATARI_SCC /* This table is used if RTxC = 3.672 MHz. This is the case for TT's * channel A and for both channels on the Mega STE/Falcon. (TRxC is unused) */ + static BAUD_ENTRY bdtab_norm[18] = { /* B0 */ { 0, 0 }, /* B50 */ { CLK_RTxC, 4590 }, @@ -180,6 +192,33 @@ /* B57600 */ { CLK_TRxC, 2 }, /* 57600 is not possible, use 76800 instead */ /* B115200 */ { CLK_TRxC, 1 } /* 115200 is not possible, use 153600 instead */ }; +#endif + +#ifdef CONFIG_MVME162_SCC +/* This table is used if RTxC = pCLK = 10 MHz. This is the case for MVME162 + */ +static BAUD_ENTRY bdtab_mvme[18] = { + /* B0 */ { 0, 0 }, + /* B50 */ { CLK_PCLK, 12500 }, + /* B75 */ { CLK_PCLK, 8332 }, + /* B110 */ { CLK_PCLK, 5682 }, + /* B134 */ { CLK_PCLK, 4646 }, + /* B150 */ { CLK_PCLK, 4166 }, + /* B200 */ { CLK_PCLK, 3124 }, + /* B300 */ { CLK_PCLK, 2082 }, + /* B600 */ { CLK_PCLK, 1042 }, + /* B1200 */ { CLK_PCLK, 520 }, + /* B1800 */ { CLK_PCLK, 390 }, + /* B2400 */ { CLK_PCLK, 260 }, + /* B4800 */ { CLK_PCLK, 130 }, + /* B9600 */ { CLK_PCLK, 64 }, + /* B19200 */ { CLK_PCLK, 32 }, + /* B38400 */ { CLK_PCLK, 16 }, + /* B57600 */ { CLK_PCLK, 8 }, + /* B115200 */ { CLK_PCLK, 4 } +}; +#endif + /* User settable tables */ static BAUD_ENTRY bdtab_usr[2][18]; @@ -299,9 +338,11 @@ #define DEFAULT_CHANNEL_A422_LINE 4 /* ttyS4 */ static int chb_line = -1, cha232_line = -1, cha422_line = -1; -static int scca_dma = 0; /* whether DMA is supported at all */ -#ifdef CONFIG_ATARI_SCC_DMA +#ifndef CONFIG_ATARI_SCC_DMA +#define scca_dma 0 /* No DMA support */ +#else +static int scca_dma = 0; /* whether DMA is supported at all */ /* ++TeSche: these next few things are for DMA support on channel A. both * BUFFERS and BUFSIZE must be a power of two (because of speed reasons)! @@ -330,7 +371,12 @@ /***************************** Prototypes *****************************/ +#ifdef CONFIG_ATARI_SCC static void SCC_init_port( struct m68k_async_struct *info, int type, int channel ); +#endif +#ifdef CONFIG_MVME162_SCC +static void vme_init_port( struct m68k_async_struct *info, int type, int channel ); +#endif #ifdef MODULE static void SCC_deinit_port( struct m68k_async_struct *info, int channel ); #endif @@ -338,7 +384,9 @@ static void SCC_spcond_int (int irq, void *data, struct pt_regs *fp); static void SCC_tx_int (int irq, void *data, struct pt_regs *fp); static void SCC_stat_int (int irq, void *data, struct pt_regs *fp); +#ifdef CONFIG_ATARI_SCC static void SCC_ri_int (int irq, void *data, struct pt_regs *fp); +#endif static int SCC_check_open( struct m68k_async_struct *info, struct tty_struct *tty, struct file *file ); static void SCC_init( struct m68k_async_struct *info ); @@ -381,6 +429,112 @@ extern int atari_SCC_reset_done; +#ifdef CONFIG_MVME162_SCC + +int vme_SCC_init( void ) +{ + struct serial_struct req; + int nr = 0; + + if (MACH_IS_MVME16x && !(mvme16x_config & MVME16x_CONFIG_GOT_SCCA)) + return (-ENODEV); + + scc_del = (unsigned char *)0; + + SCC_chan_a_switchable = SCCA_SWITCH_SERIAL2_ONLY; + SCC_PCLK = SCC_BAUD_BASE_MVME_PCLK; + + /* General initialization */ + ChannelsReversed = 4; + SCC_chan_a_open = 0; + + req.line = DEFAULT_CHANNEL_B_LINE; + req.type = SER_SCC_MVME; + req.port = SCC_B_ADDR; + if ((chb_line = register_serial( &req )) >= 0) { + vme_init_port( &rs_table[chb_line], req.type, CHANNEL_B ); + ++nr; + } + else + printk(KERN_WARNING "Cannot allocate ttyS%d for SCC channel B\n", req.line ); + + /* Init channel A, RS232 part (Serial2) */ + req.line = 0; + req.type = SER_SCC_MVME; + req.port = SCC_A_ADDR; + if ((cha232_line = register_serial( &req )) >= 0) { + vme_init_port( &rs_table[cha232_line], req.type, CHANNEL_A ); + ++nr; + } + else + printk(KERN_WARNING "Cannot allocate ttyS%d for SCC channel A\n", req.line ); + /* + * Ensure interrupts are enabled in the MC2 chip + */ + *(volatile char *)0xfff4201d = 0x14; + + return( nr > 0 ? 0 : -ENODEV ); +} + + +static void vme_init_port( struct m68k_async_struct *info, int type, int channel ) +{ + static int called = 0, ch_a_inited = 0; + SCC_ACCESS_INIT(info); + + info->sw = &SCC_switch; + + /* set ISRs, but don't enable interrupts yet (done in init()); + */ + if (channel == CHANNEL_B || !ch_a_inited) { + request_irq(channel ? IRQ_MVME162_SCCB_TX : IRQ_MVME162_SCCA_TX, + SCC_tx_int, IRQ_MVME162_TYPE_PRIO, + channel ? "SCC-B TX" : "SCC-A TX", info); + request_irq(channel ? IRQ_MVME162_SCCB_STAT : IRQ_MVME162_SCCA_STAT, + SCC_stat_int, IRQ_MVME162_TYPE_PRIO, + channel ? "SCC-B status" : "SCC-A status", info); + request_irq(channel ? IRQ_MVME162_SCCB_RX : IRQ_MVME162_SCCA_RX, + SCC_rx_int, IRQ_MVME162_TYPE_PRIO, + channel ? "SCC-B RX" : "SCC-A RX", info); + request_irq(channel ? IRQ_MVME162_SCCB_SPCOND : IRQ_MVME162_SCCA_SPCOND, + SCC_spcond_int, IRQ_MVME162_TYPE_PRIO, + channel ? "SCC-B special cond" : "SCC-A special cond", info); + + } + + /* Hardware initialization */ + + if (!called) { + /* Set the interrupt vector */ + SCCwrite( INT_VECTOR_REG, IRQ_MVME162_SCC_BASE ); + + /* Interrupt parameters: vector includes status, status low */ + SCCwrite( MASTER_INT_CTRL, MIC_VEC_INCL_STAT ); + + /* Set the baud tables */ + SCC_baud_table[CHANNEL_A] = bdtab_mvme; + SCC_baud_table[CHANNEL_B] = bdtab_mvme; + + /* Set the clocks */ + SCC_clocks[CHANNEL_A][CLK_RTxC] = SCC_BAUD_BASE_MVME; + SCC_clocks[CHANNEL_A][CLK_TRxC] = SCC_BAUD_BASE_NONE; + SCC_clocks[CHANNEL_B][CLK_RTxC] = SCC_BAUD_BASE_MVME; + SCC_clocks[CHANNEL_B][CLK_TRxC] = SCC_BAUD_BASE_NONE; + + SCCmod( MASTER_INT_CTRL, 0xff, MIC_MASTER_INT_ENAB ); + } + + /* disable interrupts for this channel */ + SCCwrite( INT_AND_DMA_REG, 0 ); + + called = 1; + if (CHANNR(info) == CHANNEL_A) ch_a_inited = 1; +} + +#endif + +#ifdef CONFIG_ATARI_SCC + int atari_SCC_init( void ) { struct serial_struct req; @@ -393,6 +547,8 @@ !(ATARIHW_PRESENT(SCC) || ATARIHW_PRESENT(ST_ESCC))) return( -ENODEV ); + scc_del = &mfp.par_dt_reg; + #ifdef CONFIG_ATARI_SCC_DMA /* strengthen the condition a bit to be on the safer side... */ @@ -612,27 +768,41 @@ if (CHANNR(info) == CHANNEL_A) ch_a_inited = 1; } +#endif #ifdef MODULE static void SCC_deinit_port( struct m68k_async_struct *info, int channel ) { - free_irq(channel ? IRQ_SCCB_TX : IRQ_SCCA_TX, info); - free_irq(channel ? IRQ_SCCB_STAT : IRQ_SCCA_STAT, info); - free_irq(channel ? IRQ_SCCB_RX : IRQ_SCCA_RX, info); - free_irq(channel ? IRQ_SCCB_SPCOND : IRQ_SCCA_SPCOND, info); - if (channel != 0 && ATARIHW_PRESENT (TT_MFP)) - free_irq(IRQ_TT_MFP_RI, info); +#ifdef CONFIG_ATARI_SCC + if (MACH_IS_ATARI) { + free_irq(channel ? IRQ_SCCB_TX : IRQ_SCCA_TX, info); + free_irq(channel ? IRQ_SCCB_STAT : IRQ_SCCA_STAT, info); + free_irq(channel ? IRQ_SCCB_RX : IRQ_SCCA_RX, info); + free_irq(channel ? IRQ_SCCB_SPCOND : IRQ_SCCA_SPCOND, info); + if (channel != 0 && ATARIHW_PRESENT (TT_MFP)) + free_irq(IRQ_TT_MFP_RI, info); #ifdef CONFIG_ATARI_SCC_DMA - if (channel == CHANNEL_A && scca_dma) { - tt_mfp.int_en_a &= ~0x20; - tt_mfp.int_pn_a = ~0x20; - tt_mfp.int_mk_a &= ~0x20; - free_irq(IRQ_TT_MFP_SCC, info); - free_irq(IRQ_TT_MFP_TIMA, info); - free_pages ((unsigned long)scca_dma_buf[0].buf, - (SCCA_DMA_BUFFERS * SCCA_DMA_BUFSIZE + PAGE_SIZE - 1) >> 12); - kfree (scca_dma_buf[0].err); + if (channel == CHANNEL_A && scca_dma) { + tt_mfp.int_en_a &= ~0x20; + tt_mfp.int_pn_a = ~0x20; + tt_mfp.int_mk_a &= ~0x20; + free_irq(IRQ_TT_MFP_SCC, info); + free_irq(IRQ_TT_MFP_TIMA, info); + free_pages ((unsigned long)scca_dma_buf[0].buf, + (SCCA_DMA_BUFFERS * SCCA_DMA_BUFSIZE + PAGE_SIZE - 1) >> 12); + kfree (scca_dma_buf[0].err); + } +#endif + } +#endif +#ifdef CONFIG_MVME162 + if (MACH_IS_MVME16x) { + free_irq(channel ? IRQ_MVME162_SCCB_TX : IRQ_MVME162_SCCA_TX, info); + free_irq(channel ? IRQ_MVME162_SCCB_STAT : IRQ_MVME162_SCCA_STAT, info); + free_irq(channel ? IRQ_MVME162_SCCB_RX : IRQ_MVME162_SCCA_RX, info); + free_irq(channel ? IRQ_MVME162_SCCB_SPCOND : IRQ_MVME162_SCCA_SPCOND, + info); } #endif } @@ -1132,6 +1302,7 @@ } +#ifdef CONFIG_ATARI_SCC static void SCC_ri_int(int irq, void *data, struct pt_regs *fp) { struct m68k_async_struct *info = data; @@ -1139,6 +1310,7 @@ info->icount.rng++; wake_up_interruptible(&info->delta_msr_wait); } +#endif static void SCC_tx_int( int irq, void *data, struct pt_regs *fp) @@ -1216,9 +1388,6 @@ static int SCC_check_open( struct m68k_async_struct *info, struct tty_struct *tty, struct file *file ) { - unsigned long flags; - unsigned char tmp; - /* If channel A is opened, check if one of the compounded ports (ttyS3 and * ttyS4) is already open, else activate the appropriate port hardware. */ @@ -1250,8 +1419,11 @@ SCC_chan_a_open = 1; SCC_chan_a_line = info->line; SCC_chan_a_info = &rs_table[info->line]; - +#ifdef CONFIG_ATARI_SCC if (SCC_chan_a_switchable == SCCA_SWITCH_BOTH) { + unsigned long flags; + unsigned char tmp; + save_flags(flags); cli(); sound_ym.rd_data_reg_sel = 14; @@ -1266,7 +1438,7 @@ #endif restore_flags(flags); } - +#endif } return( 0 ); } @@ -1277,6 +1449,7 @@ int i, channel = CHANNR(info); unsigned long flags; SCC_ACCESS_INIT(info); +#ifdef CONFIG_ATARI_SCC static const struct { unsigned reg, val; } init_tab[] = { @@ -1340,54 +1513,97 @@ IDR_RX_INT_DISAB | IDR_WAITREQ_RX | IDR_WAITREQ_IS_REQ} }; #endif - +#endif +#ifdef CONFIG_MVME162_SCC + static const struct { + unsigned reg, val; + } mvme_init_tab[] = { + /* Values for MVME162 */ + /* no parity, 1 stop bit, async, 1:16 */ + { AUX1_CTRL_REG, A1CR_PARITY_NONE|A1CR_MODE_ASYNC_1|A1CR_CLKMODE_x16 }, + /* parity error is special cond, ints disabled, no DMA */ + { INT_AND_DMA_REG, IDR_PARERR_AS_SPCOND | IDR_RX_INT_DISAB }, + /* Rx 8 bits/char, no auto enable, Rx off */ + { RX_CTRL_REG, RCR_CHSIZE_8 }, + /* DTR off, Tx 8 bits/char, RTS off, Tx off */ + { TX_CTRL_REG, TCR_CHSIZE_8 }, + /* special features off */ + { AUX2_CTRL_REG, 0 }, + { CLK_CTRL_REG, CCR_RXCLK_BRG | CCR_TXCLK_BRG }, + { DPLL_CTRL_REG, DCR_BRG_ENAB | DCR_BRG_USE_PCLK }, + /* Start Rx */ + { RX_CTRL_REG, RCR_RX_ENAB | RCR_CHSIZE_8 }, + /* Start Tx */ + { TX_CTRL_REG, TCR_TX_ENAB | TCR_RTS | TCR_DTR | TCR_CHSIZE_8 }, + /* Ext/Stat ints: CTS, DCD, SYNC (DSR) */ + { INT_CTRL_REG, ICR_ENAB_DCD_INT | ICR_ENAB_CTS_INT | ICR_ENAB_SYNC_INT }, + /* Reset Ext/Stat ints */ + { COMMAND_REG, CR_EXTSTAT_RESET }, + /* ...again */ + { COMMAND_REG, CR_EXTSTAT_RESET }, + /* Rx int always, TX int off, Ext/Stat int on */ + { INT_AND_DMA_REG, IDR_EXTSTAT_INT_ENAB | + IDR_PARERR_AS_SPCOND | IDR_RX_INT_ALL } + }; +#endif save_flags(flags); cli(); - SCCmod( MASTER_INT_CTRL, 0x3f, - channel == 0 ? MIC_CH_A_RESET : MIC_CH_B_RESET ); - udelay(40); /* extra delay after a reset */ + if (!MACH_IS_MVME16x) { + SCCmod( MASTER_INT_CTRL, 0x3f, + channel == 0 ? MIC_CH_A_RESET : MIC_CH_B_RESET ); + udelay(40); /* extra delay after a reset */ + } +#ifdef CONFIG_ATARI_SCC + if (MACH_IS_ATARI) { #ifdef CONFIG_ATARI_SCC_DMA - if (channel == CHANNEL_A && scca_dma) { + if (channel == CHANNEL_A && scca_dma) { - for (i=0; iactive = 1; - dma_start (); - SCCmod (INT_AND_DMA_REG, 0xff, IDR_RX_INT_SPCOND|IDR_WAITREQ_ENAB); + scca_dma_head->active = 1; + dma_start (); + SCCmod (INT_AND_DMA_REG, 0xff, IDR_RX_INT_SPCOND|IDR_WAITREQ_ENAB); - SCC_flush_tqueue.data = ((struct m68k_async_struct *)info)->tty; + SCC_flush_tqueue.data = ((struct m68k_async_struct *)info)->tty; - } else + } else +#endif + { + for (i=0; itty || !info->tty->termios) return; + channel = CHANNR(info); + + if (MACH_IS_MVME16x && channel == CHANNEL_A) + return; /* Settings controlled by 162Bug */ + cflag = info->tty->termios->c_cflag; baud = cflag & CBAUD; chsize = (cflag & CSIZE) >> 4; @@ -1551,8 +1776,6 @@ else info->flags |= ASYNC_CHECK_CD; - channel = CHANNR(info); - #if DEBUG & DEBUG_SPEED printk( "SCC channel %d: doing new settings:\n", CHANNR(info) ); printk( " baud=%d chsize=%d aflags=%04x base_baud=%d divisor=%d\n", @@ -1570,7 +1793,7 @@ if (baud & CBAUDEX) { baud &= ~CBAUDEX; - if (baud < 1 || baud > 4) + if (baud < 1 || baud > (MACH_IS_MVME16x ? 2 : 4)) info->tty->termios->c_cflag &= ~CBAUDEX; else baud += 15; @@ -1672,13 +1895,13 @@ /* BRG value */ SCCwrite( TIMER_LOW_REG, brgval & 0xff ); SCCwrite( TIMER_HIGH_REG, (brgval >> 8) & 0xff ); + + /* BRG enable and clock source */ + SCCmod( DPLL_CTRL_REG, ~(DCR_BRG_ENAB | DCR_BRG_USE_PCLK), brgmode ); #if DEBUG & DEBUG_SPEED printk( " TIMER_LOW_REG <- %02x\n", SCCread( TIMER_LOW_REG ) ); printk( " TIMER_HIGH_REG <- %02x\n", SCCread( TIMER_HIGH_REG ) ); #endif - - /* BRG enable and clock source */ - SCCmod( DPLL_CTRL_REG, ~(DCR_BRG_ENAB | DCR_BRG_USE_PCLK), brgmode ); #if DEBUG & DEBUG_SPEED printk( " DPLL_CTRL_REG <- %02x\n", SCCread( DPLL_CTRL_REG ) ); #endif @@ -1754,7 +1977,7 @@ static unsigned int SCC_get_modem_info( struct m68k_async_struct *info ) { - unsigned sr, tcr, ri, dsr; + unsigned sr, tcr, ri = 0, dsr = 0; unsigned long flags; SCC_ACCESS_INIT(info); @@ -1767,18 +1990,25 @@ printk( "SCC channel %d: get info, sr=%02x tcr=%02x\n", CHANNR(info), sr, tcr ); #endif - if (CHANNR (info) == 0) + if (MACH_IS_MVME16x) { ri = 0; - else if (ATARIHW_PRESENT (TT_MFP)) - ri = tt_mfp.par_dt_reg & (1 << 3) ? 0 : TIOCM_RNG; - else - ri = mfp.par_dt_reg & (1 << 6) ? 0 : TIOCM_RNG; - - if (ATARIHW_PRESENT (ST_ESCC)) - dsr = st_escc_dsr & (1 << (3 - CHANNR(info))) ? TIOCM_DSR : 0; - else dsr = sr & SR_SYNC_ABORT ? TIOCM_DSR : 0; + } +#ifdef CONFIG_ATARI_SCC + if (MACH_IS_ATARI) { + if (CHANNR (info) == 0) + ri = 0; + else if (ATARIHW_PRESENT (TT_MFP)) + ri = tt_mfp.par_dt_reg & (1 << 3) ? 0 : TIOCM_RNG; + else + ri = mfp.par_dt_reg & (1 << 6) ? 0 : TIOCM_RNG; + if (ATARIHW_PRESENT (ST_ESCC)) + dsr = st_escc_dsr & (1 << (3 - CHANNR(info))) ? TIOCM_DSR : 0; + else + dsr = sr & SR_SYNC_ABORT ? TIOCM_DSR : 0; + } +#endif return (((tcr & TCR_RTS) ? TIOCM_RTS : 0) | ((tcr & TCR_DTR) ? TIOCM_DTR : 0) | ((sr & SR_DCD ) ? TIOCM_CAR : 0) | @@ -1829,7 +2059,8 @@ SCCmod (INT_AND_DMA_REG, ~IDR_RX_INT_MASK, 0); /* disable Rx */ - SCCmod (RX_CTRL_REG, ~RCR_RX_ENAB, 0); + if (!(MACH_IS_MVME16x && CHANNR(info) == CHANNEL_A)) + SCCmod (RX_CTRL_REG, ~RCR_RX_ENAB, 0); } static int SCC_trans_empty (struct m68k_async_struct *info) @@ -1927,7 +2158,7 @@ case TIOCDATSCC: if (!suser()) return( -EPERM ); - +#ifdef CONFIG_ATARI_SCC if (ATARIHW_PRESENT(TT_MFP)) { SCC_clocks[channel][CLK_RTxC] = (channel == CHANNEL_A) ? @@ -1950,7 +2181,7 @@ SCC_baud_table[channel] = ((ATARIHW_PRESENT(TT_MFP) && channel == 1) ? bdtab_TTChB : bdtab_norm); - +#endif return( 0 ); } diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/drivers/char/atari_SCC.h linuxvme-2.1.72/drivers/char/atari_SCC.h --- linux68k-2.1.72+/drivers/char/atari_SCC.h Sat Dec 20 17:19:34 1997 +++ linuxvme-2.1.72/drivers/char/atari_SCC.h Tue Dec 23 20:13:02 1997 @@ -13,7 +13,16 @@ #ifndef _ATARI_SCC_H #define _ATARI_SCC_H +#ifdef CONFIG_MVME162_SCC +#include +#endif +#ifdef CONFIG_ATARI_SCC #include +#endif + +#if !defined(CONFIG_ATARI) +#define ATARIHW_PRESENT(x) 0 +#endif /***********************************************************************/ /* */ @@ -349,7 +358,10 @@ */ #define scc_reg_delay() \ - __asm__ __volatile__ ( "tstb %0" : : "g" (*_mfp_gpip) : "cc" ) + if (MACH_IS_MVME16x) \ + udelay(1); \ + else \ + __asm__ __volatile__ ( "tstb %0" : : "g" (*_scc_del) : "cc" ); /* Another version with only 3 nop's for cases when some other * statement intervenes between the two SCC accesses @@ -358,7 +370,10 @@ */ #define scc_reg3_delay() \ - __asm__ __volatile__ ( "tstb %0" : : "g" (*_mfp_gpip) : "cc" ) + if (MACH_IS_MVME16x) \ + udelay(1); \ + else \ + __asm__ __volatile__ ( "tstb %0" : : "g" (*_scc_del) : "cc" ); struct PARTIAL_SCC { /* just one channel */ @@ -413,7 +428,7 @@ static __inline__ void _SCCwrite( volatile struct PARTIAL_SCC *sc, unsigned char *shadow, - volatile unsigned char *_mfp_gpip, + volatile unsigned char *_scc_del, int regno, unsigned char val, int final_delay ) { @@ -451,8 +466,15 @@ break; case TX_DATA_REG: /* WR8 */ - /* TX_DATA_REG can be accessed directly */ - sc->data = val; + /* TX_DATA_REG can be accessed directly on some h/w */ + if (MACH_IS_MVME16x) + { + sc->ctrl = regno; + scc_reg_delay(); + sc->ctrl = val; + } + else + sc->data = val; break; case MASTER_INT_CTRL: @@ -495,7 +517,7 @@ static __inline__ unsigned char _SCCread( volatile struct PARTIAL_SCC *sc, unsigned char *shadow, - volatile unsigned char *_mfp_gpip, + volatile unsigned char *_scc_del, int regno, int final_delay ) { unsigned char rv; @@ -514,8 +536,15 @@ goto normal_case; case RX_DATA_REG: - /* RR8 can be accessed directly */ - rv = sc->data; + /* RR8 can be accessed directly on some h/w */ + if (MACH_IS_MVME16x) + { + sc->ctrl = 8; + scc_reg_delay(); + rv = sc->ctrl; + } + else + rv = sc->data; break; case CURR_VECTOR_REG: @@ -571,13 +600,12 @@ : "=&a" (_rv) \ : "d" (_SCC_p), "0" (_rv) ); \ _rv; \ - }); \ - volatile unsigned char *_mfp_gpip = &mfp.par_dt_reg + }) -#define SCCwrite(reg,val) _SCCwrite(_SCC_p,_SCC_shadow,_mfp_gpip,(reg),(val),1) -#define SCCwrite_NB(reg,val) _SCCwrite(_SCC_p,_SCC_shadow,_mfp_gpip,(reg),(val),0) -#define SCCread(reg) _SCCread(_SCC_p,_SCC_shadow,_mfp_gpip,(reg),1) -#define SCCread_NB(reg) _SCCread(_SCC_p,_SCC_shadow,_mfp_gpip,(reg),0) +#define SCCwrite(reg,val) _SCCwrite(_SCC_p,_SCC_shadow,scc_del,(reg),(val),1) +#define SCCwrite_NB(reg,val) _SCCwrite(_SCC_p,_SCC_shadow,scc_del,(reg),(val),0) +#define SCCread(reg) _SCCread(_SCC_p,_SCC_shadow,scc_del,(reg),1) +#define SCCread_NB(reg) _SCCread(_SCC_p,_SCC_shadow,scc_del,(reg),0) #define SCCmod(reg,and,or) SCCwrite((reg),(SCCread(reg)&(and))|(or)) diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/drivers/char/m68kserial.c linuxvme-2.1.72/drivers/char/m68kserial.c --- linux68k-2.1.72+/drivers/char/m68kserial.c Sat Dec 20 17:21:29 1997 +++ linuxvme-2.1.72/drivers/char/m68kserial.c Tue Dec 23 20:13:02 1997 @@ -106,6 +106,10 @@ int multiface_init(void); #endif +#ifdef CONFIG_MVME162_SCC +int vme_SCC_init(void); +#endif + #ifdef CONFIG_WHIPPET int whippet_init (void); #endif @@ -156,7 +160,7 @@ "MFP", "MFP w/o ctrl lines", "MIDI", "Amiga builtin", "GVP IO-Extender (16c552)", "BSC MultiFaceCard III", - "Hisoft Whippet" + "Hisoft Whippet", "SCC on VME" }; #define M68K_PORT_MAX (sizeof(serialtypes68k)/sizeof(*serialtypes68k)) #endif @@ -1480,6 +1484,12 @@ whippet_init(); #endif break; + case MACH_MVME16x: +#ifdef CONFIG_MVME162_SCC + vme_SCC_init(); +#endif + break; + } /* end switch on machine type */ #endif @@ -1627,6 +1637,7 @@ unsigned int count); extern int atari_midi_console_wait_key(struct console *co); extern void atari_init_midi_port( int cflag ); +extern void mvme16x_init_console_port (struct console *co, int cflag); /* * Setup initial baud/bits/parity. @@ -1726,6 +1737,8 @@ co->wait_key = atari_midi_console_wait_key; atari_init_midi_port( cflag ); } + else if (MACH_IS_MVME16x && co->index == 0) + mvme16x_init_console_port (co, cflag); } static void dummy_console_write( struct console *co, const char *str, diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/drivers/char/serial167.c linuxvme-2.1.72/drivers/char/serial167.c --- linux68k-2.1.72+/drivers/char/serial167.c Sat Dec 20 17:19:48 1997 +++ linuxvme-2.1.72/drivers/char/serial167.c Tue Dec 23 20:13:02 1997 @@ -101,7 +101,7 @@ DECLARE_TASK_QUEUE(tq_cyclades); struct tty_driver cy_serial_driver, cy_callout_driver; -int serial_console = 64; +extern int serial_console; static struct cyclades_port *serial_console_info = NULL; static unsigned int serial_console_cflag = 0; u_char initial_console_speed; @@ -195,7 +195,6 @@ static void cy_unthrottle(struct tty_struct *); static void config_setup(struct cyclades_port *); extern void console_print(const char *); -void serial_console_write(const char *str, unsigned count); #ifdef CYCLOM_SHOW_STATUS static void show_status(int); #endif @@ -2117,7 +2116,7 @@ break; } restore_flags(flags); - if (current->signal & ~current->blocked) { + if (signal_pending(current)) { retval = -ERESTARTSYS; break; } @@ -2253,24 +2252,9 @@ * ... I wonder what I should do if this fails ... */ -#ifndef CONFIG_SERIAL_CONSOLE_PORT -#define CONFIG_SERIAL_CONSOLE_PORT 0 -#endif - -static int serial_console_device(void) -{ - return MKDEV(TTYAUX_MAJOR, 64 + CONFIG_SERIAL_CONSOLE_PORT); -} - - -long -serial_console_init(long kmem_start, long kmem_end) +void +mvme167_serial_console_setup(int cflag) { - static struct console console = { - serial_console_write, 0, - 0, serial_console_device - }; - volatile unsigned char* base_addr = (u_char *)BASE_ADDR; int ch; u_char spd; @@ -2303,7 +2287,7 @@ my_udelay(20000L); /* Allow time for any active o/p to complete */ if(base_addr[CyCCR] != 0x00){ /* printk(" chip is never idle (CCR != 0)\n"); */ - return (kmem_start); + return; } base_addr[CyCCR] = CyCHIP_RESET; /* Reset the chip */ @@ -2311,7 +2295,7 @@ if(base_addr[CyGFRCR] == 0x00){ /* printk(" chip is not responding (GFRCR stayed 0)\n"); */ - return (kmem_start); + return; } /* @@ -2372,14 +2356,10 @@ my_udelay(20000L); /* Let it all settle down */ - register_console (&console); - printk("CD2401 initialised, chip is rev 0x%02x\n", base_addr[CyGFRCR]); if (badspeed) printk(" WARNING: Failed to identify line speed, rcor=%02x,rbpr=%02x\n", - rcor >> 5, rbpr); - - return(kmem_start); + rcor >> 5, rbpr); } /* serial_console_init */ /* The serial driver boot-time initialization code! @@ -2426,7 +2406,9 @@ DefSpeed = initial_console_speed; serial_console_info = &cy_port[0]; serial_console_cflag = DefSpeed | CS8; +#if 0 serial_console = 64; /*callout_driver.minor_start*/ +#endif } /* Initialize the tty_driver structure */ @@ -2662,6 +2644,9 @@ #endif +#if 0 +/* Dummy routine in mvme16x/config.c for now */ + /* Serial console setup. Called from linux/init/main.c */ void console_setup(char *str, int *ints) @@ -2727,6 +2712,7 @@ serial_console_cflag = cflag; serial_console = ints[1] + 64; /*callout_driver.minor_start*/ } +#endif /* * The following is probably out of date for 2.1.x serial console stuff. @@ -2741,7 +2727,7 @@ * that serial167_init() doesn't leave the chip non-functional. */ -void serial_console_write(const char *str, unsigned count) +void serial167_write(struct console *co, const char *str, unsigned count) { volatile unsigned char *base_addr = (u_char *)BASE_ADDR; unsigned long flags; diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/drivers/char/tty_io.c linuxvme-2.1.72/drivers/char/tty_io.c --- linux68k-2.1.72+/drivers/char/tty_io.c Sat Dec 20 17:21:30 1997 +++ linuxvme-2.1.72/drivers/char/tty_io.c Tue Dec 23 20:13:02 1997 @@ -1929,8 +1929,10 @@ return kmem_start; } -static struct tty_driver dev_tty_driver, dev_console_driver, - dev_syscons_driver; +static struct tty_driver dev_tty_driver, dev_syscons_driver; +#ifdef CONFIG_VT +static struct tty_driver dev_console_driver; +#endif /* * Ok, now we can initialize the rest of the tty devices and can count @@ -1991,13 +1993,14 @@ #if defined(CONFIG_SERIAL) || defined(CONFIG_ATARI_MFPSER) || \ defined(CONFIG_ATARI_SCC) || defined(CONFIG_ATARI_MIDI) || \ defined(CONFIG_AMIGA_BUILTIN_SERIAL) || defined(CONFIG_GVIOEXT) || \ - defined(CONFIG_MULTIFACE_III_TTY) || defined(CONFIG_USERIAL) + defined(CONFIG_MULTIFACE_III_TTY) || defined(CONFIG_USERIAL) || \ + defined(CONFIG_MVME162_SCC) rs_init(); #endif #ifdef CONFIG_ROCKETPORT rp_init(); #endif -#ifdef CONFIG_MVME167 +#ifdef CONFIG_MVME16x serial167_init(); #endif #ifdef CONFIG_CYCLADES diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/drivers/scsi/53c7xx.c linuxvme-2.1.72/drivers/scsi/53c7xx.c --- linux68k-2.1.72+/drivers/scsi/53c7xx.c Sat Dec 20 17:20:21 1997 +++ linuxvme-2.1.72/drivers/scsi/53c7xx.c Tue Dec 23 20:13:03 1997 @@ -2,7 +2,7 @@ * 53c710 driver. Modified from Drew Eckhardts driver * for 53c810 by Richard Hirst [richard@sleepie.demon.co.uk] * Check out PERM_OPTIONS and EXPECTED_CLOCK, which may be defined in the - * relevant machine specific file (eg. mvme166.[ch], amiga7xx.[ch]). + * relevant machine specific file (eg. mvme16x.[ch], amiga7xx.[ch]). * There are also currently some defines at the top of 53c7xx.scr. * The chip type is #defined in script_asm.pl, as well as the Makefile. * Host scsi ID expected to be 7 - see NCR53c7x0_init(). @@ -10,9 +10,9 @@ * I have removed the PCI code and some of the 53c8xx specific code - * simply to make this file smaller and easier to manage. * - * MVME166 issues: + * MVME16x issues: * Problems trying to read any chip registers in NCR53c7x0_init(), as they - * may never have been set by 166Bug (eg. If kernel has come in over tftp). + * may never have been set by 16xBug (eg. If kernel has come in over tftp). */ /* @@ -45,6 +45,9 @@ * validids:0x?? - Bitmask field that disallows certain ID's. * - e.g. 0x03 allows ID 0,1 * - 0x1F allows ID 0,1,2,3,4 + * opthi:n - replace top word of options with 'n' + * optlo:n - replace bottom word of options with 'n' + * - ALWAYS SPECIFY opthi THEN optlo <<<<<<<<<< */ /* @@ -60,7 +63,7 @@ * out brain damaged main boards. * * Other PERM_OPTIONS settings are listed below. Note the actual options - * required are set in the relevant file (mvme166.c, amiga7xx.c, etc): + * required are set in the relevant file (mvme16x.c, amiga7xx.c, etc): * * OPTION_NO_ASYNC * Don't negotiate for asynchronous transfers on the first command @@ -234,6 +237,8 @@ #include +#include +#include #include #include #include @@ -262,11 +267,13 @@ #define NO_IO_SPACE #endif -#ifdef CONFIG_MVME166 -#include +#ifdef CONFIG_MVME16x +#include +#include #define BIG_ENDIAN #define NO_IO_SPACE +#define VALID_IDS #endif #include "scsi.h" @@ -785,7 +792,8 @@ hostdata->talked_to = 0; hostdata->idle = 1; - cache_push(virt_to_bus(hostdata->script), flushsize); + if (!MACH_IS_MVME16x) + cache_push(virt_to_bus(hostdata->script), flushsize); } /* @@ -877,6 +885,11 @@ setup_used[--i] = 1; } + if (check_setup_strings("opthi",&flags,&val,buf)) + hostdata->options = (long long)val << 32; + if (check_setup_strings("optlo",&flags,&val,buf)) + hostdata->options |= val; + NCR53c7x0_local_setup(host); switch (hostdata->chip) { case 710: @@ -887,7 +900,7 @@ hostdata->init_fixup = NCR53c7x0_init_fixup; hostdata->soft_reset = NCR53c7x0_soft_reset; hostdata->run_tests = NCR53c7xx_run_tests; - expected_clock = hostdata->scsi_clock = 50000000; + expected_clock = hostdata->scsi_clock; expected_id = 7; break; default: @@ -915,6 +928,12 @@ hostdata->istat = ((hostdata->chip / 100) == 8) ? ISTAT_REG_800 : ISTAT_REG_700; +/* We have to assume that this may be the first access to the chip, so + * we must set EA in DCNTL. */ + + NCR53c7x0_write8 (DCNTL_REG, DCNTL_10_EA|DCNTL_10_COM); + + /* Only the ISTAT register is readable when the NCR is running, so make sure it's halted. */ ncr_halt(host); @@ -988,7 +1007,7 @@ * On NCR53c700 series chips, DCNTL controls the SCSI clock divisor, * on 800 series chips, it allows for a totem-pole IRQ driver. * NOTE saved_dcntl currently overwritten in init function. - * The value read here may be garbage anyway, MVME166 board at least + * The value read here may be garbage anyway, MVME16x board at least * does not initialise chip if kernel arrived via tftp. */ @@ -997,7 +1016,7 @@ /* * DMODE controls DMA burst length, and on 700 series chips, * 286 mode and bus width - * NOTE: On MVME166, chip may have been reset, so this could be a + * NOTE: On MVME16x, chip may have been reset, so this could be a * power-on/reset default value. */ hostdata->saved_dmode = NCR53c7x0_read8(hostdata->dmode); @@ -1051,11 +1070,11 @@ * with another board. */ -#ifdef CONFIG_MVME166 - if (request_irq(IRQ_MVME166_SCSI, NCR53c7x0_intr, 0, "SCSI-script", NULL)) +#ifdef CONFIG_MVME16x + if (request_irq(IRQ_MVME16x_SCSI, NCR53c7x0_intr, 0, "SCSI-script", NULL)) panic ("Couldn't get SCSI IRQ"); -#ifdef MVME166_INTFLY - else if (request_irq(IRQ_MVME166_FLY, NCR53c7x0_intr, 0, "SCSI-intfly", NULL)) +#ifdef MVME16x_INTFLY + else if (request_irq(IRQ_MVME16x_FLY, NCR53c7x0_intr, 0, "SCSI-intfly", NULL)) panic ("Couldn't get INT_FLY IRQ"); #endif #else @@ -1103,10 +1122,9 @@ } /* - * Function : static int normal_init(Scsi_Host_Template *tpnt, int board, - * int chip, u32 base, int io_port, int irq, int dma, int pcivalid, - * unsigned char pci_bus, unsigned char pci_device_fn, - * long long options); + * Function : static int ncr53c7xx_init(Scsi_Host_Template *tpnt, int board, + * int chip, u32 base, int io_port, int irq, int dma, + * long long options, int clock); * * Purpose : initializes a NCR53c7,8x0 based on base addresses, * IRQ, and DMA channel. @@ -1268,6 +1286,7 @@ hostdata->dsa_len = dsa_len; hostdata->max_cmd_size = max_cmd_size; hostdata->num_cmds = 1; + hostdata->scsi_clock = clock; /* Initialize single command */ tmp = (hostdata->script + hostdata->script_count); #ifdef FORCE_DSA_ALIGNMENT @@ -1392,8 +1411,8 @@ * register. Make sure SCRIPTS start automagically. */ -#if defined(CONFIG_MVME166) - /* We know better what we want than 166Bug does! */ +#if defined(CONFIG_MVME16x) + /* We know better what we want than 16xBug does! */ tmp = DMODE_10_BL_8 | DMODE_10_FC2; #else tmp = NCR53c7x0_read8(DMODE_REG_10); @@ -1543,7 +1562,8 @@ printk("scsi%d : NCR code relocated to 0x%lx (virt 0x%p)\n", host->host_no, virt_to_bus(hostdata->script), hostdata->script); - cache_push(virt_to_bus(hostdata->script), flushsize); + if (!MACH_IS_MVME16x) + cache_push(virt_to_bus(hostdata->script), flushsize); } /* @@ -1597,7 +1617,8 @@ start = virt_to_bus (hostdata->script) + hostdata->E_test_1; hostdata->state = STATE_RUNNING; printk ("scsi%d : test 1", host->host_no); - cache_push(virt_to_bus(hostdata->script), flushsize); + if (!MACH_IS_MVME16x) + cache_push(virt_to_bus(hostdata->script), flushsize); NCR53c7x0_write32 (DSP_REG, start); if (hostdata->options & OPTION_DEBUG_TRACE) NCR53c7x0_write8 (DCNTL_REG, hostdata->saved_dcntl | DCNTL_SSM | @@ -1691,7 +1712,8 @@ hostdata->test_completed = -1; start = virt_to_bus(hostdata->script) + hostdata->E_test_2; hostdata->state = STATE_RUNNING; - cache_clear(virt_to_bus(hostdata->script), flushsize); + if(!MACH_IS_MVME16x) + cache_clear(virt_to_bus(hostdata->script), flushsize); NCR53c7x0_write32 (DSA_REG, virt_to_bus(dsa)); NCR53c7x0_write32 (DSP_REG, start); if (hostdata->options & OPTION_DEBUG_TRACE) @@ -1798,8 +1820,10 @@ patch_abs_32 (cmd->dsa, Ent_dsa_code_template / sizeof(u32), dsa_temp_addr_dsa_value, virt_to_bus(&cmd->dsa_addr)); - cache_push(virt_to_bus(hostdata->script), flushsize); - cache_push(virt_to_bus(cmd->dsa), flushsize); + if (!MACH_IS_MVME16x) { + cache_push(virt_to_bus(hostdata->script), flushsize); + cache_push(virt_to_bus(cmd->dsa), flushsize); + } } /* @@ -2254,6 +2278,16 @@ dsps = NCR53c7x0_read32(DSPS_REG); dsp = (u32 *) bus_to_virt(NCR53c7x0_read32(DSP_REG)); + /* RGH 150597: Frig. Commands which fail with Check Condition are + * Flagged as successful - hack dsps to indicate check condition */ +#if 0 + /* RGH 200597: Need to disable for BVME6000, as it gets Check Conditions + * and then dies. Seems to handle Check Condition at startup, but + * not mid kernel build. */ + if (dsps == A_int_norm_emulateintfly && c && c->result == 2) + dsps = A_int_err_check_condition; +#endif + if (hostdata->options & OPTION_DEBUG_INTR) printk ("scsi%d : DSPS = 0x%x\n", host->host_no, dsps); @@ -2859,7 +2893,8 @@ return SPECIFIC_INT_PANIC; } - flush_cache_all(); + if (!MACH_IS_MVME16x) + flush_cache_all(); } /* @@ -2897,7 +2932,7 @@ NCR53c7x0_soft_reset (struct Scsi_Host *host) { NCR53c7x0_local_declare(); unsigned long flags; -#ifdef CONFIG_MVME166 +#ifdef CONFIG_MVME16x volatile unsigned long v; #endif struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *) @@ -2909,7 +2944,7 @@ /* Disable scsi chip and s/w level 7 ints */ -#ifdef CONFIG_MVME166 +#ifdef CONFIG_MVME16x v = *(volatile unsigned long *)0xfff4006c; v &= ~0x8000; *(volatile unsigned long *)0xfff4006c = v; @@ -2984,7 +3019,7 @@ SIEN_PAR : 0) | SIEN_700_STO | SIEN_RST | SIEN_UDC | SIEN_SGE | SIEN_MA); -#ifdef CONFIG_MVME166 +#ifdef CONFIG_MVME16x /* Enable scsi chip and s/w level 7 ints */ v = *(volatile unsigned long *)0xfff40080; @@ -3681,7 +3716,8 @@ * soon as it is idle. */ - flush_cache_all(); + if (!MACH_IS_MVME16x) + flush_cache_all(); if (hostdata->idle) { hostdata->idle = 0; @@ -4083,7 +4119,7 @@ done = 1; for (host = first_host; host; host = host->next) if (host->hostt == the_template -#if defined(MVME166_INTFLY) +#if defined(MVME16x_INTFLY) /* We have two different interrupts pointing * at this routine, so remove this check */ #else @@ -4107,7 +4143,7 @@ istat = NCR53c7x0_read8(hostdata->istat); if ((hostdata->options & OPTION_INTFLY) && -#ifdef MVME166_INTFLY +#ifdef MVME16x_INTFLY /* the bit is set which indicates an on-the-fly int */ (*(volatile unsigned long *)0xfff40068 & 0x8000)) #else @@ -4118,7 +4154,7 @@ done = 0; interrupted = 1; -#ifdef MVME166_INTFLY +#ifdef MVME16x_INTFLY /* clear the INTFLY bit */ *(volatile unsigned long *)0xfff40074 = 0x8000; #endif @@ -4295,7 +4331,8 @@ #endif hostdata->state = STATE_RUNNING; - flush_cache_all(); + if (!MACH_IS_MVME16x) + flush_cache_all(); NCR53c7x0_write32 (DSP_REG, virt_to_bus(hostdata->dsp)); if (hostdata->options & OPTION_DEBUG_TRACE) { #ifdef CYCLIC_TRACE @@ -4620,7 +4657,9 @@ where = "non-BMI dynamic DSA code"; action = ACTION_ABORT_PRINT; } - } else if (dsp == (hostdata->script + hostdata->E_select_msgout / 4)) { + } else if (dsp == (hostdata->script + hostdata->E_select_msgout / 4 + 2)) { + /* RGH 290697: Added +2 above, to compensate for the script + * instruction which disables the selection timer. */ /* Release ATN */ NCR53c7x0_write8 (SOCL_REG, 0); switch (sbcl) { @@ -4703,7 +4742,8 @@ } #endif - cache_push(virt_to_bus(hostdata->script), flushsize); + if (!MACH_IS_MVME16x) + cache_push(virt_to_bus(hostdata->script), flushsize); } /* @@ -4777,7 +4817,7 @@ */ if (retry == NEVER) { - printk(KERN_ALERT " mail drew@PoohSticks.ORG\n"); + printk(KERN_ALERT " mail ricahrd@sleepie.demon.co.uk\n"); FATAL (host); } } @@ -5048,7 +5088,7 @@ * FIXME : (void *) cast in virt_to_bus should be unnecessary, because * it should take const void * as argument. */ -#ifndef CONFIG_MVME166 +#ifndef CONFIG_MVME16x sprintf(buf, "%s0x%lx (virt 0x%p) : 0x%08x 0x%08x (virt 0x%p)", (prefix ? prefix : ""), virt_to_bus((void *) insn), insn, insn[0], insn[1], bus_to_virt (insn[1])); @@ -5061,7 +5101,7 @@ #endif tmp = buf + strlen(buf); if ((dcmd & DCMD_TYPE_MASK) == DCMD_TYPE_MMI) { -#ifndef CONFIG_MVME166 +#ifndef CONFIG_MVME16x sprintf (tmp, " 0x%08x (virt 0x%p)\n", insn[2], bus_to_virt(insn[2])); #else diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/drivers/scsi/mvme16x.c linuxvme-2.1.72/drivers/scsi/mvme16x.c --- linux68k-2.1.72+/drivers/scsi/mvme16x.c Sat Dec 20 17:20:24 1997 +++ linuxvme-2.1.72/drivers/scsi/mvme16x.c Tue Dec 23 20:13:04 1997 @@ -25,9 +25,13 @@ #include struct proc_dir_entry proc_scsi_mvme16x = { - PROC_SCSI_MVME16x, 5, "MVME16x", + PROC_SCSI_MVME16x, 7, "MVME16x", S_IFDIR | S_IRUGO | S_IXUGO, 2 }; + +extern ncr53c7xx_init (Scsi_Host_Template *tpnt, int board, int chip, + u32 base, int io_port, int irq, int dma, + long long options, int clock); int mvme16x_scsi_detect(Scsi_Host_Template *tpnt) { diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/fs/proc/array.c linuxvme-2.1.72/fs/proc/array.c --- linux68k-2.1.72+/fs/proc/array.c Sat Dec 20 17:20:49 1997 +++ linuxvme-2.1.72/fs/proc/array.c Tue Dec 23 20:13:04 1997 @@ -1094,7 +1094,7 @@ #ifdef CONFIG_ZORRO extern int zorro_get_list(char *); #endif -#if defined (CONFIG_AMIGA) || defined (CONFIG_ATARI) +#if defined (CONFIG_AMIGA) || defined (CONFIG_ATARI) || defined (CONFIG_VME) extern int get_hardware_list(char *); #endif #ifdef CONFIG_STRAM_PROC @@ -1184,7 +1184,7 @@ case PROC_ZORRO: return zorro_get_list(page); #endif -#if defined (CONFIG_AMIGA) || defined (CONFIG_ATARI) +#if defined (CONFIG_AMIGA) || defined (CONFIG_ATARI) || defined (CONFIG_VME) case PROC_HARDWARE: return get_hardware_list(page); #endif diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/fs/proc/root.c linuxvme-2.1.72/fs/proc/root.c --- linux68k-2.1.72+/fs/proc/root.c Tue Dec 23 20:05:27 1997 +++ linuxvme-2.1.72/fs/proc/root.c Tue Dec 23 20:13:04 1997 @@ -453,7 +453,7 @@ S_IFREG | S_IRUGO, 1, 0, 0, 0, &proc_array_inode_operations }; -#if defined (CONFIG_AMIGA) || defined (CONFIG_ATARI) +#if defined (CONFIG_AMIGA) || defined (CONFIG_ATARI) || defined (CONFIG_VME) static struct proc_dir_entry proc_root_hardware = { PROC_HARDWARE, 8, "hardware", S_IFREG | S_IRUGO, 1, 0, 0, @@ -648,7 +648,7 @@ #endif proc_register(&proc_root, &proc_openprom); #endif -#if defined (CONFIG_AMIGA) || defined (CONFIG_ATARI) +#if defined (CONFIG_AMIGA) || defined (CONFIG_ATARI) || defined (CONFIG_VME) proc_register(&proc_root, &proc_root_hardware); #endif #ifdef CONFIG_STRAM_PROC diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/include/asm-m68k/atari_SCCserial.h linuxvme-2.1.72/include/asm-m68k/atari_SCCserial.h --- linux68k-2.1.72+/include/asm-m68k/atari_SCCserial.h Sat Aug 24 12:45:06 1996 +++ linuxvme-2.1.72/include/asm-m68k/atari_SCCserial.h Tue Dec 23 20:13:04 1997 @@ -28,6 +28,10 @@ #define SCC_BAUD_BASE_NONE 0 /* for not connected or unused * clock sources */ +#define SCC_BAUD_BASE_MVME_PCLK 781250 /* 12.5 MHz */ +#define SCC_BAUD_BASE_BVM 460800 /* 7.3728 MHz */ +#define SCC_BAUD_BASE_MVME 625000 /* 10.000 MHz */ + /* The SCC configuration structure */ struct atari_SCCserial { diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/include/asm-m68k/mvme16xhw.h linuxvme-2.1.72/include/asm-m68k/mvme16xhw.h --- linux68k-2.1.72+/include/asm-m68k/mvme16xhw.h Sat Dec 20 17:20:54 1997 +++ linuxvme-2.1.72/include/asm-m68k/mvme16xhw.h Tue Dec 23 20:13:04 1997 @@ -3,6 +3,24 @@ #include +/* Board ID data structure - pointer to this retrieved from Bug by head.S */ + +/* Note, bytes 12 and 13 are board no in BCD (0162,0166,0167,0177,etc) */ + +extern long mvme_bdid_ptr; + +typedef struct { + char bdid[4]; + u_char rev, mth, day, yr; + u_short size, reserved; + u_short brdno; + char brdsuffix[2]; + u_long options; + u_short clun, dlun, ctype, dnum; + u_long option2; +} t_bdid, *p_bdid; + + typedef struct { u_char ack_icr, flt_icr, @@ -22,7 +40,10 @@ #define I596_BASE 0xfff46000 -#define IRQ_TYPE_PRIO 0 +#define SCC_A_ADDR 0xfff45005 +#define SCC_B_ADDR 0xfff45001 + +#define IRQ_MVME162_TYPE_PRIO 0 #define IRQ_MVME167_PRN 0x54 #define IRQ_MVME16x_I596 0x57 @@ -35,15 +56,15 @@ #define IRQ_MVME16x_TIMER 0x59 /* SCC interrupts, for MVME162 */ -#define IRQ_SCC_BASE 0x40 -#define IRQ_SCCB_TX 0x40 -#define IRQ_SCCB_STAT 0x42 -#define IRQ_SCCB_RX 0x44 -#define IRQ_SCCB_SPCOND 0x46 -#define IRQ_SCCA_TX 0x48 -#define IRQ_SCCA_STAT 0x4a -#define IRQ_SCCA_RX 0x4c -#define IRQ_SCCA_SPCOND 0x4e +#define IRQ_MVME162_SCC_BASE 0x40 +#define IRQ_MVME162_SCCB_TX 0x40 +#define IRQ_MVME162_SCCB_STAT 0x42 +#define IRQ_MVME162_SCCB_RX 0x44 +#define IRQ_MVME162_SCCB_SPCOND 0x46 +#define IRQ_MVME162_SCCA_TX 0x48 +#define IRQ_MVME162_SCCA_STAT 0x4a +#define IRQ_MVME162_SCCA_RX 0x4c +#define IRQ_MVME162_SCCA_SPCOND 0x4e /* MVME162 version register */ @@ -63,5 +84,35 @@ #define MVME16x_CONFIG_GOT_CD2401 0x0200 #define MVME16x_CONFIG_GOT_SCCA 0x0400 #define MVME16x_CONFIG_GOT_SCCB 0x0800 + +/* Specials for the ethernet driver */ + +#define CA() (((struct i596_reg *)dev->base_addr)->ca = 1) + +#define MPU_PORT(c,x) \ + ((struct i596_reg *)(dev->base_addr))->porthi = ((c) | (u32)(x)) & 0xffff; \ + ((struct i596_reg *)(dev->base_addr))->portlo = ((c) | (u32)(x)) >> 16 + +#define SCP_SYSBUS 0x00000054 + +#define WSWAPrfd(x) ((struct i596_rfd *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) +#define WSWAPrbd(x) ((struct i596_rbd *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) +#define WSWAPiscp(x) ((struct i596_iscp *)(((u32)(x)<<16) | ((((u32)(x)))>>16))) +#define WSWAPscb(x) ((struct i596_scb *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) +#define WSWAPcmd(x) ((struct i596_cmd *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) +#define WSWAPtbd(x) ((struct i596_tbd *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) +#define WSWAPchar(x) ((char *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) + +/* + * The MPU_PORT command allows direct access to the 82596. With PORT access + * the following commands are available (p5-18). The 32-bit port command + * must be word-swapped with the most significant word written first. + */ +#define PORT_RESET 0x00 /* reset 82596 */ +#define PORT_SELFTEST 0x01 /* selftest */ +#define PORT_ALTSCP 0x02 /* alternate SCB address */ +#define PORT_ALTDUMP 0x03 /* Alternate DUMP address */ + +#define ISCP_BUSY 0x00010000 #endif /* _M68K_MVME16xHW_H_ */ diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/include/asm-m68k/serial.h linuxvme-2.1.72/include/asm-m68k/serial.h --- linux68k-2.1.72+/include/asm-m68k/serial.h Sat Dec 20 17:20:54 1997 +++ linuxvme-2.1.72/include/asm-m68k/serial.h Tue Dec 23 20:13:04 1997 @@ -32,6 +32,7 @@ #define SER_IOEXT 106 /* Amiga GVP IO-Extender (16c552) */ #define SER_MFC_III 107 /* Amiga BSC Multiface Card III (MC68681) */ #define SER_WHIPPET 108 /* Amiga Hisoft Whippet PCMCIA (16c550B) */ +#define SER_SCC_MVME 109 /* MVME162/MVME172 ports */ struct serial_struct { int type; diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/include/asm-m68k/setup.h linuxvme-2.1.72/include/asm-m68k/setup.h --- linux68k-2.1.72+/include/asm-m68k/setup.h Sat Dec 20 17:20:54 1997 +++ linuxvme-2.1.72/include/asm-m68k/setup.h Tue Dec 23 20:13:04 1997 @@ -36,9 +36,8 @@ #define MACH_APOLLO 4 #define MACH_SUN3 5 #define MACH_MVME147 6 -#define MACH_MVME162 7 -#define MACH_MVME167 8 -#define MACH_BVME6000 9 +#define MACH_MVME16x 7 +#define MACH_BVME6000 8 #ifdef __KERNEL__ @@ -48,7 +47,8 @@ #if !defined(CONFIG_AMIGA) # define MACH_IS_AMIGA (0) -#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) +#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \ + || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) # define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA) #else # define MACH_AMIGA_ONLY @@ -58,7 +58,8 @@ #if !defined(CONFIG_ATARI) # define MACH_IS_ATARI (0) -#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \ + || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) # define MACH_IS_ATARI (m68k_machtype == MACH_ATARI) #else # define MACH_ATARI_ONLY @@ -76,13 +77,37 @@ #if !defined (CONFIG_APOLLO) # define MACH_IS_APOLLO (0) -#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) -# define MACH_IS_APOLLO (boot_info.machtype == MACH_APOLLO) +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ + || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) +# define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO) #else # define CONFIG_APOLLO_ONLY # define MACH_IS_APOLLO (1) # define MACH_TYPE (MACH_APOLLO) #endif + +#if !defined (CONFIG_MVME16x) +# define MACH_IS_MVME16x (0) +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ + || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) +# define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x) +#else +# define CONFIG_MVME16x_ONLY +# define MACH_IS_MVME16x (1) +# define MACH_TYPE (MACH_MVME16x) +#endif + +#if !defined (CONFIG_BVME6000) +# define MACH_IS_BVME6000 (0) +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ + || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) +# define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000) +#else +# define CONFIG_BVME6000_ONLY +# define MACH_IS_BVME6000 (1) +# define MACH_TYPE (MACH_BVME6000) +#endif + #ifndef MACH_TYPE # define MACH_TYPE (m68k_machtype) diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/include/linux/tty.h linuxvme-2.1.72/include/linux/tty.h --- linux68k-2.1.72+/include/linux/tty.h Sat Dec 20 17:21:04 1997 +++ linuxvme-2.1.72/include/linux/tty.h Tue Dec 23 20:13:04 1997 @@ -304,6 +304,7 @@ extern int pc_init(void); extern int vcs_init(void); extern int cy_init(void); +extern int serial167_init(void); extern int stl_init(void); extern int stli_init(void); extern int riscom8_init(void); diff -ur -x RCS -x asm -x *.ver -x *.[ao] -x .depend -x .version -x .hdepend -x uni_hash.tbl -x image.gz -x compile.h -x .config -x .config.old -x System.map* -x vmlinux* -x bootstrap -x *~ -x config.old -x *.orig -x *.rej -x 53c7xx_[ud].h -x loader.bin -x bi.bin -x mkimage -x *# -x version.h -x autoconf.h --new-file linux68k-2.1.72+/init/main.c linuxvme-2.1.72/init/main.c --- linux68k-2.1.72+/init/main.c Sat Dec 20 17:21:32 1997 +++ linuxvme-2.1.72/init/main.c Tue Dec 23 20:13:04 1997 @@ -539,7 +539,9 @@ #ifdef CONFIG_STRAM_SWAP { "stram_swap=", stram_swap_setup }, #endif -#if defined(CONFIG_A4000T_SCSI) || defined(CONFIG_WARPENGINE_SCSI) || defined(CONFIG_A4091_SCSI) +#if defined(CONFIG_A4000T_SCSI) || defined(CONFIG_WARPENGINE_SCSI) \ + || defined(CONFIG_A4091_SCSI) || defined(CONFIG_MVME16x_SCSI) \ + || defined(CONFIG_BVME6000_SCSI) { "53c7xx=", ncr53c7xx_setup }, #endif #if defined(CONFIG_A3000_SCSI) || defined(CONFIG_A2091_SCSI) \