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
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,