4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6 * IO dispatcher for a shared memory channel driver.
7 * Also, includes macros to simulate shm via port io calls.
9 * Copyright (C) 2005-2006 Texas Instruments, Inc.
11 * This package is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23 #include <dspbridge/_chnl_sm.h>
24 #include <dspbridge/host_os.h>
26 #include <dspbridge/io.h>
27 #include <dspbridge/mbx_sh.h> /* shared mailbox codes */
29 /* Magic code used to determine if DSP signaled exception. */
30 #define DEH_BASE MBX_DEH_BASE
31 #define DEH_LIMIT MBX_DEH_LIMIT
37 #ifdef CONFIG_TIDSPBRIDGE_DVFS
38 /* The maximum number of OPPs that are supported */
39 extern s32 dsp_max_opps;
40 /* The Vdd1 opp table information */
41 extern u32 vdd1_dsp_freq[6][4];
45 * ======== io_cancel_chnl ========
47 * Cancel IO on a given channel.
49 * hio_mgr: IO Manager.
50 * chnl: Index of channel to cancel IO on.
56 extern void io_cancel_chnl(struct io_mgr *hio_mgr, u32 chnl);
59 * ======== io_dpc ========
61 * Deferred procedure call for shared memory channel driver ISR. Carries
62 * out the dispatch of I/O.
64 * ref_data: Pointer to reference data registered via a call to
69 * Must not acquire resources.
70 * All data touched must be locked in memory if running in kernel mode.
72 * Non-preemptible (but interruptible).
74 extern void io_dpc(unsigned long ref_data);
77 * ======== io_mbox_msg ========
79 * Main message handler for the shared memory Bridge channel manager.
80 * Determine if this message is ours, then schedules a DPC to
83 * self: Pointer to its own notifier_block struct.
84 * len: Length of message.
85 * msg: Message code received.
87 * NOTIFY_OK if handled; NOTIFY_BAD otherwise.
89 int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg);
92 * ======== io_request_chnl ========
94 * Request I/O from the DSP. Sets flags in shared memory, then interrupts
97 * hio_mgr: IO manager handle.
98 * pchnl: Ptr to the channel requesting I/O.
99 * io_mode: Mode of channel: {IO_INPUT | IO_OUTPUT}.
105 extern void io_request_chnl(struct io_mgr *io_manager,
106 struct chnl_object *pchnl,
107 u8 io_mode, u16 *mbx_val);
110 * ======== iosm_schedule ========
112 * Schedule DPC for IO.
114 * pio_mgr: Ptr to a I/O manager.
120 extern void iosm_schedule(struct io_mgr *io_manager);
123 * ======== io_sh_msetting ========
125 * Sets the shared memory setting
127 * hio_mgr: Handle to a I/O manager.
128 * desc: Shared memory type
129 * pargs: Ptr to shm setting
136 extern int io_sh_msetting(struct io_mgr *hio_mgr, u8 desc, void *pargs);
139 * Misc functions for the CHNL_IO shared memory library:
142 /* Maximum channel bufsize that can be used. */
143 extern u32 io_buf_size(struct io_mgr *hio_mgr);
145 #ifdef CONFIG_TIDSPBRIDGE_BACKTRACE
147 * ========print_dsp_trace_buffer ========
148 * Print DSP tracebuffer.
150 extern int print_dsp_trace_buffer(struct bridge_dev_context
153 int dump_dsp_stack(struct bridge_dev_context *bridge_context);
155 void dump_dl_modules(struct bridge_dev_context *bridge_context);
157 void print_dsp_debug_trace(struct io_mgr *hio_mgr);