[rtems commit] bsp/virtex: Move timer config to new file

Sebastian Huber sebh at rtems.org
Mon Jun 24 08:48:40 UTC 2013


Module:    rtems
Branch:    master
Commit:    bee7612ec57be542c4cc14b5177f6a1d7fd6804d
Changeset: http://git.rtems.org/rtems/commit/?id=bee7612ec57be542c4cc14b5177f6a1d7fd6804d

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jun 18 16:39:24 2013 +0200

bsp/virtex: Move timer config to new file

---

 c/src/lib/libbsp/powerpc/virtex/Makefile.am        |   10 ++-
 c/src/lib/libbsp/powerpc/virtex/startup/bspstart.c |    6 --
 .../lib/libbsp/powerpc/virtex/timer/timer-config.c |   61 ++++++++++++++++++++
 3 files changed, 68 insertions(+), 9 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/virtex/Makefile.am b/c/src/lib/libbsp/powerpc/virtex/Makefile.am
index 65663d9..a2647e8 100644
--- a/c/src/lib/libbsp/powerpc/virtex/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/virtex/Makefile.am
@@ -39,6 +39,7 @@ dist_project_lib_DATA += ../shared/startup/linkcmds.base
 
 noinst_LIBRARIES += libbsp.a
 libbsp_a_SOURCES =
+libbsp_a_LIBADD =
 
 # startup
 libbsp_a_SOURCES += ../../shared/bspclean.c ../../shared/bspgetworkarea.c \
@@ -69,13 +70,16 @@ network_rel_CPPFLAGS = $(AM_CPPFLAGS)
 network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 endif
 
-libbsp_a_LIBADD = \
+# timer
+libbsp_a_SOURCES += timer/timer-config.c
+libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/ppc403/timer.rel
+
+libbsp_a_LIBADD += \
     ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
     ../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
     ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
     ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
-    ../../../libcpu/@RTEMS_CPU@/ppc403/clock.rel \
-    ../../../libcpu/@RTEMS_CPU@/ppc403/timer.rel
+    ../../../libcpu/@RTEMS_CPU@/ppc403/clock.rel
 
 if HAS_NETWORKING
 libbsp_a_LIBADD += network.rel
diff --git a/c/src/lib/libbsp/powerpc/virtex/startup/bspstart.c b/c/src/lib/libbsp/powerpc/virtex/startup/bspstart.c
index f19c3fc..4cb8cda 100644
--- a/c/src/lib/libbsp/powerpc/virtex/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/virtex/startup/bspstart.c
@@ -73,9 +73,6 @@ LINKER_SYMBOL(virtex_exc_vector_base);
  *  Driver configuration parameters
  */
 uint32_t   bsp_clicks_per_usec;
-uint32_t   bsp_timer_average_overhead; /* Average overhead of timer in ticks */
-uint32_t   bsp_timer_least_valid;      /* Least valid number from timer      */
-bool       bsp_timer_internal_clock;   /* TRUE, when timer runs with CPU clk */
 
 /*
  *  bsp_start
@@ -98,9 +95,6 @@ void bsp_start( void )
 
   /* timebase register ticks/microsecond */
   bsp_clicks_per_usec = (250000000 / 1000000);
-  bsp_timer_internal_clock  = true;
-  bsp_timer_average_overhead = 2;
-  bsp_timer_least_valid = 3;
 
   /*
    * Initialize default raw exception handlers.
diff --git a/c/src/lib/libbsp/powerpc/virtex/timer/timer-config.c b/c/src/lib/libbsp/powerpc/virtex/timer/timer-config.c
new file mode 100644
index 0000000..29651eb
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/virtex/timer/timer-config.c
@@ -0,0 +1,61 @@
+/*
+ *  Author:	Thomas Doerfler <td at imd.m.isar.de>
+ *              IMD Ingenieurbuero fuer Microcomputertechnik
+ *
+ *  COPYRIGHT (c) 1998 by IMD
+ *
+ *  Changes from IMD are covered by the original distributions terms.
+ *  This file has been derived from the papyrus BSP:
+ *
+ *  Author:	Andrew Bray <andy at i-cubed.co.uk>
+ *
+ *  COPYRIGHT (c) 1995 by i-cubed ltd.
+ *
+ *  To anyone who acknowledges that this file is provided "AS IS"
+ *  without any express or implied warranty:
+ *      permission to use, copy, modify, and distribute this file
+ *      for any purpose is hereby granted without fee, provided that
+ *      the above copyright notice and this notice appears in all
+ *      copies, and that the name of i-cubed limited not be used in
+ *      advertising or publicity pertaining to distribution of the
+ *      software without specific, written prior permission.
+ *      i-cubed limited makes no representations about the suitability
+ *      of this software for any purpose.
+ *
+ *  Modifications for spooling console driver and control of memory layout
+ *  with linker command file by
+ *              Thomas Doerfler <td at imd.m.isar.de>
+ *  for these modifications:
+ *  COPYRIGHT (c) 1997 by IMD, Puchheim, Germany.
+ *
+ *  To anyone who acknowledges that this file is provided "AS IS"
+ *  without any express or implied warranty:
+ *      permission to use, copy, modify, and distribute this file
+ *      for any purpose is hereby granted without fee, provided that
+ *      the above copyright notice and this notice appears in all
+ *      copies. IMD makes no representations about the suitability
+ *      of this software for any purpose.
+ *
+ *  Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c:
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  Modifications for PPC405GP by Dennis Ehlin
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+
+/*
+ *  Driver configuration parameters
+ */
+
+/* Average overhead of timer in ticks */
+uint32_t bsp_timer_average_overhead = 2;
+
+/* Least valid number from timer */
+uint32_t bsp_timer_least_valid = 3;
+
+/* TRUE, when timer runs with CPU clk */
+bool bsp_timer_internal_clock = true;




More information about the vc mailing list