diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp index 64cc695a..440c9a20 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp @@ -222,10 +222,11 @@ volatile CustomizeTable C = { { 1683000, { 1168000, }, { 5100873, -279186, 4747, } }, { 1785000, { 1225000, }, { 5100873, -279186, 4747, } }, { 1887000, { 1225000, }, { 5100873, -279186, 4747, } }, - { 1989000, { 1227500, }, { 5100873, -279186, 4747, } }, - { 2091000, { 1256250, }, { 5100873, -279186, 4747, } }, - { 2193000, { 1256250, }, { 5100873, -279186, 4747, } }, + { 1963500, { 1227500, }, { 5100873, -279186, 4747, } }, + { 2091000, { 1227500, }, { 5100873, -279186, 4747, } }, + { 2193000, { 1227500, }, { 5100873, -279186, 4747, } }, { 2295000, { 1256250, }, { 5100873, -279186, 4747, } }, + { 2397000, { 1256250, }, { 5100873, -279186, 4747, } }, // Only for god speedo! }, .marikoCpuDvfsTable = { diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp index d4551292..868717cc 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp @@ -143,12 +143,12 @@ void SafetyCheck() { { C.eristaCpuBoostClock, 1020'000, 2295'000, true }, { C.marikoCpuBoostClock, 1020'000, 2703'000, true }, { C.commonEmcMemVolt, 912'500, 1350'000 }, // Official burst vmax for the RAMs is 1500mV - { C.eristaCpuMaxVolt, 1000, 1257 }, + { C.eristaCpuMaxVolt, 1000, 1260 }, { GET_MAX_OF_ARR(erista::maxEmcClocks), 1600'000, 2600'000 }, { C.marikoCpuMaxVolt, 1000, 1235 }, { C.marikoEmcMaxClock, 1600'000, 3500'000 }, { C.marikoEmcVddqVolt, 250'000, 700'000 }, - { eristaCpuDvfsMaxFreq, 1785'000, 2295'000 }, + { eristaCpuDvfsMaxFreq, 1785'000, 2397'000 }, { marikoCpuDvfsMaxFreq, 1785'000, 2703'000 }, { eristaGpuDvfsMaxFreq, 768'000, 1152'000 }, { marikoGpuDvfsMaxFreq, 768'000, 1536'000 }, diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp index fbf78df3..45f78307 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp @@ -218,6 +218,13 @@ namespace ams::ldr::hoc::pcv { constexpr u32 GpuClkPllMax = 921'600'000; constexpr u32 GpuVminOfficial = 810; + constexpr u16 CpuMinVolts[] = { 950, 850, 825, 810 }; + + inline bool CpuMaxVoltPatternFn(u32* ptr32) { + u32 val = *ptr32; + return (val == 1132 || val == 1170 || val == 1227); + } + static const u32 gpuVoltDvfsPattern[] = { 810, 1150, 1000, 100, 1000, 10, }; static_assert(sizeof(gpuVoltDvfsPattern) == (sizeof(u32) * 6), "Invalid gpuVoltDvfsPattern"); diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp index 03b80814..d2c6e5c9 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp @@ -24,6 +24,21 @@ namespace ams::ldr::hoc::pcv::erista { + Result CpuVoltRange(u32* ptr) { + u32 min_volt_got = *(ptr - 1); + for (const auto& mv : CpuMinVolts) { + if (min_volt_got != mv) + continue; + + if (!C.eristaCpuMaxVolt) + R_SKIP(); + + PATCH_OFFSET(ptr, C.eristaCpuMaxVolt); + R_SUCCEED(); + } + R_THROW(ldr::ResultInvalidCpuMinVolt()); + } + Result CpuVoltDvfs(u32 *ptr) { if (MatchesPattern(ptr, cpuVoltDvfsPattern, cpuVoltDvfsOffsets)) { if (C.eristaCpuVmin) { @@ -439,6 +454,7 @@ namespace ams::ldr::hoc::pcv::erista { PatcherEntry patches[] = { {"CPU Freq Table", CpuFreqCvbTable, 1, nullptr, static_cast(GetDvfsTableLastEntry(CpuCvbTableDefault)->freq)}, {"CPU Volt DVFS", &CpuVoltDvfs, 1, nullptr, 825}, + {"CPU Volt Limit", &CpuVoltRange, 0, &CpuMaxVoltPatternFn}, {"CPU Volt Thermals", &CpuVoltThermals, 1, nullptr, 825}, {"CPU Volt Dfll", &CpuVoltDfll, 1, nullptr, 0xFFEAD0FF}, {"GPU Volt DVFS", &GpuVoltDVFS, 1, nullptr, 810}, diff --git a/Source/sys-clk/common/include/sysclk/config.h b/Source/sys-clk/common/include/sysclk/config.h index 3351df41..d5aca225 100644 --- a/Source/sys-clk/common/include/sysclk/config.h +++ b/Source/sys-clk/common/include/sysclk/config.h @@ -197,7 +197,7 @@ static inline const char* sysclkFormatConfigValue(SysClkConfigValue val, bool pr return pretty ? "Overwrite Boost Mode" : "ow_boost"; case HocClkConfigValue_EristaMaxCpuClock: - return pretty ? "CPU Max Display Clock" : "cpu_max_e"; + return pretty ? "CPU Max Clock" : "cpu_max_e"; case HocClkConfigValue_MarikoMaxCpuClock: return pretty ? "CPU Max Display Clock" : "cpu_max_m"; diff --git a/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp index efdc0ca6..7311bd05 100644 --- a/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/freq_choice_gui.cpp @@ -131,10 +131,9 @@ void FreqChoiceGui::listUI() // // this->configList->values[HocClkConfigValue_MarikoMaxMemClock] < mhz) // // continue; - // } else if (checkMax && IsErista()) { - // if (moduleName == "cpu" && - // this->configList->values[HocClkConfigValue_EristaMaxCpuClock] < mhz) - // continue; + if (checkMax && IsErista()) + if (moduleName == "cpu" && this->configList->values[HocClkConfigValue_EristaMaxCpuClock] < mhz) + continue; // // if (moduleName == "gpu" && // // this->configList->values[HocClkConfigValue_EristaMaxGpuClock] < mhz) diff --git a/Source/sys-clk/overlay/src/ui/gui/labels.cpp b/Source/sys-clk/overlay/src/ui/gui/labels.cpp index de6abdb8..a474817b 100644 --- a/Source/sys-clk/overlay/src/ui/gui/labels.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/labels.cpp @@ -35,7 +35,7 @@ std::map cpu_freq_label_e = { {1224000000, "Dev OC"}, {1785000000, "Boost Mode & Safe Max"}, {2091000000, "Unsafe Max"}, - {2295000000, "Absolute Max"}, + {2397000000, "Absolute Max"}, }; std::map gpu_freq_label_e = { {76800000, "Boost Mode"}, 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 44746447..b08ca583 100644 --- a/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/misc_gui.cpp @@ -834,6 +834,7 @@ protected: NamedValue("2091 MHz", 2091000), NamedValue("2193 MHz", 2193000), NamedValue("2295 MHz", 2295000), + NamedValue("2397 MHz", 2295000), }; ValueThresholds eCpuClockThresholds(1785000, 2091000); addConfigButton( @@ -870,16 +871,39 @@ protected: {}, false ); + + ValueThresholds eCpuVoltThresholds(1235, 1260); addConfigButton( KipConfigValue_eristaCpuMaxVolt, "CPU Max Voltage", - ValueRange(1120, 1235, 5, "mV", 1), + ValueRange(1120, 1260, 5, "mV", 1), "CPU Max Voltage", - &thresholdsDisabled, + &eCpuVoltThresholds, {}, {}, false ); + + std::vector maxClkOptions = { + NamedValue("1785 MHz", 1785), + NamedValue("1887 MHz", 1887), + NamedValue("1963 MHz", 1963), + NamedValue("2091 MHz", 2091), + NamedValue("2193 MHz", 2193), + NamedValue("2295 MHz", 2295), + NamedValue("2397 MHz", 2397), + }; + ValueThresholds eCpuMaxClockThresholds(1785, 2091); + addConfigButton( + HocClkConfigValue_EristaMaxCpuClock, + "CPU Max Clock", + ValueRange(0, 0, 1, "", 1), + "CPU Max Clock", + &eCpuMaxClockThresholds, + {}, + maxClkOptions, + false + ); } else { std::vector marikoTableConf = { // NamedValue("Auto", 0), diff --git a/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp b/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp index 3f9ec5b3..565a7e32 100644 Binary files a/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp and b/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp differ diff --git a/dist/atmosphere/kips/hoc.kip b/dist/atmosphere/kips/hoc.kip index 1f74ae43..d1fe6c2f 100644 Binary files a/dist/atmosphere/kips/hoc.kip and b/dist/atmosphere/kips/hoc.kip differ diff --git a/dist/switch/.overlays/horizon-oc-overlay.ovl b/dist/switch/.overlays/horizon-oc-overlay.ovl index a4ae136b..0eb2826b 100644 Binary files a/dist/switch/.overlays/horizon-oc-overlay.ovl and b/dist/switch/.overlays/horizon-oc-overlay.ovl differ