Skip to content

Commit fa433d3

Browse files
committed
drivers: debug: Moved nrf_etr from misc
Moved the nrf_etr driver from the drive/misc folder into the recently established driver/debug folder where it is a better fit. Moved the associated files such as bindings and headers accordingly as well. Signed-off-by: Karsten Koenig <[email protected]>
1 parent 16f4d6c commit fa433d3

File tree

17 files changed

+89
-82
lines changed

17 files changed

+89
-82
lines changed

doc/releases/migration-guide-4.3.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ Device Drivers and Devicetree
6161

6262
.. zephyr-keep-sorted-start re(^\w)
6363
64+
MISC
65+
====
66+
67+
* The nrf_etr driver has been migrated to drivers/debug. As a consequence the related Kconfig
68+
symbol was renamed from ``NRF_ETR`` to :kconfig:option:`DEBUG_NRF_ETR`, along with the rest of
69+
the ``NRF_ETR`` symbols. Also the driver needs to be explicitly enabled via
70+
:kconfig:option:`DEBUG_DRIVER` as it is no longer built by default.
71+
6472
MFD
6573
===
6674

doc/services/logging/cs_stm.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ When using logs, this method has the following advantages:
119119

120120
Proxy core is using Nordic specific peripheral (TBM) to get ETR buffer busyness and send data over
121121
UART. Nordic specific driver for ETR buffer is located in
122-
:zephyr_file:`drivers/misc/coresight/nrf_etr.c`.
122+
:zephyr_file:`drivers/debug/debug_nrf_etr.c`.
123123

124124
Configuration
125125
-------------
@@ -175,7 +175,7 @@ in :zephyr_file:`subsys/logging/frontends/log_frontend_stmesp_demux.c`.
175175

176176
``Proxy`` is using Nordic specific peripheral (TBM) to get ETR buffer busyness and read and
177177
decode data and send human-readable data over UART. Nordic specific driver for ETR buffer is
178-
located in :zephyr_file:`drivers/misc/coresight/nrf_etr.c`. It is using :ref:`cs_trace_defmt` and
178+
located in :zephyr_file:`drivers/debug/debug_nrf_etr.c`. It is using :ref:`cs_trace_defmt` and
179179
:ref:`mipi_stp_decoder` and above-mentioned demultiplexer to decode messages.
180180

181181
Logging messages contains read-only format string used in the logging macros thus they cannot be

drivers/debug/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ zephyr_library()
55

66
# zephyr-keep-sorted-start
77
zephyr_library_sources_ifdef(CONFIG_DEBUG_SILABS_PTI debug_silabs_pti.c)
8+
zephyr_library_sources_ifdef(CONFIG_DEBUG_NRF_ETR debug_nrf_etr.c)
89
# zephyr-keep-sorted-stop

drivers/debug/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ config DEBUG_DRIVER_INIT_PRIORITY
1515
Debug drivers initialization priority.
1616

1717
# zephyr-keep-sorted-start
18+
source "drivers/debug/Kconfig.nrf"
1819
source "drivers/debug/Kconfig.silabs"
1920
# zephyr-keep-sorted-stop
2021

drivers/misc/coresight/Kconfig renamed to drivers/debug/Kconfig.nrf

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
DT_COMPAT_NORDIC_NRF_TBM := nordic,nrf-tbm
55

6-
config NRF_ETR
6+
config DEBUG_NRF_ETR
77
bool "Coresight ETR handler (with Nordic TBM)"
88
depends on $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_TBM))
99
select NRFX_TBM
@@ -14,9 +14,9 @@ config NRF_ETR
1414
data). Busyness is tracked using TBM (Trace Buffer Monitor) peripheral
1515
which is specific to Nordic Semiconductor SoCs.
1616

17-
if NRF_ETR
17+
if DEBUG_NRF_ETR
1818

19-
config NRF_ETR_DECODE
19+
config DEBUG_NRF_ETR_DECODE
2020
bool "Decode ETR content"
2121
default y if LOG_FRONTEND_STMESP_FSC
2222
select MIPI_STP_DECODER
@@ -29,70 +29,70 @@ config NRF_ETR_DECODE
2929
In this mode, log messages stored by Coresight STM logging frontends are
3030
decoded and printed in the human readable form.
3131

