Changeset 911 for trunk/softs/tsar_boot/drivers
- Timestamp:
- Jan 2, 2015, 1:03:52 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/tsar_boot/drivers/reset_inval.c
r758 r911 17 17 enum memc_registers 18 18 { 19 MCC_LOCK = 0, 20 MCC_ADDR_LO = 1, 21 MCC_ADDR_HI = 2, 22 MCC_LENGTH = 3, 23 MCC_CMD = 4 19 MCC_ADDR_LO = 0, 20 MCC_ADDR_HI = 1, 21 MCC_LENGTH = 2, 22 MCC_CMD = 3 24 23 }; 25 24 … … 33 32 /** 34 33 * \brief Invalidate all data cache lines corresponding to a memory buffer 35 * (identified by an address and a size) in L2 cache.36 */37 void reset_mcc_invalidate (void* const buffer, size_t size)38 {39 // get the hard lock assuring exclusive access to MEMC40 while (ioread32(&mcc_address[MCC_LOCK]));41 42 // write invalidate paremeters on the memory cache this preloader43 // use only the cluster 0 and then the HI bits are not used44 45 iowrite32(&mcc_address[MCC_ADDR_LO], (unsigned int) buffer);46 iowrite32(&mcc_address[MCC_ADDR_HI], (unsigned int) 0);47 iowrite32(&mcc_address[MCC_LENGTH] , (unsigned int) size);48 iowrite32(&mcc_address[MCC_CMD] , (unsigned int) MCC_CMD_INVAL);49 50 // release the lock protecting MEMC51 iowrite32(&mcc_address[MCC_LOCK], (unsigned int) 0);52 }53 54 /**55 * \brief Invalidate all data cache lines corresponding to a memory buffer56 34 * (identified by an address and a size) in L1 cache and L2 cache. 57 35 */ … … 60 38 unsigned int i; 61 39 62 /* 63 * iterate on cache lines containing target buffer to invalidate them 64 */ 40 // iterate on L1 cache lines containing target buffer 65 41 for (i = 0; i <= size; i += CACHE_LINE_SIZE) 66 42 { … … 73 49 } 74 50 75 if (inval_memc) reset_mcc_invalidate(buffer, size); 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 } 76 61 } 77 62
Note: See TracChangeset
for help on using the changeset viewer.