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 <lijian.zhao@intel.com>
Reviewed-on: https://review.coreboot.org/19684
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Lijian Zhao 2017-05-12 17:21:57 -07:00 committed by Aaron Durbin
parent 6b45ee44a9
commit d84c8f8601

View file

@ -18,6 +18,10 @@
#include <intelblocks/pcr.h>
#include <soc/pcr_ids.h>
#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;