Changeset 968 for trunk/softs/tsar_boot/drivers
- Timestamp:
- Apr 6, 2015, 10:29:14 AM (10 years ago)
- Location:
- trunk/softs/tsar_boot/drivers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/tsar_boot/drivers/reset_bdv.c
r962 r968 50 50 51 51 //////////////////////////////////// 52 int reset_bdv_read( unsigned int lba, 53 void* buffer, 54 unsigned int count ) 52 int reset_bdv_read( unsigned int lba, void* buffer, unsigned int count ) 55 53 { 56 54 // block_device configuration 57 iowrite32( &ioc_address[BLOCK_DEVICE_BUFFER], (unsigned int) 55 iowrite32( &ioc_address[BLOCK_DEVICE_BUFFER], (unsigned int)buffer ); 58 56 iowrite32( &ioc_address[BLOCK_DEVICE_COUNT], count ); 59 57 iowrite32( &ioc_address[BLOCK_DEVICE_LBA], lba ); … … 61 59 62 60 // trigger transfer 63 iowrite32( &ioc_address[BLOCK_DEVICE_OP], ( unsigned int )64 BLOCK_DEVICE_READ );61 iowrite32( &ioc_address[BLOCK_DEVICE_OP], 62 (unsigned int)BLOCK_DEVICE_READ ); 65 63 66 64 #if (RESET_HARD_CC == 0) || USE_IOB … … 82 80 break; 83 81 } 84 if ( status == BLOCK_DEVICE_READ_ERROR )82 if ( status == BLOCK_DEVICE_READ_ERROR ) 85 83 { 86 84 reset_puts("ERROR during read on the BLK device\n"); -
trunk/softs/tsar_boot/drivers/reset_hba.c
r964 r968 9 9 #include <reset_tty.h> 10 10 #include <reset_inval.h> 11 #include <reset_utils.h> 11 12 #include <io.h> 12 13 #include <defs.h> … … 17 18 18 19 // command descriptor (one single command) 19 static hba_cmd_desc_t hba_cmd_desc __attribute__((aligned(64)));20 static hba_cmd_desc_t hba_cmd_desc __cache_aligned__; 20 21 21 22 // command table (one single command) 22 static hba_cmd_table_t hba_cmd_table __attribute__((aligned(64)));23 static hba_cmd_table_t hba_cmd_table __cache_aligned__; 23 24 24 25 // IOC/HBA device base address … … 35 36 // return 0 if success, -1 if error 36 37 /////////////////////////////////////////////////////////////////////////////// 37 int reset_hba_read( unsigned int lba, 38 int reset_hba_read( unsigned int lba, 38 39 void* buffer, 39 unsigned int count ) 40 unsigned int count ) 40 41 { 41 42 unsigned int pxci; // HBA_PXCI register value … … 46 47 { 47 48 reset_puts("\n[RESET ERROR] in reset_hba_read() "); 48 reset_puts("buffer not aligned on 64 bytes: base = "); 49 reset_puts("buffer not aligned on 64 bytes: base = "); 49 50 reset_putx( (unsigned int)buffer ); 50 reset_puts("\n"); 51 reset_puts("\n"); 51 52 return -1; 52 53 } … … 69 70 hba_cmd_desc.prdtl[1] = 0; 70 71 hba_cmd_desc.flag[0] = 0; // read 71 72 72 73 #if USE_IOB 73 74 // update external memory for command table … … 96 97 pxci = ioread32( &ioc_address[HBA_PXCI] ); 97 98 } 98 while( pxci ); 99 99 while( pxci ); 100 100 101 // get PXIS register 101 102 pxis = ioread32( &ioc_address[HBA_PXIS] ); … … 107 108 iowrite32( &ioc_address[HBA_PXCI] , 0 ); 108 109 109 // check error status 110 if ( pxis & 0x40000000 ) 110 // check error status 111 if ( pxis & 0x40000000 ) 111 112 { 112 113 reset_puts("[RESET ERROR] in reset_hba_read() : " … … 120 121 121 122 /////////////////////////////////////////////////////////////////////////////// 122 // This function initialises both the HBA registers and the 123 // This function initialises both the HBA registers and the 123 124 // memory structures used by the AHCI peripheral (one single command). 124 125 /////////////////////////////////////////////////////////////////////////////// … … 126 127 { 127 128 // initialise the command descriptor 128 hba_cmd_desc.ctba 129 hba_cmd_desc.ctba = (unsigned int)&hba_cmd_table; 129 130 hba_cmd_desc.ctbau = 0; 130 131 131 132 #if USE_IOB 132 133 // update external memory for the commande descriptor 133 reset_L2_sync( 134 reset_L2_sync(&hba_cmd_desc , sizeof( hba_cmd_desc_t ) ); 134 135 #endif 135 // initialise HBA registers 136 iowrite32( &ioc_address[HBA_PXCLB], (unsigned int)&hba_cmd_desc );137 iowrite32( &ioc_address[HBA_PXCLBU], 0 );138 iowrite32( &ioc_address[HBA_PXIE], 0 );139 iowrite32( &ioc_address[HBA_PXIS], 0 );140 iowrite32( &ioc_address[HBA_PXCI], 0 );141 iowrite32( &ioc_address[HBA_PXCMD], 1 );136 // initialise HBA registers 137 iowrite32(&ioc_address[HBA_PXCLB], (unsigned int)&hba_cmd_desc ); 138 iowrite32(&ioc_address[HBA_PXCLBU], 0 ); 139 iowrite32(&ioc_address[HBA_PXIE], 0 ); 140 iowrite32(&ioc_address[HBA_PXIS], 0 ); 141 iowrite32(&ioc_address[HBA_PXCI], 0 ); 142 iowrite32(&ioc_address[HBA_PXCMD], 1 ); 142 143 143 144 return 0; 144 145 } 145 146 146 147 147 // Local Variables:
Note: See TracChangeset
for help on using the changeset viewer.