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

Showing the changes to include/linux (2 of 5 files). Show all

Unified · Split

2 files
  1. include/linux/firmware/intel/stratix10-smc.h +21 −28
  2. include/linux/firmware/intel/stratix10-svc-client.h +30 −41
include/linux/firmware/intel/stratix10-smc.h+21−28
@@ -54,32 +54,25 @@ · 53 unmodified lines
5454 * Secure monitor software doesn't recognize the request.
5555 *
5656 * INTEL_SIP_SMC_STATUS_OK:
57− * FPGA configuration completed successfully,
58− * In case of FPGA configuration write operation, it means secure monitor
59− * software can accept the next chunk of FPGA configuration data.
57+ * Secure monitor software accepts the service client's request.
6058 *
61− * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY:
62− * In case of FPGA configuration write operation, it means secure monitor
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).
59+ * INTEL_SIP_SMC_STATUS_BUSY:
60+ * Secure monitor software is still processing service client's request.
6761 *
68− * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR:
69− * There is error during the FPGA configuration process.
62+ * INTEL_SIP_SMC_STATUS_REJECTED:
63+ * Secure monitor software reject the service client's request.
7064 *
71− * INTEL_SIP_SMC_REG_ERROR:
72− * There is error during a read or write operation of the protected registers.
65+ * INTEL_SIP_SMC_STATUS_ERROR:
66+ * There is error during the process of service request.
7367 *
7468 * 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.
7670 */
7771 #define INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF
7872 #define INTEL_SIP_SMC_STATUS_OK 0x0
79−#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY 0x1
80−#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_REJECTED 0x2
81−#define INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR 0x4
82−#define INTEL_SIP_SMC_REG_ERROR 0x5
73+#define INTEL_SIP_SMC_STATUS_BUSY 0x1
74+#define INTEL_SIP_SMC_STATUS_REJECTED 0x2
75+#define INTEL_SIP_SMC_STATUS_ERROR 0x4
8376 #define INTEL_SIP_SMC_RSU_ERROR 0x7
8477
8578 /**
@@ -95,7 +88,7 @@ · 9 unmodified lines
9588 * a2-7: not used.
9689 *
9790 * 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.
9992 * a1-3: not used.
10093 */
10194 #define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_START 1
@@ -115,8 +108,8 @@ · 13 unmodified lines
115108 * a3-7: not used.
116109 *
117110 * Return status:
118− * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or
119− * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
111+ * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_STATUS_BUSY or
112+ * INTEL_SIP_SMC_STATUS_ERROR.
120113 * a1: 64bit physical address of 1st completed memory block if any completed
121114 * block, otherwise zero value.
122115 * a2: 64bit physical address of 2nd completed memory block if any completed
@@ -133,15 +126,15 @@ · 10 unmodified lines
133126 *
134127 * Sync call used by service driver at EL1 to track the completed write
135128 * 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.
137130 *
138131 * Call register usage:
139132 * a0: INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE.
140133 * a1-7: not used.
141134 *
142135 * Return status:
143− * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or
144− * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
136+ * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_BUSY or
137+ * INTEL_SIP_SMC_STATUS_ERROR.
145138 * a1: 64bit physical address of 1st completed memory block.
146139 * a2: 64bit physical address of 2nd completed memory block if
147140 * 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
164157 * a1-7: not used.
165158 *
166159 * Return status:
167− * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY or
168− * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
160+ * a0: INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_STATUS_BUSY or
161+ * INTEL_SIP_SMC_STATUS_ERROR.
169162 * a1-3: not used.
170163 */
171164 #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
183176 * a1-7: not used.
184177 *
185178 * 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.
187180 * a1: start of physical address of reserved memory block.
188181 * a2: size of reserved memory block.
189182 * a3: not used.
@@ -203,7 +196,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 13 unmodified lines
203196 * a1-7: not used.
204197 *
205198 * 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.
207200 * a1-3: not used.
208201 */
209202 #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
1818 /**
1919 * Status of the sent command, in bit number
2020 *
21− * SVC_COMMAND_STATUS_RECONFIG_REQUEST_OK:
22− * Secure firmware accepts the request of FPGA reconfiguration.
21+ * SVC_STATUS_OK:
22+ * Secure firmware accepts the request issued by one of service clients.
2323 *
24− * SVC_STATUS_RECONFIG_BUFFER_SUBMITTED:
25− * Service client successfully submits FPGA configuration
26− * data buffer to secure firmware.
24+ * SVC_STATUS_BUFFER_SUBMITTED:
25+ * Service client successfully submits data buffer to secure firmware.
2726 *
28− * SVC_COMMAND_STATUS_RECONFIG_BUFFER_DONE:
27+ * SVC_STATUS_BUFFER_DONE:
2928 * Secure firmware completes data process, ready to accept the
3029 * next WRITE transaction.
3130 *
32− * SVC_COMMAND_STATUS_RECONFIG_COMPLETED:
33− * Secure firmware completes FPGA configuration successfully, FPGA should
34− * be in user mode.
31+ * SVC_STATUS_COMPLETED:
32+ * Secure firmware completes service request successfully. In case of
33+ * FPGA configuration, FPGA should be in user mode.
3534 *
36− * SVC_COMMAND_STATUS_RECONFIG_BUSY:
37− * FPGA configuration is still in process.
35+ * SVC_COMMAND_STATUS_BUSY:
36+ * Service request is still in process.
3837 *
39− * SVC_COMMAND_STATUS_RECONFIG_ERROR:
40− * Error encountered during FPGA configuration.
38+ * SVC_COMMAND_STATUS_ERROR:
39+ * Error encountered during the process of the service request.
4140 *
42− * SVC_STATUS_RSU_OK:
43− * Secure firmware accepts the request of remote status update (RSU).
44− *
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.
41+ * SVC_STATUS_NO_SUPPORT:
42+ * Secure firmware doesn't support requested features such as RSU retry
43+ * or RSU notify.
5044 */
51−#define SVC_STATUS_RECONFIG_REQUEST_OK 0
52−#define SVC_STATUS_RECONFIG_BUFFER_SUBMITTED 1
53−#define SVC_STATUS_RECONFIG_BUFFER_DONE 2
54−#define SVC_STATUS_RECONFIG_COMPLETED 3
55−#define SVC_STATUS_RECONFIG_BUSY 4
56−#define SVC_STATUS_RECONFIG_ERROR 5
57−#define SVC_STATUS_RSU_OK 6
58−#define SVC_STATUS_RSU_ERROR 7
59−#define SVC_STATUS_RSU_NO_SUPPORT 8
45+#define SVC_STATUS_OK 0
46+#define SVC_STATUS_BUFFER_SUBMITTED 1
47+#define SVC_STATUS_BUFFER_DONE 2
48+#define SVC_STATUS_COMPLETED 3
49+#define SVC_STATUS_BUSY 4
50+#define SVC_STATUS_ERROR 5
51+#define SVC_STATUS_NO_SUPPORT 6
6052
6153 /**
6254 * Flag bit for COMMAND_RECONFIG
@@ -84,32 +76,29 @@ struct stratix10_svc_chan; · 21 unmodified lines
8476 * @COMMAND_NOOP: do 'dummy' request for integration/debug/trouble-shooting
8577 *
8678 * @COMMAND_RECONFIG: ask for FPGA configuration preparation, return status
87− * is SVC_STATUS_RECONFIG_REQUEST_OK
79+ * is SVC_STATUS_OK
8880 *
8981 * @COMMAND_RECONFIG_DATA_SUBMIT: submit buffer(s) of bit-stream data for the
90− * FPGA configuration, return status is SVC_STATUS_RECONFIG_BUFFER_SUBMITTED,
91− * or SVC_STATUS_RECONFIG_ERROR
82+ * FPGA configuration, return status is SVC_STATUS_SUBMITTED or SVC_STATUS_ERROR
9283 *
9384 * @COMMAND_RECONFIG_DATA_CLAIM: check the status of the configuration, return
94− * status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or
95− * SVC_STATUS_RECONFIG_ERROR
85+ * status is SVC_STATUS_COMPLETED, or SVC_STATUS_BUSY, or SVC_STATUS_ERROR
9686 *
9787 * @COMMAND_RECONFIG_STATUS: check the status of the configuration, return
98− * status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or
99− * SVC_STATUS_RECONFIG_ERROR
88+ * status is SVC_STATUS_COMPLETED, or SVC_STATUS_BUSY, or SVC_STATUS_ERROR
10089 *
10190 * @COMMAND_RSU_STATUS: request remote system update boot log, return status
10291 * is log data or SVC_STATUS_RSU_ERROR
10392 *
10493 * @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_ERROR
94+ * return status is SVC_STATUS_OK or SVC_STATUS_ERROR
10695 *
10796 * @COMMAND_RSU_NOTIFY: report the status of hard processor system
108− * software to firmware, return status is SVC_STATUS_RSU_OK or
109− * SVC_STATUS_RSU_ERROR
97+ * software to firmware, return status is SVC_STATUS_OK or
98+ * SVC_STATUS_ERROR
11099 *
111100 * @COMMAND_RSU_RETRY: query firmware for the current image's retry counter,
112− * return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR
101+ * return status is SVC_STATUS_OK or SVC_STATUS_ERROR
113102 */
114103 enum stratix10_svc_command_code {
115104 COMMAND_NOOP = 0,