Subject: Re: MI console detection
To: Matthias Drochner <M.Drochner@fz-juelich.de>
From: Martin Husemann <martin@duskware.de>
List: tech-kern
Date: 10/31/2002 16:08:54
On Thu, Oct 31, 2002 at 03:53:06PM +0100, Matthias Drochner wrote:

> In most cases, the driver's cnattach() has to be called anyway
> in early bootstrap to do some initializations.
> The cn_tab pointer has to be set early too.

Hmm, this is not true for suns, which just use the firmware for console
input/output until some driver takes over the console (which might not
even happen).

But I see that on other ports the urgent need for an early console driver
naturally fixes the problem.

> Or are there sparc/ofw specifics I'm missing?

Probably not. We know from firmware which OF node the console device is,
and when iterating the OF device tree the bus driver maps that OF nodes to
devices before calling config_found(). We could make the call to 
mach64_cnattach from the pcibus implementation just before attaching it,
but that's not realy a nice thing.

We could have a fixed lists of possible console devices (represented by their
cnattach function pointer, #if NDRIVER > 0'd) and some function to match that
list against the OF node we know the console input/output is on.

That's probably close to what alpha does now.

All this is not realy needed if we accept a few (!) #ifdef's in MI drivers
from time to time, and to me it is not clear if it's worth the effort.


Martin