sysclk/loader: refix kip editing and remove depricated mtcconf option

This commit is contained in:
souldbminersmwc
2025-12-19 20:16:16 -05:00
parent 7ac134aa47
commit 414faddd7a
6 changed files with 34 additions and 20 deletions

View File

@@ -34,6 +34,7 @@
#include "ipc_service.h"
#include "kip.h"
#include "i2c_reg.h"
#include "notification.h"
#define HOSPPC_HAS_BOOST (hosversionAtLeast(7,0,0))
@@ -529,10 +530,18 @@ void ClockManager::SetRNXRTMode(ReverseNXMode mode)
}
void ClockManager::SetKipData() {
if(Board::GetSocType() == SysClkSocType_Mariko) {
if(I2c_BuckConverter_SetMvOut(&I2c_Mariko_DRAM_VDDQ, this->config->GetConfigValue(KipConfigValue_marikoEmcVddqVolt) / 1000)) {
FileUtils::LogLine("[clock_manager] Failed set i2c vddq");
writeNotification("Horizon OC\nFailed to write I2C\nwhile setting vddq");
}
}
CustomizeTable table;
if (!cust_read_and_cache(this->config->GetConfigValue(HocClkConfigValue_KipFileName) ? "sdmc:/atmosphere/kips/loader.kip" : "sdmc:/atmosphere/kips/hoc.kip", &table)) {
FileUtils::LogLine("[clock_manager] Failed to read KIP file");
writeNotification("Horizon OC\nKip read failed");
return;
}
@@ -594,6 +603,7 @@ void ClockManager::SetKipData() {
if (!cust_write_table(this->config->GetConfigValue(HocClkConfigValue_KipFileName) ? "sdmc:/atmosphere/kips/loader.kip" : "sdmc:/atmosphere/kips/hoc.kip", &table)) {
FileUtils::LogLine("[clock_manager] Failed to write KIP file");
writeNotification("Horizon OC\nKip write failed");
}
}
@@ -605,6 +615,7 @@ void ClockManager::GetKipData() {
if (!cust_read_and_cache(this->config->GetConfigValue(HocClkConfigValue_KipFileName) ? "sdmc:/atmosphere/kips/loader.kip" : "sdmc:/atmosphere/kips/hoc.kip", &table)) {
FileUtils::LogLine("[clock_manager] Failed to read KIP file for GetKipData");
writeNotification("Horizon OC\nKip read failed");
return;
}
@@ -672,11 +683,14 @@ void ClockManager::GetKipData() {
FileUtils::LogLine("[clock_manager] Successfully loaded KIP data into config");
} else {
FileUtils::LogLine("[clock_manager] Warning: Failed to set config values from KIP");
writeNotification("Horizon OC\nKip config set failed");
}
} else {
FileUtils::LogLine("[clock_manager] Error: Config value list buffer size mismatch");
writeNotification("Horizon OC\nConfig Buffer Mismatch");
}
} else {
FileUtils::LogLine("[clock_manager] Config refresh error in GetKipData!");
writeNotification("Horizon OC\nConfig refresh failed");
}
}

View File

@@ -38,7 +38,7 @@ const I2c_BuckConverter_Domain I2c_Erista_GPU = { I2cDevice_Max77621Gpu,
const I2c_BuckConverter_Domain I2c_Erista_DRAM = { I2cDevice_Max77620Pmic, I2c_Max77620_SD1VOLT_REG, 0x7F, 12500, 600000, 1250000, };
const I2c_BuckConverter_Domain I2c_Mariko_CPU = { I2cDevice_Max77812_2, I2c_Max77812_CPUVOLT_REG, 0xFF, 5000, 250000, 1525000, 0x78 };
const I2c_BuckConverter_Domain I2c_Mariko_GPU = { I2cDevice_Max77812_2, I2c_Max77812_GPUVOLT_REG, 0xFF, 5000, 250000, 1525000, 0x78 };
const I2c_BuckConverter_Domain I2c_Mariko_DRAM_VDDQ = { I2cDevice_Max77812_2, I2c_Max77812_MEMVOLT_REG, 0xFF, 5000, 250000, 650000, 0x78 };
const I2c_BuckConverter_Domain I2c_Mariko_DRAM_VDDQ = { I2cDevice_Max77812_2, I2c_Max77812_MEMVOLT_REG, 0xFF, 5000, 250000, 700000, 0x78 };
const I2c_BuckConverter_Domain I2c_Mariko_DRAM_VDD2 = { I2cDevice_Max77620Pmic, I2c_Max77620_SD1VOLT_REG, 0x7F, 12500, 600000, 1250000, };
u32 I2c_BuckConverter_GetMvOut(const I2c_BuckConverter_Domain* domain);

View File

@@ -8,7 +8,7 @@
#pragma pack(push, 1)
typedef struct {
u8 cust[16];
u8 cust[4];
u32 custRev;
u32 mtcConf;
u32 hpMode;
@@ -56,8 +56,8 @@ typedef struct {
#pragma pack(pop)
#define CUST_MAGIC "HOCKIPCUST\0\0\0\0"
#define CUST_MAGIC_LEN 16
#define CUST_MAGIC "CUST"
#define CUST_MAGIC_LEN 4
typedef struct {
FILE* file;