Skip to content

Commit e399b1a

Browse files
author
Russell King
committed
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>
1 parent 000d9c7 commit e399b1a

11 files changed

Lines changed: 47 additions & 31 deletions

File tree

‎arch/arm/Kconfig‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ config ARM
2424
select HAVE_PERF_EVENTS
2525
select PERF_USE_VMALLOC
2626
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))
2828
select HAVE_C_RECORDMCOUNT
2929
select HAVE_GENERIC_HARDIRQS
3030
select HAVE_SPARSE_IRQ
@@ -1048,7 +1048,7 @@ config XSCALE_PMU
10481048
default y
10491049

10501050
config CPU_HAS_PMU
1051-
depends on (CPU_V6 || CPU_V7 || XSCALE_PMU) && \
1051+
depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
10521052
(!ARCH_OMAP3 || OMAP3_EMU)
10531053
default y
10541054
bool
@@ -1064,7 +1064,7 @@ endif
10641064

10651065
config ARM_ERRATA_411920
10661066
bool "ARM errata: Invalidation of the Instruction Cache operation can fail"
1067-
depends on CPU_V6
1067+
depends on CPU_V6 || CPU_V6K
10681068
help
10691069
Invalidation of the Instruction Cache operation can
10701070
fail. This erratum is present in 1136 (before r1p4), 1156 and 1176.
@@ -1361,7 +1361,7 @@ config HZ
13611361

13621362
config THUMB2_KERNEL
13631363
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
13651365
select AEABI
13661366
select ARM_ASM_UNIFIED
13671367
help
@@ -1852,7 +1852,7 @@ config FPE_FASTFPE
18521852

18531853
config VFP
18541854
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
18561856
help
18571857
Say Y to include VFP support code in the kernel. This is needed
18581858
if your hardware includes a VFP unit.

‎arch/arm/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110)
8989
tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
9090
tune-$(CONFIG_CPU_FEROCEON) :=$(call cc-option,-mtune=marvell-f,-mtune=xscale)
9191
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)
9293

9394
ifeq ($(CONFIG_AEABI),y)
9495
CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork

‎arch/arm/boot/compressed/head.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#if defined(CONFIG_DEBUG_ICEDCC)
2323

24-
#ifdef CONFIG_CPU_V6
24+
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
2525
.macro loadsp, rb, tmp
2626
.endm
2727
.macro writeb, ch, rb

‎arch/arm/boot/compressed/misc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern void error(char *x);
3636

3737
#ifdef CONFIG_DEBUG_ICEDCC
3838

39-
#ifdef CONFIG_CPU_V6
39+
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
4040

4141
static void icedcc_putc(int ch)
4242
{

‎arch/arm/include/asm/cacheflush.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
# define MULTI_CACHE 1
117117
#endif
118118

119-
#if defined(CONFIG_CPU_V6)
119+
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
120120
//# ifdef _CACHE
121121
# define MULTI_CACHE 1
122122
//# else
@@ -316,7 +316,8 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *,
316316
* Optimized __flush_icache_all for the common cases. Note that UP ARMv7
317317
* will fall through to use __flush_icache_all_generic.
318318
*/
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))) || \
320321
defined(CONFIG_SMP_ON_UP)
321322
#define __flush_icache_preferred __cpuc_flush_icache_all
322323
#elif __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)

‎arch/arm/include/asm/proc-fns.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231
# endif
232232
#endif
233233

234-
#ifdef CONFIG_CPU_V6
234+
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
235235
# ifdef CPU_NAME
236236
# undef MULTI_CPU
237237
# define MULTI_CPU

‎arch/arm/kernel/debug.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
.macro addruart, rp, rv
2626
.endm
2727

28-
#if defined(CONFIG_CPU_V6)
28+
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
2929

3030
.macro senduart, rd, rx
3131
mcr p14, 0, \rd, c0, c5, 0

‎arch/arm/kernel/perf_event_v6.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* enable the interrupt.
3131
*/
3232

