Changeset 962 for trunk/softs/tsar_boot/drivers
- Timestamp:
- Apr 1, 2015, 3:42:03 PM (10 years ago)
- Location:
- trunk/softs/tsar_boot/drivers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/tsar_boot/drivers/reset_bdv.c
r758 r962 43 43 }; 44 44 45 //////////////////// 45 46 int reset_bdv_init() 46 47 { … … 48 49 } 49 50 50 int reset_bdv_read( unsigned int lba, void* buffer, unsigned int count ) 51 //////////////////////////////////// 52 int reset_bdv_read( unsigned int lba, 53 void* buffer, 54 unsigned int count ) 51 55 { 52 /* 53 * block_device configuration 54 */ 56 // block_device configuration 55 57 iowrite32( &ioc_address[BLOCK_DEVICE_BUFFER], (unsigned int) buffer ); 56 58 iowrite32( &ioc_address[BLOCK_DEVICE_COUNT], count ); … … 58 60 iowrite32( &ioc_address[BLOCK_DEVICE_IRQ_ENABLE], 0 ); 59 61 60 /* 61 * block_device trigger transfer 62 */ 62 // trigger transfer 63 63 iowrite32( &ioc_address[BLOCK_DEVICE_OP], ( unsigned int ) 64 64 BLOCK_DEVICE_READ ); 65 66 #if (RESET_HARD_CC == 0) || USE_IOB 67 // inval buffer in L1 cache 68 reset_L1_inval( buffer , count * 512 ); 69 #endif 70 71 #if USE_IOB 72 // inval buffer in L2 cache 73 reset_L2_inval( buffer , count * 512 ); 74 #endif 65 75 66 76 unsigned int status = 0; … … 72 82 break; 73 83 } 74 if ( status == BLOCK_DEVICE_READ_ERROR ) { 84 if ( status == BLOCK_DEVICE_READ_ERROR ) 85 { 75 86 reset_puts("ERROR during read on the BLK device\n"); 76 87 return 1; … … 78 89 } 79 90 80 #if (RESET_HARD_CC == 0) || USE_IOB81 reset_buf_invalidate(buffer, count * 512, USE_IOB);82 #endif83 91 return 0; 84 92 } -
trunk/softs/tsar_boot/drivers/reset_inval.c
r911 r962 2 2 * \file reset_inval.c 3 3 * \date December 14, 2014 4 * \author Cesar Fuguet 4 * \author Cesar Fuguet / Alain Greiner 5 5 */ 6 6 … … 13 13 #endif 14 14 15 static int* const m cc_address = (int* const)SEG_MMC_BASE;15 static int* const mmc_address = (int* const)SEG_MMC_BASE; 16 16 17 17 enum memc_registers … … 31 31 32 32 /** 33 * \brief Invalidate all datacache lines corresponding to a memory buffer34 * (identified by an address and a size) in L1 cache and L2 cache.33 * \brief Invalidate all L1 cache lines corresponding to a memory buffer 34 * (identified by an address and a size). 35 35 */ 36 void reset_ buf_invalidate (void* const buffer, size_t size, int inval_memc)36 void reset_L1_inval( void* const buffer, size_t size ) 37 37 { 38 38 unsigned int i; … … 45 45 : /* no outputs */ 46 46 : "i" (0x11), "R" (*((char*)buffer + i)) 47 : "memory" 48 ); 47 : "memory" ); 49 48 } 49 } 50 50 51 if (inval_memc) 52 { 53 // this preloader uses only the cluster 0 54 // It does not use the ADDR_HI bits, and does not take 55 // any lock for exclusive access to MCC 56 iowrite32(&mcc_address[MCC_ADDR_LO], (unsigned int) buffer); 57 iowrite32(&mcc_address[MCC_ADDR_HI], (unsigned int) 0); 58 iowrite32(&mcc_address[MCC_LENGTH] , (unsigned int) size); 59 iowrite32(&mcc_address[MCC_CMD] , (unsigned int) MCC_CMD_INVAL); 60 } 51 /** 52 * \brief Invalidate all L2 cache lines corresponding to a memory buffer 53 * (identified by an address and a size). 54 */ 55 void reset_L2_inval( void* const buffer, size_t size ) 56 { 57 iowrite32( &mmc_address[MCC_ADDR_LO], (unsigned int)buffer ); 58 iowrite32( &mmc_address[MCC_ADDR_HI], 0 ); 59 iowrite32( &mmc_address[MCC_LENGTH] , size ); 60 iowrite32( &mmc_address[MCC_CMD] , MCC_CMD_INVAL); 61 } 62 63 /** 64 * \brief Update external RAM for all L2 cache lines corresponding to 65 * a memory buffer (identified by an address and a size). 66 */ 67 void reset_L2_sync ( void* const buffer, size_t size ) 68 { 69 iowrite32( &mmc_address[MCC_ADDR_LO], (unsigned int)buffer ); 70 iowrite32( &mmc_address[MCC_ADDR_HI], 0 ); 71 iowrite32( &mmc_address[MCC_LENGTH] , size ); 72 iowrite32( &mmc_address[MCC_CMD] , MCC_CMD_SYNC ); 61 73 } 62 74 -
trunk/softs/tsar_boot/drivers/reset_inval.h
r758 r962 10 10 #include <inttypes.h> 11 11 12 void reset_ mcc_invalidate(void* const buffer, size_t size);12 void reset_L1_inval (void* const buffer, size_t size); 13 13 14 void reset_buf_invalidate (void* const buffer, size_t size, int inval_memc); 14 void reset_L2_inval (void* const buffer, size_t size); 15 16 void reset_L2_sync (void* const buffer, size_t size); 15 17 16 18 #endif
Note: See TracChangeset
for help on using the changeset viewer.