提交 327a6b6f 编写于 作者: L liang yongxiang

[bsp][imxrt1052] add cache interface support

上级 c8a654ce
......@@ -8,6 +8,7 @@ cwd = os.path.join(str(Dir('#')), 'drivers')
src = Split("""
board.c
drv_uart.c
drv_cache.c
""")
CPPPATH = [cwd]
......
/*
* File : drv_cache.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2018-04-02 tanek first implementation
*/
#include <rtthread.h>
#include <rthw.h>
#include <fsl_cache.h>
void rt_hw_cpu_icache_enable(void)
{
SCB_EnableICache();
}
void rt_hw_cpu_icache_disable(void)
{
SCB_DisableICache();
}
rt_base_t rt_hw_cpu_icache_status(void)
{
return 0;
}
void rt_hw_cpu_icache_ops(int ops, void* addr, int size)
{
if (ops & RT_HW_CACHE_INVALIDATE)
{
ICACHE_InvalidateByRange((uint32_t)addr, size);
}
}
void rt_hw_cpu_dcache_enable(void)
{
SCB_EnableDCache();
}
void rt_hw_cpu_dcache_disable(void)
{
SCB_DisableDCache();
}
rt_base_t rt_hw_cpu_dcache_status(void)
{
return 0;
}
void rt_hw_cpu_dcache_ops(int ops, void* addr, int size)
{
if (ops & (RT_HW_CACHE_FLUSH | RT_HW_CACHE_INVALIDATE))
{
DCACHE_CleanInvalidateByRange((uint32_t)addr, size);
}
else if (ops & RT_HW_CACHE_FLUSH)
{
DCACHE_CleanByRange((uint32_t)addr, size);
}
else if (ops & RT_HW_CACHE_INVALIDATE)
{
DCACHE_InvalidateByRange((uint32_t)addr, size);
}
else
{
RT_ASSERT(0);
}
}
......@@ -308,7 +308,7 @@
<state>$PROJ_DIR$\Libraries\drivers</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\posix</state>
<state>$PROJ_DIR$\drivers</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\ipv4</state>
<state>$PROJ_DIR$\.</state>
<state>$PROJ_DIR$\..\..\libcpu\arm\cortex-m7</state>
......@@ -316,10 +316,11 @@
<state>$PROJ_DIR$\..\..\components\dfs\filesystems\devfs</state>
<state>$PROJ_DIR$\Libraries\CMSIS\Include</state>
<state>$PROJ_DIR$\Libraries\utilities</state>
<state>$PROJ_DIR$\..\..\components\drivers\spi</state>
<state>$PROJ_DIR$\applications</state>
<state>$PROJ_DIR$\..\..\components\finsh</state>
<state>$PROJ_DIR$\..\..\components\dfs\filesystems\elmfat</state>
<state>$PROJ_DIR$\drivers</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\posix</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\arch\include</state>
</option>
<option>
......@@ -1247,7 +1248,7 @@
<state>$PROJ_DIR$\Libraries\drivers</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\posix</state>
<state>$PROJ_DIR$\drivers</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\ipv4</state>
<state>$PROJ_DIR$\.</state>
<state>$PROJ_DIR$\..\..\libcpu\arm\cortex-m7</state>
......@@ -1255,10 +1256,11 @@
<state>$PROJ_DIR$\..\..\components\dfs\filesystems\devfs</state>
<state>$PROJ_DIR$\Libraries\CMSIS\Include</state>
<state>$PROJ_DIR$\Libraries\utilities</state>
<state>$PROJ_DIR$\..\..\components\drivers\spi</state>
<state>$PROJ_DIR$\applications</state>
<state>$PROJ_DIR$\..\..\components\finsh</state>
<state>$PROJ_DIR$\..\..\components\dfs\filesystems\elmfat</state>
<state>$PROJ_DIR$\drivers</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\posix</state>
<state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\arch\include</state>
</option>
<option>
......@@ -1898,7 +1900,7 @@
<name>$PROJ_DIR$\drivers\drv_uart.c</name>
</file>
<file>
<name>$PROJ_DIR$\drivers\hyper_flash_boot.c</name>
<name>$PROJ_DIR$\drivers\drv_cache.c</name>
</file>
<file>
<name>$PROJ_DIR$\drivers\drv_sdram.c</name>
......@@ -1907,7 +1909,13 @@
<name>$PROJ_DIR$\drivers\drv_pin.c</name>
</file>
<file>
<name>$PROJ_DIR$\drivers\drv_hp_rtc.c</name>
<name>$PROJ_DIR$\drivers\drv_rtc.c</name>
</file>
<file>
<name>$PROJ_DIR$\drivers\drv_spi_bus.c</name>
</file>
<file>
<name>$PROJ_DIR$\drivers\hyper_flash_boot.c</name>
</file>
<file>
<name>$PROJ_DIR$\drivers\drv_eth.c</name>
......@@ -2227,6 +2235,12 @@
<file>
<name>$PROJ_DIR$\..\..\components\drivers\serial\serial.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\components\drivers\spi\spi_core.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\components\drivers\spi\spi_dev.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\components\drivers\src\completion.c</name>
</file>
......
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册