History

firmware: fpga: replace the error codes with the standard ones

The Intel service layer driver has defined error codes for the specific services, which started from FPGA configuration then RSU (Remote Status Update). Intel service layer driver should define the standard error codes rather than keep adding more error codes for the new services. The standard error codes will be used by all the clients of Intel service layer driver. Replace FPGA and RSU specific error codes with Intel service layer’s Common error codes.

Richard Gong committed 6 years ago

Commit 7536ad81 parent 2a4542e5 files · +84 −133Browse files

Unified · Split

5 files
  1. drivers/firmware/stratix10-rsu.c +5 −5
  2. drivers/firmware/stratix10-svc.c +18 −44
  3. drivers/fpga/stratix10-soc.c +10 −15
  4. include/linux/firmware/intel/stratix10-smc.h +21 −28
  5. include/linux/firmware/intel/stratix10-svc-client.h +30 −41
drivers/firmware/stratix10-rsu.c+5−5
@@ -72,7 +72,7 @@ static void rsu_status_callback(struct stratix10_svc_client *client, · 71 unmodified lines
72 struct stratix10_rsu_priv *priv = client->priv;72 struct stratix10_rsu_priv *priv = client->priv;
73 struct arm_smccc_res *res = (struct arm_smccc_res *)data->kaddr1;73 struct arm_smccc_res *res = (struct arm_smccc_res *)data->kaddr1;
74 74
75 if (data->status == BIT(SVC_STATUS_RSU_OK)) {75 if (data->status == BIT(SVC_STATUS_OK)) {
76 priv->status.version = FIELD_GET(RSU_VERSION_MASK,76 priv->status.version = FIELD_GET(RSU_VERSION_MASK,
77 res->a2);77 res->a2);
78 priv->status.state = FIELD_GET(RSU_STATE_MASK, res->a2);78 priv->status.state = FIELD_GET(RSU_STATE_MASK, res->a2);
@@ -108,9 +108,9 @@ static void rsu_command_callback(struct stratix10_svc_client *client, · 29 unmodified lines
108{108{
109 struct stratix10_rsu_priv *priv = client->priv;109 struct stratix10_rsu_priv *priv = client->priv;
110 110
111 if (data->status == BIT(SVC_STATUS_RSU_NO_SUPPORT))111 if (data->status == BIT(SVC_STATUS_NO_SUPPORT))
112 dev_warn(client->dev, "Secure FW doesn't support notify\n");112 dev_warn(client->dev, "Secure FW doesn't support notify\n");
113 else if (data->status == BIT(SVC_STATUS_RSU_ERROR))113 else if (data->status == BIT(SVC_STATUS_ERROR))
114 dev_err(client->dev, "Failure, returned status is %lu\n",114 dev_err(client->dev, "Failure, returned status is %lu\n",
115 BIT(data->status));115 BIT(data->status));
116 116
@@ -133,9 +133,9 @@ static void rsu_retry_callback(struct stratix10_svc_client *client, · 16 unmodified lines
133 struct stratix10_rsu_priv *priv = client->priv;133 struct stratix10_rsu_priv *priv = client->priv;
134 unsigned int *counter = (unsigned int *)data->kaddr1;134 unsigned int *counter = (unsigned int *)data->kaddr1;
135 135
136 if (data->status == BIT(SVC_STATUS_RSU_OK))136 if (data->status == BIT(SVC_STATUS_OK))
137 priv->retry_counter = *counter;137 priv->retry_counter = *counter;
138 else if (data->status == BIT(SVC_STATUS_RSU_NO_SUPPORT))138 else if (data->status == BIT(SVC_STATUS_NO_SUPPORT))
139 dev_warn(client->dev, "Secure FW doesn't support retry\n");139 dev_warn(client->dev, "Secure FW doesn't support retry\n");
140 else140 else
141 dev_err(client->dev, "Failed to get retry counter %lu\n",141 dev_err(client->dev, "Failed to get retry counter %lu\n",
drivers/firmware/stratix10-svc.c+18−44
@@ -214,7 +214,7 @@ static void svc_thread_cmd_data_claim(struct stratix10_svc_controller *ctrl, · 213 unmodified lines
214 complete(&ctrl->complete_status);214 complete(&ctrl->complete_status);
215 break;215 break;
216 }216 }
217 cb_data->status = BIT(SVC_STATUS_RECONFIG_BUFFER_DONE);217 cb_data->status = BIT(SVC_STATUS_BUFFER_DONE);
218 cb_data->kaddr1 = svc_pa_to_va(res.a1);218 cb_data->kaddr1 = svc_pa_to_va(res.a1);
219 cb_data->kaddr2 = (res.a2) ?219 cb_data->kaddr2 = (res.a2) ?
220 svc_pa_to_va(res.a2) : NULL;220 svc_pa_to_va(res.a2) : NULL;
@@ -227,7 +227,7 @@ static void svc_thread_cmd_data_claim(struct stratix10_svc_controller *ctrl, · 6 unmodified lines
227 __func__);227 __func__);
228 }228 }
229 } while (res.a0 == INTEL_SIP_SMC_STATUS_OK ||229 } while (res.a0 == INTEL_SIP_SMC_STATUS_OK ||
230 res.a0 == INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY ||230 res.a0 == INTEL_SIP_SMC_STATUS_BUSY ||
231 wait_for_completion_timeout(&ctrl->complete_status, timeout));231 wait_for_completion_timeout(&ctrl->complete_status, timeout));
232}232}
233 233
@@ -250,7 +250,7 @@ static void svc_thread_cmd_config_status(struct stratix10_svc_controller *ctrl, · 16 unmodified lines
250 cb_data->kaddr1 = NULL;250 cb_data->kaddr1 = NULL;
251 cb_data->kaddr2 = NULL;251 cb_data->kaddr2 = NULL;
252 cb_data->kaddr3 = NULL;252 cb_data->kaddr3 = NULL;
253 cb_data->status = BIT(SVC_STATUS_RECONFIG_ERROR);253 cb_data->status = BIT(SVC_STATUS_ERROR);
254 254
255 pr_debug("%s: polling config status\n", __func__);255 pr_debug("%s: polling config status\n", __func__);
256 256
@@ -259,7 +259,7 @@ static void svc_thread_cmd_config_status(struct stratix10_svc_controller *ctrl, · 2 unmodified lines
259 ctrl->invoke_fn(INTEL_SIP_SMC_FPGA_CONFIG_ISDONE,259 ctrl->invoke_fn(INTEL_SIP_SMC_FPGA_CONFIG_ISDONE,
260 0, 0, 0, 0, 0, 0, 0, &res);260 0, 0, 0, 0, 0, 0, 0, &res);
261 if ((res.a0 == INTEL_SIP_SMC_STATUS_OK) ||261 if ((res.a0 == INTEL_SIP_SMC_STATUS_OK) ||
262 (res.a0 == INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR))262 (res.a0 == INTEL_SIP_SMC_STATUS_ERROR))
263 break;263 break;
264 264
265 /*265 /*
@@ -271,7 +271,7 @@ static void svc_thread_cmd_config_status(struct stratix10_svc_controller *ctrl, · 5 unmodified lines
271 }271 }
272 272
273 if (res.a0 == INTEL_SIP_SMC_STATUS_OK && count_in_sec)273 if (res.a0 == INTEL_SIP_SMC_STATUS_OK && count_in_sec)
274 cb_data->status = BIT(SVC_STATUS_RECONFIG_COMPLETED);274 cb_data->status = BIT(SVC_STATUS_COMPLETED);
275 275
276 p_data->chan->scl->receive_cb(p_data->chan->scl, cb_data);276 p_data->chan->scl->receive_cb(p_data->chan->scl, cb_data);
277}277}
@@ -294,24 +294,18 @@ static void svc_thread_recv_status_ok(struct stratix10_svc_data *p_data, · 16 unmodified lines
294 294
295 switch (p_data->command) {295 switch (p_data->command) {
296 case COMMAND_RECONFIG:296 case COMMAND_RECONFIG:
297 cb_data->status = BIT(SVC_STATUS_RECONFIG_REQUEST_OK);297 case COMMAND_RSU_UPDATE:
298 case COMMAND_RSU_NOTIFY:
299 cb_data->status = BIT(SVC_STATUS_OK);
298 break;300 break;
299 case COMMAND_RECONFIG_DATA_SUBMIT:301 case COMMAND_RECONFIG_DATA_SUBMIT:
300 cb_data->status = BIT(SVC_STATUS_RECONFIG_BUFFER_SUBMITTED);302 cb_data->status = BIT(SVC_STATUS_BUFFER_SUBMITTED);
301 break;
302 case COMMAND_NOOP:
303 cb_data->status = BIT(SVC_STATUS_RECONFIG_BUFFER_SUBMITTED);
304 cb_data->kaddr1 = svc_pa_to_va(res.a1);
305 break;303 break;
306 case COMMAND_RECONFIG_STATUS:304 case COMMAND_RECONFIG_STATUS:
307 cb_data->status = BIT(SVC_STATUS_RECONFIG_COMPLETED);305 cb_data->status = BIT(SVC_STATUS_COMPLETED);
308 break;
309 case COMMAND_RSU_UPDATE:
310 case COMMAND_RSU_NOTIFY:
311 cb_data->status = BIT(SVC_STATUS_RSU_OK);
312 break;306 break;
313 case COMMAND_RSU_RETRY:307 case COMMAND_RSU_RETRY:
314 cb_data->status = BIT(SVC_STATUS_RSU_OK);308 cb_data->status = BIT(SVC_STATUS_OK);
315 cb_data->kaddr1 = &res.a1;309 cb_data->kaddr1 = &res.a1;
316 break;310 break;
317 default:311 default:
@@ -430,9 +424,9 @@ static int svc_normal_to_secure_thread(void *data) · 112 unmodified lines
430 424
431 if (pdata->command == COMMAND_RSU_STATUS) {425 if (pdata->command == COMMAND_RSU_STATUS) {
432 if (res.a0 == INTEL_SIP_SMC_RSU_ERROR)426 if (res.a0 == INTEL_SIP_SMC_RSU_ERROR)
433 cbdata->status = BIT(SVC_STATUS_RSU_ERROR);427 cbdata->status = BIT(SVC_STATUS_ERROR);
434 else428 else
435 cbdata->status = BIT(SVC_STATUS_RSU_OK);429 cbdata->status = BIT(SVC_STATUS_OK);
436 430
437 cbdata->kaddr1 = &res;431 cbdata->kaddr1 = &res;
438 cbdata->kaddr2 = NULL;432 cbdata->kaddr2 = NULL;
@@ -445,7 +439,7 @@ static int svc_normal_to_secure_thread(void *data) · 6 unmodified lines
445 case INTEL_SIP_SMC_STATUS_OK:439 case INTEL_SIP_SMC_STATUS_OK:
446 svc_thread_recv_status_ok(pdata, cbdata, res);440 svc_thread_recv_status_ok(pdata, cbdata, res);
447 break;441 break;
448 case INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY:442 case INTEL_SIP_SMC_STATUS_BUSY:
449 switch (pdata->command) {443 switch (pdata->command) {
450 case COMMAND_RECONFIG_DATA_SUBMIT:444 case COMMAND_RECONFIG_DATA_SUBMIT:
451 svc_thread_cmd_data_claim(ctrl,445 svc_thread_cmd_data_claim(ctrl,
@@ -460,33 +454,13 @@ static int svc_normal_to_secure_thread(void *data) · 8 unmodified lines
460 break;454 break;
461 }455 }
462 break;456 break;
463 case INTEL_SIP_SMC_FPGA_CONFIG_STATUS_REJECTED:457 case INTEL_SIP_SMC_STATUS_REJECTED:
464 pr_debug("%s: STATUS_REJECTED\n", __func__);458 pr_debug("%s: STATUS_REJECTED\n", __func__);
465 break;459 break;
466 case INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR:460 case INTEL_SIP_SMC_STATUS_ERROR:
467 case INTEL_SIP_SMC_RSU_ERROR:461 case INTEL_SIP_SMC_RSU_ERROR:
468 pr_err("%s: STATUS_ERROR\n", __func__);462 pr_err("%s: STATUS_ERROR\n", __func__);
469 switch (pdata->command) {463 cbdata->status = BIT(SVC_STATUS_ERROR);
470 /* for FPGA mgr */
471 case COMMAND_RECONFIG_DATA_CLAIM:
472 case COMMAND_RECONFIG:
473 case COMMAND_RECONFIG_DATA_SUBMIT:
474 case COMMAND_RECONFIG_STATUS:
475 cbdata->status =
476 BIT(SVC_STATUS_RECONFIG_ERROR);
477 break;
478
479 /* for RSU */
480 case COMMAND_RSU_STATUS:
481 case COMMAND_RSU_UPDATE:
482 case COMMAND_RSU_NOTIFY:
483 case COMMAND_RSU_RETRY:
484 cbdata->status =
485 BIT(SVC_STATUS_RSU_ERROR);
486 break;
487 }
488
489 cbdata->status = BIT(SVC_STATUS_RECONFIG_ERROR);
490 cbdata->kaddr1 = NULL;464 cbdata->kaddr1 = NULL;
491 cbdata->kaddr2 = NULL;465 cbdata->kaddr2 = NULL;
492 cbdata->kaddr3 = NULL;466 cbdata->kaddr3 = NULL;
@@ -502,7 +476,7 @@ static int svc_normal_to_secure_thread(void *data) · 9 unmodified lines
502 if ((pdata->command == COMMAND_RSU_RETRY) ||476 if ((pdata->command == COMMAND_RSU_RETRY) ||
503 (pdata->command == COMMAND_RSU_NOTIFY)) {477 (pdata->command == COMMAND_RSU_NOTIFY)) {
504 cbdata->status =478 cbdata->status =
505 BIT(SVC_STATUS_RSU_NO_SUPPORT);479 BIT(SVC_STATUS_NO_SUPPORT);
506 cbdata->kaddr1 = NULL;480 cbdata->kaddr1 = NULL;
507 cbdata->kaddr2 = NULL;481 cbdata->kaddr2 = NULL;
508 cbdata->kaddr3 = NULL;482 cbdata->kaddr3 = NULL;
drivers/fpga/stratix10-soc.c+10−15
@@ -154,11 +154,11 @@ static void s10_receive_callback(struct stratix10_svc_client *client, · 153 unmodified lines
154 * Here we set status bits as we receive them. Elsewhere, we always use154 * Here we set status bits as we receive them. Elsewhere, we always use
155 * test_and_clear_bit() to check status in priv->status155 * test_and_clear_bit() to check status in priv->status
156 */156 */
157 for (i = 0; i <= SVC_STATUS_RECONFIG_ERROR; i++)157 for (i = 0; i <= SVC_STATUS_ERROR; i++)
158 if (status & (1 << i))158 if (status & (1 << i))
159 set_bit(i, &priv->status);159 set_bit(i, &priv->status);
160 160
161 if (status & BIT(SVC_STATUS_RECONFIG_BUFFER_DONE)) {161 if (status & BIT(SVC_STATUS_BUFFER_DONE)) {
162 s10_unlock_bufs(priv, data->kaddr1);162 s10_unlock_bufs(priv, data->kaddr1);
163 s10_unlock_bufs(priv, data->kaddr2);163 s10_unlock_bufs(priv, data->kaddr2);
164 s10_unlock_bufs(priv, data->kaddr3);164 s10_unlock_bufs(priv, data->kaddr3);
@@ -209,8 +209,7 @@ static int s10_ops_write_init(struct fpga_manager *mgr, · 44 unmodified lines
209 }209 }
210 210
211 ret = 0;211 ret = 0;
212 if (!test_and_clear_bit(SVC_STATUS_RECONFIG_REQUEST_OK,212 if (!test_and_clear_bit(SVC_STATUS_OK, &priv->status)) {
213 &priv->status)) {
214 ret = -ETIMEDOUT;213 ret = -ETIMEDOUT;
215 goto init_done;214 goto init_done;
216 }215 }
@@ -323,17 +322,15 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf, · 106 unmodified lines
323 &priv->status_return_completion,322 &priv->status_return_completion,
324 S10_BUFFER_TIMEOUT);323 S10_BUFFER_TIMEOUT);
325 324
326 if (test_and_clear_bit(SVC_STATUS_RECONFIG_BUFFER_DONE,325 if (test_and_clear_bit(SVC_STATUS_BUFFER_DONE, &priv->status) ||
327 &priv->status) ||326 test_and_clear_bit(SVC_STATUS_BUFFER_SUBMITTED,
328 test_and_clear_bit(SVC_STATUS_RECONFIG_BUFFER_SUBMITTED,
329 &priv->status)) {327 &priv->status)) {
330 ret = 0;328 ret = 0;
331 continue;329 continue;
332 }330 }
333 331
334 if (test_and_clear_bit(SVC_STATUS_RECONFIG_ERROR,332 if (test_and_clear_bit(SVC_STATUS_ERROR, &priv->status)) {
335 &priv->status)) {333 dev_err(dev, "ERROR - giving up - SVC_STATUS_ERROR\n");
336 dev_err(dev, "ERROR - giving up - SVC_STATUS_RECONFIG_ERROR\n");
337 ret = -EFAULT;334 ret = -EFAULT;
338 break;335 break;
339 }336 }
@@ -393,13 +390,11 @@ static int s10_ops_write_complete(struct fpga_manager *mgr, · 53 unmodified lines
393 timeout = ret;390 timeout = ret;
394 ret = 0;391 ret = 0;
395 392
396 if (test_and_clear_bit(SVC_STATUS_RECONFIG_COMPLETED,393 if (test_and_clear_bit(SVC_STATUS_COMPLETED, &priv->status))
397 &priv->status))
398 break;394 break;
399 395
400 if (test_and_clear_bit(SVC_STATUS_RECONFIG_ERROR,396 if (test_and_clear_bit(SVC_STATUS_ERROR, &priv->status)) {
401 &priv->status)) {397 dev_err(dev, "ERROR - giving up - SVC_STATUS_ERROR\n");
402 dev_err(dev, "ERROR - giving up - SVC_STATUS_RECONFIG_ERROR\n");
403 ret = -EFAULT;398 ret = -EFAULT;
404 break;399 break;
405 }400 }
include/linux/firmware/intel/stratix10-smc.h+21−28
@@ -54,32 +54,25 @@ · 53 unmodified lines
54 * Secure monitor software doesn't recognize the request.54 * Secure monitor software doesn't recognize the request.
55 *55 *
56 * INTEL_SIP_SMC_STATUS_OK:56 * INTEL_SIP_SMC_STATUS_OK:
57 * FPGA configuration completed successfully,57 * Secure monitor software accepts the service client's request.
58 * In case of FPGA configuration write operation, it means secure monitor
59 * software can accept the next chunk of FPGA configuration data.
60 *58 *
61 * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY:59 * INTEL_SIP_SMC_STATUS_BUSY:
62 * In case of FPGA configuration write operation, it means secure monitor60 * Secure monitor software is still processing service client's request.
63 * software is still processing previous data & can't accept the next chunk
64 * of data. Service driver needs to issue
65 * INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE call to query the
66 * completed block(s).
67 *61 *
68 * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR:62 * INTEL_SIP_SMC_STATUS_REJECTED:
69 * There is error during the FPGA configuration process.63 * Secure monitor software reject the service client's request.
70 *64 *
71 * INTEL_SIP_SMC_REG_ERROR:65 * INTEL_SIP_SMC_STATUS_ERROR:
72 * There is error during a read or write operation of the protected registers.66 * There is error during the process of service request.
73 *67 *
74 * INTEL_SIP_SMC_RSU_ERROR:68 * INTEL_SIP_SMC_RSU_ERROR:
75 * There is error during a remote status update.69 * There is error during the process of remote status update request.
76 */70 */
77#define INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF71#define INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF
78#define INTEL_SIP_SMC_STATUS_OK 0x072#define INTEL_SIP_SMC_STATUS_OK 0x0
79#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY 0x173#define INTEL_SIP_SMC_STATUS_BUSY 0x1
80#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_REJECTED 0x274#define INTEL_SIP_SMC_STATUS_REJECTED 0x2
81#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR 0x475#define INTEL_SIP_SMC_STATUS_ERROR 0x4
82#define INTEL_SIP_SMC_REG_ERROR 0x5
83#define INTEL_SIP_SMC_RSU_ERROR 0x776#define INTEL_SIP_SMC_RSU_ERROR 0x7
84 77
85/**78/**
@@ -95,7 +88,7 @@ · 9 unmodified lines
95 * a2-7: not used.88 * a2-7: not used.
96 *89 *
97 * Return status:90 * Return status:
98 * a0: INTEL_SIP_SMC_STATUS_OK, or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.91 * a0: INTEL_SIP_SMC_STATUS_OK, or INTEL_SIP_SMC_STATUS_ERROR.
99 * a1-3: not used.92 * a1-3: not used.
100 */93 */
101#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_START 194#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_START 1
@@ -115,8 +108,8 @@ · 13 unmodified lines
115 * a3-7: not used.108 * a3-7: not used.
116 *109 *
117 * Return status:110 * Return status:
118 * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or111 * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_STATUS_BUSY or
119 * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.112 * INTEL_SIP_SMC_STATUS_ERROR.
120 * a1: 64bit physical address of 1st completed memory block if any completed113 * a1: 64bit physical address of 1st completed memory block if any completed
121 * block, otherwise zero value.114 * block, otherwise zero value.
122 * a2: 64bit physical address of 2nd completed memory block if any completed115 * a2: 64bit physical address of 2nd completed memory block if any completed
@@ -133,15 +126,15 @@ · 10 unmodified lines
133 *126 *
134 * Sync call used by service driver at EL1 to track the completed write127 * Sync call used by service driver at EL1 to track the completed write
135 * transactions. This request is called after INTEL_SIP_SMC_FPGA_CONFIG_WRITE128 * transactions. This request is called after INTEL_SIP_SMC_FPGA_CONFIG_WRITE
136 * call returns INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY.129 * call returns INTEL_SIP_SMC_STATUS_BUSY.
137 *130 *
138 * Call register usage:131 * Call register usage:
139 * a0: INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE.132 * a0: INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE.
140 * a1-7: not used.133 * a1-7: not used.
141 *134 *
142 * Return status:135 * Return status:
143 * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or136 * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_BUSY or
144 * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.137 * INTEL_SIP_SMC_STATUS_ERROR.
145 * a1: 64bit physical address of 1st completed memory block.138 * a1: 64bit physical address of 1st completed memory block.
146 * a2: 64bit physical address of 2nd completed memory block if139 * a2: 64bit physical address of 2nd completed memory block if
147 * any completed block, otherwise zero value.140 * any completed block, otherwise zero value.
@@ -164,8 +157,8 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 16 unmodified lines
164 * a1-7: not used.157 * a1-7: not used.
165 *158 *
166 * Return status:159 * Return status:
167 * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or160 * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_STATUS_BUSY or
168 * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.161 * INTEL_SIP_SMC_STATUS_ERROR.
169 * a1-3: not used.162 * a1-3: not used.
170 */163 */
171#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_ISDONE 4164#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_ISDONE 4
@@ -183,7 +176,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 11 unmodified lines
183 * a1-7: not used.176 * a1-7: not used.
184 *177 *
185 * Return status:178 * Return status:
186 * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.179 * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_STATUS_ERROR.
187 * a1: start of physical address of reserved memory block.180 * a1: start of physical address of reserved memory block.
188 * a2: size of reserved memory block.181 * a2: size of reserved memory block.
189 * a3: not used.182 * a3: not used.
@@ -203,7 +196,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 13 unmodified lines
203 * a1-7: not used.196 * a1-7: not used.
204 *197 *
205 * Return status:198 * Return status:
206 * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.199 * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_STATUS_ERROR.
207 * a1-3: not used.200 * a1-3: not used.
208 */201 */
209#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK 6202#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK 6
include/linux/firmware/intel/stratix10-svc-client.h+30−41
@@ -18,45 +18,37 @@ · 17 unmodified lines
18/**18/**
19 * Status of the sent command, in bit number19 * Status of the sent command, in bit number
20 *20 *
21 * SVC_COMMAND_STATUS_RECONFIG_REQUEST_OK:21 * SVC_STATUS_OK:
22 * Secure firmware accepts the request of FPGA reconfiguration.22 * Secure firmware accepts the request issued by one of service clients.
23 *23 *
24 * SVC_STATUS_RECONFIG_BUFFER_SUBMITTED:24 * SVC_STATUS_BUFFER_SUBMITTED:
25 * Service client successfully submits FPGA configuration25 * Service client successfully submits data buffer to secure firmware.
26 * data buffer to secure firmware.
27 *26 *
28 * SVC_COMMAND_STATUS_RECONFIG_BUFFER_DONE:27 * SVC_STATUS_BUFFER_DONE:
29 * Secure firmware completes data process, ready to accept the28 * Secure firmware completes data process, ready to accept the
30 * next WRITE transaction.29 * next WRITE transaction.
31 *30 *
32 * SVC_COMMAND_STATUS_RECONFIG_COMPLETED:31 * SVC_STATUS_COMPLETED:
33 * Secure firmware completes FPGA configuration successfully, FPGA should32 * Secure firmware completes service request successfully. In case of
34 * be in user mode.33 * FPGA configuration, FPGA should be in user mode.
35 *34 *
36 * SVC_COMMAND_STATUS_RECONFIG_BUSY:35 * SVC_COMMAND_STATUS_BUSY:
37 * FPGA configuration is still in process.36 * Service request is still in process.
38 *37 *
39 * SVC_COMMAND_STATUS_RECONFIG_ERROR:38 * SVC_COMMAND_STATUS_ERROR:
40 * Error encountered during FPGA configuration.39 * Error encountered during the process of the service request.
41 *40 *
42 * SVC_STATUS_RSU_OK:41 * SVC_STATUS_NO_SUPPORT:
43 * Secure firmware accepts the request of remote status update (RSU).42 * Secure firmware doesn't support requested features such as RSU retry
44 *43 * or RSU notify.
45 * SVC_STATUS_RSU_ERROR:
46 * Error encountered during remote system update.
47 *
48 * SVC_STATUS_RSU_NO_SUPPORT:
49 * Secure firmware doesn't support RSU retry or notify feature.
50 */44 */
51#define SVC_STATUS_RECONFIG_REQUEST_OK 045#define SVC_STATUS_OK 0
52#define SVC_STATUS_RECONFIG_BUFFER_SUBMITTED 146#define SVC_STATUS_BUFFER_SUBMITTED 1
53#define SVC_STATUS_RECONFIG_BUFFER_DONE 247#define SVC_STATUS_BUFFER_DONE 2
54#define SVC_STATUS_RECONFIG_COMPLETED 348#define SVC_STATUS_COMPLETED 3
55#define SVC_STATUS_RECONFIG_BUSY 449#define SVC_STATUS_BUSY 4
56#define SVC_STATUS_RECONFIG_ERROR 550#define SVC_STATUS_ERROR 5
57#define SVC_STATUS_RSU_OK 651#define SVC_STATUS_NO_SUPPORT 6
58#define SVC_STATUS_RSU_ERROR 7
59#define SVC_STATUS_RSU_NO_SUPPORT 8
60 52
61/**53/**
62 * Flag bit for COMMAND_RECONFIG54 * Flag bit for COMMAND_RECONFIG
@@ -84,32 +76,29 @@ struct stratix10_svc_chan; · 21 unmodified lines
84 * @COMMAND_NOOP: do 'dummy' request for integration/debug/trouble-shooting76 * @COMMAND_NOOP: do 'dummy' request for integration/debug/trouble-shooting
85 *77 *
86 * @COMMAND_RECONFIG: ask for FPGA configuration preparation, return status78 * @COMMAND_RECONFIG: ask for FPGA configuration preparation, return status
87 * is SVC_STATUS_RECONFIG_REQUEST_OK79 * is SVC_STATUS_OK
88 *80 *
89 * @COMMAND_RECONFIG_DATA_SUBMIT: submit buffer(s) of bit-stream data for the81 * @COMMAND_RECONFIG_DATA_SUBMIT: submit buffer(s) of bit-stream data for the
90 * FPGA configuration, return status is SVC_STATUS_RECONFIG_BUFFER_SUBMITTED,82 * FPGA configuration, return status is SVC_STATUS_SUBMITTED or SVC_STATUS_ERROR
91 * or SVC_STATUS_RECONFIG_ERROR
92 *83 *
93 * @COMMAND_RECONFIG_DATA_CLAIM: check the status of the configuration, return84 * @COMMAND_RECONFIG_DATA_CLAIM: check the status of the configuration, return
94 * status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or85 * status is SVC_STATUS_COMPLETED, or SVC_STATUS_BUSY, or SVC_STATUS_ERROR
95 * SVC_STATUS_RECONFIG_ERROR
96 *86 *
97 * @COMMAND_RECONFIG_STATUS: check the status of the configuration, return87 * @COMMAND_RECONFIG_STATUS: check the status of the configuration, return
98 * status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or88 * status is SVC_STATUS_COMPLETED, or SVC_STATUS_BUSY, or SVC_STATUS_ERROR
99 * SVC_STATUS_RECONFIG_ERROR
100 *89 *
101 * @COMMAND_RSU_STATUS: request remote system update boot log, return status90 * @COMMAND_RSU_STATUS: request remote system update boot log, return status
102 * is log data or SVC_STATUS_RSU_ERROR91 * is log data or SVC_STATUS_RSU_ERROR
103 *92 *
104 * @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot,93 * @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot,
105 * return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR94 * return status is SVC_STATUS_OK or SVC_STATUS_ERROR
106 *95 *
107 * @COMMAND_RSU_NOTIFY: report the status of hard processor system96 * @COMMAND_RSU_NOTIFY: report the status of hard processor system
108 * software to firmware, return status is SVC_STATUS_RSU_OK or97 * software to firmware, return status is SVC_STATUS_OK or
109 * SVC_STATUS_RSU_ERROR98 * SVC_STATUS_ERROR
110 *99 *
111 * @COMMAND_RSU_RETRY: query firmware for the current image's retry counter,100 * @COMMAND_RSU_RETRY: query firmware for the current image's retry counter,
112 * return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR101 * return status is SVC_STATUS_OK or SVC_STATUS_ERROR
113 */102 */
114enum stratix10_svc_command_code {103enum stratix10_svc_command_code {
115 COMMAND_NOOP = 0,104 COMMAND_NOOP = 0,