UPSTREAM: 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

Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Original-Commit-Id: d84c8f8601
Original-Change-Id: I396aa1a3e89507c90e17229a986de5d2c0887c9c
Original-Signed-off-by: Lijian Zhao <lijian.zhao@intel.com>
Original-Reviewed-on: https://review.coreboot.org/19684
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Change-Id: I35744d6620cb77f36c440efa266e4182799ff61d
Reviewed-on: https://chromium-review.googlesource.com/506905
This commit is contained in:
Lijian Zhao 2017-05-12 17:21:57 -07:00 committed by chrome-bot
parent 3e985d3aad
commit 1b014dbdfe

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;