@@ -28,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:
|
||||
@@ -36,24 +36,21 @@ 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.
|
||||
*/
|
||||
.marikoCpuBoostClock = 1963500,
|
||||
|
||||
.eristaCpuBoostClock = 1785000,
|
||||
|
||||
.commonCpuBoostClock = 2295000,
|
||||
/* - EMC Vddq (Erista Only) and RAM Vdd2 Voltage in uV
|
||||
* Range: 1100'000 to 1250'000 uV
|
||||
* Erista Default(HOS): 1175'000 (bootloader: 1100'000)
|
||||
* Mariko Default: 1175'000 (It will not work without sys-clk-OC.)
|
||||
* Erista Default(HOS): 1125'000 (bootloader: 1100'000)
|
||||
* Mariko Default: 1100'000 (It will not work without sys-clk-OC.)
|
||||
* Value should be divided evenly by 12'500.
|
||||
* Not enabled by default.
|
||||
*/
|
||||
.commonEmcMemVolt = 1175000,
|
||||
.commonEmcMemVolt = 1212500,
|
||||
|
||||
/* Erista CPU:
|
||||
* - Max Voltage in mV
|
||||
* - CpuVoltL4T: 1235
|
||||
*/
|
||||
.eristaCpuMaxVolt = 1257,
|
||||
.eristaCpuMaxVolt = 1235,
|
||||
|
||||
/* Erista EMC(RAM):
|
||||
* - RAM Clock in kHz
|
||||
@@ -69,7 +66,7 @@ volatile CustomizeTable C = {
|
||||
* - Max Voltage in mV:
|
||||
* Default voltage: 1120
|
||||
*/
|
||||
.marikoCpuMaxVolt = 1120,
|
||||
.marikoCpuMaxVolt = 1235,
|
||||
|
||||
/* Mariko EMC(RAM):
|
||||
* - RAM Clock in kHz:
|
||||
@@ -92,40 +89,38 @@ volatile CustomizeTable C = {
|
||||
|
||||
.marikoCpuUV = 0,
|
||||
|
||||
.marikoCpuHighUV = 0,
|
||||
|
||||
.marikoGpuUV = 0,
|
||||
|
||||
.commonGpuVoltOffset = 0,
|
||||
|
||||
.marikoCpuHighVoltOffset = 0,
|
||||
|
||||
.cpuMaxFreq = 1963,
|
||||
.marikoCpuHighUV = 0,
|
||||
|
||||
.gpuMaxFreq = 1152,
|
||||
.cpuMaxFreq = 1963500,
|
||||
|
||||
.EcpuMaxFreq = 1963,
|
||||
|
||||
.EgpuMaxFreq = 921,
|
||||
.gpuMaxFreq = 1267200,
|
||||
|
||||
.marikoEmcDvbShift = 0,
|
||||
|
||||
.ramTimingPresetOne = 0, // T1-3 EOS
|
||||
.ramTimingPresetOne = 4, // T1-3 EOS
|
||||
|
||||
.ramTimingPresetTwo = 0, // T4
|
||||
.ramTimingPresetTwo = 2, // T4
|
||||
|
||||
.ramTimingPresetThree = 0, // Try all values from 0-6
|
||||
.ramTimingPresetThree = 2, // Try all values from 0-6
|
||||
|
||||
.ramTimingPresetFour = 0, // EOS T5
|
||||
.ramTimingPresetFour = 2, // EOS T5
|
||||
|
||||
.ramTimingPresetFive = 0, // EOS T7
|
||||
.ramTimingPresetFive = 2, // EOS T7
|
||||
|
||||
.ramTimingPresetSix = 0, // EOS T8
|
||||
.ramTimingPresetSix = 2, // EOS T8
|
||||
|
||||
.ramTimingPresetSeven = 0,
|
||||
.ramTimingPresetSeven = 2,
|
||||
|
||||
.marikoGpuVoltArray = {635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 660, 685, 715, 745, 765, 785},
|
||||
|
||||
.marikoGpuVoltArray_RAM_OC = {635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 660, 685, 715, 745, 765, 785},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define CUST_REV 2
|
||||
#define CUST_REV 1
|
||||
|
||||
#include "oc_common.hpp"
|
||||
#include "pcv/pcv_common.hpp"
|
||||
@@ -45,10 +45,7 @@ typedef struct CustomizeTable {
|
||||
u8 cust[4] = {'C', 'U', 'S', 'T'};
|
||||
u32 custRev = CUST_REV;
|
||||
u32 mtcConf;
|
||||
|
||||
u32 marikoCpuBoostClock;
|
||||
u32 eristaCpuBoostClock;
|
||||
|
||||
u32 commonCpuBoostClock;
|
||||
u32 commonEmcMemVolt;
|
||||
u32 eristaCpuMaxVolt;
|
||||
u32 eristaEmcMaxClock;
|
||||
@@ -56,15 +53,13 @@ typedef struct CustomizeTable {
|
||||
u32 marikoEmcMaxClock;
|
||||
u32 marikoEmcVddqVolt;
|
||||
u32 marikoCpuUV;
|
||||
u32 marikoCpuHighUV;
|
||||
u32 marikoGpuUV;
|
||||
u32 commonGpuVoltOffset;
|
||||
u32 marikoCpuHighVoltOffset;
|
||||
u32 marikoCpuHighUV;
|
||||
|
||||
u32 cpuMaxFreq;
|
||||
u32 gpuMaxFreq;
|
||||
u32 EcpuMaxFreq;
|
||||
u32 EgpuMaxFreq;
|
||||
// advanced config
|
||||
u32 marikoEmcDvbShift;
|
||||
u32 ramTimingPresetOne;
|
||||
|
||||
@@ -111,17 +111,17 @@ void SafetyCheck() {
|
||||
}
|
||||
|
||||
sValidator validators[] = {
|
||||
{ C.commonCpuBoostClock, 1020'000, 3010'000, true },
|
||||
{ C.commonCpuBoostClock, 1020'000, C.cpuMaxFreq + 1, true },
|
||||
{ C.commonEmcMemVolt, 1000'000, C.MemVltMax + 1 },
|
||||
{ C.eristaCpuMaxVolt, 1100, C.eristaCPUvMax + 1 },
|
||||
{ C.eristaEmcMaxClock, 1600'000, 2428'800 },
|
||||
{ C.marikoCpuMaxVolt, 800, C.marikoCPUvMax + 1 },
|
||||
{ C.marikoEmcMaxClock, 1600'000, 3504'000 },
|
||||
{ C.marikoEmcVddqVolt, 550'000, C.marikoVDDQMax + 1 },
|
||||
{ eristaCpuDvfsMaxFreq, 204'000, (C.EcpuMaxFreq * 1000) + 1000},
|
||||
{ marikoCpuDvfsMaxFreq, 204'000, (C.cpuMaxFreq * 1000) + 1000 },
|
||||
{ eristaGpuDvfsMaxFreq, 76'800, (C.EgpuMaxFreq * 1000) + 1000 },
|
||||
{ marikoGpuDvfsMaxFreq, 76'800, (C.gpuMaxFreq * 1000) + 1000 },
|
||||
{ eristaCpuDvfsMaxFreq, 1785'000, C.cpuMaxFreq + 1 },
|
||||
{ marikoCpuDvfsMaxFreq, 1785'000, C.cpuMaxFreq + 1 },
|
||||
{ eristaGpuDvfsMaxFreq, 768'000, C.gpuMaxFreq + 1 },
|
||||
{ marikoGpuDvfsMaxFreq, 768'000, C.gpuMaxFreq + 1 },
|
||||
};
|
||||
|
||||
for (auto& i : validators) {
|
||||
|
||||
@@ -17,20 +17,12 @@
|
||||
#include "ptm.hpp"
|
||||
|
||||
namespace ams::ldr::oc::ptm {
|
||||
#ifdef ATMOSPHERE_IS_STRATOSPHERE
|
||||
bool isMariko = (spl::GetSocType() == spl::SocType_Mariko);
|
||||
#else
|
||||
bool isMariko = true;
|
||||
#endif
|
||||
|
||||
Result CpuPtmBoost(perf_conf_entry* entry) {
|
||||
if (!C.commonCpuBoostClock)
|
||||
R_SUCCEED();
|
||||
u32 cpuPtmBoostNew;
|
||||
if(isMariko) {
|
||||
cpuPtmBoostNew = C.marikoCpuBoostClock * 1000;
|
||||
} else {
|
||||
cpuPtmBoostNew = C.eristaCpuBoostClock * 1000;
|
||||
}
|
||||
|
||||
u32 cpuPtmBoostNew = C.commonCpuBoostClock * 1000;
|
||||
|
||||
PATCH_OFFSET(&(entry->cpu_freq_1), cpuPtmBoostNew);
|
||||
PATCH_OFFSET(&(entry->cpu_freq_2), cpuPtmBoostNew);
|
||||
@@ -79,6 +71,13 @@ void Patch(uintptr_t mapped_nso, size_t nso_size) {
|
||||
PatcherEntry<perf_conf_entry> cpuPtmBoostPatch = { "CPU Ptm Boost", &CpuPtmBoost, 2, };
|
||||
PatcherEntry<perf_conf_entry> memPtmPatch = { "MEM Ptm", &MemPtm, 16, };
|
||||
|
||||
#ifdef ATMOSPHERE_IS_STRATOSPHERE
|
||||
bool isMariko = (spl::GetSocType() == spl::SocType_Mariko);
|
||||
#else
|
||||
bool isMariko = true;
|
||||
#endif
|
||||
|
||||
|
||||
for (u32 i = 0; i < entryCnt; i++) {
|
||||
perf_conf_entry* entry = confTable + i;
|
||||
|
||||
|
||||
85
docs/main.js
85
docs/main.js
@@ -25,7 +25,7 @@ var __awaiter = this && this.__awaiter || function(e, t, i, n) {
|
||||
o((n = n.apply(e, t || [])).next())
|
||||
}))
|
||||
};
|
||||
const CUST_REV_ADV = 2;
|
||||
const CUST_REV_ADV = 1;
|
||||
var CustPlatform;
|
||||
! function(e) {
|
||||
e[e.Undefined = 0] = "Undefined", e[e.Erista = 1] = "Erista", e[e.Mariko = 2] = "Mariko", e[e.All = 3] = "All"
|
||||
@@ -113,20 +113,14 @@ class GpuEntry extends CustEntry {
|
||||
var CustTable = [
|
||||
new CustEntry("mtcConf", "DRAM Timing", CustPlatform.All, 4, [
|
||||
"<b>0</b>: AUTO_ADJ_ALL: Auto adjust mtc table with LPDDR4 3733 Mbps specs, 8Gb density. Change timing with Advanced Config (Default)",
|
||||
"<b>1</b>: CUSTOM_ADJ_ALL: Adjust only non-zero preset timings in Advanced Config. This may not work on Erista units",
|
||||
"<b>1</b>: CUSTOM_ADJ_ALL: Adjust only non-zero preset timings in Advanced Config",
|
||||
"<b>2</b>: NO_ADJ_ALL: Use 1600 mtc table wihout adjusting (Timing becomes tighter if you raise dram clock)."
|
||||
], 0, [0, 2], 1),
|
||||
|
||||
new CustEntry("marikoCpuBoostClock", "Mariko Boost Clock in kHz", CustPlatform.Mariko, 4, [
|
||||
new CustEntry("commonCpuBoostClock", "Boost Clock in kHz", CustPlatform.All, 4, [
|
||||
"System default: 1785000",
|
||||
"Boost clock will be applied when applications request Boost Mode via performance configuration."
|
||||
], 1963500, [204000, 2907000], 1, !1),
|
||||
|
||||
new CustEntry("eristaCpuBoostClock", "Erista Boost Clock in kHz", CustPlatform.Erista, 4, [
|
||||
"System default: 1785000",
|
||||
"Boost clock will be applied when applications request Boost Mode via performance configuration."
|
||||
], 1963e3, [204000, 2907000], 1, !1),
|
||||
|
||||
], 2091e3, [204000, 2907000], 1, !1),
|
||||
|
||||
new CustEntry("commonEmcMemVolt", "EMC Vdd2 Voltage in uV", CustPlatform.All, 4, [
|
||||
"Acceptable range: 1100000 ≤ x ≤ 1250000, and it should be divided evenly by 12500.",
|
||||
@@ -145,13 +139,13 @@ var CustTable = [
|
||||
"Values should be ≥ 1600000, and divided evenly by 3200.",
|
||||
"Recommended Clocks: 1862400, 2131200 (JEDEC)",
|
||||
"<b>WARNING:</b> RAM overclock could be UNSTABLE if timing parameters are not suitable for your DRAM"
|
||||
], 1862400, [16e5, 2500000], 3200),
|
||||
], 1862400, [16e5, 2131200], 3200),
|
||||
|
||||
new CustEntry("marikoCpuMaxVolt", "Mariko CPU Max Voltage in mV", CustPlatform.Mariko, 4, [
|
||||
"System default: 1120",
|
||||
"Acceptable range: 1120 ≤ x ≤ 1300",
|
||||
"Changing this value affects cpu voltage calculation"
|
||||
], 1120, [1120, 1300], 5),
|
||||
], 1235, [1120, 1300], 5),
|
||||
|
||||
new CustEntry("marikoEmcMaxClock", "Mariko RAM Max Clock in kHz", CustPlatform.Mariko, 4, [
|
||||
"Values should be ≥ 1600000, and divided evenly by 9600.",
|
||||
@@ -174,10 +168,6 @@ var CustTable = [
|
||||
"<b>2</b> : Undervolt Level 1 (SLT - CPU speedo >= 1650)"
|
||||
], 0, [0, 2], 1),
|
||||
|
||||
new CustEntry("marikoCpuHighUV", "Enable Mariko CPU High Undervolt", CustPlatform.Mariko, 4, [
|
||||
"Reduce CPU power draw at high clocks by offsetting the voltage sent to the CPU",
|
||||
], 0, [0, 12], 1),
|
||||
|
||||
new CustEntry("marikoGpuUV", "Enable Mariko GPU Undervolt", CustPlatform.Mariko, 4, [
|
||||
"Reduce GPU power draw",
|
||||
"Your GPU might not withstand undervolt, and can hang your console, or crash games",
|
||||
@@ -200,34 +190,23 @@ var CustTable = [
|
||||
"Reduce CPU power draw at high clocks",
|
||||
], 0, [0, 100], 1),
|
||||
|
||||
new CustEntry("cpuMaxFreq", "Mariko Maximum allowed CPU Frequency (MHz)", CustPlatform.Mariko, 4, [
|
||||
"Default: 1963",
|
||||
new CustEntry("marikoCpuHighUV", "Enable Mariko CPU High Undervolt", CustPlatform.Mariko, 4, [
|
||||
"Reduce CPU power draw at high clocks by offsetting the voltage sent to the CPU",
|
||||
], 0, [0, 12], 1),
|
||||
|
||||
new CustEntry("cpuMaxFreq", "Maximum allowed CPU Frequency (KHz)", CustPlatform.All, 4, [
|
||||
"Default: 1963500",
|
||||
"This is the maximum frequency for the CPU you can set in sys-clk-ocs2.",
|
||||
"The value for this setting is capped at 2907MHz",
|
||||
"Anything above 1963MHz is unsafe without undervolting"
|
||||
], 1963, [204, 2907], 1, !1),
|
||||
"The value for this setting is capped at 2091mhz for Erista units and 2907MHz for Mariko units",
|
||||
"Anything above 1785MHz for Erista units and 1963MHz for Mariko units is unsafe without undervolting"
|
||||
], 1963500, [204000, 2907000], 1, !1),
|
||||
|
||||
new CustEntry("gpuMaxFreq", "Mariko Maximum allowed GPU Frequency (MHz)", CustPlatform.Mariko, 4, [
|
||||
"Default: 1267",
|
||||
new CustEntry("gpuMaxFreq", "Maximum allowed GPU Frequency (KHz)", CustPlatform.All, 4, [
|
||||
"Default: 1267200",
|
||||
"This is the maximum frequency for the GPU you can set in sys-clk-ocs2.",
|
||||
"The value for this setting is capped at 998mhz",
|
||||
"The maximum safe value without undervolt is 1152MHz"
|
||||
], 1152, [76, 1305], 1, !1),
|
||||
|
||||
new CustEntry("EcpuMaxFreq", "Erista Maximum allowed CPU Frequency (MHz)", CustPlatform.Erista, 4, [
|
||||
"Default: 1785",
|
||||
"This is the maximum frequency for the CPU you can set in sys-clk-ocs2.",
|
||||
"The value for this setting is capped at 2091mhz",
|
||||
"Anything above 1785MHz is unsafe without undervolting"
|
||||
], 1785, [204, 2091], 1, !1),
|
||||
|
||||
new CustEntry("EgpuMaxFreq", "Erista Maximum allowed GPU Frequency (MHz)", CustPlatform.Erista, 4, [
|
||||
"Default: 921",
|
||||
"This is the maximum frequency for the GPU you can set in sys-clk-ocs2.",
|
||||
"The value for this setting is capped at 998mhz",
|
||||
"The maximum safe value without undervolt is 921MHz"
|
||||
], 921, [76, 998], 1, !1),
|
||||
|
||||
"The value for this setting is capped at 998mhz for Erista units, and 1305MHz on Mariko units",
|
||||
"The maximum safe value without undervolt is 844MHz for Erista units and 1152MHz for Mariko units"
|
||||
], 1152000, [76800, 1305600], 1, !1),
|
||||
];
|
||||
|
||||
var AdvTable = [
|
||||
@@ -252,7 +231,7 @@ var AdvTable = [
|
||||
], 1, [0, 6], 1),
|
||||
|
||||
new AdvEntry("ramTimingPresetTwo", "Secondary RAM Timing Preset", CustPlatform.All, 4, [
|
||||
"<b>WARNING</b>: Unstable timings can corrupt your nand",
|
||||
"WARNING: Unstable timings can corrupt your nand",
|
||||
"Secondary Timing Preset for both AUTO_ADJ and CUSTOM_ADJ",
|
||||
"Values are : tRRD - tFAW",
|
||||
"<b>0</b> : Do Not Adjust (2400Mhz: 6.6 - 26.6) (CUST_ADJ only)",
|
||||
@@ -264,7 +243,7 @@ var AdvTable = [
|
||||
], 1, [0, 5], 1),
|
||||
|
||||
new AdvEntry("ramTimingPresetThree", "Secondary RAM Timing Preset", CustPlatform.All, 4, [
|
||||
"<b>WARNING</b>: Unstable timings can corrupt your nand",
|
||||
"WARNING: Unstable timings can corrupt your nand",
|
||||
"Secondary Timing Preset for both AUTO_ADJ and CUSTOM_ADJ",
|
||||
"Values are : tWR - tRTP",
|
||||
"<b>0</b> : Do Not Adjust (2400Mhz: ?? - 5) (CUST_ADJ only)",
|
||||
@@ -277,7 +256,7 @@ var AdvTable = [
|
||||
], 1, [0, 6], 1),
|
||||
|
||||
new AdvEntry("ramTimingPresetFour", "Secondary RAM Timing Preset", CustPlatform.All, 4, [
|
||||
"<b>WARNING</b>: Unstable timings can corrupt your nand",
|
||||
"WARNING: Unstable timings can corrupt your nand",
|
||||
"Secondary Timing Preset for both AUTO_ADJ and CUSTOM_ADJ",
|
||||
"Values are : tRFC",
|
||||
"<b>0</b> : Do Not Adjust (2400Mhz: 93.3) (CUST_ADJ only)",
|
||||
@@ -290,7 +269,7 @@ var AdvTable = [
|
||||
], 1, [0, 6], 1),
|
||||
|
||||
new AdvEntry("ramTimingPresetFive", "Secondary RAM Timing Preset", CustPlatform.All, 4, [
|
||||
"<b>WARNING</b>: Unstable timings can corrupt your nand",
|
||||
"WARNING: Unstable timings can corrupt your nand",
|
||||
"Secondary Timing Preset for both AUTO_ADJ and CUSTOM_ADJ",
|
||||
"Values are : tWTR",
|
||||
"<b>0</b> : Do Not Adjust (2400Mhz: ??) (CUST_ADJ only)",
|
||||
@@ -303,7 +282,7 @@ var AdvTable = [
|
||||
], 1, [0, 6], 1),
|
||||
|
||||
new AdvEntry("ramTimingPresetSix", "Tertiary RAM Timing Preset", CustPlatform.All, 4, [
|
||||
"<b>WARNING</b>: Unstable timings can corrupt your nand",
|
||||
"WARNING: Unstable timings can corrupt your nand",
|
||||
"Tertiary Timing Preset for both AUTO_ADJ and CUSTOM_ADJ",
|
||||
"Values are : tREFpb",
|
||||
"<b>0</b> : Do Not Adjust (2400Mhz: 325) (CUST_ADJ only)",
|
||||
@@ -315,7 +294,7 @@ var AdvTable = [
|
||||
], 1, [0, 5], 1),
|
||||
|
||||
new AdvEntry("ramTimingPresetSeven", "Latency Decrement", CustPlatform.All, 4, [
|
||||
"<b>WARNING</b>: Unstable timings can corrupt your nand",
|
||||
"WARNING: Unstable timings can corrupt your nand",
|
||||
"Latency decrement for both AUTO_ADJ and CUSTOM_ADJ",
|
||||
"This preset decreases Write/Read related delays. Values are Write - Read",
|
||||
"<b>0</b> : 0 - 0, Do Not Adjust for CUST_ADJ",
|
||||
@@ -342,11 +321,11 @@ var GpuTable = [
|
||||
new GpuEntry("10", "844.8"),
|
||||
new GpuEntry("11", "921.6"),
|
||||
new GpuEntry("12", "998.4"),
|
||||
new GpuEntry("13", "1075.2", CustPlatform.Mariko),
|
||||
new GpuEntry("14", "1152.0", CustPlatform.Mariko),
|
||||
new GpuEntry("15", "1228.8", CustPlatform.Mariko),
|
||||
new GpuEntry("16", "1267.2", CustPlatform.Mariko),
|
||||
new GpuEntry("17", "1305.6 <b>(UNSAFE)</b>", CustPlatform.Mariko)
|
||||
new GpuEntry("13", "1075.2"),
|
||||
new GpuEntry("14", "1152.0"),
|
||||
new GpuEntry("15", "1228.8"),
|
||||
new GpuEntry("16", "1267.2"),
|
||||
new GpuEntry("17", "1305.6 (UNSAFE)")
|
||||
];
|
||||
|
||||
class ErrorToolTip {
|
||||
@@ -491,7 +470,7 @@ class Cust {
|
||||
}
|
||||
parse() {
|
||||
let e = this.beginOffset + this.magicLen;
|
||||
if (this.rev = this.mapper[4].get(e), CUST_REV_ADV != this.rev) throw new Error(`Unsupported custRev, expected: 1, got ${this.rev}`);
|
||||
if (this.rev = this.mapper[4].get(e), 1 != this.rev) throw new Error(`Unsupported custRev, expected: 1, got ${this.rev}`);
|
||||
e += 4, document.getElementById("cust_rev").innerHTML = `Cust v${this.rev} is loaded.`;
|
||||
let t = t => {
|
||||
var i;
|
||||
|
||||
Reference in New Issue
Block a user