add custom soc voltage table

This commit is contained in:
Lightos1
2026-06-06 14:13:02 +02:00
parent a78de5f18a
commit b561d2f0ca
18 changed files with 759 additions and 639 deletions

View File

@@ -156,30 +156,60 @@ volatile CustomizeTable C = {
},
.marikoGpuVoltArray = {
AUTO /* 76 */,
AUTO /* 153 */,
AUTO /* 230 */,
AUTO /* 307 */,
AUTO /* 384 */,
AUTO /* 460 */,
AUTO /* 537 */,
AUTO /* 614 */,
AUTO /* 691 */,
AUTO /* 768 */,
AUTO /* 844 */,
AUTO /* 921 */,
AUTO /* 998 */,
AUTO /* 1075 */,
AUTO /* 1152 (SLT / HiOPT Only!) */,
AUTO /* 1228 (HiOPT Only!) */,
DEACTIVATED_GPU_FREQ /* 1267 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1305 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1344 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1382 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1420 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1459 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1497 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1536 (Disabled by default) */,
AUTO /* 76 */,
AUTO /* 153 */,
AUTO /* 230 */,
AUTO /* 307 */,
AUTO /* 384 */,
AUTO /* 460 */,
AUTO /* 537 */,
AUTO /* 614 */,
AUTO /* 691 */,
AUTO /* 768 */,
AUTO /* 844 */,
AUTO /* 921 */,
AUTO /* 998 */,
AUTO /* 1075 */,
AUTO /* 1152 (HioPT / High UV only!) */,
AUTO /* 1228 (High UV Only!) */,
DEACTIVATED_GPU_FREQ /* 1267 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1305 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1344 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1382 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1420 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1459 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1497 (Disabled by default) */,
DEACTIVATED_GPU_FREQ /* 1536 (Disabled by default) */,
},
/* Override soc voltage brackets. */
.marikoSocVoltArray = {
0 /* >= 1866 */,
0 /* >= 2000 */,
0 /* >= 2133 */,
0 /* >= 2200 */,
0 /* >= 2266 */,
0 /* >= 2333 */,
0 /* >= 2400 */,
0 /* >= 2433 */,
0 /* >= 2466 */,
0 /* >= 2533 */,
0 /* >= 2566 */,
0 /* >= 2600 */,
0 /* >= 2666 */,
0 /* >= 2700 */,
0 /* >= 2733 */,
0 /* >= 2766 */,
0 /* >= 2800 */,
0 /* >= 2833 */,
0 /* >= 2900 */,
0 /* >= 2933 */,
0 /* >= 3000 */,
0 /* >= 3033 */,
0 /* >= 3100 */,
0 /* >= 3133 */,
0 /* >= 3166 */,
0 /* >= 3200 */,
},
/* Advanced. */
@@ -478,7 +508,7 @@ volatile CustomizeTable C = {
},
.marikoGpuDvfsTableSLT = {
{ 76800, {}, { 590000, } },
{ 76800, {}, { 590000, } },
{ 153600, {}, { 590000, } },
{ 230400, {}, { 590000, } },
{ 307200, {}, { 590000, } },

View File

@@ -123,6 +123,7 @@ struct CustomizeTable {
u32 eristaGpuVoltArray[27];
u32 marikoGpuVoltArray[24];
s32 marikoSocVoltArray[26];
u32 fineTune_t6_tRTW;
u32 fineTune_t7_tWTR;

View File

@@ -829,7 +829,13 @@ namespace ams::ldr::hoc::pcv::mariko {
return std::clamp(value + voltAdd, MinVolt, max);
};
auto DvbVolt = [&](s32 zero, s32 one, s32 two) {
auto DvbVolt = [&](s32 zero, s32 one, s32 two, u32 index) {
const s32 overrideVoltage = C.marikoSocVoltArray[index];
if (overrideVoltage) {
zero = one = two = overrideVoltage;
}
return std::array<s32, 3>{
ClampVolt(zero, max0),
ClampVolt(one, max1),
@@ -841,39 +847,45 @@ namespace ams::ldr::hoc::pcv::mariko {
static_cast<u32>((v)[0]), \
static_cast<u32>((v)[1]), \
static_cast<u32>((v)[2])
#define DVB_OC(one, zero, two, idx) \
DVB(DvbVolt(one, zero, two, idx))
DvbEntry emcDvbOcTableBrackets[] = {
{ 204000, { 637, 637, 637, }, },
{ 1331200, { 650, 637, 637, }, },
{ 1600000, { 675, 650, 637, }, },
{ 1866000, { DVB(DvbVolt( 700, 675, 650)) }, },
{ 2000000, { DVB(DvbVolt( 712, 687, 662)) }, },
{ 2133000, { DVB(DvbVolt( 725, 700, 675)) }, },
{ 2200000, { DVB(DvbVolt( 737, 712, 687)) }, },
{ 2266000, { DVB(DvbVolt( 750, 725, 700)) }, },
{ 2333000, { DVB(DvbVolt( 762, 737, 712)) }, },
{ 2400000, { DVB(DvbVolt( 775, 750, 725)) }, },
{ 2433000, { DVB(DvbVolt( 787, 762, 737)) }, },
{ 2466000, { DVB(DvbVolt( 800, 775, 750)) }, },
{ 2533000, { DVB(DvbVolt( 812, 787, 762)) }, },
{ 2566000, { DVB(DvbVolt( 825, 800, 775)) }, },
{ 2600000, { DVB(DvbVolt( 837, 812, 787)) }, },
{ 2666000, { DVB(DvbVolt( 850, 825, 800)) }, },
{ 2700000, { DVB(DvbVolt( 875, 850, 825)) }, },
{ 2733000, { DVB(DvbVolt( 887, 862, 837)) }, },
{ 2766000, { DVB(DvbVolt( 912, 887, 862)) }, },
{ 2800000, { DVB(DvbVolt( 925, 900, 875)) }, },
{ 2833000, { DVB(DvbVolt( 937, 912, 887)) }, },
{ 2900000, { DVB(DvbVolt( 950, 925, 900)) }, },
{ 2933000, { DVB(DvbVolt( 962, 937, 912)) }, },
{ 3000000, { DVB(DvbVolt( 975, 950, 925)) }, },
{ 3033000, { DVB(DvbVolt( 987, 962, 937)) }, },
{ 3100000, { DVB(DvbVolt(1000, 975, 950)) }, },
{ 3133000, { DVB(DvbVolt(1025, 1000, 975)) }, },
{ 3166000, { DVB(DvbVolt(1037, 1012, 987)) }, },
{ 3200000, { DVB(DvbVolt(1050, 1025, 1000)) }, },
{ ~0u, { }, },
{ 204000, { 637, 637, 637, }, },
{ 1331200, { 650, 637, 637, }, },
{ 1600000, { 675, 650, 637, }, },
{ 1866000, { DVB_OC( 700, 675, 650, 0) }, },
{ 2000000, { DVB_OC( 712, 687, 662, 1) }, },
{ 2133000, { DVB_OC( 725, 700, 675, 2) }, },
{ 2200000, { DVB_OC( 737, 712, 687, 3) }, },
{ 2266000, { DVB_OC( 750, 725, 700, 4) }, },
{ 2333000, { DVB_OC( 762, 737, 712, 5) }, },
{ 2400000, { DVB_OC( 775, 750, 725, 6) }, },
{ 2433000, { DVB_OC( 787, 762, 737, 7) }, },
{ 2466000, { DVB_OC( 800, 775, 750, 8) }, },
{ 2533000, { DVB_OC( 812, 787, 762, 9) }, },
{ 2566000, { DVB_OC( 825, 800, 775, 10) }, },
{ 2600000, { DVB_OC( 837, 812, 787, 11) }, },
{ 2666000, { DVB_OC( 850, 825, 800, 12) }, },
{ 2700000, { DVB_OC( 875, 850, 825, 13) }, },
{ 2733000, { DVB_OC( 887, 862, 837, 14) }, },
{ 2766000, { DVB_OC( 912, 887, 862, 15) }, },
{ 2800000, { DVB_OC( 925, 900, 875, 16) }, },
{ 2833000, { DVB_OC( 937, 912, 887, 17) }, },
{ 2900000, { DVB_OC( 950, 925, 900, 18) }, },
{ 2933000, { DVB_OC( 962, 937, 912, 19) }, },
{ 3000000, { DVB_OC( 975, 950, 925, 20) }, },
{ 3033000, { DVB_OC( 987, 962, 937, 21) }, },
{ 3100000, { DVB_OC(1000, 975, 950, 22) }, },
{ 3133000, { DVB_OC(1025, 1000, 975, 23) }, },
{ 3166000, { DVB_OC(1037, 1012, 987, 24) }, },
{ 3200000, { DVB_OC(1050, 1025, 1000, 25) }, },
{ ~0u, { }, },
};
#undef DVB
#undef DVB_OC
DvbEntry emcDvbTableOc[newEmcList.size()];
u32 bracketIndex = 0;

View File

@@ -70,7 +70,7 @@ typedef enum {
HocClkConfigValue_AulaDisplayColorPreset,
HocClkConfigValue_MarikoMiddleFreqs,
HocClkConfigValue_AutoRAMCPUOverclock,
HocClkConfigValue_AutoRamCpuCpuOCFreq,
HocClkConfigValue_AutoRamCpuRamOCThreshold,
@@ -192,6 +192,33 @@ typedef enum {
KipConfigValue_g_volt_e_1036800,
KipConfigValue_g_volt_e_1075200,
KipConfigValue_g_soc_volt_1866000,
KipConfigValue_g_soc_volt_2000000,
KipConfigValue_g_soc_volt_2133000,
KipConfigValue_g_soc_volt_2200000,
KipConfigValue_g_soc_volt_2266000,
KipConfigValue_g_soc_volt_2333000,
KipConfigValue_g_soc_volt_2400000,
KipConfigValue_g_soc_volt_2433000,
KipConfigValue_g_soc_volt_2466000,
KipConfigValue_g_soc_volt_2533000,
KipConfigValue_g_soc_volt_2566000,
KipConfigValue_g_soc_volt_2600000,
KipConfigValue_g_soc_volt_2666000,
KipConfigValue_g_soc_volt_2700000,
KipConfigValue_g_soc_volt_2733000,
KipConfigValue_g_soc_volt_2766000,
KipConfigValue_g_soc_volt_2800000,
KipConfigValue_g_soc_volt_2833000,
KipConfigValue_g_soc_volt_2900000,
KipConfigValue_g_soc_volt_2933000,
KipConfigValue_g_soc_volt_3000000,
KipConfigValue_g_soc_volt_3033000,
KipConfigValue_g_soc_volt_3100000,
KipConfigValue_g_soc_volt_3133000,
KipConfigValue_g_soc_volt_3166000,
KipConfigValue_g_soc_volt_3200000,
KipConfigValue_t6_tRTW_fine_tune,
KipConfigValue_t7_tWTR_fine_tune,
@@ -237,7 +264,7 @@ static inline const char* hocclkFormatConfigValue(HocClkConfigValue val, bool pr
case HocClkConfigValue_BatteryChargeCurrent:
return pretty ? "Battery Charge Current" : "bat_charge_current";
case HocClkConfigValue_InputCurrentLimit:
return pretty ? "Input Current Limit" : "in_curr_limit";
@@ -468,6 +495,34 @@ static inline const char* hocclkFormatConfigValue(HocClkConfigValue val, bool pr
case KipConfigValue_g_volt_e_1075200: return pretty ? "Erista GPU Volt 1075 MHz" : "g_volt_e_1075200";
case KipConfigValue_t6_tRTW_fine_tune: return pretty ? "t6 - tRTW Fine Tune" : "t6_tRTW_fine_tune";
case KipConfigValue_t7_tWTR_fine_tune: return pretty ? "t7 - tWTR Fine Tune" : "t7_tWTR_fine_tune";
case KipConfigValue_g_soc_volt_1866000: return pretty ? "Mariko SOC Volt 1866 MHz" : "g_soc_volt_1866000";
case KipConfigValue_g_soc_volt_2000000: return pretty ? "Mariko SOC Volt 2000 MHz" : "g_soc_volt_2000000";
case KipConfigValue_g_soc_volt_2133000: return pretty ? "Mariko SOC Volt 2133 MHz" : "g_soc_volt_2133000";
case KipConfigValue_g_soc_volt_2200000: return pretty ? "Mariko SOC Volt 2200 MHz" : "g_soc_volt_2200000";
case KipConfigValue_g_soc_volt_2266000: return pretty ? "Mariko SOC Volt 2266 MHz" : "g_soc_volt_2266000";
case KipConfigValue_g_soc_volt_2333000: return pretty ? "Mariko SOC Volt 2333 MHz" : "g_soc_volt_2333000";
case KipConfigValue_g_soc_volt_2400000: return pretty ? "Mariko SOC Volt 2400 MHz" : "g_soc_volt_2400000";
case KipConfigValue_g_soc_volt_2433000: return pretty ? "Mariko SOC Volt 2433 MHz" : "g_soc_volt_2433000";
case KipConfigValue_g_soc_volt_2466000: return pretty ? "Mariko SOC Volt 2466 MHz" : "g_soc_volt_2466000";
case KipConfigValue_g_soc_volt_2533000: return pretty ? "Mariko SOC Volt 2533 MHz" : "g_soc_volt_2533000";
case KipConfigValue_g_soc_volt_2566000: return pretty ? "Mariko SOC Volt 2566 MHz" : "g_soc_volt_2566000";
case KipConfigValue_g_soc_volt_2600000: return pretty ? "Mariko SOC Volt 2600 MHz" : "g_soc_volt_2600000";
case KipConfigValue_g_soc_volt_2666000: return pretty ? "Mariko SOC Volt 2666 MHz" : "g_soc_volt_2666000";
case KipConfigValue_g_soc_volt_2700000: return pretty ? "Mariko SOC Volt 2700 MHz" : "g_soc_volt_2700000";
case KipConfigValue_g_soc_volt_2733000: return pretty ? "Mariko SOC Volt 2733 MHz" : "g_soc_volt_2733000";
case KipConfigValue_g_soc_volt_2766000: return pretty ? "Mariko SOC Volt 2766 MHz" : "g_soc_volt_2766000";
case KipConfigValue_g_soc_volt_2800000: return pretty ? "Mariko SOC Volt 2800 MHz" : "g_soc_volt_2800000";
case KipConfigValue_g_soc_volt_2833000: return pretty ? "Mariko SOC Volt 2833 MHz" : "g_soc_volt_2833000";
case KipConfigValue_g_soc_volt_2900000: return pretty ? "Mariko SOC Volt 2900 MHz" : "g_soc_volt_2900000";
case KipConfigValue_g_soc_volt_2933000: return pretty ? "Mariko SOC Volt 2933 MHz" : "g_soc_volt_2933000";
case KipConfigValue_g_soc_volt_3000000: return pretty ? "Mariko SOC Volt 3000 MHz" : "g_soc_volt_3000000";
case KipConfigValue_g_soc_volt_3033000: return pretty ? "Mariko SOC Volt 3033 MHz" : "g_soc_volt_3033000";
case KipConfigValue_g_soc_volt_3100000: return pretty ? "Mariko SOC Volt 3100 MHz" : "g_soc_volt_3100000";
case KipConfigValue_g_soc_volt_3133000: return pretty ? "Mariko SOC Volt 3133 MHz" : "g_soc_volt_3133000";
case KipConfigValue_g_soc_volt_3166000: return pretty ? "Mariko SOC Volt 3166 MHz" : "g_soc_volt_3166000";
case KipConfigValue_g_soc_volt_3200000: return pretty ? "Mariko SOC Volt 3200 MHz" : "g_soc_volt_3200000";
case KipCrc32:
return pretty ? "CRC32" : "crc32";
case HocClkConfigValue_IsFirstLoad:
@@ -490,7 +545,7 @@ static inline uint64_t hocclkDefaultConfigValue(HocClkConfigValue val)
case HocClkConfigValue_UncappedClocks:
case HocClkConfigValue_OverwriteBoostMode:
case HocClkConfigValue_BatteryChargeCurrent:
case HocClkConfigValue_InputCurrentLimit:
case HocClkConfigValue_InputCurrentLimit:
case HocClkConfigValue_OverwriteRefreshRate:
case HocClkConfigValue_GPUScheduling:
case HocClkConfigValue_LiveCpuUv:
@@ -556,7 +611,7 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in
case HocClkConfigValue_MarikoMiddleFreqs:
case HocClkConfigValue_AutoRAMCPUOverclock:
return (input & 0x1) == input;
case KipConfigValue_KipVersion:
case KipConfigValue_custRev:
// case KipConfigValue_mtcConf:
@@ -657,6 +712,32 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in
case KipConfigValue_g_volt_e_998400:
case KipConfigValue_g_volt_e_1036800:
case KipConfigValue_g_volt_e_1075200:
case KipConfigValue_g_soc_volt_1866000:
case KipConfigValue_g_soc_volt_2000000:
case KipConfigValue_g_soc_volt_2133000:
case KipConfigValue_g_soc_volt_2200000:
case KipConfigValue_g_soc_volt_2266000:
case KipConfigValue_g_soc_volt_2333000:
case KipConfigValue_g_soc_volt_2400000:
case KipConfigValue_g_soc_volt_2433000:
case KipConfigValue_g_soc_volt_2466000:
case KipConfigValue_g_soc_volt_2533000:
case KipConfigValue_g_soc_volt_2566000:
case KipConfigValue_g_soc_volt_2600000:
case KipConfigValue_g_soc_volt_2666000:
case KipConfigValue_g_soc_volt_2700000:
case KipConfigValue_g_soc_volt_2733000:
case KipConfigValue_g_soc_volt_2766000:
case KipConfigValue_g_soc_volt_2800000:
case KipConfigValue_g_soc_volt_2833000:
case KipConfigValue_g_soc_volt_2900000:
case KipConfigValue_g_soc_volt_2933000:
case KipConfigValue_g_soc_volt_3000000:
case KipConfigValue_g_soc_volt_3033000:
case KipConfigValue_g_soc_volt_3100000:
case KipConfigValue_g_soc_volt_3133000:
case KipConfigValue_g_soc_volt_3166000:
case KipConfigValue_g_soc_volt_3200000:
case KipConfigValue_eristaCpuVmin:
case KipConfigValue_eristaCpuUnlock:
case KipConfigValue_t6_tRTW_fine_tune:
@@ -678,7 +759,7 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in
case HocClkConfigValue_InputCurrentLimit:
return ((input >= 100) && (input <= 3000)) || !input;
case HocClkConfigValue_DisplayVoltage:
return ((input >= 800) && (input <= 1325));

View File

@@ -61,6 +61,7 @@ class SafetySubMenuGui;
class RamSubmenuGui;
class RamTimingsSubmenuGui;
class RamLatenciesSubmenuGui;
class SocCustomTableSubmenuGui;
class CpuSubmenuGui;
class GpuSubmenuGui;
class GpuCustomTableSubmenuGui;
@@ -1074,6 +1075,19 @@ class RamSubmenuGui : public MiscGui {
});
timingsSubmenu->setValue(R_ARROW);
this->listElement->addItem(timingsSubmenu);
if (IsMariko()) {
tsl::elm::ListItem *socVoltageTable = new tsl::elm::ListItem("SOC Voltage Table");
socVoltageTable->setClickListener([](u64 keys) {
if (keys & HidNpadButton_A) {
tsl::changeTo<SocCustomTableSubmenuGui>();
return true;
}
return false;
});
socVoltageTable->setValue(R_ARROW);
this->listElement->addItem(socVoltageTable);
}
}
};
@@ -2358,6 +2372,66 @@ class GpuCustomTableSubmenuGui : public MiscGui {
}
};
class SocCustomTableSubmenuGui : public MiscGui {
public:
SocCustomTableSubmenuGui() {}
protected:
void listUI() override {
Result rc = hocclkIpcGetConfigValues(this->configList); // populate config list early otherwise wont work
if (R_FAILED(rc)) [[unlikely]] {
FatalGui::openWithResultCode("hocclkIpcGetConfigValues", rc);
return;
}
this->listElement->addItem(new CompactCategoryHeader("SOC Custom Voltages"));
ValueThresholds voltageThresholds(1075, 1150);
std::vector<NamedValue> socVolts = {
NamedValue("No Override", 0),
NamedValue("637mV", 637), NamedValue("650mV", 650), NamedValue("662mV", 662), NamedValue("675mV", 675), NamedValue("687mV", 687),
NamedValue("700mV", 700), NamedValue("712mV", 712), NamedValue("725mV", 725), NamedValue("737mV", 737), NamedValue("750mV", 750),
NamedValue("762mV", 762), NamedValue("775mV", 775), NamedValue("787mV", 787), NamedValue("800mV", 800), NamedValue("812mV", 812),
NamedValue("825mV", 825), NamedValue("837mV", 837), NamedValue("850mV", 850), NamedValue("862mV", 862), NamedValue("875mV", 875),
NamedValue("887mV", 887), NamedValue("900mV", 900), NamedValue("912mV", 912), NamedValue("925mV", 925), NamedValue("937mV", 937),
NamedValue("950mV", 950), NamedValue("962mV", 962), NamedValue("975mV", 975), NamedValue("987mV", 987), NamedValue("1000mV", 1000),
NamedValue("1012mV", 1012), NamedValue("1025mV", 1025), NamedValue("1037mV", 1037), NamedValue("1050mV", 1050), NamedValue("1062mV", 1062),
NamedValue("1075mV", 1075), NamedValue("1087mV", 1087), NamedValue("1100mV", 1100), NamedValue("1112mV", 1112), NamedValue("1125mV", 1125),
NamedValue("1137mV", 1137), NamedValue("1150mV", 1150),
};
addConfigButton(KipConfigValue_g_soc_volt_1866000, "1866MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2000000, "2000MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2133000, "2133MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2200000, "2200MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2266000, "2266MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2333000, "2333MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2400000, "2400MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2433000, "2433MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2466000, "2466MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2533000, "2533MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2566000, "2566MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2600000, "2600MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2666000, "2666MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2700000, "2700MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2733000, "2733MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2766000, "2766MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2800000, "2800MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2833000, "2833MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2900000, "2900MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_2933000, "2933MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_3000000, "3000MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_3033000, "3033MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_3100000, "3100MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_3133000, "3133MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_3166000, "3166MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
addConfigButton(KipConfigValue_g_soc_volt_3200000, "3200MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &voltageThresholds, {}, socVolts, false, true);
}
};
static std::string getValueDisplayText(uint64_t currentValue, const ValueRange &range, const std::vector<NamedValue> &namedValues) {
char valueText[32];

View File

@@ -135,6 +135,10 @@ namespace kip {
table.eristaGpuVoltArray[i] = config::GetConfigValue((HocClkConfigValue)(KipConfigValue_g_volt_e_76800 + i));
}
for (size_t i = 0; i < 26; ++i) {
table.marikoSocVoltArray[i] = config::GetConfigValue((HocClkConfigValue) (KipConfigValue_g_soc_volt_1866000 + i));
}
CUST_WRITE_FIELD_BATCH(&table, t6_tRTW_fine_tune, config::GetConfigValue(KipConfigValue_t6_tRTW_fine_tune));
CUST_WRITE_FIELD_BATCH(&table, t7_tWTR_fine_tune, config::GetConfigValue(KipConfigValue_t7_tWTR_fine_tune));
@@ -290,6 +294,10 @@ namespace kip {
configValues.values[KipConfigValue_g_volt_e_76800 + i] = cust_get_erista_gpu_volt(&table, i);
}
for (size_t i = 0; i < 26; ++i) {
configValues.values[KipConfigValue_g_soc_volt_1866000 + i] = cust_get_mariko_soc_volt(&table, i);
}
configValues.values[KipConfigValue_t7_tWTR_fine_tune] = cust_get_tWTR_fine_tune(&table);
configValues.values[KipConfigValue_t6_tRTW_fine_tune] = cust_get_tRTW_fine_tune(&table);

View File

@@ -92,6 +92,7 @@ namespace kip {
u32 eristaGpuVoltArray[27];
u32 marikoGpuVoltArray[24];
s32 marikoSocVoltArray[26];
u32 t6_tRTW_fine_tune;
u32 t7_tWTR_fine_tune;
@@ -392,6 +393,21 @@ namespace kip {
return cust_write_table(p, &t);
}
static inline bool cust_set_mariko_soc_volt(const char *p, int idx, u32 v) {
if (idx < 0 || idx >= 26) {
return false;
}
CustomizeTable t;
if (!cust_read_table(p, &t)) {
return false;
}
t.marikoSocVoltArray[idx] = v;
return cust_write_table(p, &t);
}
static inline u32 cust_get_field(const CustomizeTable *t, u32 offset) {
if (!t)
return 0;
@@ -577,6 +593,12 @@ namespace kip {
return t->marikoGpuVoltArray[idx];
}
static inline u32 cust_get_mariko_soc_volt(const CustomizeTable *t, int idx) {
if (!t || idx < 0 || idx >= 26)
return 0;
return t->marikoSocVoltArray[idx];
}
#define DECL_ERISTA_GPU_VOLT_HELPER(freq, idx) \
static inline bool cust_set_erista_gpu_volt_##freq(const char *p, u32 v) { \
return cust_set_erista_gpu_volt(p, idx, v); \
@@ -587,7 +609,12 @@ namespace kip {
return cust_set_mariko_gpu_volt(p, idx, v); \
}
DECL_ERISTA_GPU_VOLT_HELPER(76800, 0)
#define DECL_MARIKO_SOC_VOLT_HELPER(freq, idx) \
static inline bool cust_set_mariko_soc_volt_##freq(const char *p, u32 v) { \
return cust_set_mariko_soc_volt(p, idx, v); \
}
DECL_ERISTA_GPU_VOLT_HELPER(76800, 0)
DECL_ERISTA_GPU_VOLT_HELPER(115200, 1)
DECL_ERISTA_GPU_VOLT_HELPER(153600, 2)
DECL_ERISTA_GPU_VOLT_HELPER(192000, 3)
@@ -640,6 +667,33 @@ namespace kip {
DECL_MARIKO_GPU_VOLT_HELPER(1497600, 22)
DECL_MARIKO_GPU_VOLT_HELPER(1536000, 23)
DECL_MARIKO_SOC_VOLT_HELPER(1866000, 0)
DECL_MARIKO_SOC_VOLT_HELPER(2000000, 1)
DECL_MARIKO_SOC_VOLT_HELPER(2133000, 2)
DECL_MARIKO_SOC_VOLT_HELPER(2200000, 3)
DECL_MARIKO_SOC_VOLT_HELPER(2266000, 4)
DECL_MARIKO_SOC_VOLT_HELPER(2333000, 5)
DECL_MARIKO_SOC_VOLT_HELPER(2400000, 6)
DECL_MARIKO_SOC_VOLT_HELPER(2433000, 7)
DECL_MARIKO_SOC_VOLT_HELPER(2466000, 8)
DECL_MARIKO_SOC_VOLT_HELPER(2533000, 9)
DECL_MARIKO_SOC_VOLT_HELPER(2566000, 10)
DECL_MARIKO_SOC_VOLT_HELPER(2600000, 11)
DECL_MARIKO_SOC_VOLT_HELPER(2666000, 12)
DECL_MARIKO_SOC_VOLT_HELPER(2700000, 13)
DECL_MARIKO_SOC_VOLT_HELPER(2733000, 14)
DECL_MARIKO_SOC_VOLT_HELPER(2766000, 15)
DECL_MARIKO_SOC_VOLT_HELPER(2800000, 16)
DECL_MARIKO_SOC_VOLT_HELPER(2833000, 17)
DECL_MARIKO_SOC_VOLT_HELPER(2900000, 18)
DECL_MARIKO_SOC_VOLT_HELPER(2933000, 19)
DECL_MARIKO_SOC_VOLT_HELPER(3000000, 20)
DECL_MARIKO_SOC_VOLT_HELPER(3033000, 21)
DECL_MARIKO_SOC_VOLT_HELPER(3100000, 22)
DECL_MARIKO_SOC_VOLT_HELPER(3133000, 23)
DECL_MARIKO_SOC_VOLT_HELPER(3166000, 24)
DECL_MARIKO_SOC_VOLT_HELPER(3200000, 25)
#define DECL_ERISTA_GPU_VOLT_GET(freq, idx) \
static inline u32 cust_get_erista_gpu_volt_##freq##_val(const char *p) { \
CustomizeTable t; \
@@ -655,6 +709,14 @@ namespace kip {
return cust_get_mariko_gpu_volt(&t, idx); \
}
#define DECL_MARIKO_SOC_VOLT_GET(freq, idx) \
static inline u32 cust_get_mariko_soc_volt_##freq##_val(const char *p) { \
CustomizeTable t; \
if (!cust_read_table(p, &t)) \
return 0; \
return cust_get_mariko_soc_volt(&t, idx); \
}
DECL_ERISTA_GPU_VOLT_GET(76800, 0)
DECL_ERISTA_GPU_VOLT_GET(115200, 1)
DECL_ERISTA_GPU_VOLT_GET(153600, 2)
@@ -707,6 +769,34 @@ namespace kip {
DECL_MARIKO_GPU_VOLT_GET(1459200, 21)
DECL_MARIKO_GPU_VOLT_GET(1497600, 22)
DECL_MARIKO_GPU_VOLT_GET(1536000, 23)
DECL_MARIKO_SOC_VOLT_GET(1866000, 0)
DECL_MARIKO_SOC_VOLT_GET(2000000, 1)
DECL_MARIKO_SOC_VOLT_GET(2133000, 2)
DECL_MARIKO_SOC_VOLT_GET(2200000, 3)
DECL_MARIKO_SOC_VOLT_GET(2266000, 4)
DECL_MARIKO_SOC_VOLT_GET(2333000, 5)
DECL_MARIKO_SOC_VOLT_GET(2400000, 6)
DECL_MARIKO_SOC_VOLT_GET(2433000, 7)
DECL_MARIKO_SOC_VOLT_GET(2466000, 8)
DECL_MARIKO_SOC_VOLT_GET(2533000, 9)
DECL_MARIKO_SOC_VOLT_GET(2566000, 10)
DECL_MARIKO_SOC_VOLT_GET(2600000, 11)
DECL_MARIKO_SOC_VOLT_GET(2666000, 12)
DECL_MARIKO_SOC_VOLT_GET(2700000, 13)
DECL_MARIKO_SOC_VOLT_GET(2733000, 14)
DECL_MARIKO_SOC_VOLT_GET(2766000, 15)
DECL_MARIKO_SOC_VOLT_GET(2800000, 16)
DECL_MARIKO_SOC_VOLT_GET(2833000, 17)
DECL_MARIKO_SOC_VOLT_GET(2900000, 18)
DECL_MARIKO_SOC_VOLT_GET(2933000, 19)
DECL_MARIKO_SOC_VOLT_GET(3000000, 20)
DECL_MARIKO_SOC_VOLT_GET(3033000, 21)
DECL_MARIKO_SOC_VOLT_GET(3100000, 22)
DECL_MARIKO_SOC_VOLT_GET(3133000, 23)
DECL_MARIKO_SOC_VOLT_GET(3166000, 24)
DECL_MARIKO_SOC_VOLT_GET(3200000, 25)
void MigrateKipData(u32 custRev, u32 version);
void SetKipData();
void GetKipData();