vme dma ???

lee funnyvoice at tlabs.ac.za
Tue Sep 22 15:53:38 UTC 2009


Hi everyone...

Im bit stuck...

im trying to do a simple vme dma read using the VMEDMA.h api... 

Here is my "read dma" function...

int mvme_read_dma(MVME_INTERFACE *mvme, void *dst, mvme_addr_t vme_addr,
mvme_size_t n_bytes)
{
	int rval;
	int status;
	volatile uint32_t* plocal = 0x90000000;

	//plocal = calloc(n_bytes, sizeof(uint32_t));
    
  
	status = BSP_VMEDmaStatus(DMACHANNEL);
	printf("mvme_read_dma: BSP_VMEDmaStatus = %d \n",status );
	printf("[mvme_read_dma] am %d , dmode %d \n",mvme->am,mvme->dmode );

	/* DMA direct transfer Setup */	
	uint32_t mode = ( mvme->am | mvme->dmode| BSP_VMEDMA_MODE_NOINC_VME  );
	rval = BSP_VMEDmaSetup( DMACHANNEL, rtemsVmeDmaBusMode, mode, 0 );
	printf("[mvme_read_dma] BSP_VMEDmaSetup %d \n",rval );

	if( rval != 0 ){
		printf("[mvme_read_dma]: error BSP_VMEDmaSetup rval = %d vme_addr %08x
n_bytes %d \n",rval,vme_addr,n_bytes );
		printf("[mvme_read_dma]: dma status %d
\n",BSP_VMEDmaStatus(DMACHANNEL));
		return(MVME_ERROR);
	}
	
	/* DMA start the transfer */
	rval = BSP_VMEDmaStart( DMACHANNEL, plocal, vme_addr, n_bytes );
	int i = 0;

	printf("[mvme_read_dma]: dma status %d
\n",BSP_VMEDmaStatus(DMACHANNEL));


	if( rval != 0 ){
		printf("[mvme_read_dma]: error BSP_VMEDmaStart rval = %d , vme_addr %
8x, plocal %p, n_bytes %d \n",rval,vme_addr,plocal,n_bytes );
		printf("[mvme_read_dma]: dma status %d
\n",BSP_VMEDmaStatus(DMACHANNEL));

		return(MVME_ERROR);
	}

	memcpy(dst,&plocal,n_bytes);
	return(MVME_SUCCESS);
}



and here is my output:

mvme_read_dma: BSP_VMEDmaStatus = 0
[mvme_read_dma] am 15 , dmode 3
[mvme_read_dma] BSP_VMEDmaSetup 0
[mvme_read_dma]: dma status 3
Error reading data:
[read_v792] Error in dma transfer, nentries 128
 [0] w  = 0x00000000
  [1] w  = 0x00000000
  [2] w  = 0x00000000
  [3] w  = 0x00000000
  [4] w  = 0x00000000
  [5] w  = 0x00000000
  [6] w  = 0x00000000
  [7] w  = 0x00000000
  [8] w  = 0x00000000
  [9] w  = 0x00000000
  [10] w  = 0x00000000
  [11] w  = 0x00000000
  [12] w  = 0x00000000
  [13] w  = 0x00000000
  [14] w  = 0x00000000
  [15] w  = 0x00000000
  [16] w  = 0x00000000
  [17] w  = 0x00000000
  [18] w  = 0x00000000
  [19] w  = 0x00000000
  [20] w  = 0x00000000
  [21] w  = 0x00000000
  [22] w  = 0x00000000
  [23] w  = 0x00000000
  [24] w  = 0x00000000
  [25] w  = 0x00000000
  [26] w  = 0x00000000
  [27] w  = 0x00000000
  [28] w  = 0x00000000
  [29] w  = 0x00000000
  [30] w  = 0x00000000
  [31] w  = 0x00000000
  [32] w  = 0x00000000
  [33] w  = 0x00000000
  [34] w  = 0x00000000
  [35] w  = 0x00000000
  [36] w  = 0x00000000
  [37] w  = 0x00000000
  [38] w  = 0x00000000
  [39] w  = 0x00000000
  [40] w  = 0x00000000
  [41] w  = 0x00000000
  [42] w  = 0x00000000
  [43] w  = 0x00000000
  [44] w  = 0x00000000
  [45] w  = 0x00000000
  [46] w  = 0x00000000
  [47] w  = 0x00000000
  [48] w  = 0x00000000
  [49] w  = 0x00000000
  [50] w  = 0x00000000
  [51] w  = 0x00000000
  [52] w  = 0x00000000
  [53] w  = 0x00000000
  [54] w  = 0x00000000
  [55] w  = 0x00000000
  [56] w  = 0x00000000
  [57] w  = 0x00000000
  [58] w  = 0x00000000
  [59] w  = 0x00000000
  [60] w  = 0x00000000
  [61] w  = 0x00000000
  [62] w  = 0x00000000
  [63] w  = 0x00000000
  [64] w  = 0x00000000
  [65] w  = 0x00000000
  [66] w  = 0x00000000
  [67] w  = 0x00000000
  [68] w  = 0x00000000
  [69] w  = 0x00000000
  [70] w  = 0x00000000
  [71] w  = 0x00000000
  [72] w  = 0x00000000
  [73] w  = 0x00000000
  [74] w  = 0x00000000
  [75] w  = 0x00000000
  [76] w  = 0x00000000
  [77] w  = 0x00000000
  [78] w  = 0x00000000
  [79] w  = 0x00000000
  [80] w  = 0x00000000
  [81] w  = 0x00000000
  [82] w  = 0x00000000
  [83] w  = 0x00000000
  [84] w  = 0x00000000
  [85] w  = 0x00000000
  [86] w  = 0x00000000
  [87] w  = 0x00000000
  [88] w  = 0x00000000
  [89] w  = 0x00000000
  [90] w  = 0x00000000
  [91] w  = 0x00000000
  [92] w  = 0x00000000
  [93] w  = 0x00000000
  [94] w  = 0x00000000
  [95] w  = 0x00000000
  [96] w  = 0x00000000
  [97] w  = 0x00000000
  [98] w  = 0x00000000
  [99] w  = 0x00000000
  [100] w  = 0x00000000
  [101] w  = 0x00000000
  [102] w  = 0x00000000
  [103] w  = 0x00000000
  [104] w  = 0x00003006
  [105] w  = 0x00000000
  [106] w  = 0x00003002
  [107] w  = 0x00650c98
  [108] w  = 0x0018ab30
  [109] w  = 0x387e264c
  [110] w  = 0x000e1012
  [111] w  = 0x00000000
  [112] w  = 0x00003002
  [113] w  = 0x001cd100
  [114] w  = 0x0857f9ac
  [115] w  = 0x00000002
  [116] w  = 0x00000000
  [117] w  = 0x00650cb0
  [118] w  = 0x0010303d
  [119] w  = 0x0857f9ac
  [120] w  = 0x000e100e
  [121] w  = 0x00000004
  [122] w  = 0x005c5918
  [123] w  = 0x00650cd8
  [124] w  = 0x0857f9ac
  [125] w  = 0x00650ce0
  [126] w  = 0x00101f81
  [127] w  = 0x0857f9ac
 [mvme_read] ############## DMA TRANSFER #############
mvme_read_dma: BSP_VMEDmaStatus = 0
[mvme_read_dma] am 15 , dmode 3
[mvme_read_dma] BSP_VMEDmaSetup 0
[mvme_read_dma]: dma status 3
Error reading data:
[read_v792] Error in dma transfer, nentries 128
 [0] w  = 0x00000000
  [1] w  = 0x00000000
  [2] w  = 0x00000000
  [3] w  = 0x00000000
  [4] w  = 0x00000000
  [5] w  = 0x00000000
  [6] w  = 0x00000000
  [7] w  = 0x00000000
  [8] w  = 0x00000000
  [9] w  = 0x00000000
  [10] w  = 0x00000000
  [11] w  = 0x00000000
  [12] w  = 0x00000000
  [13] w  = 0x00000000

little bit stuck on what is causing this!? anyone any ideas?

Lee








More information about the users mailing list