From 4e0c77aa124f0e12d7252ae3a718a6486a779106 Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Sat, 13 Sep 2025 11:03:51 -0400 Subject: [PATCH] fix tr2ref and logic error --- .../Atmosphere/stratosphere/loader/source/oc/customize.cpp | 7 +++++-- .../Atmosphere/stratosphere/loader/source/oc/customize.hpp | 2 +- .../stratosphere/loader/source/oc/mtc_timing_value.hpp | 4 ++-- .../Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp | 7 ++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp index 4f3b7d45..642061e1 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp @@ -51,7 +51,6 @@ volatile CustomizeTable C = { .tRC = 60, .tWTR = 10, .tWR = 18, -.tR2REF = 26, .tRCD = 18, .tREFpb = 488, .tMRWCKEL = 14, @@ -59,6 +58,7 @@ volatile CustomizeTable C = { .tFAW = 40, // --- double fields --- +.tR2REF = 25.5, .tDQSCK_min = 1.5, .tDQSCK_max = 3.5, .tWPRE = 1.8, @@ -103,6 +103,8 @@ 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: @@ -160,9 +162,10 @@ volatile CustomizeTable C = { { 2397000, { 1702903, -34955, 113 }, { 1235000 } }, { 2499000, { 1754400, -35643, 113 }, { 1235000 } }, { 2601000, { 1805897, -36331, 113 }, { 1235000 } }, - { 2703000, { 1857394, -37019, 113 }, { 1235000 } }, + { 2703000, { 1857394, -37019, 113 }, { 1235000 } }, { 2805000, { 1908891, -37707, 113 }, { 1235000 } }, { 2907000, { 1960388, -38395, 113 }, { 1235000 } }, + }, /* - Erista GPU DVFS Table: diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp index e1a183c7..57597e62 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp @@ -80,7 +80,6 @@ typedef struct CustomizeTable { u32 tRC; u32 tWTR; u32 tWR; - u32 tR2REF; u32 tRCD; u32 tREFpb; u32 tMRWCKEL; @@ -88,6 +87,7 @@ typedef struct CustomizeTable { u32 tFAW; // RAM timings (double) + double tR2REF; double tDQSCK_min; double tDQSCK_max; double tWPRE; diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/mtc_timing_value.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/mtc_timing_value.hpp index e230c5ba..d34a2451 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/mtc_timing_value.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/mtc_timing_value.hpp @@ -66,9 +66,9 @@ namespace ams::ldr::oc { // tCK_avg (average clock period) in ns const double tCK_avg = 1000'000. / C.marikoEmcMaxClock; // Write Latency - const u32 WL = 14 - 2*C.latency; + const u32 WL = 14 + C.latency; // Read Latency - const u32 RL = 32 - 4*C.latency; + const u32 RL = 32 + C.latency; // minimum number of cycles from any read command to any write command, irrespective of bank const u32 R2W = CEIL (RL + CEIL(C.tDQSCK_max/tCK_avg) + C.BL/2 - WL + C.tWPRE + FLOOR(C.tRPST)); diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp index 43838f1f..6f39a376 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp @@ -318,9 +318,6 @@ namespace ams::ldr::oc::pcv case 2: customize_table = const_cast(C.marikoGpuDvfsTableHiOPT); break; - case 3: - customize_table = const_cast(C.marikoGpuDvfsTableUv3); - break; default: customize_table = const_cast(C.marikoGpuDvfsTable); break; @@ -350,10 +347,10 @@ namespace ams::ldr::oc::pcv cvb_entry_t *entry = static_cast(gpu_cvb_table_head); for (size_t i = 0; i < customize_entry_count; i++) { - if (!(C.marikoGpuVoltArray[i] < C.gpuVmin)) + if (C.marikoGpuVoltArray[i] < C.gpuVmin) { u32 patched_voltage = C.marikoGpuVoltArray[i]; - if(!C.gpuVmax) { + if(C.gpuVmax) { if(patched_voltage > C.gpuVmax) { patched_voltage = C.gpuVmax; }