Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/oea parse G5 device paths



details:   https://anonhg.NetBSD.org/src/rev/8dc5145337f3
branches:  trunk
changeset: 834569:8dc5145337f3
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Aug 17 15:54:35 2018 +0000

description:
parse G5 device paths

diffstat:

 sys/arch/powerpc/oea/ofw_autoconf.c |  39 +++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 6 deletions(-)

diffs (106 lines):

diff -r 605827415cc5 -r 8dc5145337f3 sys/arch/powerpc/oea/ofw_autoconf.c
--- a/sys/arch/powerpc/oea/ofw_autoconf.c       Fri Aug 17 14:47:21 2018 +0000
+++ b/sys/arch/powerpc/oea/ofw_autoconf.c       Fri Aug 17 15:54:35 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_autoconf.c,v 1.21 2018/03/04 00:21:20 macallan Exp $ */
+/* $NetBSD: ofw_autoconf.c,v 1.22 2018/08/17 15:54:35 macallan Exp $ */
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
  * Copyright (C) 1995, 1996 TooLs GmbH.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.21 2018/03/04 00:21:20 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.22 2018/08/17 15:54:35 macallan Exp $");
 
 #ifdef ofppc
 #include "gtpci.h"
@@ -231,6 +231,11 @@
                return;
        }
 
+       /* skip over CPUs */
+       if (device_is_a(dev, "cpu")) {
+               return;
+       }
+
        if (device_is_a(dev, "valkyriefb")) {
                struct confargs *ca = aux;
                prop_dictionary_t dict;
@@ -306,7 +311,10 @@
                    CACHELINESIZE);
        }
 #endif
-       if (device_is_a(dev, "atapibus") || device_is_a(dev, "pci") ||
+       if (device_is_a(dev, "atapibus") ||
+#ifndef PMAC_G5
+           device_is_a(dev, "pci") ||
+#endif
            device_is_a(dev, "scsibus") || device_is_a(dev, "atabus"))
                return;
 
@@ -379,13 +387,17 @@
         * Skip over devices that are really just layers of NetBSD
         * autoconf(9) we should just skip as they do not have any
         * OFW devices.
+        * XXX except on G5, where we have /ht/pci* instead of /pci*
         */
        if (device_is_a(device_parent(dev), "atapibus") ||
            device_is_a(device_parent(dev), "atabus") ||
+#ifndef PMAC_G5
            device_is_a(device_parent(dev), "pci") ||
+#endif
            device_is_a(device_parent(dev), "scsibus")) {
-               if (device_parent(device_parent(dev)) != parent)
+               if (device_parent(device_parent(dev)) != parent) {
                        return;
+               }
        } else {
                if (device_parent(dev) != parent)
                        return;
@@ -416,13 +428,14 @@
 
        if (device_is_a(device_parent(dev), "mainbus")) {
                struct confargs *ca = aux;
-
                if (strcmp(ca->ca_name, "ofw") == 0)            /* XXX */
                        return;
                if (strcmp(ca->ca_name, "gt") == 0)
                        parent = dev;
                if (addr != ca->ca_reg[0])
                        return;
+               if (addr2 != 0 && addr2 != ca->ca_reg[1])
+                       return;
        } else if (device_is_a(device_parent(dev), "gt")) {
                /*
                 * Special handle for MV64361 on PegasosII(ofppc).
@@ -477,13 +490,27 @@
 
                if (addr != adev->adev_drv_data->drive)
                        return;
+       } else if (device_is_a(dev, "pci")) {
+               if (addr != device_unit(dev))
+                       return;
+       } else if (device_is_a(device_parent(dev), "atabus")) {
+               /*
+                * XXX
+                * on svwsata this is the channel number and we ignore the
+                * drive number which is always 0 anyway
+                * needs to be revisited for other (S)ATA cards
+                */
+               struct ata_device *adev = aux;
+               if (addr != adev->adev_channel)
+                       return;
+               /* we have our match, cut off the rest */
+               if (p) *p = 0;
        } else
                return;
 
        /* If we reach this point, then dev is a match for the current
         * path component.
         */
-
        if (p && *p) {
                parent = dev;
                cp = p;



Home | Main Index | Thread Index | Old Index