stm32: flash: pull out i/d cache support.
Copied a few times.
This commit is contained in:
@@ -47,7 +47,7 @@ OBJS += exti_common_all.o
|
||||
OBJS += adc_common_v2.o adc_common_v2_multi.o
|
||||
OBJS += crc_common_all.o crc_v2.o
|
||||
OBJS += crs_common_all.o
|
||||
OBJS += flash_common_all.o flash_common_f.o
|
||||
OBJS += flash_common_all.o flash_common_f.o flash_common_idcache.o
|
||||
OBJS += rng_common_v1.o
|
||||
OBJS += timer_common_all.o
|
||||
OBJS += i2c_common_v2.o
|
||||
|
||||
@@ -58,51 +58,6 @@ void flash_wait_for_last_operation(void)
|
||||
while ((FLASH_SR & FLASH_SR_BSY) == FLASH_SR_BSY);
|
||||
}
|
||||
|
||||
/** @brief Enable the Data Cache
|
||||
*/
|
||||
void flash_dcache_enable(void)
|
||||
{
|
||||
FLASH_ACR |= FLASH_ACR_DCEN;
|
||||
}
|
||||
|
||||
/** @brief Disable the Data Cache
|
||||
*/
|
||||
void flash_dcache_disable(void)
|
||||
{
|
||||
FLASH_ACR &= ~FLASH_ACR_DCEN;
|
||||
}
|
||||
|
||||
/** @brief Enable the Instruction Cache
|
||||
*/
|
||||
void flash_icache_enable(void)
|
||||
{
|
||||
FLASH_ACR |= FLASH_ACR_ICEN;
|
||||
}
|
||||
|
||||
/** @brief Disable the Instruction Cache
|
||||
*/
|
||||
void flash_icache_disable(void)
|
||||
{
|
||||
FLASH_ACR &= ~FLASH_ACR_ICEN;
|
||||
}
|
||||
|
||||
|
||||
/** @brief Reset the Data Cache
|
||||
* The data cache must be disabled for this to have effect.
|
||||
*/
|
||||
void flash_dcache_reset(void)
|
||||
{
|
||||
FLASH_ACR |= FLASH_ACR_DCRST;
|
||||
}
|
||||
|
||||
/** @brief Reset the Instruction Cache
|
||||
* The instruction cache must be disabled for this to have effect.
|
||||
*/
|
||||
void flash_icache_reset(void)
|
||||
{
|
||||
FLASH_ACR |= FLASH_ACR_ICRST;
|
||||
}
|
||||
|
||||
/** @brief Clear the Programming Sequence Error Flag
|
||||
* This flag is set when incorrect programming configuration has been made.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user