Subject: Re: 3/9/97 kernel on Q650...
To: xiamin <ingerrn@cris.com>
From: Stephen C. Brown <sbrown@shellx.best.com>
List: port-mac68k
Date: 03/11/1997 04:22:48
>compiling the sources from the ninth gave me no video...i assume the
>magic from madhatter hasnt beeen worked into the official source...
>-xiamin

It's not in the official source but I just uploaded the diffs along
with a new kernel version to my ftp provider:

 <ftp.best.com/pub.s/sbrown/NetBSD/kernels/madhatter#37.tar.gz>

I have downloaded the developer notes for ALL of the quadra systems.
Poring over the address maps listed therein, it seems that, with
the exception of the "AV" systems, they all map the "video slot space"
to address 0xf9000000.  So, the latest patch consists of the following:

*** machdep.c   1997/01/08 02:08:37     1.3
--- machdep.c   1997/03/11 11:23:00
***************
*** 2411,2429 ****
--- 2400,2423 ----
        case MACH_CLASSQ2:
        case MACH_CLASSAV:
                VIA2 = 1;
                IOBase = 0x50f00000;
                Via1Base = (volatile u_char *) IOBase;
                mac68k_machine.scsi96 = 1;
                mac68k_machine.sccClkConst = 115200;
                via_reg(VIA1, vIER) = 0x7f;     /* disable VIA1 int */
                via_reg(VIA2, vIER) = 0x7f;     /* disable VIA2 int */
+               if(cpui->class != MACH_CLASSAV)
+               {
+                         mac68k_vidlog = mac68k_vidphys = 0xf9000000;
+                         mac68k_vidlen = 1 * 1024 * 1024;
+               }
                break;
        case MACH_CLASSIIci:
                VIA2 = 0x13;
                IOBase = 0x50f00000;
                Via1Base = (volatile u_char *) IOBase;
                mac68k_machine.scsi80 = 1;
                mac68k_machine.sccClkConst = 115200;
                via_reg(VIA1, vIER) = 0x7f;     /* disable VIA1 int */
                via_reg(VIA2, rIER) = 0x7f;     /* disable RBV int */
                break;

--------------------------------------------------------------------------------

As you can probably tell by glancing at the above code, the latest
kernel and patch will not work on the "AV" systems.  Could someone
with an "AV" system verify exactly what those systems do with the
video mapping??

If anyone's interested, the old "madhatter" patch just involved
changing the line in grfiv_match() in grf_iv.c that read:

        if(!internal_video_found || (mac68k_vidlog == 0 ))

to read:

        if(!internal_video_found)

This basically has the effect of letting the video go ahead and
exist at whereever it is(typically address 0).  While this seems
to work with no problem, it's not a clean solution and is a really
heinous hack that resulted from my desparation in trying to get
video working on my Q610.  Flame me if you will, but it worked..

Steve Brown,
sbrown@best.com

p.s.  When I mention all "quadra" systems, that includes the
        "centris" systems as they are identical in the memory
        mapping.  If anyone with a non-AV quadra has problems
        with the patch, please let me know.