Software APIs
sw
device
silicon_creator
lib
boot_svc
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
10
#include "
sw/device/lib/base/macros.h
"
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
*/
28
typedef
struct
boot_svc_min_bl0_sec_ver_req
{
29
/**
30
* Boot services message header.
31
*/
32
boot_svc_header_t
header
;
33
/**
34
* Minimum security version to set.
35
*/
36
uint32_t
min_bl0_sec_ver
;
37
}
boot_svc_min_bl0_sec_ver_req_t
;
38
39
OT_ASSERT_MEMBER_OFFSET
(
boot_svc_min_bl0_sec_ver_req_t
, header, 0);
40
OT_ASSERT_MEMBER_OFFSET
(
boot_svc_min_bl0_sec_ver_req_t
, min_bl0_sec_ver,
41
CHIP_BOOT_SVC_MSG_HEADER_SIZE
);
42
OT_ASSERT_SIZE
(
boot_svc_min_bl0_sec_ver_req_t
, 48);
43
44
/**
45
* A Set Minimum Security Version response.
46
*/
47
typedef
struct
boot_svc_min_bl0_sec_ver_res
{
48
/**
49
* Boot services message header.
50
*/
51
boot_svc_header_t
header
;
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
;
60
}
boot_svc_min_bl0_sec_ver_res_t
;
61
62
OT_ASSERT_MEMBER_OFFSET
(
boot_svc_min_bl0_sec_ver_res_t
, header, 0);
63
OT_ASSERT_MEMBER_OFFSET
(
boot_svc_min_bl0_sec_ver_res_t
, min_bl0_sec_ver,
64
CHIP_BOOT_SVC_MSG_HEADER_SIZE
);
65
OT_ASSERT_MEMBER_OFFSET
(
boot_svc_min_bl0_sec_ver_res_t
,
status
,
66
CHIP_BOOT_SVC_MSG_HEADER_SIZE
+ 4);
67
OT_ASSERT_SIZE
(
boot_svc_min_bl0_sec_ver_res_t
, 52);
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,
76
boot_svc_min_bl0_sec_ver_req_t
*msg);
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
,
87
boot_svc_min_bl0_sec_ver_res_t
*msg);
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_
Return to
OpenTitan Documentation