blob: 823d3d5a9e11487c3037fbbc01af0141456c9335 [file] [log] [blame]
Thomas Gleixnerec8f24b2019-05-19 13:07:45 +01001# SPDX-License-Identifier: GPL-2.0-only
Guo Renc32e64e2018-09-05 14:25:06 +08002config CSKY
3 def_bool y
Yury Norov942fa982018-05-16 11:18:49 +03004 select ARCH_32BIT_OFF_T
Christoph Hellwig13bf5ce2019-03-25 15:44:06 +01005 select ARCH_HAS_DMA_PREP_COHERENT
Ma Junde863672020-03-10 23:32:56 +08006 select ARCH_HAS_GCOV_PROFILE_ALL
Guo Renc32e64e2018-09-05 14:25:06 +08007 select ARCH_HAS_SYNC_DMA_FOR_CPU
8 select ARCH_HAS_SYNC_DMA_FOR_DEVICE
9 select ARCH_USE_BUILTIN_BSWAP
Guo Ren8e35ac72020-12-20 08:12:45 +000010 select ARCH_USE_QUEUED_RWLOCKS
Guenter Roeckaeba0b82021-09-16 21:38:36 -070011 select ARCH_WANT_FRAME_POINTERS if !CPU_CK610 && $(cc-option,-mbacktrace)
Guo Ren953131e2020-07-30 12:44:12 +000012 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
Guo Renc32e64e2018-09-05 14:25:06 +080013 select COMMON_CLK
14 select CLKSRC_MMIO
Guo Ren1994cc42019-05-10 12:57:27 +080015 select CSKY_MPINTC if CPU_CK860
16 select CSKY_MP_TIMER if CPU_CK860
17 select CSKY_APB_INTC
Christoph Hellwigf04b9512018-11-04 17:47:44 +010018 select DMA_DIRECT_REMAP
Guo Renc32e64e2018-09-05 14:25:06 +080019 select IRQ_DOMAIN
20 select HANDLE_DOMAIN_IRQ
21 select DW_APB_TIMER_OF
Christoph Hellwig0055f672019-08-13 11:41:57 +020022 select GENERIC_IOREMAP
Guo Renc32e64e2018-09-05 14:25:06 +080023 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
Guo Renc32e64e2018-09-05 14:25:06 +080031 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
Guo Ren0d3b0512021-01-17 23:38:18 +080038 select GENERIC_TIME_VSYSCALL
39 select GENERIC_VDSO_32
40 select GENERIC_GETTIMEOFDAY
Guo Ren1994cc42019-05-10 12:57:27 +080041 select GX6605S_TIMER if CPU_CK610
Guo Renc32e64e2018-09-05 14:25:06 +080042 select HAVE_ARCH_TRACEHOOK
Guo Ren2f7932b2019-03-20 18:27:27 +080043 select HAVE_ARCH_AUDITSYSCALL
Guo Ren953131e2020-07-30 12:44:12 +000044 select HAVE_ARCH_MMAP_RND_BITS
Guo Rene95a4f82020-05-26 08:11:52 +000045 select HAVE_ARCH_SECCOMP_FILTER
Guo Renbdcd93e2020-07-31 09:13:51 +000046 select HAVE_CONTEXT_TRACKING
47 select HAVE_VIRT_CPU_ACCOUNTING_GEN
Guo Ren18c07d22020-05-13 15:15:25 +080048 select HAVE_DEBUG_BUGVERBOSE
Guo Renc109f422020-12-24 03:34:43 +000049 select HAVE_DEBUG_KMEMLEAK
Guo Ren28bb0302019-03-01 08:50:36 +080050 select HAVE_DYNAMIC_FTRACE
Guo Ren89a39272020-02-18 20:27:39 +080051 select HAVE_DYNAMIC_FTRACE_WITH_REGS
Guo Ren0d3b0512021-01-17 23:38:18 +080052 select HAVE_GENERIC_VDSO
Guo Ren230c77a2018-12-09 14:29:59 +080053 select HAVE_FUNCTION_TRACER
Guo Rend7950be2018-12-15 21:04:27 +080054 select HAVE_FUNCTION_GRAPH_TRACER
Guo Ren71e193d2020-07-28 16:30:46 +000055 select HAVE_FUNCTION_ERROR_INJECTION
Guo Rend6c5cb92020-12-20 01:35:09 +000056 select HAVE_FUTEX_CMPXCHG if FUTEX && SMP
Guo Ren28bb0302019-03-01 08:50:36 +080057 select HAVE_FTRACE_MCOUNT_RECORD
Guo Renc32e64e2018-09-05 14:25:06 +080058 select HAVE_KERNEL_GZIP
59 select HAVE_KERNEL_LZO
60 select HAVE_KERNEL_LZMA
Guo Ren33e53ae2020-04-01 09:17:02 +080061 select HAVE_KPROBES if !CPU_CK610
62 select HAVE_KPROBES_ON_FTRACE if !CPU_CK610
63 select HAVE_KRETPROBES if !CPU_CK610
Guo Renf50fd2d2019-01-02 22:09:25 +080064 select HAVE_PERF_EVENTS
Mao Handaac95e2019-04-15 17:17:29 +080065 select HAVE_PERF_REGS
66 select HAVE_PERF_USER_STACK_DUMP
Guo Renc32e64e2018-09-05 14:25:06 +080067 select HAVE_DMA_CONTIGUOUS
Guo Renbfe47f32019-12-17 14:57:22 +080068 select HAVE_REGS_AND_STACK_ACCESS_API
Guo Ren9866d142019-11-05 09:58:33 +080069 select HAVE_RSEQ
Mao Han2f78c732019-10-11 10:56:55 +080070 select HAVE_STACKPROTECTOR
Guo Ren2f7932b2019-03-20 18:27:27 +080071 select HAVE_SYSCALL_TRACEPOINTS
Guo Renc32e64e2018-09-05 14:25:06 +080072 select MAY_HAVE_SPARSE_IRQ
73 select MODULES_USE_ELF_RELA if MODULES
Guo Renc32e64e2018-09-05 14:25:06 +080074 select OF
75 select OF_EARLY_FLATTREE
Guo Renf50fd2d2019-01-02 22:09:25 +080076 select PERF_USE_VMALLOC if CPU_CK610
Guo Renc32e64e2018-09-05 14:25:06 +080077 select RTC_LIB
78 select TIMER_OF
MaJun5b49c822020-01-27 10:56:21 +080079 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
Christoph Hellwig5e6e9852020-09-03 16:22:35 +020084 select SET_FS
Masahiro Yamada4aae6832021-07-31 14:22:32 +090085 select TRACE_IRQFLAGS_SUPPORT
Guo Renc32e64e2018-09-05 14:25:06 +080086
Guo Ren000591f2020-04-02 19:39:42 +080087config LOCKDEP_SUPPORT
88 def_bool y
89
Guo Ren8f6bb792020-04-02 19:52:27 +080090config ARCH_SUPPORTS_UPROBES
91 def_bool y if !CPU_CK610
92
Guo Renc32e64e2018-09-05 14:25:06 +080093config CPU_HAS_CACHEV2
94 bool
95
96config CPU_HAS_FPUV2
97 bool
98
99config CPU_HAS_HILO
100 bool
101
102config CPU_HAS_TLBI
103 bool
104
105config CPU_HAS_LDSTEX
106 bool
107 help
Randy Dunlapbebd26a2020-01-31 17:52:30 -0800108 For SMP, CPU needs "ldex&stex" instructions for atomic operations.
Guo Renc32e64e2018-09-05 14:25:06 +0800109
110config CPU_NEED_TLBSYNC
111 bool
112
113config CPU_NEED_SOFTALIGN
114 bool
115
116config CPU_NO_USER_BKPT
117 bool
118 help
119 For abiv2 we couldn't use "trap 1" as user space bkpt in gdbserver, because
120 abiv2 is 16/32bit instruction set and "trap 1" is 32bit.
121 So we need a 16bit instruction as user space bkpt, and it will cause an illegal
122 instruction exception.
123 In kernel we parse the *regs->pc to determine whether to send SIGTRAP or not.
124
125config GENERIC_CALIBRATE_DELAY
126 def_bool y
127
128config GENERIC_CSUM
129 def_bool y
130
131config GENERIC_HWEIGHT
132 def_bool y
133
134config MMU
135 def_bool y
136
Guo Ren0ea2dc72018-12-09 14:18:05 +0800137config STACKTRACE_SUPPORT
138 def_bool y
139
Guo Renc32e64e2018-09-05 14:25:06 +0800140config TIME_LOW_RES
141 def_bool y
142
Guo Renc32e64e2018-09-05 14:25:06 +0800143config CPU_TLB_SIZE
144 int
145 default "128" if (CPU_CK610 || CPU_CK807 || CPU_CK810)
146 default "1024" if (CPU_CK860)
147
148config CPU_ASID_BITS
149 int
150 default "8" if (CPU_CK610 || CPU_CK807 || CPU_CK810)
151 default "12" if (CPU_CK860)
152
153config L1_CACHE_SHIFT
154 int
155 default "4" if (CPU_CK610)
156 default "5" if (CPU_CK807 || CPU_CK810)
157 default "6" if (CPU_CK860)
158
Guo Ren953131e2020-07-30 12:44:12 +0000159config ARCH_MMAP_RND_BITS_MIN
160 default 8
161
162# max bits determined by the following formula:
163# VA_BITS - PAGE_SHIFT - 3
164config ARCH_MMAP_RND_BITS_MAX
165 default 17
166
Guo Renc32e64e2018-09-05 14:25:06 +0800167menu "Processor type and features"
168
169choice
170 prompt "CPU MODEL"
171 default CPU_CK807
172
173config CPU_CK610
174 bool "CSKY CPU ck610"
175 select CPU_NEED_TLBSYNC
176 select CPU_NEED_SOFTALIGN
177 select CPU_NO_USER_BKPT
178
179config CPU_CK810
180 bool "CSKY CPU ck810"
181 select CPU_HAS_HILO
182 select CPU_NEED_TLBSYNC
183
184config CPU_CK807
185 bool "CSKY CPU ck807"
186 select CPU_HAS_HILO
187
188config CPU_CK860
189 bool "CSKY CPU ck860"
190 select CPU_HAS_TLBI
191 select CPU_HAS_CACHEV2
192 select CPU_HAS_LDSTEX
193 select CPU_HAS_FPUV2
194endchoice
195
196choice
Guo Ren0c8a32e2020-09-07 06:20:18 +0000197 prompt "PAGE OFFSET"
198 default PAGE_OFFSET_80000000
199
200config PAGE_OFFSET_80000000
201 bool "PAGE OFFSET 2G (user:kernel = 2:2)"
202
203config PAGE_OFFSET_A0000000
204 bool "PAGE OFFSET 2.5G (user:kernel = 2.5:1.5)"
205endchoice
206
207config PAGE_OFFSET
208 hex
209 default 0x80000000 if PAGE_OFFSET_80000000
210 default 0xa0000000 if PAGE_OFFSET_A0000000
211choice
212
Guo Renf50fd2d2019-01-02 22:09:25 +0800213 prompt "C-SKY PMU type"
214 depends on PERF_EVENTS
215 depends on CPU_CK807 || CPU_CK810 || CPU_CK860
216
217config CPU_PMU_NONE
218 bool "None"
219
220config CSKY_PMU_V1
221 bool "Performance Monitoring Unit Ver.1"
222
223endchoice
224
225choice
Guo Renc32e64e2018-09-05 14:25:06 +0800226 prompt "Power Manager Instruction (wait/doze/stop)"
227 default CPU_PM_NONE
228
229config CPU_PM_NONE
230 bool "None"
231
232config CPU_PM_WAIT
233 bool "wait"
234
235config CPU_PM_DOZE
236 bool "doze"
237
238config CPU_PM_STOP
239 bool "stop"
240endchoice
241
Guo Renf525bb22019-11-27 08:44:33 +0800242menuconfig HAVE_TCM
243 bool "Tightly-Coupled/Sram Memory"
Guenter Roecke21e52a2021-09-16 21:38:38 -0700244 depends on !COMPILE_TEST
Guo Renf525bb22019-11-27 08:44:33 +0800245 help
246 The implementation are not only used by TCM (Tightly-Coupled Meory)
247 but also used by sram on SOC bus. It follow existed linux tcm
248 software interface, so that old tcm application codes could be
249 re-used directly.
250
251if HAVE_TCM
252config ITCM_RAM_BASE
253 hex "ITCM ram base"
254 default 0xffffffff
255
256config ITCM_NR_PAGES
257 int "Page count of ITCM size: NR*4KB"
258 range 1 256
259 default 32
260
261config HAVE_DTCM
262 bool "DTCM Support"
263
264config DTCM_RAM_BASE
265 hex "DTCM ram base"
266 depends on HAVE_DTCM
267 default 0xffffffff
268
269config DTCM_NR_PAGES
270 int "Page count of DTCM size: NR*4KB"
271 depends on HAVE_DTCM
272 range 1 256
273 default 32
274endif
275
Guo Renc32e64e2018-09-05 14:25:06 +0800276config CPU_HAS_VDSP
277 bool "CPU has VDSP coprocessor"
278 depends on CPU_HAS_FPU && CPU_HAS_FPUV2
279
280config CPU_HAS_FPU
281 bool "CPU has FPU coprocessor"
282 depends on CPU_CK807 || CPU_CK810 || CPU_CK860
283
Guo Ren761b4f62020-01-22 11:15:14 +0800284config CPU_HAS_ICACHE_INS
285 bool "CPU has Icache invalidate instructions"
286 depends on CPU_HAS_CACHEV2
287
Guo Renc32e64e2018-09-05 14:25:06 +0800288config CPU_HAS_TEE
289 bool "CPU has Trusted Execution Environment"
290 depends on CPU_CK810
291
292config SMP
293 bool "Symmetric Multi-Processing (SMP) support for C-SKY"
294 depends on CPU_CK860
295 default n
296
297config NR_CPUS
298 int "Maximum number of CPUs (2-32)"
299 range 2 32
300 depends on SMP
Guo Ren50d23a12020-07-30 13:12:00 +0000301 default "4"
Guo Renc32e64e2018-09-05 14:25:06 +0800302
303config HIGHMEM
304 bool "High Memory Support"
305 depends on !CPU_CK610
Thomas Gleixner5af627a2020-11-03 10:27:23 +0100306 select KMAP_LOCAL
Guo Renc32e64e2018-09-05 14:25:06 +0800307 default y
308
309config FORCE_MAX_ZONEORDER
310 int "Maximum zone order"
311 default "11"
312
Randy Dunlapd1991612021-04-16 15:46:03 -0700313config DRAM_BASE
Guo Renc32e64e2018-09-05 14:25:06 +0800314 hex "DRAM start addr (the same with memory-section in dts)"
315 default 0x0
316
Guo Ren859e5f42018-12-19 19:56:14 +0800317config HOTPLUG_CPU
318 bool "Support for hot-pluggable CPUs"
319 select GENERIC_IRQ_MIGRATION
320 depends on SMP
321 help
322 Say Y here to allow turning CPUs off and on. CPUs can be
323 controlled through /sys/devices/system/cpu/cpu1/hotplug/target.
324
325 Say N if you want to disable CPU hotplug.
Guo Renc32e64e2018-09-05 14:25:06 +0800326endmenu
327
Guo Rena736fa12020-01-11 13:44:32 +0800328source "arch/csky/Kconfig.platforms"
329
Guo Renc32e64e2018-09-05 14:25:06 +0800330source "kernel/Kconfig.hz"