Merge pull request #1336 from TanekLiang/cache

[bsp][imxrt1052] add cache interface support
This commit is contained in:
Bernard Xiong 2018-04-05 07:42:40 +08:00 committed by GitHub
commit f06f50f4ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 512 additions and 2314 deletions

View File

@ -8,6 +8,7 @@ cwd = os.path.join(str(Dir('#')), 'drivers')
src = Split("""
board.c
drv_uart.c
drv_cache.c
""")
CPPPATH = [cwd]

View File

@ -0,0 +1,75 @@
/*
* 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);
}
}

View File

@ -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>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff