Add comment about 2133BL being incorrect for erista; do I hate myself enough to fix?

This commit is contained in:
Lightos1
2025-10-24 07:40:41 +02:00
parent d9f4c2c46c
commit 31ea468b49

View File

@@ -163,9 +163,9 @@ namespace ams::ldr::oc::pcv::erista {
R_SUCCEED(); R_SUCCEED();
} }
/* This is not done properly, this is not scaled correctly. */
/* It is fixable of course, but I don't know if I hate myself enough to fix it, especially considering erista does not benefit much from proper timings. */
/* This currently patches a lot of unwanted extra stuff that needs to be removed. */ /* This currently patches a lot of unwanted extra stuff that needs to be removed. */
/* Additionally, timing reductions have possible improvements. */
/* Note: I don't even know if this patches 2133BL or 1866BL, but I assume 2133BL. */
void MemMtcTableAutoAdjustBaseLatency(EristaMtcTable *table) { void MemMtcTableAutoAdjustBaseLatency(EristaMtcTable *table) {
using namespace pcv::erista; using namespace pcv::erista;
#define WRITE_PARAM_ALL_REG(TABLE, PARAM, VALUE) \ #define WRITE_PARAM_ALL_REG(TABLE, PARAM, VALUE) \
@@ -415,19 +415,7 @@ namespace ams::ldr::oc::pcv::erista {
table->burst_mc_regs.mc_emem_arb_timing_r2w = (uint) (((double) ((uint) tR2W >> 2) - 1.0) + 2.0); table->burst_mc_regs.mc_emem_arb_timing_r2w = (uint) (((double) ((uint) tR2W >> 2) - 1.0) + 2.0);
table->burst_mc_regs.mc_emem_arb_timing_w2r = (uint) (((double) (tW2R >> 2) - 1.0) + 2.0); table->burst_mc_regs.mc_emem_arb_timing_w2r = (uint) (((double) (tW2R >> 2) - 1.0) + 2.0);
u32 mc_r2r = table->burst_mc_regs.mc_emem_arb_timing_r2r; table->burst_mc_regs.mc_emem_arb_da_turns = (val & 0x0000FFFF) | (tW2R << 24) | (tR2W << 16);
if (mc_r2r > 1) {
mc_r2r = (uint) (((double) (long) ((double) rext * 0.25) - 1.0) + 2.0);
table->burst_mc_regs.mc_emem_arb_timing_r2r = mc_r2r;
}
u32 mc_w2w = table->burst_mc_regs.mc_emem_arb_timing_w2w;
if (mc_w2w > 1) {
mc_w2w = (uint) (((double) (long) ((double) wext / 4.0) - 1.0) + 2.0);
table->burst_mc_regs.mc_emem_arb_timing_w2w = mc_w2w;
}
table->burst_mc_regs.mc_emem_arb_da_turns = ((mc_tW2R >> 1) << 0x18) | ((mc_tR2W >> 1) << 0x10) | ((mc_r2r >> 1) << 8) | ((mc_w2w >> 1));
table->burst_mc_regs.mc_emem_arb_da_covers = (((uint) (mc_tRCD + 3 + mc_tRPpb) >> 1 & 0xff) << 8) | (((uint) (mc_tRCD + 11 + mc_tRPpb) >> 1 & 0xff) << 0x10) | ((mc_tRC >> 1) & 0xff); table->burst_mc_regs.mc_emem_arb_da_covers = (((uint) (mc_tRCD + 3 + mc_tRPpb) >> 1 & 0xff) << 8) | (((uint) (mc_tRCD + 11 + mc_tRPpb) >> 1 & 0xff) << 0x10) | ((mc_tRC >> 1) & 0xff);
table->burst_mc_regs.mc_emem_arb_misc0 = (table->burst_mc_regs.mc_emem_arb_misc0 & 0xffe08000U) | ((mc_tRC + 1) & 0xff); /* Missing in l4t dump? TODO */ table->burst_mc_regs.mc_emem_arb_misc0 = (table->burst_mc_regs.mc_emem_arb_misc0 & 0xffe08000U) | ((mc_tRC + 1) & 0xff); /* Missing in l4t dump? TODO */
table->burst_mc_regs.mc_emem_arb_timing_rfcpb = GET_CYCLE(tRFCpb) >> 2; table->burst_mc_regs.mc_emem_arb_timing_rfcpb = GET_CYCLE(tRFCpb) >> 2;
@@ -441,7 +429,7 @@ namespace ams::ldr::oc::pcv::erista {
// table->burst_mc_regs.mc_emem_arb_timing_rrd = 0x00000003; // table->burst_mc_regs.mc_emem_arb_timing_rrd = 0x00000003;
table->burst_mc_regs.mc_emem_arb_timing_rap2pre = 0x00000003; table->burst_mc_regs.mc_emem_arb_timing_rap2pre = 0x00000003;
table->burst_mc_regs.mc_emem_arb_timing_wap2pre = 0x0000000d; table->burst_mc_regs.mc_emem_arb_timing_wap2pre = 0x0000000d;
// table->burst_mc_regs.mc_emem_arb_timing_r2r = 0x00000007; table->burst_mc_regs.mc_emem_arb_timing_r2r = 0x00000007;
table->burst_mc_regs.mc_emem_arb_timing_w2w = 0x00000007; table->burst_mc_regs.mc_emem_arb_timing_w2w = 0x00000007;
// table->burst_mc_regs.mc_emem_arb_timing_r2w = 0x0000000c; // table->burst_mc_regs.mc_emem_arb_timing_r2w = 0x0000000c;
// table->burst_mc_regs.mc_emem_arb_timing_w2r = 0x0000000a; // table->burst_mc_regs.mc_emem_arb_timing_w2r = 0x0000000a;