📄 dsp.h
字号:
/* * linux/arch/arm/mach-omap/dsp/dsp.h * * Header for OMAP DSP driver * * Copyright (C) 2002-2004 Nokia Corporation * * Written by Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: dsp.h * $Revision: 3.0.1 * $Date: 2004/10/04 * */#include "hardware_dsp.h"#include "dsp_common.h"# define DSP_INIT_PAGE 0xfff000/* idle program will be placed at IDLEPG_BASE. */# define IDLEPG_BASE 0xfffe00# define IDLEPG_SIZE 0x100/* * INT_D2A_MB value definition * INT_DSP_MAILBOX1: use Mailbox 1 (INT 10) for DSP->ARM mailbox * INT_DSP_MAILBOX2: use Mailbox 2 (INT 11) for DSP->ARM mailbox */#define INT_D2A_MB1 INT_DSP_MAILBOX1/* * MBSEQ_CHECKLEVEL value definition * 0: no check * 1: notify SEQ error * 2: SEQ error is not reported */#define MBSEQ_CHECKLEVEL 1#define CFGSTAT_ERR 0#define CFGSTAT_GOING 1#define CFGSTAT_DONE 2#define CFGSTAT_ABORT 3/* keep 2 entries for OMAP_DSP_TID_FREE and OMAP_DSP_TID_ANON */#define TASKDEV_MAX 254struct sync_seq { unsigned short da_dsp; unsigned short da_arm; unsigned short ad_dsp; unsigned short ad_arm;};#define MKLONG(uw,lw) (((unsigned long)(uw)) << 16 | (lw))#define MBCMD(nm) OMAP_DSP_MBCMD_##nm#define mb_sqbit(cmd) ((cmd) >> 15)#define mb_cmd_h(cmd) (((cmd) & 0x7f00) >> 8)#define mb_cmd_l(cmd) ((cmd) & 0x00ff)#define MBSENDTYPE_NOWAIT 0 /* never wait */#define MBSENDTYPE_NORMAL 1 /* waits */#define MBSENDTYPE_RECOVERY 2 /* used for mmu err recovery comand */extern void omap_dsp_cur_users_add(struct task_struct *tsk);extern void omap_dsp_cur_users_del(struct task_struct *tsk);extern void omap_dsp_cur_users_flush(void);extern void omap_dsp_cur_users_map_update(void);extern void omap_dsp_mb_config(void);extern void omap_dsp_mb_unconfig(void);extern int sync_with_dsp(unsigned short *syncwd, unsigned short tid, int try_cnt);#define omap_dsp_mbsend(cmd_h, cmd_l, data) \ __omap_dsp_mbsend(cmd_h, cmd_l, data, 0, 0, NULL, MBSENDTYPE_NORMAL)#define omap_dsp_mbsend_recovery(cmd_h, cmd_l, data) \ __omap_dsp_mbsend(cmd_h, cmd_l, data, 0, 0, NULL, MBSENDTYPE_RECOVERY)#define omap_dsp_mbsend_exarg(cmd_h, cmd_l, data, tid, argc, argv) \ __omap_dsp_mbsend(cmd_h, cmd_l, data, tid, argc, argv, MBSENDTYPE_NORMAL)extern int __omap_dsp_mbsend(unsigned char cmd_h, unsigned char cmd_l, unsigned short data, unsigned char tid, int argc, unsigned short *argv, int sendtype);#define omap_dsp_mbsend_and_wait(cmd_h, cmd_l, data, q) \ omap_dsp_mbsend_and_wait_exarg(cmd_h, cmd_l, data, 0, 0, NULL, q)extern int omap_dsp_mbsend_and_wait_exarg(unsigned char cmd_h, unsigned char cmd_l, unsigned short data, unsigned char tid, int argc, unsigned short *argv, wait_queue_head_t *q);extern int omap_dsp_ipbuf_config(unsigned short ln, unsigned short lsz, unsigned long adr, unsigned short dspkp);extern void omap_dsp_ipbuf_unconfig(void);extern void omap_dsp_ipbuf_pcfg(void);extern int is_ipbuf_internal_mem(void);extern unsigned short get_free_ipbuf(unsigned char tid);extern void unuse_ipbuf(unsigned short bid, int sendtype);extern void release_ipbuf(unsigned short bid);extern void balance_ipbuf(int sendtype);extern int omap_dsp_is_config_done(void);extern int omap_dsp_dspuncfg(void);extern void omap_dsp_runlevel(unsigned char level);extern int omap_dsp_task_config_all(unsigned char n);extern void omap_dsp_task_unconfig_all(void);extern unsigned char dsp_task_count(void);extern int omap_dsp_taskmod_busy(void);extern int omap_dsp_mkdev(char *name);extern int omap_dsp_rmdev(char *name);extern int omap_dsp_tadd(unsigned char minor, unsigned long adr);extern int omap_dsp_tdel(unsigned int minor);extern int omap_dsp_taskdev_openstat(unsigned char minor);#define release_ipbuf_pvt(ipbuf_pvt) \ do { \ (ipbuf_pvt)->s = OMAP_DSP_TID_FREE; \ } while(0)#ifdef CONFIG_PROC_FSextern int omap_dsp_ipbuf_held(unsigned char tid, unsigned short bid);#endif /* CONFIG_PROC_FS */extern void omap_dsp_mmu_shutdown(void);extern int omap_dsp_enable_dspmem(void);extern int omap_dsp_disable_dspmem(void);extern void omap_dsp_map_update(struct task_struct *tsk);extern unsigned long omap_dsp_virt_to_phys(void *vadr, size_t *len);extern void omap_dsp_twch_config(unsigned char n);extern void omap_dsp_twch_unconfig(void);extern void omap_dsp_twch_touch(void);extern void omap_dsp_err_config(void);extern void omap_dsp_err_unconfig(void);extern void omap_dsp_err_mmu_set(unsigned long adr);extern void omap_dsp_err_mmu_clear(void);extern int omap_dsp_err_mmu_isset(void);extern void omap_dsp_err_wdt_clear(void);extern int omap_dsp_err_wdt_isset(void);extern char *cmd_name(unsigned char cmd_h);extern char *subcmd_name(unsigned char cmd_h, unsigned char cmd_l);#define CONFIG_OMAP_DSP_MBLOG#ifdef CONFIG_OMAP_DSP_MBLOG#define MBLOG_DIR_AD 1#define MBLOG_DIR_DA 2extern void omap_dsp_mblog_add(unsigned short cmd, unsigned short data, char dir);#else /* CONFIG_OMAP_DSP_MBLOG */#define omap_dsp_mblog_add(cmd, data, dir) do {} while(0)#endif /* CONFIG_OMAP_DSP_MBLOG */#ifdef CONFIG_OMAP_DSP_MBCMD_VERBOSEextern void omap_dsp_mblog_printcmd(unsigned short cmd, unsigned short data, char dir);#else /* CONFIG_OMAP_DSP_MBCMD_VERBOSE */#define omap_dsp_mblog_printcmd(cmd, data, dir) do {} while(0)#endif /* CONFIG_OMAP_DSP_MBCMD_VERBOSE */extern struct ipbuf **ipbuf;extern struct ipbcfg ipbcfg;extern struct ipbuf_sys *ipbuf_sys_da, *ipbuf_sys_ad;extern struct sync_seq *sync_seq;#ifdef CONFIG_PROC_FSextern struct proc_dir_entry *procdir_dsp;#endif /* CONFIG_PROC_FS */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -