Software APIs
sw
device
silicon_creator
lib
boot_svc
boot_svc_empty.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_EMPTY_H_
6
#define OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_BOOT_SVC_BOOT_SVC_EMPTY_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
13
#ifdef __cplusplus
14
extern
"C"
{
15
#endif
// __cplusplus
16
17
enum
{
18
/** Empty boot services request: `EMPT`. */
19
kBootSvcEmptyReqType = 0x54504d45,
20
/** Empty boot services response: `TPME`. */
21
kBootSvcEmptyResType = 0x454d5054,
22
kBootSvcEmptyPayloadWordCount =
23
CHIP_BOOT_SVC_MSG_PAYLOAD_SIZE_MAX
/
sizeof
(uint32_t),
24
};
25
26
/**
27
* An empty boot services message.
28
*
29
* This message type consists of a payload that is as large as the largest boot
30
* services message. ROM_EXT should use an object of this type to initialize the
31
* boot services area in the retention SRAM or to clear a boot services request
32
* before writing the response. Silicon owner code should use an object of this
33
* type to clear a boot services response.
34
*/
35
36
typedef
struct
boot_svc_empty
{
37
/**
38
* Boot services message header.
39
*/
40
boot_svc_header_t
header
;
41
/**
42
* An arbitrary payload.
43
*/
44
uint32_t
payload
[kBootSvcEmptyPayloadWordCount];
45
}
boot_svc_empty_t
;
46
47
OT_ASSERT_MEMBER_OFFSET
(
boot_svc_empty_t
, header, 0);
48
OT_ASSERT_MEMBER_OFFSET
(
boot_svc_empty_t
, payload,
49
CHIP_BOOT_SVC_MSG_HEADER_SIZE
);
50
OT_ASSERT_SIZE
(
boot_svc_empty_t
,
CHIP_BOOT_SVC_MSG_SIZE_MAX
);
51
52
/**
53
* Initialize an empty boot services request.
54
*
55
* @param[out] msg Output buffer for the message.
56
*/
57
void
boot_svc_empty_req_init(
boot_svc_empty_t
*msg);
58
59
/**
60
* Initialize an empty boot services response.
61
*
62
* @param[inout] msg Buffer for the message.
63
*/
64
void
boot_svc_empty_res_init(
boot_svc_empty_t
*msg);
65
66
#ifdef __cplusplus
67
}
// extern "C"
68
#endif
// __cplusplus
69
70
#endif
// OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_BOOT_SVC_BOOT_SVC_EMPTY_H_
Return to
OpenTitan Documentation