diff options
author | Martin Roth <martin@coreboot.org> | 2020-05-28 00:44:50 -0600 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2020-07-08 19:34:59 +0000 |
commit | c7acf1666a517f0fcfec3a5f64791932ca145c45 (patch) | |
tree | 8f2e6c0539a028ee3f2e27e5c80fe613678e7444 /src/soc/amd/picasso/psp_verstage/pmutil.c | |
parent | ac41f582351dc2c6aaaf0c1ef662e6d99b67b4ce (diff) |
soc/amd/picasso: add psp_verstage
This is the main code for building coreboot's verstage as a userspace
application to run on the PSP. It does a minimal setup of hardware,
then runs verstage_main. It uses hardware hashing to increase the speed
and will directly reboot into recovery mode if there are any failures.
BUG=b:158124527
TEST=Build & boot trembyle
Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: Ia58839caa5bfbae0408702ee8d02ef482f2861c4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41816
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd/picasso/psp_verstage/pmutil.c')
-rw-r--r-- | src/soc/amd/picasso/psp_verstage/pmutil.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/soc/amd/picasso/psp_verstage/pmutil.c b/src/soc/amd/picasso/psp_verstage/pmutil.c new file mode 100644 index 0000000000..ddaf54d470 --- /dev/null +++ b/src/soc/amd/picasso/psp_verstage/pmutil.c @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <bl_uapp/bl_syscall_public.h> +#include <bootmode.h> +#include <console/console.h> +#include <stdint.h> + +int platform_is_resuming(void) +{ + uint32_t bootmode = 0; + if (svc_get_boot_mode(&bootmode)) { + printk(BIOS_ERR, "Error getting boot mode. Assuming no resume.\n"); + return 0; + } + + if (bootmode == PSP_BOOT_MODE_S3_RESUME || bootmode == PSP_BOOT_MODE_S0i3_RESUME) + return 1; + + return 0; +} |