soctherm coldboot fix
This commit is contained in:
1 parent
b8f728ac0a
commit
1b9156fbd6
3 files changed
+40
-18
No files matched your search
@@ -32,6 +32,21 @@ namespace {
|
||||
|
||||
} // namespace
|
||||
|
||||
void MainLoop(HocClkBpmpSharedInfo &info) {
|
||||
for (;;) {
|
||||
const u32 temp1 = MMIO32(SocthermBase + SocthermSensorTemp1);
|
||||
const u32 temp2 = MMIO32(SocthermBase + SocthermSensorTemp2);
|
||||
|
||||
info.tempCpu = TranslateSocthermTemp(static_cast<u16>(temp1 >> 16));
|
||||
info.tempGpu = TranslateSocthermTemp(static_cast<u16>(temp1));
|
||||
info.tempMem = TranslateSocthermTemp(static_cast<u16>(temp2 >> 16));
|
||||
info.tempPllx = TranslateSocthermTemp(static_cast<u16>(temp2));
|
||||
// printf("tmr=%u\n", MMIO32(TmrBase + TimerUsCntr1Us));
|
||||
msleep(500);
|
||||
//printf("[hoc-bpmpfw]: Done logging\n");
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void main() {
|
||||
InitializeLibc();
|
||||
|
||||
@@ -42,15 +57,15 @@ extern "C" void main() {
|
||||
info.status = 0;
|
||||
info.magic = HOCCLK_BPMP_MAGIC; // written last
|
||||
|
||||
for (;;) {
|
||||
const u32 temp1 = MMIO32(SocthermBase + SocthermSensorTemp1);
|
||||
const u32 temp2 = MMIO32(SocthermBase + SocthermSensorTemp2);
|
||||
/* If the main loop exits then it is a panic or invalid state */
|
||||
MainLoop(info);
|
||||
|
||||
info.tempCpu = TranslateSocthermTemp(static_cast<u16>(temp1 >> 16));
|
||||
info.tempGpu = TranslateSocthermTemp(static_cast<u16>(temp1));
|
||||
info.tempMem = TranslateSocthermTemp(static_cast<u16>(temp2 >> 16));
|
||||
info.tempPllx = TranslateSocthermTemp(static_cast<u16>(temp2));
|
||||
printf("[hoc-bpmpfw]: PANIC\n");
|
||||
/* Clear the magic so sysmodule knows of a panic */
|
||||
info.magic = 0x0;
|
||||
|
||||
usleep(250000); // 250ms
|
||||
}
|
||||
/* Give a panic code */
|
||||
info.status = ~0;
|
||||
for(;;)
|
||||
;
|
||||
}
|
||||
Reference in new issue
Block a user