/* * Copyright (c) 2009 Xilinx, Inc. All rights reserved. * * Xilinx, Inc. * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR * STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. * */ /* * helloworld.c: simple test application */ #include #include #include #include #include #include "xil_mmu.h" #define CDMA_BASE_ADDR 0x60000000 #define MY_SIZE_BYTE 64 /* Write to memory location or register */ #define X_mWriteReg(BASE_ADDRESS, RegOffset, data) \ *(unsigned int *)(BASE_ADDRESS + RegOffset) = ((unsigned int) data); /* Read from memory location or register */ #define X_mReadReg(BASE_ADDRESS, RegOffset) \ *(unsigned int *)(BASE_ADDRESS + RegOffset); int main() { char * srcDMA = (char *) 0x80000000; // from BRAM char * srcCPU = (char *) 0x70000000; // from BRAM char * dstDMA = (char *) 0xFFFF8000; // to OCM char * dstCPU = (char *) 0xFFFF8000; // to OCM volatile unsigned int i; volatile int value; unsigned int addresList[] = {0x0,0x18,0x20,0x28,0x4}; /* S=b1 TEX=b100 AP=b11, Domain=b0, C=b1, B=b1 */ Xil_SetTlbAttributes(0xFFF00000,0x14c0e); xil_printf("\n\rHello World"); xil_printf("\n\rsrcCPU addr = 0x%x",(unsigned int)srcCPU); xil_printf("\n\rsrcDMA addr = 0x%x",(unsigned int)srcDMA); xil_printf("\n\rdst addr = 0x%x",(unsigned int)dstCPU); value = X_mReadReg(0xF8000910,0x0); xil_printf("\n\r0x%x = 0x%x",0xF8000910,value); value = X_mReadReg(0xF8F00000,0x0); xil_printf("\n\r0x%x = 0x%x",0xF8000000,value); value = X_mReadReg(0xF8F00040,0x0); xil_printf("\n\r0x%x = 0x%x",0xF8000040,value); value = X_mReadReg(0xF8F00044,0x0); xil_printf("\n\r0x%x = 0x%x",0xF8000044,value); for (i=0; i