Changeset 333 for soft/giet_vm
- Timestamp:
- Jun 19, 2014, 1:31:45 PM (11 years ago)
- Location:
- soft/giet_vm/giet_drivers
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/bdv_driver.c
r320 r333 136 136 _bdv_set_register( BLOCK_DEVICE_LBA , lba ); 137 137 138 #if GIET_DEBUG_IOC_DRIVER 139 _printf("\n[BDV DEBUG] _bdv_access() : config registers set\n"); 140 #endif 141 138 142 // In BOOT mode, we launch transfer, and poll the BDV_STATUS 139 143 // register because IRQs are masked. … … 144 148 else _bdv_set_register( BLOCK_DEVICE_OP, BLOCK_DEVICE_READ ); 145 149 150 #if GIET_DEBUG_IOC_DRIVER 151 _printf("\n[BDV DEBUG] _bdv_access() : transfert lauched in polling mode\n"); 152 #endif 146 153 unsigned int status; 147 154 do … … 185 192 // enters critical section 186 193 _it_disable( &save_sr ); 187 188 194 189 195 // set _bdv_gtid and reset runnable … … 195 201 else _bdv_set_register( BLOCK_DEVICE_OP, BLOCK_DEVICE_READ ); 196 202 203 #if GIET_DEBUG_IOC_DRIVER 204 _printf("\n[BDV DEBUG] _bdv_access() : transfert lauched in interrupt mode\n"); 205 #endif 197 206 // deschedule task 198 207 _ctx_switch(); -
soft/giet_vm/giet_drivers/dma_driver.c
r320 r333 21 21 // 22 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_id23 // SEG_DMA_BASE + cluster_xy * PERI_CLUSTER_INCREMENT + DMA_SPAN * channel_id 24 24 // 25 25 // The SEG_DMA_BASE virtual address mus be defined in the hard_config.h file. … … 57 57 #endif 58 58 59 #if !defined( VSEG_CLUSTER_INCREMENT)60 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file59 #if !defined(PERI_CLUSTER_INCREMENT) 60 # error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file 61 61 #endif 62 62 … … 83 83 // compute DMA base address 84 84 unsigned int* dma_address = (unsigned int*) ( SEG_DMA_BASE + 85 (cluster_xy * VSEG_CLUSTER_INCREMENT) );85 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 86 86 87 87 // disable interrupt for selected channel … … 111 111 // compute DMA base address 112 112 unsigned int* dma_address = (unsigned int*) ( SEG_DMA_BASE + 113 (cluster_xy * VSEG_CLUSTER_INCREMENT) );113 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 114 114 115 115 // reset selected channel … … 138 138 // compute DMA base address 139 139 unsigned int * dma_address = (unsigned int *) ( SEG_DMA_BASE + 140 (cluster_xy * VSEG_CLUSTER_INCREMENT) );140 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 141 141 142 142 // get selected channel status … … 169 169 // compute DMA base address 170 170 unsigned int * dma_address = (unsigned int *) ( SEG_DMA_BASE + 171 (cluster_xy * VSEG_CLUSTER_INCREMENT) );171 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 172 172 173 173 // selected channel configuration and lauching … … 308 308 309 309 #else // NB_DMA_CHANNELS == 0 310 _printf("\n[GIET ERROR] in _dma_copy() : NB_DMA_CHANNELS = 0 !\n"); 310 _printf("\n[GIET ERROR] in _dma_copy() : NB_DMA_CHANNELS == 0 / cycle %d\n", 311 _get_proctime ); 311 312 _exit(); 312 313 #endif … … 320 321 unsigned int channel ) 321 322 { 322 _printf("\n[GIET ERROR] _dma_isr() not implemented\n"); 323 _printf("\n[GIET ERROR] _dma_isr() not implemented / cycle %d\n", 324 _get_proctime() ); 323 325 _exit(); 324 326 } -
soft/giet_vm/giet_drivers/icu_driver.c
r320 r333 15 15 //////////////////////////////////////////////////////////////////////////////// 16 16 // The virtual base address of the segment associated to the component is: 17 // SEG_ICU_BASE + cluster_xy * VSEG_CLUSTER_INCREMENT17 // SEG_ICU_BASE + cluster_xy * PERI_CLUSTER_INCREMENT 18 18 // 19 // SEG_ICU_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h19 // SEG_ICU_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h 20 20 //////////////////////////////////////////////////////////////////////////////// 21 21 … … 53 53 #endif 54 54 55 #if !defined( VSEG_CLUSTER_INCREMENT)56 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file55 #if !defined(PERI_CLUSTER_INCREMENT) 56 # error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file 57 57 #endif 58 58 … … 80 80 #else 81 81 unsigned int * icu_address = (unsigned int *) ( SEG_ICU_BASE + 82 (cluster_xy * VSEG_CLUSTER_INCREMENT) );82 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 83 83 icu_address[proc_id * ICU_SPAN + ICU_MASK_SET] = value; 84 84 return 0; … … 108 108 #else 109 109 unsigned int * icu_address = (unsigned int *) ( SEG_ICU_BASE + 110 (cluster_xy * VSEG_CLUSTER_INCREMENT) );110 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 111 111 *buffer = icu_address[proc_id * ICU_SPAN + ICU_IT_VECTOR]; 112 112 return 0; -
soft/giet_vm/giet_drivers/mmc_driver.c
r320 r333 12 12 // 13 13 // The (virtual) base address of the associated segment is: 14 // SEG_MMC_BASE + cluster_id * VSEG_CLUSTER_INCREMENT14 // SEG_MMC_BASE + cluster_id * PERI_CLUSTER_INCREMENT 15 15 // 16 // SEG_MMC_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h.16 // SEG_MMC_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h. 17 17 //////////////////////////////////////////////////////////////////////////////// 18 18 … … 42 42 #endif 43 43 44 #if !defined( VSEG_CLUSTER_INCREMENT)45 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file44 #if !defined(PERI_CLUSTER_INCREMENT) 45 # error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file 46 46 #endif 47 47 … … 68 68 69 69 unsigned int* mmc_address = (unsigned int*)( SEG_MMC_BASE + 70 (cluster_xy * VSEG_CLUSTER_INCREMENT) );70 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 71 71 72 72 // get the hard lock protecting exclusive access to MEMC … … 104 104 105 105 unsigned int* mmc_address = (unsigned int*)( SEG_MMC_BASE + 106 (cluster_xy * VSEG_CLUSTER_INCREMENT) );106 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 107 107 108 108 // get the hard lock protecting exclusive access to MEMC -
soft/giet_vm/giet_drivers/mwr_driver.c
r320 r333 11 11 // 12 12 // The (virtual) base address of the associated segment is: 13 // SEG_MWR_BASE + cluster_xy * VSEG_CLUSTER_INCREMENT13 // SEG_MWR_BASE + cluster_xy * PERI_CLUSTER_INCREMENT 14 14 // 15 // SEG_MWR_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h15 // SEG_MWR_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h 16 16 //////////////////////////////////////////////////////////////////////////////// 17 17 … … 41 41 #endif 42 42 43 #if !defined( VSEG_CLUSTER_INCREMENT)44 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file43 #if !defined(PERI_CLUSTER_INCREMENT) 44 # error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file 45 45 #endif 46 46 … … 75 75 // compute base address 76 76 unsigned int* mwr_address = (unsigned int*) ( SEG_MWR_BASE + 77 (cluster_xy * VSEG_CLUSTER_INCREMENT) );77 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 78 78 79 79 unsigned int lsb = (unsigned int)channel_pbase; -
soft/giet_vm/giet_drivers/nic_driver.c
r320 r333 93 93 unsigned int length ) 94 94 { 95 _printf("[GIET ERROR] _nic_sync_write function not implemented\n"); 95 _printf("[GIET ERROR] _nic_sync_write function not implemented / cycle %d\n", 96 _get_proctime() ); 96 97 _exit(); 97 98 98 // unsigned char* nic_address = (unsigned char *) &seg_nic_base;99 // memcpy((void *) nic_address, (void *) buffer, length);100 99 return 0; 101 100 } … … 108 107 unsigned int length ) 109 108 { 110 _printf("[GIET ERROR] _nic_sync_read function not implemented\n"); 109 _printf("[GIET ERROR] _nic_sync_read function not implemented / cycle %d\n", 110 _get_proctime() ); 111 111 _exit(); 112 112 113 // unsigned char* nic_address = (unsigned char *) &seg_nic_base;114 // memcpy((void *) buffer, (void *) nic_address, length);115 113 return 0; 116 114 } … … 120 118 unsigned int _nic_cma_start( ) 121 119 { 122 _printf("[GIET ERROR] _nic_cma_start() not implemented\n"); 120 _printf("[GIET ERROR] _nic_cma_start() not implemented / cycle %d\n", 121 _get_proctime() ); 123 122 _exit(); 124 123 125 // unsigned char* nic_address = (unsigned char *) &seg_nic_base;126 124 return 0; 127 125 } … … 131 129 unsigned int _nic_cma_stop() 132 130 { 133 _printf("[GIET ERROR] _nic_cma_stop() not implemented\n"); 131 _printf("[GIET ERROR] _nic_cma_stop() not implemented / cycle %d\n", 132 _get_proctime() ); 134 133 _exit(); 135 134 136 // unsigned char* nic_address = (unsigned char *) &seg_nic_base;137 135 return 0; 138 136 } … … 145 143 unsigned int channel ) 146 144 { 147 _printf("[GIET ERROR] _nic_rx_isr() not implemented\n"); 145 _printf("[GIET ERROR] _nic_rx_isr() not implemented / cycle %d\n", 146 _get_proctime() ); 148 147 _exit(); 149 148 } … … 156 155 unsigned int channel ) 157 156 { 158 _printf("[GIET ERROR] _nic_tx_isr() not implemented\n"); 157 _printf("[GIET ERROR] _nic_tx_isr() not implemented / cycle %d\n", 158 _get_proctime() ); 159 159 _exit(); 160 160 } -
soft/giet_vm/giet_drivers/tim_driver.c
r320 r333 21 21 // 22 22 // The virtual base address of the segment associated to a channel is: 23 // SEG_TIM_BASE + cluster_xy * VSEG_CLUSTER_INCREMENT + TIMER_SPAN * timer_id24 // 25 // The SEG_TIM_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h.23 // SEG_TIM_BASE + cluster_xy * PERI_CLUSTER_INCREMENT + TIMER_SPAN * timer_id 24 // 25 // The SEG_TIM_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h. 26 26 ///////////////////////////////////////////////////////////////////////////////////// 27 27 … … 36 36 #endif 37 37 38 #if !defined( VSEG_CLUSTER_INCREMENT)39 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file38 #if !defined(PERI_CLUSTER_INCREMENT) 39 # error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file 40 40 #endif 41 41 … … 99 99 100 100 unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE + 101 (cluster_xy * VSEG_CLUSTER_INCREMENT) );101 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 102 102 103 103 timer_address[local_id * TIMER_SPAN + TIMER_PERIOD] = period; … … 130 130 131 131 unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE + 132 (cluster_xy * VSEG_CLUSTER_INCREMENT) );132 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 133 133 134 134 timer_address[local_id * TIMER_SPAN + TIMER_MODE] = 0; … … 162 162 163 163 unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE + 164 (cluster_xy * VSEG_CLUSTER_INCREMENT) );164 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 165 165 166 166 timer_address[local_id * TIMER_SPAN + TIMER_RESETIRQ] = 0; … … 196 196 // We suppose that the TIMER_MODE register value is 0x3 197 197 unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE + 198 (cluster_xy * VSEG_CLUSTER_INCREMENT) );198 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 199 199 200 200 unsigned int period = timer_address[local_id * TIMER_SPAN + TIMER_PERIOD]; -
soft/giet_vm/giet_drivers/tty_driver.c
r320 r333 152 152 153 153 ////////////////////////////////////////////////////////////////////////////// 154 // This function try to take the hardwiredlock protecting154 // This function try to take the lock protecting 155 155 // exclusive access to TTY terminal identified by the "channel" argument. 156 156 // It enters a critical section before taking the lock, and save the SR value … … 162 162 { 163 163 if( channel >= NB_TTY_CHANNELS ) _exit(); 164 165 164 _it_disable( save_sr_ptr ); 166 167 // while ( _tty_get_register( channel, TTY_CONFIG ) ); // busy waiting168 169 165 _get_lock( &_tty_lock[channel] ); 170 166 } … … 180 176 { 181 177 if( channel >= NB_TTY_CHANNELS ) _exit(); 182 183 // _tty_set_register( channel, TTY_CONFIG, 0 );184 185 178 _release_lock( &_tty_lock[channel] ); 186 187 179 _it_restore( save_sr_ptr ); 188 180 } -
soft/giet_vm/giet_drivers/xcu_driver.c
r320 r333 7 7 // This peripheral is replicated in aall clusters containing processors. 8 8 // 9 // SEG_XCU_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h file.9 // SEG_XCU_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h file. 10 10 /////////////////////////////////////////////////////////////////////////////////// 11 11 … … 45 45 #endif 46 46 47 #if !defined( VSEG_CLUSTER_INCREMENT )48 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file47 #if !defined( PERI_CLUSTER_INCREMENT ) 48 # error: You must define PERI_CLUSTER_INCREMENT in the hard_config.h file 49 49 #endif 50 50 … … 69 69 70 70 unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE + 71 (cluster_xy * VSEG_CLUSTER_INCREMENT) );71 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 72 72 73 73 unsigned int func; … … 111 111 112 112 unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE + 113 (cluster_xy * VSEG_CLUSTER_INCREMENT) );113 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 114 114 115 115 unsigned int prio = xcu_address[XCU_REG(XCU_PRIO,channel)]; … … 163 163 164 164 unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE + 165 (cluster_xy * VSEG_CLUSTER_INCREMENT) );165 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 166 166 167 167 xcu_address[XCU_REG(XCU_WTI_REG,wti_index)] = wdata; … … 192 192 193 193 unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE + 194 (cluster_xy * VSEG_CLUSTER_INCREMENT) );194 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 195 195 196 196 *value = xcu_address[XCU_REG(XCU_WTI_REG, wti_index)]; … … 240 240 241 241 unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE + 242 (cluster_xy * VSEG_CLUSTER_INCREMENT) );242 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 243 243 244 244 xcu_address[XCU_REG(XCU_PTI_PER, pti_index)] = period; … … 265 265 266 266 unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE + 267 (cluster_xy * VSEG_CLUSTER_INCREMENT) );267 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 268 268 269 269 xcu_address[XCU_REG(XCU_PTI_PER, pti_index)] = 0; … … 292 292 293 293 unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE + 294 (cluster_xy * VSEG_CLUSTER_INCREMENT) );294 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 295 295 296 296 // This return value is not used / avoid a compilation warning. … … 323 323 324 324 unsigned int* xcu_address = (unsigned int *) ( SEG_XCU_BASE + 325 (cluster_xy * VSEG_CLUSTER_INCREMENT) );325 (cluster_xy * PERI_CLUSTER_INCREMENT) ); 326 326 327 327 unsigned int period = xcu_address[XCU_REG(XCU_PTI_PER, pti_index)];
Note: See TracChangeset
for help on using the changeset viewer.