File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed
drivers/firmware/scmi/nxp
include/zephyr/drivers/firmware/scmi/nxp Expand file tree Collapse file tree 2 files changed +64
-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 @@ -33,6 +33,24 @@ struct scmi_cpu_sleep_mode_config {
33
33
uint32_t sleep_mode ;
34
34
};
35
35
36
+ struct scmi_pd_lpm_settings {
37
+ uint32_t domainId ;
38
+ uint32_t lpmSetting ;
39
+ uint32_t retMask ;
40
+ };
41
+
42
+ /**
43
+ * @struct scmi_cpu_pd_lpm_config
44
+ *
45
+ * @brief Describes cpu power domain low power mode setting, the SCMI_CPU_MAX_PDCONFIGS_T
46
+ * is defined in soc level
47
+ */
48
+ struct scmi_cpu_pd_lpm_config {
49
+ uint32_t cpu_id ;
50
+ uint32_t num_cfg ;
51
+ struct scmi_pd_lpm_settings cfgs [SCMI_CPU_MAX_PDCONFIGS_T ];
52
+ };
53
+
36
54
/**
37
55
* @brief CPU domain protocol command message IDs
38
56
*/
@@ -64,4 +82,14 @@ enum scmi_cpu_domain_message {
64
82
*/
65
83
int scmi_cpu_sleep_mode_set (struct scmi_cpu_sleep_mode_config * cfg );
66
84
85
+ /**
86
+ * @brief Send the SCMI_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET command and get its reply
87
+ *
88
+ * @param cfg pointer to structure containing configuration
89
+ * to be set
90
+ *
91
+ * @retval 0 if successful
92
+ * @retval negative errno if failure
93
+ */
94
+ int scmi_cpu_pd_lpm_set (struct scmi_cpu_pd_lpm_config * cfg );
67
95
#endif /* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CPU_H_ */
You can’t perform that action at this time.
0 commit comments