loader: remove static table and patch coefficients instead

This commit is contained in:
hanabbi
2023-07-06 01:35:41 +09:00
parent ff0c8c8838
commit 63f7e86de0
7 changed files with 6 additions and 35 deletions

View File

@@ -270,26 +270,6 @@ 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<EristaMtcTable *>(&EristaMtcTablePlaceholder),
//.marikoMtcTable = const_cast<MarikoMtcTable *>(&MarikoMtcTablePlaceholder),

View File

@@ -70,7 +70,6 @@ typedef struct CustomizeTable {
CustomizeGpuDvfsTable marikoGpuDvfsTable;
CustomizeGpuDvfsTable marikoGpuDvfsTableSLT;
CustomizeGpuDvfsTable marikoGpuDvfsTableHiOPT;
CustomizeGpuDvfsTable marikoGpuStaticTable;
//EristaMtcTable* eristaMtcTable;
//MarikoMtcTable* marikoMtcTable;
} CustomizeTable;

View File

@@ -105,9 +105,6 @@ void SafetyCheck() {
case 2:
marikoGpuDvfsMaxFreq = static_cast<u32>(GetDvfsTableLastEntry(C.marikoGpuDvfsTableHiOPT)->freq);
break;
case 3:
marikoGpuDvfsMaxFreq = static_cast<u32>(GetDvfsTableLastEntry(C.marikoGpuStaticTable)->freq);
break;
default:
marikoGpuDvfsMaxFreq = static_cast<u32>(GetDvfsTableLastEntry(C.marikoGpuDvfsTable)->freq);
break;

View File

@@ -227,9 +227,6 @@ Result GpuFreqCvbTable(u32* ptr) {
case 2:
customize_table = const_cast<cvb_entry_t *>(C.marikoGpuDvfsTableHiOPT);
break;
case 3:
customize_table = const_cast<cvb_entry_t *>(C.marikoGpuStaticTable);
break;
default:
customize_table = const_cast<cvb_entry_t *>(C.marikoGpuDvfsTable);
break;
@@ -252,10 +249,15 @@ Result GpuFreqCvbTable(u32* ptr) {
std::memcpy(gpu_cvb_table_head, (void*)customize_table, customize_table_size);
// Patch GPU volt
if (C.marikoGpuUV == 3) {
if (isMariko && 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);
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++;
}
}

View File

@@ -73,9 +73,6 @@ Result GpuFreqMaxAsm(u32* ptr32) {
case 2:
max_clock = GetDvfsTableLastEntry(C.marikoGpuDvfsTableHiOPT)->freq;
break;
case 3:
max_clock = GetDvfsTableLastEntry(C.marikoGpuStaticTable)->freq;
break;
default:
max_clock = GetDvfsTableLastEntry(C.marikoGpuDvfsTable)->freq;
break;

View File

@@ -315,9 +315,6 @@ 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;

View File

@@ -73,7 +73,6 @@ typedef struct CustTable {
CustomizeGpuDvfsTable marikoGpuDvfsTable;
CustomizeGpuDvfsTable marikoGpuDvfsTableSLT;
CustomizeGpuDvfsTable marikoGpuDvfsTableHiOPT;
CustomizeGpuDvfsTable marikoGpuStaticTable;
//void* eristaMtcTable;
//void* marikoMtcTable;
} CustTable;