亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? zl5011xdmampc8260.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*******************************************************************************
*
*  File name:              zl5011xDmaMpc8260.c
*
*  Version:                23
*
*  Author:                 ARW
*
*  Date created:           30/10/2002
*
*  Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
*  All rights reserved.
*
*  Module Description:
*    This module provides the DMA interface functions for an MPC8260
*    microprocessor
*
*    This file should be used as a reference for generating low level functions
*    for other microprocessors
*
*    It is STRONGLY suggested that the Motorola MPC8260 manual is read before
*    making any changes to this file
*
*    The API software assumes there are two virtual DMA channels (0 and 1)
*    and these are mapped in this file to physical DMA channels.
*    By default channel 0 is used for CPU to device transfers and
*    channel 1 is used for device to CPU transfers
*    In the Zarlink evaluation board the mapping is as follows:
*        virtual channel 0 maps to physical IDMA 1,
*        virtual channel 1 maps to physical IDMA 2,
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     25/09/2002  ARW      New Data
*  2     17/10/2002  ARW      Peer review actions
*                             Minor bugs detected during testing on a
*                             board without a device
*  3     23/10/2002  ARW      Fixed a bug in the interrupt masking code
*  4     30/10/2002  ARW      Included uP specific structures
*  5     31/10/2002  MRC      Added variants + minor fixes
*  6     01/11/2002  ARW      Changed _DEV_BOARD to _NO_DEVICE
*  7     07/11/2002  ARW      Added port C definitions for DREQo & DREQ1
*                             Added new tasks for monitoring the IDMAs
*  8     13/11/2002  ARW      Removed printf accidently left in file
*  9     14/01/2003  ARW      Added mirco specific prototpyes and include files
*  10    31/01/2003  MRC      Moved DMA include files and micro specific
*                             prototypes to OS include file
*  11    21/03/2003  ARW      Fixed bugs found on the eval board
*  12    07/04/2003  ARW      Fixed more bugs identified during evaluation
*  13    10/04/2003  ARW      Removed _NO_DEVICE compilation code
*  14    15/04/2003  ARW      Applied byte swapping to DMA transfers
*  15    02/05/2003  ARW      Turned TRACE off in task zl5011xDmaOutOfBuffers
*  16    02/05/2003  ARW      Undid version 15 edits
*                             Removed TRACE from zl5011xDmaDetermineStatus()
*  17    29/07/2003  APL      Renamed macro _ZARLINK_ZLE5011X_BOARD
*  18    29/07/2004  MRC      Fixed some compiler warnings
*  19    03/09/2004  APL      Completely specified initialiser for IdmaMonitor
*  20    19/10/2004  APL      Added zl5011xIsDmaBufferDone and
*                                zl5011xDmaSetDescriptorInterruptFlag
*  21    16/11/2004  MRC      Shortened task label
*  22    15/04/2005  APL      Changed macros to make it easier to port to other
*                                PowerQUIC II micros
*  23    15/04/2005  APL      Fixed incorrect DACK1 mask
*
*******************************************************************************/


/*****************   INCLUDE FILES   ******************************************/
#include "zl5011x.h"
#include "zl5011xDmaMpc.h"
#include "zl5011xDmaTaskInfo.h"

/*****************   #DEFINES AND ASSOCIATED STRUCTURES    ********************/
#define ZL5011X_DMA_PADDING  ZL5011X_DMA_32BYTE_PADDING
/* MPC8260 supports bursts of 32 bytes. We need to ensure the device pads
   packets destined for the micro to integers of the transfer buffer size. This
   will ensure that the last packet does not get held up due to an incomplete
   buffer.

   The device supports 3 types of padding to suit all DMAs. This macro MUST be
   set to one of the three following values:

     ZL5011X_DMA_64BYTE_PADDING - pad packets for the CPU to be integers of 64
                                 bytes
     ZL5011X_DMA_32BYTE_PADDING - pad packets for the CPU to be integers of 32
                                 bytes
     ZL5011X_DMA_NO_PADDING     - Do not pad packets
*/

