From d84c8f8601d1f8fad006cb2844caadf8dbd69962 Mon Sep 17 00:00:00 2001 From: Lijian Zhao Date: Fri, 12 May 2017 17:21:57 -0700 Subject: soc/intel/common: Add sanity check of PCR_BASE_ADDRESS PCR_BASE_ADRESS may be zero if SOC Kconfig didn't define the non zero default value. TEST=Remove the PCR_BASE_ADDRESS config in Apollolake Kconfig file and build. BUG=None Change-Id: I396aa1a3e89507c90e17229a986de5d2c0887c9c Signed-off-by: Lijian Zhao Reviewed-on: https://review.coreboot.org/19684 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Aaron Durbin --- src/soc/intel/common/block/pcr/pcr.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/soc/intel') diff --git a/src/soc/intel/common/block/pcr/pcr.c b/src/soc/intel/common/block/pcr/pcr.c index 6560a4b337..4264cdf5f9 100644 --- a/src/soc/intel/common/block/pcr/pcr.c +++ b/src/soc/intel/common/block/pcr/pcr.c @@ -18,6 +18,10 @@ #include #include +#if !defined(CONFIG_PCR_BASE_ADDRESS) || (CONFIG_PCR_BASE_ADDRESS == 0) +#error "PCR_BASE_ADDRESS need to be non-zero!" +#endif + static void *__pcr_reg_address(uint8_t pid, uint16_t offset) { uintptr_t reg_addr; -- cgit v1.2.3