Add 1305 pll limit patch for mariko

This commit is contained in:
Lightos1
2025-12-02 17:31:17 +01:00
parent 554c103bf2
commit 2a0dac43d3
4 changed files with 29 additions and 9 deletions

View File

@@ -45,7 +45,7 @@ volatile CustomizeTable C = {
.marikoCpuMaxVolt = 1185, .marikoCpuMaxVolt = 1185,
.marikoEmcMaxClock = 2700000, // Hynix NME and Samsung AM-MGCJ Rating (others are 4766MT, 2133MHz) .marikoEmcMaxClock = 2133000, // Hynix NME and Samsung AM-MGCJ Rating (others are 4766MT, 2133MHz)
.marikoEmcVddqVolt = 640000, .marikoEmcVddqVolt = 640000,
@@ -86,6 +86,14 @@ volatile CustomizeTable C = {
.marikoGpuVmin = 610, .marikoGpuVmin = 610,
.marikoGpuVmax = 850, .marikoGpuVmax = 850,
/* >1305 GPU unlock. */
/* WARNING! This removes ALL gpu frequency limits and risks permanent hardware damage. */
/* This setting is very dangerous and can damage your pmic, degrade your soc, damage the voltage rails and can cause various other damage. */
/* Even with all of that said, if you still decide to use this despite all the warnings, use it at your own risk. */
/* No warranty is provided in any way whatsoever. */
.marikoGpuFullUnlock = DISABLED,
// NOTE: These tables should NOT BE USED and are only here as placeholders. Always try and find your own optimal tables. // NOTE: These tables should NOT BE USED and are only here as placeholders. Always try and find your own optimal tables.
// Ensure the voltages actually increase or stay the sameot // Ensure the voltages actually increase or stay the sameot
@@ -147,8 +155,6 @@ volatile CustomizeTable C = {
0 /* 1075 (Disabled by default) */, 0 /* 1075 (Disabled by default) */,
}, },
/* Advanced Settings: /* Advanced Settings:
* - Erista CPU DVFS Table: * - Erista CPU DVFS Table:
*/ */

View File

@@ -85,6 +85,8 @@ typedef struct CustomizeTable {
u32 marikoGpuVmin; u32 marikoGpuVmin;
u32 marikoGpuVmax; u32 marikoGpuVmax;
u32 marikoGpuFullUnlock;
u32 marikoGpuVoltArray[24]; u32 marikoGpuVoltArray[24];
u32 eristaGpuVoltArray[27]; u32 eristaGpuVoltArray[27];
@@ -96,10 +98,10 @@ typedef struct CustomizeTable {
CustomizeGpuDvfsTable eristaGpuDvfsTableSLT; CustomizeGpuDvfsTable eristaGpuDvfsTableSLT;
CustomizeGpuDvfsTable eristaGpuDvfsTableHigh; CustomizeGpuDvfsTable eristaGpuDvfsTableHigh;
CustomizeGpuDvfsTable marikoGpuDvfsTable; CustomizeGpuDvfsTable marikoGpuDvfsTable;
CustomizeGpuDvfsTable marikoGpuDvfsTableSLT; CustomizeGpuDvfsTable marikoGpuDvfsTableSLT;
CustomizeGpuDvfsTable marikoGpuDvfsTableHiOPT; CustomizeGpuDvfsTable marikoGpuDvfsTableHiOPT;
} CustomizeTable; } CustomizeTable;
extern volatile CustomizeTable C; extern volatile CustomizeTable C;

View File

@@ -94,7 +94,8 @@ namespace ams::ldr::oc::pcv
{}, {},
}; };
constexpr u32 GpuClkPllLimit = 1300'000'000; constexpr u32 GpuClkPllMax = 1300'000'000;
constexpr u32 GpuClkPllLimit = 2'600'000;
/* GPU Max Clock asm Pattern: /* GPU Max Clock asm Pattern:
* *

View File

@@ -204,7 +204,7 @@ namespace ams::ldr::oc::pcv::mariko {
R_SUCCEED(); R_SUCCEED();
} }
Result GpuFreqPllLimit(u32 *ptr) { Result GpuFreqPllMax(u32 *ptr) {
clk_pll_param *entry = reinterpret_cast<clk_pll_param *>(ptr); clk_pll_param *entry = reinterpret_cast<clk_pll_param *>(ptr);
// All zero except for freq // All zero except for freq
@@ -218,8 +218,18 @@ namespace ams::ldr::oc::pcv::mariko {
R_SUCCEED(); R_SUCCEED();
} }
Result GpuFreqMax(u32 *ptr) { Result GpuFreqPllLimit(u32 *ptr) {
PATCH_OFFSET(ptr, 3600000); u32 prev_freq = *(ptr - 1);
if (prev_freq != 128000 && prev_freq != 1300000 && prev_freq != 76800) {
R_THROW(ldr::ResultInvalidGpuPllEntry());
}
if (C.marikoGpuFullUnlock) {
/* Removes all limits - dangerous. */
*ptr = 3600000;
}
R_SUCCEED(); R_SUCCEED();
} }
@@ -840,7 +850,8 @@ namespace ams::ldr::oc::pcv::mariko {
{"CPU Volt Dfll", &CpuVoltDfll, 1, nullptr, 0x0000FFCF}, {"CPU Volt Dfll", &CpuVoltDfll, 1, nullptr, 0x0000FFCF},
{"GPU Freq Table", GpuFreqCvbTable<true>, 1, nullptr, GpuCvbDefaultMaxFreq}, {"GPU Freq Table", GpuFreqCvbTable<true>, 1, nullptr, GpuCvbDefaultMaxFreq},
{"GPU Freq Asm", &GpuFreqMaxAsm, 2, &GpuMaxClockPatternFn}, {"GPU Freq Asm", &GpuFreqMaxAsm, 2, &GpuMaxClockPatternFn},
{"GPU Freq PLL", &GpuFreqPllLimit, 1, nullptr, GpuClkPllLimit}, {"GPU PLL Max", &GpuFreqPllMax, 1, nullptr, GpuClkPllMax},
{"GPU PLL Limit", &GpuFreqPllLimit, 4, nullptr, GpuClkPllLimit},
{"MEM Freq Mtc", &MemFreqMtcTable, 0, nullptr, EmcClkOSLimit}, {"MEM Freq Mtc", &MemFreqMtcTable, 0, nullptr, EmcClkOSLimit},
{"MEM Freq Dvb", &MemFreqDvbTable, 1, nullptr, EmcClkOSLimit}, {"MEM Freq Dvb", &MemFreqDvbTable, 1, nullptr, EmcClkOSLimit},
{"MEM Freq Max", &MemFreqMax, 0, nullptr, EmcClkOSLimit}, {"MEM Freq Max", &MemFreqMax, 0, nullptr, EmcClkOSLimit},