tracing: Move to DTS for uart device
Move from using Kconfig TRACING_BACKEND_UART_NAME to a devicetree chosen property ("zephyr,tracing-uart"). This is similar to a number of other functions like "zephyr,shell-uart" or "zephyr,bt-uart". Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
parent
93f71d6a8a
commit
dcfcd05ed3
8 changed files with 25 additions and 16 deletions
2
doc/build/dts/api/api.rst
vendored
2
doc/build/dts/api/api.rst
vendored
|
@ -432,6 +432,8 @@ device.
|
||||||
* - zephyr,sram
|
* - zephyr,sram
|
||||||
- A node whose ``reg`` sets the base address and size of SRAM memory
|
- A node whose ``reg`` sets the base address and size of SRAM memory
|
||||||
available to the Zephyr image, used during linking
|
available to the Zephyr image, used during linking
|
||||||
|
* - zephyr,tracing-uart
|
||||||
|
- Sets UART device used by tracing subsystem
|
||||||
* - zephyr,uart-mcumgr
|
* - zephyr,uart-mcumgr
|
||||||
- UART used for :ref:`device_mgmt`
|
- UART used for :ref:`device_mgmt`
|
||||||
* - zephyr,uart-pipe
|
* - zephyr,uart-pipe
|
||||||
|
|
7
samples/subsys/tracing/boards/qemu_x86.overlay
Normal file
7
samples/subsys/tracing/boards/qemu_x86.overlay
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* SPDX-License-Identifier: Apache-2.0 */
|
||||||
|
|
||||||
|
/ {
|
||||||
|
chosen {
|
||||||
|
zephyr,tracing-uart = &uart1;
|
||||||
|
};
|
||||||
|
};
|
7
samples/subsys/tracing/boards/qemu_x86_64.overlay
Normal file
7
samples/subsys/tracing/boards/qemu_x86_64.overlay
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* SPDX-License-Identifier: Apache-2.0 */
|
||||||
|
|
||||||
|
/ {
|
||||||
|
chosen {
|
||||||
|
zephyr,tracing-uart = &uart1;
|
||||||
|
};
|
||||||
|
};
|
|
@ -3,5 +3,3 @@ CONFIG_TRACING=y
|
||||||
CONFIG_TRACING_TEST=y
|
CONFIG_TRACING_TEST=y
|
||||||
CONFIG_TRACING_BACKEND_UART=y
|
CONFIG_TRACING_BACKEND_UART=y
|
||||||
CONFIG_TRACING_BUFFER_SIZE=4096
|
CONFIG_TRACING_BUFFER_SIZE=4096
|
||||||
|
|
||||||
CONFIG_TRACING_BACKEND_UART_NAME="UART_1"
|
|
||||||
|
|
|
@ -2,4 +2,3 @@ CONFIG_TRACING=y
|
||||||
CONFIG_TRACING_CTF=y
|
CONFIG_TRACING_CTF=y
|
||||||
CONFIG_TRACING_BACKEND_UART=y
|
CONFIG_TRACING_BACKEND_UART=y
|
||||||
CONFIG_TRACING_BUFFER_SIZE=4096
|
CONFIG_TRACING_BUFFER_SIZE=4096
|
||||||
CONFIG_TRACING_BACKEND_UART_NAME="UART_1"
|
|
||||||
|
|
|
@ -170,16 +170,6 @@ config RAM_TRACING_BUFFER_SIZE
|
||||||
Size of the RAM trace buffer. Trace will be discarded if the
|
Size of the RAM trace buffer. Trace will be discarded if the
|
||||||
length is exceeded.
|
length is exceeded.
|
||||||
|
|
||||||
|
|
||||||
config TRACING_BACKEND_UART_NAME
|
|
||||||
string "Device Name of UART Device for UART backend"
|
|
||||||
default "$(dt_chosen_label,$(DT_CHOSEN_Z_CONSOLE))" if HAS_DTS
|
|
||||||
default "UART_0"
|
|
||||||
depends on TRACING_BACKEND_UART
|
|
||||||
help
|
|
||||||
This option specifies the name of UART device to be used for
|
|
||||||
tracing backend.
|
|
||||||
|
|
||||||
config TRACING_USB_MPS
|
config TRACING_USB_MPS
|
||||||
int "USB backend max packet size"
|
int "USB backend max packet size"
|
||||||
default 64
|
default 64
|
||||||
|
|
|
@ -76,9 +76,8 @@ static void tracing_backend_uart_output(
|
||||||
|
|
||||||
static void tracing_backend_uart_init(void)
|
static void tracing_backend_uart_init(void)
|
||||||
{
|
{
|
||||||
tracing_uart_dev =
|
tracing_uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_tracing_uart));
|
||||||
device_get_binding(CONFIG_TRACING_BACKEND_UART_NAME);
|
__ASSERT(device_is_ready(tracing_uart_dev), "uart backend is not ready");
|
||||||
__ASSERT(tracing_uart_dev, "uart backend binding failed");
|
|
||||||
|
|
||||||
#ifdef CONFIG_TRACING_HANDLE_HOST_CMD
|
#ifdef CONFIG_TRACING_HANDLE_HOST_CMD
|
||||||
uart_irq_rx_disable(tracing_uart_dev);
|
uart_irq_rx_disable(tracing_uart_dev);
|
||||||
|
|
7
tests/subsys/tracing/tracing_api/boards/qemu_x86.overlay
Normal file
7
tests/subsys/tracing/tracing_api/boards/qemu_x86.overlay
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/* SPDX-License-Identifier: Apache-2.0 */
|
||||||
|
|
||||||
|
/ {
|
||||||
|
chosen {
|
||||||
|
zephyr,tracing-uart = &uart0;
|
||||||
|
};
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue