dsp_common.h

来自「omap3 linux 2.6 用nocc去除了冗余代码」· C头文件 代码 · 共 121 行

H
121
字号
/* * This file is part of OMAP DSP driver (DSP Gateway version 3.3.1) * * Copyright (C) 2002-2006 Nokia Corporation. All rights reserved. * * Contact: 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 * version 2 as published by the Free Software Foundation. * * 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., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */#define DRIVER_DSP_COMMON_H#include <linux/clk.h>#include <asm/arch/mmu.h>#include "hardware_dsp.h"#define DSPSPACE_SIZE	0x1000000#define omap_set_bit_regw(b,r) \	do { omap_writew(omap_readw(r) | (b), (r)); } while(0)#define omap_clr_bit_regw(b,r) \	do { omap_writew(omap_readw(r) & ~(b), (r)); } while(0)#define omap_set_bit_regl(b,r) \	do { omap_writel(omap_readl(r) | (b), (r)); } while(0)#define omap_clr_bit_regl(b,r) \	do { omap_writel(omap_readl(r) & ~(b), (r)); } while(0)#define omap_set_bits_regl(val,mask,r) \	do { omap_writel((omap_readl(r) & ~(mask)) | (val), (r)); } while(0)#define dspword_to_virt(dw)	((void *)(dspmem_base + ((dw) << 1)))#define dspbyte_to_virt(db)	((void *)(dspmem_base + (db)))#define virt_to_dspword(va) \	((dsp_long_t)(((unsigned long)(va) - dspmem_base) >> 1))#define virt_to_dspbyte(va) \	((dsp_long_t)((unsigned long)(va) - dspmem_base))#define is_dsp_internal_mem(va) \	(((unsigned long)(va) >= dspmem_base) &&  \	 ((unsigned long)(va) < dspmem_base + dspmem_size))#define is_dspbyte_internal_mem(db)	((db) < dspmem_size)#define is_dspword_internal_mem(dw)	(((dw) << 1) < dspmem_size)typedef u32 dsp_long_t;	/* must have ability to carry TADD_ABORTADR */extern dsp_long_t dspmem_base, dspmem_size,		  daram_base, daram_size,		  saram_base, saram_size;enum cpustat_e {	CPUSTAT_RESET = 0,	CPUSTAT_RUN,	CPUSTAT_MAX};int dsp_set_rstvect(dsp_long_t adr);dsp_long_t dsp_get_rstvect(void);void dsp_set_idle_boot_base(dsp_long_t adr, size_t size);void dsp_reset_idle_boot_base(void);void dsp_cpustat_request(enum cpustat_e req);enum cpustat_e dsp_cpustat_get_stat(void);u16 dsp_cpustat_get_icrmask(void);void dsp_cpustat_set_icrmask(u16 mask);void dsp_register_mem_cb(int (*req_cb)(void), void (*rel_cb)(void));void dsp_unregister_mem_cb(void);struct dsp_kfunc_device {	char		*name;	struct clk	*fck;	struct clk	*ick;;	spinlock_t	 lock;	int		 enabled;	int		 type;#define DSP_KFUNC_DEV_TYPE_COMMON	1#define DSP_KFUNC_DEV_TYPE_AUDIO	2	struct list_head	entry;	int	(*probe)(struct dsp_kfunc_device *, int);	int	(*remove)(struct dsp_kfunc_device *, int);	int	(*enable)(struct dsp_kfunc_device *, int);	int	(*disable)(struct dsp_kfunc_device *, int);};extern int dsp_kfunc_device_register(struct dsp_kfunc_device *);struct dsp_platform_data {	struct list_head kdev_list;};struct omap_dsp {	struct mutex		lock;	int			enabled;	/* stored peripheral status */	struct omap_mmu		*mmu;	struct omap_mbox	*mbox;	struct device		*dev;	struct list_head	*kdev_list;	int			initialized;};extern struct omap_dsp *omap_dsp;extern int dsp_late_init(void);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?