add t2 trp cap
This commit is contained in:
@@ -42,7 +42,7 @@ volatile CustomizeTable C = {
|
|||||||
|
|
||||||
/* Available: 66MHz step rate, 100MHz step rate and jedec. */
|
/* Available: 66MHz step rate, 100MHz step rate and jedec. */
|
||||||
/* Jedec freqs are 1333MHz, 1600MHz, 1866MHz, 2133MHz, 2400MHz, 2666MHz, 2933MHz, 3200MHz. */
|
/* Jedec freqs are 1333MHz, 1600MHz, 1866MHz, 2133MHz, 2400MHz, 2666MHz, 2933MHz, 3200MHz. */
|
||||||
.stepMode = StepMode_Jedec,
|
.stepMode = StepMode_66MHz,
|
||||||
|
|
||||||
.marikoEmcMaxClock = 2933000, /* 1866MHz @ 1866tWRL is guaranteed to work on all Mariko units */
|
.marikoEmcMaxClock = 2933000, /* 1866MHz @ 1866tWRL is guaranteed to work on all Mariko units */
|
||||||
.marikoEmcVddqVolt = 600000,
|
.marikoEmcVddqVolt = 600000,
|
||||||
@@ -50,7 +50,7 @@ volatile CustomizeTable C = {
|
|||||||
|
|
||||||
// Primary
|
// Primary
|
||||||
.t1_tRCD = 0,
|
.t1_tRCD = 0,
|
||||||
.t2_tRP = 0,
|
.t2_tRP = 4,
|
||||||
.t3_tRAS = 0,
|
.t3_tRAS = 0,
|
||||||
// Secondary
|
// Secondary
|
||||||
.t4_tRRD = 0,
|
.t4_tRRD = 0,
|
||||||
@@ -59,6 +59,8 @@ volatile CustomizeTable C = {
|
|||||||
.t7_tWTR = 0,
|
.t7_tWTR = 0,
|
||||||
.t8_tREFI = 0,
|
.t8_tREFI = 0,
|
||||||
|
|
||||||
|
.t2_tRP_cap = 2,
|
||||||
|
|
||||||
.readLatency = {
|
.readLatency = {
|
||||||
2133000,
|
2133000,
|
||||||
2400000,
|
2400000,
|
||||||
|
|||||||
@@ -103,6 +103,8 @@ typedef struct CustomizeTable {
|
|||||||
u32 t7_tWTR;
|
u32 t7_tWTR;
|
||||||
u32 t8_tREFI;
|
u32 t8_tREFI;
|
||||||
|
|
||||||
|
u32 t2_tRP_cap;
|
||||||
|
|
||||||
u32 readLatency[4];
|
u32 readLatency[4];
|
||||||
u32 writeLatency[4];
|
u32 writeLatency[4];
|
||||||
|
|
||||||
|
|||||||
@@ -127,13 +127,39 @@ namespace ams::ldr::hoc::pcv::mariko {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CalculateTimings(double tCK_avg, u32 freq) {
|
void CalculateTimings(double tCK_avg, u32 freq) {
|
||||||
RL = 28;
|
RL = RL_1331;
|
||||||
WL = 12;
|
WL = WL_1331;
|
||||||
|
|
||||||
HandleLatency(freq);
|
HandleLatency(freq);
|
||||||
|
|
||||||
GetRext();
|
GetRext();
|
||||||
|
|
||||||
|
/* At 1333WL, for some reason (incorrect ram timing config in mtc table?), tRP causes crashes at high reductions - 2 seems to be the most common limit. */
|
||||||
|
/* This is a lazy workaround until I find the issue... */
|
||||||
|
u32 tRPpbIndex = C.t2_tRP;
|
||||||
|
if (WL == WL_1331) {
|
||||||
|
tRPpbIndex = MIN(C.t2_tRP_cap, C.t2_tRP);
|
||||||
|
}
|
||||||
|
|
||||||
|
tRCD = tRCD_values[C.t1_tRCD];
|
||||||
|
tRPpb = tRP_values[tRPpbIndex];
|
||||||
|
tRAS = tRAS_values[C.t3_tRAS];
|
||||||
|
tRRD = tRRD_values[C.t4_tRRD];
|
||||||
|
tRFCpb = tRFC_values[C.t5_tRFC];
|
||||||
|
u32 tWTR = 10 - tWTR_values[C.t7_tWTR];
|
||||||
|
s32 finetRTW = C.fineTune_t6_tRTW;
|
||||||
|
s32 finetWTR = C.fineTune_t7_tWTR;
|
||||||
|
|
||||||
|
Log("Freq: %u\n", freq);
|
||||||
|
Log("WL: %u\n", WL);
|
||||||
|
Log("tRP value: %u\n\n", tRPpb);
|
||||||
|
|
||||||
|
tRC = tRAS + tRPpb;
|
||||||
|
tRFCab = tRFCpb * 2;
|
||||||
|
tXSR = static_cast<double>(tRFCab + 7.5);
|
||||||
|
tFAW = static_cast<u32>(tRRD * 4.0);
|
||||||
|
tRPab = tRPpb + 3;
|
||||||
|
|
||||||
tR2P = CEIL((RL * 0.426) - 2.0);
|
tR2P = CEIL((RL * 0.426) - 2.0);
|
||||||
tR2W = FLOOR(FLOOR((5.0 / tCK_avg) + ((FLOOR(48.0 / WL) - 0.478) * 3.0)) / 1.501) + RL - (C.t6_tRTW * 3) + finetRTW;
|
tR2W = FLOOR(FLOOR((5.0 / tCK_avg) + ((FLOOR(48.0 / WL) - 0.478) * 3.0)) / 1.501) + RL - (C.t6_tRTW * 3) + finetRTW;
|
||||||
tRTM = FLOOR((10.0 + RL) + (3.502 / tCK_avg)) + FLOOR(7.489 / tCK_avg);
|
tRTM = FLOOR((10.0 + RL) + (3.502 / tCK_avg)) + FLOOR(7.489 / tCK_avg);
|
||||||
|
|||||||
@@ -111,20 +111,17 @@ namespace ams::ldr::hoc {
|
|||||||
const std::array<u32, 10> tWTR_values = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
|
const std::array<u32, 10> tWTR_values = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
|
||||||
const std::array<u32, 6> tREFpb_values = { 3900, 5850, 7800, 11700, 15600, 99999 };
|
const std::array<u32, 6> tREFpb_values = { 3900, 5850, 7800, 11700, 15600, 99999 };
|
||||||
|
|
||||||
const u32 tRCD = tRCD_values[C.t1_tRCD];
|
inline u32 tRCD;
|
||||||
const u32 tRPpb = tRP_values[C.t2_tRP];
|
inline u32 tRPpb;
|
||||||
const u32 tRAS = tRAS_values[C.t3_tRAS];
|
inline u32 tRAS;
|
||||||
const double tRRD = tRRD_values[C.t4_tRRD];
|
inline double tRRD;
|
||||||
const u32 tRFCpb = tRFC_values[C.t5_tRFC];
|
inline u32 tRFCpb;
|
||||||
const u32 tWTR = 10 - tWTR_values[C.t7_tWTR];
|
|
||||||
const s32 finetRTW = C.fineTune_t6_tRTW;
|
|
||||||
const s32 finetWTR = C.fineTune_t7_tWTR;
|
|
||||||
|
|
||||||
const u32 tRC = tRAS + tRPpb;
|
inline u32 tRC;
|
||||||
const u32 tRFCab = tRFCpb * 2;
|
inline u32 tRFCab;
|
||||||
const double tXSR = static_cast<double>(tRFCab + 7.5);
|
inline double tXSR;
|
||||||
const u32 tFAW = static_cast<u32>(tRRD * 4.0);
|
inline u32 tFAW;
|
||||||
const double tRPab = tRPpb + 3;
|
inline double tRPab;
|
||||||
|
|
||||||
inline u32 RL;
|
inline u32 RL;
|
||||||
inline u32 WL;
|
inline u32 WL;
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ typedef enum {
|
|||||||
KipConfigValue_t7_tWTR,
|
KipConfigValue_t7_tWTR,
|
||||||
KipConfigValue_t8_tREFI,
|
KipConfigValue_t8_tREFI,
|
||||||
|
|
||||||
|
KipConfigValue_t2_tRP_cap,
|
||||||
|
|
||||||
KipConfigValue_read_latency_1333,
|
KipConfigValue_read_latency_1333,
|
||||||
KipConfigValue_read_latency_1600,
|
KipConfigValue_read_latency_1600,
|
||||||
KipConfigValue_read_latency_1866,
|
KipConfigValue_read_latency_1866,
|
||||||
@@ -323,6 +325,9 @@ static inline const char* hocclkFormatConfigValue(HocClkConfigValue val, bool pr
|
|||||||
case KipConfigValue_t8_tREFI:
|
case KipConfigValue_t8_tREFI:
|
||||||
return pretty ? "t8 - tREFI" : "t8_trefi";
|
return pretty ? "t8 - tREFI" : "t8_trefi";
|
||||||
|
|
||||||
|
case KipConfigValue_t2_tRP_cap:
|
||||||
|
return pretty ? "t2 - trp 1333WL Cap" : "t2_tRP_cap";
|
||||||
|
|
||||||
case KipConfigValue_read_latency_1333:
|
case KipConfigValue_read_latency_1333:
|
||||||
return pretty ? "1333 Read Latency" : "read_latency_1333";
|
return pretty ? "1333 Read Latency" : "read_latency_1333";
|
||||||
case KipConfigValue_read_latency_1600:
|
case KipConfigValue_read_latency_1600:
|
||||||
@@ -558,6 +563,7 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in
|
|||||||
case KipConfigValue_t6_tRTW:
|
case KipConfigValue_t6_tRTW:
|
||||||
case KipConfigValue_t7_tWTR:
|
case KipConfigValue_t7_tWTR:
|
||||||
case KipConfigValue_t8_tREFI:
|
case KipConfigValue_t8_tREFI:
|
||||||
|
case KipConfigValue_t2_tRP_cap:
|
||||||
case KipConfigValue_read_latency_1333:
|
case KipConfigValue_read_latency_1333:
|
||||||
case KipConfigValue_read_latency_1600:
|
case KipConfigValue_read_latency_1600:
|
||||||
case KipConfigValue_read_latency_1866:
|
case KipConfigValue_read_latency_1866:
|
||||||
|
|||||||
@@ -1032,6 +1032,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
this->listElement->addItem(new tsl::elm::CategoryHeader("Advanced"));
|
this->listElement->addItem(new tsl::elm::CategoryHeader("Advanced"));
|
||||||
|
addConfigButton(KipConfigValue_t2_tRP_cap, "1333WL t2 RP Cap", ValueRange(0, 8, 1, "", 1), "tRP Cap", &thresholdsDisabled, {}, {}, false, true );
|
||||||
addConfigButton(KipConfigValue_t6_tRTW_fine_tune, "t6 tRTW Fine Tune", ValueRange(0, 4, 1, "", 0), "tRTW Fine Tune", &thresholdsDisabled, {}, t6_tRTW_fine_tune, false, true);
|
addConfigButton(KipConfigValue_t6_tRTW_fine_tune, "t6 tRTW Fine Tune", ValueRange(0, 4, 1, "", 0), "tRTW Fine Tune", &thresholdsDisabled, {}, t6_tRTW_fine_tune, false, true);
|
||||||
addConfigButton(KipConfigValue_t7_tWTR_fine_tune, "t7 tWTR Fine Tune", ValueRange(0, 6, 1, "", 0), "tWTR Fine Tune", &thresholdsDisabled, {}, t7_tWTR_fine_tune, false, true);
|
addConfigButton(KipConfigValue_t7_tWTR_fine_tune, "t7 tWTR Fine Tune", ValueRange(0, 6, 1, "", 0), "tWTR Fine Tune", &thresholdsDisabled, {}, t7_tWTR_fine_tune, false, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ namespace kip {
|
|||||||
CUST_WRITE_FIELD_BATCH(&table, t7_tWTR, config::GetConfigValue(KipConfigValue_t7_tWTR));
|
CUST_WRITE_FIELD_BATCH(&table, t7_tWTR, config::GetConfigValue(KipConfigValue_t7_tWTR));
|
||||||
CUST_WRITE_FIELD_BATCH(&table, t8_tREFI, config::GetConfigValue(KipConfigValue_t8_tREFI));
|
CUST_WRITE_FIELD_BATCH(&table, t8_tREFI, config::GetConfigValue(KipConfigValue_t8_tREFI));
|
||||||
CUST_WRITE_FIELD_BATCH(&table, stepMode, config::GetConfigValue(KipConfigValue_stepMode));
|
CUST_WRITE_FIELD_BATCH(&table, stepMode, config::GetConfigValue(KipConfigValue_stepMode));
|
||||||
|
CUST_WRITE_FIELD_BATCH(&table, t2_tRP_cap, config::GetConfigValue(KipConfigValue_t2_tRP_cap));
|
||||||
|
|
||||||
CUST_WRITE_FIELD_BATCH(&table, readLatency1333, config::GetConfigValue(KipConfigValue_read_latency_1333));
|
CUST_WRITE_FIELD_BATCH(&table, readLatency1333, config::GetConfigValue(KipConfigValue_read_latency_1333));
|
||||||
CUST_WRITE_FIELD_BATCH(&table, readLatency1600, config::GetConfigValue(KipConfigValue_read_latency_1600));
|
CUST_WRITE_FIELD_BATCH(&table, readLatency1600, config::GetConfigValue(KipConfigValue_read_latency_1600));
|
||||||
@@ -201,6 +202,8 @@ namespace kip {
|
|||||||
configValues.values[KipConfigValue_t8_tREFI] = cust_get_tREFI(&table);
|
configValues.values[KipConfigValue_t8_tREFI] = cust_get_tREFI(&table);
|
||||||
configValues.values[KipConfigValue_stepMode] = cust_get_step_mode(&table);
|
configValues.values[KipConfigValue_stepMode] = cust_get_step_mode(&table);
|
||||||
|
|
||||||
|
configValues.values[KipConfigValue_t2_tRP_cap] = cust_get_tRP_cap(&table);
|
||||||
|
|
||||||
configValues.values[KipConfigValue_read_latency_1333] = cust_get_read_latency_1333(&table);
|
configValues.values[KipConfigValue_read_latency_1333] = cust_get_read_latency_1333(&table);
|
||||||
configValues.values[KipConfigValue_read_latency_1600] = cust_get_read_latency_1600(&table);
|
configValues.values[KipConfigValue_read_latency_1600] = cust_get_read_latency_1600(&table);
|
||||||
configValues.values[KipConfigValue_read_latency_1866] = cust_get_read_latency_1866(&table);
|
configValues.values[KipConfigValue_read_latency_1866] = cust_get_read_latency_1866(&table);
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ namespace kip {
|
|||||||
u32 t7_tWTR;
|
u32 t7_tWTR;
|
||||||
u32 t8_tREFI;
|
u32 t8_tREFI;
|
||||||
|
|
||||||
|
u32 t2_tRP_cap;
|
||||||
|
|
||||||
/* These latencies are arrays in loader, but it's easier to handle it this way in the configurator. */
|
/* These latencies are arrays in loader, but it's easier to handle it this way in the configurator. */
|
||||||
u32 readLatency1333, readLatency1600, readLatency1866, readLatency2133;
|
u32 readLatency1333, readLatency1600, readLatency1866, readLatency2133;
|
||||||
u32 writeLatency1333, writeLatency1600, writeLatency1866, writeLatency2133;
|
u32 writeLatency1333, writeLatency1600, writeLatency1866, writeLatency2133;
|
||||||
@@ -219,6 +221,7 @@ namespace kip {
|
|||||||
static inline bool cust_set_tRTW(const char* p, u32 v) { CUST_WRITE_FIELD(p, t6_tRTW, v); }
|
static inline bool cust_set_tRTW(const char* p, u32 v) { CUST_WRITE_FIELD(p, t6_tRTW, v); }
|
||||||
static inline bool cust_set_tWTR(const char* p, u32 v) { CUST_WRITE_FIELD(p, t7_tWTR, v); }
|
static inline bool cust_set_tWTR(const char* p, u32 v) { CUST_WRITE_FIELD(p, t7_tWTR, v); }
|
||||||
static inline bool cust_set_tREFI(const char* p, u32 v) { CUST_WRITE_FIELD(p, t8_tREFI, v); }
|
static inline bool cust_set_tREFI(const char* p, u32 v) { CUST_WRITE_FIELD(p, t8_tREFI, v); }
|
||||||
|
static inline bool cust_set_tRP_cap(const char* p, u32 v) { CUST_WRITE_FIELD(p, t2_tRP_cap, v); }
|
||||||
static inline bool cust_set_tRTW_fine_tune(const char* p, u32 v) { CUST_WRITE_FIELD(p, t6_tRTW_fine_tune, v); }
|
static inline bool cust_set_tRTW_fine_tune(const char* p, u32 v) { CUST_WRITE_FIELD(p, t6_tRTW_fine_tune, v); }
|
||||||
static inline bool cust_set_tWTR_fine_tune(const char* p, u32 v) { CUST_WRITE_FIELD(p, t7_tWTR_fine_tune, v); }
|
static inline bool cust_set_tWTR_fine_tune(const char* p, u32 v) { CUST_WRITE_FIELD(p, t7_tWTR_fine_tune, v); }
|
||||||
|
|
||||||
@@ -302,6 +305,7 @@ namespace kip {
|
|||||||
static inline u32 cust_get_tRTW(const CustomizeTable* t) { return CUST_GET_FIELD(t, t6_tRTW); }
|
static inline u32 cust_get_tRTW(const CustomizeTable* t) { return CUST_GET_FIELD(t, t6_tRTW); }
|
||||||
static inline u32 cust_get_tWTR(const CustomizeTable* t) { return CUST_GET_FIELD(t, t7_tWTR); }
|
static inline u32 cust_get_tWTR(const CustomizeTable* t) { return CUST_GET_FIELD(t, t7_tWTR); }
|
||||||
static inline u32 cust_get_tREFI(const CustomizeTable* t) { return CUST_GET_FIELD(t, t8_tREFI); }
|
static inline u32 cust_get_tREFI(const CustomizeTable* t) { return CUST_GET_FIELD(t, t8_tREFI); }
|
||||||
|
static inline u32 cust_get_tRP_cap(const CustomizeTable* t) { return CUST_GET_FIELD(t, t2_tRP_cap); }
|
||||||
static inline u32 cust_get_tRTW_fine_tune(const CustomizeTable* t) { return CUST_GET_FIELD(t, t6_tRTW_fine_tune); }
|
static inline u32 cust_get_tRTW_fine_tune(const CustomizeTable* t) { return CUST_GET_FIELD(t, t6_tRTW_fine_tune); }
|
||||||
static inline u32 cust_get_tWTR_fine_tune(const CustomizeTable* t) { return CUST_GET_FIELD(t, t7_tWTR_fine_tune); }
|
static inline u32 cust_get_tWTR_fine_tune(const CustomizeTable* t) { return CUST_GET_FIELD(t, t7_tWTR_fine_tune); }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user