Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/arch/mac68k/mac68k Pull up following revision(s) (req...



details:   https://anonhg.NetBSD.org/src/rev/80ba5072b189
branches:  netbsd-9
changeset: 962041:80ba5072b189
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Apr 28 09:46:39 2021 +0000

description:
Pull up following revision(s) (requested by rin in ticket #1258):

        sys/arch/mac68k/mac68k/machdep.c: revision 1.361
        sys/arch/mac68k/mac68k/machdep.c: revision 1.362

Make mac68k_set_io_offsets() a little bit cleaner:
- Via1Base is always ``base'' for all supported models.
- Set sccA and SCSIBase for each model of MACH_CLASSQ class.
- Some style fixes.

No functional changes intended.

Change sccA address for Quadra 800 from base + 0xc000 to 0xc020.

The H/W partially decodes its address, and sccA is available at
offsets 0xc000, 0xc020, .... The functionality is same, but Mac
toolbox ROM routines use 0xc020, and QEMU for Quadra 800 only
supports this address.

diffstat:

 sys/arch/mac68k/mac68k/machdep.c |  37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diffs (107 lines):

diff -r cb5d000d81d4 -r 80ba5072b189 sys/arch/mac68k/mac68k/machdep.c
--- a/sys/arch/mac68k/mac68k/machdep.c  Wed Apr 28 04:54:19 2021 +0000
+++ b/sys/arch/mac68k/mac68k/machdep.c  Wed Apr 28 09:46:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.353.2.2 2021/04/27 10:31:17 martin Exp $ */
+/*     $NetBSD: machdep.c,v 1.353.2.3 2021/04/28 09:46:39 martin Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.353.2.2 2021/04/27 10:31:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.353.2.3 2021/04/28 09:46:39 martin Exp $");
 
 #include "opt_adb.h"
 #include "opt_copy_symtab.h"
@@ -2109,24 +2109,33 @@
 mac68k_set_io_offsets(vaddr_t base)
 {
 
+       Via1Base = (volatile u_char *)base;
+       Via2Base = Via1Base + 0x2000 * VIA2;
        switch (current_mac_model->class) {
        case MACH_CLASSQ:
-               Via1Base = (volatile u_char *)base;
-
-               /* The following two may be overridden. */
-               sccA = (volatile u_char *)base + 0xc000;
-               SCSIBase = base + 0xf000;
-
                switch (current_mac_model->machineid) {
                case MACH_MACQ900:
                case MACH_MACQ950:
+                       sccA = (volatile u_char *)base + 0xc020;
+                       SCSIBase = base + 0xf000;
                        mac68k_machine.scsi96_2 = 1;
-                       sccA = (volatile u_char *)base + 0xc020;
                        iop_init(0);    /* For console */
                        break;
+               case MACH_MACQ800:
+                       /*
+                        * The H/W partially decode address for sccA; it is
+                        * available at offsets 0xc000, 0xc020, .... Here,
+                        * we choose 0xc020, where Mac toolbox ROM uses.
+                        */
+                       sccA = (volatile u_char *)base + 0xc020;
+                       SCSIBase = base + 0x10000;
+                       break;
                case MACH_MACQ700:
+                       sccA = (volatile u_char *)base + 0xc000;
+                       SCSIBase = base + 0xf000;
                        break;
                default:
+                       sccA = (volatile u_char *)base + 0xc000;
                        SCSIBase = base + 0x10000;
                        break;
                }
@@ -2137,7 +2146,6 @@
                 * machines.  This seems to be common on many of the
                 * Quadra-type machines.
                 */
-               Via1Base = (volatile u_char *)base;
                sccA = (volatile u_char *)base + 0xc020;
                SCSIBase = base + 0x10000;
                break;
@@ -2146,12 +2154,10 @@
                 * Here's a queer bird... it seems to be a cross between
                 * the two different Quadra classes.
                 */
-               Via1Base = (volatile u_char *) base;
-               sccA = (volatile u_char *) base + 0xc020;
+               sccA = (volatile u_char *)base + 0xc020;
                SCSIBase = base;
                break;
        case MACH_CLASSAV:
-               Via1Base = (volatile u_char *)base;
                sccA = (volatile u_char *)base + 0x4000;
                SCSIBase = base + 0x18000;
                PSCBase = (volatile u_char *)base + 0x31000;
@@ -2163,8 +2169,7 @@
        case MACH_CLASSIIsi:
        case MACH_CLASSIIvx:
        case MACH_CLASSLC:
-               Via1Base = (volatile u_char *)base;
-               sccA = (volatile u_char *) base + 0x4000;
+               sccA = (volatile u_char *)base + 0x4000;
                SCSIBase = base;
                break;
        case MACH_CLASSIIfx:
@@ -2173,7 +2178,6 @@
                 * the serial port in `compatible' mode (set in
                 * the Serial Switch control panel before booting).
                 */
-               Via1Base = (volatile u_char *)base;
                sccA = (volatile u_char *)base + 0x4020;
                SCSIBase = base;
                iop_init(0);    /* For console */
@@ -2184,7 +2188,6 @@
                    current_mac_model->class);
                break;
        }
-       Via2Base = Via1Base + 0x2000 * VIA2;
 }
 
 #if GRAYBARS



Home | Main Index | Thread Index | Old Index