GNU Linux-libre 6.1.90-gnu
[releases.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
11         select ARCH_USE_QUEUED_SPINLOCKS
12         select ARCH_INLINE_READ_LOCK if !PREEMPTION
13         select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION
14         select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPTION
15         select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPTION
16         select ARCH_INLINE_READ_UNLOCK if !PREEMPTION
17         select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPTION
18         select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPTION
19         select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPTION
20         select ARCH_INLINE_WRITE_LOCK if !PREEMPTION
21         select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPTION
22         select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPTION
23         select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPTION
24         select ARCH_INLINE_WRITE_UNLOCK if !PREEMPTION
25         select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPTION
26         select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPTION
27         select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPTION
28         select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPTION
29         select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPTION
30         select ARCH_INLINE_SPIN_LOCK if !PREEMPTION
31         select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPTION
32         select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPTION
33         select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPTION
34         select ARCH_INLINE_SPIN_UNLOCK if !PREEMPTION
35         select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION
36         select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION
37         select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION
38         select ARCH_WANT_FRAME_POINTERS if !CPU_CK610 && $(cc-option,-mbacktrace)
39         select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
40         select COMMON_CLK
41         select CLKSRC_MMIO
42         select CSKY_MPINTC if CPU_CK860
43         select CSKY_MP_TIMER if CPU_CK860
44         select CSKY_APB_INTC
45         select DMA_DIRECT_REMAP
46         select IRQ_DOMAIN
47         select DW_APB_TIMER_OF
48         select GENERIC_IOREMAP
49         select GENERIC_LIB_ASHLDI3
50         select GENERIC_LIB_ASHRDI3
51         select GENERIC_LIB_LSHRDI3
52         select GENERIC_LIB_MULDI3
53         select GENERIC_LIB_CMPDI2
54         select GENERIC_LIB_UCMPDI2
55         select GENERIC_ALLOCATOR
56         select GENERIC_ATOMIC64
57         select GENERIC_CPU_DEVICES
58         select GENERIC_IRQ_CHIP
59         select GENERIC_IRQ_PROBE
60         select GENERIC_IRQ_SHOW
61         select GENERIC_IRQ_MULTI_HANDLER
62         select GENERIC_SCHED_CLOCK
63         select GENERIC_SMP_IDLE_THREAD
64         select GENERIC_TIME_VSYSCALL
65         select GENERIC_VDSO_32
66         select GENERIC_GETTIMEOFDAY
67         select GX6605S_TIMER if CPU_CK610
68         select HAVE_ARCH_TRACEHOOK
69         select HAVE_ARCH_AUDITSYSCALL
70         select HAVE_ARCH_JUMP_LABEL if !CPU_CK610
71         select HAVE_ARCH_JUMP_LABEL_RELATIVE
72         select HAVE_ARCH_MMAP_RND_BITS
73         select HAVE_ARCH_SECCOMP_FILTER
74         select HAVE_CONTEXT_TRACKING_USER
75         select HAVE_VIRT_CPU_ACCOUNTING_GEN
76         select HAVE_DEBUG_BUGVERBOSE
77         select HAVE_DEBUG_KMEMLEAK
78         select HAVE_DYNAMIC_FTRACE
79         select HAVE_DYNAMIC_FTRACE_WITH_REGS
80         select HAVE_GENERIC_VDSO
81         select HAVE_FUNCTION_TRACER
82         select HAVE_FUNCTION_GRAPH_TRACER
83         select HAVE_FUNCTION_ERROR_INJECTION
84         select HAVE_FTRACE_MCOUNT_RECORD
85         select HAVE_KERNEL_GZIP
86         select HAVE_KERNEL_LZO
87         select HAVE_KERNEL_LZMA
88         select HAVE_KPROBES if !CPU_CK610
89         select HAVE_KPROBES_ON_FTRACE if !CPU_CK610
90         select HAVE_KRETPROBES if !CPU_CK610
91         select HAVE_PERF_EVENTS
92         select HAVE_PERF_REGS
93         select HAVE_PERF_USER_STACK_DUMP
94         select HAVE_DMA_CONTIGUOUS
95         select HAVE_REGS_AND_STACK_ACCESS_API
96         select HAVE_RSEQ
97         select HAVE_STACKPROTECTOR
98         select HAVE_SYSCALL_TRACEPOINTS
99         select LOCK_MM_AND_FIND_VMA
100         select MAY_HAVE_SPARSE_IRQ
101         select MODULES_USE_ELF_RELA if MODULES
102         select OF
103         select OF_EARLY_FLATTREE
104         select PERF_USE_VMALLOC if CPU_CK610
105         select RTC_LIB
106         select TIMER_OF
107         select GENERIC_PCI_IOMAP
108         select HAVE_PCI
109         select PCI_DOMAINS_GENERIC if PCI
110         select PCI_SYSCALL if PCI
111         select PCI_MSI if PCI
112         select TRACE_IRQFLAGS_SUPPORT
113
114 config LOCKDEP_SUPPORT
115         def_bool y
116
117 config ARCH_SUPPORTS_UPROBES
118         def_bool y if !CPU_CK610
119
120 config CPU_HAS_CACHEV2
121         bool
122
123 config CPU_HAS_FPUV2
124         bool
125
126 config CPU_HAS_HILO
127         bool
128
129 config CPU_HAS_TLBI
130         bool
131
132 config CPU_HAS_LDSTEX
133         bool
134         help
135           For SMP, CPU needs "ldex&stex" instructions for atomic operations.
136
137 config CPU_NEED_TLBSYNC
138         bool
139
140 config CPU_NEED_SOFTALIGN
141         bool
142
143 config CPU_NO_USER_BKPT
144         bool
145         help
146           For abiv2 we couldn't use "trap 1" as user space bkpt in gdbserver, because
147           abiv2 is 16/32bit instruction set and "trap 1" is 32bit.
148           So we need a 16bit instruction as user space bkpt, and it will cause an illegal
149           instruction exception.
150           In kernel we parse the *regs->pc to determine whether to send SIGTRAP or not.
151
152 config GENERIC_CALIBRATE_DELAY
153         def_bool y
154
155 config GENERIC_CSUM
156         def_bool y
157
158 config GENERIC_HWEIGHT
159         def_bool y
160
161 config MMU
162         def_bool y
163
164 config STACKTRACE_SUPPORT
165         def_bool y
166
167 config TIME_LOW_RES
168         def_bool y
169
170 config CPU_TLB_SIZE
171         int
172         default "128"   if (CPU_CK610 || CPU_CK807 || CPU_CK810)
173         default "1024"  if (CPU_CK860)
174
175 config CPU_ASID_BITS
176         int
177         default "8"     if (CPU_CK610 || CPU_CK807 || CPU_CK810)
178         default "12"    if (CPU_CK860)
179
180 config L1_CACHE_SHIFT
181         int
182         default "4"     if (CPU_CK610)
183         default "5"     if (CPU_CK807 || CPU_CK810)
184         default "6"     if (CPU_CK860)
185
186 config ARCH_MMAP_RND_BITS_MIN
187         default 8
188
189 # max bits determined by the following formula:
190 #  VA_BITS - PAGE_SHIFT - 3
191 config ARCH_MMAP_RND_BITS_MAX
192         default 17
193
194 menu "Processor type and features"
195
196 choice
197         prompt "CPU MODEL"
198         default CPU_CK807
199
200 config CPU_CK610
201         bool "CSKY CPU ck610"
202         select CPU_NEED_TLBSYNC
203         select CPU_NEED_SOFTALIGN
204         select CPU_NO_USER_BKPT
205
206 config CPU_CK810
207         bool "CSKY CPU ck810"
208         select CPU_HAS_HILO
209         select CPU_NEED_TLBSYNC
210
211 config CPU_CK807
212         bool "CSKY CPU ck807"
213         select CPU_HAS_HILO
214
215 config CPU_CK860
216         bool "CSKY CPU ck860"
217         select CPU_HAS_TLBI
218         select CPU_HAS_CACHEV2
219         select CPU_HAS_LDSTEX
220         select CPU_HAS_FPUV2
221 endchoice
222
223 choice
224         prompt "PAGE OFFSET"
225         default PAGE_OFFSET_80000000
226
227 config PAGE_OFFSET_80000000
228         bool "PAGE OFFSET 2G (user:kernel = 2:2)"
229
230 config PAGE_OFFSET_A0000000
231         bool "PAGE OFFSET 2.5G (user:kernel = 2.5:1.5)"
232 endchoice
233
234 config PAGE_OFFSET
235         hex
236         default 0x80000000 if PAGE_OFFSET_80000000
237         default 0xa0000000 if PAGE_OFFSET_A0000000
238 choice
239
240         prompt "C-SKY PMU type"
241         depends on PERF_EVENTS
242         depends on CPU_CK807 || CPU_CK810 || CPU_CK860
243
244 config CPU_PMU_NONE
245         bool "None"
246
247 config CSKY_PMU_V1
248         bool "Performance Monitoring Unit Ver.1"
249
250 endchoice
251
252 choice
253         prompt "Power Manager Instruction (wait/doze/stop)"
254         default CPU_PM_NONE
255
256 config CPU_PM_NONE
257         bool "None"
258
259 config CPU_PM_WAIT
260         bool "wait"
261
262 config CPU_PM_DOZE
263         bool "doze"
264
265 config CPU_PM_STOP
266         bool "stop"
267 endchoice
268
269 menuconfig HAVE_TCM
270         bool "Tightly-Coupled/Sram Memory"
271         depends on !COMPILE_TEST
272         help
273           The implementation are not only used by TCM (Tightly-Coupled Meory)
274           but also used by sram on SOC bus. It follow existed linux tcm
275           software interface, so that old tcm application codes could be
276           re-used directly.
277
278 if HAVE_TCM
279 config ITCM_RAM_BASE
280         hex "ITCM ram base"
281         default 0xffffffff
282
283 config ITCM_NR_PAGES
284         int "Page count of ITCM size: NR*4KB"
285         range 1 256
286         default 32
287
288 config HAVE_DTCM
289         bool "DTCM Support"
290
291 config DTCM_RAM_BASE
292         hex "DTCM ram base"
293         depends on HAVE_DTCM
294         default 0xffffffff
295
296 config DTCM_NR_PAGES
297         int "Page count of DTCM size: NR*4KB"
298         depends on HAVE_DTCM
299         range 1 256
300         default 32
301 endif
302
303 config CPU_HAS_VDSP
304         bool "CPU has VDSP coprocessor"
305         depends on CPU_HAS_FPU && CPU_HAS_FPUV2
306
307 config CPU_HAS_FPU
308         bool "CPU has FPU coprocessor"
309         depends on CPU_CK807 || CPU_CK810 || CPU_CK860
310
311 config CPU_HAS_ICACHE_INS
312         bool "CPU has Icache invalidate instructions"
313         depends on CPU_HAS_CACHEV2
314
315 config CPU_HAS_TEE
316         bool "CPU has Trusted Execution Environment"
317         depends on CPU_CK810
318
319 config SMP
320         bool "Symmetric Multi-Processing (SMP) support for C-SKY"
321         depends on CPU_CK860
322         default n
323
324 config NR_CPUS
325         int "Maximum number of CPUs (2-32)"
326         range 2 32
327         depends on SMP
328         default "4"
329
330 config HIGHMEM
331         bool "High Memory Support"
332         depends on !CPU_CK610
333         select KMAP_LOCAL
334         default y
335
336 config ARCH_FORCE_MAX_ORDER
337         int "Maximum zone order"
338         default "11"
339
340 config DRAM_BASE
341         hex "DRAM start addr (the same with memory-section in dts)"
342         default 0x0
343
344 config HOTPLUG_CPU
345         bool "Support for hot-pluggable CPUs"
346         select GENERIC_IRQ_MIGRATION
347         depends on SMP
348         help
349           Say Y here to allow turning CPUs off and on. CPUs can be
350           controlled through /sys/devices/system/cpu/cpu1/hotplug/target.
351
352           Say N if you want to disable CPU hotplug.
353
354 config HAVE_EFFICIENT_UNALIGNED_STRING_OPS
355         bool "Enable EFFICIENT_UNALIGNED_STRING_OPS for abiv2"
356         depends on CPU_CK807 || CPU_CK810 || CPU_CK860
357         help
358           Say Y here to enable EFFICIENT_UNALIGNED_STRING_OPS. Some CPU models could
359           deal with unaligned access by hardware.
360
361 endmenu
362
363 source "arch/csky/Kconfig.platforms"
364
365 source "kernel/Kconfig.hz"