Attention is currently required from: Felix Held, Fred Reitberger, Jason Glenesk, Matt DeVillier, Zheng Bao.
Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/84576?usp=email
to review the following change.
Change subject: soc/amd/common: Add function to check the if it is in A/B recovery ......................................................................
soc/amd/common: Add function to check the if it is in A/B recovery
Change-Id: Iadd0f91221e92eab5e563fa19d6e4ab199871b11 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M src/soc/amd/common/block/include/amdblocks/psp.h M src/soc/amd/common/block/psp/psp_gen2.c 2 files changed, 10 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/84576/1
diff --git a/src/soc/amd/common/block/include/amdblocks/psp.h b/src/soc/amd/common/block/include/amdblocks/psp.h index 1ab3385..83afdbe 100644 --- a/src/soc/amd/common/block/include/amdblocks/psp.h +++ b/src/soc/amd/common/block/include/amdblocks/psp.h @@ -84,4 +84,6 @@ /* Sets the GPIO used for the TPM IRQ */ void psp_set_tpm_irq_gpio(unsigned int gpio);
+uint8_t check_abrecovery(void); + #endif /* AMD_BLOCK_PSP_H */ diff --git a/src/soc/amd/common/block/psp/psp_gen2.c b/src/soc/amd/common/block/psp/psp_gen2.c index 2113b57..0ac069a 100644 --- a/src/soc/amd/common/block/psp/psp_gen2.c +++ b/src/soc/amd/common/block/psp/psp_gen2.c @@ -211,3 +211,11 @@ *msg_38_value = read32p(psp_mmio | CORE_2_PSP_MSG_38_OFFSET); return CB_SUCCESS; } + +uint8_t check_abrecovery(void) +{ + union pspv2_mbox_command tmp; + + tmp.val = smn_read32(SMN_PSP_PUBLIC_BASE + PSP_MAILBOX_COMMAND_OFFSET); + return !!tmp.fields.recovery; +}