1# Copyright (c) 2022 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4menu "Frontends"
5
6config LOG_FRONTEND_DICT_UART
7	bool "UART dictionary frontend"
8	select LOG_DICTIONARY_SUPPORT
9	select MPSC_PBUF
10	depends on UART_ASYNC_API || UART_INTERRUPT_DRIVEN
11	imply LOG_FMT_SECTION
12	imply LOG_FMT_SECTION_STRIP if !LOG_ALWAYS_RUNTIME
13	help
14	  Frontend sends data in binary dictionary mode.
15
16if LOG_FRONTEND_DICT_UART
17
18config LOG_FRONTEND_DICT_UART_BUFFER_SIZE
19	int "Buffer size"
20	default 1024
21	help
22	  Number of bytes dedicated for buffering data
23
24config LOG_FRONTEND_DICT_UART_DROPPED_NOTIFY_PERIOD
25	int "Dropped notification period"
26	default 500
27	help
28	  Determines how often a report about dropped messages is printed. Given
29	  in milliseconds.
30
31endif
32
33config LOG_FRONTEND_STMESP
34	bool "Coresight STM frontend"
35	imply ARM_ON_ENTER_CPU_IDLE_HOOK if LOG_FRONTEND_STMESP_FLUSH_COUNT > 0
36
37if LOG_FRONTEND_STMESP
38
39config LOG_FRONTEND_STMESP_DICT
40	bool
41	default y if !LOG_FRONTEND_STMESP_FSC
42	select LOG_FRONTEND_OPT_API
43	select LOG_DICTIONARY_DB
44	imply LOG_FMT_SECTION
45	imply LOG_FMT_SECTION_STRIP
46
47config LOG_FRONTEND_STMESP_FSC
48	bool "Send fully self-contained messages"
49	select LOG_MSG_APPEND_RO_STRING_LOC if !(NRF_ETR || \
50			SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR)
51
52config LOG_FRONTEND_STMESP_FLUSH_COUNT
53	int "Number of flushing words"
54	default 4
55	help
56	  Before going to sleep CPU shall write to STM some dummy data to ensure
57	  that any buffered data goes to TPIU/ETR.
58
59config LOG_FRONTEND_STMESP_EARLY_BUF_SIZE
60	int "Buffer size to store early messages"
61	default 0
62	help
63	  Frontend cannot write to STM if it is used with ETR buffer unless ETR is
64	  initialized and memory is properly configured (privileges). Data is stored
65	  in the buffer and flushed to the STMESP once the pipeline is ready.
66
67config LOG_FRONTEND_STMESP_DICT_VER
68	def_int 0
69
70config LOG_FRONTEND_STMESP_TURBO_LOG
71	bool "Optimize short_logs"
72	select LOG_CUSTOM_HEADER
73	default y if (NRF_ETR || SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUFLPR) \
74		     && LOG_FRONTEND_STMESP_FSC
75	help
76	  When enabled, then logging messages with 0 and 1 numeric argument are
77	  optimized and handled much faster than others.
78
79config LOG_FRONTEND_STMESP_TURBO_DROP_OTHERS
80	bool "Drop all logs except turbo logs"
81	help
82	  Option can be enabled for memory constraint cases to remove all logging
83	  related code except turbo logs.
84
85config LOG_FRONTEND_STMESP_TURBO_LOG_BASE
86	def_int 32768
87
88config LOG_FRONTEND_STPESP_TURBO_SOURCE_PORT_ID
89	def_int 65535
90	depends on LOG_FRONTEND_STMESP_TURBO_LOG
91
92config LOG_FRONTEND_STMESP_GUARANTEED_ACCESS
93	bool "Use STMESP guaranteed access"
94	help
95	  When enabled, accessing STMESP registers will stall if write cannot be
96	  performed (e.g. ETR buffer is full).
97
98config LOG_FRONTEND_STMESP_MSG_END_TIMESTAMP
99	bool "Generate timestamp and marker at message end"
100	help
101	  Generate a zero data byte with timestamp and marker at message end,
102	  instead of generating a timestamp and marker at message start and
103	  a flag at end. This can be used to maintain compatibility with
104	  certain decoders.
105
106endif # LOG_FRONTEND_STMESP
107
108config LOG_FRONTEND_STMESP_DEMUX
109	bool "Demultiplexer of logging packets from STM stream"
110	select MPSC_PBUF
111	help
112	  Module demultiplexes messages encoded in STPv2 stream. Messages may
113	  be interleaved because they may come from multiple cores (majors).
114	  There are 3 types of messages: logging, tracepoints and HW events.
115
116if LOG_FRONTEND_STMESP_DEMUX
117
118config LOG_FRONTEND_STMESP_DEMUX_ACTIVE_PACKETS
119	int "Active packets"
120	default 12
121
122config LOG_FRONTEND_STMESP_DEMUX_BUFFER_SIZE
123	int "Buffer size"
124	default 1024
125
126config LOG_FRONTEND_STMESP_DEMUX_MAX_UTILIZATION
127	bool "Track maximum utilization"
128
129config LOG_FRONTEND_STMESP_DEMUX_GC_TIMEOUT
130	int "Message timeout (in milliseconds)"
131	default 100
132	help
133	  If log message is not completed within that time frame it is discarded.
134
135endif # LOG_FRONTEND_STMESP_DEMUX
136
137config LOG_FRONTEND_STMESP_FLUSH_PORT_ID
138	def_int 0
139	depends on LOG_FRONTEND_STMESP_DEMUX || LOG_FRONTEND_STMESP
140
141config LOG_FRONTEND_STMESP_TP_CHAN_BASE
142	def_int 255
143	depends on LOG_FRONTEND_STMESP_DEMUX || LOG_FRONTEND_STMESP
144	help
145	  Do not change this value as it is aligned with host decoder (nrfutil trace).
146
147
148endmenu
149