armv7a/r: cache function should depends on CONFIG_ARCH_XCACHE

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2022-12-07 12:29:05 +08:00 committed by Xiang Xiao
parent 613bfd0fde
commit 7e4c5d3daa
2 changed files with 132 additions and 116 deletions

View File

@ -34,6 +34,70 @@
* Public Functions
****************************************************************************/
#ifdef CONFIG_ARCH_ICACHE
/****************************************************************************
* Name: up_invalidate_icache_all
*
* Description:
* Invalidate all instruction caches to PoU, also flushes branch target
* cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_invalidate_icache_all(void)
{
cp15_invalidate_icache();
}
/****************************************************************************
* Name: up_enable_icache
*
* Description:
* Enable the I-Cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_enable_icache(void)
{
cp15_enable_icache();
}
/****************************************************************************
* Name: up_disable_icache
*
* Description:
* Disable the I-Cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_disable_icache(void)
{
cp15_disable_icache();
}
#endif /* CONFIG_ARCH_ICACHE */
#ifdef CONFIG_ARCH_DCACHE
/****************************************************************************
* Name: up_invalidate_dcache
*
@ -91,26 +155,6 @@ void up_invalidate_dcache_all(void)
#endif
}
/****************************************************************************
* Name: up_invalidate_icache_all
*
* Description:
* Invalidate all instruction caches to PoU, also flushes branch target
* cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_invalidate_icache_all(void)
{
cp15_invalidate_icache();
}
/****************************************************************************
* Name: up_clean_dcache
*
@ -238,44 +282,6 @@ void up_flush_dcache_all(void)
l2cc_flush_all();
}
/****************************************************************************
* Name: up_enable_icache
*
* Description:
* Enable the I-Cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_enable_icache(void)
{
cp15_enable_icache();
}
/****************************************************************************
* Name: up_disable_icache
*
* Description:
* Disable the I-Cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_disable_icache(void)
{
cp15_disable_icache();
}
/****************************************************************************
* Name: up_enable_dcache
*
@ -349,3 +355,5 @@ void up_coherent_dcache(uintptr_t addr, size_t len)
#endif
}
}
#endif /* CONFIG_ARCH_DCACHE */

View File

@ -34,6 +34,70 @@
* Public Functions
****************************************************************************/
#ifdef CONFIG_ARCH_ICACHE
/****************************************************************************
* Name: up_invalidate_icache_all
*
* Description:
* Invalidate all instruction caches to PoU, also flushes branch target
* cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_invalidate_icache_all(void)
{
cp15_invalidate_icache();
}
/****************************************************************************
* Name: up_enable_icache
*
* Description:
* Enable the I-Cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_enable_icache(void)
{
cp15_enable_icache();
}
/****************************************************************************
* Name: up_disable_icache
*
* Description:
* Disable the I-Cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_disable_icache(void)
{
cp15_disable_icache();
}
#endif /* CONFIG_ARCH_ICACHE */
#ifdef CONFIG_ARCH_DCACHE
/****************************************************************************
* Name: up_invalidate_dcache
*
@ -91,26 +155,6 @@ void up_invalidate_dcache_all(void)
#endif
}
/****************************************************************************
* Name: up_invalidate_icache_all
*
* Description:
* Invalidate all instruction caches to PoU, also flushes branch target
* cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_invalidate_icache_all(void)
{
cp15_invalidate_icache();
}
/****************************************************************************
* Name: up_clean_dcache
*
@ -238,44 +282,6 @@ void up_flush_dcache_all(void)
l2cc_flush_all();
}
/****************************************************************************
* Name: up_enable_icache
*
* Description:
* Enable the I-Cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_enable_icache(void)
{
cp15_enable_icache();
}
/****************************************************************************
* Name: up_disable_icache
*
* Description:
* Disable the I-Cache
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
void up_disable_icache(void)
{
cp15_disable_icache();
}
/****************************************************************************
* Name: up_enable_dcache
*
@ -349,3 +355,5 @@ void up_coherent_dcache(uintptr_t addr, size_t len)
#endif
}
}
#endif /* CONFIG_ARCH_DCACHE */