From f710955b93dddb094b9dacf651fe8a0730b21500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Mon, 24 Jul 2017 03:35:11 +0300 Subject: AGESA f15tn: Fix MemContext buffer parser for AmdInitPost() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Like commit c91ab1cfc that targeted AGESA f14. MemRestore() is still broken after this fix. Change-Id: I7457de5e0c52819560e2bfd46b9e351b00d3d386 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/20900 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Martin Roth --- src/vendorcode/amd/agesa/f15tn/Proc/Mem/Main/mmMemRestore.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vendorcode/amd/agesa/f15tn/Proc/Mem/Main/mmMemRestore.c b/src/vendorcode/amd/agesa/f15tn/Proc/Mem/Main/mmMemRestore.c index ab1ce1a696..346489220e 100644 --- a/src/vendorcode/amd/agesa/f15tn/Proc/Mem/Main/mmMemRestore.c +++ b/src/vendorcode/amd/agesa/f15tn/Proc/Mem/Main/mmMemRestore.c @@ -408,7 +408,9 @@ MemMRestoreDqsTimings ( if (!MemMSetCSRNb (&NBArray[Node], Reg->SpecialCases, PciAddress, *((UINT32 *) OrMask) & Reg->RegisterList[j].AndMask)) { return FALSE; // Restore fails } - OrMask += (Reg->RegisterList[j].Type.RegisterSize == 0) ? 4 : Reg->RegisterList[j].Type.RegisterSize; + if (Reg->RegisterList[j].Type.RegisterSize != 3) + OrMask += (Reg->RegisterList[j].Type.RegisterSize == 0) ? 4 : + Reg->RegisterList[j].Type.RegisterSize; } if (MaxNode < Node) { @@ -431,7 +433,9 @@ MemMRestoreDqsTimings ( if (!MemMSetCSRNb (&NBArray[Node], CReg->SpecialCases, PciAddress, *((UINT32 *) OrMask) & CReg->RegisterList[j].AndMask)) { return FALSE; // Restore fails } - OrMask += (CReg->RegisterList[j].Type.RegisterSize == 0) ? 4 : CReg->RegisterList[j].Type.RegisterSize; + if (CReg->RegisterList[j].Type.RegisterSize != 3) + OrMask += (CReg->RegisterList[j].Type.RegisterSize == 0) ? 4 : + CReg->RegisterList[j].Type.RegisterSize; } } } else if (((State == ST_PRE_ESR) && (Device.CommonDeviceHeader->Type == DEV_TYPE_MSR_PRE_ESR)) || -- cgit v1.2.3