memdma_init.asm

来自「blackfin开发板 BF533-sdram_memdma开发代码 包括sdr」· 汇编 代码 · 共 85 行

ASM
85
字号
#include "defBF533.h"

.section L1_data_a;
.align 4;

/**************************************************************************************
	Memory DMA descriptor
**************************************************************************************/
.global MemDMAQueue;
MemDMAQueue:
.byte4 _MemDMAQueue[16];
MemDMAQueue.end:

.section L1_code;
.align 4;

/***************************************************************************************
	The sub_code initializes memory DMA descriptors
	Descriptors locates in the memory which label is MemDMAQueue
	Use p0 to store the address of the descriptor
	Use p1 to stroe the modify address
	The loop write the next descriptor address for each descriptor
	and the next descriptor address of the last descriptor points to 
	the first one 
***************************************************************************************/
.global memdma_init;
memdma_init:

	p0.h = hi(EBIU_AMBCTL0);
	p0.l = lo(EBIU_AMBCTL0);
	r0.l = 0x7bb0;
	r0.h = 0x7bb0;
	[p0] = r0;

	p0.h = hi(EBIU_AMBCTL1);
	p0.l = lo(EBIU_AMBCTL1);
	r0.l = 0x7bb0;
	r0.h = 0x7bb0;
	[p0] = r0;

	//Async Memory Global Control Register
	p0.h = hi(EBIU_AMGCTL);
	p0.l = lo(EBIU_AMGCTL);
	r0.l = w[p0];
	r1 = 0xf;
	r0 = r0 | r1;
	w[p0] = r1;		
	ssync;
	
	p0.l = 0x0000;
	p0.h = 0x2020;
	r0.l = 0x00ff;
	w[p0] = r0.l;
	
	p0.l = 0x0000;
	p0.h = 0x2022;
	w[p0] = r0.l;
	
	p0.l = 0x0000;
	p0.h = 0x2023;
	w[p0] = r0.l;
	
	p0.l = MemDMAQueue;
	p0.h = MemDMAQueue;
	p1 = 16(z);//modify address

	r0 = p0;
	r1 = p0;
	r0 += 16;
	
	p2 = 2;
	lsetup(start,end)lc0 = p2;
	start:
	r0 += 16;
	end:
	w[p0 ++ p1] = r0.l;//(++):   p0 + p1 post_modify
	
	w[p0 ++ p1] = r1.l;
	r1 += 16;
	[p0] = r1;
	
	rts;
memdma_init.end:	
	

⌨️ 快捷键说明

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