Subject: Re: Problems with autoconf matching
To: Quentin Garnier <cube@cubidou.net>
From: Jachym Holecek <freza@NetBSD.org>
List: tech-kern
Date: 09/02/2007 17:15:03
# Quentin Garnier 2007-09-01:
> On Sat, Sep 01, 2007 at 05:25:17PM +0200, Julio M. Merino Vidal wrote:
> > AIUI, as genfb returns 5 during match and intvid returns 1, autoconf  
> > should simply discard intvid and use genfb, isn't it?  It should  
> > behave as if intvid's match returned 0, as the last test I did.  But  
> > for some reason there seems to be a problem in this.  Or is my  
> > reasoning wrong?
> 
> No, and yes.
> 
> [...]
> 
> You have ways around that:  for instance, you could use config_defer(9)
> in intvid(4) so that it doesn't do any actual work if a genfb(4) has
> attached to obio(4).

Well, this sounds hacky...

> In the case of direct configuration, things are of course very
> different:  the parent knows there is a device, and indeed wants the
> best driver for it.

I'm not familiar with mac68k, but for the case where device configuration
is fixed for given machine model and where there's a limited number of
machine models, I think it's better to take the evbmips/evbppc approach.

That is, convert the bus from indirect config to direct-config and
config_found() devices based on some internal config table picked by
lowlevel code according to machine model (if you can tell machine
model at runtime this allows you to have GENERIC kernel).

Alternatively, make obio(4) properly indirect and come up with per-model
kernel config with all obio(4) devices wired down (but this only makes
sense in case where there may be arbitrary devices connected at obio(4)).

	-- Jachym