From 1d9370b3a58ddfcadda0692500e970109bcbb29f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 6 Apr 2016 13:25:09 -0500 Subject: nb/amd/mct_ddr3: Add MCE reporting logic When a fatal error and subsequent sync flood / reset occurs, the MCA status registers may contain valuable information on the cause of the fatal error. Add functions to report MCEs and reset the MCA status registers early in the boot process. Change-Id: Icde1051ac22f93688de1330f5e2c9ce28b14b59a Signed-off-by: Timothy Pearson Reviewed-on: https://review.coreboot.org/14265 Tested-by: build bot (Jenkins) Tested-by: Raptor Engineering Automated Test Stand Reviewed-by: Martin Roth --- src/northbridge/amd/amdmct/mct_ddr3/mct_d.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/northbridge/amd/amdmct/mct_ddr3/mct_d.c') diff --git a/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c b/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c index f31fb3c7e6..bb12746a5c 100644 --- a/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c +++ b/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c @@ -2944,6 +2944,29 @@ fatalexit: die("mct_d: fatalexit"); } +void initialize_mca(uint8_t bsp, uint8_t suppress_errors) { + uint8_t node; + uint32_t mc4_status_high; + uint32_t mc4_status_low; + + for (node = 0; node < MAX_NODES_SUPPORTED; node++) { + if (bsp && (node > 0)) + break; + + mc4_status_high = pci_read_config32(PCI_DEV(0, 0x18 + node, 3), 0x4c); + mc4_status_low = pci_read_config32(PCI_DEV(0, 0x18 + node, 3), 0x48); + if ((mc4_status_high & (0x1 << 31)) && (mc4_status_high != 0xffffffff)) { + if (!suppress_errors) + printk(BIOS_WARNING, "WARNING: MC4 Machine Check Exception detected on node %d!\n" + "Signature: %08x%08x\n", node, mc4_status_high, mc4_status_low); + + /* Clear MC4 error status */ + pci_write_config32(PCI_DEV(0, 0x18 + node, 3), 0x48, 0x0); + pci_write_config32(PCI_DEV(0, 0x18 + node, 3), 0x4c, 0x0); + } + } +} + static u8 ReconfigureDIMMspare_D(struct MCTStatStruc *pMCTstat, struct DCTStatStruc *pDCTstatA) { -- cgit v1.2.3