2
* Copyright (c) 2005, Adaptive Digital Technologies, Inc.
4
* File Name: GpakCust.h
7
* This file contains host system dependent definitions and prototypes of
8
* functions to support generic G.PAK API functions. The file is used when
9
* integrating G.PAK API functions in a specific host processor environment.
11
* Note: This file may need to be modified by the G.PAK system integrator.
16
* 06/15/05 - Initial release.
18
* This program has been released under the terms of the GPL version 2 by
19
* permission of Adaptive Digital Technologies, Inc. The standard
20
* GPL disclaimer is given inline below for your convenience.
22
* This program is free software; you can redistribute it and/or modify
23
* it under the terms of the GNU General Public License as published by
24
* the Free Software Foundation; either version 2 of the License, or
25
* (at your option) any later version.
27
* This program is distributed in the hope that it will be useful,
28
* but WITHOUT ANY WARRANTY; without even the implied warranty of
29
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
* GNU General Public License for more details.
32
* You should have received a copy of the GNU General Public License
33
* along with this program; if not, write to the Free Software
34
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37
#ifndef _GPAKCUST_H /* prevent multiple inclusion */
40
#include "wctdm24xxp.h"
41
#ifdef VPM150M_SUPPORT
42
#include <linux/device.h>
43
#include <linux/firmware.h>
48
struct wctdm_firmware {
49
const struct firmware *fw;
53
/* Host and DSP system dependent related definitions. */
54
#define MAX_DSP_CORES 128 /* maximum number of DSP cores */
55
//#define MAX_CONFS 1 /* maximum number of conferences */
56
//#define MAX_PKT_CHANNELS 8 /* maximum number of packet channels */
57
#define MAX_CHANNELS 32 /* maximum number of channels */
58
#define MAX_WAIT_LOOPS 50 /* max number of wait delay loops */
59
#define DSP_IFBLK_ADDRESS 0x0100 /* DSP address of I/F block pointer */
60
#define DOWNLOAD_BLOCK_SIZE 512 /* download block size (DSP words) */
61
//#define MAX_CIDPAYLOAD_BYTES 512 /* max size of a CID payload (octets) */
62
typedef unsigned short DSP_WORD; /* 16 bit DSP word */
63
typedef unsigned int DSP_ADDRESS; /* 32 bit DSP address */
64
typedef struct wctdm_firmware* GPAK_FILE_ID; /* G.PAK Download file identifier */
66
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
67
* gpakReadDspMemory - Read DSP memory.
70
* This function reads a contiguous block of words from DSP memory starting at
71
* the specified address.
77
extern void gpakReadDspMemory(
78
unsigned short int DspId, /* DSP Identifier (0 to MAX_DSP_CORES-1) */
79
DSP_ADDRESS DspAddress, /* DSP's memory address of first word */
80
unsigned int NumWords, /* number of contiguous words to read */
81
DSP_WORD *pWordValues /* pointer to array of word values variable */
85
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
86
* gpakWriteDspMemory - Write DSP memory.
89
* This function writes a contiguous block of words to DSP memory starting at
90
* the specified address.
96
extern void gpakWriteDspMemory(
97
unsigned short int DspId, /* DSP Identifier (0 to MAX_DSP_CORES-1) */
98
DSP_ADDRESS DspAddress, /* DSP's memory address of first word */
99
unsigned int NumWords, /* number of contiguous words to write */
100
DSP_WORD *pWordValues /* pointer to array of word values to write */
104
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
105
* gpakHostDelay - Delay for a fixed time interval.
108
* This function delays for a fixed time interval before returning. The time
109
* interval is the Host Port Interface sampling period when polling a DSP for
110
* replies to command messages.
116
extern void gpakHostDelay(void);
119
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
120
* gpakLockAccess - Lock access to the specified DSP.
123
* This function aquires exclusive access to the specified DSP.
129
extern void gpakLockAccess(
130
unsigned short int DspId /* DSP Identifier (0 to MAX_DSP_CORES-1) */
134
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
135
* gpakUnlockAccess - Unlock access to the specified DSP.
138
* This function releases exclusive access to the specified DSP.
144
extern void gpakUnlockAccess(
145
unsigned short int DspId /* DSP Identifier (0 to MAX_DSP_CORES-1) */
149
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
150
* gpakReadFile - Read a block of bytes from a G.PAK Download file.
153
* This function reads a contiguous block of bytes from a G.PAK Download file
154
* starting at the current file position.
157
* The number of bytes read from the file.
158
* -1 indicates an error occurred.
159
* 0 indicates all bytes have been read (end of file)
162
extern int gpakReadFile(
163
GPAK_FILE_ID FileId, /* G.PAK Download File Identifier */
164
unsigned char *pBuffer, /* pointer to buffer for storing bytes */
165
unsigned int NumBytes /* number of bytes to read */
169
unsigned char wctdm_vpm150m_getpage(struct wctdm *wc);
171
int wctdm_vpm150m_setpage(struct wctdm *wc, unsigned short addr);
173
int wctdm_vpm150m_setreg(struct wctdm *wc, unsigned int len, unsigned int addr, unsigned short *data);
175
unsigned short wctdm_vpm150m_getreg(struct wctdm *wc, unsigned int len, unsigned int addr, unsigned short *data);
177
char vpm150mtone_to_zaptone(GpakToneCodes_t tone);
179
#endif /* prevent multiple inclusion */