svn commit: r245365 - in head/sys: dev/altera/jtag_uart mips/beri

Robert Watson rwatson at FreeBSD.org
Sun Jan 13 15:08:18 UTC 2013


Author: rwatson
Date: Sun Jan 13 15:08:17 2013
New Revision: 245365
URL: http://svnweb.freebsd.org/changeset/base/245365

Log:
  Merge Perforce changeset 219918 to head:
  
    Naive first cut at an FDT bus attachment for the Altera JTAG UART.
  
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c
  head/sys/mips/beri/files.beri

Modified: head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c
==============================================================================
--- head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c	Sun Jan 13 14:38:09 2013	(r245364)
+++ head/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c	Sun Jan 13 15:08:17 2013	(r245365)
@@ -52,21 +52,27 @@ __FBSDID("$FreeBSD$");
 
 #include <dev/altera/jtag_uart/altera_jtag_uart.h>
 
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
 /*
- * Nexus bus attachment for Altera JTAG UARTs.  Appropriate for most Altera
- * FPGA SoC-style configurations in which the IP core will be exposed to the
- * processor via a memory-mapped Avalon bus.
+ * FDT bus attachment for Altera JTAG UARTs.
  */
 static int
-altera_jtag_uart_nexus_probe(device_t dev)
+altera_jtag_uart_fdt_probe(device_t dev)
 {
 
-	device_set_desc(dev, "Altera JTAG UART");
-	return (BUS_PROBE_DEFAULT);
+	if (ofw_bus_is_compatible(dev, "altera,jtag_uart-11_0")) {
+		device_set_desc(dev, "Altera JTAG UART");
+		return (BUS_PROBE_DEFAULT);
+	}
+	return (ENXIO);
 }
 
 static int
-altera_jtag_uart_nexus_attach(device_t dev)
+altera_jtag_uart_fdt_attach(device_t dev)
 {
 	struct altera_jtag_uart_softc *sc;
 	int error;
@@ -108,7 +114,7 @@ out:
 }
 
 static int
-altera_jtag_uart_nexus_detach(device_t dev)
+altera_jtag_uart_fdt_detach(device_t dev)
 {
 	struct altera_jtag_uart_softc *sc;
 
@@ -124,20 +130,20 @@ altera_jtag_uart_nexus_detach(device_t d
 	return (0);
 }
 
-static device_method_t altera_jtag_uart_nexus_methods[] = {
-	DEVMETHOD(device_probe,		altera_jtag_uart_nexus_probe),
-	DEVMETHOD(device_attach,	altera_jtag_uart_nexus_attach),
-	DEVMETHOD(device_detach,	altera_jtag_uart_nexus_detach),
+static device_method_t altera_jtag_uart_fdt_methods[] = {
+	DEVMETHOD(device_probe,		altera_jtag_uart_fdt_probe),
+	DEVMETHOD(device_attach,	altera_jtag_uart_fdt_attach),
+	DEVMETHOD(device_detach,	altera_jtag_uart_fdt_detach),
 	{ 0, 0 }
 };
 
-static driver_t altera_jtag_uart_nexus_driver = {
+static driver_t altera_jtag_uart_fdt_driver = {
 	"altera_jtag_uart",
-	altera_jtag_uart_nexus_methods,
+	altera_jtag_uart_fdt_methods,
 	sizeof(struct altera_jtag_uart_softc),
 };
 
 static devclass_t altera_jtag_uart_devclass;
 
-DRIVER_MODULE(altera_jtag_uart, nexus, altera_jtag_uart_nexus_driver,
+DRIVER_MODULE(altera_jtag_uart, simplebus, altera_jtag_uart_fdt_driver,
     altera_jtag_uart_devclass, 0, 0);

Modified: head/sys/mips/beri/files.beri
==============================================================================
--- head/sys/mips/beri/files.beri	Sun Jan 13 14:38:09 2013	(r245364)
+++ head/sys/mips/beri/files.beri	Sun Jan 13 15:08:17 2013	(r245365)
@@ -1,6 +1,7 @@
 # $FreeBSD$
 dev/altera/jtag_uart/altera_jtag_uart_cons.c	optional altera_jtag_uart
 dev/altera/jtag_uart/altera_jtag_uart_tty.c	optional altera_jtag_uart
+dev/altera/jtag_uart/altera_jtag_uart_fdt.c	optional altera_jtag_uart fdt
 dev/altera/jtag_uart/altera_jtag_uart_nexus.c	optional altera_jtag_uart
 dev/terasic/de4led/terasic_de4led.c	optional terasic_de4led
 dev/terasic/de4led/terasic_de4led_nexus.c	optional terasic_de4led


More information about the svn-src-all mailing list