1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2021 NXP
4  */
5 
6 #ifndef SCMI_MSG_PD_H
7 #define SCMI_MSG_PD_H
8 
9 #include <stdint.h>
10 
11 #include <lib/utils_def.h>
12 
13 #define SCMI_PROTOCOL_VERSION_PD	0x21000U
14 
15 /*
16  * Identifiers of the SCMI POWER DOMAIN Protocol commands
17  */
18 enum scmi_pd_command_id {
19 	SCMI_PD_ATTRIBUTES = 0x003,
20 	SCMI_PD_STATE_SET = 0x004,
21 	SCMI_PD_STATE_GET = 0x005,
22 };
23 
24 /* Protocol attributes */
25 struct scmi_pd_attributes_a2p {
26 	uint32_t pd_id;
27 };
28 
29 struct scmi_protocol_attributes_p2a_pd {
30 	int32_t status;
31 	uint32_t attributes;
32 	uint32_t statistics_addr_low;
33 	uint32_t statistics_addr_high;
34 	uint32_t statistics_len;
35 };
36 
37 #define SCMI_PD_NAME_LENGTH_MAX	16U
38 
39 struct scmi_pd_attributes_p2a {
40 	int32_t status;
41 	uint32_t attributes;
42 	char pd_name[SCMI_PD_NAME_LENGTH_MAX];
43 };
44 
45 /*
46  * Power Domain State Get
47  */
48 
49 struct scmi_pd_state_get_a2p {
50 	uint32_t pd_id;
51 };
52 
53 struct scmi_pd_state_get_p2a {
54 	int32_t status;
55 	uint32_t power_state;
56 };
57 
58 /*
59  * Power domain State Set
60  */
61 
62 struct scmi_pd_state_set_a2p {
63 	uint32_t flags;
64 	uint32_t pd_id;
65 	uint32_t power_state;
66 };
67 
68 struct scmi_pd_state_set_p2a {
69 	int32_t status;
70 };
71 
72 #endif /* SCMI_MSG_PD_H */
73