#define ZL5011X_DMA_DREQ_POLARITY ZL5011X_POSITIVE
/* Dreq line active state. This MUST be set to either:
     ZL5011X_NEGATIVE for active low, or
     ZL5011X_POSITIVE for active high                                           */

#define ZL5011X_DMA_DACK_POLARITY ZL5011X_NEGATIVE
/* Dack line active state. This MUST be set to either:
     ZL5011X_NEGATIVE for active low, or
     ZL5011X_POSITIVE for active high                                           */

#define ZL5011X_DMA_TRANSACTION_64_BIT ZL5011X_TRUE
/* The number of bits the micro uses for a transfer must be known to ensure
   packets do not get corrupted
     ZL5011X_FALSE for 32 bit transactions
     ZL5011X_TRUE for 64 bit transactions                                       */

#define ZL5011X_DMA_WRAP                0x0
/* Define a 3 bit number specifying the size of the internal buffer allocated
   in the dual port parameter RAM used for transferring packets. This number
   must be consistant with the padding capability of the device (0 gives a
   buffer size of 64 bytes, and a transfer size of 32 bytes as defined in the
   next 2 macros).                                                            */

#define ZL5011X_DMA_TRANSFER_BUFFER_SIZE (64 * (1 << ZL5011X_DMA_WRAP))
/* Using the MPC8260 formula, define the size of the internal buffer in bytes */

#define ZL5011X_DMA_MAXIMUM_TRANSFER_SIZE (ZL5011X_DMA_TRANSFER_BUFFER_SIZE -32)
/* Define the maximum transfer size the DMA_WRAP bits will provide. This value
   MUST be consistant with the padding that the device will put on packets
   destined for the CPU                                                       */

#define ZL5011X_DMA_MAX_DESCRIPTOR_COUNT 128 /* Limit a descriptor chain to one
                                             2Kbyte bank of memory. (The
                                             descriptor size is 4 words long) */

#define ZL5011X_PER_PORT_TRANSFER_SIZE    sizeof(Uint32T)
/* Transfers from the DMA internal memory to / from the device must be done a
   word at a time                                                             */

#define ZL5011X_DMA_WRAP_BIT_SHIFT        6 /* Bit shifts for ZL5011X_DMA_WRAP    */
#define ZL5011X_DPRAM_BASE_ADDRESS       64 /* Alignment (in bytes) required for
                                             the channel parameters stored in
                                             the DPRAM                        */
#define ZL5011X_DB_BASE_ADDRESS           8 /* Alignment (in bytes) required for
                                             the buffer descriptors stored in
                                             the DPRAM                        */

#define ZL5011X_CPM_MODULE_TIMEOUT       12 /* 200mS (for a 60 tick/sec CPU)    */
#define ZL5011X_IDMA_STOP_TIMEOUT        ZL5011X_CPM_MODULE_TIMEOUT
#define ZL5011X_DEVICE_STOP_TIMEOUT      12 /* Number of ticks to wait for the
  DMA to stop after issuing a stop command. On the Zarlink evaluation board 12
  ticks corresponds to 200ms.                                                 */

/* Align pointers as required                                                 */
#define ZL5011X_DMA_BUFFER_BURST_ALIGNED(buffer) (((((Uint32T)buffer-1)/ \
           zl5011xDmaProps.alignmentSize)+1)*zl5011xDmaProps.alignmentSize)

#ifdef _ZARLINK_ZLE5011X_BOARD
#define ZL5011X_DMA_NUMBER_OF_CHANNELS    2 /* Number of independent DMA channels
                                             in the MPC8260 bound that can be
                                             used in the eval board           */

/* The following macros connect IDMA channel 1 and 2 DREQ and DACK signals
   to the external world. This is micro and board specific.
   In the Zarlink eval board port C pins 0 (DREQ1), 1 (DREQ2), 23 (DACK1)
   and 3 (DACK2) are used       */
#define PPC8260_PORTC_DREQ1_MASK   0x80000000
#define PPC8260_PORTC_DACK1_MASK   0x00000100
#define PPC8260_PORTC_DREQ2_MASK   0x40000000
#define PPC8260_PORTC_DACK2_MASK   0x10000000

#define PPC8260_IMM_PIO_PSORC 0x10D48
#define PPC8260_IMM_PIO_PPARC 0x10D44
#define PPC8260_IMM_PIO_PDIRC 0x10D40
#define PPC8260_IMM_CPM_RCCR  0x119C4

#define PPC8260_IMM_CPM_CMD_1  0x00A00000     /* IDMA 1, level sensitive, priority option 3 */
#define PPC8260_IMM_CPM_CMD_2  0x00410000     /* IDMA 2, level sensitive, priority option 2 */

#else
#define ZL5011X_DMA_NUMBER_OF_CHANNELS    4 /* Number of independent DMA channels
                                             in the MPC8260                   */

#endif

/******************************************************************************/
/* IDMA Event (IDSR) & Mask (IDMR) registers bit fields                       */
#define PPC8260_IMM_IDSR             0x11020 /* IDMA registers base           */
#define PPC8260_IMM_IDSR_INC         0x00008 /* Increment value for IDSR regs
                                                (1 per DMA channel)           */

/* IDSR/IDMR bit fields                                                       */
#define PPC8260_IDMA_IDSR_BC         0x01    /* Buffer descriptor completed   */
#define PPC8260_IDMA_IDSR_EDN        0x02    /* Channel terminated transfer due
                                                to external signal            */
#define PPC8260_IDMA_IDSR_OB         0x04    /* No valid BDs left to transfer */
#define PPC8260_IDMA_IDSR_SC         0x08    /* Stop completed                */

/******************************************************************************/
/* IDMA parameter ram bit fields                                              */
#define PPC8260_IMM_IDMA_BASE         0x87FE /* Base address for IDMA params  */
#define PPC8260_IMM_IDMA_BASE_INC     0x0100 /* Increment value for each DMA
                                                channel                       */

/* Bit fields for DCM word                                                    */
#define PPC8260_IDMA_SINC            0x0020
#define PPC8260_IDMA_DINC            0x0010
#define PPC8260_IDMA_SD_MEM_MEM      0x0000
#define PPC8260_IDMA_SD_MEM_PER      0x0001
#define PPC8260_IDMA_SD_PER_MEM      0x0002
#define PPC8260_IDMA_ERM             0x0008 /* External request mode          */
#define PPC8260_IDMA_DT              0x0004
#define PPC8260_IDMA_FB_MODE         0x8000

/******************************************************************************/
/* Communications Processor Module                                            */
#define PPC8260_IMM_CPM_CPCR         0x119C0 /* CPM command register          */

#define PPC8260_CPM_BUSY          0x00010000 /* CPM busy bit                  */
#define PPC8260_CPM_IDMA_START    0x1E810009 /* CPM command to start IDMA1    */
#define PPC8260_CPM_IDMA_STOP     0x1E81000B /* CPM command to stop IDMA1     */
#define PPC8260_CPM_COMMAND_INC   0x04200000 /* Increment number to apply to
                                                start and stop commands for
                                                another DMA channel           */

/******************************************************************************/
/* Buffer descriptor definition - Bit fields for ctlsts word decribing how to
   perform the data transfer                                                  */
#define PPC8260_IDMA_BD_SDTB_60X  0x00000000
#define PPC8260_IDMA_BD_DDTB_60X  0x00000000
#define PPC8260_IDMA_BD_SDTB_LCL  0x00000200
#define PPC8260_IDMA_BD_DDTB_LCL  0x00010000
#define PPC8260_IDMA_BD_DBO_PPC   0x00080000 /* DMA to perform byte swapping  */
#define PPC8260_IDMA_BD_SBO_PPC   0x00000800 /* in both directions            */
#define PPC8260_IDMA_BD_VALID     0x80000000
#define PPC8260_IDMA_BD_WRAP      0x20000000
#define PPC8260_IDMA_BD_INT       0x10000000
#define PPC8260_IDMA_BD_LAST      0x08000000
#define PPC8260_IDMA_BD_CM        0x02000000
#define PPC8260_IDMA_BD_SDN       0x00400000
#define PPC8260_IDMA_BD_DDN       0x00200000

/*****************   DATA STRUCTURES   ****************************************/
/* IDMA Event (IDSR) & Mask (IDMR) registers                                  */
typedef struct zl5011xDmaRegistersS
{
  volatile Uint8T  idsr;
           Uint8T  reserved1;
           Uint8T  reserved2;
           Uint8T  reserved3;
  volatile Uint8T  idmr;
} zl5011xDmaRegistersS;

/* IDMA parameter ram structure for register addresses in correct offset
   positions                                                                  */
typedef struct zl5011xDmaParametersS
{
  volatile Uint16T ibase;
  volatile Uint16T dcm;
  volatile Uint16T ibdptr;
  volatile Uint16T dpr_buf;
  volatile Uint16T buf_inv;
  volatile Uint16T ss_max;
  volatile Uint16T dpr_in_ptr;
  volatile Uint16T sts;
  volatile Uint16T dpr_out_ptr;
  volatile Uint16T seob;
  volatile Uint16T deob;
  volatile Uint16T dts;
  volatile Uint16T ret_add;
           Uint16T reserved1;
  volatile Uint32T bd_cnt;
  volatile Uint32T s_ptr;
  volatile Uint32T d_ptr;
  volatile Uint32T istate;
} zl5011xDmaParametersS;

/* Buffer descriptor definition                                               */
typedef struct zl5011xDmaBufferDescripS
{
  volatile Uint32T ctlsts;
  volatile Uint32T length;
  volatile Uint32T source;
  volatile Uint32T destination;
} zl5011xDmaBufferDescripS;

/* Structure defining all micro specific parameters                           */
typedef struct zl5011xDmaStructS
{
   zl5011xDmaRegistersS *reg;            /* Status and mask registers          */
   zl5011xDmaParametersS *params;        /* DMA chhanel parameters             */
   zl5011xDmaBufferDescripS *bufferDescrip;
} zl5011xDmaStructS;

/* Structure used by the IDMA task for monitoring the status of the IDMA
   channels                                                                   */
typedef struct zl5011xIdmaMonitorS
{
    zl5011xBooleanE channelEnabled[ZL5011X_DMA_NUMBER_OF_CHANNELS];
    Uint32T taskId;
    zl5011xBooleanE goFlag;
    zl5011xDmaChannelS *dmaChannel[ZL5011X_DMA_NUMBER_OF_CHANNELS];
} zl5011xIdmaMonitorS;

/*****************   ENUMERATIONS    ******************************************/


/*****************   STATIC FUNCTION DECLARATIONS   ***************************/
static void zl5011xDmaOutOfBuffers(void);

static void zl5011xassignDmaPorts(zl5011xDmaChannelS *dmaChannel);

static void zl5011xConnectDreq(zl5011xDmaChannelS *dmaChannel);

static void zl5011xDisconnectDreq(zl5011xDmaChannelS *dmaChannel);

/*****************   STATIC GLOBAL VARIABLES   ********************************/

/*****************   EXPORTED GLOBAL VARIABLES   ******************************/
/* Global structure for storing all global DMA parameters, and setting the
   device needs to have in order to work with the DMA                         */
