svn commit: r276680 - head/sys/powerpc/ps3

Nathan Whitehorn nwhitehorn at FreeBSD.org
Mon Jan 5 01:05:37 UTC 2015


Author: nwhitehorn
Date: Mon Jan  5 01:05:35 2015
New Revision: 276680
URL: https://svnweb.freebsd.org/changeset/base/276680

Log:
  Use FDT properties to identify a PS3 if present.

Modified:
  head/sys/powerpc/ps3/platform_ps3.c
  head/sys/powerpc/ps3/ps3_syscons.c

Modified: head/sys/powerpc/ps3/platform_ps3.c
==============================================================================
--- head/sys/powerpc/ps3/platform_ps3.c	Mon Jan  5 00:50:16 2015	(r276679)
+++ head/sys/powerpc/ps3/platform_ps3.c	Mon Jan  5 01:05:35 2015	(r276680)
@@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$");
 #include <machine/spr.h>
 #include <machine/vmparam.h>
 
+#include <dev/ofw/openfirm.h>
+
 #include "platform_if.h"
 #include "ps3-hvcall.h"
 
@@ -103,8 +105,17 @@ PLATFORM_DEF(ps3_platform);
 static int
 ps3_probe(platform_t plat)
 {
+	phandle_t root;
+	char compatible[64];
+
+	root = OF_finddevice("/");
+	if (OF_getprop(root, "compatible", compatible, sizeof(compatible)) <= 0)
+                return (BUS_PROBE_NOWILDCARD);
+	
+	if (strncmp(compatible, "sony,ps3", sizeof(compatible)) != 0)
+		return (BUS_PROBE_NOWILDCARD);
 
-	return (BUS_PROBE_NOWILDCARD);
+	return (BUS_PROBE_SPECIFIC);
 }
 
 static int

Modified: head/sys/powerpc/ps3/ps3_syscons.c
==============================================================================
--- head/sys/powerpc/ps3/ps3_syscons.c	Mon Jan  5 00:50:16 2015	(r276679)
+++ head/sys/powerpc/ps3/ps3_syscons.c	Mon Jan  5 01:05:35 2015	(r276680)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/platform.h>
 #include <machine/pmap.h>
 
+#include <dev/ofw/openfirm.h>
 #include <dev/vt/vt.h>
 #include <dev/vt/hw/fb/vt_fb.h>
 #include <dev/vt/colors/vt_termcolors.h>
@@ -95,9 +96,7 @@ ps3fb_probe(struct vt_device *vd)
 	struct ps3fb_softc *sc;
 	int disable;
 	char compatible[64];
-#if 0
 	phandle_t root;
-#endif
 
 	disable = 0;
 	TUNABLE_INT_FETCH("hw.syscons.disable", &disable);
@@ -106,18 +105,16 @@ ps3fb_probe(struct vt_device *vd)
 
 	sc = &ps3fb_softc;
 
-#if 0
+	TUNABLE_STR_FETCH("hw.platform", compatible, sizeof(compatible));
+	if (strcmp(compatible, "ps3") == 0)
+		return (CN_INTERNAL);
+
 	root = OF_finddevice("/");
 	if (OF_getprop(root, "compatible", compatible, sizeof(compatible)) <= 0)
-                return (0);
+                return (CN_DEAD);
 	
 	if (strncmp(compatible, "sony,ps3", sizeof(compatible)) != 0)
-		return (0);
-#else
-	TUNABLE_STR_FETCH("hw.platform", compatible, sizeof(compatible));
-	if (strcmp(compatible, "ps3") != 0)
 		return (CN_DEAD);
-#endif
 
 	return (CN_INTERNAL);
 }


More information about the svn-src-head mailing list