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