@@ -4895,6 +4895,7 @@ compact Thumb2 instruction set. Supports also ARMv6-M and ARMv8-M cores
48954895@item @code {dsp5680xx } -- implements Freescale's 5680x DSP.
48964896@item @code {esirisc } -- this is an EnSilica eSi-RISC core.
48974897The current implementation supports eSi-32xx cores.
4898+ @item @code {esp32s2 } -- this is a single-core SoC with Xtensa core.
48984899@item @code {fa526 } -- resembles arm920 (w/o Thumb).
48994900@item @code {feroceon } -- resembles arm926.
49004901@item @code {hla_target } -- a Cortex-M alternative to work with HL adapters like ST-Link.
@@ -4933,6 +4934,7 @@ And two debug interfaces cores:
49334934@item @code {testee } -- a dummy target for cases without a real CPU, e.g. CPLD.
49344935@item @code {xscale } -- this is actually an architecture,
49354936not a CPU type. It is based on the ARMv5 architecture.
4937+ @item @code {xtensa } -- this is a generic Cadence/Tensilica Xtensa core.
49364938@end itemize
49374939@end deffn
49384940
@@ -10964,33 +10966,158 @@ OpenOCD supports debugging STM8 through the STMicroelectronics debug
1096410966protocol SWIM, @pxref {swimtransport ,,SWIM }.
1096510967
1096610968@section Xtensa Architecture
10967- Xtensa processors are based on a modular, highly flexible 32-bit RISC architecture
10968- that can easily scale from a tiny, cache-less controller or task engine to a high-performance
10969- SIMD/VLIW DSP provided by Cadence.
10970- @url {https://www.cadence.com/en_US/home/tools/ip/tensilica-ip/tensilica-xtensa-controllers-and-extensible-processors.html }.
1097110969
10972- OpenOCD supports generic Xtensa processors implementation which can be customized by
10973- simply providing vendor-specific core configuration which controls every configurable
10970+ Xtensa is a highly-customizable, user-extensible microprocessor and DSP
10971+ architecture for complex embedded systems provided by Cadence Design
10972+ Systems, Inc. See the
10973+ @uref {https://www.cadence.com/en_US/home/tools/ip/tensilica-ip.html , Tensilica IP }
10974+ website for additional information and documentation.
10975+
10976+ OpenOCD supports generic Xtensa processor implementations which can be customized by
10977+ providing a core-specific configuration file which describes every enabled
1097410978Xtensa architecture option, e.g. number of address registers, exceptions, reduced
10975- size instructions support, memory banks configuration etc. Also OpenOCD supports SMP
10976- configurations for Xtensa processors with any number of cores and allows to configure
10977- their debug signals interconnection (so-called "break/stall networks") which control how
10978- debug signals are distributed among cores. Xtensa "break networks" are compatible with
10979- ARM's Cross Trigger Interface (CTI). For debugging code on Xtensa chips OpenOCD
10980- uses JTAG protocol. Currently OpenOCD implements several Epsressif Xtensa-based chips of
10979+ size instructions support, memory banks configuration etc. OpenOCD also supports SMP
10980+ configurations for Xtensa processors with any number of cores and allows configuring
10981+ their debug interconnect (termed "break/stall networks"), which control how debug
10982+ signals are distributed among cores. Xtensa "break networks" are compatible with
10983+ ARM's Cross Trigger Interface (CTI). OpenOCD implements both generic Xtensa targets
10984+ as well as several Epsressif Xtensa-based chips from the
1098110985@uref {https://www.espressif.com/en/products/socs , ESP32 family }.
1098210986
10983- @subsection General Xtensa Commands
10987+ OCD sessions for Xtensa processor and DSP targets are accessed via the Xtensa
10988+ Debug Module (XDM), which provides external connectivity either through a
10989+ traditional JTAG interface or an ARM DAP interface. If used, the DAP interface
10990+ can control Xtensa targets through JTAG or SWD probes.
10991+
10992+ @subsection Xtensa Core Configuration
10993+
10994+ Due to the high level of configurability in Xtensa cores, the Xtensa target
10995+ configuration is composed of two categories:
10996+
10997+ @enumerate
10998+ @item Base Xtensa support common to all core configurations, and
10999+ @item Core-specific support as configured for individual cores.
11000+ @end enumerate
11001+
11002+ All common Xtensa support is built into the OpenOCD Xtensa target layer and
11003+ is enabled through a combination of TCL scripts: the target-specific
11004+ @code {target/xtensa.cfg } and a board-specific @code {board/xtensa-*.cfg },
11005+ similar to other target architectures.
11006+
11007+ Importantly, core-specific configuration information must be provided by
11008+ the user, and takes the form of an @code {xtensa-core-XXX.cfg } TCL script that
11009+ defines the core's configurable features through a series of Xtensa
11010+ configuration commands (detailed below).
11011+
11012+ This core-specific @code {xtensa-core-XXX.cfg } file is typically either:
11013+
11014+ @itemize @bullet
11015+ @item Located within the Xtensa core configuration build as
11016+ @code {src/config/xtensa-core-openocd.cfg }, or
11017+ @item Generated by running the command @code {xt-gdb --dump-oocd-config }
11018+ from the Xtensa processor tool-chain's command-line tools.
11019+ @end itemize
11020+
11021+ NOTE: @code {xtensa-core-XXX.cfg } must match the target Xtensa hardware
11022+ connected to OpenOCD.
11023+
11024+ Some example Xtensa configurations are bundled with OpenOCD for reference:
11025+ @itemize @bullet
11026+ @item Cadence Palladium VDebug emulation target. The user can combine their
11027+ @code {xtensa-core-XXX.cfg } with the provided
11028+ @code {board/xtensa-palladium-vdebug.cfg } to debug an emulated Xtensa RTL design.
11029+ @item NXP MIMXRT685-EVK evaluation kit. The relevant configuration files are
11030+ @code {board/xtensa-rt685-jlink.cfg } and @code {board/xtensa-core-nxp_rt600.cfg }.
11031+ Additional information is provided by
11032+ @uref {https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt600-evaluation-kit:MIMXRT685-EVK ,
11033+ NXP }.
11034+ @end itemize
11035+
11036+ @subsection Xtensa Configuration Commands
11037+
11038+ @deffn {Command} {xtensa xtdef} ( @option {LX }| @option {NX })
11039+ Configure the Xtensa target architecture. Currently, Xtensa support is limited
11040+ to LX6, LX7, and NX cores.
11041+ @end deffn
11042+
11043+ @deffn {Command} {xtensa xtopt} option value
11044+ Configure Xtensa target options that are relevant to the debug subsystem.
11045+ @var {option } is one of: @option {bigendian }, @option {arnum }, @option {windowed },
11046+ @option {cpenable }, @option {exceptions }, @option {intnum }, @option {hipriints },
11047+ @option {excmlevel }, @option {intlevels }, @option {debuglevel },
11048+ @option {ibreaknum }, or @option {dbreaknum }. @var {value } is an integer with
11049+ the exact range determined by each particular option.
11050+
11051+ NOTE: Some options are specific to Xtensa LX or Xtensa NX architecture, while
11052+ others may be common to both but have different valid ranges.
11053+ @end deffn
11054+
11055+ @deffn {Command} {xtensa xtmem} ( @option {iram }| @option {dram }| @option {sram }| @option {irom }| @option {drom }| @option {srom }) baseaddr bytes
11056+ Configure Xtensa target memory. Memory type determines access rights,
11057+ where RAMs are read/write while ROMs are read-only. @var {baseaddr } and
11058+ @var {bytes } are both integers, typically hexadecimal and decimal, respectively.
11059+ @end deffn
11060+
11061+ @deffn {Command} {xtensa xtmem} ( @option {icache }| @option {dcache }) linebytes cachebytes ways [writeback]
11062+ Configure Xtensa processor cache. All parameters are required except for
11063+ the optional @option {writeback } parameter; all are integers.
11064+ @end deffn
11065+
11066+ @deffn {Command} {xtensa xtmpu} numfgseg minsegsz lockable execonly
11067+ Configure an Xtensa Memory Protection Unit (MPU). MPUs can restrict access
11068+ and/or control cacheability of specific address ranges, but are lighter-weight
11069+ than a full traditional MMU. All parameters are required; all are integers.
11070+ @end deffn
11071+
11072+ @deffn {Command} {xtensa xtmmu} numirefillentries numdrefillentries
11073+ (Xtensa-LX only) Configure an Xtensa Memory Management Unit (MMU). Both
11074+ parameters are required; both are integers.
11075+ @end deffn
11076+
11077+ @deffn {Command} {xtensa xtregs} numregs
11078+ Configure the total number of registers for the Xtensa core. Configuration
11079+ logic expects to subsequently process this number of @code {xtensa xtreg }
11080+ definitions. @var {numregs } is an integer.
11081+ @end deffn
11082+
11083+ @deffn {Command} {xtensa xtregfmt} ( @option {sparse }| @option {contiguous }) [general]
11084+ Configure the type of register map used by GDB to access the Xtensa core.
11085+ Generic Xtensa tools (e.g. xt-gdb) require @option {sparse } mapping (default) while
11086+ Espressif tools expect @option {contiguous } mapping. Contiguous mapping takes an
11087+ additional, optional integer parameter @option {general }, which specifies the number
11088+ of general registers used in handling g/G packets.
11089+ @end deffn
11090+
11091+ @deffn {Command} {xtensa xtreg} name offset
11092+ Configure an Xtensa core register. All core registers are 32 bits wide,
11093+ while TIE and user registers may have variable widths. @var {name } is a
11094+ character string identifier while @var {offset } is a hexadecimal integer.
11095+ @end deffn
11096+
11097+ @subsection Xtensa Debug Module Configuration Commands
11098+
11099+ @deffn {Command} {xtensa dm offset} value
11100+ Configure the Xtensa Debug Module (DM) to apply a fixed offset when accessing
11101+ debug registers behind a DAP interface (typically over APB). The offset
11102+ value must be aligned to the size of the DM register file, typically 16KB.
11103+ @end deffn
11104+
11105+ @subsection Xtensa Operation Commands
11106+
11107+ @deffn {Command} {xtensa maskisr} ( @option {on }| @option {off })
11108+ (Xtensa-LX only) Mask or unmask Xtensa interrupts during instruction step.
11109+ When masked, an interrupt that occurs during a step operation is handled and
11110+ its ISR is executed, with the user's debug session returning after potentially
11111+ executing many instructions. When unmasked, a triggered interrupt will result
11112+ in execution progressing the requested number of instructions into the relevant
11113+ vector/ISR code.
11114+ @end deffn
1098411115
1098511116@deffn {Command} {xtensa set_permissive} (0|1)
1098611117By default accessing memory beyond defined regions is forbidden. This commnd controls memory access address check.
1098711118When set to (1), skips access controls and address range check before read/write memory.
1098811119@end deffn
1098911120
10990- @deffn {Command} {xtensa maskisr} (on|off)
10991- Selects whether interrupts will be disabled during stepping over single instruction. The default configuration is (off).
10992- @end deffn
10993-
1099411121@deffn {Command} {xtensa smpbreak} [none|breakinout|runstall] | [BreakIn] [BreakOut] [RunStallIn] [DebugModeOut]
1099511122Configures debug signals connection ("break network") for currently selected core.
1099611123@itemize @bullet
@@ -11014,6 +11141,8 @@ This feature is not well implemented and tested yet.
1101411141@end itemize
1101511142@end deffn
1101611143
11144+ @subsection Xtensa Performance Monitor Configuration
11145+
1101711146@deffn {Command} {xtensa perfmon_enable} <counter_id> <select> [mask] [kernelcnt] [tracelevel]
1101811147Enable and start performance counter.
1101911148@itemize @bullet
@@ -11033,6 +11162,8 @@ whether to count.
1103311162Dump performance counter value. If no argument specified, dumps all counters.
1103411163@end deffn
1103511164
11165+ @subsection Xtensa Trace Configuration
11166+
1103611167@deffn {Command} {xtensa tracestart} [pc <pcval>/[<maskbitcount>]] [after <n> [ins|words]]
1103711168Set up and start a HW trace. Optionally set PC address range to trigger tracing stop when reached during program execution.
1103811169This command also allows to specify the amount of data to capture after stop trigger activation.
0 commit comments