diff options
author | Kangheui Won <khwon@chromium.org> | 2021-06-25 16:03:05 +1000 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-07-21 16:53:17 +0000 |
commit | ce0fad5e39c7d5b32ea39f2bb56b1f2b26de89f8 (patch) | |
tree | e85f5103b76cbeb69fe3617bbba2f8c2aa00508a /src/soc/amd/cezanne | |
parent | ce291b4327a888920fad453103094630ca247a57 (diff) |
soc/amd/cezanne: enable crypto in psp_verstage
Enable RSA and SHA for cezanne since support has been added to the PSP.
Also picasso and cezanne have different enums definitions for
hash algorithm, so split that out into chipset.c.
BUG=b:187906425
TEST=boot guybrush, check cbmem -t and the logs
Signed-off-by: Kangheui Won <khwon@chromium.org>
Change-Id: I725b0cac801ac0429f362a83aa58a8b9de158550
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55833
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd/cezanne')
-rw-r--r-- | src/soc/amd/cezanne/psp_verstage/chipset.c | 21 | ||||
-rw-r--r-- | src/soc/amd/cezanne/psp_verstage/svc.c | 14 |
2 files changed, 29 insertions, 6 deletions
diff --git a/src/soc/amd/cezanne/psp_verstage/chipset.c b/src/soc/amd/cezanne/psp_verstage/chipset.c index 7ad21490f8..f680456b1a 100644 --- a/src/soc/amd/cezanne/psp_verstage/chipset.c +++ b/src/soc/amd/cezanne/psp_verstage/chipset.c @@ -1,12 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -/* This file contains stub for not-yet-implemented svc in cezanne PSP. - * So this file will and should be removed eventually when psp_verstage works - * correctly in cezanne. - */ - #include <bl_uapp/bl_syscall_public.h> -#include <console/console.h> #include <psp_verstage.h> uint32_t update_psp_bios_dir(uint32_t *psp_dir_offset, uint32_t *bios_dir_offset) @@ -24,6 +18,21 @@ uint32_t get_bios_dir_addr(struct psp_ef_table *ef_table) return ef_table->bios3_entry; } +int platform_set_sha_op(enum vb2_hash_algorithm hash_alg, + struct sha_generic_data *sha_op) +{ + if (hash_alg == VB2_HASH_SHA256) { + sha_op->SHAType = SHA_TYPE_256; + sha_op->DigestLen = 32; + } else if (hash_alg == VB2_HASH_SHA384) { + sha_op->SHAType = SHA_TYPE_384; + sha_op->DigestLen = 48; + } else { + return -1; + } + return 0; +} + /* Functions below are stub functions for not-yet-implemented PSP features. * These functions should be replaced with proper implementations later. diff --git a/src/soc/amd/cezanne/psp_verstage/svc.c b/src/soc/amd/cezanne/psp_verstage/svc.c index bd4bec5798..e0f1b52d60 100644 --- a/src/soc/amd/cezanne/psp_verstage/svc.c +++ b/src/soc/amd/cezanne/psp_verstage/svc.c @@ -112,3 +112,17 @@ uint32_t svc_reset_system(enum reset_type reset_type) SVC_CALL1(SVC_RESET_SYSTEM, reset_type, retval); return retval; } + +uint32_t svc_crypto_sha(struct sha_generic_data *sha_op, enum sha_operation_mode sha_mode) +{ + uint32_t retval = 0; + SVC_CALL2(SVC_SHA, sha_op, sha_mode, retval); + return retval; +} + +uint32_t svc_modexp(struct mod_exp_params *mod_exp_param) +{ + uint32_t retval = 0; + SVC_CALL1(SVC_MODEXP, mod_exp_param, retval); + return retval; +} |