Commit e2255d22 authored by Hari Kanigeri's avatar Hari Kanigeri

port 3430 bridge files for tesla support

Port 3430 bridge files for tesla support. Also disables
PM.
parent 885f837b
/*
* TI's dspbridge platform device registration
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
* Copyright (C) 2009 Nokia Corporation
*
* Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/platform_device.h>
#include <mach/omap-pm.h>
#include <dspbridge/host_os.h>
static struct platform_device *dspbridge_pdev;
static struct dspbridge_platform_data dspbridge_pdata __initdata = {
#ifdef CONFIG_BRIDGE_DVFS
.dsp_set_min_opp = omap_pm_dsp_set_min_opp,
.dsp_get_opp = omap_pm_dsp_get_opp,
.cpu_set_freq = omap_pm_cpu_set_freq,
.cpu_get_freq = omap_pm_cpu_get_freq,
#endif
};
static int __init dspbridge_init(void)
{
struct platform_device *pdev;
int err = -ENOMEM;
struct dspbridge_platform_data *pdata = &dspbridge_pdata;
pdata->phys_mempool_base = dspbridge_get_mempool_base();
if (pdata->phys_mempool_base) {
pdata->phys_mempool_size = CONFIG_BRIDGE_MEMPOOL_SIZE;
pr_info("%s: %x bytes @ %x\n", __func__,
pdata->phys_mempool_size, pdata->phys_mempool_base);
}
pdev = platform_device_alloc("C6410", -1);
if (!pdev)
goto err_out;
err = platform_device_add_data(pdev, pdata, sizeof(*pdata));
if (err)
goto err_out;
err = platform_device_add(pdev);
if (err)
goto err_out;
dspbridge_pdev = pdev;
return 0;
err_out:
platform_device_put(pdev);
return err;
}
module_init(dspbridge_init);
static void __exit dspbridge_exit(void)
{
platform_device_unregister(dspbridge_pdev);
}
module_exit(dspbridge_exit);
MODULE_AUTHOR("Hiroshi DOYU");
MODULE_DESCRIPTION("TI's dspbridge platform device registration");
MODULE_LICENSE("GPL v2");
/*
* _chnl_sm.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== _chnl_sm.h ========
* Description:
* Private header file defining channel manager and channel objects for
* a shared memory channel driver.
*
* Public Functions:
* None.
*
* Notes:
* Shared between the modules implementing the shared memory channel class
* library.
*
*! Revision History:
*! ================
*! 15-Oct-2002 kc Removed legacy PERF code.
*! 12-Jan-2002 ag Removed unused gppReqIO & ddmaChnlId DDMA fields.
*! Added zero-copy chnl descriptor array: zchnldesc.
*! 21-Dec-2001 ag Moved descPaGpp to private chnl obj from chnl descriptor.
*! 20-May-2001 ag/jeh Removed fShmSyms field from CHNL_MGR.
*! 04-Feb-2001 ag DSP-DMA support added.
*! 26-Oct-2000 jeh Added arg and resvd to SHM control structure. Added dwArg
*! to CHNL_IRP.
*! 16-Oct-2000 jeh Removed #ifdef DEBUG from around channel object's cIOCs
*! field, added cIOReqs.
*! 20-Jan-2000 ag: Incorporated code review comments.
*! 05-Jan-2000 ag: Text format cleanup.
*! 03-Nov-1999 ag: Added szEventName[] to CHNL object for name event support.
*! 02-Nov-1999 ag: _SHM_BEG & _END Syms from COFF now used for IO and SM CLASS.
*! 27-Oct-1999 jeh Define SHM structure to work for 16-bit targets.
*! 25-May-1999 jg: Added target side symbol names for share memory buffer
*! 03-Jan-1997 gp: Added fSharedIRQ field.
*! 22-Oct-1996 gp: Made dwProcessID a handle.
*! 09-Sep-1996 gp: Added dwProcessID field to CHNL_OBJECT.
*! 13-Aug-1996 gp: Created.
*/
#ifndef _CHNL_SM_
#define _CHNL_SM_
#include <dspbridge/wcd.h>
#include <dspbridge/wmd.h>
#include <dspbridge/dpc.h>
#include <dspbridge/list.h>
#include <dspbridge/ntfy.h>
/*
* These target side symbols define the beginning and ending addresses
* of shared memory buffer. They are defined in the *cfg.cmd file by
* cdb code.
*/
#define CHNL_SHARED_BUFFER_BASE_SYM "_SHM_BEG"
#define CHNL_SHARED_BUFFER_LIMIT_SYM "_SHM_END"
#define BRIDGEINIT_BIOSGPTIMER "_BRIDGEINIT_BIOSGPTIMER"
#define BRIDGEINIT_LOADMON_GPTIMER "_BRIDGEINIT_LOADMON_GPTIMER"
#ifndef _CHNL_WORDSIZE
#define _CHNL_WORDSIZE 4 /* default _CHNL_WORDSIZE is 2 bytes/word */
#endif
#define MAXOPPS 16
struct oppTableEntry {
u32 voltage;
u32 frequency;
u32 minFreq;
u32 maxFreq;
} ;
struct oppStruct {
u32 currOppPt;
u32 numOppPts;
struct oppTableEntry oppPoint[MAXOPPS];
} ;
/* Request to MPU */
struct oppRqstStruct {
u32 rqstDspFreq;
u32 rqstOppPt;
};
/* Info to MPU */
struct loadMonStruct {
u32 currDspLoad;
u32 currDspFreq;
u32 predDspLoad;
u32 predDspFreq;
};
enum SHM_DESCTYPE {
SHM_CURROPP = 0,
SHM_OPPINFO = 1,
SHM_GETOPP = 2, /* Get DSP requested OPP info */
} ;
/* Structure in shared between DSP and PC for communication.*/
struct SHM {
u32 dspFreeMask; /* Written by DSP, read by PC. */
u32 hostFreeMask; /* Written by PC, read by DSP */
u32 inputFull; /* Input channel has unread data. */
u32 inputId; /* Channel for which input is available. */
u32 inputSize; /* Size of data block (in DSP words). */
u32 outputFull; /* Output channel has unread data. */
u32 outputId; /* Channel for which output is available. */
u32 outputSize; /* Size of data block (in DSP words). */
u32 arg; /* Arg for Issue/Reclaim (23 bits for 55x). */
u32 resvd; /* Keep structure size even for 32-bit DSPs */
/* Operating Point structure */
struct oppStruct oppTableStruct;
/* Operating Point Request structure */
struct oppRqstStruct oppRequest;
/* load monitor information structure*/
struct loadMonStruct loadMonInfo;
char dummy[184]; /* padding to 256 byte boundary */
u32 shm_dbg_var[64]; /* shared memory debug variables */
} ;
/* Channel Manager: only one created per board: */
struct CHNL_MGR {
u32 dwSignature; /* Used for object validation */
/* Function interface to WMD */
struct WMD_DRV_INTERFACE *pIntfFxns;
struct IO_MGR *hIOMgr; /* IO manager */
/* Device this board represents */
struct DEV_OBJECT *hDevObject;
/* These fields initialized in WMD_CHNL_Create(): */
u32 dwOutputMask; /* Host output channels w/ full buffers */
u32 dwLastOutput; /* Last output channel fired from DPC */
/* Critical section object handle */
struct SYNC_CSOBJECT *hCSObj;
u32 uWordSize; /* Size in bytes of DSP word */
u32 cChannels; /* Total number of channels */
u32 cOpenChannels; /* Total number of open channels */
struct CHNL_OBJECT **apChannel; /* Array of channels */
u32 dwType; /* Type of channel class library */
/* If no SHM syms, return for CHNL_Open */
DSP_STATUS chnlOpenStatus;
} ;
/*
* Channel: up to CHNL_MAXCHANNELS per board or if DSP-DMA supported then
* up to CHNL_MAXCHANNELS + CHNL_MAXDDMACHNLS per board.
*/
struct CHNL_OBJECT {
u32 dwSignature; /* Used for object validation */
/* Pointer back to channel manager */
struct CHNL_MGR *pChnlMgr;
u32 uId; /* Channel id */
u32 dwState; /* Current channel state */
u32 uMode; /* Chnl mode and attributes */
/* Chnl I/O completion event (user mode) */
HANDLE hUserEvent;
/* Abstract syncronization object */
struct SYNC_OBJECT *hSyncEvent;
/* Name of Sync event */
char szEventName[SYNC_MAXNAMELENGTH + 1];
u32 hProcess; /* Process which created this channel */
u32 pCBArg; /* Argument to use with callback */
struct LST_LIST *pIORequests; /* List of IOR's to driver */
s32 cIOCs; /* Number of IOC's in queue */
s32 cIOReqs; /* Number of IORequests in queue */
s32 cChirps; /* Initial number of free Irps */
/* List of IOC's from driver */
struct LST_LIST *pIOCompletions;
struct LST_LIST *pFreeList; /* List of free Irps */
struct NTFY_OBJECT *hNtfy;
u32 cBytesMoved; /* Total number of bytes transfered */
/* For DSP-DMA */
/* Type of chnl transport:CHNL_[PCPY][DDMA] */
u32 uChnlType;
} ;
/* I/O Request/completion packet: */
struct CHNL_IRP {
struct LST_ELEM link; /* Link to next CHIRP in queue. */
/* Buffer to be filled/emptied. (User) */
u8 *pHostUserBuf;
/* Buffer to be filled/emptied. (System) */
u8 *pHostSysBuf;
u32 dwArg; /* Issue/Reclaim argument. */
u32 uDspAddr; /* Transfer address on DSP side. */
u32 cBytes; /* Bytes transferred. */
u32 cBufSize; /* Actual buffer size when allocated. */
u32 status; /* Status of IO completion. */
} ;
#endif /* _CHNL_SM_ */
/*
* _dcd.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== _dcd.h ========
* Description:
* Includes the wrapper functions called directly by the
* DeviceIOControl interface.
*
* Public Functions:
* WCD_CallDevIOCtl
* WCD_Init
* WCD_InitComplete2
* WCD_Exit
* <MOD>WRAP_*
*
* Notes:
* Compiled with CDECL calling convention.
*
*! Revision History:
*! ================
*! 19-Apr-2004 sb Aligned DMM definitions with Symbian
*! 08-Mar-2004 sb Added the Dynamic Memory Mapping feature
*! 30-Jan-2002 ag Renamed CMMWRAP_AllocBuf to CMMWRAP_CallocBuf.
*! 22-Nov-2000 kc: Added MGRWRAP_GetPerf_Data to acquire PERF stats.
*! 27-Oct-2000 jeh Added NODEWRAP_AllocMsgBuf, NODEWRAP_FreeMsgBuf. Removed
*! NODEWRAP_GetMessageStream.
*! 10-Oct-2000 ag: Added user CMM wrappers.
*! 04-Aug-2000 rr: MEMWRAP and UTIL_Wrap added.
*! 27-Jul-2000 rr: NODEWRAP, STRMWRAP added.
*! 27-Jun-2000 rr: MGRWRAP fxns added.IFDEF to build for PM or DSP/BIOS Bridge
*! 03-Dec-1999 rr: WCD_InitComplete2 enabled for BRD_AutoStart.
*! 09-Nov-1999 kc: Added MEMRY.
*! 02-Nov-1999 ag: Added CHNL.
*! 08-Oct-1999 rr: Utilwrap_Testdll fxn added
*! 24-Sep-1999 rr: header changed from _wcd.h to _dcd.h
*! 09-Sep-1997 gp: Created.
*/
#ifndef _WCD_
#define _WCD_
#include <dspbridge/wcdioctl.h>
/*
* ======== WCD_CallDevIOCtl ========
* Purpose:
* Call the (wrapper) function for the corresponding WCD IOCTL.
* Parameters:
* cmd: IOCTL id, base 0.
* args: Argument structure.
* pResult:
* Returns:
* DSP_SOK if command called; DSP_EINVALIDARG if command not in IOCTL
* table.
* Requires:
* Ensures:
*/
extern DSP_STATUS WCD_CallDevIOCtl(unsigned int cmd,
union Trapped_Args *args,
u32 *pResult);
/*
* ======== WCD_Init ========
* Purpose:
* Initialize WCD modules, and export WCD services to WMD's.
* This procedure is called when the class driver is loaded.
* Parameters:
* Returns:
* TRUE if success; FALSE otherwise.
* Requires:
* Ensures:
*/
extern bool WCD_Init(void);
/*
* ======== WCD_InitComplete2 ========
* Purpose:
* Perform any required WCD, and WMD initialization which
* cannot not be performed in WCD_Init(void) or DEV_StartDevice() due
* to the fact that some services are not yet
* completely initialized.
* Parameters:
* Returns:
* DSP_SOK: Allow this device to load
* DSP_EFAIL: Failure.
* Requires:
* WCD initialized.
* Ensures:
*/
extern DSP_STATUS WCD_InitComplete2(void);
/*
* ======== WCD_Exit ========
* Purpose:
* Exit all modules initialized in WCD_Init(void).
* This procedure is called when the class driver is unloaded.
* Parameters:
* Returns:
* Requires:
* WCD_Init(void) was previously called.
* Ensures:
* Resources acquired in WCD_Init(void) are freed.
*/
extern void WCD_Exit(void);
/* MGR wrapper functions */
extern u32 MGRWRAP_EnumNode_Info(union Trapped_Args *args);
extern u32 MGRWRAP_EnumProc_Info(union Trapped_Args *args);
extern u32 MGRWRAP_RegisterObject(union Trapped_Args *args);
extern u32 MGRWRAP_UnregisterObject(union Trapped_Args *args);
extern u32 MGRWRAP_WaitForBridgeEvents(union Trapped_Args *args);
#ifndef RES_CLEANUP_DISABLE
extern u32 MGRWRAP_GetProcessResourcesInfo(union Trapped_Args *args);
#endif
/* CPRC (Processor) wrapper Functions */
extern u32 PROCWRAP_Attach(union Trapped_Args *args);
extern u32 PROCWRAP_Ctrl(union Trapped_Args *args);
extern u32 PROCWRAP_Detach(union Trapped_Args *args);
extern u32 PROCWRAP_EnumNode_Info(union Trapped_Args *args);
extern u32 PROCWRAP_EnumResources(union Trapped_Args *args);
extern u32 PROCWRAP_GetState(union Trapped_Args *args);
extern u32 PROCWRAP_GetTrace(union Trapped_Args *args);
extern u32 PROCWRAP_Load(union Trapped_Args *args);
extern u32 PROCWRAP_RegisterNotify(union Trapped_Args *args);
extern u32 PROCWRAP_Start(union Trapped_Args *args);
extern u32 PROCWRAP_ReserveMemory(union Trapped_Args *args);
extern u32 PROCWRAP_UnReserveMemory(union Trapped_Args *args);
extern u32 PROCWRAP_Map(union Trapped_Args *args);
extern u32 PROCWRAP_UnMap(union Trapped_Args *args);
extern u32 PROCWRAP_FlushMemory(union Trapped_Args *args);
extern u32 PROCWRAP_Stop(union Trapped_Args *args);
extern u32 PROCWRAP_InvalidateMemory(union Trapped_Args *args);
/* NODE wrapper functions */
extern u32 NODEWRAP_Allocate(union Trapped_Args *args);
extern u32 NODEWRAP_AllocMsgBuf(union Trapped_Args *args);
extern u32 NODEWRAP_ChangePriority(union Trapped_Args *args);
extern u32 NODEWRAP_Connect(union Trapped_Args *args);
extern u32 NODEWRAP_Create(union Trapped_Args *args);
extern u32 NODEWRAP_Delete(union Trapped_Args *args);
extern u32 NODEWRAP_FreeMsgBuf(union Trapped_Args *args);
extern u32 NODEWRAP_GetAttr(union Trapped_Args *args);
extern u32 NODEWRAP_GetMessage(union Trapped_Args *args);
extern u32 NODEWRAP_Pause(union Trapped_Args *args);
extern u32 NODEWRAP_PutMessage(union Trapped_Args *args);
extern u32 NODEWRAP_RegisterNotify(union Trapped_Args *args);
extern u32 NODEWRAP_Run(union Trapped_Args *args);
extern u32 NODEWRAP_Terminate(union Trapped_Args *args);
extern u32 NODEWRAP_GetUUIDProps(union Trapped_Args *args);
/* STRM wrapper functions */
extern u32 STRMWRAP_AllocateBuffer(union Trapped_Args *args);
extern u32 STRMWRAP_Close(union Trapped_Args *args);
extern u32 STRMWRAP_FreeBuffer(union Trapped_Args *args);
extern u32 STRMWRAP_GetEventHandle(union Trapped_Args *args);
extern u32 STRMWRAP_GetInfo(union Trapped_Args *args);
extern u32 STRMWRAP_Idle(union Trapped_Args *args);
extern u32 STRMWRAP_Issue(union Trapped_Args *args);
extern u32 STRMWRAP_Open(union Trapped_Args *args);
extern u32 STRMWRAP_Reclaim(union Trapped_Args *args);
extern u32 STRMWRAP_RegisterNotify(union Trapped_Args *args);
extern u32 STRMWRAP_Select(union Trapped_Args *args);
extern u32 CMMWRAP_CallocBuf(union Trapped_Args *args);
extern u32 CMMWRAP_FreeBuf(union Trapped_Args *args);
extern u32 CMMWRAP_GetHandle(union Trapped_Args *args);
extern u32 CMMWRAP_GetInfo(union Trapped_Args *args);
#endif /* _WCD_ */
/*
* brddefs.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== brddefs.h ========
* Description:
* Global BRD constants and types, shared between WSX, WCD, and WMD.
*
*! Revision History:
*! ================
*! 31-Jan-2000 rr: Comment Exec changed to Monitor
*! 22-Jul-1999 jeh Added BRD_LOADED state.
*! 26-Mar-1997 gp: Added BRD_SYNCINIT state.
*! 11-Dec-1996 cr: Added BRD_LASTSTATE definition.
*! 11-Jul-1996 gp: Added missing u32 callback argument to BRD_CALLBACK.
*! 10-Jun-1996 gp: Created from board.h and brd.h.
*/
#ifndef BRDDEFS_
#define BRDDEFS_
/* platform status values */
#define BRD_STOPPED 0x0 /* No Monitor Loaded, Not running. */
#define BRD_IDLE 0x1 /* Monitor Loaded, but suspended. */
#define BRD_RUNNING 0x2 /* Monitor loaded, and executing. */
#define BRD_UNKNOWN 0x3 /* Board state is indeterminate. */
#define BRD_SYNCINIT 0x4
#define BRD_LOADED 0x5
#define BRD_LASTSTATE BRD_LOADED /* Set to highest legal board state. */
#define BRD_SLEEP_TRANSITION 0x6 /* Sleep transition in progress */
#define BRD_HIBERNATION 0x7 /* MPU initiated hibernation */
#define BRD_RETENTION 0x8 /* Retention mode */
#define BRD_DSP_HIBERNATION 0x9 /* DSP initiated hibernation */
#define BRD_ERROR 0xA /* Board state is Error */
typedef u32 BRD_STATUS;
/* BRD Object */
struct BRD_OBJECT;
#endif /* BRDDEFS_ */
This diff is collapsed.
/*
* cfgdefs.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== cfgdefs.h ========
* Purpose:
* Global CFG constants and types, shared between class and mini driver.
*
*! Revision History:
*! ================
*! 24-Feb-2003 kc Removed wIOPort* in CFG_HOSTRES.
*! 06-Sep-2000 jeh Added channel info to CFG_HOSTRES.
*! 09-May-2000 rr: CFG_HOSTRES now support multiple windows for PCI support.
*! 31-Jan-2000 rr: Comments changed after code review.
*! 06-Jan-2000 rr: Bus Type included in CFG_HOSTRES.
*! 12-Nov-1999 rr: CFG_HOSTRES member names changed.
*! 25-Oct-1999 rr: Modified the CFG_HOSTRES Structure
*! PCMCIA ISR Register/Unregister fxn removed..
*! New flag PCCARD introduced during compile time.
*! 10-Sep-1999 ww: Added PCMCIA ISR Register/Unregister fxn.
*! 01-Sep-1999 ag: Removed NT/95 specific fields in CFG_HOSTRES
*! 27-Oct-1997 cr: Updated CFG_HOSTRES struct to support 1+ IRQs per board.
*! 17-Sep-1997 gp: Tacked some NT config info to end of CFG_HOSTRES structure.
*! 12-Dec-1996 cr: Cleaned up after code review.
*! 14-Nov-1996 gp: Renamed from wsxcfg.h
*! 19-Jun-1996 cr: Created.
*/
#ifndef CFGDEFS_
#define CFGDEFS_
/* Maximum length of module search path. */
#define CFG_MAXSEARCHPATHLEN 255
/* Maximum length of general paths. */
#define CFG_MAXPATH 255
/* Host Resources: */
#define CFG_MAXMEMREGISTERS 9
#define CFG_MAXIOPORTS 20
#define CFG_MAXIRQS 7
#define CFG_MAXDMACHANNELS 7
/* IRQ flag */
#define CFG_IRQSHARED 0x01 /* IRQ can be shared */
/* DSP Resources: */
#define CFG_DSPMAXMEMTYPES 10
#define CFG_DEFAULT_NUM_WINDOWS 1 /* We support only one window. */
/* A platform-related device handle: */
struct CFG_DEVNODE;
/*
* Host resource structure.
*/
struct CFG_HOSTRES {
u32 wNumMemWindows; /* Set to default */
/* This is the base.memory */
u32 dwMemBase[CFG_MAXMEMREGISTERS]; /* SHM virtual address */
u32 dwMemLength[CFG_MAXMEMREGISTERS]; /* Length of the Base */
u32 dwMemPhys[CFG_MAXMEMREGISTERS]; /* SHM Physical address */
u8 bIRQRegisters; /* IRQ Number */
u8 bIRQAttrib; /* IRQ Attribute */
u32 dwOffsetForMonitor; /* The Shared memory starts from
* dwMemBase + this offset */
/*
* Info needed by NODE for allocating channels to communicate with RMS:
* dwChnlOffset: Offset of RMS channels. Lower channels are
* reserved.
* dwChnlBufSize: Size of channel buffer to send to RMS
* dwNumChnls: Total number of channels (including reserved).
*/
u32 dwChnlOffset;
u32 dwChnlBufSize;
u32 dwNumChnls;
void __iomem *dwPrmBase;
void __iomem *dwCmBase;
void __iomem *dwPerBase;
u32 dwPerPmBase;
u32 dwCorePmBase;
void __iomem *dwWdTimerDspBase;
void __iomem *dwMboxBase;
void __iomem *dwDmmuBase;
void __iomem *dwSysCtrlBase;
} ;
struct CFG_DSPMEMDESC {
u32 uMemType; /* Type of memory. */
u32 ulMin; /* Minimum amount of memory of this type. */
u32 ulMax; /* Maximum amount of memory of this type. */
} ;
struct CFG_DSPRES {
u32 uChipType; /* DSP chip type. */
u32 uWordSize; /* Number of bytes in a word */
u32 cChips; /* Number of chips. */
u32 cMemTypes; /* Types of memory. */
struct CFG_DSPMEMDESC aMemDesc[CFG_DSPMAXMEMTYPES];
/* DSP Memory types */
} ;
#endif /* CFGDEFS_ */
/*
* chnl.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== chnl.h ========
* Description:
* WCD channel interface: multiplexes data streams through the single
* physical link managed by a mini-driver.
*
* Public Functions:
* CHNL_AddIOReq
* CHNL_AllocBuffer
* CHNL_CancelIO
* CHNL_Close
* CHNL_CloseOrphans
* CHNL_Create
* CHNL_Destroy
* CHNL_Exit
* CHNL_FlushIO
* CHNL_FreeBuffer
* CHNL_GetEventHandle
* CHNL_GetHandle
* CHNL_GetIOCompletion
* CHNL_GetId
* CHNL_GetMgr
* CHNL_GetMode
* CHNL_GetPosition
* CHNL_GetProcessHandle
* CHNL_Init
* CHNL_Open
*
* Notes:
* See DSP API chnl.h for more details.
*
*! Revision History:
*! ================
*! 14-Jan-1997 gp: Updated based on code review feedback.
*! 24-Oct-1996 gp: Move CloseOrphans into here from dspsys.
*! 09-Sep-1996 gp: Added CHNL_GetProcessID() and CHNL_GetHandle().
*! 10-Jul-1996 gp: Created.
*/
#ifndef CHNL_
#define CHNL_
#include <dspbridge/chnlpriv.h>
/*
* ======== CHNL_Close ========
* Purpose:
* Ensures all pending I/O on this channel is cancelled, discards all
* queued I/O completion notifications, then frees the resources allocated
* for this channel, and makes the corresponding logical channel id
* available for subsequent use.
* Parameters:
* hChnl: Channel object handle.
* Returns:
* DSP_SOK: Success;
* DSP_EHANDLE: Invalid hChnl.
* Requires:
* CHNL_Init(void) called.
* No thread must be blocked on this channel's I/O completion event.
* Ensures:
* DSP_SOK: The I/O completion event for this channel is freed.
* hChnl is no longer valid.
*/
extern DSP_STATUS CHNL_Close(struct CHNL_OBJECT *hChnl);
/*
* ======== CHNL_Create ========
* Purpose:
* Create a channel manager object, responsible for opening new channels
* and closing old ones for a given board.
* Parameters:
* phChnlMgr: Location to store a channel manager object on output.
* hDevObject: Handle to a device object.
* pMgrAttrs: Channel manager attributes.
* pMgrAttrs->cChannels: Max channels
* pMgrAttrs->bIRQ: Channel's I/O IRQ number.
* pMgrAttrs->fShared: TRUE if the IRQ is shareable.
* pMgrAttrs->uWordSize: DSP Word size in equivalent PC bytes..
* Returns:
* DSP_SOK: Success;
* DSP_EHANDLE: hDevObject is invalid.
* DSP_EINVALIDARG: cChannels is 0.
* DSP_EMEMORY: Insufficient memory for requested resources.
* CHNL_E_ISR: Unable to plug channel ISR for configured IRQ.
* CHNL_E_MAXCHANNELS: This manager cannot handle this many channels.
* CHNL_E_INVALIDIRQ: Invalid IRQ number. Must be 0 <= bIRQ <= 15.
* CHNL_E_INVALIDWORDSIZE: Invalid DSP word size. Must be > 0.
* CHNL_E_INVALIDMEMBASE: Invalid base address for DSP communications.
* CHNL_E_MGREXISTS: Channel manager already exists for this device.
* Requires:
* CHNL_Init(void) called.
* phChnlMgr != NULL.
* pMgrAttrs != NULL.
* Ensures:
* DSP_SOK: Subsequent calls to CHNL_Create() for the same
* board without an intervening call to
* CHNL_Destroy() will fail.
*/
extern DSP_STATUS CHNL_Create(OUT struct CHNL_MGR **phChnlMgr,
struct DEV_OBJECT *hDevObject,
IN CONST struct CHNL_MGRATTRS *pMgrAttrs);
/*
* ======== CHNL_Destroy ========
* Purpose:
* Close all open channels, and destroy the channel manager.
* Parameters:
* hChnlMgr: Channel manager object.
* Returns:
* DSP_SOK: Success.
* DSP_EHANDLE: hChnlMgr was invalid.
* Requires:
* CHNL_Init(void) called.
* Ensures:
* DSP_SOK: Cancels I/O on each open channel.
* Closes each open channel.
* CHNL_Create may subsequently be called for the
* same board.
*/
extern DSP_STATUS CHNL_Destroy(struct CHNL_MGR *hChnlMgr);
/*
* ======== CHNL_Exit ========
* Purpose:
* Discontinue usage of the CHNL module.
* Parameters:
* Returns:
* Requires:
* CHNL_Init(void) previously called.
* Ensures:
* Resources, if any acquired in CHNL_Init(void), are freed when the last
* client of CHNL calls CHNL_Exit(void).
*/
extern void CHNL_Exit(void);
/*
* ======== CHNL_Init ========
* Purpose:
* Initialize the CHNL module's private state.
* Parameters:
* Returns:
* TRUE if initialized; FALSE if error occurred.
* Requires:
* Ensures:
* A requirement for each of the other public CHNL functions.
*/
extern bool CHNL_Init(void);
#endif /* CHNL_ */
/*
* chnl_sm.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== chnl_sm.h ========
* Description:
* Prototypes for channel lower edge functions for a WinBRIDGE mini driver
* implementing data transfer via shared memory.
*
* Public Functions:
* CHNLSM_DisableInterrupt;
* CHNLSM_EnableInterrupt;
* CHNLSM_ISR;
* CHNLSM_Read;
* CHNLSM_UpdateSHMLength;
* CHNLSM_Write;
*
* Notes:
* These lower edge functions must be implemented by the WMD writer.
* Currently, CHNLSM_Read() and CHNLSM_Write() are not called, but must
* be defined to link.
*
*/
#ifndef CHNLSM_
#define CHNLSM_
#include <dspbridge/wmd.h>
/*
* ======== CHNLSM_DisableInterrupt ========
* Purpose:
* Disable interrupts from the DSP board to the PC.
* Parameters:
* hDevContext: Handle to mini-driver defined device info.
* Returns:
* Requires:
* Ensures:
*/
extern DSP_STATUS CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT*
hDevContext);
/*
* ======== CHNLSM_EnableInterrupt ========
* Purpose:
* Enable interrupts from the DSP board to the PC.
* Parameters:
* hDevContext: Handle to mini-driver defined device info.
* Returns:
* Requires:
* Ensures:
*/
extern DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT*
hDevContext);
/*
* ======== CHNLSM_InterruptDSP2 ========
* Purpose:
* Set interrupt value & send an interrupt to the DSP processor(s).
* This is typicaly used when mailbox interrupt mechanisms allow data
* to be associated with interrupt such as for OMAP's CMD/DATA regs.
* Parameters:
* hDevContext: Handle to mini-driver defined device info.
* wMbVal: Value associated with interrupt(e.g. mailbox value).
* Returns:
* DSP_SOK: Interrupt sent;
* else: Unable to send interrupt.
* Requires:
* Ensures:
*/
extern DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT*
hDevContext, u16 wMbVal);
/*
* ======== CHNLSM_ISR ========
* Purpose:
* Mini-driver's ISR, called by WCD when the board interrupts the host.
* Parameters:
* hDevContext: Handle to the mini-driver defined device info.
* pfSchedDPC: Set to TRUE to schedule a deferred procedure call
* to advance the channel protocol. The channel class
* library will call the WMD's CHNLSM_DPC routine during
* its own DPC, before dispatching I/O.
* The channel class library should ignore *pfSchedDPC when
* CHNLSM_ISR returns FALSE.
* pwMBRegVal: Value of mailbox register.
* Returns:
* TRUE if this interrupt is was generated by the DSP board.
* FALSE otherwise.
* Requires:
* Interrupts to the host processor are disabled on entry.
* Must only call functions which are in page locked memory.
* Must only call asynchronous OS services.
* The EOI for this interrupt has already been sent to the PIC.
* Ensures:
* If the interrupt is *not* shared, this routine must return TRUE.
*/
extern bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *hDevContext,
OUT bool *pfSchedDPC,
OUT u16 *pwIntrVal);
/*
* ======== CHNLSM_Read ========
* Purpose:
* Read data from DSP board memory into a Host buffer.
* Parameters:
* hDevContext: Handle to mini-driver defined device info.
* pHostBuf: Pointer to host buffer (Destination).
* dwDSPAddr: Address on DSP board (Source).
* ulNumBytes: Number of bytes to transfer.
* Returns:
* Requires:
* Ensures:
*/
extern DSP_STATUS CHNLSM_Read(struct WMD_DEV_CONTEXT *hDevContext,
OUT u8 *pHostBuf,
u32 dwDSPAddr, u32 ulNumBytes);
/*
* ======== CHNLSM_UpdateSHMLength ========
* Purpose:
* Allow the minidriver a chance to override the SHM length as reported
* to the mini driver (chnl_sm.lib) by Windows Plug and Play.
* Parameters:
* hDevContext: Handle to mini-driver defined device info.
* pSHMLength: Pointer to size of SHM window (in DSP words).
* Returns:
* TRUE if pSHMLength updated; FALSE otherwise.
* Requires:
* pSHMLength != NULL.
* Ensures:
* No more than sizeof(u32) bytes written to *pSHMLength
*/
extern bool CHNLSM_UpdateSHMLength(struct WMD_DEV_CONTEXT *hDevContext,
IN OUT u32 *pSHMLength);
/*
* ======== CHNLSM_Write ========
* Purpose:
* Write data from a Host buffer to DSP board memory.
* Parameters:
* hDevContext: Handle to mini-driver defined device info.
* pHostBuf: Pointer to host buffer (Source).
* dwDSPAddr: Address on DSP board (Destination).
* ulNumBytes: Number of bytes to transfer.
* Returns:
* Requires:
* Ensures:
*/
extern DSP_STATUS CHNLSM_Write(struct WMD_DEV_CONTEXT *hDevContext,
IN u8 *pHostBuf,
u32 dwDSPAddr, u32 ulNumBytes);
#endif /* CHNLSM_ */
/*
* chnldefs.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== chnldefs.h ========
* Purpose:
* System-wide channel objects and constants.
*
*! Revision History:
*! ================
*! 19-Jan-2002 ag Added cBufSize to IOC.
*! 05-Jan-2000 ag: Text format cleanup.
*! 02-Dec-1999 ag: Added new chnl attribute pstrEventName.
*! 12-Nov-1999 kc: Enabled hEvent attribute for tests.
*! 01-Nov-1999 ag: hEvent attribute not supported(yet).
*! 16-Jan-1997 gp: Moved private stuff into chnlpriv.h
*! 14-Jan-1997 gp: Updated based on code review feedback:
*! Removed CHNL_MODENOWAIT, CHNL_MODEDIRECT,
*! 03-Jan-1997 gp: Added channel class library types.
*! 14-Dec-1996 gp: Moved uChnlId field from CHNL_ATTRS to CHNL_Open().
*! 10-Dec-1996 gp: Added CHNL_IsTimedOut() macro.
*! 14-Nov-1996 gp: Renamed from wsxchnl.h.
*! 09-Sep-1996 gp: Added hReserved2 field to CHNL_ATTRS. Updated CHNL_INFO.
*! 10-Jul-1996 gp: Created from channel.h.
*/
#ifndef CHNLDEFS_
#define CHNLDEFS_
/* Channel id option. */
#define CHNL_PICKFREE (~0UL) /* Let manager pick a free channel. */
/* Channel manager limits: */
#define CHNL_INITIOREQS 4 /* Default # of I/O requests. */
/* Channel modes */
#define CHNL_MODETODSP 0x0000 /* Data streaming to the DSP. */
#define CHNL_MODEFROMDSP 0x0001 /* Data streaming from the DSP. */
/* GetIOCompletion flags */
#define CHNL_IOCINFINITE 0xffffffff /* Wait forever for IO completion. */
#define CHNL_IOCNOWAIT 0x0 /* Dequeue an IOC, if available. */
/* IO Completion Record status: */
#define CHNL_IOCSTATCOMPLETE 0x0000 /* IO Completed. */
#define CHNL_IOCSTATCANCEL 0x0002 /* IO was cancelled */
#define CHNL_IOCSTATTIMEOUT 0x0008 /* Wait for IOC timed out. */
#define CHNL_IOCSTATEOS 0x8000 /* End Of Stream reached. */
/* Macros for checking I/O Completion status: */
#define CHNL_IsEOS(ioc) (ioc.status & CHNL_IOCSTATEOS)
#define CHNL_IsIOComplete(ioc) (!(ioc.status & ~CHNL_IOCSTATEOS))
#define CHNL_IsIOCancelled(ioc) (ioc.status & CHNL_IOCSTATCANCEL)
#define CHNL_IsTimedOut(ioc) (ioc.status & CHNL_IOCSTATTIMEOUT)
/* CHNL types: */
typedef u32 CHNL_MODE; /* Channel transfer mode. */
/* Channel attributes: */
struct CHNL_ATTRS {
u32 uIOReqs; /* Max # of preallocated I/O requests. */
HANDLE hEvent; /* User supplied auto-reset event object. */
char *pstrEventName; /* Ptr to name of user event object. */
HANDLE hReserved1; /* Reserved for future use. */
u32 hReserved2; /* Reserved for future use. */
};
/* I/O completion record: */
struct CHNL_IOC {
void *pBuf; /* Buffer to be filled/emptied. */
u32 cBytes; /* Bytes transferred. */
u32 cBufSize; /* Actual buffer size in bytes */
u32 status; /* Status of IO completion. */
u32 dwArg; /* User argument associated with pBuf. */
} ;
#endif /* CHNLDEFS_ */
/*
* chnlpriv.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== chnlpriv.h ========
* Description:
* Private channel header shared between DSPSYS, WCD and WMD modules.
*
* Public Functions:
* None.
*
* Notes:
*
*! Revision History:
*! ================
*! 05-Jan-2002 ag Added cChannels(total # of chnls) to CHNL_MGRINFO struct.
*! Added private CHNL_[PCPY][ZCPY][DDMA].
*! 17-Nov-2000 jeh Removed IRQ, shared memory from CHNL_MGRATTRS, since these
*! now belong to IO_ATTRS.
*! 21-Jan-2000 ag: Code review comments added.
*! 05-Jan-2000 ag: Text format cleanup.
*! 11-Dec-1999 ag: Added CHNL_MAXLOCKPAGES for CHNL_PrepareBuffer().
*! 04-Dec-1999 ag: Added CHNL_MAXEVTNAMELEN for i/o compl named event support.
*! 01-Nov-1999 ag: CHNL_MAXCHANNELS set to 16 for 16-bit DSPs.
*! 27-Oct-1997 cr: Expanded CHNL_MAXIRQ from 0x0f to 0xff.
*! 16-Jan-1997 gp: Moved symbols into here from chnldefs.h.
*! 03-Jan-1997 gp: Added CHNL_MAXIRQ define.
*! 09-Dec-1996 gp: Removed CHNL_STATEIDLE.
*! 15-Jul-1996 gp: Created.
*/
#ifndef CHNLPRIV_
#define CHNLPRIV_
#include <dspbridge/chnldefs.h>
#include <dspbridge/devdefs.h>
#include <dspbridge/sync.h>
/* CHNL Object validation signatures: */
#define CHNL_MGRSIGNATURE 0x52474D43 /* "CMGR" (in reverse). */
#define CHNL_SIGNATURE 0x4C4E4843 /* "CHNL" (in reverse). */
/* Channel manager limits: */
#define CHNL_MAXCHANNELS 32 /* Max channels available per transport */
/*
* Trans port channel Id definitions:(must match dsp-side).
*
* For CHNL_MAXCHANNELS = 16:
*
* ChnlIds:
* 0-15 (PCPY) - transport 0)
* 16-31 (DDMA) - transport 1)
* 32-47 (ZCPY) - transport 2)
*/
#define CHNL_PCPY 0 /* Proc-copy transport 0 */
#define CHNL_MAXIRQ 0xff /* Arbitrarily large number. */
/* The following modes are private: */
#define CHNL_MODEUSEREVENT 0x1000 /* User provided the channel event. */
#define CHNL_MODEMASK 0x1001
/* Higher level channel states: */
#define CHNL_STATEREADY 0x0000 /* Channel ready for I/O. */
#define CHNL_STATECANCEL 0x0001 /* I/O was cancelled. */
#define CHNL_STATEEOS 0x0002 /* End Of Stream reached. */
/* Determine if user supplied an event for this channel: */
#define CHNL_IsUserEvent(mode) (mode & CHNL_MODEUSEREVENT)
/* Macros for checking mode: */
#define CHNL_IsInput(mode) (mode & CHNL_MODEFROMDSP)
#define CHNL_IsOutput(mode) (!CHNL_IsInput(mode))
/* Types of channel class libraries: */
#define CHNL_TYPESM 1 /* Shared memory driver. */
#define CHNL_TYPEBM 2 /* Bus Mastering driver. */
/* Max string length of channel I/O completion event name - change if needed */
#define CHNL_MAXEVTNAMELEN 32
/* Max memory pages lockable in CHNL_PrepareBuffer() - change if needed */
#define CHNL_MAXLOCKPAGES 64
/* Channel info. */
struct CHNL_INFO {
struct CHNL_MGR *hChnlMgr; /* Owning channel manager. */
u32 dwID; /* Channel ID. */
HANDLE hEvent; /* Channel I/O completion event. */
/*Abstraction of I/O completion event.*/
struct SYNC_OBJECT *hSyncEvent;
u32 dwMode; /* Channel mode. */
u32 dwState; /* Current channel state. */
u32 cPosition; /* Total bytes transferred. */
u32 cIOCs; /* Number of IOCs in queue. */
u32 cIOReqs; /* Number of IO Requests in queue. */
u32 hProcess; /* Process owning this channel. */
/*
* Name of channel I/O completion event. Not required in Linux
*/
char szEventName[CHNL_MAXEVTNAMELEN + 1];
} ;
/* Channel manager info: */
struct CHNL_MGRINFO {
u32 dwType; /* Type of channel class library. */
/* Channel handle, given the channel id. */
struct CHNL_OBJECT *hChnl;
u32 cOpenChannels; /* Number of open channels. */
u32 cChannels; /* total # of chnls supported */
} ;
/* Channel Manager Attrs: */
struct CHNL_MGRATTRS {
/* Max number of channels this manager can use. */
u32 cChannels;
u32 uWordSize; /* DSP Word size. */
} ;
#endif /* CHNLPRIV_ */
/*
* clk.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== clk.h ========
* Purpose: Provides Clock functions.
*
*! Revision History:
*! ================
*! 08-May-2007 rg: Moved all clock functions from sync module.
*/
#ifndef _CLK_H
#define _CLK_H
/* Generic TIMER object: */
struct TIMER_OBJECT;
enum SERVICES_ClkId {
SERVICESCLK_iva2_ck = 0,
SERVICESCLK_mailbox_ick,
SERVICESCLK_gpt5_fck,
SERVICESCLK_gpt5_ick,
SERVICESCLK_gpt6_fck,
SERVICESCLK_gpt6_ick,
SERVICESCLK_gpt7_fck,
SERVICESCLK_gpt7_ick,
SERVICESCLK_gpt8_fck,
SERVICESCLK_gpt8_ick,
SERVICESCLK_wdt3_fck,
SERVICESCLK_wdt3_ick,
SERVICESCLK_mcbsp1_fck,
SERVICESCLK_mcbsp1_ick,
SERVICESCLK_mcbsp2_fck,
SERVICESCLK_mcbsp2_ick,
SERVICESCLK_mcbsp3_fck,
SERVICESCLK_mcbsp3_ick,
SERVICESCLK_mcbsp4_fck,
SERVICESCLK_mcbsp4_ick,
SERVICESCLK_mcbsp5_fck,
SERVICESCLK_mcbsp5_ick,
SERVICESCLK_ssi_fck,
SERVICESCLK_ssi_ick,
SERVICESCLK_sys_32k_ck,
SERVICESCLK_sys_ck,
SERVICESCLK_NOT_DEFINED
} ;
/*
* ======== CLK_Exit ========
* Purpose:
* Discontinue usage of module; free resources when reference count
* reaches 0.
* Parameters:
* Returns:
* Requires:
* CLK initialized.
* Ensures:
* Resources used by module are freed when cRef reaches zero.
*/
extern void CLK_Exit(void);
/*
* ======== CLK_Init ========
* Purpose:
* Initializes private state of CLK module.
* Parameters:
* Returns:
* TRUE if initialized; FALSE if error occured.
* Requires:
* Ensures:
* CLK initialized.
*/
extern bool CLK_Init(void);
/*
* ======== CLK_Enable ========
* Purpose:
* Enables the clock requested.
* Parameters:
* Returns:
* DSP_SOK: Success.
* DSP_EFAIL: Error occured while enabling the clock.
* Requires:
* Ensures:
*/
extern DSP_STATUS CLK_Enable(IN enum SERVICES_ClkId clk_id);
/*
* ======== CLK_Disable ========
* Purpose:
* Disables the clock requested.
* Parameters:
* Returns:
* DSP_SOK: Success.
* DSP_EFAIL: Error occured while disabling the clock.
* Requires:
* Ensures:
*/
extern DSP_STATUS CLK_Disable(IN enum SERVICES_ClkId clk_id);
/*
* ======== CLK_GetRate ========
* Purpose:
* Get the clock rate of requested clock.
* Parameters:
* Returns:
* DSP_SOK: Success.
* DSP_EFAIL: Error occured while Getting the clock rate.
* Requires:
* Ensures:
*/
extern DSP_STATUS CLK_GetRate(IN enum SERVICES_ClkId clk_id,
u32 *speedMhz);
/*
* ======== CLK_Set_32KHz ========
* Purpose:
* Set the requested clock to 32KHz.
* Parameters:
* Returns:
* DSP_SOK: Success.
* DSP_EFAIL: Error occured while setting the clock parent to 32KHz.
* Requires:
* Ensures:
*/
extern DSP_STATUS CLK_Set_32KHz(IN enum SERVICES_ClkId clk_id);
extern void SSI_Clk_Prepare(bool FLAG);
/*
* ======== CLK_Get_RefCnt ========
* Purpose:
* get the reference count for the clock.
* Parameters:
* Returns:
* s32: Reference Count for the clock.
* DSP_EFAIL: Error occured while getting the reference count of a clock.
* Requires:
* Ensures:
*/
extern s32 CLK_Get_UseCnt(IN enum SERVICES_ClkId clk_id);
#endif /* _SYNC_H */
This diff is collapsed.
/*
* cmmdefs.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2008 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== cmmdefs.h ========
* Purpose:
* Global MEM constants and types.
*
*! Revision History:
*! ================
*! 12-Nov-2001 ag CMM_KERNMAPTYPE added for dsp<->device process addr map'n.
*! This allows addr conversion from drvr process <-> DSP addr.
*! 29-Aug-2001 ag Added CMM_ALLSEGMENTS.
*! 08-Dec-2000 ag Added bus address conversion type CMM_POMAPEMIF2DSPBUS.
*! 05-Dec-2000 ag Added default CMM_DEFLTCONVFACTOR & CMM_DEFLTDSPADDROFFSET.
*! 29-Oct-2000 ag Added converstion factor for GPP DSP Pa translation.
*! 15-Oct-2000 ag Added address translator attributes and defaults.
*! 12-Jul-2000 ag Created.
*/
#ifndef CMMDEFS_
#define CMMDEFS_
#include <dspbridge/list.h>
/* Cmm attributes used in CMM_Create() */
struct CMM_MGRATTRS {
/* Minimum SM allocation; default 32 bytes. */
u32 ulMinBlockSize;
} ;
/* Attributes for CMM_AllocBuf() & CMM_AllocDesc() */
struct CMM_ATTRS {
u32 ulSegId; /* 1,2... are SM segments. 0 is not. */
u32 ulAlignment; /* 0,1,2,4....ulMinBlockSize */
} ;
/*
* DSPPa to GPPPa Conversion Factor.
*
* For typical platforms:
* converted Address = PaDSP + ( cFactor * addressToConvert).
*/
enum CMM_CNVTTYPE {
CMM_SUBFROMDSPPA = -1,
/* PreOMAP is special case: not simple offset */
CMM_POMAPEMIF2DSPBUS = 0,
CMM_ADDTODSPPA = 1
} ;
#define CMM_DEFLTDSPADDROFFSET 0
#define CMM_DEFLTCONVFACTOR CMM_POMAPEMIF2DSPBUS /* PreOMAP DSPBUS<->EMIF */
#define CMM_ALLSEGMENTS 0xFFFFFF /* All SegIds */
#define CMM_MAXGPPSEGS 1 /* Maximum # of SM segs */
/*
* SMSEGs are SM segments the DSP allocates from.
*
* This info is used by the GPP to xlate DSP allocated PAs.
*/
struct CMM_SEGINFO {
u32 dwSegBasePa; /* Start Phys address of SM segment */
/* Total size in bytes of segment: DSP+GPP */
u32 ulTotalSegSize;
u32 dwGPPBasePA; /* Start Phys addr of Gpp SM seg */
u32 ulGPPSize; /* Size of Gpp SM seg in bytes */
u32 dwDSPBaseVA; /* DSP virt base byte address */
u32 ulDSPSize; /* DSP seg size in bytes */
/* # of current GPP allocations from this segment */
u32 ulInUseCnt;
u32 dwSegBaseVa; /* Start Virt address of SM seg */
} ;
/* CMM useful information */
struct CMM_INFO {
/* # of SM segments registered with this Cmm. */
u32 ulNumGPPSMSegs;
/* Total # of allocations outstanding for CMM */
u32 ulTotalInUseCnt;
/* Min SM block size allocation from CMM_Create() */
u32 ulMinBlockSize;
/* Info per registered SM segment. */
struct CMM_SEGINFO segInfo[CMM_MAXGPPSEGS];
} ;
/* XlatorCreate attributes */
struct CMM_XLATORATTRS {
u32 ulSegId; /* segment Id used for SM allocations */
u32 dwDSPBufs; /* # of DSP-side bufs */
u32 dwDSPBufSize; /* size of DSP-side bufs in GPP bytes */
/* Vm base address alloc'd in client process context */
void *pVmBase;
/* dwVmSize must be >= (dwMaxNumBufs * dwMaxSize) */
u32 dwVmSize;
} ;
/*
* Cmm translation types. Use to map SM addresses to process context.
*/
enum CMM_XLATETYPE {
CMM_VA2PA = 0, /* Virtual to GPP physical address xlation */
CMM_PA2VA = 1, /* GPP Physical to virtual */
CMM_VA2DSPPA = 2, /* Va to DSP Pa */
CMM_PA2DSPPA = 3, /* GPP Pa to DSP Pa */
CMM_DSPPA2PA = 4, /* DSP Pa to GPP Pa */
} ;
/*
* Used to "map" between device process virt addr and dsp addr.
*/
enum CMM_KERNMAPTYPE {
CMM_KERNVA2DSP = 0, /* Device process context to dsp address. */
CMM_DSP2KERNVA = 1, /* Dsp address to device process context. */
} ;
struct CMM_OBJECT;
struct CMM_XLATOROBJECT;
#endif /* CMMDEFS_ */
This diff is collapsed.
/*
* csl.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2008 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== csl.h ========
* Purpose:
* Platform independent C Standard library functions.
*
* Public Functions:
* CSL_AnsiToWchar
* CSL_ByteSwap
* CSL_Exit
* CSL_Init
* CSL_NumToAscii
* CSL_Strtok
* CSL_Strtokr
* CSL_WcharToAnsi
*
*! Revision History:
*! ================
*! 07-Aug-2002 jeh: Added CSL_Strtokr().
*! 21-Sep-2001 jeh: Added CSL_Strncmp.
*! 22-Nov-2000 map: Added CSL_Atoi and CSL_Strtok
*! 19-Nov-2000 kc: Added CSL_ByteSwap().
*! 09-Nov-2000 kc: Added CSL_Strncat.
*! 29-Oct-1999 kc: Added CSL_Wstrlen().
*! 20-Sep-1999 ag: Added CSL_Wchar2Ansi().
*! 19-Jan-1998 cr: Code review cleanup (mostly documentation fixes).
*! 29-Dec-1997 cr: Changed CSL_lowercase to CSL_Uppercase, added
*! CSL_AnsiToWchar.
*! 30-Sep-1997 cr: Added explicit cdecl descriptors to fxn definitions.
*! 25-Jun-1997 cr: Added CSL_strcmp.
*! 12-Jun-1996 gp: Created.
*/
#ifndef CSL_
#define CSL_
#include <dspbridge/host_os.h>
/*
* ======== CSL_Exit ========
* Purpose:
* Discontinue usage of the CSL module.
* Parameters:
* Returns:
* Requires:
* CSL initialized.
* Ensures:
* Resources acquired in CSL_Init(void) are freed.
*/
extern void CSL_Exit(void);
/*
* ======== CSL_Init ========
* Purpose:
* Initialize the CSL module's private state.
* Parameters:
* Returns:
* TRUE if initialized; FALSE if error occured.
* Requires:
* Ensures:
* A requirement for each of the other public CSL functions.
*/
extern bool CSL_Init(void);
/*
* ======== CSL_NumToAscii ========
* Purpose:
* Convert a 1 or 2 digit number to a 2 digit string.
* Parameters:
* pstrNumber: Buffer to store converted string.
* dwNum: Number to convert.
* Returns:
* Requires:
* pstrNumber must be able to hold at least three characters.
* Ensures:
* pstrNumber will be null terminated.
*/
extern void CSL_NumToAscii(OUT char *pstrNumber, IN u32 dwNum);
/*
* ======== CSL_Strtok ========
* Purpose:
* Tokenize a NULL terminated string
* Parameters:
* ptstrSrc: pointer to string.
* szSeparators: pointer to a string of seperators
* Returns:
* char *
* Requires:
* CSL initialized.
* ptstrSrc is a valid string pointer.
* szSeparators is a valid string pointer.
* Ensures:
*/
extern char *CSL_Strtok(IN char *ptstrSrc,
IN CONST char *szSeparators);
/*
* ======== CSL_Strtokr ========
* Purpose:
* Re-entrant version of strtok.
* Parameters:
* pstrSrc: Pointer to string. May be NULL on subsequent calls.
* szSeparators: Pointer to a string of seperators
* ppstrCur: Location to store start of string for next call to
* to CSL_Strtokr.
* Returns:
* char * (the token)
* Requires:
* CSL initialized.
* szSeparators != NULL
* ppstrCur != NULL
* Ensures:
*/
extern char *CSL_Strtokr(IN char *pstrSrc,
IN CONST char *szSeparators,
OUT char **ppstrCur);
#endif /* CSL_ */
/*
* dbc.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2008 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== dbc.h ========
* Purpose:
* "Design by Contract" programming macros.
*
* Public Functions:
* DBC_Assert
* DBC_Require
* DBC_Ensure
*
* Notes:
* Requires that the GT->ERROR function has been defaulted to a valid
* error handler for the given execution environment.
*
* Does not require that GT_init() be called.
*
*! Revision History:
*! ================
*! 11-Aug-2000 ag: Removed include <dspbridge/std.h>
*! 22-Apr-1996 gp: Created.
*/
#ifndef DBC_
#define DBC_
#ifndef GT_TRACE
#define GT_TRACE 0 /* 0 = "trace compiled out"; 1 = "trace active" */
#endif
/* Assertion Macros: */
#if GT_TRACE
#include <dspbridge/gt.h>
#define DBC_Assert(exp) \
if (!(exp)) \
printk("%s, line %d: Assertion (" #exp ") failed.\n", \
__FILE__, __LINE__)
#define DBC_Require DBC_Assert /* Function Precondition. */
#define DBC_Ensure DBC_Assert /* Function Postcondition. */
#else
#define DBC_Assert(exp)
#define DBC_Require(exp)
#define DBC_Ensure(exp)
#endif /* DEBUG */
#endif /* DBC_ */
This diff is collapsed.
/*
* dbdcddef.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2008 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== dbdcddef.h ========
* Description:
* DCD (DSP/BIOS Bridge Configuration Database) constants and types.
*
*! Revision History:
*! ================
*! 03-Dec-2003 map Moved and renamed DCD_OBJTYPE to DSP_DCDOBJTYPE in dbdefs.h
*! 05-Dec-2002 map Added DCD_CREATELIBTYPE, DCD_EXECUTELIBTYPE,
* DCD_DELETELIBTYPE
*! 24-Feb-2003 kc Updated REG entry names to DspBridge.
*! 22-Nov-2002 gp Cleaned up comments, formatting.
*! 05-Aug-2002 jeh Added DCD_REGISTERFXN.
*! 19-Apr-2002 jeh Added DCD_LIBRARYTYPE to DCD_OBJTYPE, dynamic load
*! properties to DCD_NODEPROPS.
*! 29-Jul-2001 ag Added extended procObj.
*! 13-Feb-2001 kc: Named changed from dcdbsdef.h dbdcddef.h.
*! 12-Dec-2000 jeh Added DAIS iAlg name to DCD_NODEPROPS.
*! 30-Oct-2000 kc: Added #defines for DCD_AutoRegister function.
*! 05-Sep-2000 jeh Added DCD_NODEPROPS.
*! 12-Aug-2000 kc: Incoroporated the use of types defined in <dspdefs.h>.
*! 29-Jul-2000 kc: Created.
*/
#ifndef DBDCDDEF_
#define DBDCDDEF_
#include <dspbridge/dbdefs.h>
#include <dspbridge/mgrpriv.h> /* for MGR_PROCESSOREXTINFO */
/*
* The following defines are critical elements for the DCD module:
*
* - DCD_REGKEY enables DCD functions to locate registered DCD objects.
* - DCD_REGISTER_SECTION identifies the COFF section where the UUID of
* registered DCD objects are stored.
*/
#define DCD_REGKEY "Software\\TexasInstruments\\DspBridge\\DCD"
#define DCD_REGISTER_SECTION ".dcd_register"
/* DCD Manager Object */
struct DCD_MANAGER;
/* DCD Node Properties */
struct DCD_NODEPROPS {
struct DSP_NDBPROPS ndbProps;
u32 uMsgSegid;
u32 uMsgNotifyType;
char *pstrCreatePhaseFxn;
char *pstrDeletePhaseFxn;
char *pstrExecutePhaseFxn;
char *pstrIAlgName;
/* Dynamic load properties */
u16 usLoadType; /* Static, dynamic, overlay */
u32 ulDataMemSegMask; /* Data memory requirements */
u32 ulCodeMemSegMask; /* Code memory requirements */
} ;
/* DCD Generic Object Type */
struct DCD_GENERICOBJ {
union dcdObjUnion {
struct DCD_NODEPROPS nodeObj; /* node object. */
/* processor object. */
struct DSP_PROCESSORINFO procObj;
/* extended proc object (private) */
struct MGR_PROCESSOREXTINFO extProcObj;
} objData;
} ;
/* DCD Internal Callback Type */
typedef DSP_STATUS(*DCD_REGISTERFXN) (IN struct DSP_UUID *pUuid,
IN enum DSP_DCDOBJTYPE objType,
IN void *handle);
#endif /* DBDCDDEF_ */
This diff is collapsed.
/*
* dbg.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2008 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== dbg.h ========
* Purpose:
* Provide debugging services for 'Bridge Mini Drivers.
*
* Public Functions:
* DBG_Exit
* DBG_Init
* DBG_Printf
* DBG_Trace
*
* Notes:
* WMD's must not call DBG_Init or DBG_Exit.
*
*! Revision History:
*! ================
*! 03-Feb-2000 rr: DBG Levels redefined.
*! 29-Oct-1999 kc: Cleaned up for code review.
*! 10-Oct-1997 cr: Added DBG_Printf service.
*! 29-May-1996 gp: Removed WCD_ prefix.
*! 15-May-1996 gp: Created.
*/
#ifndef DBG_
#define DBG_
#include <dspbridge/host_os.h>
#include <linux/types.h>
/* Levels of trace debug messages: */
#define DBG_ENTER (u8)(0x01) /* Function entry point. */
#define DBG_LEVEL1 (u8)(0x02) /* Display debugging state/varibles */
#define DBG_LEVEL2 (u8)(0x04) /* Display debugging state/varibles */
#define DBG_LEVEL3 (u8)(0x08) /* Display debugging state/varibles */
#define DBG_LEVEL4 (u8)(0x10) /* Display debugging state/varibles */
#define DBG_LEVEL5 (u8)(0x20) /* Module Init, Exit */
#define DBG_LEVEL6 (u8)(0x40) /* Warn SERVICES Failures */
#define DBG_LEVEL7 (u8)(0x80) /* Warn Critical Errors */
#if (defined(DEBUG) || defined(DDSP_DEBUG_PRODUCT)) && GT_TRACE
/*
* ======== DBG_Exit ========
* Purpose:
* Discontinue usage of module; free resources when reference count
* reaches 0.
* Parameters:
* Returns:
* Requires:
* DBG initialized.
* Ensures:
* Resources used by module are freed when cRef reaches zero.
*/
extern void DBG_Exit(void);
/*
* ======== DBG_Init ========
* Purpose:
* Initializes private state of DBG module.
* Parameters:
* Returns:
* TRUE if initialized; FALSE if error occured.
* Requires:
* Ensures:
*/
extern bool DBG_Init(void);
/*
* ======== DBG_Trace ========
* Purpose:
* Output a trace message to the debugger, if the given trace level
* is unmasked.
* Parameters:
* bLevel: Trace level.
* pstrFormat: sprintf-style format string.
* ...: Arguments for format string.
* Returns:
* DSP_SOK: Success, or trace level masked.
* DSP_EFAIL: On Error.
* Requires:
* DBG initialized.
* Ensures:
* Debug message is printed to debugger output window, if trace level
* is unmasked.
*/
extern DSP_STATUS DBG_Trace(IN u8 bLevel, IN char *pstrFormat, ...);
#else
#define DBG_Exit(void)
#define DBG_Init(void) true
#define DBG_Trace(bLevel, pstrFormat, args...)
#endif /* (defined(DEBUG) || defined(DDSP_DEBUG_PRODUCT)) && GT_TRACE */
#endif /* DBG_ */
This diff is collapsed.
/*
* dbldefs.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== dbldefs.h ========
*
*! Revision History
*! ================
*! 19-Mar-2002 jeh Added DBL_Fxns type (to make it easier to switch
*! between different loaders).
*! 28-Sep-2001 jeh Created from zl.h.
*/
#ifndef DBLDEFS_
#define DBLDEFS_
/*
* Bit masks for DBL_Flags.
*/
#define DBL_NOLOAD 0x0 /* Don't load symbols, code, or data */
#define DBL_SYMB 0x1 /* load symbols */
#define DBL_CODE 0x2 /* load code */
#define DBL_DATA 0x4 /* load data */
#define DBL_DYNAMIC 0x8 /* dynamic load */
#define DBL_BSS 0x20 /* Unitialized section */
#define DBL_MAXPATHLENGTH 255
/*
* ======== DBL_Flags ========
* Specifies whether to load code, data, or symbols
*/
typedef s32 DBL_Flags;
/*
* ======== DBL_SectInfo ========
* For collecting info on overlay sections
*/
struct DBL_SectInfo {
const char *name; /* name of section */
u32 runAddr; /* run address of section */
u32 loadAddr; /* load address of section */
u32 size; /* size of section (target MAUs) */
DBL_Flags type; /* Code, data, or BSS */
} ;
/*
* ======== DBL_Symbol ========
* (Needed for dynamic load library)
*/
struct DBL_Symbol {
u32 value;
};
/*
* ======== DBL_AllocFxn ========
* Allocate memory function. Allocate or reserve (if reserved == TRUE)
* "size" bytes of memory from segment "space" and return the address in
* *dspAddr (or starting at *dspAddr if reserve == TRUE). Returns 0 on
* success, or an error code on failure.
*/
typedef s32(*DBL_AllocFxn) (void *hdl, s32 space, u32 size, u32 align,
u32 *dspAddr, s32 segId, s32 req, bool reserved);
/*
* ======== DBL_FreeFxn ========
* Free memory function. Free, or unreserve (if reserved == TRUE) "size"
* bytes of memory from segment "space"
*/
typedef bool(*DBL_FreeFxn) (void *hdl, u32 addr, s32 space, u32 size,
bool reserved);
/*
* ======== DBL_LogWriteFxn ========
* Function to call when writing data from a section, to log the info.
* Can be NULL if no logging is required.
*/
typedef DSP_STATUS(*DBL_LogWriteFxn) (void *handle, struct DBL_SectInfo *sect,
u32 addr, u32 nBytes);
/*
* ======== DBL_SymLookup ========
* Symbol lookup function - Find the symbol name and return its value.
*
* Parameters:
* handle - Opaque handle
* pArg - Opaque argument.
* name - Name of symbol to lookup.
* sym - Location to store address of symbol structure.
*
* Returns:
* TRUE: Success (symbol was found).
* FALSE: Failed to find symbol.
*/
typedef bool(*DBL_SymLookup) (void *handle, void *pArg, void *rmmHandle,
const char *name, struct DBL_Symbol **sym);
/*
* ======== DBL_WriteFxn ========
* Write memory function. Write "n" HOST bytes of memory to segment "mtype"
* starting at address "dspAddr" from the buffer "buf". The buffer is
* formatted as an array of words appropriate for the DSP.
*/
typedef s32(*DBL_WriteFxn) (void *hdl, u32 dspAddr, void *buf,
u32 n, s32 mtype);
/*
* ======== DBL_Attrs ========
*/
struct DBL_Attrs {
DBL_AllocFxn alloc;
DBL_FreeFxn free;
void *rmmHandle; /* Handle to pass to alloc, free functions */
DBL_WriteFxn write;
void *wHandle; /* Handle to pass to write, cinit function */
DBL_LogWriteFxn logWrite;
void *logWriteHandle;
/* Symbol matching function and handle to pass to it */
DBL_SymLookup symLookup;
void *symHandle;
void *symArg;
/*
* These file manipulation functions should be compatible with the
* "C" run time library functions of the same name.
*/
s32(*fread) (void *, size_t, size_t, void *);
s32(*fseek) (void *, long, int);
s32(*ftell) (void *);
s32(*fclose) (void *);
void *(*fopen) (const char *, const char *);
} ;
#endif /* DBLDEFS_ */
/*
* dbll.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== dbll.h ========
* DSP/BIOS Bridge Dynamic load library module interface. Function header
* comments are in the file dblldefs.h.
*
*! Revision History
*! ================
*! 31-Jul-2002 jeh Removed function comments (now in dblldefs.h).
*! 17-Apr-2002 jeh Created based on zl.h.
*/
#ifndef DBLL_
#define DBLL_
#include <dspbridge/dbdefs.h>
#include <dspbridge/dblldefs.h>
extern void DBLL_close(struct DBLL_LibraryObj *lib);
extern DSP_STATUS DBLL_create(struct DBLL_TarObj **pTarget,
struct DBLL_Attrs *pAttrs);
extern void DBLL_delete(struct DBLL_TarObj *target);
extern void DBLL_exit(void);
extern bool DBLL_getAddr(struct DBLL_LibraryObj *lib, char *name,
struct DBLL_Symbol **ppSym);
extern void DBLL_getAttrs(struct DBLL_TarObj *target,
struct DBLL_Attrs *pAttrs);
extern bool DBLL_getCAddr(struct DBLL_LibraryObj *lib, char *name,
struct DBLL_Symbol **ppSym);
extern DSP_STATUS DBLL_getSect(struct DBLL_LibraryObj *lib, char *name,
u32 *pAddr, u32 *pSize);
extern bool DBLL_init(void);
extern DSP_STATUS DBLL_load(struct DBLL_LibraryObj *lib,
DBLL_Flags flags,
struct DBLL_Attrs *attrs, u32 *pEntry);
extern DSP_STATUS DBLL_loadSect(struct DBLL_LibraryObj *lib,
char *sectName,
struct DBLL_Attrs *attrs);
extern DSP_STATUS DBLL_open(struct DBLL_TarObj *target, char *file,
DBLL_Flags flags,
struct DBLL_LibraryObj **pLib);
extern DSP_STATUS DBLL_readSect(struct DBLL_LibraryObj *lib,
char *name,
char *pBuf, u32 size);
extern void DBLL_setAttrs(struct DBLL_TarObj *target,
struct DBLL_Attrs *pAttrs);
extern void DBLL_unload(struct DBLL_LibraryObj *lib,
struct DBLL_Attrs *attrs);
extern DSP_STATUS DBLL_unloadSect(struct DBLL_LibraryObj *lib,
char *sectName,
struct DBLL_Attrs *attrs);
#endif /* DBLL_ */
This diff is collapsed.
/*
* dbof.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== dbof.h ========
* Description:
* Defines and typedefs for DSP/BIOS Bridge Object File Format (DBOF).
*
*! Revision History
*! ================
*! 12-Jul-2002 jeh Added defines for DBOF_SectHdr page.
*! 12-Oct-2001 jeh Converted to std.h format.
*! 07-Sep-2001 jeh Added overlay support.
*! 06-Jul-2001 jeh Created.
*/
#ifndef DBOF_
#define DBOF_
/* Enough to hold DCD section names: 32 digit ID + underscores */
#define DBOF_DCDSECTNAMELEN 40
/* Values for DBOF_SectHdr page field. */
#define DBOF_PROGRAM 0
#define DBOF_DATA 1
#define DBOF_CINIT 2
/*
* ======== DBOF_FileHdr ========
*/
struct DBOF_FileHdr {
u32 magic; /* COFF magic number */
u32 entry; /* Program entry point */
u16 numSymbols; /* Number of bridge symbols */
u16 numDCDSects; /* Number of DCD sections */
u16 numSects; /* Number of sections to load */
u16 numOvlySects; /* Number of overlay sections */
u32 symOffset; /* Offset in file to symbols */
u32 dcdSectOffset; /* Offset to DCD sections */
u32 loadSectOffset; /* Offset to loadable sections */
u32 ovlySectOffset; /* Offset to overlay data */
u16 version; /* DBOF version number */
u16 resvd; /* Reserved for future use */
} ;
/*
* ======== DBOF_DCDSectHdr ========
*/
struct DBOF_DCDSectHdr {
u32 size; /* Sect size (target MAUs) */
char name[DBOF_DCDSECTNAMELEN]; /* DCD section name */
} ;
/*
* ======== DBOF_OvlySectHdr ========
*/
struct DBOF_OvlySectHdr {
u16 nameLen; /* Length of section name */
u16 numCreateSects; /* # of sects loaded for create phase */
u16 numDeleteSects; /* # of sects loaded for delete phase */
u16 numExecuteSects; /* # of sects loaded for execute phase */
/*
* Number of sections where load/unload phase is not specified.
* These sections will be loaded when create phase sects are
* loaded, and unloaded when the delete phase is unloaded.
*/
u16 numOtherSects;
u16 resvd; /* Reserved for future use */
};
/*
* ======== DBOF_OvlySectData ========
*/
struct DBOF_OvlySectData {
u32 loadAddr; /* Section load address */
u32 runAddr; /* Section run address */
u32 size; /* Section size (target MAUs) */
u16 page; /* Memory page number */
u16 resvd; /* Reserved */
} ;
/*
* ======== DBOF_SectHdr ========
*/
struct DBOF_SectHdr {
u32 addr; /* Section address */
u32 size; /* Section size (target MAUs) */
u16 page; /* Page number */
u16 resvd; /* Reserved for future use */
} ;
/*
* ======== DBOF_SymbolHdr ========
*/
struct DBOF_SymbolHdr {
u32 value; /* Symbol value */
u16 nameLen; /* Length of symbol name */
u16 resvd; /* Reserved for future use */
} ;
#endif /* DBOF_ */
/*
* dbreg.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== dbreg.h ========
* Purpose:
* Registry keys for use in Linux. This is the clearinghouse for
* registry definitions, hopefully eliminating overlapping between
* modules.
*
*! Revision History:
*! ================
*! 10-Apr-2003 vp: Added macro for subkey TCWORDSWAP.
*! 21-Mar-2003 sb: Added macro for subkey SHMSize
*! 27-Aug-2001 jeh Added WSXREG_LOADERFILENAME.
*! 13-Feb-2001 kc: DSP/BIOS Bridge name updates.
*! 29-Nov-2000 rr: Added WSXREG_DSPTYPE_55 as 6.
*! 06-Sep-2000 jeh: Added WSXREG_CHNLOFFSET, WSXREG_NUMCHNLS,
*! WSXREG_CHNLBUFSIZE.
*! 26-Aug-2000 rr: MEMBASE expanded to 9 entries.
*! 26-Jul-2000 rr: Added WSXREG_DCDNAME for the DCD Dll name. It will
*! live under WSXREG_WINSPOXCONFIG.
*! 17-Jul-2000 rr: REG_MGR_OBJECT and REG_DRV_OBJECT defined. They
*! are stored in the Registrty under WSXREG_WINSPOXCONFIG
*! when they are created in DSP_Init. WSXREG_DEVOBJECT
*! and WSXREG_MGROBJECT defined.
*! 11-Dec-1999 ag: Renamed Isa to IsaBus due to conflict with ceddk.h.
*! 12-Nov-1999 rr: New Registry Defnitions.
*! 15-Oct-1999 rr: New entry for DevObject created. WSXREG_DEVOBJECT
*! under WSXREG_DDSPDRIVERPATH
*! 10-Nov-1997 cr: Added WSXREG_INFPATH, WSXREG_WINDEVICEPATH,
*! WSXREG_WINCURVERSION
*! 21-Oct-1997 cr: Added WSXREG_BUSTYPE.
*! 08-Sep-1997 cr: Added WSXREG_SERVICES, WSXREG_SERVICENAME and
*! WSXREG_CLASSINDEX.
*! 30-Aug-1997 cr: Added WSXREG_SOFTWAREPATHNT & WSXREG_WBCLASSGUID.
*! 24-Mar-1997 gp: Added MAXCHIPINFOSUBKEY def.
*! 18-Feb-1997 cr: Changed Version1.1 -> Version1.0
*! 12-Feb-1997 cr: Changed WinSPOX -> WinBRIDGE.
*! 11-Dec-1996 gp: Added Perf key name in WinSPOX Config.
*! 22-Jul-1996 gp: Added Trace key name.
*! 30-May-1996 cr: Created.
*/
#ifndef DBREG_
#define DBREG_ 1 /* Defined as "1" so InstallShield programs compile. */
#define REG_MGR_OBJECT 1
#define REG_DRV_OBJECT 2
/* general registry definitions */
#define MAXREGPATHLENGTH 255 /* Max registry path length. Also the
max registry value length. */
#define DSPTYPE_55 6 /* This is the DSP Chip type for 55 */
#define DSPTYPE_64 0x99
#define IVA_ARM7 0x97 /* This is the DSP Chip type for IVA/ARM7 */
#define DSPPROCTYPE_C55 5510
#define DSPPROCTYPE_C64 6410
#define IVAPROCTYPE_ARM7 470
/* registry */
#define DEVNODESTRING "DevNode" /* u32 devnode */
#define CONFIG "Software\\TexasInstruments\\DirectDSP\\Config"
#define DRVOBJECT "DrvObject"
#define MGROBJECT "MgrObject"
#define CLASS "Device" /* device class */
#define TRACE "Trace" /* GT Trace settings. */
#define PERFR "Perf" /* Enable perf bool. */
#define ROOT "Root" /* root dir */
/* MiniDriver related definitions */
/* The following definitions are under "Drivers\\DirectDSP\\Device\\XXX "
* Where XXX is the device or board name */
#define WMDFILENAME "MiniDriver" /* WMD entry name */
#define CHIPTYPE "ChipType" /* Chip type */
#define CHIPNUM "NumChips" /* Number of chips */
#define NUMPROCS "NumOfProcessors" /* Number of processors */
#define DEFEXEC "DefaultExecutable" /* Default executable */
#define AUTOSTART "AutoStart" /* Statically load flag */
#define IVAAUTOSTART "IvaAutoStart" /* Statically load flag */
#define BOARDNAME "BoardName" /* Name of the Board */
#define UNITNUMBER "UnitNumber" /* Unit # of the Board */
#define BUSTYPE "BusType" /* Bus type board is on */
#define BUSNUMBER "BusNumber" /* Bus number board is on */
#define CURRENTCONFIG "CurrentConfig" /* Current resources */
#define PCIVENDEVID "VendorDeviceId" /* The board's id */
#define INFPATH "InfPath" /* wmd's inf filename */
#define DEVOBJECT "DevObject"
#define ZLFILENAME "ZLFileName" /* Name of ZL file */
#define WORDSIZE "WordSize" /* NumBytes in DSP Word */
#define SHMSIZE "SHMSize" /* Size of SHM reservd on MPU */
#define IVAEXTMEMSIZE "IVAEXTMEMSize" /* IVA External Memeory size */
#define TCWORDSWAP "TCWordSwap" /* Traffic Contoller Word Swap */
#define DSPRESOURCES "DspTMSResources" /* C55 DSP resurces on OMAP */
#define IVA1RESOURCES "ARM7IvaResources" /* ARM7 IVA resurces on OMAP */
#define PHYSMEMPOOLBASE "PhysicalMemBase" /* Physical mem passed to driver */
#define PHYSMEMPOOLSIZE "PhysicalMemSize" /* Physical mem passed to driver */
#endif /* DBREG_ */
/*
* dbtype.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Copyright (C) 2008 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
* ======== dbtype.h ========
* Description:
* This header defines data types for DSP/BIOS Bridge APIs and device
* driver modules. It also defines the Hungarian
* prefix to use for each base type.
*
*
*! Revision History:
*! =================
*! 23-Nov-2002 gp: Purpose -> Description in file header.
*! 13-Feb-2001 kc: Name changed from ddsptype.h dbtype.h.
*! 09-Oct-2000 jeh Added CHARACTER.
*! 11-Aug-2000 ag: Added 'typedef void void'.
*! 08-Apr-2000 ww: Cloned.
*/
#ifndef DBTYPE_
#define DBTYPE_
/*============================================================================*/
/* Argument specification syntax */
/*============================================================================*/
#ifndef IN
#define IN /* Following parameter is for input. */
#endif
#ifndef OUT
#define OUT /* Following parameter is for output. */
#endif
#ifndef OPTIONAL
#define OPTIONAL /* Function may optionally use previous parameter. */
#endif
#ifndef CONST
#define CONST const
#endif
/*============================================================================*/
/* Boolean constants */
/*============================================================================*/
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
/*============================================================================*/
/* NULL (Definition is language specific) */
/*============================================================================*/
#ifndef NULL
#define NULL ((void *)0) /* Null pointer. */
#endif
/*============================================================================*/
/* NULL character (normally used for string termination) */
/*============================================================================*/
#ifndef NULL_CHAR
#define NULL_CHAR '\0' /* Null character. */
#endif
/*============================================================================*/
/* Basic Type definitions (with Prefixes for Hungarian notation) */
/*============================================================================*/
#ifndef OMAPBRIDGE_TYPES
#define OMAPBRIDGE_TYPES
typedef volatile unsigned short REG_UWORD16;
#endif
typedef void *HANDLE; /* h */
#define TEXT(x) x
#define DLLIMPORT
#define DLLEXPORT
/* Define DSPAPIDLL correctly in dspapi.h */
#define _DSPSYSDLL32_
#endif /* DBTYPE_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment