Subject: Re: U5, SCSI HA, trouble booting
To: Eric Benoit <eric@oddity.ca>
From: Eduardo Horvath <eeh@netbsd.org>
List: port-sparc64
Date: 08/10/2005 16:09:30
What's happening is that the kernel cannot correlate the boot stick (boot 
path from OBP) to a specific driver instance.

The rather baroque code that attempts to do that is in:

src/sys/arch/sparc64/sparc64/autoconf.c

It takes the boot stick apart, one component at a time and tries to match 
it to a specific driver instance by matching the name and register 
specification OBP uses.  This algorithm requires knowledge of every 
possible device node on the boot path so it can be properly parsed.  The 
quick fix is to figure out where the mismatch occurs and add appropriate 
entries to the bus_class_tab or dev_compat_tab to recognize the failing 
device.  You can get the necessary diagnostic information by building a 
DEBUG kernel, booting with DDB, and setting autoconf_debug to 1.

A much better fix for this whole problem would be to directly get the 
phandle for the boot device from OBP and have device_register compare the 
phandle for the current device to the phandle for the boot device.  The 
problem with implementing this solution is finding some way to correlate 
the OBP phandle, which is usually passed around somewhere in the 
bus-specific aux structure (and on PCI it's hidden in the pcitag somewhere 
inside the pci_attach_args structure) with the device node inside 
device_register.  Once you figure out how to do that for any device the 
rest of the implementation is trivial.

Eduardo