xref: /linux/arch/arm/mm/Kconfig (revision 3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d)
1# SPDX-License-Identifier: GPL-2.0
2comment "Processor Type"
3
4# Select CPU types depending on the architecture selected.  This selects
5# which CPUs we support in the kernel image, and the compiler instruction
6# optimiser behaviour.
7
8# ARM7TDMI
9config CPU_ARM7TDMI
10	bool
11	depends on !MMU
12	select CPU_32v4T
13	select CPU_ABRT_LV4T
14	select CPU_CACHE_V4
15	select CPU_PABRT_LEGACY
16	help
17	  A 32-bit RISC microprocessor based on the ARM7 processor core
18	  which has no memory control unit and cache.
19
20	  Say Y if you want support for the ARM7TDMI processor.
21	  Otherwise, say N.
22
23# ARM720T
24config CPU_ARM720T
25	bool
26	select CPU_32v4T
27	select CPU_ABRT_LV4T
28	select CPU_CACHE_V4
29	select CPU_CACHE_VIVT
30	select CPU_COPY_V4WT if MMU
31	select CPU_CP15_MMU
32	select CPU_PABRT_LEGACY
33	select CPU_THUMB_CAPABLE
34	select CPU_TLB_V4WT if MMU
35	help
36	  A 32-bit RISC processor with 8kByte Cache, Write Buffer and
37	  MMU built around an ARM7TDMI core.
38
39	  Say Y if you want support for the ARM720T processor.
40	  Otherwise, say N.
41
42# ARM740T
43config CPU_ARM740T
44	bool
45	depends on !MMU
46	select CPU_32v4T
47	select CPU_ABRT_LV4T
48	select CPU_CACHE_V4
49	select CPU_CP15_MPU
50	select CPU_PABRT_LEGACY
51	select CPU_THUMB_CAPABLE
52	help
53	  A 32-bit RISC processor with 8KB cache or 4KB variants,
54	  write buffer and MPU(Protection Unit) built around
55	  an ARM7TDMI core.
56
57	  Say Y if you want support for the ARM740T processor.
58	  Otherwise, say N.
59
60# ARM9TDMI
61config CPU_ARM9TDMI
62	bool
63	depends on !MMU
64	select CPU_32v4T
65	select CPU_ABRT_NOMMU
66	select CPU_CACHE_V4
67	select CPU_PABRT_LEGACY
68	help
69	  A 32-bit RISC microprocessor based on the ARM9 processor core
70	  which has no memory control unit and cache.
71
72	  Say Y if you want support for the ARM9TDMI processor.
73	  Otherwise, say N.
74
75# ARM920T
76config CPU_ARM920T
77	bool
78	select CPU_32v4T
79	select CPU_ABRT_EV4T
80	select CPU_CACHE_V4WT
81	select CPU_CACHE_VIVT
82	select CPU_COPY_V4WB if MMU
83	select CPU_CP15_MMU
84	select CPU_PABRT_LEGACY
85	select CPU_THUMB_CAPABLE
86	select CPU_TLB_V4WBI if MMU
87	help
88	  The ARM920T is licensed to be produced by numerous vendors,
89	  and is used in the Cirrus EP93xx and the Samsung S3C2410.
90
91	  Say Y if you want support for the ARM920T processor.
92	  Otherwise, say N.
93
94# ARM922T
95config CPU_ARM922T
96	bool
97	select CPU_32v4T
98	select CPU_ABRT_EV4T
99	select CPU_CACHE_V4WT
100	select CPU_CACHE_VIVT
101	select CPU_COPY_V4WB if MMU
102	select CPU_CP15_MMU
103	select CPU_PABRT_LEGACY
104	select CPU_THUMB_CAPABLE
105	select CPU_TLB_V4WBI if MMU
106	help
107	  The ARM922T is a version of the ARM920T, but with smaller
108	  instruction and data caches. It is used in Altera's
109	  Excalibur XA device family and the ARM Integrator.
110
111	  Say Y if you want support for the ARM922T processor.
112	  Otherwise, say N.
113
114# ARM925T
115config CPU_ARM925T
116	bool
117	select CPU_32v4T
118	select CPU_ABRT_EV4T
119	select CPU_CACHE_V4WT
120	select CPU_CACHE_VIVT
121	select CPU_COPY_V4WB if MMU
122	select CPU_CP15_MMU
123	select CPU_PABRT_LEGACY
124	select CPU_THUMB_CAPABLE
125	select CPU_TLB_V4WBI if MMU
126 	help
127 	  The ARM925T is a mix between the ARM920T and ARM926T, but with
128	  different instruction and data caches. It is used in TI's OMAP
129 	  device family.
130
131 	  Say Y if you want support for the ARM925T processor.
132 	  Otherwise, say N.
133
134# ARM926T
135config CPU_ARM926T
136	bool
137	select CPU_32v5
138	select CPU_ABRT_EV5TJ
139	select CPU_CACHE_VIVT
140	select CPU_COPY_V4WB if MMU
141	select CPU_CP15_MMU
142	select CPU_PABRT_LEGACY
143	select CPU_THUMB_CAPABLE
144	select CPU_TLB_V4WBI if MMU
145	help
146	  This is a variant of the ARM920.  It has slightly different
147	  instruction sequences for cache and TLB operations.  Curiously,
148	  there is no documentation on it at the ARM corporate website.
149
150	  Say Y if you want support for the ARM926T processor.
151	  Otherwise, say N.
152
153# FA526
154config CPU_FA526
155	bool
156	select CPU_32v4
157	select CPU_ABRT_EV4
158	select CPU_CACHE_FA
159	select CPU_CACHE_VIVT
160	select CPU_COPY_FA if MMU
161	select CPU_CP15_MMU
162	select CPU_PABRT_LEGACY
163	select CPU_TLB_FA if MMU
164	help
165	  The FA526 is a version of the ARMv4 compatible processor with
166	  Branch Target Buffer, Unified TLB and cache line size 16.
167
168	  Say Y if you want support for the FA526 processor.
169	  Otherwise, say N.
170
171# ARM940T
172config CPU_ARM940T
173	bool
174	depends on !MMU
175	select CPU_32v4T
176	select CPU_ABRT_NOMMU
177	select CPU_CACHE_VIVT
178	select CPU_CP15_MPU
179	select CPU_PABRT_LEGACY
180	select CPU_THUMB_CAPABLE
181	help
182	  ARM940T is a member of the ARM9TDMI family of general-
183	  purpose microprocessors with MPU and separate 4KB
184	  instruction and 4KB data cases, each with a 4-word line
185	  length.
186
187	  Say Y if you want support for the ARM940T processor.
188	  Otherwise, say N.
189
190# ARM946E-S
191config CPU_ARM946E
192	bool
193	depends on !MMU
194	select CPU_32v5
195	select CPU_ABRT_NOMMU
196	select CPU_CACHE_VIVT
197	select CPU_CP15_MPU
198	select CPU_PABRT_LEGACY
199	select CPU_THUMB_CAPABLE
200	help
201	  ARM946E-S is a member of the ARM9E-S family of high-
202	  performance, 32-bit system-on-chip processor solutions.
203	  The TCM and ARMv5TE 32-bit instruction set is supported.
204
205	  Say Y if you want support for the ARM946E-S processor.
206	  Otherwise, say N.
207
208# ARM1020 - needs validating
209config CPU_ARM1020
210	bool
211	select CPU_32v5
212	select CPU_ABRT_EV4T
213	select CPU_CACHE_V4WT
214	select CPU_CACHE_VIVT
215	select CPU_COPY_V4WB if MMU
216	select CPU_CP15_MMU
217	select CPU_PABRT_LEGACY
218	select CPU_THUMB_CAPABLE
219	select CPU_TLB_V4WBI if MMU
220	help
221	  The ARM1020 is the 32K cached version of the ARM10 processor,
222	  with an addition of a floating-point unit.
223
224	  Say Y if you want support for the ARM1020 processor.
225	  Otherwise, say N.
226
227# ARM1020E - needs validating
228config CPU_ARM1020E
229	bool
230	depends on n
231	select CPU_32v5
232	select CPU_ABRT_EV4T
233	select CPU_CACHE_V4WT
234	select CPU_CACHE_VIVT
235	select CPU_COPY_V4WB if MMU
236	select CPU_CP15_MMU
237	select CPU_PABRT_LEGACY
238	select CPU_THUMB_CAPABLE
239	select CPU_TLB_V4WBI if MMU
240
241# ARM1022E
242config CPU_ARM1022
243	bool
244	select CPU_32v5
245	select CPU_ABRT_EV4T
246	select CPU_CACHE_VIVT
247	select CPU_COPY_V4WB if MMU # can probably do better
248	select CPU_CP15_MMU
249	select CPU_PABRT_LEGACY
250	select CPU_THUMB_CAPABLE
251	select CPU_TLB_V4WBI if MMU
252	help
253	  The ARM1022E is an implementation of the ARMv5TE architecture
254	  based upon the ARM10 integer core with a 16KiB L1 Harvard cache,
255	  embedded trace macrocell, and a floating-point unit.
256
257	  Say Y if you want support for the ARM1022E processor.
258	  Otherwise, say N.
259
260# ARM1026EJ-S
261config CPU_ARM1026
262	bool
263	select CPU_32v5
264	select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10
265	select CPU_CACHE_VIVT
266	select CPU_COPY_V4WB if MMU # can probably do better
267	select CPU_CP15_MMU
268	select CPU_PABRT_LEGACY
269	select CPU_THUMB_CAPABLE
270	select CPU_TLB_V4WBI if MMU
271	help
272	  The ARM1026EJ-S is an implementation of the ARMv5TEJ architecture
273	  based upon the ARM10 integer core.
274
275	  Say Y if you want support for the ARM1026EJ-S processor.
276	  Otherwise, say N.
277
278# SA110
279config CPU_SA110
280	bool
281	select CPU_32v3 if ARCH_RPC
282	select CPU_32v4 if !ARCH_RPC
283	select CPU_ABRT_EV4
284	select CPU_CACHE_V4WB
285	select CPU_CACHE_VIVT
286	select CPU_COPY_V4WB if MMU
287	select CPU_CP15_MMU
288	select CPU_PABRT_LEGACY
289	select CPU_TLB_V4WB if MMU
290	help
291	  The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and
292	  is available at five speeds ranging from 100 MHz to 233 MHz.
293	  More information is available at
294	  <http://developer.intel.com/design/strong/sa110.htm>.
295
296	  Say Y if you want support for the SA-110 processor.
297	  Otherwise, say N.
298
299# SA1100
300config CPU_SA1100
301	bool
302	select CPU_32v4
303	select CPU_ABRT_EV4
304	select CPU_CACHE_V4WB
305	select CPU_CACHE_VIVT
306	select CPU_CP15_MMU
307	select CPU_PABRT_LEGACY
308	select CPU_TLB_V4WB if MMU
309
310# XScale
311config CPU_XSCALE
312	bool
313	select CPU_32v5
314	select CPU_ABRT_EV5T
315	select CPU_CACHE_VIVT
316	select CPU_CP15_MMU
317	select CPU_PABRT_LEGACY
318	select CPU_THUMB_CAPABLE
319	select CPU_TLB_V4WBI if MMU
320
321# XScale Core Version 3
322config CPU_XSC3
323	bool
324	select CPU_32v5
325	select CPU_ABRT_EV5T
326	select CPU_CACHE_VIVT
327	select CPU_CP15_MMU
328	select CPU_PABRT_LEGACY
329	select CPU_THUMB_CAPABLE
330	select CPU_TLB_V4WBI if MMU
331	select IO_36
332
333# Marvell PJ1 (Mohawk)
334config CPU_MOHAWK
335	bool
336	select CPU_32v5
337	select CPU_ABRT_EV5T
338	select CPU_CACHE_VIVT
339	select CPU_COPY_V4WB if MMU
340	select CPU_CP15_MMU
341	select CPU_PABRT_LEGACY
342	select CPU_THUMB_CAPABLE
343	select CPU_TLB_V4WBI if MMU
344
345# Feroceon
346config CPU_FEROCEON
347	bool
348	select CPU_32v5
349	select CPU_ABRT_EV5T
350	select CPU_CACHE_VIVT
351	select CPU_COPY_FEROCEON if MMU
352	select CPU_CP15_MMU
353	select CPU_PABRT_LEGACY
354	select CPU_THUMB_CAPABLE
355	select CPU_TLB_FEROCEON if MMU
356
357config CPU_FEROCEON_OLD_ID
358	bool "Accept early Feroceon cores with an ARM926 ID"
359	depends on CPU_FEROCEON && !CPU_ARM926T
360	default y
361	help
362	  This enables the usage of some old Feroceon cores
363	  for which the CPU ID is equal to the ARM926 ID.
364	  Relevant for Feroceon-1850 and early Feroceon-2850.
365
366# Marvell PJ4
367config CPU_PJ4
368	bool
369	select ARM_THUMBEE
370	select CPU_V7
371
372config CPU_PJ4B
373	bool
374	select CPU_V7
375
376# ARMv6
377config CPU_V6
378	bool
379	depends on !SMP
380	select CPU_32v6
381	select CPU_ABRT_EV6
382	select CPU_CACHE_V6
383	select CPU_CACHE_VIPT
384	select CPU_COPY_V6 if MMU
385	select CPU_CP15_MMU
386	select CPU_HAS_ASID if MMU
387	select CPU_PABRT_V6
388	select CPU_THUMB_CAPABLE
389	select CPU_TLB_V6 if MMU
390
391# ARMv6k
392config CPU_V6K
393	bool
394	select CPU_32v6
395	select CPU_32v6K
396	select CPU_ABRT_EV6
397	select CPU_CACHE_V6
398	select CPU_CACHE_VIPT
399	select CPU_COPY_V6 if MMU
400	select CPU_CP15_MMU
401	select CPU_HAS_ASID if MMU
402	select CPU_PABRT_V6
403	select CPU_THUMB_CAPABLE
404	select CPU_TLB_V6 if MMU
405
406config CPU_ARM1136R0
407	bool
408	select CPU_V6
409	depends on !SMP
410	help
411	  These early revisions of ARM1136 lack support for the
412	  ARMv6k extensions for multiprocessing.
413	  Support for this revision is scheduled for removal
414	  from the kernel in early 2027.
415
416config CPU_ARM1136R1
417	bool
418	select CPU_V6K
419	help
420	  Later revisions of ARM1136 add ARMv6k (atomics, barriers
421	  and TLS register) in addition to the features from r0.
422
423config CPU_ARM1176
424	bool
425	select CPU_V6K
426	help
427	  ARM1176 implements ARMv6k, VMSAv7 and Trustzone in
428	  addition to the ARMv6 baseline.
429
430# ARMv7 and ARMv8 architectures
431config CPU_V7
432	bool
433	select CPU_32v6K
434	select CPU_32v7
435	select CPU_ABRT_EV7
436	select CPU_CACHE_V7
437	select CPU_CACHE_VIPT
438	select CPU_COPY_V6 if MMU
439	select CPU_CP15_MMU if MMU
440	select CPU_CP15_MPU if !MMU
441	select CPU_HAS_ASID if MMU
442	select CPU_PABRT_V7
443	select CPU_SPECTRE if MMU
444	select CPU_THUMB_CAPABLE
445	select CPU_TLB_V7 if MMU
446
447# ARMv7M
448config CPU_V7M
449	bool
450	select CPU_32v7M
451	select CPU_ABRT_NOMMU
452	select CPU_CACHE_V7M
453	select CPU_CACHE_NOP
454	select CPU_PABRT_LEGACY
455	select CPU_THUMBONLY
456
457config CPU_THUMBONLY
458	bool
459	select CPU_THUMB_CAPABLE
460	# There are no CPUs available with MMU that don't implement an ARM ISA:
461	depends on !MMU
462	help
463	  Select this if your CPU doesn't support the 32 bit ARM instructions.
464
465config CPU_THUMB_CAPABLE
466	bool
467	help
468	  Select this if your CPU can support Thumb mode.
469
470# Figure out what processor architecture version we should be using.
471# This defines the compiler instruction set which depends on the machine type.
472config CPU_32v3
473	bool
474	select CPU_USE_DOMAINS if MMU
475	select NEED_KUSER_HELPERS
476	select TLS_REG_EMUL if SMP || !MMU
477	select CPU_NO_EFFICIENT_FFS
478
479config CPU_32v4
480	bool
481	select CPU_USE_DOMAINS if MMU
482	select NEED_KUSER_HELPERS
483	select TLS_REG_EMUL if SMP || !MMU
484	select CPU_NO_EFFICIENT_FFS
485
486config CPU_32v4T
487	bool
488	select CPU_USE_DOMAINS if MMU
489	select NEED_KUSER_HELPERS
490	select TLS_REG_EMUL if SMP || !MMU
491	select CPU_NO_EFFICIENT_FFS
492
493config CPU_32v5
494	bool
495	select CPU_USE_DOMAINS if MMU
496	select NEED_KUSER_HELPERS
497	select TLS_REG_EMUL if SMP || !MMU
498
499config CPU_32v6
500	bool
501	select TLS_REG_EMUL if !CPU_32v6K && !MMU
502
503config CPU_32v6K
504	bool
505
506config CPU_32v7
507	bool
508
509config CPU_32v7M
510	bool
511
512# The abort model
513config CPU_ABRT_NOMMU
514	bool
515
516config CPU_ABRT_EV4
517	bool
518
519config CPU_ABRT_EV4T
520	bool
521
522config CPU_ABRT_LV4T
523	bool
524
525config CPU_ABRT_EV5T
526	bool
527
528config CPU_ABRT_EV5TJ
529	bool
530
531config CPU_ABRT_EV6
532	bool
533
534config CPU_ABRT_EV7
535	bool
536
537config CPU_PABRT_LEGACY
538	bool
539
540config CPU_PABRT_V6
541	bool
542
543config CPU_PABRT_V7
544	bool
545
546# The cache model
547config CPU_CACHE_V4
548	bool
549
550config CPU_CACHE_V4WT
551	bool
552
553config CPU_CACHE_V4WB
554	bool
555
556config CPU_CACHE_V6
557	bool
558
559config CPU_CACHE_V7
560	bool
561
562config CPU_CACHE_NOP
563	bool
564
565config CPU_CACHE_VIVT
566	bool
567
568config CPU_CACHE_VIPT
569	bool
570
571config CPU_CACHE_FA
572	bool
573
574config CPU_CACHE_V7M
575	bool
576
577if MMU
578# The copy-page model
579config CPU_COPY_V4WT
580	bool
581
582config CPU_COPY_V4WB
583	bool
584
585config CPU_COPY_FEROCEON
586	bool
587
588config CPU_COPY_FA
589	bool
590
591config CPU_COPY_V6
592	bool
593
594# This selects the TLB model
595config CPU_TLB_V4WT
596	bool
597	help
598	  ARM Architecture Version 4 TLB with writethrough cache.
599
600config CPU_TLB_V4WB
601	bool
602	help
603	  ARM Architecture Version 4 TLB with writeback cache.
604
605config CPU_TLB_V4WBI
606	bool
607	help
608	  ARM Architecture Version 4 TLB with writeback cache and invalidate
609	  instruction cache entry.
610
611config CPU_TLB_FEROCEON
612	bool
613	help
614	  Feroceon TLB (v4wbi with non-outer-cachable page table walks).
615
616config CPU_TLB_FA
617	bool
618	help
619	  Faraday ARM FA526 architecture, unified TLB with writeback cache
620	  and invalidate instruction cache entry. Branch target buffer is
621	  also supported.
622
623config CPU_TLB_V6
624	bool
625
626config CPU_TLB_V7
627	bool
628
629endif
630
631config CPU_HAS_ASID
632	bool
633	help
634	  This indicates whether the CPU has the ASID register; used to
635	  tag TLB and possibly cache entries.
636
637config CPU_CP15
638	bool
639	help
640	  Processor has the CP15 register.
641
642config CPU_CP15_MMU
643	bool
644	select CPU_CP15
645	help
646	  Processor has the CP15 register, which has MMU related registers.
647
648config CPU_CP15_MPU
649	bool
650	select CPU_CP15
651	help
652	  Processor has the CP15 register, which has MPU related registers.
653
654config CPU_USE_DOMAINS
655	bool
656	help
657	  This option enables or disables the use of domain switching
658	  using the DACR (domain access control register) to protect memory
659	  domains from each other. In Linux we use three domains: kernel, user
660	  and IO. The domains are used to protect userspace from kernelspace
661	  and to handle IO-space as a special type of memory by assigning
662	  manager or client roles to running code (such as a process).
663
664config CPU_V7M_NUM_IRQ
665	int "Number of external interrupts connected to the NVIC"
666	depends on CPU_V7M
667	default 90 if ARCH_STM32
668	default 112 if SOC_VF610
669	default 240
670	help
671	  This option indicates the number of interrupts connected to the NVIC.
672	  The value can be larger than the real number of interrupts supported
673	  by the system, but must not be lower.
674	  The default value is 240, corresponding to the maximum number of
675	  interrupts supported by the NVIC on Cortex-M family.
676
677	  If unsure, keep default value.
678
679#
680# CPU supports 36-bit I/O
681#
682config IO_36
683	bool
684
685comment "Processor Features"
686
687config ARM_LPAE
688	bool "Support for the Large Physical Address Extension"
689	depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \
690		!CPU_32v4 && !CPU_32v3
691	select PHYS_ADDR_T_64BIT
692	select SWIOTLB
693	help
694	  Say Y if you have an ARMv7 processor supporting the LPAE page
695	  table format and you would like to access memory beyond the
696	  4GB limit. The resulting kernel image will not run on
697	  processors without the LPA extension.
698
699	  If unsure, say N.
700
701config ARM_PV_FIXUP
702	def_bool y
703	depends on ARM_LPAE && ARM_PATCH_PHYS_VIRT && ARCH_KEYSTONE
704
705config ARM_THUMB
706	bool "Support Thumb user binaries" if !CPU_THUMBONLY && EXPERT
707	depends on CPU_THUMB_CAPABLE && !CPU_32v4
708	default y
709	help
710	  Say Y if you want to include kernel support for running user space
711	  Thumb binaries.
712
713	  The Thumb instruction set is a compressed form of the standard ARM
714	  instruction set resulting in smaller binaries at the expense of
715	  slightly less efficient code.
716
717	  If this option is disabled, and you run userspace that switches to
718	  Thumb mode, signal handling will not work correctly, resulting in
719	  segmentation faults or illegal instruction aborts.
720
721	  If you don't know what this all is, saying Y is a safe choice.
722
723config ARM_THUMBEE
724	bool "Enable ThumbEE CPU extension"
725	depends on CPU_V7
726	help
727	  Say Y here if you have a CPU with the ThumbEE extension and code to
728	  make use of it. Say N for code that can run on CPUs without ThumbEE.
729
730config ARM_VIRT_EXT
731	bool
732	default y if CPU_V7
733	help
734	  Enable the kernel to make use of the ARM Virtualization
735	  Extensions to install hypervisors without run-time firmware
736	  assistance.
737
738	  A compliant bootloader is required in order to make maximum
739	  use of this feature.  Refer to Documentation/arch/arm/booting.rst for
740	  details.
741
742config SWP_EMULATE
743	bool "Emulate SWP/SWPB instructions" if !SMP
744	depends on CPU_V7
745	default y if SMP
746	select HAVE_PROC_CPU if PROC_FS
747	help
748	  ARMv6 architecture deprecates use of the SWP/SWPB instructions.
749	  ARMv7 multiprocessing extensions introduce the ability to disable
750	  these instructions, triggering an undefined instruction exception
751	  when executed. Say Y here to enable software emulation of these
752	  instructions for userspace (not kernel) using LDREX/STREX.
753	  Also creates /proc/cpu/swp_emulation for statistics.
754
755	  In some older versions of glibc [<=2.8] SWP is used during futex
756	  trylock() operations with the assumption that the code will not
757	  be preempted. This invalid assumption may be more likely to fail
758	  with SWP emulation enabled, leading to deadlock of the user
759	  application.
760
761	  NOTE: when accessing uncached shared regions, LDREX/STREX rely
762	  on an external transaction monitoring block called a global
763	  monitor to maintain update atomicity. If your system does not
764	  implement a global monitor, this option can cause programs that
765	  perform SWP operations to uncached memory to deadlock.
766
767	  If unsure, say Y.
768
769choice
770	prompt "CPU Endianness"
771	default CPU_LITTLE_ENDIAN
772
773config CPU_LITTLE_ENDIAN
774	bool "Built little-endian kernel"
775	help
776	  Say Y if you plan on running a kernel in little-endian mode.
777	  This is the default and is used in practically all modern user
778	  space builds.
779
780config CPU_BIG_ENDIAN
781	bool "Build big-endian kernel (DEPRECATED)"
782	depends on ARCH_MULTI_V5 || BROKEN
783	depends on !LD_IS_LLD
784	help
785	  Say Y if you plan on running a kernel in big-endian mode.
786	  This works on many machines using ARMv6 or newer processors
787	  but requires big-endian user space.
788
789	  The only ARMv5 platform with big-endian support is
790	  Intel IXP4xx.
791
792endchoice
793
794config CPU_ENDIAN_BE8
795	bool
796	depends on CPU_BIG_ENDIAN
797	default CPU_V6 || CPU_V6K || CPU_V7 || CPU_V7M
798	help
799	  Support for the BE-8 (big-endian) mode on ARMv6 and ARMv7 processors.
800
801config CPU_ENDIAN_BE32
802	bool
803	depends on CPU_BIG_ENDIAN
804	default !CPU_ENDIAN_BE8
805	help
806	  Support for the BE-32 (big-endian) mode on pre-ARMv6 processors.
807
808config CPU_HIGH_VECTOR
809	depends on !MMU && CPU_CP15 && !CPU_ARM740T
810	bool "Select the High exception vector"
811	help
812	  Say Y here to select high exception vector(0xFFFF0000~).
813	  The exception vector can vary depending on the platform
814	  design in nommu mode. If your platform needs to select
815	  high exception vector, say Y.
816	  Otherwise or if you are unsure, say N, and the low exception
817	  vector (0x00000000~) will be used.
818
819config CPU_ICACHE_DISABLE
820	bool "Disable I-Cache (I-bit)"
821	depends on (CPU_CP15 && !(CPU_ARM720T || CPU_ARM740T || CPU_XSCALE || CPU_XSC3)) || CPU_V7M
822	help
823	  Say Y here to disable the processor instruction cache. Unless
824	  you have a reason not to or are unsure, say N.
825
826config CPU_ICACHE_MISMATCH_WORKAROUND
827	bool "Workaround for I-Cache line size mismatch between CPU cores"
828	depends on SMP && CPU_V7
829	help
830	  Some big.LITTLE systems have I-Cache line size mismatch between
831	  LITTLE and big cores.  Say Y here to enable a workaround for
832	  proper I-Cache support on such systems.  If unsure, say N.
833
834config CPU_DCACHE_DISABLE
835	bool "Disable D-Cache (C-bit)"
836	depends on (CPU_CP15 && !SMP) || CPU_V7M
837	help
838	  Say Y here to disable the processor data cache. Unless
839	  you have a reason not to or are unsure, say N.
840
841config CPU_DCACHE_SIZE
842	hex
843	depends on CPU_ARM740T || CPU_ARM946E
844	default 0x00001000 if CPU_ARM740T
845	default 0x00002000 # default size for ARM946E-S
846	help
847	  Some cores are synthesizable to have various sized cache. For
848	  ARM946E-S case, it can vary from 0KB to 1MB.
849	  To support such cache operations, it is efficient to know the size
850	  before compile time.
851	  If your SoC is configured to have a different size, define the value
852	  here with proper conditions.
853
854config CPU_DCACHE_WRITETHROUGH
855	bool "Force write through D-cache"
856	depends on (CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_FA526) && !CPU_DCACHE_DISABLE
857	default y if CPU_ARM925T
858	help
859	  Say Y here to use the data cache in writethrough mode. Unless you
860	  specifically require this or are unsure, say N.
861
862config CPU_CACHE_ROUND_ROBIN
863	bool "Round robin I and D cache replacement algorithm"
864	depends on (CPU_ARM926T || CPU_ARM946E || CPU_ARM1020) && (!CPU_ICACHE_DISABLE || !CPU_DCACHE_DISABLE)
865	help
866	  Say Y here to use the predictable round-robin cache replacement
867	  policy.  Unless you specifically require this or are unsure, say N.
868
869config CPU_BPREDICT_DISABLE
870	bool "Disable branch prediction"
871	depends on CPU_ARM1020 || CPU_V6 || CPU_V6K || CPU_MOHAWK || CPU_XSC3 || CPU_V7 || CPU_FA526 || CPU_V7M
872	help
873	  Say Y here to disable branch prediction.  If unsure, say N.
874
875config CPU_SPECTRE
876	bool
877	select GENERIC_CPU_VULNERABILITIES
878
879config HARDEN_BRANCH_PREDICTOR
880	bool "Harden the branch predictor against aliasing attacks" if EXPERT
881	depends on CPU_SPECTRE
882	default y
883	help
884	   Speculation attacks against some high-performance processors rely
885	   on being able to manipulate the branch predictor for a victim
886	   context by executing aliasing branches in the attacker context.
887	   Such attacks can be partially mitigated against by clearing
888	   internal branch predictor state and limiting the prediction
889	   logic in some situations.
890
891	   This config option will take CPU-specific actions to harden
892	   the branch predictor against aliasing attacks and may rely on
893	   specific instruction sequences or control bits being set by
894	   the system firmware.
895
896	   If unsure, say Y.
897
898config HARDEN_BRANCH_HISTORY
899	bool "Harden Spectre style attacks against branch history" if EXPERT
900	depends on CPU_SPECTRE
901	default y
902	help
903	  Speculation attacks against some high-performance processors can
904	  make use of branch history to influence future speculation. When
905	  taking an exception, a sequence of branches overwrites the branch
906	  history, or branch history is invalidated.
907
908config TLS_REG_EMUL
909	bool
910	select NEED_KUSER_HELPERS
911	help
912	  An SMP system using a pre-ARMv6 processor (there are apparently
913	  a few prototypes like that in existence) and therefore access to
914	  that required register must be emulated.
915
916config NEED_KUSER_HELPERS
917	bool
918
919config KUSER_HELPERS
920	bool "Enable kuser helpers in vector page" if !NEED_KUSER_HELPERS
921	depends on MMU
922	default y
923	help
924	  Warning: disabling this option may break user programs.
925
926	  Provide kuser helpers in the vector page.  The kernel provides
927	  helper code to userspace in read only form at a fixed location
928	  in the high vector page to allow userspace to be independent of
929	  the CPU type fitted to the system.  This permits binaries to be
930	  run on ARMv4 through to ARMv7 without modification.
931
932	  See Documentation/arch/arm/kernel_user_helpers.rst for details.
933
934	  However, the fixed address nature of these helpers can be used
935	  by ROP (return orientated programming) authors when creating
936	  exploits.
937
938	  If all of the binaries and libraries which run on your platform
939	  are built specifically for your platform, and make no use of
940	  these helpers, then you can turn this option off to hinder
941	  such exploits. However, in that case, if a binary or library
942	  relying on those helpers is run, it will receive a SIGILL signal,
943	  which will terminate the program.
944
945	  Say N here only if you are absolutely certain that you do not
946	  need these helpers; otherwise, the safe option is to say Y.
947
948config VDSO
949	bool "Enable VDSO for acceleration of some system calls"
950	depends on AEABI && MMU && CPU_V7
951	default y if ARM_ARCH_TIMER
952	select GENERIC_GETTIMEOFDAY
953	help
954	  Place in the process address space an ELF shared object
955	  providing fast implementations of gettimeofday and
956	  clock_gettime.  Systems that implement the ARM architected
957	  timer will receive maximum benefit.
958
959	  You must have glibc 2.22 or later for programs to seamlessly
960	  take advantage of this.
961
962
963config OUTER_CACHE
964	bool
965
966config OUTER_CACHE_SYNC
967	bool
968	select ARM_HEAVY_MB
969	help
970	  The outer cache has a outer_cache_fns.sync function pointer
971	  that can be used to drain the write buffer of the outer cache.
972
973config CACHE_B15_RAC
974	bool "Enable the Broadcom Brahma-B15 read-ahead cache controller"
975	depends on ARCH_BRCMSTB
976	default y
977	help
978	  This option enables the Broadcom Brahma-B15 read-ahead cache
979	  controller. If disabled, the read-ahead cache remains off.
980
981config CACHE_FEROCEON_L2
982	bool "Enable the Feroceon L2 cache controller"
983	depends on ARCH_MV78XX0 || ARCH_MVEBU
984	default y
985	select OUTER_CACHE
986	help
987	  This option enables the Feroceon L2 cache controller.
988
989config CACHE_FEROCEON_L2_WRITETHROUGH
990	bool "Force Feroceon L2 cache write through"
991	depends on CACHE_FEROCEON_L2
992	help
993	  Say Y here to use the Feroceon L2 cache in writethrough mode.
994	  Unless you specifically require this, say N for writeback mode.
995
996config MIGHT_HAVE_CACHE_L2X0
997	bool
998	help
999	  This option should be selected by machines which have a L2x0
1000	  or PL310 cache controller, but where its use is optional.
1001
1002	  The only effect of this option is to make CACHE_L2X0 and
1003	  related options available to the user for configuration.
1004
1005	  Boards or SoCs which always require the cache controller
1006	  support to be present should select CACHE_L2X0 directly
1007	  instead of this option, thus preventing the user from
1008	  inadvertently configuring a broken kernel.
1009
1010config CACHE_L2X0
1011	bool "Enable the L2x0 outer cache controller" if MIGHT_HAVE_CACHE_L2X0
1012	default MIGHT_HAVE_CACHE_L2X0
1013	select OUTER_CACHE
1014	select OUTER_CACHE_SYNC
1015	help
1016	  This option enables the L2x0 PrimeCell.
1017
1018config CACHE_L2X0_PMU
1019	bool "L2x0 performance monitor support" if CACHE_L2X0
1020	depends on PERF_EVENTS
1021	help
1022	  This option enables support for the performance monitoring features
1023	  of the L220 and PL310 outer cache controllers.
1024
1025if CACHE_L2X0
1026
1027config PL310_ERRATA_588369
1028	bool "PL310 errata: Clean & Invalidate maintenance operations do not invalidate clean lines"
1029	help
1030	   The PL310 L2 cache controller implements three types of Clean &
1031	   Invalidate maintenance operations: by Physical Address
1032	   (offset 0x7F0), by Index/Way (0x7F8) and by Way (0x7FC).
1033	   They are architecturally defined to behave as the execution of a
1034	   clean operation followed immediately by an invalidate operation,
1035	   both performing to the same memory location. This functionality
1036	   is not correctly implemented in PL310 prior to r2p0 (fixed in r2p0)
1037	   as clean lines are not invalidated as a result of these operations.
1038
1039config PL310_ERRATA_727915
1040	bool "PL310 errata: Background Clean & Invalidate by Way operation can cause data corruption"
1041	help
1042	  PL310 implements the Clean & Invalidate by Way L2 cache maintenance
1043	  operation (offset 0x7FC). This operation runs in background so that
1044	  PL310 can handle normal accesses while it is in progress. Under very
1045	  rare circumstances, due to this erratum, write data can be lost when
1046	  PL310 treats a cacheable write transaction during a Clean &
1047	  Invalidate by Way operation.  Revisions prior to r3p1 are affected by
1048	  this errata (fixed in r3p1).
1049
1050config PL310_ERRATA_753970
1051	bool "PL310 errata: cache sync operation may be faulty"
1052	help
1053	  This option enables the workaround for the 753970 PL310 (r3p0) erratum.
1054
1055	  Under some condition the effect of cache sync operation on
1056	  the store buffer still remains when the operation completes.
1057	  This means that the store buffer is always asked to drain and
1058	  this prevents it from merging any further writes. The workaround
1059	  is to replace the normal offset of cache sync operation (0x730)
1060	  by another offset targeting an unmapped PL310 register 0x740.
1061	  This has the same effect as the cache sync operation: store buffer
1062	  drain and waiting for all buffers empty.
1063
1064config PL310_ERRATA_769419
1065	bool "PL310 errata: no automatic Store Buffer drain"
1066	help
1067	  On revisions of the PL310 prior to r3p2, the Store Buffer does
1068	  not automatically drain. This can cause normal, non-cacheable
1069	  writes to be retained when the memory system is idle, leading
1070	  to suboptimal I/O performance for drivers using coherent DMA.
1071	  This option adds a write barrier to the cpu_idle loop so that,
1072	  on systems with an outer cache, the store buffer is drained
1073	  explicitly.
1074
1075endif
1076
1077config CACHE_TAUROS2
1078	bool "Enable the Tauros2 L2 cache controller"
1079	depends on (CPU_MOHAWK || CPU_PJ4)
1080	default y
1081	select OUTER_CACHE
1082	help
1083	  This option enables the Tauros2 L2 cache controller (as
1084	  found on PJ1/PJ4).
1085
1086config CACHE_UNIPHIER
1087	bool "Enable the UniPhier outer cache controller"
1088	depends on ARCH_UNIPHIER
1089	select ARM_L1_CACHE_SHIFT_7
1090	select OUTER_CACHE
1091	select OUTER_CACHE_SYNC
1092	help
1093	  This option enables the UniPhier outer cache (system cache)
1094	  controller.
1095
1096config CACHE_XSC3L2
1097	bool "Enable the L2 cache on XScale3"
1098	depends on CPU_XSC3
1099	default y
1100	select OUTER_CACHE
1101	help
1102	  This option enables the L2 cache on XScale3.
1103
1104config ARM_L1_CACHE_SHIFT_6
1105	bool
1106	default y if CPU_V7
1107	help
1108	  Setting ARM L1 cache line size to 64 Bytes.
1109
1110config ARM_L1_CACHE_SHIFT_7
1111	bool
1112	help
1113	  Setting ARM L1 cache line size to 128 Bytes.
1114
1115config ARM_L1_CACHE_SHIFT
1116	int
1117	default 7 if ARM_L1_CACHE_SHIFT_7
1118	default 6 if ARM_L1_CACHE_SHIFT_6
1119	default 5
1120
1121config ARM_DMA_MEM_BUFFERABLE
1122	bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K || CPU_V7M) && !CPU_V7
1123	default y if CPU_V6 || CPU_V6K || CPU_V7 || CPU_V7M
1124	help
1125	  Historically, the kernel has used strongly ordered mappings to
1126	  provide DMA coherent memory.  With the advent of ARMv7, mapping
1127	  memory with differing types results in unpredictable behaviour,
1128	  so on these CPUs, this option is forced on.
1129
1130	  Multiple mappings with differing attributes is also unpredictable
1131	  on ARMv6 CPUs, but since they do not have aggressive speculative
1132	  prefetch, no harm appears to occur.
1133
1134	  However, drivers may be missing the necessary barriers for ARMv6,
1135	  and therefore turning this on may result in unpredictable driver
1136	  behaviour.  Therefore, we offer this as an option.
1137
1138	  On some of the beefier ARMv7-M machines (with DMA and write
1139	  buffers) you likely want this enabled, while those that
1140	  didn't need it until now also won't need it in the future.
1141
1142	  You are recommended say 'Y' here and debug any affected drivers.
1143
1144config ARM_HEAVY_MB
1145	bool
1146
1147config DEBUG_ALIGN_RODATA
1148	bool "Make rodata strictly non-executable"
1149	depends on STRICT_KERNEL_RWX
1150	default y
1151	help
1152	  If this is set, rodata will be made explicitly non-executable. This
1153	  provides protection on the rare chance that attackers might find and
1154	  use ROP gadgets that exist in the rodata section. This adds an
1155	  additional section-aligned split of rodata from kernel text so it
1156	  can be made explicitly non-executable. This padding may waste memory
1157	  space to gain the additional protection.
1158