Revert "hocclk: actually implement cpu dvfs"

This reverts commit a8f221aed8.
This commit is contained in:
Lightos1 committed 2026-10-05 11:30:15 +02:00
1 parent a8f221aed8
commit c9dafc0e2a
7 files changed
+26 -148

No files matched your search

@@ -25,7 +25,6 @@
#include <switch.h>
#include "../file/file_utils.hpp"
#include "../file/config.hpp"
#include "../hos/rgltr.h"
#include "../i2c/i2cDrv.h"
#include "board.hpp"
@@ -594,7 +593,6 @@ namespace board {
return baseVolt;
}
/* Mariko only! */
constexpr u32 PmicVmin = 250;
constexpr u32 PmicStep = 5;
@@ -604,12 +602,6 @@ namespace board {
}
void ApplyCpuDvfs(u32 ramFreqMhz) {
/* Don't reapply the table if it has been*/
static u32 lastRamFreqMhz = 0;
if(ramFreqMhz == lastRamFreqMhz) {
return;
}
/* Get the minimum DRAM OC Cpu Vmin */
u32 vmin = GetMinimumCpuVmin(ramFreqMhz, GetCpuSpeedoBracket());
@@ -623,6 +615,7 @@ namespace board {
if(vlt < vmin) {
vlt = vmin;
}
/* Don't know if modifying and passing argument causes undefined behavior? */
u32 tempVlt = vlt;
vlt = ConvertVoltToLut(tempVlt);
@@ -631,18 +624,12 @@ namespace board {
/* Pet the watchdog to avoid it hanging the system during this operation */
i2c::wdt::Pet();
/* DSB to prevent a hang during setting the new LUT. ST will not work, SY is needed */
/* DSB to prevent a hang during setting the new LUT */
__asm__("dsb SY");
/* Copy the edited LUT into it's appropriate location */
memcpy((void*)(cldvfs + CL_DVFS_OUTPUT_LUT_0), NewCpuVoltTable, sizeof(NewCpuVoltTable));
file::utils::LogLine("[cpudvfs]: Set voltage to %dmV for %dMHz", vmin, ramFreqMhz);
/* Pet the watchdog to avoid it hanging the system during this operation */
i2c::wdt::Pet();
svcSleepThread(100'000'000); // 100ms
lastRamFreqMhz = ramFreqMhz;
}
} // namespace board