aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/firmware
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-28 23:54:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-28 23:54:57 -0500
commit457fa3469a65a524be04412f5cd497fa3b11c9fd (patch)
treee826786d7838668595dfac115ced53b32e5c97b9 /include/linux/firmware
parentb07039b79c9ea64c1eacda1e01d645082e4a0d5d (diff)
parentfbc4904c287778ddb74bf6060ac9dec51992fc53 (diff)
Merge tag 'char-misc-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH: "Here is the big set of char and misc driver patches for 4.21-rc1. Lots of different types of driver things in here, as this tree seems to be the "collection of various driver subsystems not big enough to have their own git tree" lately. Anyway, some highlights of the changes in here: - binderfs: is it a rule that all driver subsystems will eventually grow to have their own filesystem? Binder now has one to handle the use of it in containerized systems. This was discussed at the Plumbers conference a few months ago and knocked into mergable shape very fast by Christian Brauner. Who also has signed up to be another binder maintainer, showing a distinct lack of good judgement :) - binder updates and fixes - mei driver updates - fpga driver updates and additions - thunderbolt driver updates - soundwire driver updates - extcon driver updates - nvmem driver updates - hyper-v driver updates - coresight driver updates - pvpanic driver additions and reworking for more device support - lp driver updates. Yes really, it's _finally_ moved to the proper parallal port driver model, something I never thought I would see happen. Good stuff. - other tiny driver updates and fixes. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (116 commits) MAINTAINERS: add another Android binder maintainer intel_th: msu: Fix an off-by-one in attribute store stm class: Add a reference to the SyS-T document stm class: Fix a module refcount leak in policy creation error path char: lp: use new parport device model char: lp: properly count the lp devices char: lp: use first unused lp number while registering char: lp: detach the device when parallel port is removed char: lp: introduce list to save port number bus: qcom: remove duplicated include from qcom-ebi2.c VMCI: Use memdup_user() rather than duplicating its implementation char/rtc: Use of_node_name_eq for node name comparisons misc: mic: fix a DMA pool free failure ptp: fix an IS_ERR() vs NULL check genwqe: Fix size check binder: implement binderfs binder: fix use-after-free due to ksys_close() during fdget() bus: fsl-mc: remove duplicated include files bus: fsl-mc: explicitly define the fsl_mc_command endianness misc: ti-st: make array read_ver_cmd static, shrinks object size ...
Diffstat (limited to 'include/linux/firmware')
-rw-r--r--include/linux/firmware/intel/stratix10-smc.h312
-rw-r--r--include/linux/firmware/intel/stratix10-svc-client.h217
2 files changed, 529 insertions, 0 deletions
diff --git a/include/linux/firmware/intel/stratix10-smc.h b/include/linux/firmware/intel/stratix10-smc.h
new file mode 100644
index 000000000000..5be5dab50b13
--- /dev/null
+++ b/include/linux/firmware/intel/stratix10-smc.h
@@ -0,0 +1,312 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2017-2018, Intel Corporation
4 */
5
6#ifndef __STRATIX10_SMC_H
7#define __STRATIX10_SMC_H
8
9#include <linux/arm-smccc.h>
10#include <linux/bitops.h>
11
12/**
13 * This file defines the Secure Monitor Call (SMC) message protocol used for
14 * service layer driver in normal world (EL1) to communicate with secure
15 * monitor software in Secure Monitor Exception Level 3 (EL3).
16 *
17 * This file is shared with secure firmware (FW) which is out of kernel tree.
18 *
19 * An ARM SMC instruction takes a function identifier and up to 6 64-bit
20 * register values as arguments, and can return up to 4 64-bit register
21 * value. The operation of the secure monitor is determined by the parameter
22 * values passed in through registers.
23 *
24 * EL1 and EL3 communicates pointer as physical address rather than the
25 * virtual address.
26 *
27 * Functions specified by ARM SMC Calling convention:
28 *
29 * FAST call executes atomic operations, returns when the requested operation
30 * has completed.
31 * STD call starts a operation which can be preempted by a non-secure
32 * interrupt. The call can return before the requested operation has
33 * completed.
34 *
35 * a0..a7 is used as register names in the descriptions below, on arm32
36 * that translates to r0..r7 and on arm64 to w0..w7.
37 */
38
39/**
40 * @func_num: function ID
41 */
42#define INTEL_SIP_SMC_STD_CALL_VAL(func_num) \
43 ARM_SMCCC_CALL_VAL(ARM_SMCCC_STD_CALL, ARM_SMCCC_SMC_64, \
44 ARM_SMCCC_OWNER_SIP, (func_num))
45
46#define INTEL_SIP_SMC_FAST_CALL_VAL(func_num) \
47 ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_64, \
48 ARM_SMCCC_OWNER_SIP, (func_num))
49
50/**
51 * Return values in INTEL_SIP_SMC_* call
52 *
53 * INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION:
54 * Secure monitor software doesn't recognize the request.
55 *
56 * 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.
60 *
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).
67 *
68 * INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR:
69 * There is error during the FPGA configuration process.
70 *
71 * INTEL_SIP_SMC_REG_ERROR:
72 * There is error during a read or write operation of the protected registers.
73 *
74 * INTEL_SIP_SMC_RSU_ERROR:
75 * There is error during a remote status update.
76 */
77#define INTEL_SIP_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF
78#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
83#define INTEL_SIP_SMC_RSU_ERROR 0x7
84
85/**
86 * Request INTEL_SIP_SMC_FPGA_CONFIG_START
87 *
88 * Sync call used by service driver at EL1 to request the FPGA in EL3 to
89 * be prepare to receive a new configuration.
90 *
91 * Call register usage:
92 * a0: INTEL_SIP_SMC_FPGA_CONFIG_START.
93 * a1: flag for full or partial configuration. 0 for full and 1 for partial
94 * configuration.
95 * a2-7: not used.
96 *
97 * Return status:
98 * a0: INTEL_SIP_SMC_STATUS_OK, or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
99 * a1-3: not used.
100 */
101#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_START 1
102#define INTEL_SIP_SMC_FPGA_CONFIG_START \
103 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_START)
104
105/**
106 * Request INTEL_SIP_SMC_FPGA_CONFIG_WRITE
107 *
108 * Async call used by service driver at EL1 to provide FPGA configuration data
109 * to secure world.
110 *
111 * Call register usage:
112 * a0: INTEL_SIP_SMC_FPGA_CONFIG_WRITE.
113 * a1: 64bit physical address of the configuration data memory block
114 * a2: Size of configuration data block.
115 * a3-7: not used.
116 *
117 * 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.
120 * a1: 64bit physical address of 1st completed memory block if any completed
121 * block, otherwise zero value.
122 * a2: 64bit physical address of 2nd completed memory block if any completed
123 * block, otherwise zero value.
124 * a3: 64bit physical address of 3rd completed memory block if any completed
125 * block, otherwise zero value.
126 */
127#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_WRITE 2
128#define INTEL_SIP_SMC_FPGA_CONFIG_WRITE \
129 INTEL_SIP_SMC_STD_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_WRITE)
130
131/**
132 * Request INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE
133 *
134 * 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_WRITE
136 * call returns INTEL_SIP_SMC_FPGA_CONFIG_STATUS_BUSY.
137 *
138 * Call register usage:
139 * a0: INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE.
140 * a1-7: not used.
141 *
142 * 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.
145 * a1: 64bit physical address of 1st completed memory block.
146 * a2: 64bit physical address of 2nd completed memory block if
147 * any completed block, otherwise zero value.
148 * a3: 64bit physical address of 3rd completed memory block if
149 * any completed block, otherwise zero value.
150 */
151#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE 3
152#define INTEL_SIP_SMC_FPGA_CONFIG_COMPLETED_WRITE \
153INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE)
154
155/**
156 * Request INTEL_SIP_SMC_FPGA_CONFIG_ISDONE
157 *
158 * Sync call used by service driver at EL1 to inform secure world that all
159 * data are sent, to check whether or not the secure world had completed
160 * the FPGA configuration process.
161 *
162 * Call register usage:
163 * a0: INTEL_SIP_SMC_FPGA_CONFIG_ISDONE.
164 * a1-7: not used.
165 *
166 * 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.
169 * a1-3: not used.
170 */
171#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_ISDONE 4
172#define INTEL_SIP_SMC_FPGA_CONFIG_ISDONE \
173 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_ISDONE)
174
175/**
176 * Request INTEL_SIP_SMC_FPGA_CONFIG_GET_MEM
177 *
178 * Sync call used by service driver at EL1 to query the physical address of
179 * memory block reserved by secure monitor software.
180 *
181 * Call register usage:
182 * a0:INTEL_SIP_SMC_FPGA_CONFIG_GET_MEM.
183 * a1-7: not used.
184 *
185 * Return status:
186 * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
187 * a1: start of physical address of reserved memory block.
188 * a2: size of reserved memory block.
189 * a3: not used.
190 */
191#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_GET_MEM 5
192#define INTEL_SIP_SMC_FPGA_CONFIG_GET_MEM \
193 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_GET_MEM)
194
195/**
196 * Request INTEL_SIP_SMC_FPGA_CONFIG_LOOPBACK
197 *
198 * For SMC loop-back mode only, used for internal integration, debugging
199 * or troubleshooting.
200 *
201 * Call register usage:
202 * a0: INTEL_SIP_SMC_FPGA_CONFIG_LOOPBACK.
203 * a1-7: not used.
204 *
205 * Return status:
206 * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_FPGA_CONFIG_STATUS_ERROR.
207 * a1-3: not used.
208 */
209#define INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK 6
210#define INTEL_SIP_SMC_FPGA_CONFIG_LOOPBACK \
211 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK)
212
213/*
214 * Request INTEL_SIP_SMC_REG_READ
215 *
216 * Read a protected register at EL3
217 *
218 * Call register usage:
219 * a0: INTEL_SIP_SMC_REG_READ.
220 * a1: register address.
221 * a2-7: not used.
222 *
223 * Return status:
224 * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_REG_ERROR.
225 * a1: value in the register
226 * a2-3: not used.
227 */
228#define INTEL_SIP_SMC_FUNCID_REG_READ 7
229#define INTEL_SIP_SMC_REG_READ \
230 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_READ)
231
232/*
233 * Request INTEL_SIP_SMC_REG_WRITE
234 *
235 * Write a protected register at EL3
236 *
237 * Call register usage:
238 * a0: INTEL_SIP_SMC_REG_WRITE.
239 * a1: register address
240 * a2: value to program into register.
241 * a3-7: not used.
242 *
243 * Return status:
244 * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_REG_ERROR.
245 * a1-3: not used.
246 */
247#define INTEL_SIP_SMC_FUNCID_REG_WRITE 8
248#define INTEL_SIP_SMC_REG_WRITE \
249 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_WRITE)
250
251/*
252 * Request INTEL_SIP_SMC_FUNCID_REG_UPDATE
253 *
254 * Update one or more bits in a protected register at EL3 using a
255 * read-modify-write operation.
256 *
257 * Call register usage:
258 * a0: INTEL_SIP_SMC_REG_UPDATE.
259 * a1: register address
260 * a2: write Mask.
261 * a3: value to write.
262 * a4-7: not used.
263 *
264 * Return status:
265 * a0: INTEL_SIP_SMC_STATUS_OK or INTEL_SIP_SMC_REG_ERROR.
266 * a1-3: Not used.
267 */
268#define INTEL_SIP_SMC_FUNCID_REG_UPDATE 9
269#define INTEL_SIP_SMC_REG_UPDATE \
270 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_UPDATE)
271
272/*
273 * Request INTEL_SIP_SMC_RSU_STATUS
274 *
275 * Request remote status update boot log, call is synchronous.
276 *
277 * Call register usage:
278 * a0 INTEL_SIP_SMC_RSU_STATUS
279 * a1-7 not used
280 *
281 * Return status
282 * a0: Current Image
283 * a1: Last Failing Image
284 * a2: Version | State
285 * a3: Error details | Error location
286 *
287 * Or
288 *
289 * a0: INTEL_SIP_SMC_RSU_ERROR
290 */
291#define INTEL_SIP_SMC_FUNCID_RSU_STATUS 11
292#define INTEL_SIP_SMC_RSU_STATUS \
293 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_STATUS)
294
295/*
296 * Request INTEL_SIP_SMC_RSU_UPDATE
297 *
298 * Request to set the offset of the bitstream to boot after reboot, call
299 * is synchronous.
300 *
301 * Call register usage:
302 * a0 INTEL_SIP_SMC_RSU_UPDATE
303 * a1 64bit physical address of the configuration data memory in flash
304 * a2-7 not used
305 *
306 * Return status
307 * a0 INTEL_SIP_SMC_STATUS_OK
308 */
309#define INTEL_SIP_SMC_FUNCID_RSU_UPDATE 12
310#define INTEL_SIP_SMC_RSU_UPDATE \
311 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_UPDATE)
312#endif
diff --git a/include/linux/firmware/intel/stratix10-svc-client.h b/include/linux/firmware/intel/stratix10-svc-client.h
new file mode 100644
index 000000000000..e521f172a47a
--- /dev/null
+++ b/include/linux/firmware/intel/stratix10-svc-client.h
@@ -0,0 +1,217 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2017-2018, Intel Corporation
4 */
5
6#ifndef __STRATIX10_SVC_CLIENT_H
7#define __STRATIX10_SVC_CLIENT_H
8
9/**
10 * Service layer driver supports client names
11 *
12 * fpga: for FPGA configuration
13 * rsu: for remote status update
14 */
15#define SVC_CLIENT_FPGA "fpga"
16#define SVC_CLIENT_RSU "rsu"
17
18/**
19 * Status of the sent command, in bit number
20 *
21 * SVC_COMMAND_STATUS_RECONFIG_REQUEST_OK:
22 * Secure firmware accepts the request of FPGA reconfiguration.
23 *
24 * SVC_STATUS_RECONFIG_BUFFER_SUBMITTED:
25 * Service client successfully submits FPGA configuration
26 * data buffer to secure firmware.
27 *
28 * SVC_COMMAND_STATUS_RECONFIG_BUFFER_DONE:
29 * Secure firmware completes data process, ready to accept the
30 * next WRITE transaction.
31 *
32 * SVC_COMMAND_STATUS_RECONFIG_COMPLETED:
33 * Secure firmware completes FPGA configuration successfully, FPGA should
34 * be in user mode.
35 *
36 * SVC_COMMAND_STATUS_RECONFIG_BUSY:
37 * FPGA configuration is still in process.
38 *
39 * SVC_COMMAND_STATUS_RECONFIG_ERROR:
40 * Error encountered during FPGA configuration.
41 *
42 * SVC_STATUS_RSU_OK:
43 * Secure firmware accepts the request of remote status update (RSU).
44 */
45#define SVC_STATUS_RECONFIG_REQUEST_OK 0
46#define SVC_STATUS_RECONFIG_BUFFER_SUBMITTED 1
47#define SVC_STATUS_RECONFIG_BUFFER_DONE 2
48#define SVC_STATUS_RECONFIG_COMPLETED 3
49#define SVC_STATUS_RECONFIG_BUSY 4
50#define SVC_STATUS_RECONFIG_ERROR 5
51#define SVC_STATUS_RSU_OK 6
52#define SVC_STATUS_RSU_ERROR 7
53/**
54 * Flag bit for COMMAND_RECONFIG
55 *
56 * COMMAND_RECONFIG_FLAG_PARTIAL:
57 * Set to FPGA configuration type (full or partial), the default
58 * is full reconfig.
59 */
60#define COMMAND_RECONFIG_FLAG_PARTIAL 0
61
62/**
63 * Timeout settings for service clients:
64 * timeout value used in Stratix10 FPGA manager driver.
65 * timeout value used in RSU driver
66 */
67#define SVC_RECONFIG_REQUEST_TIMEOUT_MS 100
68#define SVC_RECONFIG_BUFFER_TIMEOUT_MS 240
69#define SVC_RSU_REQUEST_TIMEOUT_MS 300
70
71struct stratix10_svc_chan;
72
73/**
74 * enum stratix10_svc_command_code - supported service commands
75 *
76 * @COMMAND_NOOP: do 'dummy' request for integration/debug/trouble-shooting
77 *
78 * @COMMAND_RECONFIG: ask for FPGA configuration preparation, return status
79 * is SVC_STATUS_RECONFIG_REQUEST_OK
80 *
81 * @COMMAND_RECONFIG_DATA_SUBMIT: submit buffer(s) of bit-stream data for the
82 * FPGA configuration, return status is SVC_STATUS_RECONFIG_BUFFER_SUBMITTED,
83 * or SVC_STATUS_RECONFIG_ERROR
84 *
85 * @COMMAND_RECONFIG_DATA_CLAIM: check the status of the configuration, return
86 * status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or
87 * SVC_STATUS_RECONFIG_ERROR
88 *
89 * @COMMAND_RECONFIG_STATUS: check the status of the configuration, return
90 * status is SVC_STATUS_RECONFIG_COMPLETED, or SVC_STATUS_RECONFIG_BUSY, or
91 * SVC_STATUS_RECONFIG_ERROR
92 *
93 * @COMMAND_RSU_STATUS: request remote system update boot log, return status
94 * is log data or SVC_STATUS_RSU_ERROR
95 *
96 * @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot,
97 * return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR
98 */
99enum stratix10_svc_command_code {
100 COMMAND_NOOP = 0,
101 COMMAND_RECONFIG,
102 COMMAND_RECONFIG_DATA_SUBMIT,
103 COMMAND_RECONFIG_DATA_CLAIM,
104 COMMAND_RECONFIG_STATUS,
105 COMMAND_RSU_STATUS,
106 COMMAND_RSU_UPDATE
107};
108
109/**
110 * struct stratix10_svc_client_msg - message sent by client to service
111 * @payload: starting address of data need be processed
112 * @payload_length: data size in bytes
113 * @command: service command
114 * @arg: args to be passed via registers and not physically mapped buffers
115 */
116struct stratix10_svc_client_msg {
117 void *payload;
118 size_t payload_length;
119 enum stratix10_svc_command_code command;
120 u64 arg[3];
121};
122
123/**
124 * struct stratix10_svc_command_config_type - config type
125 * @flags: flag bit for the type of FPGA configuration
126 */
127struct stratix10_svc_command_config_type {
128 u32 flags;
129};
130
131/**
132 * struct stratix10_svc_cb_data - callback data structure from service layer
133 * @status: the status of sent command
134 * @kaddr1: address of 1st completed data block
135 * @kaddr2: address of 2nd completed data block
136 * @kaddr3: address of 3rd completed data block
137 */
138struct stratix10_svc_cb_data {
139 u32 status;
140 void *kaddr1;
141 void *kaddr2;
142 void *kaddr3;
143};
144
145/**
146 * struct stratix10_svc_client - service client structure
147 * @dev: the client device
148 * @receive_cb: callback to provide service client the received data
149 * @priv: client private data
150 */
151struct stratix10_svc_client {
152 struct device *dev;
153 void (*receive_cb)(struct stratix10_svc_client *client,
154 struct stratix10_svc_cb_data *cb_data);
155 void *priv;
156};
157
158/**
159 * stratix10_svc_request_channel_byname() - request service channel
160 * @client: identity of the client requesting the channel
161 * @name: supporting client name defined above
162 *
163 * Return: a pointer to channel assigned to the client on success,
164 * or ERR_PTR() on error.
165 */
166struct stratix10_svc_chan
167*stratix10_svc_request_channel_byname(struct stratix10_svc_client *client,
168 const char *name);
169
170/**
171 * stratix10_svc_free_channel() - free service channel.
172 * @chan: service channel to be freed
173 */
174void stratix10_svc_free_channel(struct stratix10_svc_chan *chan);
175
176/**
177 * stratix10_svc_allocate_memory() - allocate the momory
178 * @chan: service channel assigned to the client
179 * @size: number of bytes client requests
180 *
181 * Service layer allocates the requested number of bytes from the memory
182 * pool for the client.
183 *
184 * Return: the starting address of allocated memory on success, or
185 * ERR_PTR() on error.
186 */
187void *stratix10_svc_allocate_memory(struct stratix10_svc_chan *chan,
188 size_t size);
189
190/**
191 * stratix10_svc_free_memory() - free allocated memory
192 * @chan: service channel assigned to the client
193 * @kaddr: starting address of memory to be free back to pool
194 */
195void stratix10_svc_free_memory(struct stratix10_svc_chan *chan, void *kaddr);
196
197/**
198 * stratix10_svc_send() - send a message to the remote
199 * @chan: service channel assigned to the client
200 * @msg: message data to be sent, in the format of
201 * struct stratix10_svc_client_msg
202 *
203 * Return: 0 for success, -ENOMEM or -ENOBUFS on error.
204 */
205int stratix10_svc_send(struct stratix10_svc_chan *chan, void *msg);
206
207/**
208 * intel_svc_done() - complete service request
209 * @chan: service channel assigned to the client
210 *
211 * This function is used by service client to inform service layer that
212 * client's service requests are completed, or there is an error in the
213 * request process.
214 */
215void stratix10_svc_done(struct stratix10_svc_chan *chan);
216#endif
217