diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp index 771bbbc3..621bc2b1 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp @@ -91,6 +91,8 @@ volatile CustomizeTable C = { .marikoGpuUV = 0, +.marikoEmcDvbShift = 0, + .ramTimingPresetOne = 0, .ramTimingPresetTwo = 0, @@ -105,6 +107,8 @@ volatile CustomizeTable C = { .ramTimingPresetSeven = 0, +.marikoGpuVoltArray = {610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 620, 640, 675, 710, 735, 785, 815}, + /* Advanced Settings: * - Erista CPU DVFS Table: */ diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp index c0afb220..fc2fcc95 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp @@ -52,9 +52,10 @@ typedef struct CustomizeTable { u32 marikoCpuMaxVolt; u32 marikoEmcMaxClock; u32 marikoEmcVddqVolt; - //advanced config u32 marikoCpuUV; u32 marikoGpuUV; + // advanced config + u32 marikoEmcDvbShift; u32 ramTimingPresetOne; u32 ramTimingPresetTwo; u32 ramTimingPresetThree; @@ -62,6 +63,8 @@ typedef struct CustomizeTable { u32 ramTimingPresetFive; u32 ramTimingPresetSix; u32 ramTimingPresetSeven; + // + u32 marikoGpuVoltArray[17]; CustomizeCpuDvfsTable eristaCpuDvfsTable; CustomizeCpuDvfsTable marikoCpuDvfsTable; CustomizeCpuDvfsTable marikoCpuDvfsTableSLT; diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp index 6d50aaf4..8cab99dc 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp @@ -107,6 +107,7 @@ void SafetyCheck() { break; default: marikoGpuDvfsMaxFreq = static_cast(GetDvfsTableLastEntry(C.marikoGpuDvfsTable)->freq); + break; } sValidator validators[] = { @@ -115,7 +116,7 @@ void SafetyCheck() { { C.eristaCpuMaxVolt, 1100, 1300 }, { C.eristaEmcMaxClock, 1600'000, 2131'200 }, { C.marikoCpuMaxVolt, 1100, 1300 }, - { C.marikoEmcMaxClock, 1600'000, 2400'000 }, + { C.marikoEmcMaxClock, 1600'000, 2800'000 }, { C.marikoEmcVddqVolt, 550'000, 650'000 }, { eristaCpuDvfsMaxFreq, 1785'000, 3000'000 }, { marikoCpuDvfsMaxFreq, 1785'000, 3000'000 }, diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp index acfbbda6..574fbacc 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp @@ -203,7 +203,11 @@ Result CpuFreqCvbTable(u32* ptr) { cvb_entry_t* entry = static_cast(cpu_cvb_table_head); for (size_t i = 0; i < customize_entry_count; i++) { if (entry->freq >= cpu_freq_threshold) { - PATCH_OFFSET(&(entry->cvb_pll_param.c0), cpu_max_volt * 1000); + if (isMariko) { + PATCH_OFFSET(&(entry->cvb_pll_param.c0), cpu_max_volt * 1000); + } else { + PATCH_OFFSET(&(entry->cvb_dfll_param.c0), cpu_max_volt * 1000); + } } entry++; } @@ -215,7 +219,25 @@ Result CpuFreqCvbTable(u32* ptr) { template Result GpuFreqCvbTable(u32* ptr) { cvb_entry_t* default_table = isMariko ? (cvb_entry_t *)(&mariko::GpuCvbTableDefault) : (cvb_entry_t *)(&erista::GpuCvbTableDefault); - cvb_entry_t* customize_table = const_cast(isMariko ? (C.marikoGpuUV ? (C.marikoGpuUV == 2 ? C.marikoGpuDvfsTableHiOPT : C.marikoGpuDvfsTableSLT) : C.marikoGpuDvfsTable) : C.eristaGpuDvfsTable); + cvb_entry_t* customize_table; + if (isMariko) { + switch (C.marikoGpuUV) { + case 0: + customize_table = const_cast(C.marikoGpuDvfsTable); + break; + case 1: + customize_table = const_cast(C.marikoGpuDvfsTableSLT); + break; + case 2: + customize_table = const_cast(C.marikoGpuDvfsTableHiOPT); + break; + default: + customize_table = const_cast(C.marikoGpuDvfsTable); + break; + } + } else { + customize_table = const_cast(C.eristaGpuDvfsTable); + } size_t default_entry_count = GetDvfsTableEntryCount(default_table); size_t default_table_size = default_entry_count * sizeof(cvb_entry_t); @@ -230,6 +252,20 @@ Result GpuFreqCvbTable(u32* ptr) { std::memcpy(gpu_cvb_table_head, (void*)customize_table, customize_table_size); + // Patch GPU volt + if (isMariko && C.marikoGpuUV == 3) { + cvb_entry_t* entry = static_cast(gpu_cvb_table_head); + for (size_t i = 0; i < customize_entry_count; i++) { + PATCH_OFFSET(&(entry->cvb_pll_param.c0), C.marikoGpuVoltArray[i] * 1000); + PATCH_OFFSET(&(entry->cvb_pll_param.c1), 0); + PATCH_OFFSET(&(entry->cvb_pll_param.c2), 0); + PATCH_OFFSET(&(entry->cvb_pll_param.c3), 0); + PATCH_OFFSET(&(entry->cvb_pll_param.c4), 0); + PATCH_OFFSET(&(entry->cvb_pll_param.c5), 0); + entry++; + } + } + R_SUCCEED(); }; 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 f3f6e2c0..a4937d9b 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp @@ -73,7 +73,9 @@ Result GpuFreqMaxAsm(u32* ptr32) { case 2: max_clock = GetDvfsTableLastEntry(C.marikoGpuDvfsTableHiOPT)->freq; break; - default: max_clock = GetDvfsTableLastEntry(C.marikoGpuDvfsTable)->freq; + default: + max_clock = GetDvfsTableLastEntry(C.marikoGpuDvfsTable)->freq; + break; } u32 asm_patch[2] = { asm_set_rd(asm_set_imm16(asm_pattern[0], max_clock), rd), @@ -369,10 +371,10 @@ Result MemFreqDvbTable(u32* ptr) { emc_dvb_dvfs_table_t oc_table = { 2131200, { 725, 700, 675, } }; std::memcpy(new_start, &oc_table, sizeof(emc_dvb_dvfs_table_t)); } else if (C.marikoEmcMaxClock < 2665600){ - emc_dvb_dvfs_table_t oc_table = { 2400000, { 750, 725, 700, } }; + emc_dvb_dvfs_table_t oc_table = { 2400000, { 750+25*C.marikoEmcDvbShift, 725+25*C.marikoEmcDvbShift, 700+25*C.marikoEmcDvbShift, } }; std::memcpy(new_start, &oc_table, sizeof(emc_dvb_dvfs_table_t)); } else { - emc_dvb_dvfs_table_t oc_table = { 2665600, { 775, 750, 725, } }; + emc_dvb_dvfs_table_t oc_table = { 2665600, { 775+25*C.marikoEmcDvbShift, 750+25*C.marikoEmcDvbShift, 725+25*C.marikoEmcDvbShift, } }; std::memcpy(new_start, &oc_table, sizeof(emc_dvb_dvfs_table_t)); } new_start->freq = C.marikoEmcMaxClock; diff --git a/Source/sys-clk-OC/sysmodule/src/file_utils.h b/Source/sys-clk-OC/sysmodule/src/file_utils.h index 07586bb5..7ed72628 100644 --- a/Source/sys-clk-OC/sysmodule/src/file_utils.h +++ b/Source/sys-clk-OC/sysmodule/src/file_utils.h @@ -58,6 +58,7 @@ typedef struct CustTable { u32 marikoEmcVddqVolt; u32 marikoCpuUV; u32 marikoGpuUV; + u32 marikoEmcDvbShift; u32 ramTimingPresetOne; u32 ramTimingPresetTwo; u32 ramTimingPresetThree; @@ -65,6 +66,7 @@ typedef struct CustTable { u32 ramTimingPresetFive; u32 ramTimingPresetSix; u32 ramTimingPresetSeven; + u32 marikoGpuVoltArray[17]; CustomizeCpuDvfsTable eristaCpuDvfsTable; CustomizeCpuDvfsTable marikoCpuDvfsTable; CustomizeCpuDvfsTable marikoCpuDvfsTableSLT; diff --git a/pages/src/index.html b/pages/src/index.html index d4fbba0b..8665317a 100644 --- a/pages/src/index.html +++ b/pages/src/index.html @@ -401,6 +401,7 @@
+