summaryrefslogtreecommitdiff
path: root/src/soc/intel
diff options
context:
space:
mode:
authorYuchi Chen <yuchi.chen@intel.com>2024-08-28 14:52:04 +0800
committerFelix Held <felix-coreboot@felixheld.de>2024-09-02 09:07:02 +0000
commit2b0b2ef9a25870cf5bac5897e8d72e8fb4cc87aa (patch)
treeab7dd71e22bc30674486e3e240dff01e571cab2a /src/soc/intel
parent53be20d37bda35e6115c7af877b9638710665e7f (diff)
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>
Diffstat (limited to 'src/soc/intel')
-rw-r--r--src/soc/intel/common/block/systemagent/Kconfig12
-rw-r--r--src/soc/intel/common/block/systemagent/systemagent.c5
-rw-r--r--src/soc/intel/common/block/systemagent/systemagent_def.h2
3 files changed, 19 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/systemagent/Kconfig b/src/soc/intel/common/block/systemagent/Kconfig
index 7bb55fe248..42d579afbe 100644
--- a/src/soc/intel/common/block/systemagent/Kconfig
+++ b/src/soc/intel/common/block/systemagent/Kconfig
@@ -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
diff --git a/src/soc/intel/common/block/systemagent/systemagent.c b/src/soc/intel/common/block/systemagent/systemagent.c
index 5d9ac15fbc..bca442bcc3 100644
--- a/src/soc/intel/common/block/systemagent/systemagent.c
+++ b/src/soc/intel/common/block/systemagent/systemagent.c
@@ -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" },
};
diff --git a/src/soc/intel/common/block/systemagent/systemagent_def.h b/src/soc/intel/common/block/systemagent/systemagent_def.h
index 58d11133cd..e0f956b938 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