summaryrefslogtreecommitdiff
path: root/bsp/allwinner/libraries/sunxi-hal/osal/src/hal_cache.c
blob: 8f9d8a6ed2dfe061d2ffb8d5a57a4fcd0ad2543a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
 * ===========================================================================================
 *
 *       Filename:  cache.S
 *
 *    Description:  cache operation for device
 *
 *        Version:  Melis3.0
 *         Create:  2019-11-25 20:31:28
 *       Revision:  none
 *       Compiler:  GCC:version 7.2.1 20170904 (release),ARM/embedded-7-branch revision 255204
 *
 *         Author:  [email protected]
 *   Organization:  BU1-PSW
 *  Last Modified:  2020-03-27 10:55:45
 *
 * ===========================================================================================
 */
#include <hal_cache.h>
#include <kconfig.h>


void cpu_dcache_clean(unsigned long vaddr_start, unsigned long size)
{
#ifndef CONFIG_CPU_DCACHE_DISABLE
    awos_arch_mems_clean_dcache_region(vaddr_start, size);
#endif
}

void cpu_dcache_clean_invalidate(unsigned long vaddr_start, unsigned long size)
{
#ifndef CONFIG_CPU_DCACHE_DISABLE
    awos_arch_mems_clean_flush_dcache_region(vaddr_start, size);
#endif
}

void cpu_dcache_invalidate(unsigned long vaddr_start, unsigned long size)
{
#ifndef CONFIG_CPU_DCACHE_DISABLE
    awos_arch_mems_flush_dcache_region(vaddr_start, size);
#endif
}

void cpu_dcache_clean_all(void)
{
#ifndef CONFIG_CPU_DCACHE_DISABLE
    awos_arch_clean_dcache();
#endif
}

void cpu_dcache_invalidate_all(void)
{
#ifndef CONFIG_CPU_DCACHE_DISABLE
    awos_arch_flush_dcache();
#endif
}

void cpu_icache_invalidate_all(void)
{
    awos_arch_flush_icache_all();
}

void cpu_icache_invalidate(unsigned long vaddr_start, unsigned long size)
{
    awos_arch_mems_flush_icache_region(vaddr_start, size);
}