blob: 94545d50d40fafe80a9996d749da97487c6a8842 [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
10 select ARCH_USE_QUEUED_RWLOCKS if NR_CPUS>2
11 select COMMON_CLK
12 select CLKSRC_MMIO
Guo Ren1994cc42019-05-10 12:57:27 +080013 select CSKY_MPINTC if CPU_CK860
14 select CSKY_MP_TIMER if CPU_CK860
15 select CSKY_APB_INTC
Christoph Hellwigf04b9512018-11-04 17:47:44 +010016 select DMA_DIRECT_REMAP
Guo Renc32e64e2018-09-05 14:25:06 +080017 select IRQ_DOMAIN
18 select HANDLE_DOMAIN_IRQ
19 select DW_APB_TIMER_OF
Christoph Hellwig0055f672019-08-13 11:41:57 +020020 select GENERIC_IOREMAP
Guo Renc32e64e2018-09-05 14:25:06 +080021 select GENERIC_LIB_ASHLDI3
22 select GENERIC_LIB_ASHRDI3
23 select GENERIC_LIB_LSHRDI3
24 select GENERIC_LIB_MULDI3
25 select GENERIC_LIB_CMPDI2
26 select GENERIC_LIB_UCMPDI2
27 select GENERIC_ALLOCATOR
28 select GENERIC_ATOMIC64
29 select GENERIC_CLOCKEVENTS
30 select GENERIC_CPU_DEVICES
31 select GENERIC_IRQ_CHIP
32 select GENERIC_IRQ_PROBE
33 select GENERIC_IRQ_SHOW
34 select GENERIC_IRQ_MULTI_HANDLER
35 select GENERIC_SCHED_CLOCK
36 select GENERIC_SMP_IDLE_THREAD
Guo Ren1994cc42019-05-10 12:57:27 +080037 select GX6605S_TIMER if CPU_CK610
Guo Renc32e64e2018-09-05 14:25:06 +080038 select HAVE_ARCH_TRACEHOOK
Guo Ren2f7932b2019-03-20 18:27:27 +080039 select HAVE_ARCH_AUDITSYSCALL
Guo Ren0b9f3862020-02-12 10:24:52 +080040 select HAVE_COPY_THREAD_TLS
Guo Ren28bb0302019-03-01 08:50:36 +080041 select HAVE_DYNAMIC_FTRACE
Guo Ren89a39272020-02-18 20:27:39 +080042 select HAVE_DYNAMIC_FTRACE_WITH_REGS
Guo Ren230c77a2018-12-09 14:29:59 +080043 select HAVE_FUNCTION_TRACER
Guo Rend7950be2018-12-15 21:04:27 +080044 select HAVE_FUNCTION_GRAPH_TRACER
Guo Ren28bb0302019-03-01 08:50:36 +080045 select HAVE_FTRACE_MCOUNT_RECORD
Guo Renc32e64e2018-09-05 14:25:06 +080046 select HAVE_KERNEL_GZIP
47 select HAVE_KERNEL_LZO
48 select HAVE_KERNEL_LZMA
Guo Ren33e53ae2020-04-01 09:17:02 +080049 select HAVE_KPROBES if !CPU_CK610
50 select HAVE_KPROBES_ON_FTRACE if !CPU_CK610
51 select HAVE_KRETPROBES if !CPU_CK610
Guo Renf50fd2d2019-01-02 22:09:25 +080052 select HAVE_PERF_EVENTS
Mao Handaac95e2019-04-15 17:17:29 +080053 select HAVE_PERF_REGS
54 select HAVE_PERF_USER_STACK_DUMP
Guo Renc32e64e2018-09-05 14:25:06 +080055 select HAVE_DMA_CONTIGUOUS
Guo Renbfe47f32019-12-17 14:57:22 +080056 select HAVE_REGS_AND_STACK_ACCESS_API
Guo Ren9866d142019-11-05 09:58:33 +080057 select HAVE_RSEQ
Mao Han2f78c732019-10-11 10:56:55 +080058 select HAVE_STACKPROTECTOR
Guo Ren2f7932b2019-03-20 18:27:27 +080059 select HAVE_SYSCALL_TRACEPOINTS
Guo Renc32e64e2018-09-05 14:25:06 +080060 select MAY_HAVE_SPARSE_IRQ
61 select MODULES_USE_ELF_RELA if MODULES
Guo Renc32e64e2018-09-05 14:25:06 +080062 select OF
63 select OF_EARLY_FLATTREE
Guo Renf50fd2d2019-01-02 22:09:25 +080064 select PERF_USE_VMALLOC if CPU_CK610
Guo Renc32e64e2018-09-05 14:25:06 +080065 select RTC_LIB
66 select TIMER_OF
67 select USB_ARCH_HAS_EHCI
68 select USB_ARCH_HAS_OHCI
MaJun5b49c822020-01-27 10:56:21 +080069 select GENERIC_PCI_IOMAP
70 select HAVE_PCI
71 select PCI_DOMAINS_GENERIC if PCI
72 select PCI_SYSCALL if PCI
73 select PCI_MSI if PCI
Guo Renc32e64e2018-09-05 14:25:06 +080074
Guo Ren000591f2020-04-02 19:39:42 +080075config LOCKDEP_SUPPORT
76 def_bool y
77
Guo Ren8f6bb792020-04-02 19:52:27 +080078config ARCH_SUPPORTS_UPROBES
79 def_bool y if !CPU_CK610
80
Guo Renc32e64e2018-09-05 14:25:06 +080081config CPU_HAS_CACHEV2
82 bool
83
84config CPU_HAS_FPUV2
85 bool
86
87config CPU_HAS_HILO
88 bool
89
90config CPU_HAS_TLBI
91 bool
92
93config CPU_HAS_LDSTEX
94 bool
95 help
Randy Dunlapbebd26a2020-01-31 17:52:30 -080096 For SMP, CPU needs "ldex&stex" instructions for atomic operations.
Guo Renc32e64e2018-09-05 14:25:06 +080097
98config CPU_NEED_TLBSYNC
99 bool
100
101config CPU_NEED_SOFTALIGN
102 bool
103
104config CPU_NO_USER_BKPT
105 bool
106 help
107 For abiv2 we couldn't use "trap 1" as user space bkpt in gdbserver, because
108 abiv2 is 16/32bit instruction set and "trap 1" is 32bit.
109 So we need a 16bit instruction as user space bkpt, and it will cause an illegal
110 instruction exception.
111 In kernel we parse the *regs->pc to determine whether to send SIGTRAP or not.
112
113config GENERIC_CALIBRATE_DELAY
114 def_bool y
115
116config GENERIC_CSUM
117 def_bool y
118
119config GENERIC_HWEIGHT
120 def_bool y
121
122config MMU
123 def_bool y
124
Guo Ren0ea2dc72018-12-09 14:18:05 +0800125config STACKTRACE_SUPPORT
126 def_bool y
127
Guo Renc32e64e2018-09-05 14:25:06 +0800128config TIME_LOW_RES
129 def_bool y
130
131config TRACE_IRQFLAGS_SUPPORT
132 def_bool y
133
134config CPU_TLB_SIZE
135 int
136 default "128" if (CPU_CK610 || CPU_CK807 || CPU_CK810)
137 default "1024" if (CPU_CK860)
138
139config CPU_ASID_BITS
140 int
141 default "8" if (CPU_CK610 || CPU_CK807 || CPU_CK810)
142 default "12" if (CPU_CK860)
143
144config L1_CACHE_SHIFT
145 int
146 default "4" if (CPU_CK610)
147 default "5" if (CPU_CK807 || CPU_CK810)
148 default "6" if (CPU_CK860)
149
150menu "Processor type and features"
151
152choice
153 prompt "CPU MODEL"
154 default CPU_CK807
155
156config CPU_CK610
157 bool "CSKY CPU ck610"
158 select CPU_NEED_TLBSYNC
159 select CPU_NEED_SOFTALIGN
160 select CPU_NO_USER_BKPT
161
162config CPU_CK810
163 bool "CSKY CPU ck810"
164 select CPU_HAS_HILO
165 select CPU_NEED_TLBSYNC
166
167config CPU_CK807
168 bool "CSKY CPU ck807"
169 select CPU_HAS_HILO
170
171config CPU_CK860
172 bool "CSKY CPU ck860"
173 select CPU_HAS_TLBI
174 select CPU_HAS_CACHEV2
175 select CPU_HAS_LDSTEX
176 select CPU_HAS_FPUV2
177endchoice
178
179choice
Guo Renf50fd2d2019-01-02 22:09:25 +0800180 prompt "C-SKY PMU type"
181 depends on PERF_EVENTS
182 depends on CPU_CK807 || CPU_CK810 || CPU_CK860
183
184config CPU_PMU_NONE
185 bool "None"
186
187config CSKY_PMU_V1
188 bool "Performance Monitoring Unit Ver.1"
189
190endchoice
191
192choice
Guo Renc32e64e2018-09-05 14:25:06 +0800193 prompt "Power Manager Instruction (wait/doze/stop)"
194 default CPU_PM_NONE
195
196config CPU_PM_NONE
197 bool "None"
198
199config CPU_PM_WAIT
200 bool "wait"
201
202config CPU_PM_DOZE
203 bool "doze"
204
205config CPU_PM_STOP
206 bool "stop"
207endchoice
208
Guo Renf525bb22019-11-27 08:44:33 +0800209menuconfig HAVE_TCM
210 bool "Tightly-Coupled/Sram Memory"
Guo Renf525bb22019-11-27 08:44:33 +0800211 select GENERIC_ALLOCATOR
212 help
213 The implementation are not only used by TCM (Tightly-Coupled Meory)
214 but also used by sram on SOC bus. It follow existed linux tcm
215 software interface, so that old tcm application codes could be
216 re-used directly.
217
218if HAVE_TCM
219config ITCM_RAM_BASE
220 hex "ITCM ram base"
221 default 0xffffffff
222
223config ITCM_NR_PAGES
224 int "Page count of ITCM size: NR*4KB"
225 range 1 256
226 default 32
227
228config HAVE_DTCM
229 bool "DTCM Support"
230
231config DTCM_RAM_BASE
232 hex "DTCM ram base"
233 depends on HAVE_DTCM
234 default 0xffffffff
235
236config DTCM_NR_PAGES
237 int "Page count of DTCM size: NR*4KB"
238 depends on HAVE_DTCM
239 range 1 256
240 default 32
241endif
242
Guo Renc32e64e2018-09-05 14:25:06 +0800243config CPU_HAS_VDSP
244 bool "CPU has VDSP coprocessor"
245 depends on CPU_HAS_FPU && CPU_HAS_FPUV2
246
247config CPU_HAS_FPU
248 bool "CPU has FPU coprocessor"
249 depends on CPU_CK807 || CPU_CK810 || CPU_CK860
250
Guo Ren761b4f62020-01-22 11:15:14 +0800251config CPU_HAS_ICACHE_INS
252 bool "CPU has Icache invalidate instructions"
253 depends on CPU_HAS_CACHEV2
254
Guo Renc32e64e2018-09-05 14:25:06 +0800255config CPU_HAS_TEE
256 bool "CPU has Trusted Execution Environment"
257 depends on CPU_CK810
258
259config SMP
260 bool "Symmetric Multi-Processing (SMP) support for C-SKY"
261 depends on CPU_CK860
262 default n
263
264config NR_CPUS
265 int "Maximum number of CPUs (2-32)"
266 range 2 32
267 depends on SMP
268 default "2"
269
270config HIGHMEM
271 bool "High Memory Support"
272 depends on !CPU_CK610
273 default y
274
275config FORCE_MAX_ZONEORDER
276 int "Maximum zone order"
277 default "11"
278
279config RAM_BASE
280 hex "DRAM start addr (the same with memory-section in dts)"
281 default 0x0
282
Guo Ren859e5f42018-12-19 19:56:14 +0800283config HOTPLUG_CPU
284 bool "Support for hot-pluggable CPUs"
285 select GENERIC_IRQ_MIGRATION
286 depends on SMP
287 help
288 Say Y here to allow turning CPUs off and on. CPUs can be
289 controlled through /sys/devices/system/cpu/cpu1/hotplug/target.
290
291 Say N if you want to disable CPU hotplug.
Guo Renc32e64e2018-09-05 14:25:06 +0800292endmenu
293
Guo Rena736fa12020-01-11 13:44:32 +0800294source "arch/csky/Kconfig.platforms"
295
Guo Renc32e64e2018-09-05 14:25:06 +0800296source "kernel/Kconfig.hz"