33-
#ifdef CONFIG_CPU_V6
33+
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
3434
enum armv6_perf_types {
3535
ARMV6_PERFCTR_ICACHE_MISS = 0x0,
3636
ARMV6_PERFCTR_IBUF_STALL = 0x1,
@@ -669,4 +669,4 @@ static const struct arm_pmu *__init armv6mpcore_pmu_init(void)
669669
{
670670
return NULL;
671671
}
672-
#endif /* CONFIG_CPU_V6 */
672+
#endif /* CONFIG_CPU_V6 || CONFIG_CPU_V6K */

‎arch/arm/mm/Kconfig‎

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -402,16 +402,18 @@ config CPU_V6
402402
select CPU_TLB_V6 if MMU
403403

404404
# 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
415417

416418
# ARMv7
417419
config CPU_V7
@@ -453,6 +455,17 @@ config CPU_32v6
453455
bool
454456
select TLS_REG_EMUL if !CPU_32v6K && !MMU
455457

458+
config CPU_32v6K
459+
bool "Support ARM V6K processor extensions" if !SMP
460+
depends on CPU_V6 || CPU_V6K || CPU_V7
461+
default y if SMP && !(ARCH_MX3 || ARCH_OMAP2)
462+
help
463+
Say Y here if your ARMv6 processor supports the 'K' extension.
464+
This enables the kernel to use some instructions not present
465+
on previous processors, and as such a kernel build with this
466+
enabled will not boot on processors with do not support these
467+
instructions.
468+
456469
config CPU_32v7
457470
bool
458471

@@ -623,7 +636,7 @@ comment "Processor Features"
623636

624637
config ARM_THUMB
625638
bool "Support Thumb user binaries"
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_V7 || CPU_FEROCEON
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_V6K || CPU_V7 || CPU_FEROCEON
627640
default y
628641
help
629642
Say Y if you want to include kernel support for running user space
@@ -681,7 +694,7 @@ config CPU_BIG_ENDIAN
681694
config CPU_ENDIAN_BE8
682695
bool
683696
depends on CPU_BIG_ENDIAN
684-
default CPU_V6 || CPU_V7
697+
default CPU_V6 || CPU_V6K || CPU_V7
685698
help
686699
Support for the BE-8 (big-endian) mode on ARMv6 and ARMv7 processors.
687700

@@ -747,7 +760,7 @@ config CPU_CACHE_ROUND_ROBIN
747760

748761
config CPU_BPREDICT_DISABLE
749762
bool "Disable branch prediction"
750-
depends on CPU_ARM1020 || CPU_V6 || CPU_MOHAWK || CPU_XSC3 || CPU_V7 || CPU_FA526
763+
depends on CPU_ARM1020 || CPU_V6 || CPU_V6K || CPU_MOHAWK || CPU_XSC3 || CPU_V7 || CPU_FA526
751764
help
752765
Say Y here to disable branch prediction. If unsure, say N.
753766

@@ -767,7 +780,7 @@ config NEEDS_SYSCALL_FOR_CMPXCHG
767780

768781
config DMA_CACHE_RWFO
769782
bool "Enable read/write for ownership DMA cache maintenance"
770-
depends on CPU_V6 && SMP
783+
depends on (CPU_V6 || CPU_V6K) && SMP
771784
default y
772785
help
773786
The Snoop Control Unit on ARM11MPCore does not detect the
@@ -823,7 +836,7 @@ config CACHE_L2X0
823836
config CACHE_PL310
824837
bool
825838
depends on CACHE_L2X0
826-
default y if CPU_V7 && !CPU_V6
839+
default y if CPU_V7 && !(CPU_V6 || CPU_V6K)
827840
help
828841
This option enables optimisations for the PL310 cache
829842
controller.
@@ -851,10 +864,10 @@ config ARM_L1_CACHE_SHIFT
851864
default 5
852865

853866
config ARM_DMA_MEM_BUFFERABLE
854-
bool "Use non-cacheable memory for DMA" if CPU_V6 && !CPU_V7
867+
bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K) && !CPU_V7
855868
depends on !(MACH_REALVIEW_PB1176 || REALVIEW_EB_ARM11MP || \
856869
MACH_REALVIEW_PB11MP)
857-
default y if CPU_V6 || CPU_V7
870+
default y if CPU_V6 || CPU_V6K || CPU_V7
858871
help
859872
Historically, the kernel has used strongly ordered mappings to
860873
provide DMA coherent memory. With the advent of ARMv7, mapping

‎arch/arm/mm/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ obj-$(CONFIG_CPU_XSC3) += proc-xsc3.o
9090
obj-$(CONFIG_CPU_MOHAWK) += proc-mohawk.o
9191
obj-$(CONFIG_CPU_FEROCEON) += proc-feroceon.o
9292
obj-$(CONFIG_CPU_V6) += proc-v6.o
93+
obj-$(CONFIG_CPU_V6K) += proc-v6.o
9394
obj-$(CONFIG_CPU_V7) += proc-v7.o
9495

9596
AFLAGS_proc-v6.o :=-Wa,-march=armv6

0 commit comments

Comments
 (0)