rewrite much of timings stuff

This commit is contained in:
souldbminersmwc
2025-08-30 11:59:19 -04:00
parent b5b509c828
commit fd91bc07d8
120 changed files with 19886 additions and 578 deletions

View File

@@ -1,8 +1,6 @@
/*
* Copyright (C) Switch-OC-Suite
*
* Copyright (c) 2023 hanai3Bi
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
@@ -30,7 +28,7 @@ volatile CustomizeTable C = {
* NO_ADJ_ALL: No timing adjustment for both Erista and Mariko.
* CUSTOMIZED_ALL: Replace with values in customized table for both Erista and Mariko.
*/
.mtcConf = AUTO_ADJ_ALL,
.mtcConf = CUSTOM_ADJ_ALL,
/* Common:
* - Boost Clock in kHz:
@@ -38,7 +36,7 @@ volatile CustomizeTable C = {
* Boost clock will be applied when applications request higher CPU frequency for quicker loading.
* This will be set regardless of whether sys-clk is enabled.
*/
.commonCpuBoostClock = 1785000,
.commonCpuBoostClock = 2295000,
/* - EMC Vddq (Erista Only) and RAM Vdd2 Voltage in uV
* Range: 1100'000 to 1250'000 uV
* Erista Default(HOS): 1125'000 (bootloader: 1100'000)
@@ -46,7 +44,7 @@ volatile CustomizeTable C = {
* Value should be divided evenly by 12'500.
* Not enabled by default.
*/
.commonEmcMemVolt = 1175000, // RAM Rated Voltage
.commonEmcMemVolt = 1212500,
/* Erista CPU:
* - Max Voltage in mV
@@ -68,7 +66,7 @@ volatile CustomizeTable C = {
* - Max Voltage in mV:
* Default voltage: 1120
*/
.marikoCpuMaxVolt = 1120,
.marikoCpuMaxVolt = 1160,
/* Mariko EMC(RAM):
* - RAM Clock in kHz:
@@ -79,39 +77,40 @@ volatile CustomizeTable C = {
* - System instabilities
* - NAND corruption
*/
.marikoEmcMaxClock = 1996800,
.marikoEmcMaxClock = 2400000,
/* - EMC Vddq (Mariko Only) Voltage in uV
* Range: 550'000 to 650'000 uV
* Value should be divided evenly by 5'000
* Value should be dicvided evenly by 5'000
* Default: 600'000
* Not enabled by default.
* This will not work without sys-clk-OC.
*/
.marikoEmcVddqVolt = 0,
.marikoEmcVddqVolt = 640000,
.marikoCpuUV = 0,
.marikoCpuUV = 1,
.marikoGpuUV = 0,
.marikoGpuUV = 2,
.commonGpuVoltOffset = 0,
.marikoEmcDvbShift = 0,
.marikoEmcDvbShift = 5,
.ramTimingPresetOne = 0,
.tRAS = 0,
.tRCD = 0,
.tREFpb = 0,
.tRFCpb = 0,
.tRPpb = 0,
.tRRD = 0,
.R2W = 0,
.tWTR = 0,
.ramTimingPresetTwo = 0,
.marikoGpuVoltArray = {635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 660, 685, 715, 745, 765, 785},
.ramTimingPresetThree = 0,
.marikoCpuHighVoltOffset = 70,
.ramTimingPresetFour = 0,
.marikoB3 = 179,
.ramTimingPresetFive = 0,
.ramTimingPresetSix = 0,
.ramTimingPresetSeven = 0,
.marikoGpuVoltArray = {610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 620, 640, 675, 710, 735, 785, 815},
.marikoCpuHighUV = 0,
/* Advanced Settings:
* - Erista CPU DVFS Table:
@@ -137,8 +136,6 @@ volatile CustomizeTable C = {
{ 1887000, { 1235000 }, { 5100873, -279186, 4747 } },
{ 1963500, { 1235000 }, { 5100873, -279186, 4747 } },
{ 2091000, { 1235000 }, { 5100873, -279186, 4747 } },
{ 2193000, { 1235000 }, { 5100873, -279186, 4747 } },
{ 2295000, { 1235000 }, { 5100873, -279186, 4747 } },
},
/* - Mariko CPU DVFS Table:
@@ -164,13 +161,15 @@ volatile CustomizeTable C = {
{ 1887000, { 1609246, -37515, 27 }, { 1120000 } },
{ 1963500, { 1675751, -38635, 27 }, { 1120000 } },
// Appending table
{ 2091000, { 1716501, -39395, 27 }, { 1235000 } },
{ 2193000, { 1775132, -40505, 27 }, { 1235000 } },
{ 2295000, { 1866287, -42005, 27 }, { 1235000 } },
// Unsafe
{ 2397000, { 1961107, -43506, 27 }, { 1235000 } },
{ 2499000, { 1754400, -35643, 27 }, { 1235000 } },
{ 2601000, { 1805897, -36331, 27 }, { 1235000 } },
{ 2091000, { 1580725, -33235, 113 }, { 1120000 } },
{ 2193000, { 1580725, -33235, 113 }, { 1235000 } },
{ 2295000, { 1635431, -34095, 113 }, { 1235000 } },
{ 2397000, { 1702903, -34955, 113 }, { 1235000 } },
{ 2499000, { 1754400, -35643, 113 }, { 1235000 } },
{ 2601000, { 1805897, -36331, 113 }, { 1235000 } },
{ 2703000, { 1857394, -37019, 113 }, { 1235000 } },
{ 2805000, { 1908891, -37707, 113 }, { 1235000 } },
{ 2907000, { 1960388, -38395, 113 }, { 1250000 } },
},
.marikoCpuDvfsTableSLT = {
@@ -226,47 +225,6 @@ volatile CustomizeTable C = {
* 1305600 might not work for some SoCs.
*/
.marikoGpuDvfsTable = {
{ 76800, {}, { 610000, } },
{ 153600, {}, { 610000, } },
{ 230400, {}, { 610000, } },
{ 307200, {}, { 610000, } },
{ 384000, {}, { 610000, } },
{ 460800, {}, { 610000, } },
{ 537600, {}, { 801688, -10900, -163, 298, -10599, 162 } },
{ 614400, {}, { 824214, -5743, -452, 238, -6325, 81 } },
{ 691200, {}, { 848830, -3903, -552, 119, -4030, -2 } },
{ 768000, {}, { 891575, -4409, -584, 0, -2849, 39 } },
{ 844800, {}, { 940071, -5367, -602, -60, -63, -93 } },
{ 921600, {}, { 986765, -6637, -614, -179, 1905, -13 } },
{ 998400, {}, { 1098475, -13529, -497, -179, 3626, 9 } },
{ 1075200, {}, { 1163644, -12688, -648, 0, 1077, 40 } },
{ 1152000, {}, { 1204812, -9908, -830, 0, 1469, 110 } },
{ 1228800, {}, { 1277303, -11675, -859, 0, 3722, 313 } },
{ 1267200, {}, { 1335531, -12567, -867, 0, 3681, 559 } },
// Appending table
{ 1305600, {}, { 1374130, -13725, -859, 0, 4442, 576 } },
},
.marikoGpuDvfsTableSLT = {
{ 76800, {}, { 590000, } },
{ 153600, {}, { 590000, } },
{ 230400, {}, { 590000, } },
{ 307200, {}, { 590000, } },
{ 384000, {}, { 590000, } },
{ 460800, {}, { 795089, -11096, -163, 298, -10421, 162 } },
{ 537600, {}, { 795089, -11096, -163, 298, -10421, 162 } },
{ 614400, {}, { 820606, -6285, -452, 238, -6182, 81 } },
{ 691200, {}, { 846289, -4565, -552, 119, -3958, -2 } },
{ 768000, {}, { 888720, -5110, -584, 0, -2849, 39 } },
{ 844800, {}, { 936634, -6089, -602, -60, -99, -93 } },
{ 921600, {}, { 982562, -7373, -614, -179, 1797, -13 } },
{ 998400, {}, { 1090179, -14125, -497, -179, 3518, 9 } },
{ 1075200, {}, { 1155798, -13465, -648, 0, 1077, 40 } },
{ 1152000, {}, { 1198568, -10904, -830, 0, 1469, 110 } },
{ 1228800, {}, { 1269988, -12707, -859, 0, 3722, 313 } },
{ 1267200, {}, { 1308155, -13694, -867, 0, 3681, 559 } },
},
.marikoGpuDvfsTableHiOPT = {
{ 76800, {}, { 590000, } },
{ 153600, {}, { 590000, } },
{ 230400, {}, { 590000, } },
@@ -284,6 +242,49 @@ volatile CustomizeTable C = {
{ 1152000, {}, { 1180029, -14534, -830, 0, 1469, 110 } },
{ 1228800, {}, { 1248293, -16383, -859, 0, 3722, 313 } },
{ 1267200, {}, { 1286399, -17475, -867, 0, 3681, 559 } },
// Appending table
{ 1305600, {}, { 1304130, -13725, -859, 0, 4442, 576 } },
},
.marikoGpuDvfsTableSLT = {
{ 76800, {}, { 635000, } },
{ 153600, {}, { 635000, } },
{ 230400, {}, { 635000, } },
{ 307200, {}, { 635000, } },
{ 384000, {}, { 635000, } },
{ 460800, {}, { 635000, } },
{ 537600, {}, { 635000, } },
{ 614400, {}, { 635000, } },
{ 691200, {}, { 635000, } },
{ 768000, {}, { 635000, } },
{ 844800, {}, { 635000, } },
{ 921600, {}, { 635000, } },
{ 998400, {}, { 901575, -4409, -584, 0, -2849, 39 } },
{ 1075200, {}, { 940071, -5367, -602, -60, -63, -93 } },
{ 1152000, {}, { 996765, -6637, -614, -179, 1905, -13 } },
{ 1228800, {}, { 1098475, -13529, -497, -179, 3626, 9 } },
{ 1267200, {}, { 1131060, -13109, -573, -90, 2352, 25 } },
{ 1305600, {}, { 1163644, -12688, -648, 0, 1077, 40 } },
},
.marikoGpuDvfsTableHiOPT = {
{ 76800, {}, { 550000, } },
{ 153600, {}, { 550000, } },
{ 230400, {}, { 550000, } },
{ 307200, {}, { 550000, } },
{ 384000, {}, { 550000, } },
{ 460800, {}, { 550000, } },
{ 537600, {}, { 550000, } },
{ 614400, {}, { 550000, } },
{ 691200, {}, { 550000, } },
{ 768000, {}, { 801688, -10900, -163, 298, -10599, 162 } },
{ 844800, {}, { 824214, -5743, -452, 238, -6325, 81 } },
{ 921600, {}, { 848830, -3903, -552, 119, -4030, -2 } },
{ 998400, {}, { 901575, -4409, -584, 0, -2849, 39 } },
{ 1075200, {}, { 940071, -5367, -602, -60, -63, -93 } },
{ 1152000, {}, { 996765, -6637, -614, -179, 1905, -13 } },
{ 1228800, {}, { 1098475, -13529, -497, -179, 3626, 9 } },
{ 1267200, {}, { 1131060, -13109, -573, -90, 2352, 25 } },
{ 1305600, {}, { 1163644, -12688, -648, 0, 1077, 40 } },
},
//.eristaMtcTable = const_cast<EristaMtcTable *>(&EristaMtcTablePlaceholder),
@@ -291,4 +292,4 @@ volatile CustomizeTable C = {
};
}
}