Skip to content

Commit 74872ca

Browse files
committed
ARCv3: Add an option to switch on SmaRT.
Small real time trace (SmaRT) is an optional on-chip debug hardware component that captures instructiontrace history. SmaRT stores the address of the most recent non-sequential instructions executed. The MetaWare debugger reads the saved instruction trace information via the JTAG port when the processor is halted. ARC_SMART_ENABLE menuconfig parameter can be used to switch SmaRT on.
1 parent f269da7 commit 74872ca

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

arch/arc/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,16 @@ config ARC_DW2_UNWIND
675675
If you don't debug the kernel, you can say N, but we may not be able
676676
to solve problems without frame unwind information
677677

678+
config ARC_SMART_ENABLE
679+
bool "Enable small real time trace (SmaRT)"
680+
default n
681+
help
682+
SmaRT is an optional on-chip debug hardware component that captures
683+
instruction trace history. SmaRT stores the address of the most recent
684+
non-sequential instructions executed. The MetaWare debugger reads the
685+
saved instruction trace information via the JTAG port when the processor
686+
is halted.
687+
678688
config ARC_DBG_JUMP_LABEL
679689
bool "Paranoid checks in Static Keys (jump labels) code"
680690
depends on JUMP_LABEL

arch/arc/kernel/head.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,18 @@
329329
sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE]
330330
#endif
331331

332+
#ifdef CONFIG_ARC_SMART_ENABLE
333+
.equ SMART_BUILD, 0xFF
334+
.equ SMART_CONTROL, 0x700
335+
lr r5, [SMART_BUILD]
336+
and r5, r5, 0xff
337+
breq r5, 0, 1f ; SmaRT doesn't exist
338+
lr r5, [SMART_CONTROL]
339+
or r5, r5, 1 ; enable SmaRT
340+
sr r5, [SMART_CONTROL]
341+
1:
342+
#endif
343+
332344
#ifdef CONFIG_ARC_HWPF
333345
lr r5, [ARC_REG_HW_PF_CTRL]
334346
or r5, r5, 1

0 commit comments

Comments
 (0)