| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: sa11x0_ost.c,v 1.31 2013/12/17 01:29:39 joerg Exp $ */ | | 1 | /* $NetBSD: sa11x0_ost.c,v 1.32 2016/10/09 14:43:17 christos Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1997 Mark Brinicombe. | | 4 | * Copyright (c) 1997 Mark Brinicombe. |
5 | * Copyright (c) 1997 Causality Limited. | | 5 | * Copyright (c) 1997 Causality Limited. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * This code is derived from software contributed to The NetBSD Foundation | | 8 | * This code is derived from software contributed to The NetBSD Foundation |
9 | * by IWAMOTO Toshihiro and Ichiro FUKUHARA. | | 9 | * by IWAMOTO Toshihiro and Ichiro FUKUHARA. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -28,27 +28,27 @@ | | | @@ -28,27 +28,27 @@ |
28 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 28 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
29 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 29 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
30 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 30 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
31 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 31 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
32 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 32 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
33 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 33 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
34 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 34 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
35 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 35 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
36 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 36 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
37 | * POSSIBILITY OF SUCH DAMAGE. | | 37 | * POSSIBILITY OF SUCH DAMAGE. |
38 | */ | | 38 | */ |
39 | | | 39 | |
40 | #include <sys/cdefs.h> | | 40 | #include <sys/cdefs.h> |
41 | __KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.31 2013/12/17 01:29:39 joerg Exp $"); | | 41 | __KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.32 2016/10/09 14:43:17 christos Exp $"); |
42 | | | 42 | |
43 | #include <sys/types.h> | | 43 | #include <sys/types.h> |
44 | #include <sys/param.h> | | 44 | #include <sys/param.h> |
45 | #include <sys/systm.h> | | 45 | #include <sys/systm.h> |
46 | #include <sys/kernel.h> | | 46 | #include <sys/kernel.h> |
47 | #include <sys/time.h> | | 47 | #include <sys/time.h> |
48 | #include <sys/timetc.h> | | 48 | #include <sys/timetc.h> |
49 | #include <sys/device.h> | | 49 | #include <sys/device.h> |
50 | | | 50 | |
51 | #include <sys/bus.h> | | 51 | #include <sys/bus.h> |
52 | #include <machine/intr.h> | | 52 | #include <machine/intr.h> |
53 | | | 53 | |
54 | #include <arm/cpufunc.h> | | 54 | #include <arm/cpufunc.h> |
| @@ -266,27 +266,27 @@ static void | | | @@ -266,27 +266,27 @@ static void |
266 | saost_tc_init(void) | | 266 | saost_tc_init(void) |
267 | { | | 267 | { |
268 | static struct timecounter saost_tc = { | | 268 | static struct timecounter saost_tc = { |
269 | .tc_get_timecount = saost_tc_get_timecount, | | 269 | .tc_get_timecount = saost_tc_get_timecount, |
270 | .tc_counter_mask = ~0, | | 270 | .tc_counter_mask = ~0, |
271 | .tc_name = "saost_count", | | 271 | .tc_name = "saost_count", |
272 | #if !(defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250)) | | 272 | #if !(defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250)) |
273 | .tc_frequency = TIMER_FREQUENCY, | | 273 | .tc_frequency = TIMER_FREQUENCY, |
274 | #endif | | 274 | #endif |
275 | .tc_quality = 100, | | 275 | .tc_quality = 100, |
276 | }; | | 276 | }; |
277 | | | 277 | |
278 | #if defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250) | | 278 | #if defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250) |
279 | saost_tc.tc_frequency = TIMER_FREQUENCY, | | 279 | saost_tc.tc_frequency = TIMER_FREQUENCY; |
280 | #endif | | 280 | #endif |
281 | tc_init(&saost_tc); | | 281 | tc_init(&saost_tc); |
282 | } | | 282 | } |
283 | | | 283 | |
284 | static uint32_t | | 284 | static uint32_t |
285 | gettick(void) | | 285 | gettick(void) |
286 | { | | 286 | { |
287 | struct saost_softc *sc = saost_sc; | | 287 | struct saost_softc *sc = saost_sc; |
288 | uint32_t counter; | | 288 | uint32_t counter; |
289 | u_int saved_ints; | | 289 | u_int saved_ints; |
290 | | | 290 | |
291 | saved_ints = disable_interrupts(I32_bit); | | 291 | saved_ints = disable_interrupts(I32_bit); |
292 | counter = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SAOST_CR); | | 292 | counter = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SAOST_CR); |