summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/arm/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-01-21 10:53:16 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-01-21 13:25:07 +0100
commit370cdefdbc03a23631988911b4a8e525ed4e4b7c (patch)
tree621c0bc60b455d9187a801aaba3725c8c9a9b348 /cpukit/score/cpu/arm/rtems
parentmips/hurricane: Add per-section compilation and linking support. (diff)
downloadrtems-370cdefdbc03a23631988911b4a8e525ed4e4b7c.tar.bz2
arm: Use DWT CYCCNT for timecounter if available
Diffstat (limited to 'cpukit/score/cpu/arm/rtems')
-rw-r--r--cpukit/score/cpu/arm/rtems/score/armv7m.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/cpukit/score/cpu/arm/rtems/score/armv7m.h b/cpukit/score/cpu/arm/rtems/score/armv7m.h
index c5e473ec0a..251ecdce39 100644
--- a/cpukit/score/cpu/arm/rtems/score/armv7m.h
+++ b/cpukit/score/cpu/arm/rtems/score/armv7m.h
@@ -75,6 +75,30 @@ typedef struct {
} ARMV7M_Exception_frame;
typedef struct {
+ uint32_t comp;
+ uint32_t mask;
+ uint32_t function;
+ uint32_t reserved;
+} ARMV7M_DWT_comparator;
+
+typedef struct {
+#define ARMV7M_DWT_CTRL_NOCYCCNT (1U << 25)
+#define ARMV7M_DWT_CTRL_CYCCNTENA (1U << 0)
+ uint32_t ctrl;
+ uint32_t cyccnt;
+ uint32_t cpicnt;
+ uint32_t exccnt;
+ uint32_t sleepcnt;
+ uint32_t lsucnt;
+ uint32_t foldcnt;
+ uint32_t pcsr;
+ ARMV7M_DWT_comparator comparator[249];
+ uint32_t reserved_e0001fb0[1];
+ uint32_t lar;
+ uint32_t lsr;
+} ARMV7M_DWT;
+
+typedef struct {
uint32_t cpuid;
#define ARMV7M_SCB_ICSR_NMIPENDSET (1U << 31)
@@ -323,6 +347,7 @@ typedef struct {
0 \
}
+#define ARMV7M_DWT_BASE 0xe0001000
#define ARMV7M_SCS_BASE 0xe000e000
#define ARMV7M_ICTAC_BASE (ARMV7M_SCS_BASE + 0x0)
#define ARMV7M_SYSTICK_BASE (ARMV7M_SCS_BASE + 0x10)
@@ -330,6 +355,8 @@ typedef struct {
#define ARMV7M_SCB_BASE (ARMV7M_SCS_BASE + 0xd00)
#define ARMV7M_MPU_BASE (ARMV7M_SCS_BASE + 0xd90)
+#define _ARMV7M_DWT \
+ ((volatile ARMV7M_DWT *) ARMV7M_DWT_BASE)
#define _ARMV7M_ICTAC \
((volatile ARMV7M_ICTAC *) ARMV7M_ICTAC_BASE)
#define _ARMV7M_SCB \