Changeset 297 for soft/giet_vm/giet_drivers
- Timestamp:
- Mar 28, 2014, 10:48:51 AM (11 years ago)
- Location:
- soft/giet_vm/giet_drivers
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/bdv_driver.c
r295 r297 304 304 unsigned int lpid = procid % NB_PROCS_MAX; 305 305 306 // acknowledge WTI in local XCU if required 307 unsigned int value; 308 if ( irq_type == IRQ_TYPE_WTI ) _xcu_get_wti_value( cluster_xy, irq_id, &value ); 309 310 // save status in _bdv_status variable and reset IRQ 311 _bdv_status = _bdv_get_register( BLOCK_DEVICE_STATUS ); 306 // get BDV status (and reset IRQ) 307 unsigned int status = _bdv_get_register( BLOCK_DEVICE_STATUS ); 308 309 // check status: does nothing if IDLE or BUSY 310 if ( (status == BLOCK_DEVICE_IDLE) || 311 (status == BLOCK_DEVICE_BUSY) ) return; 312 313 // reset WTI in XCU if WTI type 314 if ( irq_type == IRQ_TYPE_WTI ) 315 { 316 unsigned int value; 317 _xcu_get_wti_value( cluster_xy, irq_id, &value ); 318 } 319 320 // save status in kernel buffer _bdv_status 321 _bdv_status = status; 312 322 313 323 // identify task waiting on BDV … … 315 325 unsigned int ltid = _bdv_gtid & 0xFFFF; 316 326 unsigned int remote_xy = rprocid / NB_PROCS_MAX; 327 328 // re-activates sleeping task 329 _set_task_slot( rprocid, // global processor index 330 ltid, // local task index on processor 331 CTX_RUN_ID, // CTX_RUN slot 332 1 ); // running 333 334 // requires a context switch for remote processor running the waiting task 335 _xcu_send_wti( remote_xy, // cluster index 336 lpid, // local processor index 337 0 ); // don't force context switch if not idle 317 338 318 339 #if GIET_DEBUG_IRQS // we don't take the TTY lock to avoid deadlock … … 343 364 #endif 344 365 345 // re-activates sleeping task346 _set_task_slot( rprocid, // global processor index347 ltid, // local task index on processor348 CTX_RUN_ID, // CTX_RUN slot349 1 ); // running350 351 // requires a context switch for remote processor running the waiting task352 _xcu_send_wti( remote_xy, // cluster index353 lpid, // local processor index354 0 ); // don't force context switch if not idle355 366 } 356 367 -
soft/giet_vm/giet_drivers/fbf_driver.c
r295 r297 258 258 { 259 259 // SYNC request for channel descriptor 260 _m emc_sync( desc_paddr, 32 );260 _mmc_sync( desc_paddr, 32 ); 261 261 } 262 262 … … 320 320 { 321 321 // INVAL L2 cache for the channel descriptor, 322 _m emc_inval( _fb_cma_desc_paddr[channel_id], 32 );322 _mmc_inval( _fb_cma_desc_paddr[channel_id], 32 ); 323 323 324 324 // INVAL L1 cache for the channel descriptor, … … 339 339 // SYNC request for the user buffer because 340 340 // this buffer will be read from XRAM by the CMA component 341 _m emc_sync( buf_paddr, _fb_cma_channel[channel_id].length );341 _mmc_sync( buf_paddr, _fb_cma_channel[channel_id].length ); 342 342 } 343 343 … … 356 356 // SYNC request for the channel descriptor, because 357 357 // it will be read in XRAM by the CMA component 358 _m emc_sync( _fb_cma_desc_paddr[channel_id], 32 );358 _mmc_sync( _fb_cma_desc_paddr[channel_id], 32 ); 359 359 } 360 360 -
soft/giet_vm/giet_drivers/ioc_driver.c
r295 r297 286 286 287 287 // L2 cache (only if IOB used) 288 if ( USE_IOB ) _m emc_inval( buf_paddr, length );288 if ( USE_IOB ) _mmc_inval( buf_paddr, length ); 289 289 } 290 290 else // memory read : update data caches … … 293 293 294 294 // L2 cache (only if IOB used) 295 if ( USE_IOB ) _m emc_sync( buf_paddr, length );295 if ( USE_IOB ) _mmc_sync( buf_paddr, length ); 296 296 } 297 297 -
soft/giet_vm/giet_drivers/mmc_driver.c
r295 r297 41 41 42 42 /////////////////////////////////////////////////////////////////////////////////// 43 // _memc_inval()44 43 // This function invalidates all cache lines covering a memory buffer defined 45 44 // by the physical base address, and the length. 46 45 // The buffer address MSB are used to compute the cluster index. 47 46 /////////////////////////////////////////////////////////////////////////////////// 48 void _m emc_inval( paddr_t buf_paddr,49 47 void _mmc_inval( paddr_t buf_paddr, 48 unsigned int buf_length ) 50 49 { 51 50 // compute cluster coordinates … … 78 77 } 79 78 /////////////////////////////////////////////////////////////////////////////////// 80 // _memc_sync()81 79 // This function copies to external RAM all cache lines covering a memory buffer 82 80 // defined by the physical base address, and the length, if they are dirty. 83 81 // The buffer address MSB are used to compute the cluster index. 84 82 /////////////////////////////////////////////////////////////////////////////////// 85 void _m emc_sync( paddr_t buf_paddr,86 83 void _mmc_sync( paddr_t buf_paddr, 84 unsigned int buf_length ) 87 85 { 88 86 // compute cluster coordinates … … 115 113 } 116 114 115 ////////////////////////////////////////////////////////////////////////////////// 116 // This ISR access the vci_mem_cache component to get the faulty physical 117 // address and the associated SRCID. It must also acknowledge the IRQ. 118 // 119 // TODO implement... 120 ////////////////////////////////////////////////////////////////////////////////// 121 void _mmc_isr( unsigned int irq_type, // should be HWI 122 unsigned int irq_id, // index returned by ICU 123 unsigned int channel ) // unused 124 { 125 _printf("[GIET ERROR] MMC IRQ received, but _mmc_isr() not implemented...\n"); 126 } 127 128 129 117 130 // Local Variables: 118 131 // tab-width: 4 -
soft/giet_vm/giet_drivers/mmc_driver.h
r258 r297 33 33 /////////////////////////////////////////////////////////////////////////////////// 34 34 35 extern void _m emc_inval( unsigned long long buf_paddr,36 35 extern void _mmc_inval( unsigned long long buf_paddr, 36 unsigned int buf_length ); 37 37 38 extern void _memc_sync( unsigned long long buf_paddr, 39 unsigned int buf_length); 38 extern void _mmc_sync( unsigned long long buf_paddr, 39 unsigned int buf_length); 40 41 extern void _mmc_isr( unsigned int irq_type, 42 unsigned int irq_id, 43 unsigned int channel ); 40 44 41 45 /////////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/giet_drivers/tty_driver.c
r295 r297 170 170 171 171 /////////////////////////////////////////////////////////////////////////////////// 172 // This ISR handles the IRQ signaling that the RX buffer is full.172 // This ISR handles the IRQ signaling that the RX buffer is not empty. 173 173 // IT can be an HWI or an SWI. 174 // There is one single multi_tty component controling all channels.175 174 // There is one communication buffer _tty_rx_buf[i] and one synchronisation 176 175 // variable _tty_rx_full[i] per channel. 177 // A character is lost if the buffer is full when the ISR is executed. 176 // Does nothing if the TTY_RX buffer is empty, or if the kernel buffer is full 177 // when the ISR is called. 178 178 /////////////////////////////////////////////////////////////////////////////////// 179 179 void _tty_rx_isr( unsigned int irq_type, // HWI / WTI … … 183 183 unsigned int cluster_xy = _get_procid() / NB_PROCS_MAX; 184 184 185 if ( irq_type == IRQ_TYPE_WTI ) // reset SWI in XCU if required 185 // get TTY status 186 unsigned int status = _tty_get_register( channel, TTY_STATUS ); 187 188 // check both TTY status and kernel buffer status: 189 // does nothing if kernel buffer full or tty_buffer empty 190 if ( ((status & 0x1) == 0) || 191 (_tty_rx_full[channel] != 0) ) return; 192 193 // reset WTI in XCU if WTI type 194 if ( irq_type == IRQ_TYPE_WTI ) 186 195 { 187 196 unsigned int value; 188 197 _xcu_get_wti_value( cluster_xy, irq_id, &value ); 189 198 } 190 191 // get character and reset TTY IRQ 192 _tty_rx_buf[channel] = _tty_get_register( channel, TTY_READ ); 199 200 // transfer character to kernel buffer and acknowledge TTY IRQ 201 _tty_rx_buf[channel] = _tty_get_register( channel, TTY_READ ); 202 203 // set kernel buffer status 204 asm volatile( "sync" ); 205 _tty_rx_full[channel] = 1; 193 206 194 207 #if GIET_DEBUG_IRQS // we don't take the TTY lock to avoid deadlock … … 209 222 #endif 210 223 211 // signals character available212 _tty_rx_full[channel] = 1;213 224 } 214 225
Note: See TracChangeset
for help on using the changeset viewer.