⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dmac.h

📁 Xcale270Bsp包,wince平台
💻 H
字号:
/*++

$Workfile: DMAC.h $

$Date: 4/03/03 8:24p $

Abstract:  
      The PDD (Platform Dependent Driver) is responsible for
      communicating with the audio circuit to start and stop playback
      and/or recording and initialize and deinitialize the circuits.

      This driver is specifically written for the UCB 1400 Audio Codec.

	    
Notes: 

/* 
** INTEL CONFIDENTIAL
** Copyright 2000-2003 Intel Corporation All Rights Reserved.
**
** The source code contained or described herein and all documents
** related to the source code (Material) are owned by Intel Corporation
** or its suppliers or licensors.  Title to the Material remains with
** Intel Corporation or its suppliers and licensors. The Material contains
** trade secrets and proprietary and confidential information of Intel
** or its suppliers and licensors. The Material is protected by worldwide
** copyright and trade secret laws and treaty provisions. No part of the
** Material may be used, copied, reproduced, modified, published, uploaded,
** posted, transmitted, distributed, or disclosed in any way without Intel抯
** prior express written permission.

** No license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise. Any license under such intellectual property rights
** must be express and approved by Intel in writing.
*/


/*
$Log: /Projects/Windows_CE/XSC_Software/BVDMAIN_SP_2003/drivers/Wavedev2/DMAC.h $
//
//1     4/03/03 8:24p Spaden
//
//1     11/14/02 9:51p Spaden
//initial checkin
//
//3     11/12/02 9:16p Spaden
//
//14    11/13/01 5:34p Spaden
//fix bug, change DMA channels to be used in wave driver
//
//13    7/23/01 11:38a Spaden
//
//12    6/29/01 12:25a Spaden
//change audio xmit channel to 1
//
//11    3/14/01 1:02a Spaden
//*fix the  DESC_ADDRESS_STOP_MASK define
//*add DCSR_STARTIRQEN, 
//*rename DCSR_STOPIRQEN to DCSR_ENDIRQEN to match the cotulla manual
//
//10    3/01/01 10:09p Spaden
//add InputSourceTypes
//
//9     3/01/01 6:11p Spaden
//
//8     2/27/01 9:37p Spaden
//updated CMDbuff definition
//
//7     2/27/01 8:22p Spaden
//
//6     2/23/01 9:05p Spaden
//under development--this code is not working yet
//
//5     2/23/01 7:33p Spaden
//change definition os InitAcLink()
//
//4     2/21/01 6:30p Spaden
//more changes around DMA descriptors.
//
//3     2/20/01 11:34p Spaden
//continue development
//
//2     2/20/01 9:27p Spaden
//add ac97 fifo addresses
//
//1     2/20/01 8:26p Spaden
//add aclinkcontrol.c

--*/
#ifndef __DMAC_H__
#define __DMAC_H__



#include "bvd1.h"

//todo: combine DMAC.H and dmacbits.h in 1 file and place it in the INC dir
#include "DMACBITS.H"
#define DMAC_AC97_AUDIO_RCV_FIFO	0x40500040
#define DMAC_AC97_AUDIO_XMIT_FIFO	0x40500040 //(was 0x40500140)
#define DMAC_AC97_AUDIO_MIC_FIFO	0x40500060

#define DMAC_AC97_RCVAB_CMD_MASK	0x6023C000  //0110 00000 01 000 11 11 0 0000000000000
#define DMAC_AC97_XMITAB_CMD_MASK	0x9043C000	//1001 00000 10 000 11 11 0 0000000000000
#define DMAC_AC97_MICAB_CMD_MASK	0x6023C000 	//0110 00000 01 000 11 11 0 0000000000000

/*
// these should be defined in the kernal
#define DMA_RCV_A_DESCRIPTOR_BASE_PHYSICAL		0x0
#define DMA_RCV_B_DESCRIPTOR_BASE_PHYSICAL		0x0
#define DMA_XMIT_A_DESCRIPTOR_BASE_PHYSICAL		0x0
#define DMA_XMIT_B_DESCRIPTOR_BASE_PHYSICAL		0x0
#define DMA_MIC_A_DESCRIPTOR_BASE_PHYSICAL		0x0
#define DMA_MIC_B_DESCRIPTOR_BASE_PHYSICAL		0x0

#define DMA_RCV_A_DESCRIPTOR_BASE_VIRTUAL		0x0
#define DMA_RCV_B_DESCRIPTOR_BASE_VIRTUAL		0x0
#define DMA_XMIT_A_DESCRIPTOR_BASE_VIRTUAL		0x0
#define DMA_XMIT_B_DESCRIPTOR_BASE_VIRTUAL		0x0
#define DMA_MIC_A_DESCRIPTOR_BASE_VIRTUAL		0x0
#define DMA_MIC_B_DESCRIPTOR_BASE_VIRTUAL		0x0

#define DMA_RCV_A_BUFFER_BASE_PHYSICAL			0x0
#define DMA_RCV_B_BUFFER_BASE_PHYSICAL			0x0
#define DMA_XMIT_A_BUFFER_BASE_PHYSICAL			0x0
#define DMA_XMIT_B_BUFFER_BASE_PHYSICAL			0x0
#define DMA_MIC_A_BUFFER_BASE_PHYSICAL			0x0
#define DMA_MIC_B_BUFFER_BASE_PHYSICAL			0x0

#define DMA_RCV_A_BUFFER_BASE_VIRTUAL			0x0
#define DMA_RCV_B_BUFFER_BASE_VIRTUAL			0x0
#define DMA_XMIT_A_BUFFER_BASE_VIRTUAL			0x0
#define DMA_XMIT_B_BUFFER_BASE_VIRTUAL			0x0
#define DMA_MIC_A_BUFFER_BASE_VIRTUAL			0x0
#define DMA_MIC_B_BUFFER_BASE_PHYSICAL			0x0
*/
#define DESC_ADDRESS_MASK			0xFFFFFFF0
//#define DESC_ADDRESS_STOP_MASK		0xFFFFFFF1 //OOPS: TODO: THIS IS WRONG I THINK, CHECK FOR SURE
#define DESC_ADDRESS_STOP_MASK		(0x1U << 0);
#define FORCE_64BIT_ALIGNMENT		0xFFFFFFFC;
#define FORCE_128BIT_ALIGNMENT		0xFFFFFFF8;



//unit       fifo add   w bi burst       src/tar    drmcr
//audio_rcv  0x40500040 4 11  8,  16, 32 Source  0x4000012c
//audio_xmt  0x40500040 4 11  8,  16, 32 Target  0x40000130
//microphone 0x40500060 4 11  8,  16, 32 Source  0x40000120

#define DMA_MAP_VALID_MASK  (0x1U << 7)  // Request is mapped to a valid channel indicated by DRCMRx(3:0)

//now defined in dmacbits.h
//#define DMA_CH_RCV 4
//#define DMA_CH_MIC 5
//#define DMA_CH_OUT 1


#define DCSR_BUSERRINTR     (0x1U << 0)  // Bus error status bit
#define DCSR_STARTINTR      (0x1U << 1)  // Descriptor fetch status 
#define DCSR_ENDINTR        (0x1U << 2)  // finish status
#define DCSR_STOPINTR       (0x1U << 3)  // stopped status
#define DCSR_REQPEND        (0x1U << 8)  // Request Pending (read-only)
#define DCSR_STARTIRQEN     (0x1U << 21) // Enable the start interrupt (when the descriptor is loaded)
#define DCSR_STOPIRQEN       (0x1U << 29) // Enable the stopped interrupt (when the descriptor is done)
#define DCSR_NOFETCH        (0x1U << 30) // Descriptor fetch mode, 0 = fetch
#define DCSR_RUN            (0x1U << 31) // run, 1=start

#define DCMD_LEN_MASK			0xFFF // mask off the length bits
#define DCMD_LEN_ZERO_MASK		0xFFFFFFFFFFFFF000 //clear the length bits
		
typedef enum  
{
	Mic = DMA_CH_MIC,
	Line= DMA_CH_RCV,
}InputSourceType;

struct DMAC_FRAME_DESCRIPTOR 
{
	unsigned int ddadr;		// address of the next frame descriptor (physical address)
	unsigned int dsadr;		// address of the source  data (physical address)
	unsigned int dtadr;     // address of the destination
	unsigned int dcmd;		// dma command
};


// the dmcd struct is for documentation
struct dcmdRegBits 
{
	unsigned len	     :13;
	unsigned rsv0		 :1;   
	unsigned width		 :2; 
	unsigned size		 :2;
	unsigned endian		 :1;
	unsigned flybyt	 	 :1;
	unsigned flybys	 	 :1;
	unsigned endirqen    :1;
	unsigned startirqen  :1;
	unsigned rsv1        :5;
	unsigned flowtrg     :1;
	unsigned flowsrc     :1;
	unsigned inctrgadd   :1;
	unsigned incsrcadd   :1;
};

union DmaCmdReg// allow bitfields or masks
{

	volatile struct dcmdRegBits DcmdReg ;
	volatile DWORD DcmdDword;
} ;


typedef enum {
     PLAY_XMIT,
     RECORD_RCV
} AC97_TRANSFER, *PAC97_TRANSFER;

///////////////////////////////////////////////////////////////////////////////


#endif

⌨️ 快捷键说明

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