aboutsummaryrefslogtreecommitdiff
path: root/src/soc/ti/am335x/dmtimer.h
diff options
context:
space:
mode:
authorSam Lewis <sam.vr.lewis@gmail.com>2020-08-04 19:47:50 +1000
committerPatrick Georgi <pgeorgi@google.com>2020-11-22 22:32:46 +0000
commitfde084bc490daf99da85292ef87d6dcf3446c212 (patch)
treef005134a3dadedc4fa91ff0f9c07fdd69412fba8 /src/soc/ti/am335x/dmtimer.h
parentb5353965e1b7eff860faaa3312728a935311a8c6 (diff)
soc/ti/am335x: Fix timer implementation
Implements the monotonic timer using the am335x dmtimer peripheral. Change-Id: I4736b6d3b6e26370be9e8f369fc02285ad519223 Signed-off-by: Sam Lewis <sam.vr.lewis@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/44383 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/ti/am335x/dmtimer.h')
-rw-r--r--src/soc/ti/am335x/dmtimer.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/soc/ti/am335x/dmtimer.h b/src/soc/ti/am335x/dmtimer.h
index ad8515fbba..56f3d0f011 100644
--- a/src/soc/ti/am335x/dmtimer.h
+++ b/src/soc/ti/am335x/dmtimer.h
@@ -5,9 +5,33 @@
#include <stdint.h>
-#define OSC_HZ 24000000
+#define M_OSC_MHZ (24)
-void dmtimer_start(int num);
-uint64_t dmtimer_raw_value(int num);
+struct am335x_dmtimer {
+ uint32_t tidr;
+ uint8_t res1[12];
+ uint32_t tiocp_cfg;
+ uint8_t res2[12];
+ uint32_t irq_eoi;
+ uint32_t irqstatus_raw;
+ uint32_t irqstatus;
+ uint32_t irqenable_set;
+ uint32_t irqenable_clr;
+ uint32_t irqwakeen;
+ uint32_t tclr;
+ uint32_t tcrr;
+ uint32_t tldr;
+ uint32_t ttgr;
+ uint32_t twps;
+ uint32_t tmar;
+ uint32_t tcar1;
+ uint32_t tsicr;
+ uint32_t tcar2;
+};
+
+#define TCLR_ST (0x01 << 0)
+#define TCLR_AR (0x01 << 1)
+
+#define DMTIMER_2 (0x48040000)
#endif