Fix tW2R and tR2W patch and multiple ram freqs

This commit is contained in:
souldbminersmwc
2025-09-24 15:38:08 -04:00
parent 8845dc862d
commit 49f3e73b10
19 changed files with 47 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* Copyright (c) 2023 hanai3Bi
*
@@ -40,7 +40,7 @@ volatile CustomizeTable C = {
* Value should be divided evenly by 12'500.
* Not enabled by default.
*/
.commonEmcMemVolt = 1237500,
.commonEmcMemVolt = 1175000,
/* Erista CPU:
* - Max Voltage in mV
@@ -57,11 +57,11 @@ volatile CustomizeTable C = {
* - NAND corruption
*/
.eristaEmcClock1 = 1862400, // Lowest
.eristaEmcClock1 = 1996800, // Lowest
.eristaEmcClock2 = 1996800, // Middle
.eristaEmcClock2 = 2032640, // Middle
.eristaEmcClock3 = 2132640, // Highest
.eristaEmcClock3 = 2232640, // Highest
/* Mariko CPU:

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* Copyright (c) 2023 hanai3Bi
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* Copyright (c) 2023 hanai3Bi
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* Copyright (c) 2023 hanai3Bi
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* Copyright (c) 2023 hanai3Bi
*
@@ -161,8 +161,8 @@
table->burst_mc_regs.mc_emem_arb_timing_rrd = CEIL(GET_CYCLE_CEIL(tRRD) / MC_ARB_DIV) - 1;
table->burst_mc_regs.mc_emem_arb_timing_rap2pre = CEIL(GET_CYCLE_CEIL(tRTP) / MC_ARB_DIV);
table->burst_mc_regs.mc_emem_arb_timing_wap2pre = CEIL(WTP / MC_ARB_DIV);
// table->burst_mc_regs.mc_emem_arb_timing_r2r = CEIL(table->burst_regs.emc_rext / MC_ARB_DIV) - 1 + MC_ARB_SFA;
// table->burst_mc_regs.mc_emem_arb_timing_w2w = CEIL(table->burst_regs.emc_wext / MC_ARB_DIV) - 1 + MC_ARB_SFA;
table->burst_mc_regs.mc_emem_arb_timing_r2r = CEIL(table->burst_regs.emc_rext / MC_ARB_DIV) - 1 + MC_ARB_SFA; // ocs does not patch this
table->burst_mc_regs.mc_emem_arb_timing_w2w = CEIL(table->burst_regs.emc_wext / MC_ARB_DIV) - 1 + MC_ARB_SFA;
table->burst_mc_regs.mc_emem_arb_timing_r2w = CEIL(R2W / MC_ARB_DIV) - 1 + MC_ARB_SFA;
table->burst_mc_regs.mc_emem_arb_timing_w2r = CEIL(W2R / MC_ARB_DIV) - 1 + MC_ARB_SFA;
table->burst_mc_regs.mc_emem_arb_timing_rfcpb = CEIL(GET_CYCLE_CEIL(tRFCpb) / MC_ARB_DIV);
@@ -257,9 +257,9 @@
R_UNLESS(table_list[i]->rev == MTC_TABLE_REV, ldr::ResultInvalidMtcTable());
}
if (C.eristaEmcClock1 <= EmcClkOSLimit ||
C.eristaEmcClock2 <= EmcClkOSLimit ||
C.eristaEmcClock3 <= EmcClkOSLimit)
if (C.eristaEmcClock1 >= EmcClkOSLimit ||
C.eristaEmcClock2 >= EmcClkOSLimit ||
C.eristaEmcClock3 >= EmcClkOSLimit)
R_SKIP();
// Make room for three new mtc tables, discarding useless 40.8, 68.0, and 102 MHz tables
@@ -278,11 +278,11 @@
u32 *patch_ptr2 = ptr - sizeof(EristaMtcTable) / sizeof(u32);
u32 *patch_ptr3 = ptr - 2 * (sizeof(EristaMtcTable) / sizeof(u32));
if (C.eristaEmcClock3 > EmcClkOSLimit)
if (C.eristaEmcClock3 < EmcClkOSLimit)
PATCH_OFFSET(patch_ptr1, C.eristaEmcClock3);
if (C.eristaEmcClock2 > EmcClkOSLimit)
if (C.eristaEmcClock2 < EmcClkOSLimit)
PATCH_OFFSET(patch_ptr2, C.eristaEmcClock2);
if (C.eristaEmcClock3 > EmcClkOSLimit)
if (C.eristaEmcClock3 < EmcClkOSLimit)
PATCH_OFFSET(patch_ptr3, C.eristaEmcClock1);
// Handle customize table replacement

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* Copyright (c) 2023 hanai3Bi
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) Switch-OC-Suite
* Copyright (c) Horizon OC Contributors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,