diff --git a/thermosphere/src/drivers/tegra/t210/hvisor_drivers_tegra_t210_gpio.hpp b/thermosphere/src/drivers/tegra/t210/hvisor_drivers_tegra_t210_gpio.hpp index c23bd46d5..84bf3c091 100644 --- a/thermosphere/src/drivers/tegra/t210/hvisor_drivers_tegra_t210_gpio.hpp +++ b/thermosphere/src/drivers/tegra/t210/hvisor_drivers_tegra_t210_gpio.hpp @@ -193,15 +193,14 @@ namespace ams::hvisor::drivers::tegra::t210 { return static_cast((m_regs->bank[pin.port / portsPerBank].in[pin.port % portsPerBank] >> pin.pos) & 1); } - void ConfigureUartPins(u32 id) + void ConfigureUartPins() { - if (id > 3) { - return; - } constexpr Pin uartPins[] = {uart1Tx, uart2Tx, uart3Tx, uart4Tx}; // Set SFIO to all the 4 contiguous pins (tx, rx, rts, cts) - SetModeContiguous(uartPins[id], 4, Mode::Sfio); + for (Pin pin : uartPins) { + SetModeContiguous(pin, 4, Mode::Sfio); + } } }; diff --git a/thermosphere/src/drivers/tegra/t210/hvisor_drivers_tegra_t210_pinmux.hpp b/thermosphere/src/drivers/tegra/t210/hvisor_drivers_tegra_t210_pinmux.hpp index 26f2e3bf5..7c17f6747 100644 --- a/thermosphere/src/drivers/tegra/t210/hvisor_drivers_tegra_t210_pinmux.hpp +++ b/thermosphere/src/drivers/tegra/t210/hvisor_drivers_tegra_t210_pinmux.hpp @@ -234,22 +234,26 @@ namespace ams::hvisor::drivers::tegra::t210 { volatile Registers *m_regs = nullptr; public: - CONFIGURE_UART_DECL(1) - CONFIGURE_UART_DECL(2) - CONFIGURE_UART_DECL(3) - CONFIGURE_UART_DECL(4) - - void ConfigureUart(u32 id) + void ConfigureUartPins() const { - switch (id) { - case 0: ConfigureUart1(); break; - case 1: ConfigureUart2(); break; - case 2: ConfigureUart3(); break; - case 3: ConfigureUart4(); break; - default: break; - } + m_regs->uart1_tx = 0 | 0 | PULL_NONE | SELECT_FUNCTION0; + m_regs->uart1_rx = INPUT | TRISTATE | PULL_UP | SELECT_FUNCTION0; + m_regs->uart1_rts = 0 | 0 | PULL_NONE | SELECT_FUNCTION0; + m_regs->uart1_cts = INPUT | TRISTATE | PULL_DOWN | SELECT_FUNCTION0; + m_regs->uart2_tx = 0 | 0 | PULL_NONE | SELECT_FUNCTION0; + m_regs->uart2_rx = INPUT | TRISTATE | PULL_NONE | SELECT_FUNCTION0; + m_regs->uart2_rts = 0 | 0 | PULL_DOWN | SELECT_FUNCTION0; + m_regs->uart2_cts = INPUT | TRISTATE | PULL_NONE | SELECT_FUNCTION0; + m_regs->uart3_tx = 0 | 0 | PULL_NONE | SELECT_FUNCTION0; + m_regs->uart3_rx = INPUT | TRISTATE | PULL_NONE | SELECT_FUNCTION0; + m_regs->uart3_rts = 0 | 0 | PULL_DOWN | SELECT_FUNCTION0; + m_regs->uart3_cts = INPUT | TRISTATE | PULL_NONE | SELECT_FUNCTION0; + m_regs->uart4_tx = 0 | 0 | PULL_DOWN | SELECT_FUNCTION0; + m_regs->uart4_rx = INPUT | TRISTATE | PULL_DOWN | SELECT_FUNCTION0; + m_regs->uart4_cts = 0 | 0 | PULL_DOWN | SELECT_FUNCTION0; + m_regs->uart4_rts = INPUT | TRISTATE | PULL_DOWN | SELECT_FUNCTION0; } }; } -#undef CONFIGURE_UART_DECL \ No newline at end of file +#undef CONFIGURE_UART_DECL