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

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

?? dma1.c

?? 自己修改的U-boot1.1.4For AT91RM9200DK. 請用armgcc3.3.2編譯。
?? C
?? 第 1 頁 / 共 2 頁
字號:
/************************************************************ * * copyright @ Motorola, 1999 * * App. API * * App. API are the APIs Kernel provides for the application * level program * ************************************************************/#include "dma_export.h"#include "dma.h"/* Define a macro to use an optional application-layer print function, if * one was passed to the library during initialization.  If there was no * function pointer passed, this protects against referencing a NULL pointer. * Also define The global variable that holds the passed pointer. */#define PRINT if ( app_print ) app_printstatic int (*app_print)(char *,...);/* Set by call to get_eumbbar during DMA_Initialize. * This could be globally available to the library, but there is * an advantage to passing it as a parameter: it is already in a register * and doesn't have to be loaded from memory.  Also, that is the way the * library was already implemented and I don't want to change it without * a more detailed analysis. * It is being set as a global variable during initialization to hide it from * the DINK application layer, because it is Kahlua-specific.  I think that * get_eumbbar, load_runtime_reg, and store_runtime_reg should be defined in * a Kahlua-specific library dealing with the embedded utilities memory block. * Right now, get_eumbbar is defined in dink32/kahlua.s.  The other two are * defined in dink32/drivers/i2c/i2c2.s, drivers/dma/dma2.s, etc. */static unsigned int Global_eumbbar = 0;extern unsigned int get_eumbbar();extern unsigned int load_runtime_reg( unsigned int eumbbar, unsigned int reg );#pragma Alias( load_runtime_reg, "load_runtime_reg" );extern void store_runtime_reg( unsigned int eumbbar, unsigned int reg, unsigned int val );#pragma Alias( store_runtime_reg, "store_runtime_reg" );unsigned int dma_reg_tb[][14] = {	/* local DMA registers */	{      /* DMA_0_MR   */  0x00001100,      /* DMA_0_SR   */  0x00001104,      /* DMA_0_CDAR */  0x00001108,      /* DMA_0_SAR  */  0x00001110,      /* DMA_0_DAR  */  0x00001118,      /* DMA_0_BCR  */  0x00001120,      /* DMA_0_NDAR */  0x00001124,      /* DMA_1_MR   */  0x00001200,      /* DMA_1_SR   */  0x00001204,      /* DMA_1_CDAR */  0x00001208,      /* DMA_1_SAR  */  0x00001210,      /* DMA_1_DAR  */  0x00001218,      /* DMA_1_BCR  */  0x00001220,      /* DMA_1_NDAR */  0x00001224,	},	/* remote DMA registers */	{      /* DMA_0_MR   */  0x00000100,      /* DMA_0_SR   */  0x00000104,      /* DMA_0_CDAR */  0x00000108,      /* DMA_0_SAR  */  0x00000110,      /* DMA_0_DAR  */  0x00000118,      /* DMA_0_BCR  */  0x00000120,      /* DMA_0_NDAR */  0x00000124,      /* DMA_1_MR   */  0x00000200,      /* DMA_1_SR   */  0x00000204,      /* DMA_1_CDAR */  0x00000208,      /* DMA_1_SAR  */  0x00000210,      /* DMA_1_DAR  */  0x00000218,      /* DMA_1_BCR  */  0x00000220,      /* DMA_1_NDAR */  0x00000224,	},};/* API functions *//*  Initialize DMA unit with the following: *  optional pointer to application layer print function * *  These parameters may be added: *  ??? *  Interrupt enables, modes, etc. are set for each transfer. * *  This function must be called before DMA unit can be used. */externDMA_Status DMA_Initialize( int (*p)(char *,...)){  DMAStatus status;  /* establish the pointer, if there is one, to the application's "printf" */  app_print = p;  /* If this is the first call, get the embedded utilities memory block   * base address.  I'm not sure what to do about error handling here:   * if a non-zero value is returned, accept it.   */  if ( Global_eumbbar == 0)     Global_eumbbar = get_eumbbar();  if ( Global_eumbbar == 0)  {    PRINT( "DMA_Initialize: can't find EUMBBAR\n" );    return DMA_ERROR;  }  return DMA_SUCCESS;}/* Perform the DMA transfer, only direct mode is currently implemented. * At this point, I think it would be better to define a different * function for chaining mode. * Also, I'm not sure if it is appropriate to have the "generic" API * accept snoop and int_steer parameters.  The DINK user interface allows * them, so for now I'll leave them. * * int_steer controls DMA interrupt steering to PCI or local processor * type is the type of transfer: M2M, M2P, P2M, P2P * source is the source address of the data * dest is the destination address of the data * len is the length of data to transfer * channel is the DMA channel to use for the transfer * snoop is the snoop enable control */extern DMA_Status DMA_direct_transfer( DMA_INTERRUPT_STEER int_steer,				       DMA_TRANSFER_TYPE type,				       unsigned int source,				       unsigned int dest,				       unsigned int len,				       DMA_CHANNEL channel,				       DMA_SNOOP_MODE snoop){    DMA_MR md;    DMA_CDAR cdar;    /* it's inappropriate for curr to be a struct, but I'll leave it */    DMA_CURR curr;    DMAStatus stat;	/* The rest of this code was moved from device.c test_dma to here.	 * It needs to be cleaned up and validated, but at least it is removed	 * from the application and API.  Most of the mode is left hard coded.	 * This should be changed after the final API is defined and the user	 * application has a way to control the transfer.	 *	 */	if ( DMA_Get_Mode( LOCAL, Global_eumbbar, channel, &md ) != DMASUCCESS )	{		return DMA_ERROR;	}	md.irqs = int_steer;	md.pde = 0;	md.dahts = 3; /* 8 - byte */	md.sahts = 3; /* 8 - byte */	md.dahe = 0;	md.sahe = 0;	md.prc = 0;	/* if steering interrupts to local processor, use polling mode */	if ( int_steer == DMA_INT_STEER_PCI )	{		md.eie = 1;		md.eotie = 1;	} else {		md.eie = 0;		md.eotie = 0;	}	md.dl = 0;	md.ctm = 1;   /* direct mode */    md.cc = 0;	/* validate the length range */	if (len > 0x3ffffff )	{		PRINT( "dev DMA: length of transfer too large: %d\n", len );		return DMA_ERROR;	}	/* inappropriate to use a struct, but leave as is for now */	curr.src_addr = source;	curr.dest_addr = dest;	curr.byte_cnt = len;	(void)DMA_Poke_Desp( LOCAL, Global_eumbbar, channel, &cdar );	cdar.snen = snoop;	cdar.ctt = type;	if ( ( stat = DMA_Bld_Desp( LOCAL, Global_eumbbar, channel, cdar ))			!= DMASUCCESS ||		 ( stat = DMA_Bld_Curr( LOCAL, Global_eumbbar, channel, curr ))			!= DMASUCCESS ||	     ( stat = DMA_Set_Mode( LOCAL, Global_eumbbar, channel, md ))			!= DMASUCCESS ||		 ( stat = DMA_Start( LOCAL, Global_eumbbar, channel ))			!= DMASUCCESS )	{		if ( stat == DMACHNBUSY )		{			PRINT( "dev DMA: channel %d busy.\n", channel );		}		else		{			PRINT( "dev DMA: invalid channel request.\n", channel );		}		return DMA_ERROR;	}/* Since we are interested at the DMA performace right now,   we are going to do as less as possible to burden the   603e core.   if you have epic enabled or don't care the return from   DMA operation, you can just return SUCCESS.   if you don't have epic enabled and care the DMA result,   you can use the polling method below.   Note: I'll attempt to activate the code for handling polling. */#if 0	/* if steering interrupt to local processor, let it handle results */	if ( int_steer == DMA_INT_STEER_LOCAL )	{	    return DMA_SUCCESS;	}	/* polling since interrupt goes to PCI */	do	{		stat = DMA_ISR( Global_eumbbar, channel, dma_error_func,			dma_error_func, dma_error_func, dma_error_func );	}	while ( stat == DMANOEVENT );#endif    return DMA_SUCCESS;}/* DMA library internal functions *//** * Note: * * In all following functions, the host (KAHLUA) processor has a * choice of accessing on board local DMA (LOCAL), * or DMA on a distributed KAHLUA (REMOTE). In either case, * the caller shall pass the configured embedded utility memory * block base address relative to the DMA. If LOCAL DMA is used, * this parameter shall be EUMBBAR, if REMOTE is used, the * parameter shall be the corresponding PCSRBAR. **//************************************************************** * function: DMA_Get_Stat * * description: return the content of status register of *              the given DMA channel * *              if error, reserved0 field all 1s. **************************************************************/staticDMAStatus DMA_Get_Stat( LOCATION host, unsigned int eumbbar, unsigned int channel, DMA_SR *stat ){    unsigned int tmp;   if ( channel != 0 && channel != 1 || stat == 0 )   {       return DMAINVALID;   }    tmp = load_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_SR_REG] );#ifdef DMADBG0   PRINT( "%s(%d): %s DMA %d (0x%08x) stat = 0x%08x\n", __FILE__, __LINE__,		  ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_SR_REG], tmp );#endif	 stat->reserved0 = ( tmp & 0xffffff00 ) >> 8;	 stat->lme       = ( tmp & 0x00000080 ) >> 7;	 stat->reserved1 = ( tmp & 0x00000060 ) >> 5;	 stat->pe        = ( tmp & 0x00000010 ) >> 4;	 stat->reserved2 = ( tmp & 0x00000008 ) >> 3;	 stat->cb        = ( tmp & 0x00000004 ) >> 2;	 stat->eosi      = ( tmp & 0x00000002 ) >> 1;	 stat->eocai     = ( tmp & 0x00000001 );   return DMASUCCESS;}/************************************************************** * function: DMA_Get_Mode * * description: return the content of mode register of the *              given DMA channel * *              if error, return DMAINVALID, otherwise return *              DMASUCCESS **************************************************************/staticDMAStatus DMA_Get_Mode( LOCATION host, unsigned eumbbar, unsigned int channel, DMA_MR *mode ){    unsigned int tmp;   if ( channel != 0 && channel != 1 || mode == 0 )   {     return DMAINVALID;   }    tmp = load_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_MR_REG] );#ifdef DMADBG0   PRINT( "%s(%d): %s DMA %d (0x%08x) mode = 0x%08x\n", __FILE__, __LINE__,		  ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_MR_REG], tmp );#endif	 mode->reserved0 = (tmp & 0xfff00000) >> 20;	 mode->irqs      = (tmp & 0x00080000) >> 19;	 mode->pde       = (tmp & 0x00040000) >> 18;	 mode->dahts     = (tmp & 0x00030000) >> 16;     mode->sahts     = (tmp & 0x0000c000) >> 14;	 mode->dahe      = (tmp & 0x00002000) >> 13;	 mode->sahe      = (tmp & 0x00001000) >> 12;	 mode->prc       = (tmp & 0x00000c00) >> 10;	 mode->reserved1 = (tmp & 0x00000200) >> 9;	 mode->eie       = (tmp & 0x00000100) >> 8;	 mode->eotie     = (tmp & 0x00000080) >> 7;	 mode->reserved2 = (tmp & 0x00000070) >> 4;	 mode->dl        = (tmp & 0x00000008) >> 3;	 mode->ctm       = (tmp & 0x00000004) >> 2;	 mode->cc        = (tmp & 0x00000002) >> 1;	 mode->cs        = (tmp & 0x00000001);   return DMASUCCESS;}/************************************************************** * function: DMA_Set_Mode * * description: Set a new mode to a given DMA channel * * note: It is not a good idea of changing the DMA mode during *       the middle of a transaction. **************************************************************/staticDMAStatus DMA_Set_Mode( LOCATION host, unsigned eumbbar, unsigned int channel, DMA_MR mode ){    unsigned int tmp;   if ( channel != 0 && channel != 1 )   {	   return DMAINVALID;   }   tmp = ( mode.reserved0 & 0xfff ) << 20;   tmp |= ( ( mode.irqs  & 0x1 ) << 19);   tmp |= ( ( mode.pde   & 0x1 ) << 18 );   tmp |= ( ( mode.dahts & 0x3 ) << 16 );   tmp |= ( ( mode.sahts & 0x3 ) << 14 );   tmp |= ( ( mode.dahe  & 0x1 ) << 13 );   tmp |= ( ( mode.sahe  & 0x1 ) << 12 );   tmp |= ( ( mode.prc   & 0x3 ) << 10 );   tmp |= ( ( mode.reserved1 & 0x1 ) << 9 );   tmp |= ( ( mode.eie   & 0x1 ) << 8 );   tmp |= ( ( mode.eotie & 0x1 ) << 7 );   tmp |= ( ( mode.reserved2 & 0x7 ) << 4 );   tmp |= ( ( mode.dl    & 0x1 ) << 3 );   tmp |= ( ( mode.ctm   & 0x1 ) << 2 );   tmp |= ( ( mode.cc    & 0x1 ) << 1 ) ;   tmp |= ( mode.cs    & 0x1 );   store_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG + DMA_MR_REG], tmp );   return DMASUCCESS;}/************************************************************ * function: DMA_Start * * description: start a given DMA channel transaction *              return DMASUCCESS if success otherwise return *              DMAStatus value * * note: this function will clear DMA_MR(CC) first, then *       set DMA_MR(CC). ***********************************************************/staticDMAStatus DMA_Start( LOCATION host, unsigned int eumbbar, unsigned int channel ){   DMA_SR stat;   unsigned int mode;   if ( channel != 0 && channel != 1 )   {	   return DMAINVALID;   }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品va在线观看| 美女一区二区三区| 亚洲国产日韩av| 国产自产2019最新不卡| 色噜噜久久综合| 国产女主播视频一区二区| 一区二区三区精品视频| 国产麻豆日韩欧美久久| 欧美精品久久久久久久久老牛影院| 亚洲国产精品v| 久久99这里只有精品| 欧美日韩国产综合草草| 亚洲免费在线播放| 成人h动漫精品| 久久精品一区二区三区不卡牛牛| 视频在线在亚洲| 色婷婷精品大视频在线蜜桃视频| 国产欧美精品国产国产专区| 久久成人麻豆午夜电影| 91精品国产全国免费观看 | 亚洲影视资源网| 高清国产一区二区三区| 精品处破学生在线二十三| 日本伊人色综合网| 欧美三级日本三级少妇99| 亚洲色图欧美在线| av一本久道久久综合久久鬼色| 久久精品一区蜜桃臀影院| 黄色日韩三级电影| 久久综合九色综合97婷婷| 久久国产欧美日韩精品| 欧美本精品男人aⅴ天堂| 青青青伊人色综合久久| 日韩午夜在线影院| 久久福利视频一区二区| 久久久噜噜噜久久人人看| 国产精品一卡二| 亚洲国产精品成人综合| 欧美色精品在线视频| 一区二区三区精品在线观看| 在线观看中文字幕不卡| 亚洲国产一区二区三区| 欧美日韩一级大片网址| 日韩成人午夜电影| 欧美一区二区精品久久911| 美日韩一区二区| 久久美女艺术照精彩视频福利播放| 精品中文av资源站在线观看| 久久久久久久精| 成人一二三区视频| 一区二区三区欧美视频| 欧美久久久久久蜜桃| 蜜桃精品在线观看| 国产亚洲欧美日韩日本| 91精品办公室少妇高潮对白| 亚洲一区二区三区四区在线| 欧美精品123区| 国产精品资源在线观看| 亚洲人一二三区| 欧美顶级少妇做爰| 国产精品 日产精品 欧美精品| 国产精品久久久久影院老司| 欧美性猛交xxxx乱大交退制版| 日韩影院在线观看| 欧美国产丝袜视频| 欧美美女一区二区在线观看| 国产高清亚洲一区| 亚洲国产综合在线| 久久你懂得1024| 在线精品观看国产| 国产不卡一区视频| 亚洲gay无套男同| 国产欧美精品在线观看| 精品视频免费看| 国产成人av影院| 日韩av电影免费观看高清完整版| 久久久国际精品| 欧美日韩国产三级| 粉嫩aⅴ一区二区三区四区| 午夜欧美在线一二页| 欧美激情中文字幕一区二区| 555夜色666亚洲国产免| 99久久久国产精品免费蜜臀| 麻豆精品在线看| 亚洲黄色免费网站| 亚洲国产精品99久久久久久久久| 宅男噜噜噜66一区二区66| 99免费精品在线观看| 激情综合网最新| 日韩中文字幕91| 亚洲激情自拍视频| 中文字幕制服丝袜一区二区三区| 91精品国产一区二区三区香蕉| 一本大道久久a久久综合婷婷| 激情综合亚洲精品| 日本欧美久久久久免费播放网| 亚洲视频资源在线| 亚洲国产岛国毛片在线| 欧美精品一区二区精品网| 欧美日韩激情一区二区| 色狠狠色狠狠综合| 成人永久aaa| 国产成人综合网站| 国产一区二区中文字幕| 欧美a级理论片| 天涯成人国产亚洲精品一区av| 亚洲欧美偷拍卡通变态| 国产精品美女久久久久aⅴ国产馆| 欧美大片在线观看一区二区| 欧美一区二区三区日韩视频| 精品视频资源站| 欧美视频三区在线播放| 在线观看免费亚洲| 欧美日韩视频在线观看一区二区三区 | 麻豆精品视频在线观看| 午夜成人在线视频| 亚洲r级在线视频| 亚洲国产一区二区视频| 亚洲6080在线| 日精品一区二区| 久久66热re国产| 国产一区二区三区黄视频| 国产高清精品网站| 不卡区在线中文字幕| 成人在线视频首页| 色综合天天综合网天天狠天天| 91日韩在线专区| 欧美系列在线观看| 欧美一卡在线观看| 久久久久久久av麻豆果冻| 国产人伦精品一区二区| 专区另类欧美日韩| 亚洲国产精品久久久男人的天堂| 五月天丁香久久| 国模冰冰炮一区二区| 99久久99久久精品免费看蜜桃| 色婷婷综合久久久久中文| 欧美三级韩国三级日本一级| 欧美疯狂性受xxxxx喷水图片| 日韩亚洲欧美成人一区| 久久久不卡影院| 一区二区三区四区蜜桃| 麻豆精品在线视频| 99精品桃花视频在线观看| 欧美日韩国产乱码电影| 久久理论电影网| 一区二区免费视频| 久久99精品国产麻豆婷婷洗澡| 国产69精品久久777的优势| 在线观看av一区| 26uuu欧美| 亚洲一区二区三区四区在线| 国产一区二区女| 欧美亚洲国产一区在线观看网站| 欧美高清精品3d| 国产精品不卡在线| 蜜臀精品久久久久久蜜臀| 成人免费视频视频| 日韩一级视频免费观看在线| 国产精品色婷婷| 美脚の诱脚舐め脚责91| 色婷婷国产精品综合在线观看| 日韩午夜中文字幕| 亚洲综合999| 成人黄色免费短视频| 日韩一区二区在线看| 亚洲女同女同女同女同女同69| 久久不见久久见免费视频7| 色婷婷av一区二区三区之一色屋| 精品国产一区二区三区忘忧草| 亚洲图片你懂的| 国产精品自拍三区| 日韩美女一区二区三区四区| 夜夜嗨av一区二区三区中文字幕| 久久66热re国产| 6080国产精品一区二区| 亚洲激情在线激情| 成人av电影在线| 亚洲精品一区二区三区四区高清| 亚洲午夜一区二区| 色综合久久天天| 国产精品久久久久久久午夜片| 精久久久久久久久久久| 欧美久久一区二区| 亚洲电影一级片| 欧美亚男人的天堂| 亚洲精品视频免费看| 成人黄色网址在线观看| 国产欧美精品在线观看| 国内精品视频一区二区三区八戒| 日韩一级高清毛片| 日本网站在线观看一区二区三区| 欧美日韩在线播放| 午夜影视日本亚洲欧洲精品| 日本久久电影网| 亚洲一区中文在线| 欧美日韩一区在线| 日韩中文欧美在线| 欧美大白屁股肥臀xxxxxx| 免费成人性网站|