Software APIs
boot_svc_ownership_unlock.c
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #include "sw/device/silicon_creator/lib/boot_svc/boot_svc_ownership_unlock.h"
6 
8 #include "sw/device/silicon_creator/lib/error.h"
9 
10 void boot_svc_ownership_unlock_req_init(uint32_t unlock_mode, nonce_t nonce,
11  const owner_key_t *next_owner_key,
12  const owner_signature_t *signature,
14  msg->unlock_mode = unlock_mode;
15  memset(msg->reserved, 0, sizeof(msg->reserved));
16  msg->nonce = nonce;
17  msg->next_owner_key = *next_owner_key;
18  msg->signature = *signature;
19  boot_svc_header_finalize(kBootSvcOwnershipUnlockReqType,
21  &msg->header);
22 }
23 
24 void boot_svc_ownership_unlock_res_init(rom_error_t status,
26  msg->status = status;
27  boot_svc_header_finalize(kBootSvcOwnershipUnlockResType,
29  &msg->header);
30 }