summaryrefslogtreecommitdiff
path: root/orbtrace
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2022-10-05 10:36:25 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2022-10-05 10:36:25 +0200
commit41636f4a36f39be0afefde5682040da767b86122 (patch)
tree8efda16e0a820a709408aba278a9da8e8dd70373 /orbtrace
parentbab201ae1db6905b8c3ad1b7dd1cdd65d8192120 (diff)
orbtrace: Add initial support.orbtrace
Diffstat (limited to 'orbtrace')
-rw-r--r--orbtrace/SConscript21
-rw-r--r--orbtrace/orbtrace_dbgif.h18
2 files changed, 39 insertions, 0 deletions
diff --git a/orbtrace/SConscript b/orbtrace/SConscript
new file mode 100644
index 0000000..b108d18
--- /dev/null
+++ b/orbtrace/SConscript
@@ -0,0 +1,21 @@
+Import('env')
+
+headers = set()
+instances = []
+sources = []
+aliases = {}
+
+periph = env['PLATFORM_SPEC'].get('periph', {})
+
+if 'orbtrace_dbgif' in periph:
+ headers.add('orbtrace_dbgif.h')
+ for name, data in periph['orbtrace_dbgif'].items():
+ instances.append({
+ 'type': 'Orbtrace_DBGIF_t',
+ 'name': name,
+ 'args': [data['offset']],
+ })
+
+env.Jinja2('orbtrace.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances, aliases = aliases)
+
+Return('sources')
diff --git a/orbtrace/orbtrace_dbgif.h b/orbtrace/orbtrace_dbgif.h
new file mode 100644
index 0000000..c5f0b46
--- /dev/null
+++ b/orbtrace/orbtrace_dbgif.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <stdint.h>
+#include <mmio/mmio.h>
+
+struct Orbtrace_DBGIF_reg_t {
+ volatile uint32_t CMD;
+ volatile uint32_t STATUS;
+ volatile uint32_t DWRITE;
+ volatile uint32_t DREAD;
+ volatile uint32_t PINS_OUT;
+ volatile uint32_t PINS_IN;
+};
+
+class Orbtrace_DBGIF_t : public mmio_ptr<Orbtrace_DBGIF_reg_t> {
+ public:
+ using mmio_ptr<Orbtrace_DBGIF_reg_t>::ptr;
+};