Subject: Re: can't find boot device on U5 (Re: CVS commit: src/sys/arch/sparc64)
To: Martin Husemann <martin@duskware.de>
From: Eduardo Horvath <eeh@NetBSD.org>
List: port-sparc64
Date: 10/10/2006 16:11:16
On Tue, 10 Oct 2006, Martin Husemann wrote:

> On Mon, Oct 09, 2006 at 04:45:31PM +0000, Eduardo Horvath wrote:

> > In any case, if you're doing this correctly most of the logic in 
> > device_register() should be obsolete.  You don't need to match any of the 
> > buses, just the final leaf device.
> 
> I'm not sure I understand.
> 
> Yes, we only need to match the leaf devices, but that happens by looking at
> their bus specific attach args to extract the phandle. If there is an easier
> way to get the phandle for an arbitrary leaf node, I'm all ears.

If you look at device_register() it has cases for PCI bus nodes, SBus 
nodes, network nodes, etc.  You don't need that.  You only need for pseudo 
nodes such as SCSI and IDE (and later FCal, firewire, and USB) disks.

All other real device nodes should be handled the exact same way:

ihandle->phandle (if needed), then compare the phandle with the one for 
the boot device.  

Or is there some reason you think "mainbus" can be a boot device?

Eduardo