bpmpfw uart changes
This commit is contained in:
1 parent
6b88b43cb9
commit
4ac7f472d9
3 files changed
+17
-4
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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))
|
||||
;
|
||||
}
|
||||
@@ -54,3 +54,5 @@ void UartFlush();
|
||||
void UartPuts(const char *s);
|
||||
|
||||
void UartPutHex32(u32 v);
|
||||
|
||||
void UartPutsForce(const char *s);
|
||||
Reference in new issue
Block a user