From 41636f4a36f39be0afefde5682040da767b86122 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Wed, 5 Oct 2022 10:36:25 +0200 Subject: orbtrace: Add initial support. --- .gitignore | 1 + SConscript | 1 + orbtrace/SConscript | 21 +++++++++++++++++++++ orbtrace/orbtrace_dbgif.h | 18 ++++++++++++++++++ platforms/index.yaml | 5 +++++ platforms/orbtrace.yaml | 42 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 88 insertions(+) create mode 100644 orbtrace/SConscript create mode 100644 orbtrace/orbtrace_dbgif.h create mode 100644 platforms/orbtrace.yaml diff --git a/.gitignore b/.gitignore index 8ece78f..ae15383 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ interrupt/interrupt.h interrupt/interrupt_enums.h interrupt/default_handlers.cpp interrupt/vectors_*.cpp +orbtrace/orbtrace.h pwr/pwr.h rcc/flash.h rcc/rcc.h diff --git a/SConscript b/SConscript index 1378e7d..c837058 100644 --- a/SConscript +++ b/SConscript @@ -22,6 +22,7 @@ env.Append( env.SConscript('usb/SConscript'), env.SConscript('display/SConscript'), env.SConscript('wpan/SConscript'), + env.SConscript('orbtrace/SConscript'), env.SConscript('startup/SConscript'), Glob('os/*.cpp'), ], 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 +#include + +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 { + public: + using mmio_ptr::ptr; +}; diff --git a/platforms/index.yaml b/platforms/index.yaml index 15a83e6..2018e00 100644 --- a/platforms/index.yaml +++ b/platforms/index.yaml @@ -8,6 +8,11 @@ -: !import gd32v.yaml +- match: + mcu: orbtrace + + -: !import orbtrace.yaml + - match: cpu: !re cortex-m diff --git a/platforms/orbtrace.yaml b/platforms/orbtrace.yaml new file mode 100644 index 0000000..47ba74c --- /dev/null +++ b/platforms/orbtrace.yaml @@ -0,0 +1,42 @@ +- match: + mcu: !re orbtrace + + mem: + flash: + origin: 0x20000000 + size: 1M + #origin: 0x08400000 + #size: 4M + + ram: + origin: 0x20100000 + size: 7M + #origin: 0x20000000 + #size: 8M + + periph: + litex_timer: + TIMER0: + offset: 0xf0002800 + + litex_uart: + UART: + offset: 0xf0003000 + + orbtrace_dbgif: + DBGIF: + offset: 0xf0004000 + + litex_wishbone_dma_writer: + CMSIS_DAP_OUT: + offset: 0xf0006000 + + litex_wishbone_dma_reader: + CMSIS_DAP_IN: + offset: 0xf0006800 + + interrupt: + irq: {} + + meta: + cpu: rv32im -- cgit v1.2.3