Software APIs
boot_svc_ownership_activate.h
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 #ifndef OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_BOOT_SVC_BOOT_SVC_OWNERSHIP_ACTIVATE_H_
6 #define OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_BOOT_SVC_BOOT_SVC_OWNERSHIP_ACTIVATE_H_
7 
8 #include <stdint.h>
9 
12 #include "sw/device/silicon_creator/lib/boot_svc/boot_svc_header.h"
13 #include "sw/device/silicon_creator/lib/error.h"
14 #include "sw/device/silicon_creator/lib/nonce.h"
15 #include "sw/device/silicon_creator/lib/ownership/datatypes.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif // __cplusplus
20 
21 enum {
22  /** Ownership activate request: `ACTV`. */
23  kBootSvcOwnershipActivateReqType = 0x56544341,
24  /** Ownership activate response: `VTCA`. */
25  kBootSvcOwnershipActivateResType = 0x41435456,
26 };
27 
28 /**
29  * An Ownership Activate request.
30  */
32  /**
33  * Boot services message header.
34  */
36  /**
37  * Which side of the flash is primary after activation.
38  */
39  uint32_t primary_bl0_slot;
40  /**
41  * The 64-bit DIN subfield of the full 256-bit device ID.
42  */
43  uint32_t din[2];
44  /**
45  * Erase previous owner's flash (hardened_bool_t).
46  */
47  uint32_t erase_previous;
48  /**
49  * Reserved for future use.
50  */
51  uint32_t reserved[31];
52  /**
53  * The current ownership nonce.
54  */
56  /**
57  * Signature over [primary_bl0_slot..nonce]
58  */
60 
62 
77 
78 /**
79  * An Ownership Activate response.
80  */
82  /**
83  * Boot services message header.
84  */
86  /**
87  * Response status from the ROM_EXT.
88  */
89  rom_error_t status;
91 
96 
97 /**
98  * Initialize an ownership activate request.
99  *
100  * @param[out] msg Output buffer for the message.
101  */
102 void boot_svc_ownership_activate_req_init(
103  uint32_t primary_bl0_slot, uint32_t erase_previous, nonce_t nonce,
105 
106 /**
107  * Initialize an ownership activate response.
108  *
109  * @param status Reponse from the ROM_EXT after receiving the request.
110  * @param[out] msg Output buffer for the message.
111  */
112 void boot_svc_ownership_activate_res_init(
113  rom_error_t status, boot_svc_ownership_activate_res_t *msg);
114 
115 #ifdef __cplusplus
116 } // extern "C"
117 #endif // __cplusplus
118 
119 #endif // OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_BOOT_SVC_BOOT_SVC_OWNERSHIP_ACTIVATE_H_