diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp index 771bbbc3..fa388c1c 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp @@ -268,6 +268,26 @@ volatile CustomizeTable C = { { 1267200, {}, { 1286399, -17475, -867, 0, 3681, 559 } }, }, +.marikoGpuStaticTable = { + { 76800, {}, { 610000, } }, + { 153600, {}, { 610000, } }, + { 230400, {}, { 610000, } }, + { 307200, {}, { 610000, } }, + { 384000, {}, { 610000, } }, + { 460800, {}, { 610000, } }, + { 537600, {}, { 610000, } }, + { 614400, {}, { 610000, } }, + { 691200, {}, { 610000, } }, + { 768000, {}, { 610000, } }, + { 844800, {}, { 610000, } }, + { 921600, {}, { 610000, } }, + { 998400, {}, { 610000, } }, + { 1075200, {}, { 610000, } }, + { 1152000, {}, { 610000, } }, + { 1228800, {}, { 610000, } }, + { 1267200, {}, { 610000, } }, +}, + //.eristaMtcTable = const_cast(&EristaMtcTablePlaceholder), //.marikoMtcTable = const_cast(&MarikoMtcTablePlaceholder), diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp index c0afb220..25020252 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp @@ -69,6 +69,7 @@ typedef struct CustomizeTable { CustomizeGpuDvfsTable marikoGpuDvfsTable; CustomizeGpuDvfsTable marikoGpuDvfsTableSLT; CustomizeGpuDvfsTable marikoGpuDvfsTableHiOPT; + CustomizeGpuDvfsTable marikoGpuStaticTable; //EristaMtcTable* eristaMtcTable; //MarikoMtcTable* marikoMtcTable; } CustomizeTable; diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp index 6d50aaf4..efa490b1 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.cpp @@ -105,8 +105,12 @@ void SafetyCheck() { case 2: marikoGpuDvfsMaxFreq = static_cast(GetDvfsTableLastEntry(C.marikoGpuDvfsTableHiOPT)->freq); break; + case 3: + marikoGpuDvfsMaxFreq = static_cast(GetDvfsTableLastEntry(C.marikoGpuStaticTable)->freq); + break; default: marikoGpuDvfsMaxFreq = static_cast(GetDvfsTableLastEntry(C.marikoGpuDvfsTable)->freq); + break; } sValidator validators[] = { diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp index acfbbda6..9162117f 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp @@ -215,8 +215,29 @@ 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; + case 3: + customize_table = const_cast(C.marikoGpuStaticTable); + 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); size_t customize_entry_count = GetDvfsTableEntryCount(customize_table); 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..394f5117 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,12 @@ Result GpuFreqMaxAsm(u32* ptr32) { case 2: max_clock = GetDvfsTableLastEntry(C.marikoGpuDvfsTableHiOPT)->freq; break; - default: max_clock = GetDvfsTableLastEntry(C.marikoGpuDvfsTable)->freq; + case 3: + max_clock = GetDvfsTableLastEntry(C.marikoGpuStaticTable)->freq; + break; + default: + max_clock = GetDvfsTableLastEntry(C.marikoGpuDvfsTable)->freq; + break; } u32 asm_patch[2] = { asm_set_rd(asm_set_imm16(asm_pattern[0], max_clock), rd), diff --git a/Source/sys-clk-OC/sysmodule/src/file_utils.cpp b/Source/sys-clk-OC/sysmodule/src/file_utils.cpp index 9cadebb6..975493c9 100644 --- a/Source/sys-clk-OC/sysmodule/src/file_utils.cpp +++ b/Source/sys-clk-OC/sysmodule/src/file_utils.cpp @@ -315,6 +315,9 @@ Result FileUtils::CustParser(const char* filepath, size_t filesize) { case 2: gpu_dvfs_table = &table.marikoGpuDvfsTableHiOPT; break; + case 3: + gpu_dvfs_table = &table.marikoGpuStaticTable; + break; default: gpu_dvfs_table = &table.marikoGpuDvfsTable; break; diff --git a/Source/sys-clk-OC/sysmodule/src/file_utils.h b/Source/sys-clk-OC/sysmodule/src/file_utils.h index 07586bb5..13ba5fb5 100644 --- a/Source/sys-clk-OC/sysmodule/src/file_utils.h +++ b/Source/sys-clk-OC/sysmodule/src/file_utils.h @@ -72,6 +72,7 @@ typedef struct CustTable { CustomizeGpuDvfsTable marikoGpuDvfsTable; CustomizeGpuDvfsTable marikoGpuDvfsTableSLT; CustomizeGpuDvfsTable marikoGpuDvfsTableHiOPT; + CustomizeGpuDvfsTable marikoGpuStaticTable; //void* eristaMtcTable; //void* marikoMtcTable; } CustTable;