diff options
Diffstat (limited to 'sys/powerpc/aim/nexus.c')
-rw-r--r-- | sys/powerpc/aim/nexus.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/sys/powerpc/aim/nexus.c b/sys/powerpc/aim/nexus.c index d92090b9cf4f..54567b135c6d 100644 --- a/sys/powerpc/aim/nexus.c +++ b/sys/powerpc/aim/nexus.c @@ -60,7 +60,6 @@ #include <sys/systm.h> #include <sys/module.h> #include <sys/bus.h> -#include <sys/clock.h> #include <sys/cons.h> #include <sys/kernel.h> #include <sys/malloc.h> @@ -74,7 +73,6 @@ #include <sys/rman.h> -#include "clock_if.h" #include "ofw_bus_if.h" #include "pic_if.h" @@ -143,12 +141,6 @@ static const char *nexus_ofw_get_type(device_t, device_t); static const char *nexus_ofw_get_compat(device_t, device_t); /* - * Clock interface. - */ -static int nexus_gettime(device_t, struct timespec *); -static int nexus_settime(device_t, struct timespec *); - -/* * Local routines */ static device_t nexus_device_from_node(device_t, phandle_t); @@ -181,10 +173,6 @@ static device_method_t nexus_methods[] = { DEVMETHOD(ofw_bus_get_type, nexus_ofw_get_type), DEVMETHOD(ofw_bus_get_compat, nexus_ofw_get_compat), - /* Clock interface */ - DEVMETHOD(clock_gettime, nexus_gettime), - DEVMETHOD(clock_settime, nexus_settime), - { 0, 0 } }; @@ -240,7 +228,6 @@ nexus_attach(device_t dev) } - clock_register(dev, 1000); return (bus_generic_attach(dev)); } @@ -512,50 +499,3 @@ nexus_ofw_get_compat(device_t bus, device_t dev) return (dinfo->ndi_compatible); } -#define DIFF19041970 2082844800 - -static int -nexus_gettime(device_t dev, struct timespec *ts) -{ - char path[128]; - ihandle_t ih; - phandle_t ph; - u_int rtc; - - ph = OF_finddevice("rtc"); - if (ph == -1) - return (ENOENT); - - OF_package_to_path(ph, path, sizeof(path)); - ih = OF_open(path); - if (ih == -1) - return (ENXIO); - - if (OF_call_method("read-rtc", ih, 0, 1, &rtc)) - return (EIO); - - ts->tv_sec = rtc - DIFF19041970; - ts->tv_nsec = 0; - return (0); -} - -static int -nexus_settime(device_t dev, struct timespec *ts) -{ - char path[128]; - ihandle_t ih; - phandle_t ph; - u_int rtc; - - ph = OF_finddevice("rtc"); - if (ph == -1) - return (ENOENT); - - OF_package_to_path(ph, path, sizeof(path)); - ih = OF_open(path); - if (ih == -1) - return (ENXIO); - - rtc = ts->tv_sec + DIFF19041970; - return ((OF_call_method("write-rtc", ih, 1, 0, rtc) != 0) ? EIO : 0); -} |