zl5011xDmaPropertiesS zl5011xDmaProps = {
    ZL5011X_DMA_NUMBER_OF_CHANNELS,
    ZL5011X_DMA_MAX_DESCRIPTOR_COUNT,
    ZL5011X_DMA_PADDING,
    ZL5011X_DMA_DREQ_POLARITY,
    ZL5011X_DMA_DACK_POLARITY,
    ZL5011X_DEVICE_STOP_TIMEOUT,
    ZL5011X_DMA_MAXIMUM_TRANSFER_SIZE,
    ZL5011X_DMA_TRANSFER_BUFFER_SIZE,
    ZL5011X_DMA_TRANSACTION_64_BIT};

/* A global structure has been defined to store all microspecific data required
   to program the DMA. An instance of the structure is needed for both transmit
   and receive.

   The MPC8260 requires a structure containing three pointers representing the
   three areas of the dual port parameter RAM that needs to be accessed:
       - Set/Read the control registers
       - Define the parameters for each DMA channel
       - Define a chain of buffer descriptors for each channel                */
static zl5011xDmaStructS TxRamPtrs = {NULL, NULL, NULL};
static zl5011xDmaStructS RxRamPtrs = {NULL, NULL, NULL};

#ifdef _ZARLINK_ZLE5011X_BOARD
static zl5011xIdmaMonitorS IdmaMonitor =
                  {
                     {ZL5011X_FALSE,ZL5011X_FALSE},
                     OS_ERROR,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久蜜桃香蕉精品一区二区三区| 91福利视频在线| 日韩高清在线不卡| 丝袜国产日韩另类美女| 亚洲国产欧美在线| 肉丝袜脚交视频一区二区| 亚洲男女毛片无遮挡| 亚洲欧美色图小说| 亚洲综合色自拍一区| 亚洲另类一区二区| 亚洲最新视频在线观看| 一区二区高清视频在线观看| 日韩精品1区2区3区| 理论片日本一区| 韩国v欧美v亚洲v日本v| 国产91在线看| 色综合天天综合网国产成人综合天| 一本到不卡免费一区二区| 在线免费视频一区二区| 制服视频三区第一页精品| 91精品欧美综合在线观看最新| 日韩欧美高清一区| 欧美激情资源网| 樱花影视一区二区| 欧美bbbbb| av在线不卡网| 91精品国产91久久综合桃花| 久久久99免费| 亚洲一区中文在线| 国产裸体歌舞团一区二区| 91色视频在线| 亚洲精品一区二区三区精华液| 国产精品高潮呻吟| 天天综合天天做天天综合| 色一区在线观看| 日韩一级成人av| 国产精品久久久久四虎| 五月天激情综合| 成人av在线一区二区| 91精品国产91热久久久做人人 | 欧洲色大大久久| 日韩精品一区二区三区在线| 亚洲欧美另类久久久精品2019| 另类欧美日韩国产在线| 在线观看亚洲成人| 国产日韩av一区| 老色鬼精品视频在线观看播放| 日本韩国精品在线| 久久综合九色综合97_久久久| 亚洲一区二区av电影| 成人综合婷婷国产精品久久| 欧美高清激情brazzers| 亚洲欧美韩国综合色| 国产成人免费高清| 日韩精品专区在线| 天堂成人国产精品一区| 91老师片黄在线观看| 久久久91精品国产一区二区精品| 免费观看在线色综合| 欧美视频一区二| 亚洲激情图片qvod| 99精品久久99久久久久| 久久久久成人黄色影片| 精品一区二区三区在线观看国产 | 日韩免费性生活视频播放| 樱花影视一区二区| 色综合久久66| 亚洲三级电影网站| 91蝌蚪porny九色| 成人欧美一区二区三区视频网页| 成人综合婷婷国产精品久久蜜臀| 久久九九99视频| 高清shemale亚洲人妖| 久久精品一区二区三区不卡牛牛 | 免费人成黄页网站在线一区二区| 国产日韩欧美制服另类| 国产一区二区调教| 日韩欧美一区在线观看| 日本欧美一区二区| 精品久久一区二区三区| 麻豆成人在线观看| 精品成a人在线观看| 国产一区二区三区视频在线播放| 日韩女优av电影| 国产一区二区三区久久悠悠色av | 欧美在线观看18| 亚洲一区二区三区不卡国产欧美| 在线视频你懂得一区二区三区| 亚洲电影第三页| 日韩一级大片在线观看| 国产999精品久久| 亚洲视频 欧洲视频| 欧美色图一区二区三区| 日韩精品一卡二卡三卡四卡无卡| 日韩一区二区三区在线观看 | 91社区在线播放| 亚洲高清免费在线| 日韩精品在线一区| 成人中文字幕电影| 婷婷六月综合网| 国产午夜精品一区二区三区嫩草| 国产成人亚洲综合a∨猫咪| 中文字幕在线不卡一区二区三区| 91女厕偷拍女厕偷拍高清| 天天av天天翘天天综合网 | 国产乱码精品一区二区三| 中文字幕欧美一| 在线电影欧美成精品| 欧美日韩一二三区| 国产一区二区福利| 亚洲欧美另类久久久精品| 欧美一区二区三区免费视频 | 天堂成人国产精品一区| 国产日韩一级二级三级| 欧美日韩一二三| 成人免费精品视频| 日本一道高清亚洲日美韩| 国产精品美女久久久久久| 欧美日韩国产首页| 国产suv一区二区三区88区| 丝瓜av网站精品一区二区| 亚洲国产精品二十页| 欧美剧情片在线观看| 99热99精品| 久久精品国产精品亚洲精品| 亚洲女同一区二区| 久久久久久久久久看片| 欧美精品一二三四| 色婷婷激情久久| 成人性生交大片免费| 加勒比av一区二区| 日韩激情视频网站| 亚洲精品国产a| 国产精品福利一区二区| 精品国产伦一区二区三区观看体验| 色哟哟一区二区在线观看| 国产高清精品在线| 久久激情五月婷婷| 青草国产精品久久久久久| 亚洲国产精品一区二区www| 国产精品色哟哟| 久久精品视频在线免费观看| 欧美r级在线观看| 欧美欧美欧美欧美首页| 欧美专区亚洲专区| av中文字幕一区| 成人国产精品免费观看| 国产精品99久久久久| 国内不卡的二区三区中文字幕| 美美哒免费高清在线观看视频一区二区| 亚洲成a人v欧美综合天堂下载| 亚洲精品大片www| 亚洲精品成人在线| 亚洲一区二区欧美日韩| 一区二区不卡在线播放| 亚洲精品欧美激情| 亚洲一区在线观看网站| 亚洲一区二区免费视频| 婷婷国产在线综合| 日韩成人av影视| 黄一区二区三区| 成人夜色视频网站在线观看| 91影院在线观看| 欧美无砖砖区免费| 亚洲福利一二三区| 性感美女极品91精品| 日本不卡视频在线| 激情综合色综合久久| 国产原创一区二区三区| 波多野结衣中文一区| 色婷婷久久久亚洲一区二区三区| 在线观看免费视频综合| 在线综合视频播放| 精品久久久三级丝袜| 久久九九久久九九| 久久品道一品道久久精品| 国产精品乱人伦| 亚洲丝袜美腿综合| 日本高清不卡aⅴ免费网站| 91精品国产全国免费观看| 日韩一区二区不卡| 久久久久久电影| 亚洲卡通动漫在线| 亚洲午夜久久久久久久久电影网| 婷婷成人激情在线网| 久久99国产精品久久| 九九精品一区二区| 成人丝袜高跟foot| 成人免费视频视频在线观看免费| 91久久精品一区二区二区| 欧美视频一二三区| 日韩美女视频一区二区在线观看| 亚洲日本va午夜在线电影| 婷婷夜色潮精品综合在线| 美女尤物国产一区| hitomi一区二区三区精品| 91一区一区三区| 91精品午夜视频| 最近日韩中文字幕| 日韩中文字幕区一区有砖一区|