Software APIs
boot_svc_ownership_activate.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_activate.h"
6 
8 #include "sw/device/silicon_creator/lib/error.h"
9 
10 void boot_svc_ownership_activate_req_init(
11  uint32_t primary_bl0_slot, uint32_t erase_previous, nonce_t nonce,
12  const owner_signature_t *signature,
14  msg->primary_bl0_slot = primary_bl0_slot;
15  msg->erase_previous = erase_previous;
16  memset(msg->reserved, 0, sizeof(msg->reserved));
17  msg->nonce = nonce;
18  msg->signature = *signature;
19  boot_svc_header_finalize(kBootSvcOwnershipActivateReqType,
21  &msg->header);
22 }
23 
24 void boot_svc_ownership_activate_res_init(
25  rom_error_t status, boot_svc_ownership_activate_res_t *msg) {
26  msg->status = status;
27  boot_svc_header_finalize(kBootSvcOwnershipActivateResType,
29  &msg->header);
30 }