Add config flag (enable_ecc_polling) to toggle ECC polling.

Currently disabled by default for v7 release
This commit is contained in:
Sam Demeulemeester 2023-11-19 17:01:52 +01:00
parent e5200c9b89
commit 2d92fddd02
3 changed files with 41 additions and 34 deletions

View File

@ -99,6 +99,8 @@ bool enable_sm = true;
bool enable_bench = true;
bool enable_mch_read = true;
bool enable_ecc_polling = false;
bool pause_at_start = true;
power_save_t power_save = POWER_SAVE_HIGH;

View File

@ -59,6 +59,7 @@ extern bool enable_sm;
extern bool enable_tty;
extern bool enable_bench;
extern bool enable_mch_read;
extern bool enable_ecc_polling;
extern bool pause_at_start;

View File

@ -8,6 +8,7 @@
#include "error.h"
#include "config.h"
#include "cpuinfo.h"
#include "memctrl.h"
#include "msr.h"
@ -43,7 +44,6 @@ void get_imc_config_amd_zen(void)
{
uint32_t smn_reg, offset;
uint32_t reg_cha, reg_chb;
uint32_t regl, regh;
imc.tCL_dec = 0;
@ -92,6 +92,9 @@ void get_imc_config_amd_zen(void)
// Detect ECC (x64 only)
#if TESTWORD_WIDTH > 32
if (enable_ecc_polling) {
uint32_t regl, regh;
smn_reg = amd_smn_read(AMD_SMN_UMC_DRAM_ECC_CTRL + offset);
if (smn_reg & (ECC_RD_EN | ECC_WR_EN)) {
ecc_status.ecc_enabled = true;
@ -129,6 +132,7 @@ void get_imc_config_amd_zen(void)
poll_ecc_amd_zen(false); // Clear ECC registers
}
}
#endif
}