hocclk: fix gm20b driver

This commit is contained in:
souldbminersmwc
2026-05-10 12:47:49 -04:00
parent ea9adbfa14
commit 580db1f167
5 changed files with 68 additions and 57 deletions

View File

@@ -43,6 +43,7 @@
#include "../soc/gm20b.hpp"
namespace board {
#define MIDDLE_FREQ_TABLE_START_POINT 1228800000
static u32 currentInjectedHz = 0;
PcvModule GetPcvModule(HocClkModule hocclkModule) {
switch (hocclkModule) {
case HocClkModule_CPU:
@@ -91,6 +92,9 @@ namespace board {
u32 pcvHz = useGm20b ? ((hz + 76800000 - 1) / 76800000) * 76800000 : hz;
if (module == HocClkModule_GPU)
currentInjectedHz = 0;
if (HOSSVC_HAS_CLKRST) {
ClkrstSession session = {};
rc = clkrstOpenSession(&session, GetPcvModuleId(module), 3);
@@ -115,6 +119,7 @@ namespace board {
if (useGm20b) {
gm20b::setClock(hz / 1000);
currentInjectedHz = hz;
}
}
@@ -131,6 +136,10 @@ namespace board {
return GetDisplayRate(hz);
}
if (module == HocClkModule_GPU && currentInjectedHz != 0) {
return currentInjectedHz;
}
if (HOSSVC_HAS_CLKRST) {
ClkrstSession session = {};