From 1db0502b3573b6047041c8aa2e56b9867bc04e9c Mon Sep 17 00:00:00 2001 From: TuxSH <1922548+TuxSH@users.noreply.github.com> Date: Wed, 24 Jul 2019 01:08:18 +0200 Subject: [PATCH] thermosphere: proper uart_reset impl for uart-b --- thermosphere/src/platform/tegra/uart.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/thermosphere/src/platform/tegra/uart.c b/thermosphere/src/platform/tegra/uart.c index bab82a5fb..761dc527c 100644 --- a/thermosphere/src/platform/tegra/uart.c +++ b/thermosphere/src/platform/tegra/uart.c @@ -69,10 +69,16 @@ void uart_config(UartDevice dev) { void uart_reset(UartDevice dev) { CarDevice uartCarDevs[] = { CARDEVICE_UARTA, CARDEVICE_UARTB, CARDEVICE_UARTC, CARDEVICE_UARTD }; + if (dev == UART_B) { + gpio_configure_mode(TEGRA_GPIO(G, 0), GPIO_MODE_SFIO); + } else { + gpio_configure_mode(TEGRA_GPIO(G, 0), GPIO_MODE_GPIO); + } + if (dev == UART_C) { - gpio_configure_mode(TEGRA_GPIO(G, 0), GPIO_MODE_GPIO); // Leave UART-B as GPIO - gpio_configure_mode(TEGRA_GPIO(D, 1), GPIO_MODE_SFIO); // Change UART-C to SPIO - // Fixme other uart? + gpio_configure_mode(TEGRA_GPIO(D, 1), GPIO_MODE_SFIO); + } else { + gpio_configure_mode(TEGRA_GPIO(D, 1), GPIO_MODE_GPIO); } uart_config(dev);