xref: /minix3/minix/drivers/clock/readclock/arch/earm/arch_readclock.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #include <minix/syslib.h>
2*433d6423SLionel Sambuc #include <minix/drvlib.h>
3*433d6423SLionel Sambuc #include <minix/sysutil.h>
4*433d6423SLionel Sambuc #include <minix/type.h>
5*433d6423SLionel Sambuc #include <minix/board.h>
6*433d6423SLionel Sambuc 
7*433d6423SLionel Sambuc #include <sys/mman.h>
8*433d6423SLionel Sambuc #include <sys/types.h>
9*433d6423SLionel Sambuc 
10*433d6423SLionel Sambuc #include <stdio.h>
11*433d6423SLionel Sambuc #include <stdlib.h>
12*433d6423SLionel Sambuc #include <stdarg.h>
13*433d6423SLionel Sambuc #include <string.h>
14*433d6423SLionel Sambuc #include <errno.h>
15*433d6423SLionel Sambuc #include <assert.h>
16*433d6423SLionel Sambuc #include <time.h>
17*433d6423SLionel Sambuc 
18*433d6423SLionel Sambuc #include "omap_rtc.h"
19*433d6423SLionel Sambuc #include "forward.h"
20*433d6423SLionel Sambuc #include "readclock.h"
21*433d6423SLionel Sambuc 
22*433d6423SLionel Sambuc int
arch_setup(struct rtc * r)23*433d6423SLionel Sambuc arch_setup(struct rtc *r)
24*433d6423SLionel Sambuc {
25*433d6423SLionel Sambuc 	struct machine  machine ;
26*433d6423SLionel Sambuc 	sys_getmachine(&machine);
27*433d6423SLionel Sambuc 
28*433d6423SLionel Sambuc 	if (BOARD_IS_BBXM(machine.board_id)){
29*433d6423SLionel Sambuc 		fwd_set_label("tps65950.1.48");
30*433d6423SLionel Sambuc 		r->init = fwd_init;
31*433d6423SLionel Sambuc 		r->get_time = fwd_get_time;
32*433d6423SLionel Sambuc 		r->set_time = fwd_set_time;
33*433d6423SLionel Sambuc 		r->pwr_off = fwd_pwr_off;
34*433d6423SLionel Sambuc 		r->exit = fwd_exit;
35*433d6423SLionel Sambuc 		return OK;
36*433d6423SLionel Sambuc 	} else if ( BOARD_IS_BB(machine.board_id)){
37*433d6423SLionel Sambuc 		r->init = omap_rtc_init;
38*433d6423SLionel Sambuc 		r->get_time = omap_rtc_get_time;
39*433d6423SLionel Sambuc 		r->set_time = omap_rtc_set_time;
40*433d6423SLionel Sambuc 		r->pwr_off = omap_rtc_pwr_off;
41*433d6423SLionel Sambuc 		r->exit = omap_rtc_exit;
42*433d6423SLionel Sambuc 		return OK;
43*433d6423SLionel Sambuc 	}
44*433d6423SLionel Sambuc 	return ENOSYS;
45*433d6423SLionel Sambuc }
46