summaryrefslogtreecommitdiffstats
path: root/sys/dev/terasic
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2013-01-13 15:12:35 +0000
committerrwatson <rwatson@FreeBSD.org>2013-01-13 15:12:35 +0000
commit8022ccffb53fa44343410dd8f49eafd85e35fc97 (patch)
tree3f9b7e45267c7d5674ecf9414939da1e01bc4b5d /sys/dev/terasic
parente813c09dbf2c5d8078dcdc5ee1c3b55ab8b0faf4 (diff)
downloadFreeBSD-src-8022ccffb53fa44343410dd8f49eafd85e35fc97.zip
FreeBSD-src-8022ccffb53fa44343410dd8f49eafd85e35fc97.tar.gz
Merge Perforce changeset 219922 to head:
Update nexus parts in copied DE4LED attachment to use FDT. Sponsored by: DARPA, AFRL
Diffstat (limited to 'sys/dev/terasic')
-rw-r--r--sys/dev/terasic/de4led/terasic_de4led_fdt.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/sys/dev/terasic/de4led/terasic_de4led_fdt.c b/sys/dev/terasic/de4led/terasic_de4led_fdt.c
index 92da503..9c07826 100644
--- a/sys/dev/terasic/de4led/terasic_de4led_fdt.c
+++ b/sys/dev/terasic/de4led/terasic_de4led_fdt.c
@@ -47,6 +47,11 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
#include <machine/resource.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>
+
#include <dev/terasic/de4led/terasic_de4led.h>
/*
@@ -54,15 +59,18 @@ __FBSDID("$FreeBSD$");
* which is hooked up to the processor via a memory-mapped Avalon bus.
*/
static int
-terasic_de4led_nexus_probe(device_t dev)
+terasic_de4led_fdt_probe(device_t dev)
{
- device_set_desc(dev, "Terasic DE4 8-element LED");
- return (BUS_PROBE_DEFAULT);
+ if (ofw_bus_is_compatible(dev, "cambridge,de4led")) {
+ device_set_desc(dev, "Terasic DE4 8-element LED");
+ return (BUS_PROBE_DEFAULT);
+ }
+ return (ENXIO);
}
static int
-terasic_de4led_nexus_attach(device_t dev)
+terasic_de4led_fdt_attach(device_t dev)
{
struct terasic_de4led_softc *sc;
@@ -81,7 +89,7 @@ terasic_de4led_nexus_attach(device_t dev)
}
static int
-terasic_de4led_nexus_detach(device_t dev)
+terasic_de4led_fdt_detach(device_t dev)
{
struct terasic_de4led_softc *sc;
@@ -93,20 +101,20 @@ terasic_de4led_nexus_detach(device_t dev)
return (0);
}
-static device_method_t terasic_de4led_nexus_methods[] = {
- DEVMETHOD(device_probe, terasic_de4led_nexus_probe),
- DEVMETHOD(device_attach, terasic_de4led_nexus_attach),
- DEVMETHOD(device_detach, terasic_de4led_nexus_detach),
+static device_method_t terasic_de4led_fdt_methods[] = {
+ DEVMETHOD(device_probe, terasic_de4led_fdt_probe),
+ DEVMETHOD(device_attach, terasic_de4led_fdt_attach),
+ DEVMETHOD(device_detach, terasic_de4led_fdt_detach),
{ 0, 0 }
};
-static driver_t terasic_de4led_nexus_driver = {
+static driver_t terasic_de4led_fdt_driver = {
"terasic_de4led",
- terasic_de4led_nexus_methods,
+ terasic_de4led_fdt_methods,
sizeof(struct terasic_de4led_softc),
};
static devclass_t terasic_de4led_devclass;
-DRIVER_MODULE(terasic_de4led, nexus, terasic_de4led_nexus_driver,
+DRIVER_MODULE(terasic_de4led, simplebus, terasic_de4led_fdt_driver,
terasic_de4led_devclass, 0, 0);
OpenPOWER on IntegriCloud