bpmpfw uart changes

This commit is contained in:
souldbminersmwc committed 2026-08-28 14:45:37 -04:00
1 parent 6b88b43cb9
commit 4ac7f472d9
3 files changed
+17 -4

No files matched your search

+3 -3
View File
@@ -43,7 +43,7 @@ namespace {
/* Deinit MMU otherwise sleep will fatal. */
bpmpMmu::Disable();
info.magic = 0x0;
printf("[hoc-bpmpfw]: Halting...\n");
UartPutsForce("[hoc-bpmpfw]: Halting...\n");
for (;;)
;
}
@@ -91,7 +91,7 @@ extern "C" void main() {
InitializeLibc();
printf("[hoc-bpmpfw]: Starting bpmpfw\n");
UartPutsForce("[hoc-bpmpfw]: Starting bpmpfw\n");
HocClkBpmpSharedInfo &info = SharedInfo();
memset(&info, 0, sizeof(info));
@@ -104,7 +104,7 @@ extern "C" void main() {
/* If the main loop exits then it is a panic or invalid state */
MainLoop(info);
printf("[hoc-bpmpfw]: PANIC\n");
UartPutsForce("[hoc-bpmpfw]: PANIC\n");
/* Kill execution */
_panic_reboot();
+12 -1
View File
@@ -33,7 +33,7 @@
}
}
bool g_uartLoggingEnabled = true;
bool g_uartLoggingEnabled = false;
void UartPutc(char c) {
if (!g_uartLoggingEnabled) {
@@ -64,3 +64,14 @@ void UartPutHex32(u32 v) {
UartPutc(digits[(v >> i) & 0xF]);
}
}
void UartPutsForce(const char *s) {
while (*s) {
while (!(MMIO32(UartBBase + UartLsr) & UartLsrThre))
;
MMIO32(UartBBase + UartThr) = static_cast<u32>(static_cast<u8>(*s++));
}
while (!(MMIO32(UartBBase + UartLsr) & UartLsrTmty))
;
}
+2
View File
@@ -54,3 +54,5 @@ void UartFlush();
void UartPuts(const char *s);
void UartPutHex32(u32 v);
void UartPutsForce(const char *s);