Software APIs
boot_svc_min_bl0_sec_ver.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_MIN_BL0_SEC_VER_H_
6 #define OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_BOOT_SVC_BOOT_SVC_MIN_BL0_SEC_VER_H_
7 
8 #include <stdint.h>
9 
11 #include "sw/device/silicon_creator/lib/boot_svc/boot_svc_header.h"
12 #include "sw/device/silicon_creator/lib/error.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif // __cplusplus
17 
18 enum {
19  /** Minimum BL0 security version request: `MSEC` */
20  kBootSvcMinBl0SecVerReqType = 0x4345534d,
21  /** Minimum BL0 security version response: `CESM` */
22  kBootSvcMinBl0SecVerResType = 0x4d534543,
23 };
24 
25 /**
26  * A Set Minimum Security Version request.
27  */
29  /**
30  * Boot services message header.
31  */
33  /**
34  * Minimum security version to set.
35  */
36  uint32_t min_bl0_sec_ver;
38 
43 
44 /**
45  * A Set Minimum Security Version response.
46  */
48  /**
49  * Boot services message header.
50  */
52  /**
53  * Minimum security version read from flash.
54  */
55  uint32_t min_bl0_sec_ver;
56  /**
57  * Status response from ROM_EXT.
58  */
59  rom_error_t status;
61 
68 
69 /**
70  * Initialize a set minimum security version request message.
71  *
72  * @param min_bl0_sec_ver The minimum security version to set.
73  * @param[out] msg Output buffer for the message.
74  */
75 void boot_svc_min_bl0_sec_ver_req_init(uint32_t min_bl0_sec_ver,
77 
78 /**
79  * Initialize a set minimum security version response message.
80  *
81  * @param min_bl0_sec_ver The minimum security version read from flash.
82  * @param status The result of this request.
83  * @param[out] msg Output buffer for the message.
84  */
85 void boot_svc_min_bl0_sec_ver_res_init(uint32_t min_bl0_sec_ver,
86  rom_error_t status,
88 
89 #ifdef __cplusplus
90 } // extern "C"
91 #endif // __cplusplus
92 
93 #endif // OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_BOOT_SVC_BOOT_SVC_MIN_BL0_SEC_VER_H_