rtc.c revision 1.25 1 1.25 ad /* $NetBSD: rtc.c,v 1.25 2008/01/04 22:13:57 ad Exp $ */
2 1.1 takemura
3 1.1 takemura /*-
4 1.1 takemura * Copyright (c) 1999 Shin Takemura. All rights reserved.
5 1.1 takemura * Copyright (c) 1999 SATO Kazumi. All rights reserved.
6 1.1 takemura * Copyright (c) 1999 PocketBSD Project. All rights reserved.
7 1.1 takemura *
8 1.1 takemura * Redistribution and use in source and binary forms, with or without
9 1.1 takemura * modification, are permitted provided that the following conditions
10 1.1 takemura * are met:
11 1.1 takemura * 1. Redistributions of source code must retain the above copyright
12 1.1 takemura * notice, this list of conditions and the following disclaimer.
13 1.1 takemura * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 takemura * notice, this list of conditions and the following disclaimer in the
15 1.1 takemura * documentation and/or other materials provided with the distribution.
16 1.1 takemura * 3. All advertising materials mentioning features or use of this software
17 1.1 takemura * must display the following acknowledgement:
18 1.1 takemura * This product includes software developed by the PocketBSD project
19 1.1 takemura * and its contributors.
20 1.1 takemura * 4. Neither the name of the project nor the names of its contributors
21 1.1 takemura * may be used to endorse or promote products derived from this software
22 1.1 takemura * without specific prior written permission.
23 1.1 takemura *
24 1.1 takemura * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 1.1 takemura * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 1.1 takemura * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 1.1 takemura * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 1.1 takemura * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 1.1 takemura * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 1.1 takemura * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 1.1 takemura * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 1.1 takemura * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 1.1 takemura * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 1.1 takemura * SUCH DAMAGE.
35 1.1 takemura *
36 1.1 takemura */
37 1.20 lukem
38 1.20 lukem #include <sys/cdefs.h>
39 1.25 ad __KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.25 2008/01/04 22:13:57 ad Exp $");
40 1.1 takemura
41 1.5 enami #include "opt_vr41xx.h"
42 1.5 enami
43 1.1 takemura #include <sys/param.h>
44 1.1 takemura #include <sys/systm.h>
45 1.24 gdamore #include <sys/timetc.h>
46 1.25 ad #include <sys/device.h>
47 1.1 takemura
48 1.8 uch #include <machine/sysconf.h>
49 1.1 takemura #include <machine/bus.h>
50 1.8 uch
51 1.8 uch #include <dev/clock_subr.h>
52 1.1 takemura
53 1.1 takemura #include <hpcmips/vr/vr.h>
54 1.5 enami #include <hpcmips/vr/vrcpudef.h>
55 1.12 takemura #include <hpcmips/vr/vripif.h>
56 1.14 takemura #include <hpcmips/vr/vripreg.h>
57 1.1 takemura #include <hpcmips/vr/rtcreg.h>
58 1.1 takemura
59 1.3 sato /*
60 1.3 sato * for debugging definitions
61 1.6 toshii * VRRTCDEBUG print rtc debugging information
62 1.3 sato */
63 1.4 sato #ifdef VRRTCDEBUG
64 1.4 sato #ifndef VRRTCDEBUG_CONF
65 1.4 sato #define VRRTCDEBUG_CONF 0
66 1.4 sato #endif
67 1.4 sato int vrrtc_debug = VRRTCDEBUG_CONF;
68 1.4 sato #define DPRINTF(arg) if (vrrtc_debug) printf arg;
69 1.4 sato #define DDUMP_REGS(arg) if (vrrtc_debug) vrrtc_dump_regs(arg);
70 1.4 sato #else /* VRRTCDEBUG */
71 1.4 sato #define DPRINTF(arg)
72 1.4 sato #define DDUMP_REGS(arg)
73 1.4 sato #endif /* VRRTCDEBUG */
74 1.1 takemura
75 1.1 takemura struct vrrtc_softc {
76 1.1 takemura struct device sc_dev;
77 1.1 takemura bus_space_tag_t sc_iot;
78 1.1 takemura bus_space_handle_t sc_ioh;
79 1.1 takemura void *sc_ih;
80 1.14 takemura #ifndef SINGLE_VRIP_BASE
81 1.14 takemura int sc_rtcint_reg;
82 1.14 takemura int sc_tclk_h_reg, sc_tclk_l_reg;
83 1.14 takemura int sc_tclk_cnt_h_reg, sc_tclk_cnt_l_reg;
84 1.14 takemura #endif /* SINGLE_VRIP_BASE */
85 1.24 gdamore int64_t sc_epoch;
86 1.24 gdamore struct todr_chip_handle sc_todr;
87 1.24 gdamore struct timecounter sc_tc;
88 1.1 takemura };
89 1.1 takemura
90 1.24 gdamore void vrrtc_init(struct device *);
91 1.24 gdamore int vrrtc_get(todr_chip_handle_t, volatile struct timeval *);
92 1.24 gdamore int vrrtc_set(todr_chip_handle_t, volatile struct timeval *);
93 1.24 gdamore uint32_t vrrtc_get_timecount(struct timecounter *);
94 1.1 takemura
95 1.8 uch struct platform_clock vr_clock = {
96 1.8 uch #define CLOCK_RATE 128
97 1.24 gdamore CLOCK_RATE, vrrtc_init,
98 1.1 takemura };
99 1.1 takemura
100 1.7 uch int vrrtc_match(struct device *, struct cfdata *, void *);
101 1.7 uch void vrrtc_attach(struct device *, struct device *, void *);
102 1.7 uch int vrrtc_intr(void*, u_int32_t, u_int32_t);
103 1.7 uch void vrrtc_dump_regs(struct vrrtc_softc *);
104 1.1 takemura
105 1.18 thorpej CFATTACH_DECL(vrrtc, sizeof(struct vrrtc_softc),
106 1.18 thorpej vrrtc_match, vrrtc_attach, NULL, NULL);
107 1.1 takemura
108 1.8 uch int
109 1.8 uch vrrtc_match(struct device *parent, struct cfdata *cf, void *aux)
110 1.1 takemura {
111 1.7 uch
112 1.8 uch return (1);
113 1.1 takemura }
114 1.1 takemura
115 1.14 takemura #ifndef SINGLE_VRIP_BASE
116 1.14 takemura #define RTCINT_REG_W (sc->sc_rtcint_reg)
117 1.14 takemura #define TCLK_H_REG_W (sc->sc_tclk_h_reg)
118 1.14 takemura #define TCLK_L_REG_W (sc->sc_tclk_l_reg)
119 1.14 takemura #define TCLK_CNT_H_REG_W (sc->sc_tclk_cnt_h_reg)
120 1.14 takemura #define TCLK_CNT_L_REG_W (sc->sc_tclk_cnt_l_reg)
121 1.14 takemura #endif /* SINGLE_VRIP_BASE */
122 1.14 takemura
123 1.1 takemura void
124 1.7 uch vrrtc_attach(struct device *parent, struct device *self, void *aux)
125 1.1 takemura {
126 1.1 takemura struct vrip_attach_args *va = aux;
127 1.8 uch struct vrrtc_softc *sc = (void *)self;
128 1.24 gdamore int year;
129 1.14 takemura
130 1.14 takemura #ifndef SINGLE_VRIP_BASE
131 1.14 takemura if (va->va_addr == VR4102_RTC_ADDR) {
132 1.14 takemura sc->sc_rtcint_reg = VR4102_RTCINT_REG_W;
133 1.14 takemura sc->sc_tclk_h_reg = VR4102_TCLK_H_REG_W;
134 1.14 takemura sc->sc_tclk_l_reg = VR4102_TCLK_L_REG_W;
135 1.14 takemura sc->sc_tclk_cnt_h_reg = VR4102_TCLK_CNT_H_REG_W;
136 1.14 takemura sc->sc_tclk_cnt_l_reg = VR4102_TCLK_CNT_L_REG_W;
137 1.14 takemura } else
138 1.14 takemura if (va->va_addr == VR4122_RTC_ADDR) {
139 1.14 takemura sc->sc_rtcint_reg = VR4122_RTCINT_REG_W;
140 1.14 takemura sc->sc_tclk_h_reg = VR4122_TCLK_H_REG_W;
141 1.14 takemura sc->sc_tclk_l_reg = VR4122_TCLK_L_REG_W;
142 1.14 takemura sc->sc_tclk_cnt_h_reg = VR4122_TCLK_CNT_H_REG_W;
143 1.14 takemura sc->sc_tclk_cnt_l_reg = VR4122_TCLK_CNT_L_REG_W;
144 1.14 takemura } else
145 1.14 takemura if (va->va_addr == VR4181_RTC_ADDR) {
146 1.14 takemura sc->sc_rtcint_reg = VR4181_RTCINT_REG_W;
147 1.14 takemura sc->sc_tclk_h_reg = RTC_NO_REG_W;
148 1.14 takemura sc->sc_tclk_l_reg = RTC_NO_REG_W;
149 1.14 takemura sc->sc_tclk_cnt_h_reg = RTC_NO_REG_W;
150 1.14 takemura sc->sc_tclk_cnt_l_reg = RTC_NO_REG_W;
151 1.14 takemura } else {
152 1.16 provos panic("%s: unknown base address 0x%lx",
153 1.14 takemura sc->sc_dev.dv_xname, va->va_addr);
154 1.14 takemura }
155 1.14 takemura #endif /* SINGLE_VRIP_BASE */
156 1.14 takemura
157 1.1 takemura sc->sc_iot = va->va_iot;
158 1.1 takemura if (bus_space_map(sc->sc_iot, va->va_addr, va->va_size,
159 1.7 uch 0 /* no flags */, &sc->sc_ioh)) {
160 1.1 takemura printf("vrrtc_attach: can't map i/o space\n");
161 1.1 takemura return;
162 1.1 takemura }
163 1.1 takemura /* RTC interrupt handler is directly dispatched from CPU intr */
164 1.1 takemura vr_intr_establish(VR_INTR1, vrrtc_intr, sc);
165 1.19 wiz /* But need to set level 1 interrupt mask register,
166 1.1 takemura * so regsiter fake interrurpt handler
167 1.1 takemura */
168 1.12 takemura if (!(sc->sc_ih = vrip_intr_establish(va->va_vc, va->va_unit, 0,
169 1.7 uch IPL_CLOCK, 0, 0))) {
170 1.1 takemura printf (":can't map interrupt.\n");
171 1.1 takemura return;
172 1.1 takemura }
173 1.1 takemura /*
174 1.1 takemura * Rtc is attached to call this routine
175 1.1 takemura * before cpu_initclock() calls clock_init().
176 1.1 takemura * So we must disable all interrupt for now.
177 1.1 takemura */
178 1.1 takemura /*
179 1.1 takemura * Disable all rtc interrupts
180 1.1 takemura */
181 1.1 takemura /* Disable Elapse compare intr */
182 1.1 takemura bus_space_write_2(sc->sc_iot, sc->sc_ioh, ECMP_H_REG_W, 0);
183 1.1 takemura bus_space_write_2(sc->sc_iot, sc->sc_ioh, ECMP_M_REG_W, 0);
184 1.1 takemura bus_space_write_2(sc->sc_iot, sc->sc_ioh, ECMP_L_REG_W, 0);
185 1.1 takemura /* Disable RTC Long1 intr */
186 1.1 takemura bus_space_write_2(sc->sc_iot, sc->sc_ioh, RTCL1_H_REG_W, 0);
187 1.1 takemura bus_space_write_2(sc->sc_iot, sc->sc_ioh, RTCL1_L_REG_W, 0);
188 1.1 takemura /* Disable RTC Long2 intr */
189 1.1 takemura bus_space_write_2(sc->sc_iot, sc->sc_ioh, RTCL2_H_REG_W, 0);
190 1.1 takemura bus_space_write_2(sc->sc_iot, sc->sc_ioh, RTCL2_L_REG_W, 0);
191 1.1 takemura /* Disable RTC TCLK intr */
192 1.13 sato if (TCLK_H_REG_W != RTC_NO_REG_W) {
193 1.10 sato bus_space_write_2(sc->sc_iot, sc->sc_ioh, TCLK_H_REG_W, 0);
194 1.10 sato bus_space_write_2(sc->sc_iot, sc->sc_ioh, TCLK_L_REG_W, 0);
195 1.10 sato }
196 1.1 takemura /*
197 1.1 takemura * Clear all rtc intrrupts.
198 1.1 takemura */
199 1.1 takemura bus_space_write_2(sc->sc_iot, sc->sc_ioh, RTCINT_REG_W, RTCINT_ALL);
200 1.1 takemura
201 1.24 gdamore /*
202 1.24 gdamore * Figure out the epoch, which could be either forward or
203 1.24 gdamore * backwards in time. We assume that the start date will always
204 1.24 gdamore * be on Jan 1.
205 1.24 gdamore */
206 1.24 gdamore for (year = EPOCHYEAR; year < POSIX_BASE_YEAR; year++) {
207 1.24 gdamore sc->sc_epoch += LEAPYEAR4(year) ? SECYR + SECDAY : SECYR;
208 1.24 gdamore }
209 1.24 gdamore for (year = POSIX_BASE_YEAR; year < EPOCHYEAR; year++) {
210 1.24 gdamore sc->sc_epoch -= LEAPYEAR4(year) ? SECYR + SECDAY : SECYR;
211 1.24 gdamore }
212 1.24 gdamore
213 1.24 gdamore /*
214 1.24 gdamore * Initialize MI todr(9)
215 1.24 gdamore */
216 1.24 gdamore sc->sc_todr.todr_settime = vrrtc_set;
217 1.24 gdamore sc->sc_todr.todr_gettime = vrrtc_get;
218 1.24 gdamore sc->sc_todr.cookie = sc;
219 1.24 gdamore todr_attach(&sc->sc_todr);
220 1.24 gdamore
221 1.8 uch platform_clock_attach(sc, &vr_clock);
222 1.1 takemura }
223 1.1 takemura
224 1.1 takemura int
225 1.7 uch vrrtc_intr(void *arg, u_int32_t pc, u_int32_t statusReg)
226 1.1 takemura {
227 1.1 takemura struct vrrtc_softc *sc = arg;
228 1.1 takemura struct clockframe cf;
229 1.14 takemura
230 1.1 takemura bus_space_write_2(sc->sc_iot, sc->sc_ioh, RTCINT_REG_W, RTCINT_ALL);
231 1.1 takemura cf.pc = pc;
232 1.1 takemura cf.sr = statusReg;
233 1.1 takemura hardclock(&cf);
234 1.1 takemura
235 1.1 takemura return 0;
236 1.1 takemura }
237 1.1 takemura
238 1.1 takemura void
239 1.24 gdamore vrrtc_init(struct device *dev)
240 1.1 takemura {
241 1.8 uch struct vrrtc_softc *sc = (struct vrrtc_softc *)dev;
242 1.1 takemura
243 1.8 uch DDUMP_REGS(sc);
244 1.8 uch /*
245 1.8 uch * Set tick (CLOCK_RATE)
246 1.8 uch */
247 1.8 uch bus_space_write_2(sc->sc_iot, sc->sc_ioh, RTCL1_H_REG_W, 0);
248 1.8 uch bus_space_write_2(sc->sc_iot, sc->sc_ioh, RTCL1_L_REG_W,
249 1.8 uch RTCL1_L_HZ/CLOCK_RATE);
250 1.24 gdamore
251 1.24 gdamore /*
252 1.24 gdamore * Initialize timecounter.
253 1.24 gdamore */
254 1.24 gdamore sc->sc_tc.tc_get_timecount = vrrtc_get_timecount;
255 1.24 gdamore sc->sc_tc.tc_name = "vrrtc";
256 1.24 gdamore sc->sc_tc.tc_counter_mask = 0xffff;
257 1.24 gdamore sc->sc_tc.tc_frequency = ETIME_L_HZ;
258 1.24 gdamore sc->sc_tc.tc_priv = sc;
259 1.24 gdamore sc->sc_tc.tc_quality = 100;
260 1.24 gdamore tc_init(&sc->sc_tc);
261 1.24 gdamore }
262 1.24 gdamore
263 1.24 gdamore uint32_t
264 1.24 gdamore vrrtc_get_timecount(struct timecounter *tc)
265 1.24 gdamore {
266 1.24 gdamore struct vrrtc_softc *sc = (struct vrrtc_softc *)tc->tc_priv;
267 1.24 gdamore bus_space_tag_t iot = sc->sc_iot;
268 1.24 gdamore bus_space_handle_t ioh = sc->sc_ioh;
269 1.24 gdamore
270 1.24 gdamore return (bus_space_read_2(iot, ioh, ETIME_L_REG_W));
271 1.8 uch }
272 1.1 takemura
273 1.24 gdamore int
274 1.24 gdamore vrrtc_get(todr_chip_handle_t tch, volatile struct timeval *tvp)
275 1.8 uch {
276 1.1 takemura
277 1.24 gdamore struct vrrtc_softc *sc = (struct vrrtc_softc *)tch->cookie;
278 1.8 uch bus_space_tag_t iot = sc->sc_iot;
279 1.8 uch bus_space_handle_t ioh = sc->sc_ioh;
280 1.8 uch u_int32_t timeh; /* elapse time (2*timeh sec) */
281 1.8 uch u_int32_t timel; /* timel/32768 sec */
282 1.24 gdamore int64_t sec, usec;
283 1.8 uch
284 1.8 uch timeh = bus_space_read_2(iot, ioh, ETIME_H_REG_W);
285 1.8 uch timeh = (timeh << 16) | bus_space_read_2(iot, ioh, ETIME_M_REG_W);
286 1.8 uch timel = bus_space_read_2(iot, ioh, ETIME_L_REG_W);
287 1.1 takemura
288 1.11 shin DPRINTF(("clock_get: timeh %08x timel %08x\n", timeh, timel));
289 1.1 takemura
290 1.24 gdamore timeh -= EPOCHOFF;
291 1.24 gdamore sec = timeh * 2;
292 1.24 gdamore sec -= sc->sc_epoch;
293 1.24 gdamore tvp->tv_sec = sec;
294 1.24 gdamore tvp->tv_sec += timel / ETIME_L_HZ;
295 1.24 gdamore
296 1.24 gdamore /* scale from 32kHz to 1MHz */
297 1.24 gdamore usec = (timel % ETIME_L_HZ);
298 1.24 gdamore usec *= 1000000;
299 1.24 gdamore usec /= ETIME_L_HZ;
300 1.24 gdamore tvp->tv_usec = (uint32_t)usec;
301 1.1 takemura
302 1.24 gdamore return 0;
303 1.4 sato }
304 1.4 sato
305 1.24 gdamore int
306 1.24 gdamore vrrtc_set(todr_chip_handle_t tch, volatile struct timeval *tvp)
307 1.4 sato {
308 1.24 gdamore struct vrrtc_softc *sc = (struct vrrtc_softc *)tch->cookie;
309 1.8 uch bus_space_tag_t iot = sc->sc_iot;
310 1.8 uch bus_space_handle_t ioh = sc->sc_ioh;
311 1.8 uch u_int32_t timeh; /* elapse time (2*timeh sec) */
312 1.8 uch u_int32_t timel; /* timel/32768 sec */
313 1.24 gdamore int64_t sec, cnt;
314 1.8 uch
315 1.24 gdamore sec = tvp->tv_sec + sc->sc_epoch;
316 1.24 gdamore sec += sc->sc_epoch;
317 1.24 gdamore timeh = EPOCHOFF + (sec / 2);
318 1.24 gdamore timel = sec % 2;
319 1.24 gdamore
320 1.24 gdamore cnt = tvp->tv_usec;
321 1.24 gdamore /* scale from 1MHz to 32kHz */
322 1.24 gdamore cnt *= ETIME_L_HZ;
323 1.24 gdamore cnt /= 1000000;
324 1.24 gdamore timel += (uint32_t)cnt;
325 1.8 uch
326 1.8 uch bus_space_write_2(iot, ioh, ETIME_H_REG_W, (timeh >> 16) & 0xffff);
327 1.8 uch bus_space_write_2(iot, ioh, ETIME_M_REG_W, timeh & 0xffff);
328 1.8 uch bus_space_write_2(iot, ioh, ETIME_L_REG_W, timel);
329 1.1 takemura
330 1.24 gdamore return 0;
331 1.1 takemura }
332 1.1 takemura
333 1.1 takemura void
334 1.8 uch vrrtc_dump_regs(struct vrrtc_softc *sc)
335 1.1 takemura {
336 1.8 uch int timeh;
337 1.8 uch int timel;
338 1.1 takemura
339 1.1 takemura timeh = bus_space_read_2(sc->sc_iot, sc->sc_ioh, ETIME_H_REG_W);
340 1.8 uch timel = bus_space_read_2(sc->sc_iot, sc->sc_ioh, ETIME_M_REG_W);
341 1.8 uch timel = (timel << 16)
342 1.8 uch | bus_space_read_2(sc->sc_iot, sc->sc_ioh, ETIME_L_REG_W);
343 1.8 uch printf("clock_init() Elapse Time %04x%04x\n", timeh, timel);
344 1.1 takemura
345 1.8 uch timeh = bus_space_read_2(sc->sc_iot, sc->sc_ioh, ECMP_H_REG_W);
346 1.8 uch timel = bus_space_read_2(sc->sc_iot, sc->sc_ioh, ECMP_M_REG_W);
347 1.8 uch timel = (timel << 16)
348 1.8 uch | bus_space_read_2(sc->sc_iot, sc->sc_ioh, ECMP_L_REG_W);
349 1.8 uch printf("clock_init() Elapse Compare %04x%04x\n", timeh, timel);
350 1.1 takemura
351 1.8 uch timeh = bus_space_read_2(sc->sc_iot, sc->sc_ioh, RTCL1_H_REG_W);
352 1.8 uch timel = bus_space_read_2(sc->sc_iot, sc->sc_ioh, RTCL1_L_REG_W);
353 1.8 uch printf("clock_init() LONG1 %04x%04x\n", timeh, timel);
354 1.1 takemura
355 1.8 uch timeh = bus_space_read_2(sc->sc_iot, sc->sc_ioh, RTCL1_CNT_H_REG_W);
356 1.8 uch timel = bus_space_read_2(sc->sc_iot, sc->sc_ioh, RTCL1_CNT_L_REG_W);
357 1.8 uch printf("clock_init() LONG1 CNTL %04x%04x\n", timeh, timel);
358 1.1 takemura
359 1.8 uch timeh = bus_space_read_2(sc->sc_iot, sc->sc_ioh, RTCL2_H_REG_W);
360 1.8 uch timel = bus_space_read_2(sc->sc_iot, sc->sc_ioh, RTCL2_L_REG_W);
361 1.8 uch printf("clock_init() LONG2 %04x%04x\n", timeh, timel);
362 1.1 takemura
363 1.8 uch timeh = bus_space_read_2(sc->sc_iot, sc->sc_ioh, RTCL2_CNT_H_REG_W);
364 1.8 uch timel = bus_space_read_2(sc->sc_iot, sc->sc_ioh, RTCL2_CNT_L_REG_W);
365 1.8 uch printf("clock_init() LONG2 CNTL %04x%04x\n", timeh, timel);
366 1.1 takemura
367 1.13 sato if (TCLK_H_REG_W != RTC_NO_REG_W) {
368 1.10 sato timeh = bus_space_read_2(sc->sc_iot, sc->sc_ioh, TCLK_H_REG_W);
369 1.10 sato timel = bus_space_read_2(sc->sc_iot, sc->sc_ioh, TCLK_L_REG_W);
370 1.10 sato printf("clock_init() TCLK %04x%04x\n", timeh, timel);
371 1.10 sato
372 1.10 sato timeh = bus_space_read_2(sc->sc_iot, sc->sc_ioh, TCLK_CNT_H_REG_W);
373 1.10 sato timel = bus_space_read_2(sc->sc_iot, sc->sc_ioh, TCLK_CNT_L_REG_W);
374 1.10 sato printf("clock_init() TCLK CNTL %04x%04x\n", timeh, timel);
375 1.10 sato }
376 1.1 takemura }
377