File tree Expand file tree Collapse file tree 2 files changed +65
-0
lines changed
drivers/firmware/scmi/nxp
include/zephyr/drivers/firmware/scmi/nxp Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -45,3 +45,39 @@ int scmi_cpu_sleep_mode_set(struct scmi_cpu_sleep_mode_config *cfg)
45
45
46
46
return 0 ;
47
47
}
48
+
49
+ int scmi_cpu_pd_lpm_set (struct scmi_cpu_pd_lpm_config * cfg )
50
+ {
51
+ struct scmi_protocol * proto = & SCMI_PROTOCOL_NAME (SCMI_PROTOCOL_CPU_DOMAIN );
52
+ struct scmi_message msg , reply ;
53
+ int status , ret ;
54
+
55
+ /* sanity checks */
56
+ if (!proto || !cfg ) {
57
+ return - EINVAL ;
58
+ }
59
+
60
+ if (proto -> id != SCMI_PROTOCOL_CPU_DOMAIN ) {
61
+ return - EINVAL ;
62
+ }
63
+
64
+ msg .hdr = SCMI_MESSAGE_HDR_MAKE (SCMI_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET , SCMI_COMMAND ,
65
+ proto -> id , 0x0 );
66
+ msg .len = sizeof (* cfg );
67
+ msg .content = cfg ;
68
+
69
+ reply .hdr = msg .hdr ;
70
+ reply .len = sizeof (status );
71
+ reply .content = & status ;
72
+
73
+ ret = scmi_send_message (proto , & msg , & reply , true);
74
+ if (ret < 0 ) {
75
+ return ret ;
76
+ }
77
+
78
+ if (status != SCMI_SUCCESS ) {
79
+ return scmi_status_to_errno (status );
80
+ }
81
+
82
+ return 0 ;
83
+ }
Original file line number Diff line number Diff line change 21
21
22
22
#define SCMI_PROTOCOL_CPU_DOMAIN 130
23
23
24
+ #define SCMI_CPU_MAX_PDCONFIGS_T 7U
25
+
24
26
/**
25
27
* @struct scmi_cpu_sleep_mode_config
26
28
*
@@ -33,6 +35,23 @@ struct scmi_cpu_sleep_mode_config {
33
35
uint32_t sleep_mode ;
34
36
};
35
37
38
+ struct scmi_pd_lpm_settings {
39
+ uint32_t domainId ;
40
+ uint32_t lpmSetting ;
41
+ uint32_t retMask ;
42
+ };
43
+
44
+ /**
45
+ * @struct scmi_cpu_pd_lpm_config
46
+ *
47
+ * @brief Describes cpu power domain low power mode setting
48
+ */
49
+ struct scmi_cpu_pd_lpm_config {
50
+ uint32_t cpu_id ;
51
+ uint32_t num_cfg ;
52
+ struct scmi_pd_lpm_settings cfgs [SCMI_CPU_MAX_PDCONFIGS_T ];
53
+ };
54
+
36
55
/**
37
56
* @brief CPU domain protocol command message IDs
38
57
*/
@@ -64,4 +83,14 @@ enum scmi_cpu_domain_message {
64
83
*/
65
84
int scmi_cpu_sleep_mode_set (struct scmi_cpu_sleep_mode_config * cfg );
66
85
86
+ /**
87
+ * @brief Send the SCMI_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET command and get its reply
88
+ *
89
+ * @param cfg pointer to structure containing configuration
90
+ * to be set
91
+ *
92
+ * @retval 0 if successful
93
+ * @retval negative errno if failure
94
+ */
95
+ int scmi_cpu_pd_lpm_set (struct scmi_cpu_pd_lpm_config * cfg );
67
96
#endif /* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CPU_H_ */
You can’t perform that action at this time.
0 commit comments