Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Apr 2007 11:00:33 +1200 (NZST)
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   powerpc/111522: Add support for the ofw bus interface to nexus
Message-ID:  <20070412230033.2CD8061FE@serv.int.fubar.geek.nz>
Resent-Message-ID: <200704122310.l3CNA4Gt021125@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         111522
>Category:       powerpc
>Synopsis:       Add support for the ofw bus interface to nexus
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ppc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 12 23:10:04 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Turner
>Release:        FreeBSD 5.5-RC1 i386
>Organization:
>Environment:
System: FreeBSD serv.int.fubar.geek.nz 5.5-RC1 FreeBSD 5.5-RC1 #0: Mon May 15 14:09:18 NZST 2006 root@serv.int.fubar.geek.nz:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	The attached patch adds support for the some of the ofw bus interface to the nexus device.
	
>How-To-Repeat:
	
>Fix:

	

--- ppc-nexus-ofwbus.diff begins here ---
Index: sys/powerpc/powerpc/nexus.c
===================================================================
RCS file: /cvsroot/src/sys/powerpc/powerpc/nexus.c,v
retrieving revision 1.13
diff -u -u -r1.13 nexus.c
--- sys/powerpc/powerpc/nexus.c	7 Mar 2007 11:42:14 -0000	1.13
+++ sys/powerpc/powerpc/nexus.c	12 Apr 2007 10:29:35 -0000
@@ -74,6 +74,7 @@
 
 #include <sys/rman.h>
 
+#include "ofw_bus_if.h"
 #include "pic_if.h"
 
 /*
@@ -124,6 +125,11 @@
 static int	nexus_release_resource(device_t, device_t, int, int,
 		    struct resource *);
 
+static phandle_t	 nexus_ofw_get_node(device_t, device_t);
+static const char	*nexus_ofw_get_name(device_t, device_t);
+static const char	*nexus_ofw_get_type(device_t, device_t);
+static const char	*nexus_ofw_get_compat(device_t, device_t);
+
 /*
  * Local routines
  */
@@ -151,6 +157,12 @@
 	DEVMETHOD(bus_deactivate_resource,	nexus_deactivate_resource),
 	DEVMETHOD(bus_release_resource,	nexus_release_resource),
 
+	/* OFW bus interface */
+	DEVMETHOD(ofw_bus_get_node, nexus_ofw_get_node),
+	DEVMETHOD(ofw_bus_get_name, nexus_ofw_get_name),
+	DEVMETHOD(ofw_bus_get_type, nexus_ofw_get_type),
+	DEVMETHOD(ofw_bus_get_compat, nexus_ofw_get_compat),
+
 	{ 0, 0 }
 };
 
@@ -416,3 +428,47 @@
 
 	return (0);
 }
+
+static const char *
+nexus_ofw_get_name(device_t bus, device_t dev)
+{
+	struct nexus_devinfo *dinfo;
+
+	if ((dinfo = device_get_ivars(dev)) == 0)
+		return NULL;
+	
+	return dinfo->ndi_name;
+}
+
+static phandle_t
+nexus_ofw_get_node(device_t bus, device_t dev)
+{
+	struct nexus_devinfo *dinfo;
+
+	if ((dinfo = device_get_ivars(dev)) == 0)
+		return 0;
+	
+	return dinfo->ndi_node;
+}
+
+static const char *
+nexus_ofw_get_type(device_t bus, device_t dev)
+{
+	struct nexus_devinfo *dinfo;
+
+	if ((dinfo = device_get_ivars(dev)) == 0)
+		return NULL;
+	
+	return dinfo->ndi_device_type;
+}
+
+static const char *
+nexus_ofw_get_compat(device_t bus, device_t dev)
+{
+	struct nexus_devinfo *dinfo;
+
+	if ((dinfo = device_get_ivars(dev)) == 0)
+		return NULL;
+	
+	return dinfo->ndi_compatible;
+}
--- ppc-nexus-ofwbus.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070412230033.2CD8061FE>