[arch][arm-m] add support for m7 cache, add memory barrier in systick driver

The memory barrier is needed to order the reading of the val register to ensure
it is read properly on M7 cores.
This commit is contained in:
Travis Geiselbrecht
2015-07-10 00:50:05 -07:00
parent 94d4d499f7
commit 88c923d88f
3 changed files with 17 additions and 1 deletions

View File

@@ -81,8 +81,21 @@ void arch_early_init(void)
/* set systick to medium priority */
NVIC_SetPriority(SysTick_IRQn, arm_cm_medium_priority());
#if ARM_WITH_CACHE
SCB_EnableICache();
SCB_EnableDCache();
#endif
}
#if ARM_WITH_CACHE
// XXX add full implementation, move to separate file
void arch_clean_cache_range(addr_t start, size_t len)
{
SCB_CleanDCache_by_Addr((void *)start, len);
}
#endif
void arch_init(void)
{
#if ENABLE_CYCLE_COUNTER