diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2013-09-09 12:54:08 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2013-09-09 12:54:08 +0000 |
commit | 62b453e543862c477058f22dfd7d6a7b72e79281 (patch) | |
tree | 6868ab54b3b19d9dfd9492213d75ea10e7abf8b4 /sys/powerpc/powermac | |
parent | b2fa807b0ea69fe87722e720c585c3117956f5ae (diff) | |
download | FreeBSD-src-62b453e543862c477058f22dfd7d6a7b72e79281.zip FreeBSD-src-62b453e543862c477058f22dfd7d6a7b72e79281.tar.gz |
Attach only on hardware that is actually supported as opposed to hardware
that seems like it has some of the problems we might want.
Approved by: re (kib)
Diffstat (limited to 'sys/powerpc/powermac')
-rw-r--r-- | sys/powerpc/powermac/platform_powermac.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/powerpc/powermac/platform_powermac.c b/sys/powerpc/powermac/platform_powermac.c index 52d5c4a..e21a48c 100644 --- a/sys/powerpc/powermac/platform_powermac.c +++ b/sys/powerpc/powermac/platform_powermac.c @@ -91,8 +91,22 @@ PLATFORM_DEF(powermac_platform); static int powermac_probe(platform_t plat) { - if (OF_finddevice("/memory") != -1 || OF_finddevice("/memory@0") != -1) - return (BUS_PROBE_GENERIC); + char compat[255]; + ssize_t compatlen; + char *curstr; + phandle_t root; + + root = OF_peer(0); + if (root == 0) + return (ENXIO); + + compatlen = OF_getprop(root, "compatible", compat, sizeof(compat)); + + for (curstr = compat; curstr < compat + compatlen; + curstr += strlen(curstr) + 1) { + if (strncmp(curstr, "MacRISC", 7) == 0) + return (BUS_PROBE_SPECIFIC); + } return (ENXIO); } |