diff options
| -rw-r--r-- | Documentation/devicetree/bindings/arm/l2c2x0.txt | 3 | ||||
| -rw-r--r-- | arch/arm/Kconfig | 1 | ||||
| -rw-r--r-- | arch/arm/boot/dts/r7s72100.dtsi | 11 | ||||
| -rw-r--r-- | arch/arm/include/asm/cpufeature.h | 38 | ||||
| -rw-r--r-- | arch/arm/include/asm/fixmap.h | 2 | ||||
| -rw-r--r-- | arch/arm/include/asm/module.h | 9 | ||||
| -rw-r--r-- | arch/arm/kernel/ftrace.c | 11 | ||||
| -rw-r--r-- | arch/arm/kernel/module-plts.c | 87 | ||||
| -rw-r--r-- | arch/arm/kernel/module.lds | 1 | ||||
| -rw-r--r-- | arch/arm/kernel/setup.c | 4 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/setup-r7s72100.c | 2 | ||||
| -rw-r--r-- | arch/arm/mm/cache-l2x0.c | 13 | ||||
| -rw-r--r-- | arch/arm/mm/dump.c | 54 | ||||
| -rw-r--r-- | arch/arm/mm/init.c | 13 | ||||
| -rw-r--r-- | arch/arm/mm/mmu.c | 16 | ||||
| -rw-r--r-- | arch/arm/mm/proc-v7m.S | 6 |
16 files changed, 212 insertions, 59 deletions
diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt index 917199f17965..d9650c1788f4 100644 --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt | |||
| @@ -90,6 +90,9 @@ Optional properties: | |||
| 90 | - arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable), | 90 | - arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable), |
| 91 | <1> (forcibly enable), property absent (OS specific behavior, | 91 | <1> (forcibly enable), property absent (OS specific behavior, |
| 92 | preferably retain firmware settings) | 92 | preferably retain firmware settings) |
| 93 | - arm,early-bresp-disable : Disable the CA9 optimization Early BRESP (PL310) | ||
| 94 | - arm,full-line-zero-disable : Disable the CA9 optimization Full line of zero | ||
| 95 | write (PL310) | ||
| 93 | 96 | ||
| 94 | Example: | 97 | Example: |
| 95 | 98 | ||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8a7ab5e73af9..4c6816be23a9 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -27,6 +27,7 @@ config ARM | |||
| 27 | select GENERIC_ALLOCATOR | 27 | select GENERIC_ALLOCATOR |
| 28 | select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI) | 28 | select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI) |
| 29 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP | 29 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP |
| 30 | select GENERIC_CPU_AUTOPROBE | ||
| 30 | select GENERIC_EARLY_IOREMAP | 31 | select GENERIC_EARLY_IOREMAP |
| 31 | select GENERIC_IDLE_POLL_SETUP | 32 | select GENERIC_IDLE_POLL_SETUP |
| 32 | select GENERIC_IRQ_PROBE | 33 | select GENERIC_IRQ_PROBE |
diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi index b8aa256bd515..1cf2bd038090 100644 --- a/arch/arm/boot/dts/r7s72100.dtsi +++ b/arch/arm/boot/dts/r7s72100.dtsi | |||
| @@ -177,6 +177,7 @@ | |||
| 177 | compatible = "arm,cortex-a9"; | 177 | compatible = "arm,cortex-a9"; |
| 178 | reg = <0>; | 178 | reg = <0>; |
| 179 | clock-frequency = <400000000>; | 179 | clock-frequency = <400000000>; |
| 180 | next-level-cache = <&L2>; | ||
| 180 | }; | 181 | }; |
| 181 | }; | 182 | }; |
| 182 | 183 | ||
| @@ -368,6 +369,16 @@ | |||
| 368 | <0xe8202000 0x1000>; | 369 | <0xe8202000 0x1000>; |
| 369 | }; | 370 | }; |
| 370 | 371 | ||
| 372 | L2: cache-controller@3ffff000 { | ||
| 373 | compatible = "arm,pl310-cache"; | ||
| 374 | reg = <0x3ffff000 0x1000>; | ||
| 375 | interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>; | ||
| 376 | arm,early-bresp-disable; | ||
| 377 | arm,full-line-zero-disable; | ||
| 378 | cache-unified; | ||
| 379 | cache-level = <2>; | ||
| 380 | }; | ||
| 381 | |||
| 371 | i2c0: i2c@fcfee000 { | 382 | i2c0: i2c@fcfee000 { |
| 372 | #address-cells = <1>; | 383 | #address-cells = <1>; |
| 373 | #size-cells = <0>; | 384 | #size-cells = <0>; |
diff --git a/arch/arm/include/asm/cpufeature.h b/arch/arm/include/asm/cpufeature.h new file mode 100644 index 000000000000..6d425191d01d --- /dev/null +++ b/arch/arm/include/asm/cpufeature.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2017 Linaro Ltd. <ard.biesheuvel@linaro.org> | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __ASM_CPUFEATURE_H | ||
| 10 | #define __ASM_CPUFEATURE_H | ||
| 11 | |||
| 12 | #include <linux/log2.h> | ||
| 13 | #include <asm/hwcap.h> | ||
| 14 | |||
| 15 | /* | ||
| 16 | * Due to the fact that ELF_HWCAP is a 32-bit type on ARM, and given the number | ||
| 17 | * of optional CPU features it defines, ARM's CPU hardware capability bits have | ||
| 18 | * been distributed over separate elf_hwcap and elf_hwcap2 variables, each of | ||
| 19 | * which covers a subset of the available CPU features. | ||
| 20 | * | ||
| 21 | * Currently, only a few of those are suitable for automatic module loading | ||
| 22 | * (which is the primary use case of this facility) and those happen to be all | ||
| 23 | * covered by HWCAP2. So let's only cover those via the cpu_feature() | ||
| 24 | * convenience macro for now (which is used by module_cpu_feature_match()). | ||
| 25 | * However, all capabilities are exposed via the modalias, and can be matched | ||
| 26 | * using an explicit MODULE_DEVICE_TABLE() that uses __hwcap_feature() directly. | ||
| 27 | */ | ||
| 28 | #define MAX_CPU_FEATURES 64 | ||
| 29 | #define __hwcap_feature(x) ilog2(HWCAP_ ## x) | ||
| 30 | #define __hwcap2_feature(x) (32 + ilog2(HWCAP2_ ## x)) | ||
| 31 | #define cpu_feature(x) __hwcap2_feature(x) | ||
| 32 | |||
| 33 | static inline bool cpu_have_feature(unsigned int num) | ||
| 34 | { | ||
| 35 | return num < 32 ? elf_hwcap & BIT(num) : elf_hwcap2 & BIT(num - 32); | ||
| 36 | } | ||
| 37 | |||
| 38 | #endif | ||
diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h index 5c17d2dec777..8f967d1373f6 100644 --- a/arch/arm/include/asm/fixmap.h +++ b/arch/arm/include/asm/fixmap.h | |||
| @@ -41,7 +41,7 @@ static const enum fixed_addresses __end_of_fixed_addresses = | |||
| 41 | 41 | ||
| 42 | #define FIXMAP_PAGE_COMMON (L_PTE_YOUNG | L_PTE_PRESENT | L_PTE_XN | L_PTE_DIRTY) | 42 | #define FIXMAP_PAGE_COMMON (L_PTE_YOUNG | L_PTE_PRESENT | L_PTE_XN | L_PTE_DIRTY) |
| 43 | 43 | ||
| 44 | #define FIXMAP_PAGE_NORMAL (FIXMAP_PAGE_COMMON | L_PTE_MT_WRITEBACK) | 44 | #define FIXMAP_PAGE_NORMAL (pgprot_kernel | L_PTE_XN) |
| 45 | #define FIXMAP_PAGE_RO (FIXMAP_PAGE_NORMAL | L_PTE_RDONLY) | 45 | #define FIXMAP_PAGE_RO (FIXMAP_PAGE_NORMAL | L_PTE_RDONLY) |
| 46 | 46 | ||
| 47 | /* Used by set_fixmap_(io|nocache), both meant for mapping a device */ | 47 | /* Used by set_fixmap_(io|nocache), both meant for mapping a device */ |
diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h index 464748b9fd7d..ed2319663a1e 100644 --- a/arch/arm/include/asm/module.h +++ b/arch/arm/include/asm/module.h | |||
| @@ -18,13 +18,18 @@ enum { | |||
| 18 | }; | 18 | }; |
| 19 | #endif | 19 | #endif |
| 20 | 20 | ||
| 21 | struct mod_plt_sec { | ||
| 22 | struct elf32_shdr *plt; | ||
| 23 | int plt_count; | ||
| 24 | }; | ||
| 25 | |||
| 21 | struct mod_arch_specific { | 26 | struct mod_arch_specific { |
| 22 | #ifdef CONFIG_ARM_UNWIND | 27 | #ifdef CONFIG_ARM_UNWIND |
| 23 | struct unwind_table *unwind[ARM_SEC_MAX]; | 28 | struct unwind_table *unwind[ARM_SEC_MAX]; |
| 24 | #endif | 29 | #endif |
| 25 | #ifdef CONFIG_ARM_MODULE_PLTS | 30 | #ifdef CONFIG_ARM_MODULE_PLTS |
| 26 | struct elf32_shdr *plt; | 31 | struct mod_plt_sec core; |
| 27 | int plt_count; | 32 | struct mod_plt_sec init; |
| 28 | #endif | 33 | #endif |
| 29 | }; | 34 | }; |
| 30 | 35 | ||
diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c index 3f1759411d51..414e60ed0257 100644 --- a/arch/arm/kernel/ftrace.c +++ b/arch/arm/kernel/ftrace.c | |||
| @@ -29,11 +29,6 @@ | |||
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | #ifdef CONFIG_DYNAMIC_FTRACE | 31 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 32 | #ifdef CONFIG_OLD_MCOUNT | ||
| 33 | #define OLD_MCOUNT_ADDR ((unsigned long) mcount) | ||
| 34 | #define OLD_FTRACE_ADDR ((unsigned long) ftrace_caller_old) | ||
| 35 | |||
| 36 | #define OLD_NOP 0xe1a00000 /* mov r0, r0 */ | ||
| 37 | 32 | ||
| 38 | static int __ftrace_modify_code(void *data) | 33 | static int __ftrace_modify_code(void *data) |
| 39 | { | 34 | { |
| @@ -51,6 +46,12 @@ void arch_ftrace_update_code(int command) | |||
| 51 | stop_machine(__ftrace_modify_code, &command, NULL); | 46 | stop_machine(__ftrace_modify_code, &command, NULL); |
| 52 | } | 47 | } |
| 53 | 48 | ||
| 49 | #ifdef CONFIG_OLD_MCOUNT | ||
| 50 | #define OLD_MCOUNT_ADDR ((unsigned long) mcount) | ||
| 51 | #define OLD_FTRACE_ADDR ((unsigned long) ftrace_caller_old) | ||
| 52 | |||
| 53 | #define OLD_NOP 0xe1a00000 /* mov r0, r0 */ | ||
| 54 | |||
| 54 | static unsigned long ftrace_nop_replace(struct dyn_ftrace *rec) | 55 | static unsigned long ftrace_nop_replace(struct dyn_ftrace *rec) |
| 55 | { | 56 | { |
| 56 | return rec->arch.old_mcount ? OLD_NOP : NOP; | 57 | return rec->arch.old_mcount ? OLD_NOP : NOP; |
diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c index 3a5cba90c971..3d0c2e4dda1d 100644 --- a/arch/arm/kernel/module-plts.c +++ b/arch/arm/kernel/module-plts.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org> | 2 | * Copyright (C) 2014-2017 Linaro Ltd. <ard.biesheuvel@linaro.org> |
| 3 | * | 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
| @@ -31,9 +31,17 @@ struct plt_entries { | |||
| 31 | u32 lit[PLT_ENT_COUNT]; | 31 | u32 lit[PLT_ENT_COUNT]; |
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | st | ||
