1 # SPDX-License-Identifier: GPL-2.0
3 # MN10300 CPU cache options
7 prompt "CPU Caching mode"
8 default MN10300_CACHE_WBACK
10 This option determines the caching mode for the kernel.
12 Write-Back caching mode involves the all reads and writes causing
13 the affected cacheline to be read into the cache first before being
14 operated upon. Memory is not then updated by a write until the cache
15 is filled and a cacheline needs to be displaced from the cache to
16 make room. Only at that point is it written back.
18 Write-Through caching only fetches cachelines from memory on a
19 read. Writes always get written directly to memory. If the affected
20 cacheline is also in cache, it will be updated too.
22 The final option is to turn of caching entirely.
24 config MN10300_CACHE_WBACK
27 The dcache operates in delayed write-back mode. It must be manually
28 flushed if writes are made that subsequently need to be executed or
29 to be DMA'd by a device.
31 config MN10300_CACHE_WTHRU
34 The dcache operates in immediate write-through mode. Writes are
35 committed to RAM immediately in addition to being stored in the
36 cache. This means that the written data is immediately available for
39 This is not available for use with an SMP kernel if cache flushing
40 and invalidation by automatic purge register is not selected.
42 config MN10300_CACHE_DISABLED
45 The icache and dcache are disabled.
49 config MN10300_CACHE_ENABLED
50 def_bool y if !MN10300_CACHE_DISABLED
54 prompt "CPU cache flush/invalidate method"
55 default MN10300_CACHE_MANAGE_BY_TAG if !AM34_2
56 default MN10300_CACHE_MANAGE_BY_REG if AM34_2
57 depends on MN10300_CACHE_ENABLED
59 This determines the method by which CPU cache flushing and
60 invalidation is performed.
62 config MN10300_CACHE_MANAGE_BY_TAG
63 bool "Use the cache tag registers directly"
64 depends on !(SMP && MN10300_CACHE_WTHRU)
66 config MN10300_CACHE_MANAGE_BY_REG
67 bool "Flush areas by way of automatic purge registers (AM34 only)"
72 config MN10300_CACHE_INV_BY_TAG
73 def_bool y if MN10300_CACHE_MANAGE_BY_TAG && MN10300_CACHE_ENABLED
75 config MN10300_CACHE_INV_BY_REG
76 def_bool y if MN10300_CACHE_MANAGE_BY_REG && MN10300_CACHE_ENABLED
78 config MN10300_CACHE_FLUSH_BY_TAG
79 def_bool y if MN10300_CACHE_MANAGE_BY_TAG && MN10300_CACHE_WBACK
81 config MN10300_CACHE_FLUSH_BY_REG
82 def_bool y if MN10300_CACHE_MANAGE_BY_REG && MN10300_CACHE_WBACK
85 config MN10300_HAS_CACHE_SNOOP
88 config MN10300_CACHE_SNOOP
89 bool "Use CPU Cache Snooping"
90 depends on MN10300_CACHE_ENABLED && MN10300_HAS_CACHE_SNOOP
93 config MN10300_CACHE_FLUSH_ICACHE
94 def_bool y if MN10300_CACHE_WBACK && !MN10300_CACHE_SNOOP
96 Set if we need the dcache flushing before the icache is invalidated.
98 config MN10300_CACHE_INV_ICACHE
99 def_bool y if MN10300_CACHE_WTHRU && !MN10300_CACHE_SNOOP
101 Set if we need the icache to be invalidated, even if the dcache is in
102 write-through mode and doesn't need flushing.
105 # The kernel debugger gets its own separate cache flushing functions
107 config MN10300_DEBUGGER_CACHE_FLUSH_BY_TAG
108 def_bool y if KERNEL_DEBUGGER && \
109 MN10300_CACHE_WBACK && \
110 !MN10300_CACHE_SNOOP && \
111 MN10300_CACHE_MANAGE_BY_TAG
113 Set if the debugger needs to flush the dcache and invalidate the
114 icache using the cache tag registers to make breakpoints work.
116 config MN10300_DEBUGGER_CACHE_FLUSH_BY_REG
117 def_bool y if KERNEL_DEBUGGER && \
118 MN10300_CACHE_WBACK && \
119 !MN10300_CACHE_SNOOP && \
120 MN10300_CACHE_MANAGE_BY_REG
122 Set if the debugger needs to flush the dcache and invalidate the
123 icache using automatic purge registers to make breakpoints work.
125 config MN10300_DEBUGGER_CACHE_INV_BY_TAG
126 def_bool y if KERNEL_DEBUGGER && \
127 MN10300_CACHE_WTHRU && \
128 !MN10300_CACHE_SNOOP && \
129 MN10300_CACHE_MANAGE_BY_TAG
131 Set if the debugger needs to invalidate the icache using the cache
132 tag registers to make breakpoints work.
134 config MN10300_DEBUGGER_CACHE_INV_BY_REG
135 def_bool y if KERNEL_DEBUGGER && \
136 MN10300_CACHE_WTHRU && \
137 !MN10300_CACHE_SNOOP && \
138 MN10300_CACHE_MANAGE_BY_REG
140 Set if the debugger needs to invalidate the icache using automatic
141 purge registers to make breakpoints work.
143 config MN10300_DEBUGGER_CACHE_NO_FLUSH
144 def_bool y if KERNEL_DEBUGGER && \
145 (MN10300_CACHE_DISABLED || MN10300_CACHE_SNOOP)
147 Set if the debugger does not need to flush the dcache and/or
148 invalidate the icache to make breakpoints work.