sysmodule: add kip editing functionality to sysmodule style

messy but should work
This commit is contained in:
souldbminersmwc
2025-12-05 20:59:30 -05:00
parent fc19d44727
commit db2e117f8a
10 changed files with 964 additions and 3 deletions

View File

@@ -84,6 +84,7 @@ ClockManager::~ClockManager()
{
delete this->config;
delete this->context;
delete this->kip;
}
SysClkContext ClockManager::GetCurrentContext()
@@ -449,4 +450,217 @@ bool ClockManager::RefreshContext()
void ClockManager::SetRNXRTMode(ReverseNXMode mode)
{
this->rnxSync->SetRTMode(mode);
}
void ClockManager::SetKipData() {
// ClockManager::GetInstance()->SetRNXRTMode(mode);
// General KIP values
this->kip->setMtcConf(this->config->GetConfigValue(KipConfigValue_MTCConf));
this->kip->setCommonCpuBoostClock(this->config->GetConfigValue(KipConfigValue_commonCpuBoostClock));
this->kip->setCommonEmcMemVolt(this->config->GetConfigValue(KipConfigValue_commonEmcMemVolt));
// Erista specific
this->kip->setEristaCpuMaxVolt(this->config->GetConfigValue(KipConfigValue_eristaCpuMaxVolt));
this->kip->setEristaEmcMaxClock(this->config->GetConfigValue(KipConfigValue_eristaEmcMaxClock));
// Mariko specific
this->kip->setMarikoCpuMaxVolt(this->config->GetConfigValue(KipConfigValue_marikoCpuMaxVolt));
this->kip->setMarikoEmcMaxClock(this->config->GetConfigValue(KipConfigValue_marikoEmcMaxClock));
this->kip->setMarikoEmcVddqVolt(this->config->GetConfigValue(KipConfigValue_marikoEmcVddqVolt));
// Undervolt / UV values
this->kip->setMarikoCpuUV(this->config->GetConfigValue(KipConfigValue_marikoCpuUV));
this->kip->setMarikoGpuUV(this->config->GetConfigValue(KipConfigValue_marikoGpuUV));
this->kip->setEristaCpuUV(this->config->GetConfigValue(KipConfigValue_eristaCpuUV));
this->kip->setEristaGpuUV(this->config->GetConfigValue(KipConfigValue_eristaGpuUV));
// GPU offset / EMC DVB
this->kip->setCommonGpuVoltOffset(this->config->GetConfigValue(KipConfigValue_commonGpuVoltOffset));
this->kip->setMarikoEmcDvbShift(this->config->GetConfigValue(KipConfigValue_marikoEmcDvbShift));
// Memory timing values
this->kip->setT1_tRCD(this->config->GetConfigValue(KipConfigValue_t1_tRCD));
this->kip->setT2_tRP(this->config->GetConfigValue(KipConfigValue_t2_tRP));
this->kip->setT3_tRAS(this->config->GetConfigValue(KipConfigValue_t3_tRAS));
this->kip->setT4_tRRD(this->config->GetConfigValue(KipConfigValue_t4_tRRD));
this->kip->setT5_tRFC(this->config->GetConfigValue(KipConfigValue_t5_tRFC));
this->kip->setT6_tRTW(this->config->GetConfigValue(KipConfigValue_t6_tRTW));
this->kip->setT7_tWTR(this->config->GetConfigValue(KipConfigValue_t7_tWTR));
this->kip->setT8_tREFI(this->config->GetConfigValue(KipConfigValue_t8_tREFI));
this->kip->setMemBurstReadLatency(this->config->GetConfigValue(KipConfigValue_mem_burst_read_latency));
this->kip->setMemBurstWriteLatency(this->config->GetConfigValue(KipConfigValue_mem_burst_write_latency));
// Additional voltages
this->kip->setMarikoCpuHighVmin(this->config->GetConfigValue(KipConfigValue_marikoCpuHighVmin));
this->kip->setMarikoCpuLowVmin(this->config->GetConfigValue(KipConfigValue_marikoCpuLowVmin));
this->kip->setEristaGpuVmin(this->config->GetConfigValue(KipConfigValue_eristaGpuVmin));
this->kip->setMarikoGpuVmin(this->config->GetConfigValue(KipConfigValue_marikoGpuVmin));
this->kip->setMarikoGpuVmax(this->config->GetConfigValue(KipConfigValue_marikoGpuVmax));
this->kip->setMarikoGpuFullUnlock(this->config->GetConfigValue(KipConfigValue_marikoGpuFullUnlock));
// Mariko GPU voltages
this->kip->setGVolt76800(this->config->GetConfigValue(KipConfigValue_g_volt_76800));
this->kip->setGVolt153600(this->config->GetConfigValue(KipConfigValue_g_volt_153600));
this->kip->setGVolt230400(this->config->GetConfigValue(KipConfigValue_g_volt_230400));
this->kip->setGVolt307200(this->config->GetConfigValue(KipConfigValue_g_volt_307200));
this->kip->setGVolt384000(this->config->GetConfigValue(KipConfigValue_g_volt_384000));
this->kip->setGVolt460800(this->config->GetConfigValue(KipConfigValue_g_volt_460800));
this->kip->setGVolt537600(this->config->GetConfigValue(KipConfigValue_g_volt_537600));
this->kip->setGVolt614400(this->config->GetConfigValue(KipConfigValue_g_volt_614400));
this->kip->setGVolt691200(this->config->GetConfigValue(KipConfigValue_g_volt_691200));
this->kip->setGVolt768000(this->config->GetConfigValue(KipConfigValue_g_volt_768000));
this->kip->setGVolt844800(this->config->GetConfigValue(KipConfigValue_g_volt_844800));
this->kip->setGVolt921600(this->config->GetConfigValue(KipConfigValue_g_volt_921600));
this->kip->setGVolt998400(this->config->GetConfigValue(KipConfigValue_g_volt_998400));
this->kip->setGVolt1075200(this->config->GetConfigValue(KipConfigValue_g_volt_1075200));
this->kip->setGVolt1152000(this->config->GetConfigValue(KipConfigValue_g_volt_1152000));
this->kip->setGVolt1228800(this->config->GetConfigValue(KipConfigValue_g_volt_1228800));
this->kip->setGVolt1267200(this->config->GetConfigValue(KipConfigValue_g_volt_1267200));
this->kip->setGVolt1305600(this->config->GetConfigValue(KipConfigValue_g_volt_1305600));
this->kip->setGVolt1344000(this->config->GetConfigValue(KipConfigValue_g_volt_1344000));
this->kip->setGVolt1382400(this->config->GetConfigValue(KipConfigValue_g_volt_1382400));
this->kip->setGVolt1420800(this->config->GetConfigValue(KipConfigValue_g_volt_1420800));
this->kip->setGVolt1459200(this->config->GetConfigValue(KipConfigValue_g_volt_1459200));
this->kip->setGVolt1497600(this->config->GetConfigValue(KipConfigValue_g_volt_1497600));
this->kip->setGVolt1536000(this->config->GetConfigValue(KipConfigValue_g_volt_1536000));
// Erista GPU voltages
this->kip->setGVoltE76800(this->config->GetConfigValue(KipConfigValue_g_volt_e_76800));
this->kip->setGVoltE115200(this->config->GetConfigValue(KipConfigValue_g_volt_e_115200));
this->kip->setGVoltE153600(this->config->GetConfigValue(KipConfigValue_g_volt_e_153600));
this->kip->setGVoltE192000(this->config->GetConfigValue(KipConfigValue_g_volt_e_192000));
this->kip->setGVoltE230400(this->config->GetConfigValue(KipConfigValue_g_volt_e_230400));
this->kip->setGVoltE268800(this->config->GetConfigValue(KipConfigValue_g_volt_e_268800));
this->kip->setGVoltE307200(this->config->GetConfigValue(KipConfigValue_g_volt_e_307200));
this->kip->setGVoltE345600(this->config->GetConfigValue(KipConfigValue_g_volt_e_345600));
this->kip->setGVoltE384000(this->config->GetConfigValue(KipConfigValue_g_volt_e_384000));
this->kip->setGVoltE422400(this->config->GetConfigValue(KipConfigValue_g_volt_e_422400));
this->kip->setGVoltE460800(this->config->GetConfigValue(KipConfigValue_g_volt_e_460800));
this->kip->setGVoltE499200(this->config->GetConfigValue(KipConfigValue_g_volt_e_499200));
this->kip->setGVoltE537600(this->config->GetConfigValue(KipConfigValue_g_volt_e_537600));
this->kip->setGVoltE576000(this->config->GetConfigValue(KipConfigValue_g_volt_e_576000));
this->kip->setGVoltE614400(this->config->GetConfigValue(KipConfigValue_g_volt_e_614400));
this->kip->setGVoltE652800(this->config->GetConfigValue(KipConfigValue_g_volt_e_652800));
this->kip->setGVoltE691200(this->config->GetConfigValue(KipConfigValue_g_volt_e_691200));
this->kip->setGVoltE729600(this->config->GetConfigValue(KipConfigValue_g_volt_e_729600));
this->kip->setGVoltE768000(this->config->GetConfigValue(KipConfigValue_g_volt_e_768000));
this->kip->setGVoltE806400(this->config->GetConfigValue(KipConfigValue_g_volt_e_806400));
this->kip->setGVoltE844800(this->config->GetConfigValue(KipConfigValue_g_volt_e_844800));
this->kip->setGVoltE883200(this->config->GetConfigValue(KipConfigValue_g_volt_e_883200));
this->kip->setGVoltE921600(this->config->GetConfigValue(KipConfigValue_g_volt_e_921600));
this->kip->setGVoltE960000(this->config->GetConfigValue(KipConfigValue_g_volt_e_960000));
this->kip->setGVoltE998400(this->config->GetConfigValue(KipConfigValue_g_volt_e_998400));
this->kip->setGVoltE1036800(this->config->GetConfigValue(KipConfigValue_g_volt_e_1036800));
this->kip->setGVoltE1075200(this->config->GetConfigValue(KipConfigValue_g_volt_e_1075200));
// Persist changes to KIP
this->kip->writeKip();
}
void ClockManager::GetKipConfigValues() {
// General KIP values
this->config->SetConfigValue(KipConfigValue_MTCConf, this->kip->getMtcConf());
this->config->SetConfigValue(KipConfigValue_commonCpuBoostClock, this->kip->getCommonCpuBoostClock());
this->config->SetConfigValue(KipConfigValue_commonEmcMemVolt, this->kip->getCommonEmcMemVolt());
// Erista specific
this->config->SetConfigValue(KipConfigValue_eristaCpuMaxVolt, this->kip->getEristaCpuMaxVolt());
this->config->SetConfigValue(KipConfigValue_eristaEmcMaxClock, this->kip->getEristaEmcMaxClock());
// Mariko specific
this->config->SetConfigValue(KipConfigValue_marikoCpuMaxVolt, this->kip->getMarikoCpuMaxVolt());
this->config->SetConfigValue(KipConfigValue_marikoEmcMaxClock, this->kip->getMarikoEmcMaxClock());
this->config->SetConfigValue(KipConfigValue_marikoEmcVddqVolt, this->kip->getMarikoEmcVddqVolt());
// Undervolt / UV values
this->config->SetConfigValue(KipConfigValue_marikoCpuUV, this->kip->getMarikoCpuUV());
this->config->SetConfigValue(KipConfigValue_marikoGpuUV, this->kip->getMarikoGpuUV());
this->config->SetConfigValue(KipConfigValue_eristaCpuUV, this->kip->getEristaCpuUV());
this->config->SetConfigValue(KipConfigValue_eristaGpuUV, this->kip->getEristaGpuUV());
// GPU offset / EMC DVB
this->config->SetConfigValue(KipConfigValue_commonGpuVoltOffset, this->kip->getCommonGpuVoltOffset());
this->config->SetConfigValue(KipConfigValue_marikoEmcDvbShift, this->kip->getMarikoEmcDvbShift());
// Memory timing values
this->config->SetConfigValue(KipConfigValue_t1_tRCD, this->kip->getT1_tRCD());
this->config->SetConfigValue(KipConfigValue_t2_tRP, this->kip->getT2_tRP());
this->config->SetConfigValue(KipConfigValue_t3_tRAS, this->kip->getT3_tRAS());
this->config->SetConfigValue(KipConfigValue_t4_tRRD, this->kip->getT4_tRRD());
this->config->SetConfigValue(KipConfigValue_t5_tRFC, this->kip->getT5_tRFC());
this->config->SetConfigValue(KipConfigValue_t6_tRTW, this->kip->getT6_tRTW());
this->config->SetConfigValue(KipConfigValue_t7_tWTR, this->kip->getT7_tWTR());
this->config->SetConfigValue(KipConfigValue_t8_tREFI, this->kip->getT8_tREFI());
this->config->SetConfigValue(KipConfigValue_mem_burst_read_latency, this->kip->getMemBurstReadLatency());
this->config->SetConfigValue(KipConfigValue_mem_burst_write_latency, this->kip->getMemBurstWriteLatency());
// Additional voltages
this->config->SetConfigValue(KipConfigValue_marikoCpuHighVmin, this->kip->getMarikoCpuHighVmin());
this->config->SetConfigValue(KipConfigValue_marikoCpuLowVmin, this->kip->getMarikoCpuLowVmin());
this->config->SetConfigValue(KipConfigValue_eristaGpuVmin, this->kip->getEristaGpuVmin());
this->config->SetConfigValue(KipConfigValue_marikoGpuVmin, this->kip->getMarikoGpuVmin());
this->config->SetConfigValue(KipConfigValue_marikoGpuVmax, this->kip->getMarikoGpuVmax());
this->config->SetConfigValue(KipConfigValue_marikoGpuFullUnlock, this->kip->getMarikoGpuFullUnlock());
// Mariko GPU voltages
this->config->SetConfigValue(KipConfigValue_g_volt_76800, this->kip->getGVolt76800());
this->config->SetConfigValue(KipConfigValue_g_volt_153600, this->kip->getGVolt153600());
this->config->SetConfigValue(KipConfigValue_g_volt_230400, this->kip->getGVolt230400());
this->config->SetConfigValue(KipConfigValue_g_volt_307200, this->kip->getGVolt307200());
this->config->SetConfigValue(KipConfigValue_g_volt_384000, this->kip->getGVolt384000());
this->config->SetConfigValue(KipConfigValue_g_volt_460800, this->kip->getGVolt460800());
this->config->SetConfigValue(KipConfigValue_g_volt_537600, this->kip->getGVolt537600());
this->config->SetConfigValue(KipConfigValue_g_volt_614400, this->kip->getGVolt614400());
this->config->SetConfigValue(KipConfigValue_g_volt_691200, this->kip->getGVolt691200());
this->config->SetConfigValue(KipConfigValue_g_volt_768000, this->kip->getGVolt768000());
this->config->SetConfigValue(KipConfigValue_g_volt_844800, this->kip->getGVolt844800());
this->config->SetConfigValue(KipConfigValue_g_volt_921600, this->kip->getGVolt921600());
this->config->SetConfigValue(KipConfigValue_g_volt_998400, this->kip->getGVolt998400());
this->config->SetConfigValue(KipConfigValue_g_volt_1075200, this->kip->getGVolt1075200());
this->config->SetConfigValue(KipConfigValue_g_volt_1152000, this->kip->getGVolt1152000());
this->config->SetConfigValue(KipConfigValue_g_volt_1228800, this->kip->getGVolt1228800());
this->config->SetConfigValue(KipConfigValue_g_volt_1267200, this->kip->getGVolt1267200());
this->config->SetConfigValue(KipConfigValue_g_volt_1305600, this->kip->getGVolt1305600());
this->config->SetConfigValue(KipConfigValue_g_volt_1344000, this->kip->getGVolt1344000());
this->config->SetConfigValue(KipConfigValue_g_volt_1382400, this->kip->getGVolt1382400());
this->config->SetConfigValue(KipConfigValue_g_volt_1420800, this->kip->getGVolt1420800());
this->config->SetConfigValue(KipConfigValue_g_volt_1459200, this->kip->getGVolt1459200());
this->config->SetConfigValue(KipConfigValue_g_volt_1497600, this->kip->getGVolt1497600());
this->config->SetConfigValue(KipConfigValue_g_volt_1536000, this->kip->getGVolt1536000());
// Erista GPU voltages
this->config->SetConfigValue(KipConfigValue_g_volt_e_76800, this->kip->getGVoltE76800());
this->config->SetConfigValue(KipConfigValue_g_volt_e_115200, this->kip->getGVoltE115200());
this->config->SetConfigValue(KipConfigValue_g_volt_e_153600, this->kip->getGVoltE153600());
this->config->SetConfigValue(KipConfigValue_g_volt_e_192000, this->kip->getGVoltE192000());
this->config->SetConfigValue(KipConfigValue_g_volt_e_230400, this->kip->getGVoltE230400());
this->config->SetConfigValue(KipConfigValue_g_volt_e_268800, this->kip->getGVoltE268800());
this->config->SetConfigValue(KipConfigValue_g_volt_e_307200, this->kip->getGVoltE307200());
this->config->SetConfigValue(KipConfigValue_g_volt_e_345600, this->kip->getGVoltE345600());
this->config->SetConfigValue(KipConfigValue_g_volt_e_384000, this->kip->getGVoltE384000());
this->config->SetConfigValue(KipConfigValue_g_volt_e_422400, this->kip->getGVoltE422400());
this->config->SetConfigValue(KipConfigValue_g_volt_e_460800, this->kip->getGVoltE460800());
this->config->SetConfigValue(KipConfigValue_g_volt_e_499200, this->kip->getGVoltE499200());
this->config->SetConfigValue(KipConfigValue_g_volt_e_537600, this->kip->getGVoltE537600());
this->config->SetConfigValue(KipConfigValue_g_volt_e_576000, this->kip->getGVoltE576000());
this->config->SetConfigValue(KipConfigValue_g_volt_e_614400, this->kip->getGVoltE614400());
this->config->SetConfigValue(KipConfigValue_g_volt_e_652800, this->kip->getGVoltE652800());
this->config->SetConfigValue(KipConfigValue_g_volt_e_691200, this->kip->getGVoltE691200());
this->config->SetConfigValue(KipConfigValue_g_volt_e_729600, this->kip->getGVoltE729600());
this->config->SetConfigValue(KipConfigValue_g_volt_e_768000, this->kip->getGVoltE768000());
this->config->SetConfigValue(KipConfigValue_g_volt_e_806400, this->kip->getGVoltE806400());
this->config->SetConfigValue(KipConfigValue_g_volt_e_844800, this->kip->getGVoltE844800());
this->config->SetConfigValue(KipConfigValue_g_volt_e_883200, this->kip->getGVoltE883200());
this->config->SetConfigValue(KipConfigValue_g_volt_e_921600, this->kip->getGVoltE921600());
this->config->SetConfigValue(KipConfigValue_g_volt_e_960000, this->kip->getGVoltE960000());
this->config->SetConfigValue(KipConfigValue_g_volt_e_998400, this->kip->getGVoltE998400());
this->config->SetConfigValue(KipConfigValue_g_volt_e_1036800, this->kip->getGVoltE1036800());
this->config->SetConfigValue(KipConfigValue_g_volt_e_1075200, this->kip->getGVoltE1075200());
}