Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: v6k: introduce CPU_V6K option

Introduce a CPU_V6K configuration option for platforms to select if they
have a V6K CPU core. This allows us to identify whether we need to
support ARMv6 CPUs without the V6K SMP extensions at build time.

Currently CPU_V6K is just an alias for CPU_V6, and all places which
reference CPU_V6 are replaced by (CPU_V6 || CPU_V6K).

Select CPU_V6K from platforms which are known to be V6K-only.

Acked-by: Tony Lindgren <tony@atomide.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

+47 -31
+5 -5
arch/arm/Kconfig
··· 24 24 select HAVE_PERF_EVENTS 25 25 select PERF_USE_VMALLOC 26 26 select HAVE_REGS_AND_STACK_ACCESS_API 27 - select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7)) 27 + select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)) 28 28 select HAVE_C_RECORDMCOUNT 29 29 select HAVE_GENERIC_HARDIRQS 30 30 select HAVE_SPARSE_IRQ ··· 1048 1048 default y 1049 1049 1050 1050 config CPU_HAS_PMU 1051 - depends on (CPU_V6 || CPU_V7 || XSCALE_PMU) && \ 1051 + depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \ 1052 1052 (!ARCH_OMAP3 || OMAP3_EMU) 1053 1053 default y 1054 1054 bool ··· 1064 1064 1065 1065 config ARM_ERRATA_411920 1066 1066 bool "ARM errata: Invalidation of the Instruction Cache operation can fail" 1067 - depends on CPU_V6 1067 + depends on CPU_V6 || CPU_V6K 1068 1068 help 1069 1069 Invalidation of the Instruction Cache operation can 1070 1070 fail. This erratum is present in 1136 (before r1p4), 1156 and 1176. ··· 1361 1361 1362 1362 config THUMB2_KERNEL 1363 1363 bool "Compile the kernel in Thumb-2 mode (EXPERIMENTAL)" 1364 - depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL 1364 + depends on CPU_V7 && !CPU_V6 && !CPU_V6K && EXPERIMENTAL 1365 1365 select AEABI 1366 1366 select ARM_ASM_UNIFIED 1367 1367 help ··· 1852 1852 1853 1853 config VFP 1854 1854 bool "VFP-format floating point maths" 1855 - depends on CPU_V6 || CPU_ARM926T || CPU_V7 || CPU_FEROCEON 1855 + depends on CPU_V6 || CPU_V6K || CPU_ARM926T || CPU_V7 || CPU_FEROCEON 1856 1856 help 1857 1857 Say Y to include VFP support code in the kernel. This is needed 1858 1858 if your hardware includes a VFP unit.
+1
arch/arm/Makefile
··· 89 89 tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale 90 90 tune-$(CONFIG_CPU_FEROCEON) :=$(call cc-option,-mtune=marvell-f,-mtune=xscale) 91 91 tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) 92 + tune-$(CONFIG_CPU_V6K) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) 92 93 93 94 ifeq ($(CONFIG_AEABI),y) 94 95 CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork
+1 -1
arch/arm/boot/compressed/head.S
··· 21 21 22 22 #if defined(CONFIG_DEBUG_ICEDCC) 23 23 24 - #ifdef CONFIG_CPU_V6 24 + #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 25 25 .macro loadsp, rb, tmp 26 26 .endm 27 27 .macro writeb, ch, rb
+1 -1
arch/arm/boot/compressed/misc.c
··· 36 36 37 37 #ifdef CONFIG_DEBUG_ICEDCC 38 38 39 - #ifdef CONFIG_CPU_V6 39 + #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 40 40 41 41 static void icedcc_putc(int ch) 42 42 {
+3 -2
arch/arm/include/asm/cacheflush.h
··· 116 116 # define MULTI_CACHE 1 117 117 #endif 118 118 119 - #if defined(CONFIG_CPU_V6) 119 + #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 120 120 //# ifdef _CACHE 121 121 # define MULTI_CACHE 1 122 122 //# else ··· 316 316 * Optimized __flush_icache_all for the common cases. Note that UP ARMv7 317 317 * will fall through to use __flush_icache_all_generic. 318 318 */ 319 - #if (defined(CONFIG_CPU_V7) && defined(CONFIG_CPU_V6)) || \ 319 + #if (defined(CONFIG_CPU_V7) && \ 320 + (defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K))) || \ 320 321 defined(CONFIG_SMP_ON_UP) 321 322 #define __flush_icache_preferred __cpuc_flush_icache_all 322 323 #elif __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
+1 -1
arch/arm/include/asm/proc-fns.h
··· 231 231 # endif 232 232 #endif 233 233 234 - #ifdef CONFIG_CPU_V6 234 + #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 235 235 # ifdef CPU_NAME 236 236 # undef MULTI_CPU 237 237 # define MULTI_CPU
+1 -1
arch/arm/kernel/debug.S
··· 25 25 .macro addruart, rp, rv 26 26 .endm 27 27 28 - #if defined(CONFIG_CPU_V6) 28 + #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 29 29 30 30 .macro senduart, rd, rx 31 31 mcr p14, 0, \rd, c0, c5, 0
+2 -2
arch/arm/kernel/perf_event_v6.c
··· 30 30 * enable the interrupt. 31 31 */ 32 32 33 - #ifdef CONFIG_CPU_V6 33 + #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 34 34 enum armv6_perf_types { 35 35 ARMV6_PERFCTR_ICACHE_MISS = 0x0, 36 36 ARMV6_PERFCTR_IBUF_STALL = 0x1, ··· 669 669 { 670 670 return NULL; 671 671 } 672 - #endif /* CONFIG_CPU_V6 */ 672 + #endif /* CONFIG_CPU_V6 || CONFIG_CPU_V6K */
+30 -17
arch/arm/mm/Kconfig
··· 402 402 select CPU_TLB_V6 if MMU 403 403 404 404 # ARMv6k 405 - config CPU_32v6K 406 - bool "Support ARM V6K processor extensions" if !SMP 407 - depends on CPU_V6 || CPU_V7 408 - default y if SMP && !(ARCH_MX3 || ARCH_OMAP2) 409 - help 410 - Say Y here if your ARMv6 processor supports the 'K' extension. 411 - This enables the kernel to use some instructions not present 412 - on previous processors, and as such a kernel build with this 413 - enabled will not boot on processors with do not support these 414 - instructions. 405 + config CPU_V6K 406 + bool "Support ARM V6K processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || ARCH_DOVE 407 + select CPU_32v6 408 + select CPU_32v6K if !ARCH_OMAP2 409 + select CPU_ABRT_EV6 410 + select CPU_PABRT_V6 411 + select CPU_CACHE_V6 412 + select CPU_CACHE_VIPT 413 + select CPU_CP15_MMU 414 + select CPU_HAS_ASID if MMU 415 + select CPU_COPY_V6 if MMU 416 + select CPU_TLB_V6 if MMU 415 417 416 418 # ARMv7 417 419 config CPU_V7 ··· 454 452 config CPU_32v6 455 453 bool 456 454 select TLS_REG_EMUL if !CPU_32v6K && !MMU 455 + 456 + config CPU_32v6K 457 + bool "Support ARM V6K processor extensions" if !SMP 458 + depends on CPU_V6 || CPU_V6K || CPU_V7 459 + default y if SMP && !(ARCH_MX3 || ARCH_OMAP2) 460 + help 461 + Say Y here if your ARMv6 processor supports the 'K' extension. 462 + This enables the kernel to use some instructions not present 463 + on previous processors, and as such a kernel build with this 464 + enabled will not boot on processors with do not support these 465 + instructions. 457 466 458 467 config CPU_32v7 459 468 bool ··· 636 623 637 624 config ARM_THUMB 638 625 bool "Support Thumb user binaries" 639 - depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V7 || CPU_FEROCEON 626 + depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V6K || CPU_V7 || CPU_FEROCEON 640 627 default y 641 628 help 642 629 Say Y if you want to include kernel support for running user space ··· 694 681 config CPU_ENDIAN_BE8 695 682 bool 696 683 depends on CPU_BIG_ENDIAN 697 - default CPU_V6 || CPU_V7 684 + default CPU_V6 || CPU_V6K || CPU_V7 698 685 help 699 686 Support for the BE-8 (big-endian) mode on ARMv6 and ARMv7 processors. 700 687 ··· 760 747 761 748 config CPU_BPREDICT_DISABLE 762 749 bool "Disable branch prediction" 763 - depends on CPU_ARM1020 || CPU_V6 || CPU_MOHAWK || CPU_XSC3 || CPU_V7 || CPU_FA526 750 + depends on CPU_ARM1020 || CPU_V6 || CPU_V6K || CPU_MOHAWK || CPU_XSC3 || CPU_V7 || CPU_FA526 764 751 help 765 752 Say Y here to disable branch prediction. If unsure, say N. 766 753 ··· 780 767 781 768 config DMA_CACHE_RWFO 782 769 bool "Enable read/write for ownership DMA cache maintenance" 783 - depends on CPU_V6 && SMP 770 + depends on (CPU_V6 || CPU_V6K) && SMP 784 771 default y 785 772 help 786 773 The Snoop Control Unit on ARM11MPCore does not detect the ··· 836 823 config CACHE_PL310 837 824 bool 838 825 depends on CACHE_L2X0 839 - default y if CPU_V7 && !CPU_V6 826 + default y if CPU_V7 && !(CPU_V6 || CPU_V6K) 840 827 help 841 828 This option enables optimisations for the PL310 cache 842 829 controller. ··· 864 851 default 5 865 852 866 853 config ARM_DMA_MEM_BUFFERABLE 867 - bool "Use non-cacheable memory for DMA" if CPU_V6 && !CPU_V7 854 + bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K) && !CPU_V7 868 855 depends on !(MACH_REALVIEW_PB1176 || REALVIEW_EB_ARM11MP || \ 869 856 MACH_REALVIEW_PB11MP) 870 - default y if CPU_V6 || CPU_V7 857 + default y if CPU_V6 || CPU_V6K || CPU_V7 871 858 help 872 859 Historically, the kernel has used strongly ordered mappings to 873 860 provide DMA coherent memory. With the advent of ARMv7, mapping
+1
arch/arm/mm/Makefile
··· 90 90 obj-$(CONFIG_CPU_MOHAWK) += proc-mohawk.o 91 91 obj-$(CONFIG_CPU_FEROCEON) += proc-feroceon.o 92 92 obj-$(CONFIG_CPU_V6) += proc-v6.o 93 + obj-$(CONFIG_CPU_V6K) += proc-v6.o 93 94 obj-$(CONFIG_CPU_V7) += proc-v7.o 94 95 95 96 AFLAGS_proc-v6.o :=-Wa,-march=armv6
+1 -1
arch/arm/mm/mmap.c
··· 31 31 struct mm_struct *mm = current->mm; 32 32 struct vm_area_struct *vma; 33 33 unsigned long start_addr; 34 - #ifdef CONFIG_CPU_V6 34 + #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) 35 35 unsigned int cache_type; 36 36 int do_align = 0, aliasing = 0; 37 37