source: rtems/bsps/m68k/genmcf548x/btimer/btimer.c @ 947c6645

Last change on this file since 947c6645 was 947c6645, checked in by Christian Mauderer <christian.mauderer@…>, on 03/07/22 at 13:06:23

bsps/m68k: Restore license file

Quite some files in the bsps/m68k/genmcf548x mention a
Freescale_license.txt file. The file has been accidentally removed
during the source reorganization in 2018. This commit restores it and
moves it to the right location for licenses.

Update #4625.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 * RTEMS generic mcf548x BSP
3 *
4 * The file contains the diagnostic timer code of generic MCF548x
5 * BSP.
6 *
7 * Parts of the code has been derived from the "dBUG source code"
8 * package Freescale is providing for M548X EVBs. The usage of
9 * the modified or unmodified code and it's integration into the
10 * generic mcf548x BSP has been done according to the Freescale
11 * license terms.
12 *
13 * The Freescale license terms can be reviewed in the file
14 *
15 *    LICENSE.Freescale
16 *
17 * The generic mcf548x BSP has been developed on the basic
18 * structures and modules of the av5282 BSP.
19 */
20
21/*
22 * Copyright (c) 2007 embedded brains GmbH. All rights reserved.
23 *
24 * The license and distribution terms for this file may be
25 * found in the file LICENSE in this distribution or at
26 * http://www.rtems.org/license/LICENSE.
27 */
28
29/*
30 *  Timer Init
31 *
32 *  Use the second slice timer (SLT1) as the diagnostic timer.
33 */
34
35#include <rtems.h>
36#include <rtems/btimer.h>
37#include <bsp.h>
38#include <mcf548x/mcf548x.h>
39
40bool benchmark_timer_find_average_overhead;
41static uint32_t microsecond_timer_value = 0;
42
43void benchmark_timer_initialize(void)
44{
45    MCF548X_SLT_SLTCNT1 = 0xFFFFFFFF;
46    MCF548X_SLT_SCR1 |= (MCF548X_SLT_SCR_TEN | MCF548X_SLT_SCR_RUN);
47}
48
49/*
50 * Return timer value in microsecond units
51 * XLB clock 100 MHz / 1us is equal to 100 counts
52 */
53uint32_t
54benchmark_timer_read(void)
55{
56    microsecond_timer_value = (0xFFFFFFFF - MCF548X_SLT_SCNT1)/100;
57
58    return microsecond_timer_value;
59}
60
61void
62benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
63{
64    benchmark_timer_find_average_overhead = find_flag;
65}
Note: See TracBrowser for help on using the repository browser.