Jamie Ryu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46644 )
Change subject: [WIP] soc/intel/tigerlake: Add support for calling microcode update API ......................................................................
[WIP] soc/intel/tigerlake: Add support for calling microcode update API
This adds the entry function to call the main microcode update interface to enable microcode update for Tigerlake SoC and also implements the reboot function required.
BUG=b:149547271 TEST=Build and boot volteer2 to OS
Signed-off-by: Jamie Ryu jamie.m.ryu@intel.com Change-Id: Id60b9828498d1474193e238ec26da26ac322620e --- M src/soc/intel/tigerlake/Makefile.inc A src/soc/intel/tigerlake/ucode_update.c 2 files changed, 49 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/46644/1
diff --git a/src/soc/intel/tigerlake/Makefile.inc b/src/soc/intel/tigerlake/Makefile.inc index c4f71c7..b9b0e8c 100644 --- a/src/soc/intel/tigerlake/Makefile.inc +++ b/src/soc/intel/tigerlake/Makefile.inc @@ -44,6 +44,7 @@ ramstage-y += soundwire.c ramstage-y += systemagent.c ramstage-y += me.c +ramstage-$(CONFIG_INTEL_TOP_SWAP_MULTI_FIT_UCODE_UPDATE) += ucode_update.c
smm-y += gpio.c smm-y += p2sb.c diff --git a/src/soc/intel/tigerlake/ucode_update.c b/src/soc/intel/tigerlake/ucode_update.c new file mode 100644 index 0000000..d24e487 --- /dev/null +++ b/src/soc/intel/tigerlake/ucode_update.c @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <bootstate.h> +#include <console/console.h> +#include <halt.h> +#include <intelbasecode/ucode_update.h> +#include <reset.h> +#include <security/vboot/misc.h> +#include <security/vboot/vboot_common.h> +#include <soc/intel/common/reset.h> +#include <vb2_api.h> + +static void update_ucode(void *unused) +{ + if (CONFIG(INTEL_TOP_SWAP_MULTI_FIT_UCODE_UPDATE)) { + if (update_ucode_and_topswap_state()) { + /* Update failed */ + if (CONFIG(VBOOT)) { + printk(BIOS_DEBUG, "ucode: Failed to update microcode\n"); + struct vb2_context *ctx = vboot_get_context(); + if (ctx == NULL) + die("ucode: Failed to trigger recovery mode\n"); + vb2api_fail(ctx, 0x36, 0x0); + vboot_save_data(ctx); + vboot_reboot(); + } + } + } +} + + +void ucode_update_reboot(void) +{ + if (CONFIG(VBOOT)) + vboot_reboot(); + else + do_board_reset(); + + die("ucode: Failed to reset the system\n"); + halt(); +} + +int ucode_update_rec_mode_enabled(void) +{ + return vboot_recovery_mode_enabled(); +} + +BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, update_ucode, NULL);
Hello build bot (Jenkins), Patrick Georgi, Martin Roth, Rizwan Qureshi, Sridhar Siricilla, Raj Astekar, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46644
to look at the new patch set (#3).
Change subject: soc/intel/tigerlake: Add support for calling microcode update API ......................................................................
soc/intel/tigerlake: Add support for calling microcode update API
This adds the entry function to call the main microcode update interface to enable microcode in-field update for Tigerlake SoC and also implements the reboot function required.
BUG=b:149547271 TEST=Build and boot volteer2 to OS
Signed-off-by: Jamie Ryu jamie.m.ryu@intel.com Change-Id: Id60b9828498d1474193e238ec26da26ac322620e --- M src/soc/intel/tigerlake/Makefile.inc A src/soc/intel/tigerlake/ucode_update.c 2 files changed, 49 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/46644/3
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46644 )
Change subject: soc/intel/tigerlake: Add support for calling microcode update API ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46644/3/src/soc/intel/tigerlake/uco... File src/soc/intel/tigerlake/ucode_update.c:
https://review.coreboot.org/c/coreboot/+/46644/3/src/soc/intel/tigerlake/uco... PS3, Line 1: /* SPDX-License-Identifier: GPL-2.0-only */ None of this is tigerlake specific. Better move it somewhere else?
https://review.coreboot.org/c/coreboot/+/46644/3/src/soc/intel/tigerlake/uco... PS3, Line 15: INTEL_TOP_SWAP_MULTI_FIT_UCODE_UPDATE This is already been taken care of by the makefile inclusion
Jamie Ryu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46644 )
Change subject: soc/intel/tigerlake: Add support for calling microcode update API ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/46644/3/src/soc/intel/tigerlake/uco... File src/soc/intel/tigerlake/ucode_update.c:
https://review.coreboot.org/c/coreboot/+/46644/3/src/soc/intel/tigerlake/uco... PS3, Line 1: /* SPDX-License-Identifier: GPL-2.0-only */
None of this is tigerlake specific. […]
Hi Arthur, this is now moved to the common code by https://review.coreboot.org/c/coreboot/+/27369/60. Thanks for your comments.
https://review.coreboot.org/c/coreboot/+/46644/3/src/soc/intel/tigerlake/uco... PS3, Line 15: INTEL_TOP_SWAP_MULTI_FIT_UCODE_UPDATE
This is already been taken care of by the makefile inclusion
This is now moved to the common code - https://review.coreboot.org/c/coreboot/+/27369/60 and updated to remove the config check. Since the implementation is moved to the common code and this patch is not needed anymore, the patch will be abandoned. Thanks.
Jamie Ryu has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/46644 )
Change subject: soc/intel/tigerlake: Add support for calling microcode update API ......................................................................
Abandoned
implementation moved to the common code - https://review.coreboot.org/c/coreboot/+/27369