32-
config NRF_ETR_DECODE_DROP_PERIOD
32+
config DEBUG_NRF_ETR_DECODE_DROP_PERIOD
3333
int "Period of dropped messages notification"
3434
default 5000
3535
help
3636
Period (in milliseconds) how often it is checked if any dropped messages
3737
have occurred.
3838

39-
config NRF_ETR_DEBUG
39+
config DEBUG_NRF_ETR_DEBUG
4040
bool "Debug mode"
4141
depends on !LOG_PRINTK
4242
select MIPI_STP_DECODER
4343
select CS_TRACE_DEFMT
4444
help
4545
In debug mode STPv2 decoded data is printed.
4646

47-
config NRF_ETR_STACK_SIZE
47+
config DEBUG_NRF_ETR_STACK_SIZE
4848
int "ETR thread stack size"
49-
default 2048 if NRF_ETR_DECODE || NRF_ETR_DEBUG
49+
default 2048 if DEBUG_NRF_ETR_DECODE || DEBUG_NRF_ETR_DEBUG
5050
default 1024
5151

52-
config NRF_ETR_BACKOFF
52+
config DEBUG_NRF_ETR_BACKOFF
5353
int "Thread backoff time (ms)"
5454
default 10
5555
help
5656
Determines how often attempt to dump the data is performed.
5757

58-
config NRF_ETR_FLUSH_TIMEOUT
58+
config DEBUG_NRF_ETR_FLUSH_TIMEOUT
5959
int "Backoff time during flushing (ms)"
6060
default 100
6161
help
6262
When thread triggers flushing of ETR data, it periodically checks if
6363
there is still a pending ETR data. This option specifies how often
6464
thread is waking up to check. Given in milliseconds.
6565

66-
config NRF_ETR_SYNC_PERIOD
66+
config DEBUG_NRF_ETR_SYNC_PERIOD
6767
int "Period of custom synchronization frame"
68-
default 0 if NRF_ETR_DECODE
69-
default 0 if NRF_ETR_DEBUG
68+
default 0 if DEBUG_NRF_ETR_DECODE
69+
default 0 if DEBUG_NRF_ETR_DEBUG
7070
default 16
7171
help
7272
To help find the synchronization when decoding the ETR content
7373
by a host tool a synchronization pattern (16 bytes of 0xFF) can be
7474
sent on regular intervals. This frame is sent between Coresight formatter
7575
frames. Use 0 to disable.
7676

77-
config NRF_ETR_SHELL
77+
config DEBUG_NRF_ETR_SHELL
7878
bool "Use shell"
7979
select UART_ASYNC_API
8080
select UART_ASYNC_RX_HELPER
8181
select SHELL_LOG_BACKEND_CUSTOM
82-
depends on NRF_ETR_DECODE
82+
depends on DEBUG_NRF_ETR_DECODE
8383
default y if SHELL
8484
help
8585
Enable shell with Coresight STM logging support.
8686

87-
if NRF_ETR_SHELL
87+
if DEBUG_NRF_ETR_SHELL
8888

89-
config NRF_ETR_SHELL_PROMPT
89+
config DEBUG_NRF_ETR_SHELL_PROMPT
9090
string "Displayed prompt name"
9191
default "uart:~$ "
9292
help
9393
Displayed prompt name for UART shell with Coresight STM logging.
9494

95-
config NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE
95+
config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE
9696
int "Size of the RX buffer"
9797
default 16
9898
help
@@ -101,13 +101,13 @@ config NRF_ETR_SHELL_ASYNC_RX_BUFFER_SIZE
101101
slow and may need to be increased if long messages are pasted directly
102102
to the shell prompt.
103103

104-
config NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT
104+
config DEBUG_NRF_ETR_SHELL_ASYNC_RX_BUFFER_COUNT
105105
int "Number of RX buffers"
106106
default 4
107107
range 2 64
108108
help
109109
Number of RX buffers.
110110

111-
endif # NRF_ETR_SHELL
111+
endif # DEBUG_NRF_ETR_SHELL
112112

113-
endif # NRF_ETR
113+
endif # DEBUG_NRF_ETR

0 commit comments

Comments
 (0)