blob: 5333c2eef3692b83d20332783bb1c42cf5bb79f8 [file] [log] [blame]
Yan Hef879bb02011-12-22 15:38:03 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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
13/* Smart-Peripheral-Switch (SPS) API. */
14
15#ifndef _SPS_H_
16#define _SPS_H_
17
18#include <linux/types.h> /* u32 */
19
20/* SPS device handle indicating use of system memory */
21#define SPS_DEV_HANDLE_MEM ((u32)0x7ffffffful)
22
23/* SPS device handle indicating use of BAM-DMA */
24
25/* SPS device handle invalid value */
26#define SPS_DEV_HANDLE_INVALID ((u32)0)
27
28/* BAM invalid IRQ value */
29#define SPS_IRQ_INVALID 0
30
31/* Invalid address value */
32#define SPS_ADDR_INVALID 0
33
34/* Invalid peripheral device enumeration class */
35#define SPS_CLASS_INVALID ((u32)-1)
36
37/*
38 * This value specifies different configurations for an SPS connection.
39 * A non-default value instructs the SPS driver to search for the configuration
40 * in the fixed connection mapping table.
41 */
42#define SPS_CONFIG_DEFAULT 0
43
44/*
45 * This value instructs the SPS driver to use the default BAM-DMA channel
46 * threshold
47 */
48#define SPS_DMA_THRESHOLD_DEFAULT 0
49
50/* Flag bits supported by SPS hardware for struct sps_iovec */
51#define SPS_IOVEC_FLAG_INT 0x8000 /* Generate interrupt */
52#define SPS_IOVEC_FLAG_EOT 0x4000 /* Generate end-of-transfer indication */
53#define SPS_IOVEC_FLAG_EOB 0x2000 /* Generate end-of-block indication */
Yan Hef879bb02011-12-22 15:38:03 -080054#define SPS_IOVEC_FLAG_NWD 0x1000 /* notify when done */
55#define SPS_IOVEC_FLAG_CMD 0x0800 /* command descriptor */
56#define SPS_IOVEC_FLAG_LOCK 0x0400 /* pipe lock */
57#define SPS_IOVEC_FLAG_UNLOCK 0x0200 /* pipe unlock */
58#define SPS_IOVEC_FLAG_IMME 0x0100 /* immediate command descriptor */
59#define SPS_IOVEC_FLAG_NO_SUBMIT 0x0002 /* Do not submit descriptor to HW */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070060#define SPS_IOVEC_FLAG_DEFAULT 0x0001 /* Use driver default */
61
Yan He9b453682012-08-07 11:32:17 -070062/* Maximum descriptor/iovec size */
63#define SPS_IOVEC_MAX_SIZE (32 * 1024 - 1) /* 32K-1 bytes due to HW limit */
64
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070065/* BAM device options flags */
66
67/*
68 * BAM will be configured and enabled at boot. Otherwise, BAM will be
69 * configured and enabled when first pipe connect occurs.
70 */
71#define SPS_BAM_OPT_ENABLE_AT_BOOT 1UL
72/* BAM IRQ is disabled */
73#define SPS_BAM_OPT_IRQ_DISABLED (1UL << 1)
74/* BAM peripheral is a BAM-DMA */
75#define SPS_BAM_OPT_BAMDMA (1UL << 2)
Yan Hec324a792011-11-10 17:19:48 -080076/* BAM IRQ is registered for apps wakeup */
77#define SPS_BAM_OPT_IRQ_WAKEUP (1UL << 3)
Yan He821e2762012-08-22 16:49:43 -070078/* Ignore external block pipe reset */
79#define SPS_BAM_NO_EXT_P_RST (1UL << 4)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070080
81/* BAM device management flags */
82
83/* BAM global device control is managed remotely */
84#define SPS_BAM_MGR_DEVICE_REMOTE 1UL
85/* BAM device supports multiple execution environments */
86#define SPS_BAM_MGR_MULTI_EE (1UL << 1)
87/* BAM pipes are *not* allocated locally */
88#define SPS_BAM_MGR_PIPE_NO_ALLOC (1UL << 2)
89/* BAM pipes are *not* configured locally */
90#define SPS_BAM_MGR_PIPE_NO_CONFIG (1UL << 3)
91/* BAM pipes are *not* controlled locally */
92#define SPS_BAM_MGR_PIPE_NO_CTRL (1UL << 4)
93/* "Globbed" management properties */
94#define SPS_BAM_MGR_NONE \
95 (SPS_BAM_MGR_DEVICE_REMOTE | SPS_BAM_MGR_PIPE_NO_ALLOC | \
96 SPS_BAM_MGR_PIPE_NO_CONFIG | SPS_BAM_MGR_PIPE_NO_CTRL)
97#define SPS_BAM_MGR_LOCAL 0
98#define SPS_BAM_MGR_LOCAL_SHARED SPS_BAM_MGR_MULTI_EE
99#define SPS_BAM_MGR_REMOTE_SHARED \
100 (SPS_BAM_MGR_DEVICE_REMOTE | SPS_BAM_MGR_MULTI_EE | \
101 SPS_BAM_MGR_PIPE_NO_ALLOC)
102#define SPS_BAM_MGR_ACCESS_MASK SPS_BAM_MGR_NONE
103
104/*
105 * BAM security configuration
106 */
107#define SPS_BAM_NUM_EES 4
108#define SPS_BAM_SEC_DO_NOT_CONFIG 0
109#define SPS_BAM_SEC_DO_CONFIG 0x0A434553
110
Yan He0eead892012-07-03 17:38:56 -0700111/* BAM pipe selection */
112#define SPS_BAM_PIPE(n) (1UL << (n))
113
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700114/* This enum specifies the operational mode for an SPS connection */
115enum sps_mode {
116 SPS_MODE_SRC = 0, /* end point is the source (producer) */
117 SPS_MODE_DEST, /* end point is the destination (consumer) */
118};
119
120
121/*
122 * This enum is a set of bit flag options for SPS connection.
123 * The enums should be OR'd together to create the option set
124 * for the SPS connection.
125 */
126enum sps_option {
127 /*
128 * Options to enable specific SPS hardware interrupts.
129 * These bit flags are also used to indicate interrupt source
130 * for the SPS_EVENT_IRQ event.
131 */
132 SPS_O_DESC_DONE = 0x00000001, /* Descriptor processed */
133 SPS_O_INACTIVE = 0x00000002, /* Inactivity timeout */
134 SPS_O_WAKEUP = 0x00000004, /* Peripheral wake up */
135 SPS_O_OUT_OF_DESC = 0x00000008,/* Out of descriptors */
136 SPS_O_ERROR = 0x00000010, /* Error */
137 SPS_O_EOT = 0x00000020, /* End-of-transfer */
138
139 /* Options to enable hardware features */
140 SPS_O_STREAMING = 0x00010000, /* Enable streaming mode (no EOT) */
141 /* Use MTI/SETPEND instead of BAM interrupt */
142 SPS_O_IRQ_MTI = 0x00020000,
Yan Hef879bb02011-12-22 15:38:03 -0800143 /* NWD bit written with EOT for BAM2BAM producer pipe */
144 SPS_O_WRITE_NWD = 0x00040000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700145
146 /* Options to enable software features */
147 /* Transfer operation should be polled */
148 SPS_O_POLL = 0x01000000,
149 /* Disable queuing of transfer events for the connection end point */
150 SPS_O_NO_Q = 0x02000000,
151 SPS_O_FLOWOFF = 0x04000000, /* Graceful halt */
152 /* SPS_O_WAKEUP will be disabled after triggered */
153 SPS_O_WAKEUP_IS_ONESHOT = 0x08000000,
154 /**
155 * Client must read each descriptor from the FIFO
156 * using sps_get_iovec()
157 */
158 SPS_O_ACK_TRANSFERS = 0x10000000,
159 /* Connection is automatically enabled */
160 SPS_O_AUTO_ENABLE = 0x20000000,
161 /* DISABLE endpoint synchronization for config/enable/disable */
162 SPS_O_NO_EP_SYNC = 0x40000000,
163};
164
165/**
166 * This enum specifies BAM DMA channel priority. Clients should use
167 * SPS_DMA_PRI_DEFAULT unless a specific priority is required.
168 */
169enum sps_dma_priority {
170 SPS_DMA_PRI_DEFAULT = 0,
171 SPS_DMA_PRI_LOW,
172 SPS_DMA_PRI_MED,
173 SPS_DMA_PRI_HIGH,
174};
175
176/*
177 * This enum specifies the ownership of a connection resource.
178 * Remote or shared ownership is only possible/meaningful on the processor
179 * that controls resource.
180 */
181enum sps_owner {
182 SPS_OWNER_LOCAL = 0x1, /* Resource is owned by local processor */
183 SPS_OWNER_REMOTE = 0x2, /* Resource is owned by a satellite processor */
184};
185
186/* This enum indicates the event associated with a client event trigger */
187enum sps_event {
188 SPS_EVENT_INVALID = 0,
189
190 SPS_EVENT_EOT, /* End-of-transfer */
191 SPS_EVENT_DESC_DONE, /* Descriptor processed */
192 SPS_EVENT_OUT_OF_DESC, /* Out of descriptors */
193 SPS_EVENT_WAKEUP, /* Peripheral wake up */
194 SPS_EVENT_FLOWOFF, /* Graceful halt (idle) */
195 SPS_EVENT_INACTIVE, /* Inactivity timeout */
196 SPS_EVENT_ERROR, /* Error */
197 SPS_EVENT_MAX,
198};
199
200/*
201 * This enum specifies the event trigger mode and is an argument for the
202 * sps_register_event() function.
203 */
204enum sps_trigger {
205 /* Trigger with payload for callback */
206 SPS_TRIGGER_CALLBACK = 0,
207 /* Trigger without payload for wait or poll */
208 SPS_TRIGGER_WAIT,
209};
210
211/*
212 * This enum indicates the desired halting mechanism and is an argument for the
213 * sps_flow_off() function
214 */
215enum sps_flow_off {
216 SPS_FLOWOFF_FORCED = 0, /* Force hardware into halt state */
217 /* Allow hardware to empty pipe before halting */
218 SPS_FLOWOFF_GRACEFUL,
219};
220
221/*
222 * This enum indicates the target memory heap and is an argument for the
223 * sps_mem_alloc() function.
224 */
225enum sps_mem {
226 SPS_MEM_LOCAL = 0, /* SPS subsystem local (pipe) memory */
227 SPS_MEM_UC, /* Microcontroller (ARM7) local memory */
228};
229
230/*
231 * This enum indicates a timer control operation and is an argument for the
232 * sps_timer_ctrl() function.
233 */
234enum sps_timer_op {
235 SPS_TIMER_OP_CONFIG = 0,
236 SPS_TIMER_OP_RESET,
237/* SPS_TIMER_OP_START, Not supported by hardware yet */
238/* SPS_TIMER_OP_STOP, Not supported by hardware yet */
239 SPS_TIMER_OP_READ,
240};
241
242/*
243 * This enum indicates the inactivity timer operating mode and is an
244 * argument for the sps_timer_ctrl() function.
245 */
246enum sps_timer_mode {
247 SPS_TIMER_MODE_ONESHOT = 0,
248/* SPS_TIMER_MODE_PERIODIC, Not supported by hardware yet */
249};
250
Yan Hefcddf6f2012-03-13 12:41:18 -0700251/* This enum indicates the cases when callback the user of BAM */
252enum sps_callback_case {
253 SPS_CALLBACK_BAM_ERROR_IRQ = 1, /* BAM ERROR IRQ */
254 SPS_CALLBACK_BAM_HRESP_ERR_IRQ, /* Erroneous HResponse */
255};
256
Yan Hef879bb02011-12-22 15:38:03 -0800257/*
258 * This enum indicates the command type in a command element
259 */
260enum sps_command_type {
261 SPS_WRITE_COMMAND = 0,
262 SPS_READ_COMMAND,
263};
264
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700265/**
266 * This data type corresponds to the native I/O vector (BAM descriptor)
267 * supported by SPS hardware
268 *
269 * @addr - Buffer physical address.
270 * @size - Buffer size in bytes.
271 * @flags -Flag bitmask (see SPS_IOVEC_FLAG_ #defines).
272 *
273 */
274struct sps_iovec {
275 u32 addr;
276 u32 size:16;
277 u32 flags:16;
278};
279
Yan Hef879bb02011-12-22 15:38:03 -0800280/**
281 * This data type corresponds to the native Command Element
282 * supported by SPS hardware
283 *
284 * @addr - register address.
285 * @command - command type.
286 * @data - for write command: content to be written into peripheral register.
287 * for read command: dest addr to write peripheral register value to.
288 * @mask - register mask.
289 * @reserved - for future usage.
290 *
291 */
292struct sps_command_element {
293 u32 addr:24;
294 u32 command:8;
295 u32 data;
296 u32 mask;
297 u32 reserved;
298};
299
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700300/*
301 * BAM device's security configuation
302 */
303struct sps_bam_pipe_sec_config_props {
304 u32 pipe_mask;
305 u32 vmid;
306};
307
308struct sps_bam_sec_config_props {
309 /* Per-EE configuration - This is a pipe bit mask for each EE */
310 struct sps_bam_pipe_sec_config_props ees[SPS_BAM_NUM_EES];
311};
312
313/**
314 * This struct defines a BAM device. The client must memset() this struct to
315 * zero before writing device information. A value of zero for uninitialized
316 * values will instruct the SPS driver to use general defaults or
317 * hardware/BIOS supplied values.
318 *
319 *
320 * @options - See SPS_BAM_OPT_* bit flag.
321 * @phys_addr - BAM base physical address (not peripheral address).
322 * @virt_addr - BAM base virtual address.
323 * @virt_size - For virtual mapping.
324 * @irq - IRQ enum for use in ISR vector install.
325 * @num_pipes - number of pipes. Can be read from hardware.
326 * @summing_threshold - BAM event threshold.
327 *
328 * @periph_class - Peripheral device enumeration class.
329 * @periph_dev_id - Peripheral global device ID.
330 * @periph_phys_addr - Peripheral base physical address, for BAM-DMA only.
331 * @periph_virt_addr - Peripheral base virtual address.
332 * @periph_virt_size - Size for virtual mapping.
333 *
Yan Hefcddf6f2012-03-13 12:41:18 -0700334 * @callback - callback function for BAM user.
335 * @user - pointer to user data.
336 *
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700337 * @event_threshold - Pipe event threshold.
338 * @desc_size - Size (bytes) of descriptor FIFO.
339 * @data_size - Size (bytes) of data FIFO.
340 * @desc_mem_id - Heap ID for default descriptor FIFO allocations.
341 * @data_mem_id - Heap ID for default data FIFO allocations.
342 *
343 * @manage - BAM device management flags (see SPS_BAM_MGR_*).
344 * @restricted_pipes - Bitmask of pipes restricted from local use.
345 * @ee - Local execution environment index.
346 *
347 * @irq_gen_addr - MTI interrupt generation address. This configuration only
348 * applies to BAM rev 1 and 2 hardware. MTIs are only supported on BAMs when
349 * global config is controlled by a remote processor.
350 * NOTE: This address must correspond to the MTI associated with the "irq" IRQ
351 * enum specified above.
352 *
353 * @sec_config - must be set to SPS_BAM_SEC_DO_CONFIG to perform BAM security
354 * configuration. Only the processor that manages the BAM is allowed to
355 * perform the configuration. The global (top-level) BAM interrupt will be
356 * assigned to the EE of the processor that manages the BAM.
357 *
358 * @p_sec_config_props - BAM device's security configuation
359 *
360 */
361struct sps_bam_props {
362
363 /* BAM device properties. */
364
365 u32 options;
366 u32 phys_addr;
367 void *virt_addr;
368 u32 virt_size;
369 u32 irq;
370 u32 num_pipes;
371 u32 summing_threshold;
372
373 /* Peripheral device properties */
374
375 u32 periph_class;
376 u32 periph_dev_id;
377 u32 periph_phys_addr;
378 void *periph_virt_addr;
379 u32 periph_virt_size;
380
381 /* Connection pipe parameter defaults. */
382
383 u32 event_threshold;
384 u32 desc_size;
385 u32 data_size;
386 u32 desc_mem_id;
387 u32 data_mem_id;
388
Yan Hefcddf6f2012-03-13 12:41:18 -0700389 /* Feedback to BAM user */
390 void (*callback)(enum sps_callback_case, void *);
391 void *user;
392
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700393 /* Security properties */
394
395 u32 manage;
396 u32 restricted_pipes;
397 u32 ee;
398
399 /* BAM MTI interrupt generation */
400
401 u32 irq_gen_addr;
402
403 /* Security configuration properties */
404
405 u32 sec_config;
406 struct sps_bam_sec_config_props *p_sec_config_props;
407};
408
409/**
410 * This struct specifies memory buffer properties.
411 *
412 * @base - Buffer virtual address.
413 * @phys_base - Buffer physical address.
414 * @size - Specifies buffer size (or maximum size).
415 * @min_size - If non-zero, specifies buffer minimum size.
416 *
417 */
418struct sps_mem_buffer {
419 void *base;
420 u32 phys_base;
421 u32 size;
422 u32 min_size;
423};
424
425/**
426 * This struct defines a connection's end point and is used as the argument
427 * for the sps_connect(), sps_get_config(), and sps_set_config() functions.
428 * For system mode pipe, use SPS_DEV_HANDLE_MEM for the end point that
429 * corresponds to system memory.
430 *
431 * The client can force SPS to reserve a specific pipe on a BAM.
432 * If the pipe is in use, the sps_connect/set_config() will fail.
433 *
434 * @source - Source BAM.
435 * @src_pipe_index - BAM pipe index, 0 to 30.
436 * @destination - Destination BAM.
437 * @dest_pipe_index - BAM pipe index, 0 to 30.
438 *
439 * @mode - specifies which end (source or destination) of the connection will
440 * be controlled/referenced by the client.
441 *
442 * @config - This value is for future use and should be set to
443 * SPS_CONFIG_DEFAULT or left as default from sps_get_config().
444 *
445 * @options - OR'd connection end point options (see SPS_O defines).
446 *
447 * WARNING: The memory provided should be physically contiguous and non-cached.
448 * The user can use one of the following:
449 * 1. sps_alloc_mem() - allocated from pipe-memory.
450 * 2. dma_alloc_coherent() - allocate coherent DMA memory.
451 * 3. dma_map_single() - for using memory allocated by kmalloc().
452 *
453 * @desc - Descriptor FIFO.
454 * @data - Data FIFO (BAM-to-BAM mode only).
455 *
456 * @event_thresh - Pipe event threshold or derivative.
Yan Hef879bb02011-12-22 15:38:03 -0800457 * @lock_group - The lock group this pipe belongs to.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700458 *
459 * @sps_reserved - Reserved word - client must not modify.
460 *
461 */
462struct sps_connect {
463 u32 source;
464 u32 src_pipe_index;
465 u32 destination;
466 u32 dest_pipe_index;
467
468 enum sps_mode mode;
469
470 u32 config;
471
472 enum sps_option options;
473
474 struct sps_mem_buffer desc;
475 struct sps_mem_buffer data;
476
477 u32 event_thresh;
478
Yan Hef879bb02011-12-22 15:38:03 -0800479 u32 lock_group;
480
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700481 /* SETPEND/MTI interrupt generation parameters */
482
483 u32 irq_gen_addr;
484 u32 irq_gen_data;
485
486 u32 sps_reserved;
487
488};
489
490/**
491 * This struct defines a satellite connection's end point. The client of the
492 * SPS driver on the satellite processor must call sps_get_config() to
493 * initialize a struct sps_connect, then copy the values from the struct
494 * sps_satellite to the struct sps_connect before making the sps_connect()
495 * call to the satellite SPS driver.
496 *
497 */
498struct sps_satellite {
499 /**
500 * These values must be copied to either the source or destination
501 * corresponding values in the connect struct.
502 */
503 u32 dev;
504 u32 pipe_index;
505
506 /**
507 * These values must be copied to the corresponding values in the
508 * connect struct
509 */
510 u32 config;
511 enum sps_option options;
512
513};
514
515/**
516 * This struct defines parameters for allocation of a BAM DMA channel. The
517 * client must memset() this struct to zero before writing allocation
518 * information. A value of zero for uninitialized values will instruct
519 * the SPS driver to use defaults or "don't care".
520 *
521 * @dev - Associated BAM device handle, or SPS_DEV_HANDLE_DMA.
522 *
523 * @src_owner - Source owner processor ID.
524 * @dest_owner - Destination owner processor ID.
525 *
526 */
527struct sps_alloc_dma_chan {
528 u32 dev;
529
530 /* BAM DMA channel configuration parameters */
531
532 u32 threshold;
533 enum sps_dma_priority priority;
534
535 /**
536 * Owner IDs are global host processor identifiers used by the system
537 * SROT when establishing execution environments.
538 */
539 u32 src_owner;
540 u32 dest_owner;
541
542};
543
544/**
545 * This struct defines parameters for an allocated BAM DMA channel.
546 *
547 * @dev - BAM DMA device handle.
548 * @dest_pipe_index - Destination/input/write pipe index.
549 * @src_pipe_index - Source/output/read pipe index.
550 *
551 */
552struct sps_dma_chan {
553 u32 dev;
554 u32 dest_pipe_index;
555 u32 src_pipe_index;
556};
557
558/**
559 * This struct is an argument passed payload when triggering a callback event
560 * object registered for an SPS connection end point.
561 *
562 * @user - Pointer registered with sps_register_event().
563 *
564 * @event_id - Which event.
565 *
566 * @iovec - The associated I/O vector. If the end point is a system-mode
567 * producer, the size will reflect the actual number of bytes written to the
568 * buffer by the pipe. NOTE: If this I/O vector was part of a set submitted to
569 * sps_transfer(), then the vector array itself will be updated with all of
570 * the actual counts.
571 *
572 * @user - Pointer registered with the transfer.
573 *
574 */
575struct sps_event_notify {
576 void *user;
577
578 enum sps_event event_id;
579
580 /* Data associated with the event */
581
582 union {
583 /* Data for SPS_EVENT_IRQ */
584 struct {
585 u32 mask;
586 } irq;
587
588 /* Data for SPS_EVENT_EOT or SPS_EVENT_DESC_DONE */
589
590 struct {
591 struct sps_iovec iovec;
592 void *user;
593 } transfer;
594
595 /* Data for SPS_EVENT_ERROR */
596
597 struct {
598 u32 status;
599 } err;
600
601 } data;
602};
603
604/**
605 * This struct defines a event registration parameters and is used as the
606 * argument for the sps_register_event() function.
607 *
608 * @options - Event options that will trigger the event object.
609 * @mode - Event trigger mode.
610 *
611 * @xfer_done - a pointer to a completion object. NULL if not in use.
612 *
613 * @callback - a callback to call on completion. NULL if not in use.
614 *
615 * @user - User pointer that will be provided in event callback data.
616 *
617 */
618struct sps_register_event {
619 enum sps_option options;
620 enum sps_trigger mode;
621 struct completion *xfer_done;
622 void (*callback)(struct sps_event_notify *notify);
623 void *user;
624};
625
626/**
627 * This struct defines a system memory transfer's parameters and is used as the
628 * argument for the sps_transfer() function.
629 *
630 * @iovec_phys - Physical address of I/O vectors buffer.
631 * @iovec - Pointer to I/O vectors buffer.
632 * @iovec_count - Number of I/O vectors.
633 * @user - User pointer passed in callback event.
634 *
635 */
636struct sps_transfer {
637 u32 iovec_phys;
638 struct sps_iovec *iovec;
639 u32 iovec_count;
640 void *user;
641};
642
643/**
644 * This struct defines a timer control operation parameters and is used as an
645 * argument for the sps_timer_ctrl() function.
646 *
647 * @op - Timer control operation.
648 * @timeout_msec - Inactivity timeout (msec).
649 *
650 */
651struct sps_timer_ctrl {
652 enum sps_timer_op op;
653
654 /**
655 * The following configuration parameters must be set when the timer
656 * control operation is SPS_TIMER_OP_CONFIG.
657 */
658 enum sps_timer_mode mode;
659 u32 timeout_msec;
660};
661
662/**
663 * This struct defines a timer control operation result and is used as an
664 * argument for the sps_timer_ctrl() function.
665 */
666struct sps_timer_result {
667 u32 current_timer;
668};
669
670
671/*----------------------------------------------------------------------------
672 * Functions specific to sps interface
673 * -------------------------------------------------------------------------*/
674struct sps_pipe; /* Forward declaration */
675
Yan He2eafd742012-04-09 16:07:15 -0700676#ifdef CONFIG_SPS
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700677/**
678 * Register a BAM device
679 *
680 * This function registers a BAM device with the SPS driver. For each
681 *peripheral that includes a BAM, the peripheral driver must register
682 * the BAM with the SPS driver.
683 *
684 * A requirement is that the peripheral driver must remain attached
685 * to the SPS driver until the BAM is deregistered. Otherwise, the
686 * system may attempt to unload the SPS driver. BAM registrations would
687 * be lost.
688 *
689 * @bam_props - Pointer to struct for BAM device properties.
690 *
691 * @dev_handle - Device handle will be written to this location (output).
692 *
693 * @return 0 on success, negative value on error
694 *
695 */
696int sps_register_bam_device(const struct sps_bam_props *bam_props,
697 u32 *dev_handle);
698
699/**
700 * Deregister a BAM device
701 *
702 * This function deregisters a BAM device from the SPS driver. The peripheral
703 * driver should deregister a BAM when the peripheral driver is shut down or
704 * when BAM use should be disabled.
705 *
706 * A BAM cannot be deregistered if any of its pipes is in an active connection.
707 *
708 * When all BAMs have been deregistered, the system is free to unload the
709 * SPS driver.
710 *
711 * @dev_handle - BAM device handle.
712 *
713 * @return 0 on success, negative value on error
714 *
715 */
716int sps_deregister_bam_device(u32 dev_handle);
717
718/**
719 * Allocate client state context
720 *
721 * This function allocate and initializes a client state context struct.
722 *
723 * @return pointer to client state context
724 *
725 */
726struct sps_pipe *sps_alloc_endpoint(void);
727
728/**
729 * Free client state context
730 *
731 * This function de-initializes and free a client state context struct.
732 *
733 * @ctx - client context for SPS connection end point
734 *
735 * @return 0 on success, negative value on error
736 *
737 */
738int sps_free_endpoint(struct sps_pipe *h);
739
740/**
741 * Get the configuration parameters for an SPS connection end point
742 *
743 * This function retrieves the configuration parameters for an SPS connection
744 * end point.
745 * This function may be called before the end point is connected (before
746 * sps_connect is called). This allows the client to specify parameters before
747 * the connection is established.
748 *
749 * The client must call this function to fill it's struct sps_connect
750 * struct before modifying values and passing the struct to sps_set_config().
751 *
752 * @h - client context for SPS connection end point
753 *
754 * @config - Pointer to buffer for the end point's configuration parameters.
755 * Must not be NULL.
756 *
757 * @return 0 on success, negative value on error
758 *
759 */
760int sps_get_config(struct sps_pipe *h, struct sps_connect *config);
761
762/**
763 * Allocate memory from the SPS Pipe-Memory.
764 *
765 * @h - client context for SPS connection end point
766 *
767 * @mem - memory type - N/A.
768 *
769 * @mem_buffer - Pointer to struct for allocated memory properties.
770 *
771 * @return 0 on success, negative value on error
772 *
773 */
774int sps_alloc_mem(struct sps_pipe *h, enum sps_mem mem,
775 struct sps_mem_buffer *mem_buffer);
776
777/**
778 * Free memory from the SPS Pipe-Memory.
779 *
780 * @h - client context for SPS connection end point
781 *
782 * @mem_buffer - Pointer to struct for allocated memory properties.
783 *
784 * @return 0 on success, negative value on error
785 *
786 */
787int sps_free_mem(struct sps_pipe *h, struct sps_mem_buffer *mem_buffer);
788
789/**
790 * Connect an SPS connection end point
791 *
792 * This function creates a connection between two SPS peripherals or between
793 * an SPS peripheral and the local host processor (via system memory, end
794 *point SPS_DEV_HANDLE_MEM). Establishing the connection includes
795 * initialization of the SPS hardware and allocation of any other connection
796 * resources (buffer memory, etc.).
797 *
798 * This function requires the client to specify both the source and
799 * destination end points of the SPS connection. However, the handle
800 * returned applies only to the end point of the connection that the client
801 * controls. The end point under control must be specified by the
802 * enum sps_mode mode argument, either SPS_MODE_SRC, SPS_MODE_DEST, or
803 * SPS_MODE_CTL. Note that SPS_MODE_CTL is only supported for I/O
804 * accelerator connections, and only a limited set of control operations are
805 * allowed (TBD).
806 *
807 * For a connection involving system memory
808 * (SPS_DEV_HANDLE_MEM), the peripheral end point must be
809 * specified. For example, SPS_MODE_SRC must be specified for a
810 * BAM-to-system connection, since the BAM pipe is the data
811 * producer.
812 *
813 * For a specific peripheral-to-peripheral connection, there may be more than
814 * one required configuration. For example, there might be high-performance
815 * and low-power configurations for a connection between the two peripherals.
816 * The config argument allows the client to specify different configurations,
817 * which may require different system resource allocations and hardware
818 * initialization.
819 *
820 * A client is allowed to create one and only one connection for its
821 * struct sps_pipe. The handle is used to identify the connection end point
822 * in subsequent SPS driver calls. A specific connection source or
823 * destination end point can be associated with one and only one
824 * struct sps_pipe.
825 *
826 * The client must establish an open device handle to the SPS. To do so, the
827 * client must attach to the SPS driver and open the SPS device by calling
828 * the following functions.
829 *
830 * @h - client context for SPS connection end point
831 *
832 * @connect - Pointer to connection parameters
833 *
834 * @return 0 on success, negative value on error
835 *
836 */
837int sps_connect(struct sps_pipe *h, struct sps_connect *connect);
838
839/**
840 * Disconnect an SPS connection end point
841 *
842 * This function disconnects an SPS connection end point.
843 * The SPS hardware associated with that end point will be disabled.
844 * For a connection involving system memory (SPS_DEV_HANDLE_MEM), all
845 * connection resources are deallocated. For a peripheral-to-peripheral
846 * connection, the resources associated with the connection will not be
847 * deallocated until both end points are closed.
848 *
849 * The client must call sps_connect() for the handle before calling
850 * this function.
851 *
852 * @h - client context for SPS connection end point
853 *
854 * @return 0 on success, negative value on error
855 *
856 */
857int sps_disconnect(struct sps_pipe *h);
858
859/**
860 * Register an event object for an SPS connection end point
861 *
862 * This function registers a callback event object for an SPS connection end
863 *point. The registered event object will be triggered for the set of
864 * events specified in reg->options that are enabled for the end point.
865 *
866 * There can only be one registered event object for each event. If an event
867 * object is already registered for an event, it will be replaced. If
868 *reg->event handle is NULL, then any registered event object for the
869 * event will be deregistered. Option bits in reg->options not associated
870 * with events are ignored.
871 *
872 * The client must call sps_connect() for the handle before calling
873 * this function.
874 *
875 * @h - client context for SPS connection end point
876 *
877 * @reg - Pointer to event registration parameters
878 *
879 * @return 0 on success, negative value on error
880 *
881 */
882int sps_register_event(struct sps_pipe *h, struct sps_register_event *reg);
883
884/**
885 * Perform a single DMA transfer on an SPS connection end point
886 *
887 * This function submits a DMA transfer request consisting of a single buffer
888 * for an SPS connection end point associated with a peripheral-to/from-memory
889 * connection. The request will be submitted immediately to hardware if the
890 * hardware is idle (data flow off, no other pending transfers). Otherwise, it
891 * will be queued for later handling in the SPS driver work loop.
892 *
893 * The data buffer must be DMA ready. The client is responsible for insuring
894 *physically contiguous memory, cache maintenance, and memory barrier. For
895 * more information, see Appendix A.
896 *
897 * The client must not modify the data buffer until the completion indication is
898 * received.
899 *
900 * This function cannot be used if transfer queuing is disabled (see option
901 * SPS_O_NO_Q). The client must set the SPS_O_EOT option to receive a callback
902 * event trigger when the transfer is complete. The SPS driver will insure the
903 * appropriate flags in the I/O vectors are set to generate the completion
904 * indication.
905 *
906 * The return value from this function may indicate that an error occurred.
907 * Possible causes include invalid arguments.
908 *
909 * @h - client context for SPS connection end point
910 *
911 * @addr - Physical address of buffer to transfer.
912 *
913 * WARNING: The memory provided should be physically contiguous and
914 * non-cached.
915 *
916 * The user can use one of the following:
917 * 1. sps_alloc_mem() - allocated from pipe-memory.
918 * 2. dma_alloc_coherent() - allocate DMA memory.
919 * 3. dma_map_single() for memory allocated by kmalloc().
920 *
921 * @size - Size in bytes of buffer to transfer
922 *
923 * @user - User pointer that will be returned to user as part of
924 * event payload
925 *
926 * @return 0 on success, negative value on error
927 *
928 */
929int sps_transfer_one(struct sps_pipe *h, u32 addr, u32 size,
930 void *user, u32 flags);
931
932/**
933 * Read event queue for an SPS connection end point
934 *
935 * This function reads event queue for an SPS connection end point.
936 *
937 * @h - client context for SPS connection end point
938 *
939 * @event - pointer to client's event data buffer
940 *
941 * @return 0 on success, negative value on error
942 *
943 */
944int sps_get_event(struct sps_pipe *h, struct sps_event_notify *event);
945
946/**
947 * Get processed I/O vector (completed transfers)
948 *
949 * This function fetches the next processed I/O vector.
950 *
951 * @h - client context for SPS connection end point
952 *
953 * @iovec - Pointer to I/O vector struct (output).
954 * This struct will be zeroed if there are no more processed I/O vectors.
955 *
956 * @return 0 on success, negative value on error
957 *
958 */
959int sps_get_iovec(struct sps_pipe *h, struct sps_iovec *iovec);
960
961/**
962 * Enable an SPS connection end point
963 *
964 * This function enables an SPS connection end point.
965 *
966 * @h - client context for SPS connection end point
967 *
968 * @return 0 on success, negative value on error
969 *
970 */
971int sps_flow_on(struct sps_pipe *h);
972
973/**
974 * Disable an SPS connection end point
975 *
976 * This function disables an SPS connection end point.
977 *
978 * @h - client context for SPS connection end point
979 *
980 * @mode - Desired mode for disabling pipe data flow
981 *
982 * @return 0 on success, negative value on error
983 *
984 */
985int sps_flow_off(struct sps_pipe *h, enum sps_flow_off mode);
986
987/**
988 * Perform a Multiple DMA transfer on an SPS connection end point
989 *
990 * This function submits a DMA transfer request for an SPS connection end point
991 * associated with a peripheral-to/from-memory connection. The request will be
992 * submitted immediately to hardware if the hardware is idle (data flow off, no
993 * other pending transfers). Otherwise, it will be queued for later handling in
994 * the SPS driver work loop.
995 *
996 * The data buffers referenced by the I/O vectors must be DMA ready.
997 * The client is responsible for insuring physically contiguous memory,
998 * any cache maintenance, and memory barrier. For more information,
999 * see Appendix A.
1000 *
1001 * The I/O vectors must specify physical addresses for the referenced buffers.
1002 *
1003 * The client must not modify the data buffers referenced by I/O vectors until
1004 * the completion indication is received.
1005 *
1006 * If transfer queuing is disabled (see option SPS_O_NO_Q), the client is
1007 * responsible for setting the appropriate flags in the I/O vectors to generate
1008 * the completion indication. Also, the client is responsible for enabling the
1009 * appropriate connection callback event options for completion indication (see
1010 * sps_connect(), sps_set_config()).
1011 *
1012 * If transfer queuing is enabled, the client must set the SPS_O_EOT option to
1013 * receive a callback event trigger when the transfer is complete. The SPS
1014 * driver will insure the appropriate flags in the I/O vectors are set to
1015 * generate the completion indication. The client must not set any flags in the
1016 * I/O vectors, as this may cause the SPS driver to become out of sync with the
1017 * hardware.
1018 *
1019 * The return value from this function may indicate that an error occurred.
1020 * Possible causes include invalid arguments. If transfer queuing is disabled,
1021 * an error will occur if the pipe is already processing a transfer.
1022 *
1023 * @h - client context for SPS connection end point
1024 *
1025 * @transfer - Pointer to transfer parameter struct
1026 *
1027 * @return 0 on success, negative value on error
1028 *
1029 */
1030int sps_transfer(struct sps_pipe *h, struct sps_transfer *transfer);
1031
1032/**
1033 * Determine whether an SPS connection end point FIFO is empty
1034 *
1035 * This function returns the empty state of an SPS connection end point.
1036 *
1037 * @h - client context for SPS connection end point
1038 *
1039 * @empty - pointer to client's empty status word (boolean)
1040 *
1041 * @return 0 on success, negative value on error
1042 *
1043 */
1044int sps_is_pipe_empty(struct sps_pipe *h, u32 *empty);
1045
1046/**
1047 * Reset an SPS BAM device
1048 *
1049 * This function resets an SPS BAM device.
1050 *
1051 * @dev - device handle for the BAM
1052 *
1053 * @return 0 on success, negative value on error
1054 *
1055 */
1056int sps_device_reset(u32 dev);
1057
1058/**
1059 * Set the configuration parameters for an SPS connection end point
1060 *
1061 * This function sets the configuration parameters for an SPS connection
1062 * end point. This function may be called before the end point is connected
1063 * (before sps_connect is called). This allows the client to specify
1064 *parameters before the connection is established. The client is allowed
1065 * to pre-allocate resources and override driver defaults.
1066 *
1067 * The client must call sps_get_config() to fill it's struct sps_connect
1068 * struct before modifying values and passing the struct to this function.
1069 * Only those parameters that differ from the current configuration will
1070 * be processed.
1071 *
1072 * @h - client context for SPS connection end point
1073 *
1074 * @config - Pointer to the end point's new configuration parameters.
1075 *
1076 * @return 0 on success, negative value on error
1077 *
1078 */
1079int sps_set_config(struct sps_pipe *h, struct sps_connect *config);
1080
1081/**
1082 * Set ownership of an SPS connection end point
1083 *
1084 * This function sets the ownership of an SPS connection end point to
1085 * either local (default) or non-local. This function is used to
1086 * retrieve the struct sps_connect data that must be used by a
1087 * satellite processor when calling sps_connect().
1088 *
1089 * Non-local ownership is only possible/meaningful on the processor
1090 * that controls resource allocations (apps processor). Setting ownership
1091 * to non-local on a satellite processor will fail.
1092 *
1093 * Setting ownership from non-local to local will succeed only if the
1094 * owning satellite processor has properly brought the end point to
1095 * an idle condition.
1096 *
1097 * This function will succeed if the connection end point is already in
1098 * the specified ownership state.
1099 *
1100 * @h - client context for SPS connection end point
1101 *
1102 * @owner - New ownership of the connection end point
1103 *
1104 * @connect - Pointer to buffer for satellite processor connect data.
1105 * Can be NULL to avoid retrieving the connect data. Will be ignored
1106 * if the end point ownership is set to local.
1107 *
1108 * @return 0 on success, negative value on error
1109 *
1110 */
1111int sps_set_owner(struct sps_pipe *h, enum sps_owner owner,
1112 struct sps_satellite *connect);
1113
1114/**
1115 * Allocate a BAM DMA channel
1116 *
1117 * This function allocates a BAM DMA channel. A "BAM DMA" is a special
1118 * DMA peripheral with a BAM front end. The DMA peripheral acts as a conduit
1119 * for data to flow into a consumer pipe and then out of a producer pipe.
1120 * It's primarily purpose is to serve as a path for interprocessor communication
1121 * that allows each processor to control and protect it's own memory space.
1122 *
1123 * @alloc - Pointer to struct for BAM DMA channel allocation properties.
1124 *
1125 * @chan - Allocated channel information will be written to this
1126 * location (output).
1127 *
1128 * @return 0 on success, negative value on error
1129 *
1130 */
1131int sps_alloc_dma_chan(const struct sps_alloc_dma_chan *alloc,
1132 struct sps_dma_chan *chan);
1133
1134/**
1135 * Free a BAM DMA channel
1136 *
1137 * This function frees a BAM DMA channel.
1138 *
1139 * @chan - Pointer to information for channel to free
1140 *
1141 * @return 0 on success, negative value on error
1142 *
1143 */
1144int sps_free_dma_chan(struct sps_dma_chan *chan);
1145
1146/**
1147 * Get the BAM handle for BAM-DMA.
1148 *
1149 * The BAM handle should be use as source/destination in the sps_connect().
1150 *
1151 * @return handle on success, zero on error
1152 *
1153 */
1154u32 sps_dma_get_bam_handle(void);
1155
1156/**
1157 * Free the BAM handle for BAM-DMA.
1158 *
1159 */
1160void sps_dma_free_bam_handle(u32 h);
1161
1162
1163/**
1164 * Get number of free transfer entries for an SPS connection end point
1165 *
1166 * This function returns the number of free transfer entries for an
1167 * SPS connection end point.
1168 *
1169 * @h - client context for SPS connection end point
1170 *
1171 * @count - pointer to count status
1172 *
1173 * @return 0 on success, negative value on error
1174 *
1175 */
1176int sps_get_free_count(struct sps_pipe *h, u32 *count);
1177
1178/**
1179 * Perform timer control
1180 *
1181 * This function performs timer control operations.
1182 *
1183 * @h - client context for SPS connection end point
1184 *
1185 * @timer_ctrl - Pointer to timer control specification
1186 *
1187 * @timer_result - Pointer to buffer for timer operation result.
1188 * This argument can be NULL if no result is expected for the operation.
1189 * If non-NULL, the current timer value will always provided.
1190 *
1191 * @return 0 on success, negative value on error
1192 *
1193 */
1194int sps_timer_ctrl(struct sps_pipe *h,
1195 struct sps_timer_ctrl *timer_ctrl,
1196 struct sps_timer_result *timer_result);
1197
Yan He2027bd82011-11-05 14:43:01 -07001198/**
1199 * Find the handle of a BAM device based on the physical address
1200 *
1201 * This function finds a BAM device in the BAM registration list that
1202 * matches the specified physical address, and returns its handle.
1203 *
1204 * @phys_addr - physical address of the BAM
1205 *
1206 * @h - device handle of the BAM
1207 *
1208 * @return 0 on success, negative value on error
1209 *
1210 */
1211int sps_phy2h(u32 phys_addr, u32 *handle);
1212
1213/**
1214 * Setup desc/data FIFO for bam-to-bam connection
1215 *
1216 * @mem_buffer - Pointer to struct for allocated memory properties.
1217 *
1218 * @addr - address of FIFO
1219 *
1220 * @size - FIFO size
1221 *
1222 * @use_offset - use address offset instead of absolute address
1223 *
1224 * @return 0 on success, negative value on error
1225 *
1226 */
1227int sps_setup_bam2bam_fifo(struct sps_mem_buffer *mem_buffer,
1228 u32 addr, u32 size, int use_offset);
1229
Yan Hece596c12012-04-06 10:42:33 -07001230/**
1231 * Get the number of unused descriptors in the descriptor FIFO
1232 * of a pipe
1233 *
1234 * @h - client context for SPS connection end point
1235 *
1236 * @desc_num - number of unused descriptors
1237 *
1238 * @return 0 on success, negative value on error
1239 *
1240 */
1241int sps_get_unused_desc_num(struct sps_pipe *h, u32 *desc_num);
1242
Yan He0eead892012-07-03 17:38:56 -07001243/**
1244 * Get the debug info of BAM registers and descriptor FIFOs
1245 *
1246 * @dev - BAM device handle
1247 *
1248 * @option - debugging option
1249 *
1250 * @para - parameter used for an option (such as pipe combination)
1251 *
Yan Hefc1aa892012-08-13 15:03:09 -07001252 * @tb_sel - testbus selection
1253 *
1254 * @pre_level - prescreening level
1255 *
Yan He0eead892012-07-03 17:38:56 -07001256 * @return 0 on success, negative value on error
1257 *
1258 */
Yan Hefc1aa892012-08-13 15:03:09 -07001259int sps_get_bam_debug_info(u32 dev, u32 option, u32 para,
1260 u32 tb_sel, u8 pre_level);
Yan He0eead892012-07-03 17:38:56 -07001261
Yan He2eafd742012-04-09 16:07:15 -07001262#else
1263static inline int sps_register_bam_device(const struct sps_bam_props
1264 *bam_props, u32 *dev_handle)
1265{
1266 return -EPERM;
1267}
1268
1269static inline int sps_deregister_bam_device(u32 dev_handle)
1270{
1271 return -EPERM;
1272}
1273
1274static inline struct sps_pipe *sps_alloc_endpoint(void)
1275{
1276 return NULL;
1277}
1278
1279static inline int sps_free_endpoint(struct sps_pipe *h)
1280{
1281 return -EPERM;
1282}
1283
1284static inline int sps_get_config(struct sps_pipe *h, struct sps_connect *config)
1285{
1286 return -EPERM;
1287}
1288
1289static inline int sps_alloc_mem(struct sps_pipe *h, enum sps_mem mem,
1290 struct sps_mem_buffer *mem_buffer)
1291{
1292 return -EPERM;
1293}
1294
1295static inline int sps_free_mem(struct sps_pipe *h,
1296 struct sps_mem_buffer *mem_buffer)
1297{
1298 return -EPERM;
1299}
1300
1301static inline int sps_connect(struct sps_pipe *h, struct sps_connect *connect)
1302{
1303 return -EPERM;
1304}
1305
1306static inline int sps_disconnect(struct sps_pipe *h)
1307{
1308 return -EPERM;
1309}
1310
1311static inline int sps_register_event(struct sps_pipe *h,
1312 struct sps_register_event *reg)
1313{
1314 return -EPERM;
1315}
1316
1317static inline int sps_transfer_one(struct sps_pipe *h, u32 addr, u32 size,
1318 void *user, u32 flags)
1319{
1320 return -EPERM;
1321}
1322
1323static inline int sps_get_event(struct sps_pipe *h,
1324 struct sps_event_notify *event)
1325{
1326 return -EPERM;
1327}
1328
1329static inline int sps_get_iovec(struct sps_pipe *h, struct sps_iovec *iovec)
1330{
1331 return -EPERM;
1332}
1333
1334static inline int sps_flow_on(struct sps_pipe *h)
1335{
1336 return -EPERM;
1337}
1338
1339static inline int sps_flow_off(struct sps_pipe *h, enum sps_flow_off mode)
1340{
1341 return -EPERM;
1342}
1343
1344static inline int sps_transfer(struct sps_pipe *h,
1345 struct sps_transfer *transfer)
1346{
1347 return -EPERM;
1348}
1349
1350static inline int sps_is_pipe_empty(struct sps_pipe *h, u32 *empty)
1351{
1352 return -EPERM;
1353}
1354
1355static inline int sps_device_reset(u32 dev)
1356{
1357 return -EPERM;
1358}
1359
1360static inline int sps_set_config(struct sps_pipe *h, struct sps_connect *config)
1361{
1362 return -EPERM;
1363}
1364
1365static inline int sps_set_owner(struct sps_pipe *h, enum sps_owner owner,
1366 struct sps_satellite *connect)
1367{
1368 return -EPERM;
1369}
1370
1371static inline int sps_get_free_count(struct sps_pipe *h, u32 *count)
1372{
1373 return -EPERM;
1374}
1375
1376static inline int sps_alloc_dma_chan(const struct sps_alloc_dma_chan *alloc,
1377 struct sps_dma_chan *chan)
1378{
1379 return -EPERM;
1380}
1381
1382static inline int sps_free_dma_chan(struct sps_dma_chan *chan)
1383{
1384 return -EPERM;
1385}
1386
1387static inline u32 sps_dma_get_bam_handle(void)
1388{
1389 return 0;
1390}
1391
1392static inline void sps_dma_free_bam_handle(u32 h)
1393{
1394}
1395
1396static inline int sps_timer_ctrl(struct sps_pipe *h,
1397 struct sps_timer_ctrl *timer_ctrl,
1398 struct sps_timer_result *timer_result)
1399{
1400 return -EPERM;
1401}
1402
1403static inline int sps_phy2h(u32 phys_addr, u32 *handle)
1404{
1405 return -EPERM;
1406}
1407
1408static inline int sps_setup_bam2bam_fifo(struct sps_mem_buffer *mem_buffer,
1409 u32 addr, u32 size, int use_offset)
1410{
1411 return -EPERM;
1412}
1413
1414static inline int sps_get_unused_desc_num(struct sps_pipe *h, u32 *desc_num)
1415{
1416 return -EPERM;
1417}
Yan He0eead892012-07-03 17:38:56 -07001418
Yan Hefc1aa892012-08-13 15:03:09 -07001419static inline int sps_get_bam_debug_info(u32 dev, u32 option, u32 para,
1420 u32 tb_sel, u8 pre_level)
Yan He0eead892012-07-03 17:38:56 -07001421{
1422 return -EPERM;
1423}
Yan He2eafd742012-04-09 16:07:15 -07001424#endif
1425
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001426#endif /* _SPS_H_ */