[feat][l1c] update flush cache external api

This commit is contained in:
qqwang 2021-08-05 17:56:16 +08:00
parent 34a81fbe16
commit 93c8f3dd23
2 changed files with 25 additions and 0 deletions

View file

@ -173,6 +173,7 @@ void L1C_BMX_TO_IRQHandler(void);
BL_Err_Type L1C_Cache_Enable_Set(uint8_t wayDisable);
void L1C_Cache_Write_Set(BL_Fun_Type wtEn, BL_Fun_Type wbEn, BL_Fun_Type waEn);
BL_Err_Type L1C_Cache_Flush(uint8_t wayDisable);
BL_Err_Type L1C_Cache_Flush_Ext(void);
void L1C_Cache_Hit_Count_Get(uint32_t *hitCountLow, uint32_t *hitCountHigh);
uint32_t L1C_Cache_Miss_Count_Get(void);
void L1C_Cache_Read_Disable(void);

View file

@ -248,6 +248,30 @@ BL_Err_Type ATTR_TCM_SECTION L1C_Cache_Flush(uint8_t wayDisable)
}
#endif
/****************************************************************************/ /**
* @brief Flush cache external api
*
* @param None
*
* @return SUCCESS or ERROR
*
*******************************************************************************/
BL_Err_Type ATTR_TCM_SECTION L1C_Cache_Flush_Ext(void)
{
uint32_t tmpVal;
/* Disable early respone */
tmpVal = BL_RD_REG(L1C_BASE, L1C_CONFIG);
L1C_Cache_Flush((tmpVal >> L1C_WAY_DIS_POS) & 0xf);
__NOP();
__NOP();
__NOP();
__NOP();
__NOP();
return SUCCESS;
}
/****************************************************************************/ /**
* @brief Get cache hit count
*