loader: implement mariko gpu volt customization

This commit is contained in:
hanabbi
2023-07-05 06:09:23 +09:00
parent a27a0a0c9e
commit 9618b15d68
4 changed files with 14 additions and 1 deletions

View File

@@ -105,6 +105,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:
*/

View File

@@ -62,6 +62,7 @@ typedef struct CustomizeTable {
u32 ramTimingPresetFive;
u32 ramTimingPresetSix;
u32 ramTimingPresetSeven;
u32 marikoGpuVoltArray[17];
CustomizeCpuDvfsTable eristaCpuDvfsTable;
CustomizeCpuDvfsTable marikoCpuDvfsTable;
CustomizeCpuDvfsTable marikoCpuDvfsTableSLT;

View File

@@ -237,7 +237,7 @@ Result GpuFreqCvbTable(u32* ptr) {
} else {
customize_table = const_cast<cvb_entry_t *>(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);
@@ -251,6 +251,15 @@ Result GpuFreqCvbTable(u32* ptr) {
std::memcpy(gpu_cvb_table_head, (void*)customize_table, customize_table_size);
// Patch GPU volt
if (C.marikoGpuUV == 3) {
cvb_entry_t* entry = static_cast<cvb_entry_t *>(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);
entry++;
}
}
R_SUCCEED();
};

View File

@@ -65,6 +65,7 @@ typedef struct CustTable {
u32 ramTimingPresetFive;
u32 ramTimingPresetSix;
u32 ramTimingPresetSeven;
u32 marikoGpuVoltArray[17];
CustomizeCpuDvfsTable eristaCpuDvfsTable;
CustomizeCpuDvfsTable marikoCpuDvfsTable;
CustomizeCpuDvfsTable marikoCpuDvfsTableSLT;