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:
Kumar Gala 2022-07-19 10:44:56 -05:00 committed by Marti Bolivar
commit dcfcd05ed3
8 changed files with 25 additions and 16 deletions

View file

@ -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

View file

@ -0,0 +1,7 @@
/* SPDX-License-Identifier: Apache-2.0 */
/ {
chosen {
zephyr,tracing-uart = &uart1;
};
};

View file

@ -0,0 +1,7 @@
/* SPDX-License-Identifier: Apache-2.0 */
/ {
chosen {
zephyr,tracing-uart = &uart1;
};
};

View file

@ -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"

View file

@ -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"

View file

@ -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

View file

@ -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);

View file

@ -0,0 +1,7 @@
/* SPDX-License-Identifier: Apache-2.0 */
/ {
chosen {
zephyr,tracing-uart = &uart0;
};
};