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>
This commit is contained in:
Yuchi Chen 2024-08-28 14:52:04 +08:00 committed by Felix Held
commit 2b0b2ef9a2
3 changed files with 19 additions and 0 deletions

View file

@ -43,4 +43,16 @@ config HAVE_PAM0_REGISTER
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

View file

@ -78,6 +78,9 @@ static void sa_soc_systemagent_init(struct device *dev)
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 @@ void sa_add_fixed_mmio_resources(struct device *dev, int *resource_cnt,
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" },
};

View file

@ -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