Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/84108?usp=email )
Change subject: soc/intel/common/systemagent: select CAPID_A, BDSM and BGSM by Kconfig ......................................................................
soc/intel/common/systemagent: select CAPID_A, BDSM and BGSM by Kconfig
CAPID_A, BDSM and BGSM registers may not exist on specific platform, this patch add `HAVE_CAPID_A_REGISTER` and `HAVE_BDSM_BGSM_REGISTER` to select them.
Change-Id: I4d1197b8b1071aefc2ea1ed2f707d769aabab5e4 Signed-off-by: Yuchi Chen yuchi.chen@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/84108 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Shuo Liu shuo.liu@intel.com --- M src/soc/intel/common/block/systemagent/Kconfig M src/soc/intel/common/block/systemagent/systemagent.c M src/soc/intel/common/block/systemagent/systemagent_def.h 3 files changed, 19 insertions(+), 0 deletions(-)
Approvals: Shuo Liu: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/soc/intel/common/block/systemagent/Kconfig b/src/soc/intel/common/block/systemagent/Kconfig index 7bb55fe..42d579a 100644 --- a/src/soc/intel/common/block/systemagent/Kconfig +++ b/src/soc/intel/common/block/systemagent/Kconfig @@ -43,4 +43,16 @@ help Specify if the SOC has a PAM0 register
+config HAVE_CAPID_A_REGISTER + bool + default y + help + Specify if the SOC has the CAPID0_A register that holds DRAM infomations. + +config HAVE_BDSM_BGSM_REGISTER + bool + default y + help + Specify if the SOC has BDSM and BGSM registres. + endif diff --git a/src/soc/intel/common/block/systemagent/systemagent.c b/src/soc/intel/common/block/systemagent/systemagent.c index 5d9ac15..bca442b 100644 --- a/src/soc/intel/common/block/systemagent/systemagent.c +++ b/src/soc/intel/common/block/systemagent/systemagent.c @@ -78,6 +78,9 @@ if (m == NULL) return;
+ if (!CONFIG(HAVE_CAPID_A_REGISTER)) + return; + const uint32_t capid0_a = pci_read_config32(dev, CAPID0_A);
m->ecc_type = sa_get_ecc_type(capid0_a); @@ -126,7 +129,9 @@ static const struct sa_mem_map_descriptor sa_memory_map[MAX_MAP_ENTRIES] = { { TOUUD, true, "TOUUD" }, { TOLUD, false, "TOLUD" }, +#if CONFIG(HAVE_BDSM_BGSM_REGISTER) { BGSM, false, "BGSM" }, +#endif { TSEG, false, "TSEG" }, };
diff --git a/src/soc/intel/common/block/systemagent/systemagent_def.h b/src/soc/intel/common/block/systemagent/systemagent_def.h index 58d1113..e0f956b 100644 --- a/src/soc/intel/common/block/systemagent/systemagent_def.h +++ b/src/soc/intel/common/block/systemagent/systemagent_def.h @@ -58,7 +58,9 @@ enum { SA_TOUUD_REG, SA_TOLUD_REG, +#if CONFIG(HAVE_BDSM_BGSM_REGISTER) SA_BGSM_REG, +#endif SA_TSEG_REG, /* Must be last. */ MAX_MAP_ENTRIES