@@ -277,13 +277,18 @@ static void fsp_spcn_set_led_completion(struct fsp_msg *msg)
update_led_list(spcn_cmd->loc_code, spcn_cmd->ckpt_status);
}
- smsg = fsp_mkmsg(cmd, 0);
- if (!smsg) {
- prerror(PREFIX "Failed to allocate FSP_RSP_SET_LED_STATE\n");
- } else {
- if (fsp_queue_msg(smsg, fsp_freemsg)) {
- fsp_freemsg(smsg);
- prerror(PREFIX "Failed to queue FSP_RSP_SET_LED_STATE\n");
+ /* FSP initiated SPCN command */
+ if (spcn_cmd->cmd_src == SPCN_SRC_FSP) {
+ smsg = fsp_mkmsg(cmd, 0);
+ if (!smsg) {
+ prerror(PREFIX
+ "Failed to allocate FSP_RSP_SET_LED_STATE\n");
+ } else {
+ if (fsp_queue_msg(smsg, fsp_freemsg)) {
+ fsp_freemsg(smsg);
+ prerror(PREFIX "Failed to queue "
+ "FSP_RSP_SET_LED_STATE\n");
+ }
}
}
@@ -472,7 +477,8 @@ static int process_led_state_change(void)
* list and keeps the chain execution going. At last when there are no elements
* in the command queue it sets 'spcn_cmd_cmplt' as true again.
*/
-static int queue_led_state_change(char *loc_code, u8 command, u8 state)
+static int queue_led_state_change(char *loc_code, u8 command,
+ u8 state, int cmd_src)
{
struct led_set_cmd *cmd;
int rc = 0;
@@ -489,6 +495,7 @@ static int queue_led_state_change(char *loc_code, u8 command, u8 state)
strncpy(cmd->loc_code, loc_code, strlen(loc_code));
cmd->command = command;
cmd->state = state;
+ cmd->cmd_src = cmd_src;
/* Add to the queue */
lock(&spcn_cmd_lock);
@@ -919,12 +926,14 @@ static void fsp_set_led_state(struct fsp_msg *msg)
if (!strcmp(led->loc_code, req.loc_code))
continue;
- queue_led_state_change(led->loc_code, command, state);
+ queue_led_state_change(led->loc_code,
+ command, state, SPCN_SRC_FSP);
}
break;
case SET_IND_SINGLE_LOC_CODE:
/* Set led state for single descendent led */
- queue_led_state_change(req.loc_code, command, state);
+ queue_led_state_change(req.loc_code,
+ command, state, SPCN_SRC_FSP);
break;
default:
resp = fsp_mkmsg(FSP_RSP_SET_LED_STATE |
@@ -40,6 +40,13 @@
#define FSP_LED_EXCL_FAULT 1UL << 0
#define FSP_LED_EXCL_IDENTIFY 1UL << 1
+/* LED update message source */
+enum spcn_cmd_src {
+ SPCN_SRC_FSP = 0,
+ SPCN_SRC_OPAL = 1,
+ SPCN_SRC_MAX = 2
+};
+
/* SPCN set LED */
struct spcn_led_data {
u8 lc_len;
@@ -113,6 +120,7 @@ struct led_set_cmd {
u8 command;
u8 state;
u16 ckpt_status; /* Checkpointed status */
+ enum spcn_cmd_src cmd_src; /* OPAL or FSP based */
struct list_node link;
};