From a50fe4f82e143b8581a56f1ed60f2f1b08c212b7 Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Sat, 10 Jan 2026 12:57:48 -0500 Subject: [PATCH] sysclk/ldr: remove marikogpufullunlock option gpu pll limit is now patched by default, this does not mean those clocks will be enabled by default, they require special settings to be enabled --- .../loader/source/oc/customize.cpp | 7 ---- .../loader/source/oc/customize.hpp | 2 -- .../loader/source/oc/pcv/pcv_mariko.cpp | 7 ++-- Source/sys-clk/common/include/sysclk/config.h | 4 --- .../sys-clk/overlay/src/ui/gui/misc_gui.cpp | 33 ++++++++++++------- .../sys-clk/sysmodule/src/clock_manager.cpp | 7 ++-- Source/sys-clk/sysmodule/src/kip.h | 3 -- 7 files changed, 26 insertions(+), 37 deletions(-) diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp index 59671ed2..0bf60016 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp @@ -92,13 +92,6 @@ volatile CustomizeTable C = { .gpuSpeedo = 1450, -/* >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, - /* This table is used with a gpu uv mode of 2. */ /* Setting DEACTIVATED_GPU_FREQ on any freq will disable it and all freqs greater than it. (the latter is a bug :/) */ /* AUTO: Voltage is optimally chosen; with commonGpuVoltOffset applied. */ diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp index 0eae9135..8c9c550d 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp @@ -104,8 +104,6 @@ typedef struct CustomizeTable { /* TODO: Automatically detect speedo. */ u32 gpuSpeedo; - u32 marikoGpuFullUnlock; - u32 eristaGpuVoltArray[27]; u32 marikoGpuVoltArray[24]; diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp index 411c42bb..43bc3b7b 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp @@ -378,11 +378,8 @@ namespace ams::ldr::oc::pcv::mariko { if (prev_freq != 128000 && prev_freq != 1300000 && prev_freq != 76800) { R_THROW(ldr::ResultInvalidGpuPllEntry()); } - - if (C.marikoGpuFullUnlock) { - /* Removes all limits - dangerous. */ - *ptr = 3600000; - } + + PATCH_OFFSET(ptr, 3600000); R_SUCCEED(); } diff --git a/Source/sys-clk/common/include/sysclk/config.h b/Source/sys-clk/common/include/sysclk/config.h index a4af86b4..d10a6113 100644 --- a/Source/sys-clk/common/include/sysclk/config.h +++ b/Source/sys-clk/common/include/sysclk/config.h @@ -111,7 +111,6 @@ typedef enum { KipConfigValue_commonGpuVoltOffset, KipConfigValue_gpuSpeedo, - KipConfigValue_marikoGpuFullUnlock, KipConfigValue_g_volt_76800, KipConfigValue_g_volt_153600, @@ -332,8 +331,6 @@ static inline const char* sysclkFormatConfigValue(SysClkConfigValue val, bool pr return pretty ? "Common GPU Voltage Offset" : "common_gpu_volt_offset"; case KipConfigValue_gpuSpeedo: return pretty ? "GPU Speedo" : "gpu_speedo"; - case KipConfigValue_marikoGpuFullUnlock: - return pretty ? "Mariko GPU Full Unlock" : "mariko_gpu_full_unlock"; // Mariko GPU voltages (24) case KipConfigValue_g_volt_76800: return pretty ? "Mariko GPU Volt 76 MHz" : "g_volt_76800"; @@ -509,7 +506,6 @@ static inline uint64_t sysclkValidConfigValue(SysClkConfigValue val, uint64_t in case KipConfigValue_marikoGpuVmax: case KipConfigValue_commonGpuVoltOffset: case KipConfigValue_gpuSpeedo: - case KipConfigValue_marikoGpuFullUnlock: case KipConfigValue_g_volt_76800: case KipConfigValue_g_volt_153600: case KipConfigValue_g_volt_230400: diff --git a/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp index 43ea72ee..c9548fbc 100644 --- a/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp @@ -935,17 +935,6 @@ protected: return false; }); this->listElement->addItem(customTableSubmenu); - - addConfigToggle(KipConfigValue_marikoGpuFullUnlock, "GPU Full Unlock"); - tsl::elm::CustomDrawer* warningText = new tsl::elm::CustomDrawer([](tsl::gfx::Renderer *renderer, s32 x, s32 y, s32 w, s32 h) { - renderer->drawString("\uE150 GPU Full Unlock can cause", false, x + 20, y + 30, 18, tsl::style::color::ColorText); - renderer->drawString("PERMANANT damage to your Switch!", false, x + 20, y + 50, 18, tsl::style::color::ColorText); - renderer->drawString("Only enable if you know what", false, x + 20, y + 80, 16, tsl::style::color::ColorText); - renderer->drawString("you're doing. Proceed at your", false, x + 20, y + 100, 16, tsl::style::color::ColorText); - renderer->drawString("own risk!", false, x + 20, y + 120, 16, tsl::style::color::ColorText); - }); - warningText->setBoundaries(0, 0, tsl::cfg::FramebufferWidth, 150); - this->listElement->addItem(warningText); } }; @@ -1024,6 +1013,17 @@ protected: }; if (IsMariko()) { + + tsl::elm::CustomDrawer* warningText = new tsl::elm::CustomDrawer([](tsl::gfx::Renderer *renderer, s32 x, s32 y, s32 w, s32 h) { + renderer->drawString("\uE150 Setting GPU Clocks past", false, x + 20, y + 30, 18, tsl::style::color::ColorText); + renderer->drawString("1075MHz without UV, 1152MHz on SLT or ", false, x + 20, y + 50, 18, tsl::style::color::ColorText); + renderer->drawString("1228MHz on HiOPT can cause ", false, x + 20, y + 80, 16, tsl::style::color::ColorText); + renderer->drawString("permanent damage to your Switch!", false, x + 20, y + 100, 16, tsl::style::color::ColorText); + renderer->drawString("Proceed at your own risk!", false, x + 20, y + 120, 16, tsl::style::color::ColorText); + }); + warningText->setBoundaries(0, 0, tsl::cfg::FramebufferWidth, 150); + this->listElement->addItem(warningText); + addConfigButton(KipConfigValue_g_volt_76800, "76.8MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &MgpuVmaxThresholds, {}, mGpuVolts, false); addConfigButton(KipConfigValue_g_volt_153600, "153.6MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &MgpuVmaxThresholds, {}, mGpuVolts, false); addConfigButton(KipConfigValue_g_volt_230400, "230.4MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &MgpuVmaxThresholds, {}, mGpuVolts, false); @@ -1049,6 +1049,17 @@ protected: addConfigButton(KipConfigValue_g_volt_1497600, "1497.6MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &MgpuVmaxThresholds, {}, mGpuVolts, false); addConfigButton(KipConfigValue_g_volt_1536000, "1536.0MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &MgpuVmaxThresholds, {}, mGpuVolts, false); } else { + + tsl::elm::CustomDrawer* warningText = new tsl::elm::CustomDrawer([](tsl::gfx::Renderer *renderer, s32 x, s32 y, s32 w, s32 h) { + renderer->drawString("\uE150 Setting GPU Clocks past", false, x + 20, y + 30, 18, tsl::style::color::ColorText); + renderer->drawString("921MHz without UV and 960MHz on", false, x + 20, y + 50, 18, tsl::style::color::ColorText); + renderer->drawString("SLT or HiOPT can cause ", false, x + 20, y + 80, 16, tsl::style::color::ColorText); + renderer->drawString("permanent damage to your Switch!", false, x + 20, y + 100, 16, tsl::style::color::ColorText); + renderer->drawString("Proceed at your own risk!", false, x + 20, y + 120, 16, tsl::style::color::ColorText); + }); + warningText->setBoundaries(0, 0, tsl::cfg::FramebufferWidth, 150); + this->listElement->addItem(warningText); + addConfigButton(KipConfigValue_g_volt_e_76800, "76.8MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &EgpuVmaxThresholds, {}, eGpuVolts, false); addConfigButton(KipConfigValue_g_volt_e_115200, "115.2MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &EgpuVmaxThresholds, {}, eGpuVolts, false); addConfigButton(KipConfigValue_g_volt_e_153600, "153.6MHz", ValueRange(0, 0, 0, "0", 1), "Voltage", &EgpuVmaxThresholds, {}, eGpuVolts, false); diff --git a/Source/sys-clk/sysmodule/src/clock_manager.cpp b/Source/sys-clk/sysmodule/src/clock_manager.cpp index a1248e8b..37735420 100644 --- a/Source/sys-clk/sysmodule/src/clock_manager.cpp +++ b/Source/sys-clk/sysmodule/src/clock_manager.cpp @@ -777,7 +777,6 @@ void ClockManager::SetKipData() { CUST_WRITE_FIELD_BATCH(&table, commonGpuVoltOffset, this->config->GetConfigValue(KipConfigValue_commonGpuVoltOffset)); CUST_WRITE_FIELD_BATCH(&table, gpuSpeedo, this->config->GetConfigValue(KipConfigValue_gpuSpeedo)); - CUST_WRITE_FIELD_BATCH(&table, marikoGpuFullUnlock, this->config->GetConfigValue(KipConfigValue_marikoGpuFullUnlock)); for (int i = 0; i < 24; i++) { table.marikoGpuVoltArray[i] = this->config->GetConfigValue((SysClkConfigValue)(KipConfigValue_g_volt_76800 + i)); @@ -856,7 +855,7 @@ void ClockManager::GetKipData() { initialConfigValues[KipConfigValue_marikoCpuLowVmin] = cust_get_mariko_cpu_low_vmin(&table); initialConfigValues[KipConfigValue_marikoCpuHighVmin] = cust_get_mariko_cpu_high_vmin(&table); initialConfigValues[KipConfigValue_marikoCpuMaxVolt] = cust_get_mariko_cpu_max_volt(&table); - initialConfigValues[KipConfigValue_marikoGpuFullUnlock] = cust_get_marikoCpuMaxClock(&table) / 1000; + initialConfigValues[KipConfigValue_marikoCpuMaxClock] = cust_get_marikoCpuMaxClock(&table) / 1000; initialConfigValues[KipConfigValue_eristaCpuBoostClock] = cust_get_erista_cpu_boost(&table) / 1000; initialConfigValues[KipConfigValue_marikoCpuBoostClock] = cust_get_mariko_cpu_boost(&table) / 1000; @@ -867,7 +866,6 @@ void ClockManager::GetKipData() { initialConfigValues[KipConfigValue_marikoGpuVmax] = cust_get_mariko_gpu_vmax(&table); initialConfigValues[KipConfigValue_commonGpuVoltOffset] = cust_get_common_gpu_offset(&table); initialConfigValues[KipConfigValue_gpuSpeedo] = cust_get_gpu_speedo(&table); - initialConfigValues[KipConfigValue_marikoGpuFullUnlock] = cust_get_mariko_gpu_unlock(&table); for (int i = 0; i < 24; i++) { initialConfigValues[KipConfigValue_g_volt_76800 + i] = cust_get_mariko_gpu_volt(&table, i); @@ -910,7 +908,7 @@ void ClockManager::GetKipData() { configValues.values[KipConfigValue_marikoCpuLowVmin] = cust_get_mariko_cpu_low_vmin(&table); configValues.values[KipConfigValue_marikoCpuHighVmin] = cust_get_mariko_cpu_high_vmin(&table); configValues.values[KipConfigValue_marikoCpuMaxVolt] = cust_get_mariko_cpu_max_volt(&table); - configValues.values[KipConfigValue_marikoGpuFullUnlock] = cust_get_marikoCpuMaxClock(&table) / 1000; + configValues.values[KipConfigValue_marikoCpuMaxClock] = cust_get_marikoCpuMaxClock(&table) / 1000; configValues.values[KipConfigValue_eristaCpuBoostClock] = cust_get_erista_cpu_boost(&table) / 1000; configValues.values[KipConfigValue_marikoCpuBoostClock] = cust_get_mariko_cpu_boost(&table) / 1000; @@ -921,7 +919,6 @@ void ClockManager::GetKipData() { configValues.values[KipConfigValue_marikoGpuVmax] = cust_get_mariko_gpu_vmax(&table); configValues.values[KipConfigValue_commonGpuVoltOffset] = cust_get_common_gpu_offset(&table); configValues.values[KipConfigValue_gpuSpeedo] = cust_get_gpu_speedo(&table); - configValues.values[KipConfigValue_marikoGpuFullUnlock] = cust_get_mariko_gpu_unlock(&table); for (int i = 0; i < 24; i++) { configValues.values[KipConfigValue_g_volt_76800 + i] = cust_get_mariko_gpu_volt(&table, i); diff --git a/Source/sys-clk/sysmodule/src/kip.h b/Source/sys-clk/sysmodule/src/kip.h index 3a67621d..8ac399da 100644 --- a/Source/sys-clk/sysmodule/src/kip.h +++ b/Source/sys-clk/sysmodule/src/kip.h @@ -67,7 +67,6 @@ typedef struct { u32 marikoGpuVmax; u32 commonGpuVoltOffset; u32 gpuSpeedo; - u32 marikoGpuFullUnlock; u32 eristaGpuVoltArray[27]; u32 marikoGpuVoltArray[24]; } CustomizeTable; @@ -215,7 +214,6 @@ static inline bool cust_set_mariko_gpu_vmin(const char* p, u32 v) { CUST_WRITE_F static inline bool cust_set_mariko_gpu_vmax(const char* p, u32 v) { CUST_WRITE_FIELD(p, marikoGpuVmax, v); } static inline bool cust_set_common_gpu_offset(const char* p, u32 v) { CUST_WRITE_FIELD(p, commonGpuVoltOffset, v); } static inline bool cust_set_gpu_speedo(const char* p, u32 v) { CUST_WRITE_FIELD(p, gpuSpeedo, v); } -static inline bool cust_set_mariko_gpu_unlock(const char* p, u32 v) { CUST_WRITE_FIELD(p, marikoGpuFullUnlock, v); } static inline bool cust_set_marikoCpuMaxClock(const char* p, u32 v) { CUST_WRITE_FIELD(p, marikoCpuMaxClock, v); } /* GPU VOLT ARRAY HELPERS */ @@ -284,7 +282,6 @@ static inline u32 cust_get_mariko_gpu_vmin(const CustomizeTable* t) { return CUS static inline u32 cust_get_mariko_gpu_vmax(const CustomizeTable* t) { return CUST_GET_FIELD(t, marikoGpuVmax); } static inline u32 cust_get_common_gpu_offset(const CustomizeTable* t) { return CUST_GET_FIELD(t, commonGpuVoltOffset); } static inline u32 cust_get_gpu_speedo(const CustomizeTable* t) { return CUST_GET_FIELD(t, gpuSpeedo); } -static inline u32 cust_get_mariko_gpu_unlock(const CustomizeTable* t) { return CUST_GET_FIELD(t, marikoGpuFullUnlock); } static inline u32 cust_get_marikoCpuMaxClock(const CustomizeTable* t) { return CUST_GET_FIELD(t, marikoCpuMaxClock); } static inline u32 cust_get_erista_gpu_volt(const CustomizeTable* t, int idx) {