csky: Add support for function error injection
[linux-2.6-microblaze.git] / arch / csky / Kconfig
1 # SPDX-License-Identifier: GPL-2.0-only
2 config CSKY
3         def_bool y
4         select ARCH_32BIT_OFF_T
5         select ARCH_HAS_DMA_PREP_COHERENT
6         select ARCH_HAS_GCOV_PROFILE_ALL
7         select ARCH_HAS_SYNC_DMA_FOR_CPU
8         select ARCH_HAS_SYNC_DMA_FOR_DEVICE
9         select ARCH_USE_BUILTIN_BSWAP
10         select ARCH_USE_QUEUED_RWLOCKS if NR_CPUS>2
11         select ARCH_WANT_FRAME_POINTERS if !CPU_CK610
12         select COMMON_CLK
13         select CLKSRC_MMIO
14         select CSKY_MPINTC if CPU_CK860
15         select CSKY_MP_TIMER if CPU_CK860
16         select CSKY_APB_INTC
17         select DMA_DIRECT_REMAP
18         select IRQ_DOMAIN
19         select HANDLE_DOMAIN_IRQ
20         select DW_APB_TIMER_OF
21         select GENERIC_IOREMAP
22         select GENERIC_LIB_ASHLDI3
23         select GENERIC_LIB_ASHRDI3
24         select GENERIC_LIB_LSHRDI3
25         select GENERIC_LIB_MULDI3
26         select GENERIC_LIB_CMPDI2
27         select GENERIC_LIB_UCMPDI2
28         select GENERIC_ALLOCATOR
29         select GENERIC_ATOMIC64
30         select GENERIC_CLOCKEVENTS
31         select GENERIC_CPU_DEVICES
32         select GENERIC_IRQ_CHIP
33         select GENERIC_IRQ_PROBE
34         select GENERIC_IRQ_SHOW
35         select GENERIC_IRQ_MULTI_HANDLER
36         select GENERIC_SCHED_CLOCK
37         select GENERIC_SMP_IDLE_THREAD
38         select GX6605S_TIMER if CPU_CK610
39         select HAVE_ARCH_TRACEHOOK
40         select HAVE_ARCH_AUDITSYSCALL
41         select HAVE_ARCH_SECCOMP_FILTER
42         select HAVE_COPY_THREAD_TLS
43         select HAVE_DEBUG_BUGVERBOSE
44         select HAVE_DYNAMIC_FTRACE
45         select HAVE_DYNAMIC_FTRACE_WITH_REGS
46         select HAVE_FUNCTION_TRACER
47         select HAVE_FUNCTION_GRAPH_TRACER
48         select HAVE_FUNCTION_ERROR_INJECTION
49         select HAVE_FTRACE_MCOUNT_RECORD
50         select HAVE_KERNEL_GZIP
51         select HAVE_KERNEL_LZO
52         select HAVE_KERNEL_LZMA
53         select HAVE_KPROBES if !CPU_CK610
54         select HAVE_KPROBES_ON_FTRACE if !CPU_CK610
55         select HAVE_KRETPROBES if !CPU_CK610
56         select HAVE_PERF_EVENTS
57         select HAVE_PERF_REGS
58         select HAVE_PERF_USER_STACK_DUMP
59         select HAVE_DMA_CONTIGUOUS
60         select HAVE_REGS_AND_STACK_ACCESS_API
61         select HAVE_RSEQ
62         select HAVE_STACKPROTECTOR
63         select HAVE_SYSCALL_TRACEPOINTS
64         select MAY_HAVE_SPARSE_IRQ
65         select MODULES_USE_ELF_RELA if MODULES
66         select OF
67         select OF_EARLY_FLATTREE
68         select PERF_USE_VMALLOC if CPU_CK610
69         select RTC_LIB
70         select TIMER_OF
71         select USB_ARCH_HAS_EHCI
72         select USB_ARCH_HAS_OHCI
73         select GENERIC_PCI_IOMAP
74         select HAVE_PCI
75         select PCI_DOMAINS_GENERIC if PCI
76         select PCI_SYSCALL if PCI
77         select PCI_MSI if PCI
78
79 config LOCKDEP_SUPPORT
80         def_bool y
81
82 config ARCH_SUPPORTS_UPROBES
83         def_bool y if !CPU_CK610
84
85 config CPU_HAS_CACHEV2
86         bool
87
88 config CPU_HAS_FPUV2
89         bool
90
91 config CPU_HAS_HILO
92         bool
93
94 config CPU_HAS_TLBI
95         bool
96
97 config CPU_HAS_LDSTEX
98         bool
99         help
100           For SMP, CPU needs "ldex&stex" instructions for atomic operations.
101
102 config CPU_NEED_TLBSYNC
103         bool
104
105 config CPU_NEED_SOFTALIGN
106         bool
107
108 config CPU_NO_USER_BKPT
109         bool
110         help
111           For abiv2 we couldn't use "trap 1" as user space bkpt in gdbserver, because
112           abiv2 is 16/32bit instruction set and "trap 1" is 32bit.
113           So we need a 16bit instruction as user space bkpt, and it will cause an illegal
114           instruction exception.
115           In kernel we parse the *regs->pc to determine whether to send SIGTRAP or not.
116
117 config GENERIC_CALIBRATE_DELAY
118         def_bool y
119
120 config GENERIC_CSUM
121         def_bool y
122
123 config GENERIC_HWEIGHT
124         def_bool y
125
126 config MMU
127         def_bool y
128
129 config STACKTRACE_SUPPORT
130         def_bool y
131
132 config TIME_LOW_RES
133         def_bool y
134
135 config TRACE_IRQFLAGS_SUPPORT
136         def_bool y
137
138 config CPU_TLB_SIZE
139         int
140         default "128"   if (CPU_CK610 || CPU_CK807 || CPU_CK810)
141         default "1024"  if (CPU_CK860)
142
143 config CPU_ASID_BITS
144         int
145         default "8"     if (CPU_CK610 || CPU_CK807 || CPU_CK810)
146         default "12"    if (CPU_CK860)
147
148 config L1_CACHE_SHIFT
149         int
150         default "4"     if (CPU_CK610)
151         default "5"     if (CPU_CK807 || CPU_CK810)
152         default "6"     if (CPU_CK860)
153
154 menu "Processor type and features"
155
156 choice
157         prompt "CPU MODEL"
158         default CPU_CK807
159
160 config CPU_CK610
161         bool "CSKY CPU ck610"
162         select CPU_NEED_TLBSYNC
163         select CPU_NEED_SOFTALIGN
164         select CPU_NO_USER_BKPT
165
166 config CPU_CK810
167         bool "CSKY CPU ck810"
168         select CPU_HAS_HILO
169         select CPU_NEED_TLBSYNC
170
171 config CPU_CK807
172         bool "CSKY CPU ck807"
173         select CPU_HAS_HILO
174
175 config CPU_CK860
176         bool "CSKY CPU ck860"
177         select CPU_HAS_TLBI
178         select CPU_HAS_CACHEV2
179         select CPU_HAS_LDSTEX
180         select CPU_HAS_FPUV2
181 endchoice
182
183 choice
184         prompt "C-SKY PMU type"
185         depends on PERF_EVENTS
186         depends on CPU_CK807 || CPU_CK810 || CPU_CK860
187
188 config CPU_PMU_NONE
189         bool "None"
190
191 config CSKY_PMU_V1
192         bool "Performance Monitoring Unit Ver.1"
193
194 endchoice
195
196 choice
197         prompt "Power Manager Instruction (wait/doze/stop)"
198         default CPU_PM_NONE
199
200 config CPU_PM_NONE
201         bool "None"
202
203 config CPU_PM_WAIT
204         bool "wait"
205
206 config CPU_PM_DOZE
207         bool "doze"
208
209 config CPU_PM_STOP
210         bool "stop"
211 endchoice
212
213 menuconfig HAVE_TCM
214         bool "Tightly-Coupled/Sram Memory"
215         select GENERIC_ALLOCATOR
216         help
217           The implementation are not only used by TCM (Tightly-Coupled Meory)
218           but also used by sram on SOC bus. It follow existed linux tcm
219           software interface, so that old tcm application codes could be
220           re-used directly.
221
222 if HAVE_TCM
223 config ITCM_RAM_BASE
224         hex "ITCM ram base"
225         default 0xffffffff
226
227 config ITCM_NR_PAGES
228         int "Page count of ITCM size: NR*4KB"
229         range 1 256
230         default 32
231
232 config HAVE_DTCM
233         bool "DTCM Support"
234
235 config DTCM_RAM_BASE
236         hex "DTCM ram base"
237         depends on HAVE_DTCM
238         default 0xffffffff
239
240 config DTCM_NR_PAGES
241         int "Page count of DTCM size: NR*4KB"
242         depends on HAVE_DTCM
243         range 1 256
244         default 32
245 endif
246
247 config CPU_HAS_VDSP
248         bool "CPU has VDSP coprocessor"
249         depends on CPU_HAS_FPU && CPU_HAS_FPUV2
250
251 config CPU_HAS_FPU
252         bool "CPU has FPU coprocessor"
253         depends on CPU_CK807 || CPU_CK810 || CPU_CK860
254
255 config CPU_HAS_ICACHE_INS
256         bool "CPU has Icache invalidate instructions"
257         depends on CPU_HAS_CACHEV2
258
259 config CPU_HAS_TEE
260         bool "CPU has Trusted Execution Environment"
261         depends on CPU_CK810
262
263 config SMP
264         bool "Symmetric Multi-Processing (SMP) support for C-SKY"
265         depends on CPU_CK860
266         default n
267
268 config NR_CPUS
269         int "Maximum number of CPUs (2-32)"
270         range 2 32
271         depends on SMP
272         default "2"
273
274 config HIGHMEM
275         bool "High Memory Support"
276         depends on !CPU_CK610
277         default y
278
279 config FORCE_MAX_ZONEORDER
280         int "Maximum zone order"
281         default "11"
282
283 config RAM_BASE
284         hex "DRAM start addr (the same with memory-section in dts)"
285         default 0x0
286
287 config HOTPLUG_CPU
288         bool "Support for hot-pluggable CPUs"
289         select GENERIC_IRQ_MIGRATION
290         depends on SMP
291         help
292           Say Y here to allow turning CPUs off and on. CPUs can be
293           controlled through /sys/devices/system/cpu/cpu1/hotplug/target.
294
295           Say N if you want to disable CPU hotplug.
296 endmenu
297
298 source "arch/csky/Kconfig.platforms"
299
300 source "kernel/Kconfig.hz"
301
302 config SECCOMP
303         bool "Enable seccomp to safely compute untrusted bytecode"
304         help
305           This kernel feature is useful for number crunching applications
306           that may need to compute untrusted bytecode during their
307           execution. By using pipes or other transports made available to
308           the process as file descriptors supporting the read/write
309           syscalls, it's possible to isolate those applications in
310           their own address space using seccomp. Once seccomp is
311           enabled via prctl(PR_SET_SECCOMP), it cannot be disabled
312           and the task is only allowed to execute a few safe syscalls
313           defined by each seccomp mode.