diff --git a/software/common/validation/dma_tests.c b/software/common/validation/dma_tests.c index 87221a77bce470a078f89bd6703569ffd73c466d..e6a13ce3df233f55fb278d5bb4a862c6aa7a1828 100644 --- a/software/common/validation/dma_tests.c +++ b/software/common/validation/dma_tests.c @@ -297,7 +297,7 @@ void dma_memory_copy (unsigned int src, unsigned int dest, unsigned int size, un (size << 21) | /* dst_prot_ctrl - HPROT[3:1] */ (size << 18) | /* src_prot_ctrl - HPROT[3:1] */ // (0 << 14) | /* R_power */ - (4 << 14) | /* R_power for 16-word block transfer*/ + (4 << 14) | /* R_power set for up to 16 transfers */ ((num-1)<< 4) | /* n_minus_1 */ (0 << 3) | /* next_useburst */ (2 << 0) ; /* cycle_ctrl - auto */ @@ -356,6 +356,21 @@ int dma_simple_test(void) } } +// then as 16 byte transfers + dma_memory_copy ((unsigned int) &source_data_array[0],(unsigned int) &dest_data_array[0], 0, 16); + do { /* Wait until PL230 DMA controller return to idle state */ + current_state = (CMSDK_DMA->DMA_STATUS >> 4) & 0xF; + } while (current_state!=0); + + for (i=0;i<4;i++) { + /* Debugging printf: */ + /*printf (" - dest[i] = %x\n", dest_data_array[i]);*/ + if (dest_data_array[i]!= i){ + printf ("ERROR:dest_data_array[%d], expected %x, actual %x\n", i, i, dest_data_array[i]); + err_code |= (1<<i); + } + } + /* Generate return value */ if (err_code != 0) { printf ("ERROR : simple DMA failed (0x%x)\n", err_code);