Skip to content

Commit e8d8979

Browse files
LaurentiuM1234nashif
authored andcommitted
firmware: scmi: nxp: add "nxp" to the CPU protocol definitions
The SCMI CPU protocol is in fact a vendor extension from NXP. The current naming used for the CPU protocol definitions (i.e. functions, structures, macros) follows that of the SCMI standard protocols, which might be misleading. Include "nxp" in the name of all of the CPU protocol definitions. This change was performed mechanically using "git grep" and "sed -i" with some manual intervention. Signed-off-by: Laurentiu Mihalcea <[email protected]>
1 parent 61938e7 commit e8d8979

File tree

6 files changed

+99
-99
lines changed

6 files changed

+99
-99
lines changed

drivers/firmware/scmi/nxp/cpu.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
DT_SCMI_PROTOCOL_DEFINE_NODEV(DT_INST(0, nxp_scmi_cpu), NULL);
1212

13-
struct scmi_cpu_info_get_reply {
13+
struct scmi_nxp_cpu_info_get_reply {
1414
int32_t status;
15-
struct scmi_cpu_info data;
15+
struct scmi_nxp_cpu_info data;
1616
};
1717

18-
int scmi_cpu_sleep_mode_set(struct scmi_cpu_sleep_mode_config *cfg)
18+
int scmi_nxp_cpu_sleep_mode_set(struct scmi_nxp_cpu_sleep_mode_config *cfg)
1919
{
20-
struct scmi_protocol *proto = &SCMI_PROTOCOL_NAME(SCMI_PROTOCOL_CPU_DOMAIN);
20+
struct scmi_protocol *proto = &SCMI_PROTOCOL_NAME(SCMI_PROTOCOL_NXP_CPU_DOMAIN);
2121
struct scmi_message msg, reply;
2222
int status, ret;
2323
bool use_polling;
@@ -27,11 +27,11 @@ int scmi_cpu_sleep_mode_set(struct scmi_cpu_sleep_mode_config *cfg)
2727
return -EINVAL;
2828
}
2929

30-
if (proto->id != SCMI_PROTOCOL_CPU_DOMAIN) {
30+
if (proto->id != SCMI_PROTOCOL_NXP_CPU_DOMAIN) {
3131
return -EINVAL;
3232
}
3333

34-
msg.hdr = SCMI_MESSAGE_HDR_MAKE(SCMI_CPU_DOMAIN_MSG_CPU_SLEEP_MODE_SET, SCMI_COMMAND,
34+
msg.hdr = SCMI_MESSAGE_HDR_MAKE(SCMI_NXP_CPU_DOMAIN_MSG_CPU_SLEEP_MODE_SET, SCMI_COMMAND,
3535
proto->id, 0x0);
3636
msg.len = sizeof(*cfg);
3737
msg.content = cfg;
@@ -53,9 +53,9 @@ int scmi_cpu_sleep_mode_set(struct scmi_cpu_sleep_mode_config *cfg)
5353
return scmi_status_to_errno(status);
5454
}
5555

56-
int scmi_cpu_pd_lpm_set(struct scmi_cpu_pd_lpm_config *cfg)
56+
int scmi_nxp_cpu_pd_lpm_set(struct scmi_nxp_cpu_pd_lpm_config *cfg)
5757
{
58-
struct scmi_protocol *proto = &SCMI_PROTOCOL_NAME(SCMI_PROTOCOL_CPU_DOMAIN);
58+
struct scmi_protocol *proto = &SCMI_PROTOCOL_NAME(SCMI_PROTOCOL_NXP_CPU_DOMAIN);
5959
struct scmi_message msg, reply;
6060
int status, ret;
6161
bool use_polling;
@@ -65,11 +65,11 @@ int scmi_cpu_pd_lpm_set(struct scmi_cpu_pd_lpm_config *cfg)
6565
return -EINVAL;
6666
}
6767

68-
if (proto->id != SCMI_PROTOCOL_CPU_DOMAIN) {
68+
if (proto->id != SCMI_PROTOCOL_NXP_CPU_DOMAIN) {
6969
return -EINVAL;
7070
}
7171

72-
msg.hdr = SCMI_MESSAGE_HDR_MAKE(SCMI_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET, SCMI_COMMAND,
72+
msg.hdr = SCMI_MESSAGE_HDR_MAKE(SCMI_NXP_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET, SCMI_COMMAND,
7373
proto->id, 0x0);
7474
msg.len = sizeof(*cfg);
7575
msg.content = cfg;
@@ -88,9 +88,9 @@ int scmi_cpu_pd_lpm_set(struct scmi_cpu_pd_lpm_config *cfg)
8888
return scmi_status_to_errno(status);
8989
}
9090

91-
int scmi_cpu_set_irq_mask(struct scmi_cpu_irq_mask_config *cfg)
91+
int scmi_nxp_cpu_set_irq_mask(struct scmi_nxp_cpu_irq_mask_config *cfg)
9292
{
93-
struct scmi_protocol *proto = &SCMI_PROTOCOL_NAME(SCMI_PROTOCOL_CPU_DOMAIN);
93+
struct scmi_protocol *proto = &SCMI_PROTOCOL_NAME(SCMI_PROTOCOL_NXP_CPU_DOMAIN);
9494
struct scmi_message msg, reply;
9595
int status, ret;
9696

@@ -99,11 +99,11 @@ int scmi_cpu_set_irq_mask(struct scmi_cpu_irq_mask_config *cfg)
9999
return -EINVAL;
100100
}
101101

102-
if (proto->id != SCMI_PROTOCOL_CPU_DOMAIN) {
102+
if (proto->id != SCMI_PROTOCOL_NXP_CPU_DOMAIN) {
103103
return -EINVAL;
104104
}
105105

106-
msg.hdr = SCMI_MESSAGE_HDR_MAKE(SCMI_CPU_DOMAIN_MSG_CPU_IRQ_WAKE_SET, SCMI_COMMAND,
106+
msg.hdr = SCMI_MESSAGE_HDR_MAKE(SCMI_NXP_CPU_DOMAIN_MSG_CPU_IRQ_WAKE_SET, SCMI_COMMAND,
107107
proto->id, 0x0);
108108
msg.len = sizeof(*cfg);
109109
msg.content = cfg;
@@ -120,9 +120,9 @@ int scmi_cpu_set_irq_mask(struct scmi_cpu_irq_mask_config *cfg)
120120
return scmi_status_to_errno(status);
121121
}
122122

123-
int scmi_cpu_reset_vector(struct scmi_cpu_vector_config *cfg)
123+
int scmi_nxp_cpu_reset_vector(struct scmi_nxp_cpu_vector_config *cfg)
124124
{
125-
struct scmi_protocol *proto = &SCMI_PROTOCOL_NAME(SCMI_PROTOCOL_CPU_DOMAIN);
125+
struct scmi_protocol *proto = &SCMI_PROTOCOL_NAME(SCMI_PROTOCOL_NXP_CPU_DOMAIN);
126126
struct scmi_message msg, reply;
127127
int status, ret;
128128

@@ -131,11 +131,11 @@ int scmi_cpu_reset_vector(struct scmi_cpu_vector_config *cfg)
131131
return -EINVAL;
132132
}
133133

134-
if (proto->id != SCMI_PROTOCOL_CPU_DOMAIN) {
134+
if (proto->id != SCMI_PROTOCOL_NXP_CPU_DOMAIN) {
135135
return -EINVAL;
136136
}
137137

138-
msg.hdr = SCMI_MESSAGE_HDR_MAKE(SCMI_CPU_DOMAIN_MSG_CPU_RESET_VECTOR_SET, SCMI_COMMAND,
138+
msg.hdr = SCMI_MESSAGE_HDR_MAKE(SCMI_NXP_CPU_DOMAIN_MSG_CPU_RESET_VECTOR_SET, SCMI_COMMAND,
139139
proto->id, 0x0);
140140
msg.len = sizeof(*cfg);
141141
msg.content = cfg;
@@ -152,23 +152,23 @@ int scmi_cpu_reset_vector(struct scmi_cpu_vector_config *cfg)
152152
return scmi_status_to_errno(status);
153153
}
154154

155-
int scmi_cpu_info_get(uint32_t cpu_id, struct scmi_cpu_info *cfg)
155+
int scmi_nxp_cpu_info_get(uint32_t cpu_id, struct scmi_nxp_cpu_info *cfg)
156156
{
157-
struct scmi_protocol *proto = &SCMI_PROTOCOL_NAME(SCMI_PROTOCOL_CPU_DOMAIN);
157+
struct scmi_protocol *proto = &SCMI_PROTOCOL_NAME(SCMI_PROTOCOL_NXP_CPU_DOMAIN);
158158
struct scmi_message msg, reply;
159-
struct scmi_cpu_info_get_reply reply_buffer;
159+
struct scmi_nxp_cpu_info_get_reply reply_buffer;
160160
int ret;
161161

162162
/* sanity checks */
163163
if (!proto || !cfg) {
164164
return -EINVAL;
165165
}
166166

167-
if (proto->id != SCMI_PROTOCOL_CPU_DOMAIN) {
167+
if (proto->id != SCMI_PROTOCOL_NXP_CPU_DOMAIN) {
168168
return -EINVAL;
169169
}
170170

171-
msg.hdr = SCMI_MESSAGE_HDR_MAKE(SCMI_CPU_DOMAIN_MSG_CPU_INFO_GET, SCMI_COMMAND,
171+
msg.hdr = SCMI_MESSAGE_HDR_MAKE(SCMI_NXP_CPU_DOMAIN_MSG_CPU_INFO_GET, SCMI_COMMAND,
172172
proto->id, 0x0);
173173
msg.len = sizeof(uint32_t);
174174
msg.content = &cpu_id;

include/zephyr/drivers/firmware/scmi/nxp/cpu.h

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,30 @@
1717
#include <scmi_cpu_soc.h>
1818
#endif
1919

20-
#define SCMI_CPU_SLEEP_FLAG_IRQ_MUX 0x1U
20+
#define SCMI_NXP_CPU_SLEEP_FLAG_IRQ_MUX 0x1U
2121

22-
#define SCMI_PROTOCOL_CPU_DOMAIN 130
22+
#define SCMI_PROTOCOL_NXP_CPU_DOMAIN 130
2323

24-
#define SCMI_CPU_MAX_PDCONFIGS_T 7U
24+
#define SCMI_NXP_CPU_MAX_PDCONFIGS_T 7U
2525

26-
#define SCMI_CPU_IRQ_WAKE_NUM 22U
26+
#define SCMI_NXP_CPU_IRQ_WAKE_NUM 22U
2727

2828
/** CPU vector flag: Boot address (cold boot/reset) */
29-
#define SCMI_CPU_VEC_FLAGS_BOOT BIT(29)
29+
#define SCMI_NXP_CPU_VEC_FLAGS_BOOT BIT(29)
3030

3131
/** CPU vector flag: Start address (warm start) */
32-
#define SCMI_CPU_VEC_FLAGS_START BIT(30)
32+
#define SCMI_NXP_CPU_VEC_FLAGS_START BIT(30)
3333

3434
/** CPU vector flag: Resume address (exit from suspend) */
35-
#define SCMI_CPU_VEC_FLAGS_RESUME BIT(31)
35+
#define SCMI_NXP_CPU_VEC_FLAGS_RESUME BIT(31)
3636

3737
/**
38-
* @struct scmi_cpu_sleep_mode_config
38+
* @struct scmi_nxp_cpu_sleep_mode_config
3939
*
4040
* @brief Describes the parameters for the CPU_STATE_SET
4141
* command
4242
*/
43-
struct scmi_cpu_sleep_mode_config {
43+
struct scmi_nxp_cpu_sleep_mode_config {
4444
uint32_t cpu_id;
4545
uint32_t flags;
4646
uint32_t sleep_mode;
@@ -53,46 +53,46 @@ struct scmi_pd_lpm_settings {
5353
};
5454

5555
/**
56-
* @struct scmi_cpu_pd_lpm_config
56+
* @struct scmi_nxp_cpu_pd_lpm_config
5757
*
5858
* @brief Describes cpu power domain low power mode setting
5959
*/
60-
struct scmi_cpu_pd_lpm_config {
60+
struct scmi_nxp_cpu_pd_lpm_config {
6161
uint32_t cpu_id;
6262
uint32_t num_cfg;
63-
struct scmi_pd_lpm_settings cfgs[SCMI_CPU_MAX_PDCONFIGS_T];
63+
struct scmi_pd_lpm_settings cfgs[SCMI_NXP_CPU_MAX_PDCONFIGS_T];
6464
};
6565

6666
/**
67-
* @struct scmi_cpu_irq_mask_config
67+
* @struct scmi_nxp_cpu_irq_mask_config
6868
*
6969
* @brief Describes the parameters for the CPU_IRQ_WAKE_SET command
7070
*/
71-
struct scmi_cpu_irq_mask_config {
71+
struct scmi_nxp_cpu_irq_mask_config {
7272
uint32_t cpu_id;
7373
uint32_t mask_idx;
7474
uint32_t num_mask;
75-
uint32_t mask[SCMI_CPU_IRQ_WAKE_NUM];
75+
uint32_t mask[SCMI_NXP_CPU_IRQ_WAKE_NUM];
7676
};
7777

7878
/**
79-
* @struct scmi_cpu_vector_config
79+
* @struct scmi_nxp_cpu_vector_config
8080
*
8181
* @brief Describes the parameters for the CPU_RESET_VECTOR_SET command
8282
*/
83-
struct scmi_cpu_vector_config {
83+
struct scmi_nxp_cpu_vector_config {
8484
uint32_t cpu_id;
8585
uint32_t flags;
8686
uint32_t vector_low;
8787
uint32_t vector_high;
8888
};
8989

9090
/**
91-
* @struct scmi_cpu_info
91+
* @struct scmi_nxp_cpu_info
9292
*
9393
* @brief Describes the parameters for the CPU_INFO_GET command
9494
*/
95-
struct scmi_cpu_info {
95+
struct scmi_nxp_cpu_info {
9696
uint32_t run_mode;
9797
uint32_t sleep_mode;
9898
uint32_t vector_low;
@@ -102,21 +102,21 @@ struct scmi_cpu_info {
102102
/**
103103
* @brief CPU domain protocol command message IDs
104104
*/
105-
enum scmi_cpu_domain_message {
106-
SCMI_CPU_DOMAIN_MSG_PROTOCOL_VERSION = 0x0,
107-
SCMI_CPU_DOMAIN_MSG_PROTOCOL_ATTRIBUTES = 0x1,
108-
SCMI_CPU_DOMAIN_MSG_PROTOCOL_MESSAGE_ATTRIBUTES = 0x2,
109-
SCMI_CPU_DOMAIN_MSG_CPU_DOMAIN_ATTRIBUTES = 0x3,
110-
SCMI_CPU_DOMAIN_MSG_CPU_START = 0x4,
111-
SCMI_CPU_DOMAIN_MSG_CPU_STOP = 0x5,
112-
SCMI_CPU_DOMAIN_MSG_CPU_RESET_VECTOR_SET = 0x6,
113-
SCMI_CPU_DOMAIN_MSG_CPU_SLEEP_MODE_SET = 0x7,
114-
SCMI_CPU_DOMAIN_MSG_CPU_IRQ_WAKE_SET = 0x8,
115-
SCMI_CPU_DOMAIN_MSG_CPU_NON_IRQ_WAKE_SET = 0x9,
116-
SCMI_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET = 0xA,
117-
SCMI_CPU_DOMAIN_MSG_CPU_PER_LPM_CONFIG_SET = 0xB,
118-
SCMI_CPU_DOMAIN_MSG_CPU_INFO_GET = 0xC,
119-
SCMI_CPU_DOMAIN_MSG_NEGOTIATE_PROTOCOL_VERSION = 0x10,
105+
enum scmi_nxp_cpu_domain_message {
106+
SCMI_NXP_CPU_DOMAIN_MSG_PROTOCOL_VERSION = 0x0,
107+
SCMI_NXP_CPU_DOMAIN_MSG_PROTOCOL_ATTRIBUTES = 0x1,
108+
SCMI_NXP_CPU_DOMAIN_MSG_PROTOCOL_MESSAGE_ATTRIBUTES = 0x2,
109+
SCMI_NXP_CPU_DOMAIN_MSG_CPU_DOMAIN_ATTRIBUTES = 0x3,
110+
SCMI_NXP_CPU_DOMAIN_MSG_CPU_START = 0x4,
111+
SCMI_NXP_CPU_DOMAIN_MSG_CPU_STOP = 0x5,
112+
SCMI_NXP_CPU_DOMAIN_MSG_CPU_RESET_VECTOR_SET = 0x6,
113+
SCMI_NXP_CPU_DOMAIN_MSG_CPU_SLEEP_MODE_SET = 0x7,
114+
SCMI_NXP_CPU_DOMAIN_MSG_CPU_IRQ_WAKE_SET = 0x8,
115+
SCMI_NXP_CPU_DOMAIN_MSG_CPU_NON_IRQ_WAKE_SET = 0x9,
116+
SCMI_NXP_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET = 0xA,
117+
SCMI_NXP_CPU_DOMAIN_MSG_CPU_PER_LPM_CONFIG_SET = 0xB,
118+
SCMI_NXP_CPU_DOMAIN_MSG_CPU_INFO_GET = 0xC,
119+
SCMI_NXP_CPU_DOMAIN_MSG_NEGOTIATE_PROTOCOL_VERSION = 0x10,
120120
};
121121

122122
/**
@@ -128,18 +128,18 @@ enum scmi_cpu_domain_message {
128128
* @retval 0 if successful
129129
* @retval negative errno if failure
130130
*/
131-
int scmi_cpu_sleep_mode_set(struct scmi_cpu_sleep_mode_config *cfg);
131+
int scmi_nxp_cpu_sleep_mode_set(struct scmi_nxp_cpu_sleep_mode_config *cfg);
132132

133133
/**
134-
* @brief Send the SCMI_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET command and get its reply
134+
* @brief Send the SCMI_NXP_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET command and get its reply
135135
*
136136
* @param cfg pointer to structure containing configuration
137137
* to be set
138138
*
139139
* @retval 0 if successful
140140
* @retval negative errno if failure
141141
*/
142-
int scmi_cpu_pd_lpm_set(struct scmi_cpu_pd_lpm_config *cfg);
142+
int scmi_nxp_cpu_pd_lpm_set(struct scmi_nxp_cpu_pd_lpm_config *cfg);
143143

144144
/**
145145
* @brief Send the CPU_IRQ_WAKE_SET command and get its reply
@@ -149,7 +149,7 @@ int scmi_cpu_pd_lpm_set(struct scmi_cpu_pd_lpm_config *cfg);
149149
* @retval 0 if successful
150150
* @retval negative errno if failure
151151
*/
152-
int scmi_cpu_set_irq_mask(struct scmi_cpu_irq_mask_config *cfg);
152+
int scmi_nxp_cpu_set_irq_mask(struct scmi_nxp_cpu_irq_mask_config *cfg);
153153

154154
/**
155155
* @brief Send the CPU_RESET_VECTOR_SET command and get its reply
@@ -159,7 +159,7 @@ int scmi_cpu_set_irq_mask(struct scmi_cpu_irq_mask_config *cfg);
159159
* @retval 0 if successful
160160
* @retval negative errno if failure
161161
*/
162-
int scmi_cpu_reset_vector(struct scmi_cpu_vector_config *cfg);
162+
int scmi_nxp_cpu_reset_vector(struct scmi_nxp_cpu_vector_config *cfg);
163163

164164
/**
165165
* @brief Send the CPU_INFO_GET command and get its reply
@@ -170,5 +170,5 @@ int scmi_cpu_reset_vector(struct scmi_cpu_vector_config *cfg);
170170
* @retval 0 if successful
171171
* @retval negative errno if failure
172172
*/
173-
int scmi_cpu_info_get(uint32_t cpu_id, struct scmi_cpu_info *cfg);
173+
int scmi_nxp_cpu_info_get(uint32_t cpu_id, struct scmi_nxp_cpu_info *cfg);
174174
#endif /* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CPU_H_ */

soc/nxp/imx/imx9/imx943/a55/soc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static int soc_netc_clock_init(int clk_id)
4141
static int soc_init(void)
4242
{
4343
#if defined(CONFIG_NXP_SCMI_CPU_DOMAIN_HELPERS)
44-
struct scmi_cpu_sleep_mode_config cpu_cfg = {0};
44+
struct scmi_nxp_cpu_sleep_mode_config cpu_cfg = {0};
4545
#endif /* CONFIG_NXP_SCMI_CPU_DOMAIN_HELPERS */
4646
int ret = 0;
4747

soc/nxp/imx/imx9/imx943/m33/soc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static int soc_netc_clock_init(int clk_id)
5050
static int soc_init(void)
5151
{
5252
#if defined(CONFIG_NXP_SCMI_CPU_DOMAIN_HELPERS)
53-
struct scmi_cpu_sleep_mode_config cpu_cfg = {0};
53+
struct scmi_nxp_cpu_sleep_mode_config cpu_cfg = {0};
5454
#endif /* CONFIG_NXP_SCMI_CPU_DOMAIN_HELPERS */
5555
int ret = 0;
5656

@@ -114,7 +114,7 @@ static int soc_init(void)
114114
cpu_cfg.cpu_id = CPU_IDX_M33P_S;
115115
cpu_cfg.sleep_mode = CPU_SLEEP_MODE_RUN;
116116

117-
ret = scmi_cpu_sleep_mode_set(&cpu_cfg);
117+
ret = scmi_nxp_cpu_sleep_mode_set(&cpu_cfg);
118118
if (ret) {
119119
return ret;
120120
}

0 commit comments

Comments
 (0)