soc/amd/common/psp_verstage: Report HSP Secure State

Get Hardware Security Processor(HSP) state in PSP Verstage through the
SVC call and report it in cbmem logs.

BUG=b:198711349
TEST=Build Skyrim BIOS image and boot to OS in Skyrim.

Change-Id: Ic4875d1732f22783a90434329188192b106168f4
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71208
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
Karthikeyan Ramasubramanian 2022-12-22 13:05:12 -07:00 committed by Martin L Roth
parent 8420ccc6e9
commit e5f627ab85
3 changed files with 21 additions and 0 deletions

View File

@ -68,4 +68,6 @@ void platform_report_mode(int developer_mode_enabled);
void update_psp_fw_hash_table(const char *fname); void update_psp_fw_hash_table(const char *fname);
void report_hsp_secure_state(void);
#endif /* PSP_VERSTAGE_H */ #endif /* PSP_VERSTAGE_H */

View File

@ -246,6 +246,9 @@ void Main(void)
svc_write_postcode(POSTCODE_CONSOLE_INIT); svc_write_postcode(POSTCODE_CONSOLE_INIT);
console_init(); console_init();
if (CONFIG(PSP_INCLUDES_HSP))
report_hsp_secure_state();
if (!CONFIG(PSP_POSTCODES_ON_ESPI)) if (!CONFIG(PSP_POSTCODES_ON_ESPI))
svc_write_postcode(POSTCODE_EARLY_INIT); svc_write_postcode(POSTCODE_EARLY_INIT);
retval = verstage_soc_early_init(); retval = verstage_soc_early_init();

View File

@ -2,6 +2,8 @@
/* TODO: Check if this is still correct */ /* TODO: Check if this is still correct */
#include <arch/hlt.h>
#include <bl_uapp/bl_errorcodes_public.h>
#include <bl_uapp/bl_syscall_public.h> #include <bl_uapp/bl_syscall_public.h>
#include <cbfs.h> #include <cbfs.h>
#include <console/console.h> #include <console/console.h>
@ -113,3 +115,17 @@ void platform_report_mode(int developer_mode_enabled)
else else
svc_set_platform_boot_mode(CHROME_BOOK_BOOT_MODE_NORMAL); svc_set_platform_boot_mode(CHROME_BOOK_BOOT_MODE_NORMAL);
} }
void report_hsp_secure_state(void)
{
uint32_t hsp_secure_state;
int ret;
ret = svc_get_hsp_secure_state(&hsp_secure_state);
if (ret != BL_OK) {
printk(BIOS_ERR, "Error reading HSP Secure state: %d\n", ret);
hlt();
}
printk(BIOS_INFO, "HSP Secure state: %#8x\n", hsp_secure_state);
}