From e0dd8a5ad830798bc8082b03b8c42c32fb9660e0 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 20 Apr 2018 12:08:42 +0200 Subject: bsps: Move benchmark timer to bsps This patch is a part of the BSP source reorganization. Update #3285. --- c/src/lib/libbsp/powerpc/qoriq/Makefile.am | 2 +- c/src/lib/libbsp/powerpc/qoriq/timer/timer.c | 42 ----------- c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am | 2 +- c/src/lib/libbsp/powerpc/tqm8xx/timer/timer.c | 101 -------------------------- 4 files changed, 2 insertions(+), 145 deletions(-) delete mode 100644 c/src/lib/libbsp/powerpc/qoriq/timer/timer.c delete mode 100644 c/src/lib/libbsp/powerpc/tqm8xx/timer/timer.c (limited to 'c/src/lib/libbsp/powerpc') diff --git a/c/src/lib/libbsp/powerpc/qoriq/Makefile.am b/c/src/lib/libbsp/powerpc/qoriq/Makefile.am index cd245dfc79..d64191285f 100644 --- a/c/src/lib/libbsp/powerpc/qoriq/Makefile.am +++ b/c/src/lib/libbsp/powerpc/qoriq/Makefile.am @@ -58,7 +58,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/qoriq/start/bsprestart.c librtemsbsp_a_SOURCES +=../../../../../../bsps/powerpc/qoriq/clock/clock-config.c # Timer -librtemsbsp_a_SOURCES += timer/timer.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/qoriq/btimer/btimer.c # IRQ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-default-handler.c diff --git a/c/src/lib/libbsp/powerpc/qoriq/timer/timer.c b/c/src/lib/libbsp/powerpc/qoriq/timer/timer.c deleted file mode 100644 index e8927c1194..0000000000 --- a/c/src/lib/libbsp/powerpc/qoriq/timer/timer.c +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file - * - * @ingroup QorIQ - * - * @brief QorIQ benchmark timer. - */ - -/* - * Copyright (c) 2011 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include - -#include - -static benchmark_timer_t benchmark_timer_base; - -void benchmark_timer_initialize(void) -{ - benchmark_timer_base = ppc_alternate_time_base(); -} - -benchmark_timer_t benchmark_timer_read(void) -{ - return ppc_alternate_time_base() - benchmark_timer_base; -} - -void benchmark_timer_disable_subtracting_average_overhead(bool find_average_overhead) -{ - /* VOID */ -} diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am b/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am index 2e94f2beb4..bc7e02426b 100644 --- a/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am +++ b/c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am @@ -36,7 +36,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/tqm8xx/console/console.c # spi librtemsbsp_a_SOURCES += spi/spi.c # timer -librtemsbsp_a_SOURCES += timer/timer.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/tqm8xx/btimer/btimer.c # startup librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/start/bspidle.c diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/timer/timer.c b/c/src/lib/libbsp/powerpc/tqm8xx/timer/timer.c deleted file mode 100644 index 06c43c56be..0000000000 --- a/c/src/lib/libbsp/powerpc/tqm8xx/timer/timer.c +++ /dev/null @@ -1,101 +0,0 @@ -/*===============================================================*\ -| Project: RTEMS TQM8xx BSP | -+-----------------------------------------------------------------+ -| This file has been adapted to MPC8xx by | -| Thomas Doerfler | -| Copyright (c) 2008 | -| Embedded Brains GmbH | -| Obere Lagerstr. 30 | -| D-82178 Puchheim | -| Germany | -| rtems@embedded-brains.de | -| | -| See the other copyright notice below for the original parts. | -+-----------------------------------------------------------------+ -| The license and distribution terms for this file may be | -| found in the file LICENSE in this distribution or at | -| | -| http://www.rtems.org/license/LICENSE. | -| | -+-----------------------------------------------------------------+ -| this file contains the console driver | -\*===============================================================*/ -/* - * benchmark_timer_initialize() - * - * Use TIMER 1 and TIMER 2 for Timing Test Suite - * - * this is derived from "timer.c" available in the m68k/gen68360 BSP - * adapted by Thomas Doerfler - */ - -/* - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * NOTE: It is important that the timer start/stop overhead be - * determined when porting or modifying this code. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include -#include -#include -#include - -bool benchmark_timer_find_average_overhead; - -void -benchmark_timer_initialize (void) -{ - /* - * Reset timers 1 and 2 - */ - m8xx.tgcr &= ~0x00FF; - m8xx.tcn1 = 0; - m8xx.tcn2 = 0; - m8xx.ter1 = 0xFFFF; - m8xx.ter2 = 0xFFFF; - - /* - * Cascade timers 1 and 2 - */ - m8xx.tgcr |= M8xx_TGCR_CAS2; - - /* - * Configure timers 1 and 2 to a single 32-bit, BUS_clock timer. - */ - m8xx.tmr2 = (0 << 8) | 0x2; - m8xx.tmr1 = 0; - - /* - * Start the timers - */ - m8xx.tgcr |= 0x0011; -} - -/* - * Return timer value in microsecond units - */ -benchmark_timer_t benchmark_timer_read(void) -{ - uint32_t retval; - retval = *(uint32_t*)&m8xx.tcn1; - retval = retval * 1000000LL / BSP_bus_frequency; - return retval; -} - -void benchmark_timer_disable_subtracting_average_overhead( - bool find_flag -) -{ - benchmark_timer_find_average_overhead = find_flag; -} -- cgit v1.2.3