summaryrefslogtreecommitdiff
path: root/src/southbridge/amd/agesa/hudson
diff options
context:
space:
mode:
authorMartin Roth <gaumless@gmail.com>2015-06-28 14:06:23 -0600
committerMartin Roth <gaumless@gmail.com>2015-07-11 22:13:25 +0200
commitd12d65fc54c31ee2635c0249a1d92c2e70bc1498 (patch)
tree53f2ddb1e15bc966ad67255ed8ee314f4abbc90f /src/southbridge/amd/agesa/hudson
parent16bc7e82d8ec9f27955c2291c8ab1dd638a5ca33 (diff)
downloadcoreboot-d12d65fc54c31ee2635c0249a1d92c2e70bc1498.tar.xz
Calculate HUDSON_FWM_POSITION and display warning on mismatch
This patch calculates the address where the chipset firmware descriptor should be located and compares it against the actual value from Kconfig. If the two don't match, it puts up a warning. This could probably replace the config variable completely, but I wanted to see how other people felt before doing that. I seem to recall that the value used to be calculated, so I figure that there must be a reason it's done this way at this point. If we do want to keep the Kconfig setting, this patch could also be modified to just verify that the HUDSON_FWM_POSITION is inside the ROM space. Change-Id: I94addf463e2c694a94eef218ec855103a3bb5da5 Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: http://review.coreboot.org/10682 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/southbridge/amd/agesa/hudson')
-rw-r--r--src/southbridge/amd/agesa/hudson/Makefile.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/southbridge/amd/agesa/hudson/Makefile.inc b/src/southbridge/amd/agesa/hudson/Makefile.inc
index ea86a329e9..425f095de3 100644
--- a/src/southbridge/amd/agesa/hudson/Makefile.inc
+++ b/src/southbridge/amd/agesa/hudson/Makefile.inc
@@ -34,8 +34,13 @@ ramstage-$(CONFIG_HAVE_SMI_HANDLER) += smi.c smi_util.c
# |0x55AA55AA |EC ROM Address |GEC ROM Address |USB3 ROM |
# +-----------+---------------+----------------+------------+
# EC ROM should be 64K aligned.
+
+HUDSON_FWM_POS_CALC=$(call int-add, $(call int-subtract, 0xffffffff $(call int-multiply, $(CONFIG_COREBOOT_ROMSIZE_KB) 1024)) 0x20000 1)
HUDSON_FWM_POSITION=$(shell printf %u $(CONFIG_HUDSON_FWM_POSITION))
+ifneq ($(HUDSON_FWM_POS_CALC), $(HUDSON_FWM_POSITION))
+$(warning ##### WARNING: CONFIG_HUDSON_FWM_POSITION does not match calculated firmware position $(HUDSON_FWM_POS_CALC) != $(HUDSON_FWM_POSITION) ##### )
+endif
#assume the cbfs header is less than 128 bytes.
ROMSIG_SIZE=16
ifeq ($(CONFIG_HUDSON_XHCI_FWM), y)