|
1 | 1 | /* |
2 | 2 | * Copyright (c) 2013-2014 Wind River Systems, Inc. |
| 3 | + * Copyright (c) 2021 Intel Corporation |
3 | 4 | * |
4 | 5 | * SPDX-License-Identifier: Apache-2.0 |
5 | 6 | */ |
|
16 | 17 | #include <toolchain.h> |
17 | 18 | #include <cache.h> |
18 | 19 | #include <stdbool.h> |
19 | | -#include <cache.h> |
20 | | - |
21 | | -/* |
22 | | - * these functions are defined in cache_s.S |
23 | | - */ |
24 | | - |
25 | | -extern int z_is_clflush_available(void); |
26 | | -extern void z_cache_flush_wbinvd(vaddr_t addr, size_t len); |
27 | | -extern size_t z_cache_line_size_get(void); |
28 | | - |
29 | | -#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT) |
30 | | -size_t sys_cache_line_size; |
31 | | -#endif |
32 | | - |
33 | | -#if defined(CONFIG_CLFLUSH_INSTRUCTION_SUPPORTED) || \ |
34 | | - defined(CONFIG_CLFLUSH_DETECT) |
35 | 20 |
|
36 | 21 | /** |
37 | | - * |
38 | 22 | * @brief Flush cache lines to main memory |
39 | 23 | * |
40 | 24 | * No alignment is required for either <virt> or <size>, but since |
41 | 25 | * sys_cache_flush() iterates on the cache lines, a cache line alignment for |
42 | 26 | * both is optimal. |
43 | 27 | * |
44 | | - * The cache line size is specified either via the CONFIG_DCACHE_LINE_SIZE |
45 | | - * kconfig option or it is detected at runtime. |
| 28 | + * The cache line size is specified via the d-cache-line-size DTS property. |
46 | 29 | * |
47 | 30 | * @return N/A |
48 | 31 | */ |
49 | | - |
50 | 32 | static void arch_dcache_flush(void *start_addr, size_t size) |
51 | 33 | { |
52 | 34 | size_t line_size = sys_dcache_line_size_get(); |
@@ -76,31 +58,3 @@ int arch_dcache_range(void *addr, size_t size, int op) |
76 | 58 |
|
77 | 59 | return -ENOTSUP; |
78 | 60 | } |
79 | | - |
80 | | -#endif /* CONFIG_CLFLUSH_INSTRUCTION_SUPPORTED || CLFLUSH_DETECT */ |
81 | | - |
82 | | -#include <init.h> |
83 | | - |
84 | | -#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT) |
85 | | -static void init_cache_line_size(void) |
86 | | -{ |
87 | | - sys_cache_line_size = z_cache_line_size_get(); |
88 | | -} |
89 | | - |
90 | | -size_t arch_cache_line_size_get(void) |
91 | | -{ |
92 | | - return sys_cache_line_size; |
93 | | -} |
94 | | -#endif |
95 | | - |
96 | | -static int init_dcache(const struct device *unused) |
97 | | -{ |
98 | | - ARG_UNUSED(unused); |
99 | | - |
100 | | -#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT) |
101 | | - init_cache_line_size(); |
102 | | -#endif |
103 | | - return 0; |
104 | | -} |
105 | | - |
106 | | -SYS_INIT(init_dcache, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); |
0 commit comments