Subject: Re: RasterOps 24S (was: ae0: device timeout on 1.5.x)
To: NetBSD/mac68k list <port-mac68k@netbsd.org>
From: John Valdes <valdes@uchicago.edu>
List: port-mac68k
Date: 01/06/2002 23:21:28
Another follow-up to myself...

On Sat, Jan 05, 2002 at 04:37:59PM -0600, I wrote:
> Well, I've peeked around in MacsBug some more, and I have now located
> the interrupt handler [...]
> While it's ugly, at least for a first
> iteration, I think I'll simply transcribe the assembly of the
> interrupt routine into a function much like grfmv_intr_cb364() in
> grf_nubus.c.

After reading through the assembly to see what the interrupt handler
was doing, I saw that all branches and subroutine returns eventually
found their way to the statement:

        MOVE.L     #$00000001,($00FE6014,A0)

which simply sets bit 0 of card offset 0xfe6014.  So as a zeroth
iteration, I simply added:

        case NUBUS_DRHW_ROPS24S:
                sc->cli_offset = 0xfe6014;
                sc->cli_value = 0x01;
                add_nubus_intr(na->slot, grfmv_intr_generic_write4, sc);
                break;

around line 311 to grf_nubus.c, where NUBUS_DRHW_ROPS24S is #define'd
as 0x0287 in nubus.h, and rebuilt the kernel.

I'm now happy to report that with this simple addition, the kernel
booted, and my Asante ethernet card is now working! :) I still have
some questions, however:

1) Is this sufficient, or should the full interrupt routine be
   implemented (see my previous message)?  While there is one path
   through the routine which results in just the one statement above
   being executed--if bit 1 of 0xfe6028 is 0 and if bits 0 & 1 of
   0xfe600c are 0--under other conditions, 11 values are written to 11
   different locations.  Any guesses as to what these do?

2) Do any other kernel sources need to be updated in order to "fully
   support" this card under NetBSD?  As it is now, I can use X in
   black & white using the stock X server from 1.5.2, and I can
   display colors (though w/o any control over which colors) when
   using an "OSFA" X server (the server runs with an 8-bit StaticGray
   visual) if I boot with the card set to 8-bit color under MacOS.
   With the SLOTMAN 1.4.2 kernel, I had 8-bit PseudoColor when using
   an old "colorkit" X server (which now only gives me black and white
   and only if I boot in 1-bit mode).

3) An academic question: why would a video card generate an interrupt?
   In my naive understanding, I believe interrupts would be generated
   whenever a card needs access to the bus and/or needs to be serviced
   by the CPU, but, being an output-only device, why/when would a
   video card need access to the bus or need to be serviced?  Is it
   just that the card generates an interrupt at boot, and after that
   point it is quiet?

John