Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/coreboot/+/45942 )
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
vc/amd/fsp: Update the svc call header for the Mod Exp SVC
The PSP bootloader version 0.08.0B.7B added support for the Mod Exp svc call.
BUG=b:169157796 TEST=Build BRANCH=Zork
Signed-off-by: Martin Roth martinroth@chromium.org Change-Id: I1ce69c80cec77e1692cf9713a739cc4da4677da6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/45942 Reviewed-by: Eric Peers epeers@google.com Reviewed-by: Marshall Dawson marshalldawson3rd@gmail.com Reviewed-by: Edward O'Callaghan quasisec@chromium.org Reviewed-by: Kangheui Won khwon@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h 1 file changed, 21 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Marshall Dawson: Looks good to me, approved Edward O'Callaghan: Looks good to me, approved Kangheui Won: Looks good to me, but someone else must approve Eric Peers: Looks good to me, but someone else must approve
diff --git a/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h b/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h index 7cc9fd4..93f987b 100644 --- a/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h +++ b/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h @@ -35,6 +35,7 @@ #define SVC_EXIT 0x00 #define SVC_MAP_USER_STACK 0x01 #define SVC_DEBUG_PRINT 0x06 +#define SVC_MODEXP 0x0C #define SVC_RSAPSS_VERIFY 0x0D #define SVC_DEBUG_PRINT_EX 0x1A #define SVC_WAIT_10NS_MULTIPLE 0x1B @@ -59,6 +60,17 @@ #define PSP_INFO_PRODUCTION_SILICON 0x00000002UL #define PSP_INFO_VALID 0x80000000UL
+typedef struct MOD_EXP_PARAMS_T +{ + char *pExponent; // Exponent address + unsigned int ExpSize; // Exponent size in bytes + char *pModulus; // Modulus address + unsigned int ModulusSize; // Modulus size in bytes + char *pMessage; // Message address, same size as ModulusSize + char *pOutput; // Output address; Must be big enough to hold the + // data of ModulusSize +} MOD_EXP_PARAMS; + typedef struct _RSAPSS_VERIFY_PARAMS_T { char *pHash; // Message digest to verify the RSA signature @@ -384,6 +396,15 @@ */ uint32_t svc_rsa_pkcs_verify(const RSAPKCS_VERIFY_PARAMS *params);
+/* Calculate ModEx + * + * Parameters: + * mod_exp_param - ModExp parameters + * + * Return value: BL_OK or error code + */ +uint32_t svc_modexp(MOD_EXP_PARAMS *mod_exp_param); + /* C entry point for the Bootloader Userspace Application */ void Main(void);