mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-19 17:35:06 -04:00
exo2: implement remainder of warmboot tz code
This commit is contained in:
parent
97ab282351
commit
ad664daea5
21 changed files with 691 additions and 17 deletions
|
@ -40,9 +40,30 @@ namespace ams::log {
|
|||
}
|
||||
}();
|
||||
|
||||
ALWAYS_INLINE void SetupUart() {
|
||||
if constexpr (UartLogPort == uart::Port_ReservedDebug) {
|
||||
/* Logging to the debug port. */
|
||||
pinmux::SetupUartA();
|
||||
clkrst::EnableUartAClock();
|
||||
} else if constexpr (UartLogPort == uart::Port_LeftJoyCon) {
|
||||
/* Logging to left joy-con (e.g. with Joyless). */
|
||||
pinmux::SetupUartB();
|
||||
clkrst::EnableUartBClock();
|
||||
} else if constexpr (UartLogPort == uart::Port_RightJoyCon) {
|
||||
/* Logging to right joy-con (e.g. with Joyless). */
|
||||
pinmux::SetupUartC();
|
||||
clkrst::EnableUartCClock();
|
||||
} else {
|
||||
__builtin_unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Initialize() {
|
||||
/* Initialize pinmux and clock for the target uart port. */
|
||||
SetupUart();
|
||||
|
||||
/* Initialize the target uart port. */
|
||||
uart::Initialize(UartLogPort, 115200, UartPortFlags);
|
||||
|
||||
|
@ -50,4 +71,20 @@ namespace ams::log {
|
|||
g_initialized_uart = true;
|
||||
}
|
||||
|
||||
void Finalize() {
|
||||
g_initialized_uart = false;
|
||||
}
|
||||
|
||||
void SendText(const void *text, size_t size) {
|
||||
if (g_initialized_uart) {
|
||||
uart::SendText(UartLogPort, text, size);
|
||||
}
|
||||
}
|
||||
|
||||
void Flush() {
|
||||
if (g_initialized_uart) {
|
||||
uart::WaitFlush(UartLogPort);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue