Subject: Re: pciide -> atabus change
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: port-alpha
Date: 10/13/2003 18:17:34
--=Aldergrove-brigand-Cocaine-Blowpipe-TWA-Glock-security-NATO-Mossad=c

Manuel Bouyer <bouyer@antioche.lip6.fr> writes:

> I suspect the attached diff is needed for alpha booting from pciide devices
> to find the root device.
> Can someone check and confirm ?

Your patch was half of what was necessary. The parent name did change
from pciide to atabus, but the scsipidev became associated with the
higher-up IDE device (aceride0, in my case), so the next test
failed. I wasn't sure if there will always be the same number of
layers between the wd device and the ide controller, so I made a
loop that searches up the device tree until it finds the scsipidev
device or hits root. If the device distance is fixed, than the "parent
!= scsipidev" test can be changed to "parent->dv_parent != scsipidev"
instead of having a loop.

        - Nathan


--=Aldergrove-brigand-Cocaine-Blowpipe-TWA-Glock-security-NATO-Mossad=c
Content-Type: text/x-patch
Content-Disposition: attachment; filename=api-diff
Content-Description: api_up1000.c pciide-to-atabus patch

Index: api_up1000.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/api_up1000.c,v
retrieving revision 1.14
diff -u -r1.14 api_up1000.c
--- api_up1000.c	14 Jun 2003 17:01:07 -0000	1.14
+++ api_up1000.c	13 Oct 2003 22:13:11 -0000
@@ -275,10 +275,16 @@
 	 */
 	if ((ideboot || scsiboot) && !strcmp(name, "wd")) {
 		struct ata_device *adev = aux;
-		if ((strncmp("pciide", parent->dv_xname, 6) != 0)) {
+		if ((strncmp("atabus", parent->dv_xname, 6) != 0)) {
 			return;
 		} else {
-			if (parent != scsipidev)
+			struct device *p = parent;
+			while (p != NULL) {
+				if (p == scsipidev)
+					break;
+				p = p->dv_parent;
+			}
+			if (p == NULL)
 				return;
 		}
 		DPRINTF(("\natapi info: drive %d, channel %d\n",

--=Aldergrove-brigand-Cocaine-Blowpipe-TWA-Glock-security-NATO-Mossad=c--