PERFORCE change 173829 for review

Rafal Jaworowski raj at FreeBSD.org
Thu Jan 28 12:03:54 UTC 2010


http://p4web.freebsd.org/chv.cgi?CH=173829

Change 173829 by raj at raj_fdt on 2010/01/28 12:03:53

	Convert Marvell RTC driver to FDT/simplebus convention.
	
	This is the very first ARM driver to run in FDT environment!

Affected files ...

.. //depot/projects/fdt/sys/arm/mv/rtc.c#2 edit

Differences ...

==== //depot/projects/fdt/sys/arm/mv/rtc.c#2 (text+ko) ====

@@ -45,6 +45,9 @@
 #include <machine/bus.h>
 #include <machine/resource.h>
 
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
 #include "clock_if.h"
 
 #define MV_RTC_TIME_REG		0x00
@@ -88,14 +91,17 @@
 };
 static devclass_t mv_rtc_devclass;
 
-DRIVER_MODULE(mv_rtc, mbus, mv_rtc_driver, mv_rtc_devclass, 0, 0);
+DRIVER_MODULE(mv_rtc, simplebus, mv_rtc_driver, mv_rtc_devclass, 0, 0);
 
 static int
 mv_rtc_probe(device_t dev)
 {
 
+	if (!ofw_bus_is_compatible(dev, "mrvl,rtc"))
+		return (ENXIO);
+
 	device_set_desc(dev, "Marvell Integrated RTC");
-	return (0);
+	return (BUS_PROBE_DEFAULT);
 }
 
 static int


More information about the p4-projects mailing list