Date: Mon, 16 May 2011 03:23:50 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r221980 - projects/pseries/powerpc/powermac Message-ID: <201105160323.p4G3NoGK064301@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Mon May 16 03:23:50 2011 New Revision: 221980 URL: http://svn.freebsd.org/changeset/base/221980 Log: Now that we have platform_chrp, platform_powermac should specifically check for a PowerMac platform instead of generic OF. Modified: projects/pseries/powerpc/powermac/platform_powermac.c Modified: projects/pseries/powerpc/powermac/platform_powermac.c ============================================================================== --- projects/pseries/powerpc/powermac/platform_powermac.c Mon May 16 03:22:41 2011 (r221979) +++ projects/pseries/powerpc/powermac/platform_powermac.c Mon May 16 03:23:50 2011 (r221980) @@ -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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105160323.p4G3NoGK064301>