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