source: rtems/c/src/lib/libbsp/m68k/genmcf548x/timer/timer.c @ 25c62b0

4.104.114.95
Last change on this file since 25c62b0 was 25c62b0, checked in by Joel Sherrill <joel.sherrill@…>, on 08/31/08 at 18:18:17

2008-08-31 Joel Sherrill <joel.sherrill@…>

  • timer/timer.c: Eliminate empty function from every benchmark timer driver. Fix spelling.
  • Property mode set to 100644
File size: 3.7 KB
Line 
1/*===============================================================*\
2| Project: RTEMS generic mcf548x BSP                              |
3+-----------------------------------------------------------------+
4| File: timer.c                                                   |
5+-----------------------------------------------------------------+
6| The file contains the diagnostic timer code of generic MCF548x  |
7| BSP.                                                            |
8+-----------------------------------------------------------------+
9|                    Copyright (c) 2007                           |
10|                    Embedded Brains GmbH                         |
11|                    Obere Lagerstr. 30                           |
12|                    D-82178 Puchheim                             |
13|                    Germany                                      |
14|                    rtems@embedded-brains.de                     |
15+-----------------------------------------------------------------+
16|                                                                 |
17| Parts of the code has been derived from the "dBUG source code"  |
18| package Freescale is providing for M548X EVBs. The usage of     |
19| the modified or unmodified code and it's integration into the   |
20| generic mcf548x BSP has been done according to the Freescale    |
21| license terms.                                                  |
22|                                                                 |
23| The Freescale license terms can be reviewed in the file         |
24|                                                                 |
25|    Freescale_license.txt                                        |
26|                                                                 |
27+-----------------------------------------------------------------+
28|                                                                 |
29| The generic mcf548x BSP has been developed on the basic         |
30| structures and modules of the av5282 BSP.                       |
31|                                                                 |
32+-----------------------------------------------------------------+
33|                                                                 |
34| The license and distribution terms for this file may be         |
35| found in the file LICENSE in this distribution or at            |
36|                                                                 |
37| http://www.rtems.com/license/LICENSE.                           |
38|                                                                 |
39+-----------------------------------------------------------------+
40|                                                                 |
41|   date                      history                        ID   |
42| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
43| 12.11.07                    1.0                            ras  |
44|                                                                 |
45\*===============================================================*/
46
47/*
48 *  Timer Init
49 *
50 *  Use the second slice timer (SLT1) as the diagnostic timer.
51 */
52
53#include <rtems.h>
54#include <bsp.h>
55#include <mcf548x/mcf548x.h>
56
57rtems_boolean benchmark_timer_find_average_overhead;
58static uint32_t microsecond_timer_value = 0;
59
60void benchmark_timer_initialize(void)
61{
62MCF548X_SLT_SLTCNT1 = 0xFFFFFFFF;
63MCF548X_SLT_SCR1 |= (MCF548X_SLT_SCR_TEN | MCF548X_SLT_SCR_RUN);
64}
65
66/*
67 * Return timer value in microsecond units
68 * XLB clock 100 MHz / 1us is equal to 100 counts
69 */
70int
71benchmark_timer_read(void)
72{
73        microsecond_timer_value = (0xFFFFFFFF - MCF548X_SLT_SCNT1)/100;
74    return microsecond_timer_value;
75}
76
77void
78benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
79{
80benchmark_timer_find_average_overhead = find_flag;
81}
Note: See TracBrowser for help on using the repository browser.