Changeset 320 for soft/giet_vm/giet_drivers/dma_driver.c
- Timestamp:
- Jun 10, 2014, 12:33:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/dma_driver.c
r313 r320 18 18 // there is no lock protecting exclusive access to the channel. 19 19 // As the kernel uses a polling policy on the DMA_STATUS register to detect 20 // transfer completion, the DMA IRQ is not used, and there is no DMA_ISR. 20 // transfer completion, the DMA IRQ is not used. 21 // 22 // The virtual base address of the segment associated to a channel is: 23 // SEG_DMA_BASE + cluster_xy * vseg_cluster_increment + DMA_SPAN * channel_id 24 // 25 // The SEG_DMA_BASE virtual address mus be defined in the hard_config.h file. 21 26 //////////////////////////////////////////////////////////////////////////////////// 22 // The virtual base address of the segment associated to a channel is:23 //24 // seg_dma_base + cluster_xy * vseg_cluster_increment + DMA_SPAN * channel_id25 //26 ////////////////////////////////////////////////////////////////////////////////////27 27 28 28 #include <giet_config.h> 29 #include <hard_config.h> 29 30 #include <dma_driver.h> 30 #include <utils.h>31 31 #include <tty_driver.h> 32 32 #include <vmem.h> 33 #include <utils.h> 33 34 34 35 #if !defined(X_SIZE) … … 50 51 #if !defined(NB_DMA_CHANNELS) 51 52 # error: You must define NB_DMA_CHANNELS in the hard_config.h file 53 #endif 54 55 #if !defined(SEG_DMA_BASE) 56 # error: You must define SEG_DMA_BASE in the hard_config.h file 57 #endif 58 59 #if !defined(VSEG_CLUSTER_INCREMENT) 60 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file 52 61 #endif 53 62 … … 73 82 74 83 // compute DMA base address 75 unsigned int* dma_address = (unsigned int*) ( (unsigned int)&seg_dma_base+76 (cluster_xy * (unsigned int)&vseg_cluster_increment));84 unsigned int* dma_address = (unsigned int*) ( SEG_DMA_BASE + 85 (cluster_xy * VSEG_CLUSTER_INCREMENT) ); 77 86 78 87 // disable interrupt for selected channel … … 101 110 102 111 // compute DMA base address 103 unsigned int* dma_address = (unsigned int*) ( (unsigned int)&seg_dma_base+104 (cluster_xy * (unsigned int)&vseg_cluster_increment));112 unsigned int* dma_address = (unsigned int*) ( SEG_DMA_BASE + 113 (cluster_xy * VSEG_CLUSTER_INCREMENT) ); 105 114 106 115 // reset selected channel … … 128 137 129 138 // compute DMA base address 130 unsigned int * dma_address = (unsigned int *) ( (unsigned int)&seg_dma_base+131 (cluster_xy * (unsigned int)&vseg_cluster_increment));139 unsigned int * dma_address = (unsigned int *) ( SEG_DMA_BASE + 140 (cluster_xy * VSEG_CLUSTER_INCREMENT) ); 132 141 133 142 // get selected channel status … … 159 168 160 169 // compute DMA base address 161 unsigned int * dma_address = (unsigned int *) ( (unsigned int)&seg_dma_base+162 (cluster_xy * (unsigned int)&vseg_cluster_increment));170 unsigned int * dma_address = (unsigned int *) ( SEG_DMA_BASE + 171 (cluster_xy * VSEG_CLUSTER_INCREMENT) ); 163 172 164 173 // selected channel configuration and lauching … … 304 313 } // end _dma_copy 305 314 315 /////////////////////////////////////////////////////////////////////////////// 316 // This ISR handles the IRQ generated by a DMA channel. 317 /////////////////////////////////////////////////////////////////////////////// 318 void _dma_isr( unsigned int irq_type, 319 unsigned int irq_id, 320 unsigned int channel ) 321 { 322 _printf("\n[GIET ERROR] _dma_isr() not implemented\n"); 323 _exit(); 324 } 325 306 326 307 327
Note: See TracChangeset
for help on using the changeset viewer.