summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/common/block/cse
diff options
context:
space:
mode:
authorSubrata Banik <subratabanik@google.com>2022-01-28 02:05:15 +0530
committerSubrata Banik <subratabanik@google.com>2022-02-02 07:09:28 +0000
commit32e06732322765819e5bf54167d3159275f7dfa8 (patch)
treec5e67bf063d178ed1c6cf1c0a82b46600e38c49b /src/soc/intel/common/block/cse
parent736f9cced0f060a333a5efdc499607350554b9c7 (diff)
downloadcoreboot-32e06732322765819e5bf54167d3159275f7dfa8.tar.gz
coreboot-32e06732322765819e5bf54167d3159275f7dfa8.tar.bz2
coreboot-32e06732322765819e5bf54167d3159275f7dfa8.zip
soc/intel/common/cse: Rework heci_disable function
This patch provides the possible options for SoC users to choose the applicable interface to make HECI1 function disable at pre-boot. `SOC_INTEL_COMMON_BLOCK_HECI_DISABLE_USING_SBI` config is used for disabling heci1 using non-posted sideband write (inside SMM) after FSP-S sets the postboot_sai attribute. Applicable from CNL PCH onwards. `SOC_INTEL_COMMON_BLOCK_HECI_DISABLE_USING_PMC_IPC` config is used for disabling heci1 using PMC IPC command `0xA9`. Applicable from TGL PCH onwards. `SOC_INTEL_COMMON_BLOCK_HECI_DISABLE_USING_PCR` config is used for disabling heci1 using private configuration register (PCR) write. Applicable for SoC platform prior to CNL PCH. Additionally, add PID_CSME0 macro for SKL, Xeon_SP and APL to fix the compilation failure. Finally, rename heci_disable() function to heci1_disable() to make it more meaningful. BUG=none TEST=Able to build and boot brya. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I7e0bab0004013b999ec1e054310763427d7b9348 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61431 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
Diffstat (limited to 'src/soc/intel/common/block/cse')
-rw-r--r--src/soc/intel/common/block/cse/Kconfig25
-rw-r--r--src/soc/intel/common/block/cse/Makefile.inc3
-rw-r--r--src/soc/intel/common/block/cse/disable_heci.c36
3 files changed, 59 insertions, 5 deletions
diff --git a/src/soc/intel/common/block/cse/Kconfig b/src/soc/intel/common/block/cse/Kconfig
index 23e08e636ae1..1a112bd68a11 100644
--- a/src/soc/intel/common/block/cse/Kconfig
+++ b/src/soc/intel/common/block/cse/Kconfig
@@ -14,13 +14,32 @@ config DISABLE_HECI1_AT_PRE_BOOT
Mainboard users to select this config to make HECI1 `function disable`
prior to handing off to payload.
-config SOC_INTEL_COMMON_BLOCK_HECI_DISABLE_IN_SMM
+config SOC_INTEL_COMMON_BLOCK_HECI1_DISABLE_USING_SBI
bool
default y if HECI_DISABLE_USING_SMM
select SOC_INTEL_COMMON_BLOCK_P2SB
help
- Use this config to include common CSE block to make HECI function
- disable in SMM mode
+ Use this config to allow common CSE block to make HECI1 function disable
+ in the SMM mode. From CNL PCH onwards,`HECI1` disabling can only be done
+ using the non-posted sideband write after FSP-S sets the postboot_sai
+ attribute.
+
+config SOC_INTEL_COMMON_BLOCK_HECI1_DISABLE_USING_PMC_IPC
+ bool
+ default n
+ select SOC_INTEL_COMMON_BLOCK_PMC
+ help
+ Use this config to allow common CSE block to make HECI1 function disable
+ using PMC IPC command `0xA9`. From TGL PCH onwards, disabling heci1
+ device using PMC IPC doesn't required to run the operation in SMM.
+
+config SOC_INTEL_COMMON_BLOCK_HECI1_DISABLE_USING_PCR
+ bool
+ default n
+ select SOC_INTEL_COMMON_BLOCK_PCR
+ help
+ Use this config for SoC platform prior to CNL PCH (with postboot_sai implemented)
+ to make `HECI1` device disable using private configuration register (PCR) write.
config SOC_INTEL_CSE_LITE_SKU
bool
diff --git a/src/soc/intel/common/block/cse/Makefile.inc b/src/soc/intel/common/block/cse/Makefile.inc
index 0e5dcdabf2d5..11a489178e1e 100644
--- a/src/soc/intel/common/block/cse/Makefile.inc
+++ b/src/soc/intel/common/block/cse/Makefile.inc
@@ -2,7 +2,8 @@ romstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_CSE) += cse.c
ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_CSE) += cse.c
romstage-$(CONFIG_SOC_INTEL_CSE_LITE_SKU) += cse_lite.c
ramstage-$(CONFIG_SOC_INTEL_CSE_LITE_SKU) += cse_lite.c
-smm-$(CONFIG_SOC_INTEL_COMMON_BLOCK_HECI_DISABLE_IN_SMM) += disable_heci.c
+ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_CSE) += disable_heci.c
+smm-$(CONFIG_SOC_INTEL_COMMON_BLOCK_CSE) += disable_heci.c
ramstage-$(CONFIG_SOC_INTEL_CSE_SET_EOP) += cse_eop.c
diff --git a/src/soc/intel/common/block/cse/disable_heci.c b/src/soc/intel/common/block/cse/disable_heci.c
index 1256fd1810e1..ab8b3ad934a6 100644
--- a/src/soc/intel/common/block/cse/disable_heci.c
+++ b/src/soc/intel/common/block/cse/disable_heci.c
@@ -1,5 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#define __SIMPLE_DEVICE__
+
#include <commonlib/helpers.h>
#include <console/console.h>
#include <device/pci.h>
@@ -15,8 +17,20 @@
#define CSME0_BAR 0x0
#define CSME0_FID 0xb0
+/* Disable HECI using PCR */
+static void heci1_disable_using_pcr(void)
+{
+ soc_disable_heci1_using_pcr();
+}
+
+/* Disable HECI using PMC IPC communication */
+static void heci1_disable_using_pmc(void)
+{
+ cse_disable_mei_devices();
+}
+
/* Disable HECI using Sideband interface communication */
-void heci_disable(void)
+static void heci1_disable_using_sbi(void)
{
struct pcr_sbi_msg msg = {
.pid = PID_CSME0,
@@ -46,3 +60,23 @@ void heci_disable(void)
/* hide p2sb device */
p2sb_hide();
}
+
+void heci1_disable(void)
+{
+ if (!CONFIG(DISABLE_HECI1_AT_PRE_BOOT))
+ return;
+
+ if (ENV_SMM && CONFIG(SOC_INTEL_COMMON_BLOCK_HECI1_DISABLE_USING_SBI)) {
+ printk(BIOS_INFO, "Disabling Heci using SBI in SMM mode\n");
+ return heci1_disable_using_sbi();
+ } else if (!ENV_SMM && CONFIG(SOC_INTEL_COMMON_BLOCK_HECI1_DISABLE_USING_PMC_IPC)) {
+ printk(BIOS_INFO, "Disabling Heci using PMC IPC\n");
+ return heci1_disable_using_pmc();
+ } else if (!ENV_SMM && CONFIG(SOC_INTEL_COMMON_BLOCK_HECI1_DISABLE_USING_PCR)) {
+ printk(BIOS_INFO, "Disabling Heci using PCR\n");
+ return heci1_disable_using_pcr();
+ } else {
+ printk(BIOS_ERR, "%s Error: Unable to make HECI1 function disable!\n",
+ __func__);
+ }
+}