Subject: Re: can't find boot device on U5 (Re: CVS commit: src/sys/arch/sparc64)
To: Izumi Tsutsui <firstname.lastname@example.org>
From: Eduardo Horvath <eeh@NetBSD.org>
Date: 10/09/2006 16:45:31
I took a quick peek at the new code.
I may be wrong, but it seems to me that ofbootpackage contains the phandle
for the boot device, which in this case would be the disk.
In device_register(), if you are attaching a disk device, you get the
parent phandle of the registering device, the controller, then call
dev_path_drive_match() with it.
dev_path_drive_match() traverses all the children of the controller and
compares them with the boot device to see if there is a match.
This seems sort of backwards.
I think you should be comparing the phandle of the parent of the
attaching device with the parent of the ofbootpackage node to find a
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. If there is some confusion at the
higher levels of the device tree, this may cauer problems trying to match
the leaf device.