Changeset 283 for branch/giet_vm_ioc_drivers/giet_drivers/hba_driver.c
- Timestamp:
- Jan 31, 2014, 11:35:57 AM (11 years ago)
- Location:
- branch
- Files:
-
- 1 added
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branch/giet_vm_ioc_drivers/giet_drivers/hba_driver.c
r258 r283 124 124 { 125 125 volatile unsigned int* hba_address; 126 hba_address = (unsigned int*)(&seg_ hba_base) + (HBA_SPAN*channel);126 hba_address = (unsigned int*)(&seg_ioc_base) + (HBA_SPAN*channel); 127 127 128 128 if( channel >= NB_HBA_CHANNELS ) … … 146 146 { 147 147 volatile unsigned int* hba_address; 148 hba_address = (unsigned int*)(&seg_ hba_base) + (HBA_SPAN*channel);148 hba_address = (unsigned int*)(&seg_ioc_base) + (HBA_SPAN*channel); 149 149 150 150 if( channel >= NB_HBA_CHANNELS ) … … 214 214 215 215 // get hba device address 216 hba_address = (unsigned int*)(&seg_ hba_base) + (HBA_SPAN * channel_id);216 hba_address = (unsigned int*)(&seg_ioc_base) + (HBA_SPAN * channel_id); 217 217 218 218 // get command list status … … 434 434 } 435 435 ////////////////////////////////////////////////////////////////// 436 // This function initializes for a given channel (k)436 // This function initializes for a given channel 437 437 // - the HBA hardware registers, 438 438 // - the command list pointer, … … 440 440 // - the command tables physical addresses array, 441 441 ////////////////////////////////////////////////////////////////// 442 void _hba_init( unsigned int k ) // k == channel_index442 void _hba_init( unsigned int channel ) 443 443 { 444 444 unsigned int ppn; … … 452 452 453 453 // HBA registers 454 unsigned int* hba_address = (unsigned int*)(&seg_hba_base) + (HBA_SPAN*k);455 hba_address = (unsigned int*)&seg_ hba_base + HBA_SPAN * k;456 457 hba_address[HBA_PXCLB] = (unsigned int)(&hba_cmd_list[ k]);454 unsigned int* hba_address; 455 hba_address = (unsigned int*)&seg_ioc_base + HBA_SPAN * channel; 456 457 hba_address[HBA_PXCLB] = (unsigned int)(&hba_cmd_list[channel]); 458 458 hba_address[HBA_PXCLBU] = 0; 459 459 hba_address[HBA_PXIE] = 0x40000001; … … 463 463 464 464 // command list pointer 465 hba_cmd_slot[ k] = 0;465 hba_cmd_slot[channel] = 0; 466 466 467 467 // Command list physical addresse 468 vbase = (unsigned int)(&hba_cmd_list[ k]);468 vbase = (unsigned int)(&hba_cmd_list[channel]); 469 469 fail = _v2p_translate( (page_table_t*)pt, 470 470 vbase>>12, … … 478 478 _exit(); 479 479 } 480 hba_cmd_list_paddr[ k] = ((paddr_t)ppn) | (vbase & 0xFFF);480 hba_cmd_list_paddr[channel] = ((paddr_t)ppn) | (vbase & 0xFFF); 481 481 482 482 // Command tables physical addresses 483 483 for( c=0 ; c<32 ; c++ ) 484 484 { 485 vbase = (unsigned int)(&hba_cmd_table[ k][c]);485 vbase = (unsigned int)(&hba_cmd_table[channel][c]); 486 486 fail = _v2p_translate( (page_table_t*)pt, 487 487 vbase>>12, … … 495 495 _exit(); 496 496 } 497 hba_cmd_table_paddr[ k][c] = ((paddr_t)ppn) | (vbase & 0xFFF);497 hba_cmd_table_paddr[channel][c] = ((paddr_t)ppn) | (vbase & 0xFFF); 498 498 } 499 499 }
Note: See TracChangeset
for help on using the changeset viewer.