Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/74208 )
Change subject: soc/intel/cmn/cse: Store ISH firmware version into CBMEM
......................................................................
soc/intel/cmn/cse: Store ISH firmware version into CBMEM
The patch stores the ISH in the CBMEM table. It verifies CSE has been
updated by comparing previous and current CSE versions. If it has, the
patch updates the previous CSE version with the current CSE version. It
then updates the CBMEM table with the current ISH version.
BUG=b:273661726
TEST=The current and old CSE and ISH versions are verified on the
google/nissa during cold and warm reboots.
Additionally, version updates are verified by a debug patch that
purposely updated the stored cse version.
Signed-off-by: Dinesh Gehlot <digehlot(a)google.com>
Change-Id: Ie5c5faf926c75b05d189fb1118020fff024fc3e0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74208
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Kangheui Won <khwon(a)chromium.org>
---
M src/soc/intel/common/block/cse/cse_lite.c
1 file changed, 75 insertions(+), 2 deletions(-)
Approvals:
build bot (Jenkins): Verified
Kangheui Won: Looks good to me, approved
diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c
index f7ebed0..4cc4f51 100644
--- a/src/soc/intel/common/block/cse/cse_lite.c
+++ b/src/soc/intel/common/block/cse/cse_lite.c
@@ -1236,6 +1236,52 @@
return send_get_fpt_partition_info_cmd(id, resp);
}
+/*
+ * Helper function to read ISH version from CSE FPT using HECI command.
+ *
+ * The HECI command only be executed after memory has been initialized.
+ * This is because the command relies on resources that are not available
+ * until DRAM initialization command has been sent.
+ */
+static void store_ish_version(void)
+{
+ if (!ENV_RAMSTAGE)
+ return;
+
+ if (vboot_recovery_mode_enabled())
+ return;
+
+ struct cse_fw_partition_info *version;
+ size_t size = sizeof(struct fw_version);
+ version = cbmem_find(CBMEM_ID_CSE_PARTITION_VERSION);
+ if (version == NULL)
+ return;
+
+ /*
+ * Compare if stored cse version (from the previous boot) is same as current
+ * running cse version.
+ */
+ if (memcmp(&version->ish_partition_info.prev_cse_fw_version,
+ &version->cur_cse_fw_version, sizeof(struct fw_version))) {
+ /*
+ * Current running CSE version is different than previous stored CSE version
+ * which could be due to CSE update or rollback, hence, need to send ISHC
+ * partition info cmd to know the currently running ISH version.
+ */
+
+ struct fw_version_resp resp;
+ if (cse_get_fpt_partition_info(FPT_PARTITION_NAME_ISHC, &resp) == CB_SUCCESS) {
+ /* Update stored cse version with current version */
+ memcpy(&(version->ish_partition_info.prev_cse_fw_version),
+ &(version->cur_cse_fw_version), size);
+
+ /* Since cse version has been updated, ish version needs to be updated. */
+ memcpy(&(version->ish_partition_info.cur_ish_fw_version),
+ &(resp.manifest_data.version), size);
+ }
+ }
+}
+
static void ramstage_cse_misc_ops(void *unused)
{
if (acpi_get_sleep_type() == ACPI_S3)
@@ -1245,12 +1291,14 @@
cse_fw_sync();
/*
- * Store the CSE RW Firmware Version into CBMEM if ISH partition
+ * Store the CSE/ISH RW Firmware Version into CBMEM if ISH partition
* is available
*/
if (CONFIG(SOC_INTEL_STORE_CSE_FPT_PARTITION_VERSION) &&
- soc_is_ish_partition_enabled())
+ soc_is_ish_partition_enabled()) {
store_cse_rw_fw_version();
+ store_ish_version();
+ }
}
BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_EXIT, ramstage_cse_misc_ops, NULL);
--
To view, visit https://review.coreboot.org/c/coreboot/+/74208
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie5c5faf926c75b05d189fb1118020fff024fc3e0
Gerrit-Change-Number: 74208
Gerrit-PatchSet: 26
Gerrit-Owner: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Kangheui Won <khwon(a)chromium.org>
Gerrit-Reviewer: Tarun Tuli <taruntuli(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-CC: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-CC: Subrata Banik <subratabanik(a)google.com>
Gerrit-MessageType: merged
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/74256 )
Change subject: {commonlib, soc/intel/cmn/cse}: Store CSE firmware version into CBMEM
......................................................................
{commonlib, soc/intel/cmn/cse}: Store CSE firmware version into CBMEM
The patch implements an API that stores the CSE firmware version in the
CBMEM table. The API will be called from RAMSTAGE based on boot state
machine BS_PRE_DEVICE/BS_ON_EXIT
Additionally, renamed ramstage_cse_fw_sync() to ramstage_cse_misc_ops()
in order to add more CSE related operations at ramstage.
This patch also adds a configuration option,
'SOC_INTEL_STORE_CSE_FPT_PARTITION_VERSION', which enables the storage
of firmware version information in CBMEM memory. This information can be
used to identify the firmware version that is currently installed on the
system. The option depends on the `DRIVERS_INTEL_ISH` config and
platform should be flexible enough to opt out from enabling this
feature.
The cost of sending HECI command to read the CSE FPT is significant
(~200ms) hence, the idea is to read the CSE RW version on every cold
reset (to cover the CSE update scenarios) and store into CBMEM to
avoid the cost of resending the HECI command in all consecutive warm
boots.
Later boot stages can just read the CBMEM ID to retrieve the ISH
version if required.
Finally, ensure this feature is platform specific hence, getting
enabled for the platform that would like to store the ISH version into
the CBMEM and parse to perform some additional work.
BUG=b:273661726
TEST=Able to build and boot google/marasov.
Signed-off-by: Dinesh Gehlot <digehlot(a)google.com>
Change-Id: I923049d2f1f589f87e1a29e1ac94af7f5fccc2c8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74256
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan(a)9elements.com>
---
M src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h
M src/soc/intel/common/block/cse/Kconfig
M src/soc/intel/common/block/cse/cse_lite.c
M src/soc/intel/common/block/include/intelblocks/cse.h
4 files changed, 131 insertions(+), 3 deletions(-)
Approvals:
build bot (Jenkins): Verified
Lean Sheng Tan: Looks good to me, approved
diff --git a/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h b/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h
index fa5c8d9..4162d84 100644
--- a/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h
+++ b/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h
@@ -85,6 +85,7 @@
#define CBMEM_ID_MEM_CHIP_INFO 0x5048434D
#define CBMEM_ID_AMD_STB 0x5f425453
#define CBMEM_ID_AMD_MP2 0x5f32504d
+#define CBMEM_ID_CSE_PARTITION_VERSION 0x43535056
#define CBMEM_ID_TO_NAME_TABLE \
{ CBMEM_ID_ACPI, "ACPI " }, \
@@ -163,5 +164,6 @@
{ CBMEM_ID_TYPE_C_INFO, "TYPE_C INFO"},\
{ CBMEM_ID_MEM_CHIP_INFO, "MEM CHIP INFO"},\
{ CBMEM_ID_AMD_STB, "AMD STB"},\
- { CBMEM_ID_AMD_MP2, "AMD MP2 BUFFER"}
+ { CBMEM_ID_AMD_MP2, "AMD MP2 BUFFER"},\
+ { CBMEM_ID_CSE_PARTITION_VERSION, "CSE PARTITION VERSION"}
#endif /* _CBMEM_ID_H_ */
diff --git a/src/soc/intel/common/block/cse/Kconfig b/src/soc/intel/common/block/cse/Kconfig
index 33d703f..73cb51bc 100644
--- a/src/soc/intel/common/block/cse/Kconfig
+++ b/src/soc/intel/common/block/cse/Kconfig
@@ -45,6 +45,27 @@
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_STORE_CSE_FPT_PARTITION_VERSION
+ bool
+ default n
+ depends on DRIVERS_INTEL_ISH
+ help
+ This configuration option stores CSE FPT partitions' version in CBMEM memory.
+ This information can be used to identify the currently running firmware partition
+ version.
+
+ The cost of sending HECI command to read the CSE FPT is significant (~200ms)
+ hence, the idea is to read the CSE RW version on every cold reset (to cover
+ the CSE update scenarios) and store into CBMEM to avoid the cost of resending
+ the HECI command in all consecutive warm boots.
+
+ Later boot stages can just read the CBMEM ID to retrieve the ISH version if
+ required.
+
+ Additionally, ensure this feature is platform specific hence, only enabled
+ for the platform that would like to store the ISH version into the CBMEM and
+ parse to perform some additional work.
+
config SOC_INTEL_CSE_SEND_EOP_EARLY
bool "CSE send EOP early"
depends on SOC_INTEL_COMMON_BLOCK_CSE
diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c
index 14a7381..f7ebed0 100644
--- a/src/soc/intel/common/block/cse/cse_lite.c
+++ b/src/soc/intel/common/block/cse/cse_lite.c
@@ -1159,6 +1159,26 @@
timestamp_add_now(TS_CSE_FW_SYNC_END);
}
+/*
+ * Helper function that stores current CSE firmware version to CBMEM memory,
+ * except during recovery mode.
+ */
+static void store_cse_rw_fw_version(void)
+{
+ if (vboot_recovery_mode_enabled())
+ return;
+
+ struct get_bp_info_rsp cse_bp_info;
+ if (!cse_get_bp_info(&cse_bp_info)) {
+ printk(BIOS_ERR, "cse_lite: Failed to get CSE boot partition info\n");
+ return;
+ }
+ const struct cse_bp_entry *cse_bp = cse_get_bp_entry(RW, &cse_bp_info.bp_info);
+ struct cse_fw_partition_info *version;
+ version = cbmem_add(CBMEM_ID_CSE_PARTITION_VERSION, sizeof(*version));
+ memcpy(&(version->cur_cse_fw_version), &(cse_bp->fw_ver), sizeof(struct fw_version));
+}
+
static enum cb_err send_get_fpt_partition_info_cmd(enum fpt_partition_id id,
struct fw_version_resp *resp)
{
@@ -1216,13 +1236,21 @@
return send_get_fpt_partition_info_cmd(id, resp);
}
-static void ramstage_cse_fw_sync(void *unused)
+static void ramstage_cse_misc_ops(void *unused)
{
if (acpi_get_sleep_type() == ACPI_S3)
return;
if (CONFIG(SOC_INTEL_CSE_LITE_SYNC_IN_RAMSTAGE))
cse_fw_sync();
+
+ /*
+ * Store the CSE RW Firmware Version into CBMEM if ISH partition
+ * is available
+ */
+ if (CONFIG(SOC_INTEL_STORE_CSE_FPT_PARTITION_VERSION) &&
+ soc_is_ish_partition_enabled())
+ store_cse_rw_fw_version();
}
-BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_EXIT, ramstage_cse_fw_sync, NULL);
+BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_EXIT, ramstage_cse_misc_ops, NULL);
diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h
index 6b708ca..f3a7f83 100644
--- a/src/soc/intel/common/block/include/intelblocks/cse.h
+++ b/src/soc/intel/common/block/include/intelblocks/cse.h
@@ -144,6 +144,18 @@
struct flash_partition_data manifest_data;
};
+/* ISHC version */
+struct cse_fw_ish_version_info {
+ struct fw_version prev_cse_fw_version;
+ struct fw_version cur_ish_fw_version;
+};
+
+/* CSE and ISHC version */
+struct cse_fw_partition_info {
+ struct fw_version cur_cse_fw_version;
+ struct cse_fw_ish_version_info ish_partition_info;
+};
+
/* CSE RX and TX error status */
enum cse_tx_rx_status {
/*
@@ -502,6 +514,27 @@
void soc_disable_heci1_using_pcr(void);
/*
+ * SoC override API to identify if ISH Firmware existed inside CSE FPT.
+ *
+ * This override is required to avoid making default call into non-ISH
+ * supported SKU to attempt to retrieve ISH version which would results into
+ * increased boot time by 100ms+.
+ *
+ * Ideally SoC with UFS enabled would like to keep ISH enabled as well, hence
+ * identifying the UFS enabled device is enough to conclude if ISH partition is
+ * available.
+ */
+#if CONFIG(SOC_INTEL_STORE_CSE_FPT_PARTITION_VERSION)
+bool soc_is_ish_partition_enabled(void);
+#else
+static inline bool soc_is_ish_partition_enabled(void)
+{
+ /* Default implementation, ISH not enabled. */
+ return false;
+}
+#endif
+
+/*
* Injects CSE timestamps into cbmem timestamp table. SoC code needs to
* implement it since timestamp definitions differ from SoC to SoC.
*/
--
To view, visit https://review.coreboot.org/c/coreboot/+/74256
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I923049d2f1f589f87e1a29e1ac94af7f5fccc2c8
Gerrit-Change-Number: 74256
Gerrit-PatchSet: 22
Gerrit-Owner: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Kangheui Won <khwon(a)chromium.org>
Gerrit-Reviewer: Lean Sheng Tan <sheng.tan(a)9elements.com>
Gerrit-Reviewer: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Tarun Tuli <taruntuli(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Sridhar Siricilla <sridhar.nest(a)gmail.com>
Gerrit-MessageType: merged
Attention is currently required from: Robert Zieba, Jason Glenesk, Matt DeVillier, Martin Roth, Fred Reitberger, Karthik Ramasubramanian.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/74658 )
Change subject: soc/amd/phoenix/include/xhci: add USB4 XHCI device pointers
......................................................................
Patch Set 2:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/74658/comment/5cbd03b1_57880b21
PS2, Line 9: Beware that there's no XHCI2 controller and the USB4 controller device
: pointers were added right after the xhci_0 and xhci_1 controller device
: pointers.
> Definitely agree with Martin. […]
ah, ok, wasn't sure about this requirement of the xhci pci code; pinged Robert to look into that. do yo uhave any suggestions for the comments? is adding add a /* XHCI3 */ comment to the #define SOC_XHCI_2 DEV_PTR(usb4_xhci_0) sufficient? same for the next one
--
To view, visit https://review.coreboot.org/c/coreboot/+/74658
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I14725d4b546ffcca42e21bbe7756babaaff8fea3
Gerrit-Change-Number: 74658
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Reviewer: Robert Zieba <robertzieba(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-CC: Martin Roth <martin.roth(a)amd.corp-partner.google.com>
Gerrit-Attention: Robert Zieba <robertzieba(a)google.com>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Attention: Martin Roth <martin.roth(a)amd.corp-partner.google.com>
Gerrit-Attention: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Comment-Date: Fri, 21 Apr 2023 17:17:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Martin Roth <martin.roth(a)amd.corp-partner.google.com>
Comment-In-Reply-To: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-MessageType: comment
Attention is currently required from: Jason Glenesk, Matt DeVillier, Felix Held.
Fred Reitberger has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/74657 )
Change subject: soc/amd/phoenix/xhci: add SCI sources for the two USB4 controllers
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/74657
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I95916e409b3fbd4941a861054733a34100244da9
Gerrit-Change-Number: 74657
Gerrit-PatchSet: 3
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Martin Roth <martin.roth(a)amd.corp-partner.google.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Attention: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Comment-Date: Fri, 21 Apr 2023 17:15:27 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Jason Glenesk, Raul Rangel, Matt DeVillier, Felix Held.
Fred Reitberger has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/74656 )
Change subject: soc/amd/*/include/pci_devs: fix copy-paste error in PCIE_ABC_C_DEVFN
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/74656
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ica8b666161c3cd3b0b4a29f8a4b0aff473b4d833
Gerrit-Change-Number: 74656
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Martin Roth <martin.roth(a)amd.corp-partner.google.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Attention: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Comment-Date: Fri, 21 Apr 2023 17:10:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Jason Glenesk, Matt DeVillier, Felix Held.
Fred Reitberger has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/74655 )
Change subject: soc/amd/phoenix/include/soc/smi: add missing SCI map defines 61-63
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/74655
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic6fff9175b73cc9d0fd324d4a568a5761b92d078
Gerrit-Change-Number: 74655
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Martin Roth <martin.roth(a)amd.corp-partner.google.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Attention: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Comment-Date: Fri, 21 Apr 2023 17:09:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment