OSDN Git Service

drivers: leds: Import Xiaomi changes
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / include / linux / msm_gsi.h
1 /* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 and
5  * only version 2 as published by the Free Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  */
12 #ifndef MSM_GSI_H
13 #define MSM_GSI_H
14 #include <linux/types.h>
15
16 enum gsi_ver {
17         GSI_VER_ERR = 0,
18         GSI_VER_1_0 = 1,
19         GSI_VER_1_2 = 2,
20         GSI_VER_1_3 = 3,
21         GSI_VER_MAX,
22 };
23
24 enum gsi_status {
25         GSI_STATUS_SUCCESS = 0,
26         GSI_STATUS_ERROR = 1,
27         GSI_STATUS_RING_INSUFFICIENT_SPACE = 2,
28         GSI_STATUS_RING_EMPTY = 3,
29         GSI_STATUS_RES_ALLOC_FAILURE = 4,
30         GSI_STATUS_BAD_STATE = 5,
31         GSI_STATUS_INVALID_PARAMS = 6,
32         GSI_STATUS_UNSUPPORTED_OP = 7,
33         GSI_STATUS_NODEV = 8,
34         GSI_STATUS_POLL_EMPTY = 9,
35         GSI_STATUS_EVT_RING_INCOMPATIBLE = 10,
36         GSI_STATUS_TIMED_OUT = 11,
37         GSI_STATUS_AGAIN = 12,
38 };
39
40 enum gsi_per_evt {
41         GSI_PER_EVT_GLOB_ERROR,
42         GSI_PER_EVT_GLOB_GP1,
43         GSI_PER_EVT_GLOB_GP2,
44         GSI_PER_EVT_GLOB_GP3,
45         GSI_PER_EVT_GENERAL_BREAK_POINT,
46         GSI_PER_EVT_GENERAL_BUS_ERROR,
47         GSI_PER_EVT_GENERAL_CMD_FIFO_OVERFLOW,
48         GSI_PER_EVT_GENERAL_MCS_STACK_OVERFLOW,
49 };
50
51 /**
52  * gsi_per_notify - Peripheral callback info
53  *
54  * @user_data: cookie supplied in gsi_register_device
55  * @evt_id:    type of notification
56  * @err_desc:  error related information
57  *
58  */
59 struct gsi_per_notify {
60         void *user_data;
61         enum gsi_per_evt evt_id;
62         union {
63                 uint16_t err_desc;
64         } data;
65 };
66
67 enum gsi_intr_type {
68         GSI_INTR_MSI = 0x0,
69         GSI_INTR_IRQ = 0x1
70 };
71
72
73 /**
74  * gsi_per_props - Peripheral related properties
75  *
76  * @gsi:        GSI core version
77  * @ee:         EE where this driver and peripheral driver runs
78  * @intr:       control interrupt type
79  * @intvec:     write data for MSI write
80  * @msi_addr:   MSI address
81  * @irq:        IRQ number
82  * @phys_addr:  physical address of GSI block
83  * @size:       register size of GSI block
84  * @notify_cb:  general notification callback
85  * @req_clk_cb: callback to request peripheral clock
86  *              granted should be set to true if request is completed
87  *              synchronously, false otherwise (peripheral needs
88  *              to call gsi_complete_clk_grant later when request is
89  *              completed)
90  *              if this callback is not provided, then GSI will assume
91  *              peripheral is clocked at all times
92  * @rel_clk_cb: callback to release peripheral clock
93  * @user_data:  cookie used for notifications
94  *
95  * All the callbacks are in interrupt context
96  *
97  */
98 struct gsi_per_props {
99         enum gsi_ver ver;
100         unsigned int ee;
101         enum gsi_intr_type intr;
102         uint32_t intvec;
103         uint64_t msi_addr;
104         unsigned int irq;
105         phys_addr_t phys_addr;
106         unsigned long size;
107         void (*notify_cb)(struct gsi_per_notify *notify);
108         void (*req_clk_cb)(void *user_data, bool *granted);
109         int (*rel_clk_cb)(void *user_data);
110         void *user_data;
111 };
112
113 enum gsi_evt_err {
114         GSI_EVT_OUT_OF_BUFFERS_ERR = 0x0,
115         GSI_EVT_OUT_OF_RESOURCES_ERR = 0x1,
116         GSI_EVT_UNSUPPORTED_INTER_EE_OP_ERR = 0x2,
117         GSI_EVT_EVT_RING_EMPTY_ERR = 0x3,
118 };
119
120 /**
121  * gsi_evt_err_notify - event ring error callback info
122  *
123  * @user_data: cookie supplied in gsi_alloc_evt_ring
124  * @evt_id:    type of error
125  * @err_desc:  more info about the error
126  *
127  */
128 struct gsi_evt_err_notify {
129         void *user_data;
130         enum gsi_evt_err evt_id;
131         uint16_t err_desc;
132 };
133
134 enum gsi_evt_chtype {
135         GSI_EVT_CHTYPE_MHI_EV = 0x0,
136         GSI_EVT_CHTYPE_XHCI_EV = 0x1,
137         GSI_EVT_CHTYPE_GPI_EV = 0x2,
138         GSI_EVT_CHTYPE_XDCI_EV = 0x3
139 };
140
141 enum gsi_evt_ring_elem_size {
142         GSI_EVT_RING_RE_SIZE_4B = 4,
143         GSI_EVT_RING_RE_SIZE_16B = 16,
144 };
145
146 /**
147  * gsi_evt_ring_props - Event ring related properties
148  *
149  * @intf:            interface type (of the associated channel)
150  * @intr:            interrupt type
151  * @re_size:         size of event ring element
152  * @ring_len:        length of ring in bytes (must be integral multiple of
153  *                   re_size)
154  * @ring_base_addr:  physical base address of ring. Address must be aligned to
155  *                   ring_len rounded to power of two
156  * @ring_base_vaddr: virtual base address of ring (set to NULL when not
157  *                   applicable)
158  * @int_modt:        cycles base interrupt moderation (32KHz clock)
159  * @int_modc:        interrupt moderation packet counter
160  * @intvec:          write data for MSI write
161  * @msi_addr:        MSI address
162  * @rp_update_addr:  physical address to which event read pointer should be
163  *                   written on every event generation. must be set to 0 when
164  *                   no update is desdired
165  * @exclusive:       if true, only one GSI channel can be associated with this
166  *                   event ring. if false, the event ring can be shared among
167  *                   multiple GSI channels but in that case no polling
168  *                   (GSI_CHAN_MODE_POLL) is supported on any of those channels
169  * @err_cb:          error notification callback
170  * @user_data:       cookie used for error notifications
171  * @evchid_valid:    is evchid valid?
172  * @evchid:          the event ID that is being specifically requested (this is
173  *                   relevant for MHI where doorbell routing requires ERs to be
174  *                   physically contiguous)
175  */
176 struct gsi_evt_ring_props {
177         enum gsi_evt_chtype intf;
178         enum gsi_intr_type intr;
179         enum gsi_evt_ring_elem_size re_size;
180         uint16_t ring_len;
181         uint64_t ring_base_addr;
182         void *ring_base_vaddr;
183         uint16_t int_modt;
184         uint8_t int_modc;
185         uint32_t intvec;
186         uint64_t msi_addr;
187         uint64_t rp_update_addr;
188         bool exclusive;
189         void (*err_cb)(struct gsi_evt_err_notify *notify);
190         void *user_data;
191         bool evchid_valid;
192         uint8_t evchid;
193 };
194
195 enum gsi_chan_mode {
196         GSI_CHAN_MODE_CALLBACK = 0x0,
197         GSI_CHAN_MODE_POLL = 0x1,
198 };
199
200 enum gsi_chan_prot {
201         GSI_CHAN_PROT_MHI = 0x0,
202         GSI_CHAN_PROT_XHCI = 0x1,
203         GSI_CHAN_PROT_GPI = 0x2,
204         GSI_CHAN_PROT_XDCI = 0x3
205 };
206
207 enum gsi_chan_dir {
208         GSI_CHAN_DIR_FROM_GSI = 0x0,
209         GSI_CHAN_DIR_TO_GSI = 0x1
210 };
211
212 enum gsi_max_prefetch {
213         GSI_ONE_PREFETCH_SEG = 0x0,
214         GSI_TWO_PREFETCH_SEG = 0x1
215 };
216
217 enum gsi_chan_evt {
218         GSI_CHAN_EVT_INVALID = 0x0,
219         GSI_CHAN_EVT_SUCCESS = 0x1,
220         GSI_CHAN_EVT_EOT = 0x2,
221         GSI_CHAN_EVT_OVERFLOW = 0x3,
222         GSI_CHAN_EVT_EOB = 0x4,
223         GSI_CHAN_EVT_OOB = 0x5,
224         GSI_CHAN_EVT_DB_MODE = 0x6,
225         GSI_CHAN_EVT_UNDEFINED = 0x10,
226         GSI_CHAN_EVT_RE_ERROR = 0x11,
227 };
228
229 /**
230  * gsi_chan_xfer_notify - Channel callback info
231  *
232  * @chan_user_data: cookie supplied in gsi_alloc_channel
233  * @xfer_user_data: cookie of the gsi_xfer_elem that caused the
234  *                  event to be generated
235  * @evt_id:         type of event triggered by the associated TRE
236  *                  (corresponding to xfer_user_data)
237  * @bytes_xfered:   number of bytes transferred by the associated TRE
238  *                  (corresponding to xfer_user_data)
239  *
240  */
241 struct gsi_chan_xfer_notify {
242         void *chan_user_data;
243         void *xfer_user_data;
244         enum gsi_chan_evt evt_id;
245         uint16_t bytes_xfered;
246 };
247
248 enum gsi_chan_err {
249         GSI_CHAN_INVALID_TRE_ERR = 0x0,
250         GSI_CHAN_NON_ALLOCATED_EVT_ACCESS_ERR = 0x1,
251         GSI_CHAN_OUT_OF_BUFFERS_ERR = 0x2,
252         GSI_CHAN_OUT_OF_RESOURCES_ERR = 0x3,
253         GSI_CHAN_UNSUPPORTED_INTER_EE_OP_ERR = 0x4,
254         GSI_CHAN_HWO_1_ERR = 0x5
255 };
256
257 /**
258  * gsi_chan_err_notify - Channel general callback info
259  *
260  * @chan_user_data: cookie supplied in gsi_alloc_channel
261  * @evt_id:         type of error
262  * @err_desc:  more info about the error
263  *
264  */
265 struct gsi_chan_err_notify {
266         void *chan_user_data;
267         enum gsi_chan_err evt_id;
268         uint16_t err_desc;
269 };
270
271 enum gsi_chan_ring_elem_size {
272         GSI_CHAN_RE_SIZE_4B = 4,
273         GSI_CHAN_RE_SIZE_16B = 16,
274         GSI_CHAN_RE_SIZE_32B = 32,
275 };
276
277 enum gsi_chan_use_db_eng {
278         GSI_CHAN_DIRECT_MODE = 0x0,
279         GSI_CHAN_DB_MODE = 0x1,
280 };
281
282 /**
283  * gsi_chan_props - Channel related properties
284  *
285  * @prot:            interface type
286  * @dir:             channel direction
287  * @ch_id:           virtual channel ID
288  * @evt_ring_hdl:    handle of associated event ring. set to ~0 if no
289  *                   event ring associated
290  * @re_size:         size of channel ring element
291  * @ring_len:        length of ring in bytes (must be integral multiple of
292  *                   re_size)
293  * @max_re_expected: maximal number of ring elements expected to be queued.
294  *                   used for data path statistics gathering. if 0 provided
295  *                   ring_len / re_size will be used.
296  * @ring_base_addr:  physical base address of ring. Address must be aligned to
297  *                   ring_len rounded to power of two
298  * @ring_base_vaddr: virtual base address of ring (set to NULL when not
299  *                   applicable)
300  * @use_db_eng:      0 => direct mode (doorbells are written directly to RE
301  *                   engine)
302  *                   1 => DB mode (doorbells are written to DB engine)
303  * @max_prefetch:    limit number of pre-fetch segments for channel
304  * @low_weight:      low channel weight (priority of channel for RE engine
305  *                   round robin algorithm); must be >= 1
306  * @xfer_cb:         transfer notification callback, this callback happens
307  *                   on event boundaries
308  *
309  *                   e.g. 1
310  *
311  *                   out TD with 3 REs
312  *
313  *                   RE1: EOT=0, EOB=0, CHAIN=1;
314  *                   RE2: EOT=0, EOB=0, CHAIN=1;
315  *                   RE3: EOT=1, EOB=0, CHAIN=0;
316  *
317  *                   the callback will be triggered for RE3 using the
318  *                   xfer_user_data of that RE
319  *
320  *                   e.g. 2
321  *
322  *                   in REs
323  *
324  *                   RE1: EOT=1, EOB=0, CHAIN=0;
325  *                   RE2: EOT=1, EOB=0, CHAIN=0;
326  *                   RE3: EOT=1, EOB=0, CHAIN=0;
327  *
328  *                   received packet consumes all of RE1, RE2 and part of RE3
329  *                   for EOT condition. there will be three callbacks in below
330  *                   order
331  *
332  *                   callback for RE1 using GSI_CHAN_EVT_OVERFLOW
333  *                   callback for RE2 using GSI_CHAN_EVT_OVERFLOW
334  *                   callback for RE3 using GSI_CHAN_EVT_EOT
335  *
336  * @err_cb:          error notification callback
337  * @chan_user_data:  cookie used for notifications
338  *
339  * All the callbacks are in interrupt context
340  *
341  */
342 struct gsi_chan_props {
343         enum gsi_chan_prot prot;
344         enum gsi_chan_dir dir;
345         uint8_t ch_id;
346         unsigned long evt_ring_hdl;
347         enum gsi_chan_ring_elem_size re_size;
348         uint16_t ring_len;
349         uint16_t max_re_expected;
350         uint64_t ring_base_addr;
351         void *ring_base_vaddr;
352         enum gsi_chan_use_db_eng use_db_eng;
353         enum gsi_max_prefetch max_prefetch;
354         uint8_t low_weight;
355         void (*xfer_cb)(struct gsi_chan_xfer_notify *notify);
356         void (*err_cb)(struct gsi_chan_err_notify *notify);
357         void *chan_user_data;
358 };
359
360 enum gsi_xfer_flag {
361         GSI_XFER_FLAG_CHAIN = 0x1,
362         GSI_XFER_FLAG_EOB = 0x100,
363         GSI_XFER_FLAG_EOT = 0x200,
364         GSI_XFER_FLAG_BEI = 0x400
365 };
366
367 enum gsi_xfer_elem_type {
368         GSI_XFER_ELEM_DATA,
369         GSI_XFER_ELEM_IMME_CMD,
370 };
371
372 /**
373  * gsi_xfer_elem - Metadata about a single transfer
374  *
375  * @addr:           physical address of buffer
376  * @len:            size of buffer for GSI_XFER_ELEM_DATA:
377  *                  for outbound transfers this is the number of bytes to
378  *                  transfer.
379  *                  for inbound transfers, this is the maximum number of
380  *                  bytes the host expects from device in this transfer
381  *
382  *                  immediate command opcode for GSI_XFER_ELEM_IMME_CMD
383  * @flags:          transfer flags, OR of all the applicable flags
384  *
385  *                  GSI_XFER_FLAG_BEI: Block event interrupt
386  *                  1: Event generated by this ring element must not assert
387  *                  an interrupt to the host
388  *                  0: Event generated by this ring element must assert an
389  *                  interrupt to the host
390  *
391  *                  GSI_XFER_FLAG_EOT: Interrupt on end of transfer
392  *                  1: If an EOT condition is encountered when processing
393  *                  this ring element, an event is generated by the device
394  *                  with its completion code set to EOT.
395  *                  0: If an EOT condition is encountered for this ring
396  *                  element, a completion event is not be generated by the
397  *                  device, unless IEOB is 1
398  *
399  *                  GSI_XFER_FLAG_EOB: Interrupt on end of block
400  *                  1: Device notifies host after processing this ring element
401  *                  by sending a completion event
402  *                  0: Completion event is not required after processing this
403  *                  ring element
404  *
405  *                  GSI_XFER_FLAG_CHAIN: Chain bit that identifies the ring
406  *                  elements in a TD
407  *
408  * @type:           transfer type
409  *
410  *                  GSI_XFER_ELEM_DATA: for all data transfers
411  *                  GSI_XFER_ELEM_IMME_CMD: for IPA immediate commands
412  *
413  * @xfer_user_data: cookie used in xfer_cb
414  *
415  */
416 struct gsi_xfer_elem {
417         uint64_t addr;
418         uint16_t len;
419         uint16_t flags;
420         enum gsi_xfer_elem_type type;
421         void *xfer_user_data;
422 };
423
424 /**
425  * gsi_gpi_channel_scratch - GPI protocol SW config area of
426  * channel scratch
427  *
428  * @max_outstanding_tre: Used for the prefetch management sequence by the
429  *                       sequencer. Defines the maximum number of allowed
430  *                       outstanding TREs in IPA/GSI (in Bytes). RE engine
431  *                       prefetch will be limited by this configuration. It
432  *                       is suggested to configure this value to IPA_IF
433  *                       channel TLV queue size times element size. To disable
434  *                       the feature in doorbell mode (DB Mode=1). Maximum
435  *                       outstanding TREs should be set to 64KB
436  *                       (or any value larger or equal to ring length . RLEN)
437  * @outstanding_threshold: Used for the prefetch management sequence by the
438  *                       sequencer. Defines the threshold (in Bytes) as to when
439  *                       to update the channel doorbell. Should be smaller than
440  *                       Maximum outstanding TREs. value. It is suggested to
441  *                       configure this value to 2 * element size.
442  */
443 struct __packed gsi_gpi_channel_scratch {
444         uint64_t resvd1;
445         uint32_t resvd2:16;
446         uint32_t max_outstanding_tre:16;
447         uint32_t resvd3:16;
448         uint32_t outstanding_threshold:16;
449 };
450
451 /**
452  * gsi_mhi_channel_scratch - MHI protocol SW config area of
453  * channel scratch
454  *
455  * @mhi_host_wp_addr:    Valid only when UL/DL Sync En is asserted. Defines
456  *                       address in host from which channel write pointer
457  *                       should be read in polling mode
458  * @assert_bit40:        1: bit #41 in address should be asserted upon
459  *                       IPA_IF.ProcessDescriptor routine (for MHI over PCIe
460  *                       transfers)
461  *                       0: bit #41 in address should be deasserted upon
462  *                       IPA_IF.ProcessDescriptor routine (for non-MHI over
463  *                       PCIe transfers)
464  * @polling_configuration: Uplink channels: Defines timer to poll on MHI
465  *                       context. Range: 1 to 31 milliseconds.
466  *                       Downlink channel: Defines transfer ring buffer
467  *                       availability threshold to poll on MHI context in
468  *                       multiple of 8. Range: 0 to 31, meaning 0 to 258 ring
469  *                       elements. E.g., value of 2 indicates 16 ring elements.
470  *                       Valid only when Burst Mode Enabled is set to 1
471  * @burst_mode_enabled:  0: Burst mode is disabled for this channel
472  *                       1: Burst mode is enabled for this channel
473  * @polling_mode:        0: the channel is not in polling mode, meaning the
474  *                       host should ring DBs.
475  *                       1: the channel is in polling mode, meaning the host
476  * @oob_mod_threshold:   Defines OOB moderation threshold. Units are in 8
477  *                       ring elements.
478  *                       should not ring DBs until notified of DB mode/OOB mode
479  * @max_outstanding_tre: Used for the prefetch management sequence by the
480  *                       sequencer. Defines the maximum number of allowed
481  *                       outstanding TREs in IPA/GSI (in Bytes). RE engine
482  *                       prefetch will be limited by this configuration. It
483  *                       is suggested to configure this value to IPA_IF
484  *                       channel TLV queue size times element size.
485  *                       To disable the feature in doorbell mode (DB Mode=1).
486  *                       Maximum outstanding TREs should be set to 64KB
487  *                       (or any value larger or equal to ring length . RLEN)
488  * @outstanding_threshold: Used for the prefetch management sequence by the
489  *                       sequencer. Defines the threshold (in Bytes) as to when
490  *                       to update the channel doorbell. Should be smaller than
491  *                       Maximum outstanding TREs. value. It is suggested to
492  *                       configure this value to min(TLV_FIFO_SIZE/2,8) *
493  *                       element size.
494  */
495 struct __packed gsi_mhi_channel_scratch {
496         uint64_t mhi_host_wp_addr;
497         uint32_t rsvd1:1;
498         uint32_t assert_bit40:1;
499         uint32_t polling_configuration:5;
500         uint32_t burst_mode_enabled:1;
501         uint32_t polling_mode:1;
502         uint32_t oob_mod_threshold:5;
503         uint32_t resvd2:2;
504         uint32_t max_outstanding_tre:16;
505         uint32_t resvd3:16;
506         uint32_t outstanding_threshold:16;
507 };
508
509 /**
510  * gsi_xdci_channel_scratch - xDCI protocol SW config area of
511  * channel scratch
512  *
513  * @const_buffer_size:   TRB buffer size in KB (similar to IPA aggregationi
514  *                       configuration). Must be aligned to Max USB Packet Size
515  * @xferrscidx: Transfer Resource Index (XferRscIdx). The hardware-assigned
516  *                       transfer resource index for the transfer, which was
517  *                       returned in response to the Start Transfer command.
518  *                       This field is used for "Update Transfer" command
519  * @last_trb_addr:       Address (LSB - based on alignment restrictions) of
520  *                       last TRB in queue. Used to identify rollover case
521  * @depcmd_low_addr:     Used to generate "Update Transfer" command
522  * @max_outstanding_tre: Used for the prefetch management sequence by the
523  *                       sequencer. Defines the maximum number of allowed
524  *                       outstanding TREs in IPA/GSI (in Bytes). RE engine
525  *                       prefetch will be limited by this configuration. It
526  *                       is suggested to configure this value to IPA_IF
527  *                       channel TLV queue size times element size.
528  *                       To disable the feature in doorbell mode (DB Mode=1)
529  *                       Maximum outstanding TREs should be set to 64KB
530  *                       (or any value larger or equal to ring length . RLEN)
531  * @depcmd_hi_addr: Used to generate "Update Transfer" command
532  * @outstanding_threshold: Used for the prefetch management sequence by the
533  *                       sequencer. Defines the threshold (in Bytes) as to when
534  *                       to update the channel doorbell. Should be smaller than
535  *                       Maximum outstanding TREs. value. It is suggested to
536  *                       configure this value to 2 * element size. for MBIM the
537  *                       suggested configuration is the element size.
538  */
539 struct __packed gsi_xdci_channel_scratch {
540         uint32_t last_trb_addr:16;
541         uint32_t resvd1:4;
542         uint32_t xferrscidx:7;
543         uint32_t const_buffer_size:5;
544         uint32_t depcmd_low_addr;
545         uint32_t depcmd_hi_addr:8;
546         uint32_t resvd2:8;
547         uint32_t max_outstanding_tre:16;
548         uint32_t resvd3:16;
549         uint32_t outstanding_threshold:16;
550 };
551
552 /**
553  * gsi_channel_scratch - channel scratch SW config area
554  *
555  */
556 union __packed gsi_channel_scratch {
557         struct __packed gsi_gpi_channel_scratch gpi;
558         struct __packed gsi_mhi_channel_scratch mhi;
559         struct __packed gsi_xdci_channel_scratch xdci;
560         struct __packed {
561                 uint32_t word1;
562                 uint32_t word2;
563                 uint32_t word3;
564                 uint32_t word4;
565         } data;
566 };
567
568 /**
569  * gsi_mhi_evt_scratch - MHI protocol SW config area of
570  * event scratch
571  */
572 struct __packed gsi_mhi_evt_scratch {
573         uint32_t resvd1;
574         uint32_t resvd2;
575 };
576
577 /**
578  * gsi_xdci_evt_scratch - xDCI protocol SW config area of
579  * event scratch
580  *
581  */
582 struct __packed gsi_xdci_evt_scratch {
583         uint32_t gevntcount_low_addr;
584         uint32_t gevntcount_hi_addr:8;
585         uint32_t resvd1:24;
586 };
587
588 /**
589  * gsi_evt_scratch - event scratch SW config area
590  *
591  */
592 union __packed gsi_evt_scratch {
593         struct __packed gsi_mhi_evt_scratch mhi;
594         struct __packed gsi_xdci_evt_scratch xdci;
595         struct __packed {
596                 uint32_t word1;
597                 uint32_t word2;
598         } data;
599 };
600
601 /**
602  * gsi_device_scratch - EE scratch config parameters
603  *
604  * @mhi_base_chan_idx_valid: is mhi_base_chan_idx valid?
605  * @mhi_base_chan_idx:       base index of IPA MHI channel indexes.
606  *                           IPA MHI channel index = GSI channel ID +
607  *                           MHI base channel index
608  * @max_usb_pkt_size_valid:  is max_usb_pkt_size valid?
609  * @max_usb_pkt_size:        max USB packet size in bytes (valid values are
610  *                           512 and 1024)
611  */
612 struct gsi_device_scratch {
613         bool mhi_base_chan_idx_valid;
614         uint8_t mhi_base_chan_idx;
615         bool max_usb_pkt_size_valid;
616         uint16_t max_usb_pkt_size;
617 };
618
619 /**
620  * gsi_chan_info - information about channel occupancy
621  *
622  * @wp: channel write pointer (physical address)
623  * @rp: channel read pointer (physical address)
624  * @evt_valid: is evt* info valid?
625  * @evt_wp: event ring write pointer (physical address)
626  * @evt_rp: event ring read pointer (physical address)
627  */
628 struct gsi_chan_info {
629         uint64_t wp;
630         uint64_t rp;
631         bool evt_valid;
632         uint64_t evt_wp;
633         uint64_t evt_rp;
634 };
635
636 #ifdef CONFIG_GSI
637 /**
638  * gsi_register_device - Peripheral should call this function to
639  * register itself with GSI before invoking any other APIs
640  *
641  * @props:  Peripheral properties
642  * @dev_hdl:  Handle populated by GSI, opaque to client
643  *
644  * @Return -GSI_STATUS_AGAIN if request should be re-tried later
645  *         other error codes for failure
646  */
647 int gsi_register_device(struct gsi_per_props *props, unsigned long *dev_hdl);
648
649 /**
650  * gsi_complete_clk_grant - Peripheral should call this function to
651  * grant the clock resource requested by GSI previously that could not
652  * be granted synchronously. GSI will release the clock resource using
653  * the rel_clk_cb when appropriate
654  *
655  * @dev_hdl:       Client handle previously obtained from
656  *         gsi_register_device
657  *
658  * @Return gsi_status
659  */
660 int gsi_complete_clk_grant(unsigned long dev_hdl);
661
662 /**
663  * gsi_write_device_scratch - Peripheral should call this function to
664  * write to the EE scratch area
665  *
666  * @dev_hdl:  Client handle previously obtained from
667  *            gsi_register_device
668  * @val:      Value to write
669  *
670  * @Return gsi_status
671  */
672 int gsi_write_device_scratch(unsigned long dev_hdl,
673                 struct gsi_device_scratch *val);
674
675 /**
676  * gsi_deregister_device - Peripheral should call this function to
677  * de-register itself with GSI
678  *
679  * @dev_hdl:  Client handle previously obtained from
680  *            gsi_register_device
681  * @force:    When set to true, cleanup is performed even if there
682  *            are in use resources like channels, event rings, etc.
683  *            this would be used after GSI reset to recover from some
684  *            fatal error
685  *            When set to false, there must not exist any allocated
686  *            channels and event rings.
687  *
688  * @Return gsi_status
689  */
690 int gsi_deregister_device(unsigned long dev_hdl, bool force);
691
692 /**
693  * gsi_alloc_evt_ring - Peripheral should call this function to
694  * allocate an event ring
695  *
696  * @props:         Event ring properties
697  * @dev_hdl:       Client handle previously obtained from
698  *         gsi_register_device
699  * @evt_ring_hdl:  Handle populated by GSI, opaque to client
700  *
701  * This function can sleep
702  *
703  * @Return gsi_status
704  */
705 int gsi_alloc_evt_ring(struct gsi_evt_ring_props *props, unsigned long dev_hdl,
706                 unsigned long *evt_ring_hdl);
707
708 /**
709  * gsi_write_evt_ring_scratch - Peripheral should call this function to
710  * write to the scratch area of the event ring context
711  *
712  * @evt_ring_hdl:  Client handle previously obtained from
713  *         gsi_alloc_evt_ring
714  * @val:           Value to write
715  *
716  * @Return gsi_status
717  */
718 int gsi_write_evt_ring_scratch(unsigned long evt_ring_hdl,
719                 union __packed gsi_evt_scratch val);
720
721 /**
722  * gsi_dealloc_evt_ring - Peripheral should call this function to
723  * de-allocate an event ring. There should not exist any active
724  * channels using this event ring
725  *
726  * @evt_ring_hdl:  Client handle previously obtained from
727  *         gsi_alloc_evt_ring
728  *
729  * This function can sleep
730  *
731  * @Return gsi_status
732  */
733 int gsi_dealloc_evt_ring(unsigned long evt_ring_hdl);
734
735 /**
736  * gsi_query_evt_ring_db_addr - Peripheral should call this function to
737  * query the physical addresses of the event ring doorbell registers
738  *
739  * @evt_ring_hdl:    Client handle previously obtained from
740  *           gsi_alloc_evt_ring
741  * @db_addr_wp_lsb:  Physical address of doorbell register where the 32
742  *                   LSBs of the doorbell value should be written
743  * @db_addr_wp_msb:  Physical address of doorbell register where the 32
744  *                   MSBs of the doorbell value should be written
745  *
746  * @Return gsi_status
747  */
748 int gsi_query_evt_ring_db_addr(unsigned long evt_ring_hdl,
749                 uint32_t *db_addr_wp_lsb, uint32_t *db_addr_wp_msb);
750
751 /**
752  * gsi_ring_evt_ring_db - Peripheral should call this function for
753  * ringing the event ring doorbell with given value
754  *
755  * @evt_ring_hdl:    Client handle previously obtained from
756  *           gsi_alloc_evt_ring
757  * @value:           The value to be used for ringing the doorbell
758  *
759  * @Return gsi_status
760  */
761 int gsi_ring_evt_ring_db(unsigned long evt_ring_hdl, uint64_t value);
762
763 /**
764  * gsi_reset_evt_ring - Peripheral should call this function to
765  * reset an event ring to recover from error state
766  *
767  * @evt_ring_hdl:  Client handle previously obtained from
768  *             gsi_alloc_evt_ring
769  *
770  * This function can sleep
771  *
772  * @Return gsi_status
773  */
774 int gsi_reset_evt_ring(unsigned long evt_ring_hdl);
775
776 /**
777  * gsi_get_evt_ring_cfg - This function returns the current config
778  * of the specified event ring
779  *
780  * @evt_ring_hdl:  Client handle previously obtained from
781  *             gsi_alloc_evt_ring
782  * @props:         where to copy properties to
783  * @scr:           where to copy scratch info to
784  *
785  * @Return gsi_status
786  */
787 int gsi_get_evt_ring_cfg(unsigned long evt_ring_hdl,
788                 struct gsi_evt_ring_props *props, union gsi_evt_scratch *scr);
789
790 /**
791  * gsi_set_evt_ring_cfg - This function applies the supplied config
792  * to the specified event ring.
793  *
794  * exclusive property of the event ring cannot be changed after
795  * gsi_alloc_evt_ring
796  *
797  * @evt_ring_hdl:  Client handle previously obtained from
798  *             gsi_alloc_evt_ring
799  * @props:         the properties to apply
800  * @scr:           the scratch info to apply
801  *
802  * @Return gsi_status
803  */
804 int gsi_set_evt_ring_cfg(unsigned long evt_ring_hdl,
805                 struct gsi_evt_ring_props *props, union gsi_evt_scratch *scr);
806
807 /**
808  * gsi_alloc_channel - Peripheral should call this function to
809  * allocate a channel
810  *
811  * @props:     Channel properties
812  * @dev_hdl:   Client handle previously obtained from
813  *             gsi_register_device
814  * @chan_hdl:  Handle populated by GSI, opaque to client
815  *
816  * This function can sleep
817  *
818  * @Return gsi_status
819  */
820 int gsi_alloc_channel(struct gsi_chan_props *props, unsigned long dev_hdl,
821                 unsigned long *chan_hdl);
822
823 /**
824  * gsi_write_channel_scratch - Peripheral should call this function to
825  * write to the scratch area of the channel context
826  *
827  * @chan_hdl:  Client handle previously obtained from
828  *             gsi_alloc_channel
829  * @val:       Value to write
830  *
831  * @Return gsi_status
832  */
833 int gsi_write_channel_scratch(unsigned long chan_hdl,
834                 union __packed gsi_channel_scratch val);
835
836 /**
837  * gsi_start_channel - Peripheral should call this function to
838  * start a channel i.e put into running state
839  *
840  * @chan_hdl:  Client handle previously obtained from
841  *             gsi_alloc_channel
842  *
843  * This function can sleep
844  *
845  * @Return gsi_status
846  */
847 int gsi_start_channel(unsigned long chan_hdl);
848
849 /**
850  * gsi_stop_channel - Peripheral should call this function to
851  * stop a channel. Stop will happen on a packet boundary
852  *
853  * @chan_hdl:  Client handle previously obtained from
854  *             gsi_alloc_channel
855  *
856  * This function can sleep
857  *
858  * @Return -GSI_STATUS_AGAIN if client should call stop/stop_db again
859  *         other error codes for failure
860  */
861 int gsi_stop_channel(unsigned long chan_hdl);
862
863 /**
864  * gsi_reset_channel - Peripheral should call this function to
865  * reset a channel to recover from error state
866  *
867  * @chan_hdl:  Client handle previously obtained from
868  *             gsi_alloc_channel
869  *
870  * This function can sleep
871  *
872  * @Return gsi_status
873  */
874 int gsi_reset_channel(unsigned long chan_hdl);
875
876 /**
877  * gsi_dealloc_channel - Peripheral should call this function to
878  * de-allocate a channel
879  *
880  * @chan_hdl:  Client handle previously obtained from
881  *             gsi_alloc_channel
882  *
883  * This function can sleep
884  *
885  * @Return gsi_status
886  */
887 int gsi_dealloc_channel(unsigned long chan_hdl);
888
889 /**
890  * gsi_stop_db_channel - Peripheral should call this function to
891  * stop a channel when all transfer elements till the doorbell
892  * have been processed
893  *
894  * @chan_hdl:  Client handle previously obtained from
895  *             gsi_alloc_channel
896  *
897  * This function can sleep
898  *
899  * @Return -GSI_STATUS_AGAIN if client should call stop/stop_db again
900  *         other error codes for failure
901  */
902 int gsi_stop_db_channel(unsigned long chan_hdl);
903
904 /**
905  * gsi_query_channel_db_addr - Peripheral should call this function to
906  * query the physical addresses of the channel doorbell registers
907  *
908  * @chan_hdl:        Client handle previously obtained from
909  *           gsi_alloc_channel
910  * @db_addr_wp_lsb:  Physical address of doorbell register where the 32
911  *                   LSBs of the doorbell value should be written
912  * @db_addr_wp_msb:  Physical address of doorbell register where the 32
913  *                   MSBs of the doorbell value should be written
914  *
915  * @Return gsi_status
916  */
917 int gsi_query_channel_db_addr(unsigned long chan_hdl,
918                 uint32_t *db_addr_wp_lsb, uint32_t *db_addr_wp_msb);
919
920 /**
921  * gsi_query_channel_info - Peripheral can call this function to query the
922  * channel and associated event ring (if any) status.
923  *
924  * @chan_hdl:  Client handle previously obtained from
925  *             gsi_alloc_channel
926  * @info:      Where to read the values into
927  *
928  * @Return gsi_status
929  */
930 int gsi_query_channel_info(unsigned long chan_hdl,
931                 struct gsi_chan_info *info);
932
933 /**
934  * gsi_is_channel_empty - Peripheral can call this function to query if
935  * the channel is empty. This is only applicable to GPI. "Empty" means
936  * GSI has consumed all descriptors for a TO_GSI channel and SW has
937  * processed all completed descriptors for a FROM_GSI channel.
938  *
939  * @chan_hdl:  Client handle previously obtained from gsi_alloc_channel
940  * @is_empty:  set by GSI based on channel emptiness
941  *
942  * @Return gsi_status
943  */
944 int gsi_is_channel_empty(unsigned long chan_hdl, bool *is_empty);
945
946 /**
947  * gsi_get_channel_cfg - This function returns the current config
948  * of the specified channel
949  *
950  * @chan_hdl:  Client handle previously obtained from
951  *             gsi_alloc_channel
952  * @props:     where to copy properties to
953  * @scr:       where to copy scratch info to
954  *
955  * @Return gsi_status
956  */
957 int gsi_get_channel_cfg(unsigned long chan_hdl, struct gsi_chan_props *props,
958                 union gsi_channel_scratch *scr);
959
960 /**
961  * gsi_set_channel_cfg - This function applies the supplied config
962  * to the specified channel
963  *
964  * ch_id and evt_ring_hdl of the channel cannot be changed after
965  * gsi_alloc_channel
966  *
967  * @chan_hdl:  Client handle previously obtained from
968  *             gsi_alloc_channel
969  * @props:     the properties to apply
970  * @scr:       the scratch info to apply
971  *
972  * @Return gsi_status
973  */
974 int gsi_set_channel_cfg(unsigned long chan_hdl, struct gsi_chan_props *props,
975                 union gsi_channel_scratch *scr);
976
977 /**
978  * gsi_poll_channel - Peripheral should call this function to query for
979  * completed transfer descriptors.
980  *
981  * @chan_hdl:  Client handle previously obtained from
982  *             gsi_alloc_channel
983  * @notify:    Information about the completed transfer if any
984  *
985  * @Return gsi_status (GSI_STATUS_POLL_EMPTY is returned if no transfers
986  * completed)
987  */
988 int gsi_poll_channel(unsigned long chan_hdl,
989                 struct gsi_chan_xfer_notify *notify);
990
991 /**
992  * gsi_config_channel_mode - Peripheral should call this function
993  * to configure the channel mode.
994  *
995  * @chan_hdl:  Client handle previously obtained from
996  *             gsi_alloc_channel
997  * @mode:      Mode to move the channel into
998  *
999  * @Return gsi_status
1000  */
1001 int gsi_config_channel_mode(unsigned long chan_hdl, enum gsi_chan_mode mode);
1002
1003 /**
1004  * gsi_queue_xfer - Peripheral should call this function
1005  * to queue transfers on the given channel
1006  *
1007  * @chan_hdl:  Client handle previously obtained from
1008  *             gsi_alloc_channel
1009  * @num_xfers: Number of transfer in the array @ xfer
1010  * @xfer:      Array of num_xfers transfer descriptors
1011  * @ring_db:   If true, tell HW about these queued xfers
1012  *             If false, do not notify HW at this time
1013  *
1014  * @Return gsi_status
1015  */
1016 int gsi_queue_xfer(unsigned long chan_hdl, uint16_t num_xfers,
1017                 struct gsi_xfer_elem *xfer, bool ring_db);
1018
1019 /**
1020  * gsi_start_xfer - Peripheral should call this function to
1021  * inform HW about queued xfers
1022  *
1023  * @chan_hdl:  Client handle previously obtained from
1024  *             gsi_alloc_channel
1025  *
1026  * @Return gsi_status
1027  */
1028 int gsi_start_xfer(unsigned long chan_hdl);
1029
1030 /**
1031  * gsi_configure_regs - Peripheral should call this function
1032  * to configure the GSI registers before/after the FW is
1033  * loaded but before it is enabled.
1034  *
1035  * @gsi_base_addr: Base address of GSI register space
1036  * @gsi_size: Mapping size of the GSI register space
1037  * @per_base_addr: Base address of the peripheral using GSI
1038  *
1039  * @Return gsi_status
1040  */
1041 int gsi_configure_regs(phys_addr_t gsi_base_addr, u32 gsi_size,
1042                 phys_addr_t per_base_addr);
1043
1044 /**
1045  * gsi_enable_fw - Peripheral should call this function
1046  * to enable the GSI FW after the FW has been loaded to the SRAM.
1047  *
1048  * @gsi_base_addr: Base address of GSI register space
1049  * @gsi_size: Mapping size of the GSI register space
1050
1051  * @Return gsi_status
1052  */
1053 int gsi_enable_fw(phys_addr_t gsi_base_addr, u32 gsi_size);
1054
1055 /**
1056  * gsi_get_inst_ram_offset_and_size - Peripheral should call this function
1057  * to get instruction RAM base address offset and size. Peripheral typically
1058  * uses this info to load GSI FW into the IRAM.
1059  *
1060  * @base_offset:[OUT] - IRAM base offset address
1061  * @size:       [OUT] - IRAM size
1062
1063  * @Return none
1064  */
1065 void gsi_get_inst_ram_offset_and_size(unsigned long *base_offset,
1066                 unsigned long *size);
1067
1068 /**
1069  * gsi_halt_channel_ee - Peripheral should call this function
1070  * to stop other EE's channel. This is usually used in SSR clean
1071  *
1072  * @chan_idx: Virtual channel index
1073  * @ee: EE
1074  * @code: [out] response code for operation
1075
1076  * @Return gsi_status
1077  */
1078 int gsi_halt_channel_ee(unsigned int chan_idx, unsigned int ee, int *code);
1079
1080 /*
1081  * Here is a typical sequence of calls
1082  *
1083  * gsi_register_device
1084  *
1085  * gsi_write_device_scratch (if the protocol needs this)
1086  *
1087  * gsi_alloc_evt_ring (for as many event rings as needed)
1088  * gsi_write_evt_ring_scratch
1089  *
1090  * gsi_alloc_channel (for as many channels as needed; channels can have
1091  * no event ring, an exclusive event ring or a shared event ring)
1092  * gsi_write_channel_scratch
1093  * gsi_start_channel
1094  * gsi_queue_xfer/gsi_start_xfer
1095  * gsi_config_channel_mode/gsi_poll_channel (if clients wants to poll on
1096  * xfer completions)
1097  * gsi_stop_db_channel/gsi_stop_channel
1098  *
1099  * gsi_dealloc_channel
1100  *
1101  * gsi_dealloc_evt_ring
1102  *
1103  * gsi_deregister_device
1104  *
1105  */
1106 #else
1107 static inline int gsi_register_device(struct gsi_per_props *props,
1108                 unsigned long *dev_hdl)
1109 {
1110         return -GSI_STATUS_UNSUPPORTED_OP;
1111 }
1112
1113 static inline int gsi_complete_clk_grant(unsigned long dev_hdl)
1114 {
1115         return -GSI_STATUS_UNSUPPORTED_OP;
1116 }
1117
1118 static inline int gsi_write_device_scratch(unsigned long dev_hdl,
1119                 struct gsi_device_scratch *val)
1120 {
1121         return -GSI_STATUS_UNSUPPORTED_OP;
1122 }
1123
1124 static inline int gsi_deregister_device(unsigned long dev_hdl, bool force)
1125 {
1126         return -GSI_STATUS_UNSUPPORTED_OP;
1127 }
1128
1129 static inline int gsi_alloc_evt_ring(struct gsi_evt_ring_props *props,
1130                 unsigned long dev_hdl,
1131                 unsigned long *evt_ring_hdl)
1132 {
1133         return -GSI_STATUS_UNSUPPORTED_OP;
1134 }
1135
1136 static inline int gsi_write_evt_ring_scratch(unsigned long evt_ring_hdl,
1137                 union __packed gsi_evt_scratch val)
1138 {
1139         return -GSI_STATUS_UNSUPPORTED_OP;
1140 }
1141
1142 static inline int gsi_dealloc_evt_ring(unsigned long evt_ring_hdl)
1143 {
1144         return -GSI_STATUS_UNSUPPORTED_OP;
1145 }
1146
1147 static inline int gsi_query_evt_ring_db_addr(unsigned long evt_ring_hdl,
1148                 uint32_t *db_addr_wp_lsb, uint32_t *db_addr_wp_msb)
1149 {
1150         return -GSI_STATUS_UNSUPPORTED_OP;
1151 }
1152
1153 static inline int gsi_ring_evt_ring_db(unsigned long evt_ring_hdl,
1154                 uint64_t value)
1155 {
1156         return -GSI_STATUS_UNSUPPORTED_OP;
1157 }
1158
1159 static inline int gsi_reset_evt_ring(unsigned long evt_ring_hdl)
1160 {
1161         return -GSI_STATUS_UNSUPPORTED_OP;
1162 }
1163
1164 static inline int gsi_alloc_channel(struct gsi_chan_props *props,
1165                 unsigned long dev_hdl,
1166                 unsigned long *chan_hdl)
1167 {
1168         return -GSI_STATUS_UNSUPPORTED_OP;
1169 }
1170
1171 static inline int gsi_write_channel_scratch(unsigned long chan_hdl,
1172                 union __packed gsi_channel_scratch val)
1173 {
1174         return -GSI_STATUS_UNSUPPORTED_OP;
1175 }
1176
1177 static inline int gsi_start_channel(unsigned long chan_hdl)
1178 {
1179         return -GSI_STATUS_UNSUPPORTED_OP;
1180 }
1181
1182 static inline int gsi_stop_channel(unsigned long chan_hdl)
1183 {
1184         return -GSI_STATUS_UNSUPPORTED_OP;
1185 }
1186
1187 static inline int gsi_reset_channel(unsigned long chan_hdl)
1188 {
1189         return -GSI_STATUS_UNSUPPORTED_OP;
1190 }
1191
1192 static inline int gsi_dealloc_channel(unsigned long chan_hdl)
1193 {
1194         return -GSI_STATUS_UNSUPPORTED_OP;
1195 }
1196
1197 static inline int gsi_stop_db_channel(unsigned long chan_hdl)
1198 {
1199         return -GSI_STATUS_UNSUPPORTED_OP;
1200 }
1201
1202 static inline int gsi_query_channel_db_addr(unsigned long chan_hdl,
1203                 uint32_t *db_addr_wp_lsb, uint32_t *db_addr_wp_msb)
1204 {
1205         return -GSI_STATUS_UNSUPPORTED_OP;
1206 }
1207
1208 static inline int gsi_query_channel_info(unsigned long chan_hdl,
1209                 struct gsi_chan_info *info)
1210 {
1211         return -GSI_STATUS_UNSUPPORTED_OP;
1212 }
1213
1214 static inline int gsi_is_channel_empty(unsigned long chan_hdl, bool *is_empty)
1215 {
1216         return -GSI_STATUS_UNSUPPORTED_OP;
1217 }
1218
1219 static inline int gsi_poll_channel(unsigned long chan_hdl,
1220                 struct gsi_chan_xfer_notify *notify)
1221 {
1222         return -GSI_STATUS_UNSUPPORTED_OP;
1223 }
1224
1225 static inline int gsi_config_channel_mode(unsigned long chan_hdl,
1226                 enum gsi_chan_mode mode)
1227 {
1228         return -GSI_STATUS_UNSUPPORTED_OP;
1229 }
1230
1231 static inline int gsi_queue_xfer(unsigned long chan_hdl, uint16_t num_xfers,
1232                 struct gsi_xfer_elem *xfer, bool ring_db)
1233 {
1234         return -GSI_STATUS_UNSUPPORTED_OP;
1235 }
1236
1237 static inline int gsi_start_xfer(unsigned long chan_hdl)
1238 {
1239         return -GSI_STATUS_UNSUPPORTED_OP;
1240 }
1241
1242 static inline int gsi_get_channel_cfg(unsigned long chan_hdl,
1243                 struct gsi_chan_props *props,
1244                 union gsi_channel_scratch *scr)
1245 {
1246         return -GSI_STATUS_UNSUPPORTED_OP;
1247 }
1248
1249 static inline int gsi_set_channel_cfg(unsigned long chan_hdl,
1250                 struct gsi_chan_props *props,
1251                 union gsi_channel_scratch *scr)
1252 {
1253         return -GSI_STATUS_UNSUPPORTED_OP;
1254 }
1255
1256 static inline int gsi_get_evt_ring_cfg(unsigned long evt_ring_hdl,
1257                 struct gsi_evt_ring_props *props, union gsi_evt_scratch *scr)
1258 {
1259         return -GSI_STATUS_UNSUPPORTED_OP;
1260 }
1261
1262 static inline int gsi_set_evt_ring_cfg(unsigned long evt_ring_hdl,
1263                 struct gsi_evt_ring_props *props, union gsi_evt_scratch *scr)
1264 {
1265         return -GSI_STATUS_UNSUPPORTED_OP;
1266 }
1267
1268 static inline int gsi_configure_regs(phys_addr_t gsi_base_addr, u32 gsi_size,
1269                 phys_addr_t per_base_addr)
1270 {
1271         return -GSI_STATUS_UNSUPPORTED_OP;
1272 }
1273
1274 static inline int gsi_enable_fw(phys_addr_t gsi_base_addr, u32 gsi_size)
1275 {
1276         return -GSI_STATUS_UNSUPPORTED_OP;
1277 }
1278
1279 static inline void gsi_get_inst_ram_offset_and_size(unsigned long *base_offset,
1280                 unsigned long *size)
1281 {
1282 }
1283
1284 static inline int gsi_halt_channel_ee(unsigned int chan_idx, unsigned int ee,
1285          int *code)
1286 {
1287         return -GSI_STATUS_UNSUPPORTED_OP;
1288 }
1289 #endif
1290 #endif