From 73c132c15da504789b924871e2491479a18e4f6a Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 16 May 2013 11:41:48 +0200 Subject: ARM: add support for kernel mode NEON In order to safely support the use of NEON instructions in kernel mode, some precautions need to be taken: - the userland context that may be present in the registers (even if the NEON/VFP is currently disabled) must be stored under the correct task (which may not be 'current' in the UP case), - to avoid having to keep track of additional vfpstates for the kernel side, disallow the use of NEON in interrupt context and run with preemption disabled, - after use, re-enable preemption and re-enable the lazy restore machinery by disabling the NEON/VFP unit. This patch adds the functions kernel_neon_begin() and kernel_neon_end() which take care of the above. It also adds the Kconfig symbol KERNEL_MODE_NEON to enable it. Signed-off-by: Ard Biesheuvel Acked-by: Nicolas Pitre --- arch/arm/include/asm/neon.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 arch/arm/include/asm/neon.h (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/neon.h b/arch/arm/include/asm/neon.h new file mode 100644 index 000000000000..8f730fe70093 --- /dev/null +++ b/arch/arm/include/asm/neon.h @@ -0,0 +1,36 @@ +/* + * linux/arch/arm/include/asm/neon.h + * + * Copyright (C) 2013 Linaro Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include + +#define cpu_has_neon() (!!(elf_hwcap & HWCAP_NEON)) + +#ifdef __ARM_NEON__ + +/* + * If you are affected by the BUILD_BUG below, it probably means that you are + * using NEON code /and/ calling the kernel_neon_begin() function from the same + * compilation unit. To prevent issues that may arise from GCC reordering or + * generating(1) NEON instructions outside of these begin/end functions, the + * only supported way of using NEON code in the kernel is by isolating it in a + * separate compilation unit, and calling it from another unit from inside a + * kernel_neon_begin/kernel_neon_end pair. + * + * (1) Current GCC (4.7) might generate NEON instructions at O3 level if + * -mpfu=neon is set. + */ + +#define kernel_neon_begin() \ + BUILD_BUG_ON_MSG(1, "kernel_neon_begin() called from NEON code") + +#else +void kernel_neon_begin(void); +#endif +void kernel_neon_end(void); -- cgit v1.2.3 From 01956597cbc46df072f20f90a40eebe356200c38 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 17 May 2013 18:51:23 +0200 Subject: ARM: crypto: add NEON accelerated XOR implementation Add a source file xor-neon.c (which is really just the reference C implementation passed through the GCC vectorizer) and hook it up to the XOR framework. Signed-off-by: Ard Biesheuvel Acked-by: Nicolas Pitre --- arch/arm/include/asm/xor.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/lib/Makefile | 6 ++++ arch/arm/lib/xor-neon.c | 42 ++++++++++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 arch/arm/lib/xor-neon.c (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/xor.h b/arch/arm/include/asm/xor.h index 7604673dc427..4ffb26d4cad8 100644 --- a/arch/arm/include/asm/xor.h +++ b/arch/arm/include/asm/xor.h @@ -7,7 +7,10 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include +#include +#include #define __XOR(a1, a2) a1 ^= a2 @@ -138,4 +141,74 @@ static struct xor_block_template xor_block_arm4regs = { xor_speed(&xor_block_arm4regs); \ xor_speed(&xor_block_8regs); \ xor_speed(&xor_block_32regs); \ + NEON_TEMPLATES; \ } while (0) + +#ifdef CONFIG_KERNEL_MODE_NEON + +extern struct xor_block_template const xor_block_neon_inner; + +static void +xor_neon_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) +{ + if (in_interrupt()) { + xor_arm4regs_2(bytes, p1, p2); + } else { + kernel_neon_begin(); + xor_block_neon_inner.do_2(bytes, p1, p2); + kernel_neon_end(); + } +} + +static void +xor_neon_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3) +{ + if (in_interrupt()) { + xor_arm4regs_3(bytes, p1, p2, p3); + } else { + kernel_neon_begin(); + xor_block_neon_inner.do_3(bytes, p1, p2, p3); + kernel_neon_end(); + } +} + +static void +xor_neon_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4) +{ + if (in_interrupt()) { + xor_arm4regs_4(bytes, p1, p2, p3, p4); + } else { + kernel_neon_begin(); + xor_block_neon_inner.do_4(bytes, p1, p2, p3, p4); + kernel_neon_end(); + } +} + +static void +xor_neon_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4, unsigned long *p5) +{ + if (in_interrupt()) { + xor_arm4regs_5(bytes, p1, p2, p3, p4, p5); + } else { + kernel_neon_begin(); + xor_block_neon_inner.do_5(bytes, p1, p2, p3, p4, p5); + kernel_neon_end(); + } +} + +static struct xor_block_template xor_block_neon = { + .name = "neon", + .do_2 = xor_neon_2, + .do_3 = xor_neon_3, + .do_4 = xor_neon_4, + .do_5 = xor_neon_5 +}; + +#define NEON_TEMPLATES \ + do { if (cpu_has_neon()) xor_speed(&xor_block_neon); } while (0) +#else +#define NEON_TEMPLATES +#endif diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index af72969820b4..aaf3a8731136 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -45,3 +45,9 @@ lib-$(CONFIG_ARCH_SHARK) += io-shark.o $(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S $(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S + +ifeq ($(CONFIG_KERNEL_MODE_NEON),y) + NEON_FLAGS := -mfloat-abi=softfp -mfpu=neon + CFLAGS_xor-neon.o += $(NEON_FLAGS) + lib-$(CONFIG_XOR_BLOCKS) += xor-neon.o +endif diff --git a/arch/arm/lib/xor-neon.c b/arch/arm/lib/xor-neon.c new file mode 100644 index 000000000000..f485e5a2af4b --- /dev/null +++ b/arch/arm/lib/xor-neon.c @@ -0,0 +1,42 @@ +/* + * linux/arch/arm/lib/xor-neon.c + * + * Copyright (C) 2013 Linaro Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include + +#ifndef __ARM_NEON__ +#error You should compile this file with '-mfloat-abi=softfp -mfpu=neon' +#endif + +/* + * Pull in the reference implementations while instructing GCC (through + * -ftree-vectorize) to attempt to exploit implicit parallelism and emit + * NEON instructions. + */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC optimize "tree-vectorize" +#else +/* + * While older versions of GCC do not generate incorrect code, they fail to + * recognize the parallel nature of these functions, and emit plain ARM code, + * which is known to be slower than the optimized ARM code in asm-arm/xor.h. + */ +#warning This code requires at least version 4.6 of GCC +#endif + +#pragma GCC diagnostic ignored "-Wunused-variable" +#include + +struct xor_block_template const xor_block_neon_inner = { + .name = "__inner_neon__", + .do_2 = xor_8regs_2, + .do_3 = xor_8regs_3, + .do_4 = xor_8regs_4, + .do_5 = xor_8regs_5, +}; -- cgit v1.2.3 From ff69a4c855066592f9e293cff8f54813614dd544 Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 26 Jul 2013 14:55:59 +0100 Subject: ARM: constify machine_desc structure uses struct machine_desc records are defined everywhere as a 'const' structure, but unfortuantely it loses its const-ness through the use of linker magic - the symbols which surround the section are not declared const so it becomes possible not to use 'const' for pointers to these const structures. Let's fix this oversight - all pointers to these structures should be marked const too. Signed-off-by: Russell King --- arch/arm/include/asm/mach/arch.h | 4 ++-- arch/arm/include/asm/memblock.h | 3 +-- arch/arm/include/asm/prom.h | 4 ++-- arch/arm/kernel/atags.h | 5 +++-- arch/arm/kernel/atags_parse.c | 6 +++--- arch/arm/kernel/devtree.c | 6 +++--- arch/arm/kernel/setup.c | 12 ++++++------ arch/arm/mm/init.c | 5 +++-- arch/arm/mm/mmu.c | 4 ++-- arch/arm/mm/nommu.c | 2 +- 10 files changed, 26 insertions(+), 25 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h index 441efc491b50..69b879ac0289 100644 --- a/arch/arm/include/asm/mach/arch.h +++ b/arch/arm/include/asm/mach/arch.h @@ -65,12 +65,12 @@ struct machine_desc { /* * Current machine - only accessible during boot. */ -extern struct machine_desc *machine_desc; +extern const struct machine_desc *machine_desc; /* * Machine type table - also only accessible during boot */ -extern struct machine_desc __arch_info_begin[], __arch_info_end[]; +extern const struct machine_desc __arch_info_begin[], __arch_info_end[]; #define for_each_machine_desc(p) \ for (p = __arch_info_begin; p < __arch_info_end; p++) diff --git a/arch/arm/include/asm/memblock.h b/arch/arm/include/asm/memblock.h index 00ca5f92648e..c2f5102ae659 100644 --- a/arch/arm/include/asm/memblock.h +++ b/arch/arm/include/asm/memblock.h @@ -4,8 +4,7 @@ struct meminfo; struct machine_desc; -extern void arm_memblock_init(struct meminfo *, struct machine_desc *); - +void arm_memblock_init(struct meminfo *, const struct machine_desc *); phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align); #endif diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h index a219227c3e43..4a2985e21969 100644 --- a/arch/arm/include/asm/prom.h +++ b/arch/arm/include/asm/prom.h @@ -15,13 +15,13 @@ #ifdef CONFIG_OF -extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys); +extern const struct machine_desc *setup_machine_fdt(unsigned int dt_phys); extern void arm_dt_memblock_reserve(void); extern void __init arm_dt_init_cpu_maps(void); #else /* CONFIG_OF */ -static inline struct machine_desc *setup_machine_fdt(unsigned int dt_phys) +static inline const struct machine_desc *setup_machine_fdt(unsigned int dt_phys) { return NULL; } diff --git a/arch/arm/kernel/atags.h b/arch/arm/kernel/atags.h index 9edc9692332d..ec4164da6e30 100644 --- a/arch/arm/kernel/atags.h +++ b/arch/arm/kernel/atags.h @@ -7,9 +7,10 @@ static inline void save_atags(struct tag *tags) { } void convert_to_tag_list(struct tag *tags); #ifdef CONFIG_ATAGS -struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr); +const struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer, + unsigned int machine_nr); #else -static inline struct machine_desc * +static inline const struct machine_desc * setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr) { early_print("no ATAGS support: can't continue\n"); diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c index 14512e6931d8..8c14de8180c0 100644 --- a/arch/arm/kernel/atags_parse.c +++ b/arch/arm/kernel/atags_parse.c @@ -178,11 +178,11 @@ static void __init squash_mem_tags(struct tag *tag) tag->hdr.tag = ATAG_NONE; } -struct machine_desc * __init setup_machine_tags(phys_addr_t __atags_pointer, - unsigned int machine_nr) +const struct machine_desc * __init +setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr) { struct tag *tags = (struct tag *)&default_tags; - struct machine_desc *mdesc = NULL, *p; + const struct machine_desc *mdesc = NULL, *p; char *from = default_command_line; default_tags.mem.start = PHYS_OFFSET; diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index 5859c8bc727c..eae1976f859d 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c @@ -176,10 +176,10 @@ void __init arm_dt_init_cpu_maps(void) * If a dtb was passed to the kernel in r2, then use it to choose the * correct machine_desc and to setup the system. */ -struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) +const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) { struct boot_param_header *devtree; - struct machine_desc *mdesc, *mdesc_best = NULL; + const struct machine_desc *mdesc, *mdesc_best = NULL; unsigned int score, mdesc_score = ~1; unsigned long dt_root; const char *model; @@ -188,7 +188,7 @@ struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) DT_MACHINE_START(GENERIC_DT, "Generic DT based system") MACHINE_END - mdesc_best = (struct machine_desc *)&__mach_desc_GENERIC_DT; + mdesc_best = &__mach_desc_GENERIC_DT; #endif if (!dt_phys) diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 63af9a7ae512..863629989f02 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -72,10 +72,10 @@ static int __init fpe_setup(char *line) __setup("fpe=", fpe_setup); #endif -extern void paging_init(struct machine_desc *desc); +extern void paging_init(const struct machine_desc *desc); extern void sanity_check_meminfo(void); extern enum reboot_mode reboot_mode; -extern void setup_dma_zone(struct machine_desc *desc); +extern void setup_dma_zone(const struct machine_desc *desc); unsigned int processor_id; EXPORT_SYMBOL(processor_id); @@ -139,7 +139,7 @@ EXPORT_SYMBOL(elf_platform); static const char *cpu_name; static const char *machine_name; static char __initdata cmd_line[COMMAND_LINE_SIZE]; -struct machine_desc *machine_desc __initdata; +const struct machine_desc *machine_desc __initdata; static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } }; #define ENDIANNESS ((char)endian_test.l) @@ -607,7 +607,7 @@ static void __init setup_processor(void) void __init dump_machine_table(void) { - struct machine_desc *p; + const struct machine_desc *p; early_print("Available machine support:\n\nID (hex)\tNAME\n"); for_each_machine_desc(p) @@ -694,7 +694,7 @@ static int __init early_mem(char *p) } early_param("mem", early_mem); -static void __init request_standard_resources(struct machine_desc *mdesc) +static void __init request_standard_resources(const struct machine_desc *mdesc) { struct memblock_region *region; struct resource *res; @@ -850,7 +850,7 @@ void __init hyp_mode_check(void) void __init setup_arch(char **cmdline_p) { - struct machine_desc *mdesc; + const struct machine_desc *mdesc; setup_processor(); mdesc = setup_machine_fdt(__atags_pointer); diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 15225d829d71..2958e74fc42c 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -231,7 +231,7 @@ static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole, } #endif -void __init setup_dma_zone(struct machine_desc *mdesc) +void __init setup_dma_zone(const struct machine_desc *mdesc) { #ifdef CONFIG_ZONE_DMA if (mdesc->dma_zone_size) { @@ -335,7 +335,8 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align) return phys; } -void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) +void __init arm_memblock_init(struct meminfo *mi, + const struct machine_desc *mdesc) { int i; diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 4f56617a2392..56054ac8348e 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1151,7 +1151,7 @@ void __init arm_mm_memblock_reserve(void) * called function. This means you can't use any function or debugging * method which may touch any device, otherwise the kernel _will_ crash. */ -static void __init devicemaps_init(struct machine_desc *mdesc) +static void __init devicemaps_init(const struct machine_desc *mdesc) { struct map_desc map; unsigned long addr; @@ -1272,7 +1272,7 @@ static void __init map_lowmem(void) * paging_init() sets up the page tables, initialises the zone memory * maps, and sets up the zero page, bad page and bad page tables. */ -void __init paging_init(struct machine_desc *mdesc) +void __init paging_init(const struct machine_desc *mdesc) { void *zero_page; diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c index 1fa50100ab6a..34d4ab217bab 100644 --- a/arch/arm/mm/nommu.c +++ b/arch/arm/mm/nommu.c @@ -299,7 +299,7 @@ void __init sanity_check_meminfo(void) * paging_init() sets up the page tables, initialises the zone memory * maps, and sets up the zero page, bad page and bad page tables. */ -void __init paging_init(struct machine_desc *mdesc) +void __init paging_init(const struct machine_desc *mdesc) { early_trap_init((void *)CONFIG_VECTORS_BASE); mpu_setup(); -- cgit v1.2.3 From f0915781bd5edf78b1154e61efe962dc15872d09 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Mon, 11 Feb 2013 13:47:48 +0000 Subject: ARM: tlb: don't perform inner-shareable invalidation for local TLB ops Inner-shareable TLB invalidation is typically more expensive than local (non-shareable) invalidation, so performing the broadcasting for local_flush_tlb_* operations is a waste of cycles and needlessly clobbers entries in the TLBs of other CPUs. This patch introduces __flush_tlb_* versions for many of the TLB invalidation functions, which only respect inner-shareable variants of the invalidation instructions when presented with the TLB_V7_UIS_FULL flag. The local version is also inlined to prevent SMP_ON_UP kernels from missing flushes, where the __flush variant would be called with the UP flags. This gains us around 0.5% in hackbench scores for a dual-core A15, but I would expect this to improve as more cores (and clusters) are added to the equation. Reviewed-by: Catalin Marinas Reported-by: Albin Tonnerre Signed-off-by: Will Deacon --- arch/arm/include/asm/tlbflush.h | 138 ++++++++++++++++++++++++++++++++++------ arch/arm/kernel/smp_tlb.c | 8 +-- arch/arm/mm/context.c | 7 +- 3 files changed, 123 insertions(+), 30 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h index f467e9b3f8d5..3316264916e9 100644 --- a/arch/arm/include/asm/tlbflush.h +++ b/arch/arm/include/asm/tlbflush.h @@ -319,6 +319,16 @@ extern struct cpu_tlb_fns cpu_tlb; #define tlb_op(f, regs, arg) __tlb_op(f, "p15, 0, %0, " regs, arg) #define tlb_l2_op(f, regs, arg) __tlb_op(f, "p15, 1, %0, " regs, arg) +static inline void __local_flush_tlb_all(void) +{ + const int zero = 0; + const unsigned int __tlb_flag = __cpu_tlb_flags; + + tlb_op(TLB_V4_U_FULL | TLB_V6_U_FULL, "c8, c7, 0", zero); + tlb_op(TLB_V4_D_FULL | TLB_V6_D_FULL, "c8, c6, 0", zero); + tlb_op(TLB_V4_I_FULL | TLB_V6_I_FULL, "c8, c5, 0", zero); +} + static inline void local_flush_tlb_all(void) { const int zero = 0; @@ -327,10 +337,8 @@ static inline void local_flush_tlb_all(void) if (tlb_flag(TLB_WB)) dsb(); - tlb_op(TLB_V4_U_FULL | TLB_V6_U_FULL, "c8, c7, 0", zero); - tlb_op(TLB_V4_D_FULL | TLB_V6_D_FULL, "c8, c6, 0", zero); - tlb_op(TLB_V4_I_FULL | TLB_V6_I_FULL, "c8, c5, 0", zero); - tlb_op(TLB_V7_UIS_FULL, "c8, c3, 0", zero); + __local_flush_tlb_all(); + tlb_op(TLB_V7_UIS_FULL, "c8, c7, 0", zero); if (tlb_flag(TLB_BARRIER)) { dsb(); @@ -338,31 +346,69 @@ static inline void local_flush_tlb_all(void) } } -static inline void local_flush_tlb_mm(struct mm_struct *mm) +static inline void __flush_tlb_all(void) { const int zero = 0; - const int asid = ASID(mm); const unsigned int __tlb_flag = __cpu_tlb_flags; if (tlb_flag(TLB_WB)) dsb(); + __local_flush_tlb_all(); + tlb_op(TLB_V7_UIS_FULL, "c8, c3, 0", zero); + + if (tlb_flag(TLB_BARRIER)) { + dsb(); + isb(); + } +} + +static inline void __local_flush_tlb_mm(struct mm_struct *mm) +{ + const int zero = 0; + const int asid = ASID(mm); + const unsigned int __tlb_flag = __cpu_tlb_flags; + if (possible_tlb_flags & (TLB_V4_U_FULL|TLB_V4_D_FULL|TLB_V4_I_FULL)) { - if (cpumask_test_cpu(get_cpu(), mm_cpumask(mm))) { + if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm))) { tlb_op(TLB_V4_U_FULL, "c8, c7, 0", zero); tlb_op(TLB_V4_D_FULL, "c8, c6, 0", zero); tlb_op(TLB_V4_I_FULL, "c8, c5, 0", zero); } - put_cpu(); } tlb_op(TLB_V6_U_ASID, "c8, c7, 2", asid); tlb_op(TLB_V6_D_ASID, "c8, c6, 2", asid); tlb_op(TLB_V6_I_ASID, "c8, c5, 2", asid); +} + +static inline void local_flush_tlb_mm(struct mm_struct *mm) +{ + const int asid = ASID(mm); + const unsigned int __tlb_flag = __cpu_tlb_flags; + + if (tlb_flag(TLB_WB)) + dsb(); + + __local_flush_tlb_mm(mm); + tlb_op(TLB_V7_UIS_ASID, "c8, c7, 2", asid); + + if (tlb_flag(TLB_BARRIER)) + dsb(); +} + +static inline void __flush_tlb_mm(struct mm_struct *mm) +{ + const unsigned int __tlb_flag = __cpu_tlb_flags; + + if (tlb_flag(TLB_WB)) + dsb(); + + __local_flush_tlb_mm(mm); #ifdef CONFIG_ARM_ERRATA_720789 - tlb_op(TLB_V7_UIS_ASID, "c8, c3, 0", zero); + tlb_op(TLB_V7_UIS_ASID, "c8, c3, 0", 0); #else - tlb_op(TLB_V7_UIS_ASID, "c8, c3, 2", asid); + tlb_op(TLB_V7_UIS_ASID, "c8, c3, 2", ASID(mm)); #endif if (tlb_flag(TLB_BARRIER)) @@ -370,16 +416,13 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm) } static inline void -local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) +__local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) { const int zero = 0; const unsigned int __tlb_flag = __cpu_tlb_flags; uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); - if (tlb_flag(TLB_WB)) - dsb(); - if (possible_tlb_flags & (TLB_V4_U_PAGE|TLB_V4_D_PAGE|TLB_V4_I_PAGE|TLB_V4_I_FULL) && cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) { tlb_op(TLB_V4_U_PAGE, "c8, c7, 1", uaddr); @@ -392,6 +435,36 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) tlb_op(TLB_V6_U_PAGE, "c8, c7, 1", uaddr); tlb_op(TLB_V6_D_PAGE, "c8, c6, 1", uaddr); tlb_op(TLB_V6_I_PAGE, "c8, c5, 1", uaddr); +} + +static inline void +local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) +{ + const unsigned int __tlb_flag = __cpu_tlb_flags; + + uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); + + if (tlb_flag(TLB_WB)) + dsb(); + + __local_flush_tlb_page(vma, uaddr); + tlb_op(TLB_V7_UIS_PAGE, "c8, c7, 1", uaddr); + + if (tlb_flag(TLB_BARRIER)) + dsb(); +} + +static inline void +__flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) +{ + const unsigned int __tlb_flag = __cpu_tlb_flags; + + uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); + + if (tlb_flag(TLB_WB)) + dsb(); + + __local_flush_tlb_page(vma, uaddr); #ifdef CONFIG_ARM_ERRATA_720789 tlb_op(TLB_V7_UIS_PAGE, "c8, c3, 3", uaddr & PAGE_MASK); #else @@ -402,16 +475,11 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) dsb(); } -static inline void local_flush_tlb_kernel_page(unsigned long kaddr) +static inline void __local_flush_tlb_kernel_page(unsigned long kaddr) { const int zero = 0; const unsigned int __tlb_flag = __cpu_tlb_flags; - kaddr &= PAGE_MASK; - - if (tlb_flag(TLB_WB)) - dsb(); - tlb_op(TLB_V4_U_PAGE, "c8, c7, 1", kaddr); tlb_op(TLB_V4_D_PAGE, "c8, c6, 1", kaddr); tlb_op(TLB_V4_I_PAGE, "c8, c5, 1", kaddr); @@ -421,6 +489,36 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr) tlb_op(TLB_V6_U_PAGE, "c8, c7, 1", kaddr); tlb_op(TLB_V6_D_PAGE, "c8, c6, 1", kaddr); tlb_op(TLB_V6_I_PAGE, "c8, c5, 1", kaddr); +} + +static inline void local_flush_tlb_kernel_page(unsigned long kaddr) +{ + const unsigned int __tlb_flag = __cpu_tlb_flags; + + kaddr &= PAGE_MASK; + + if (tlb_flag(TLB_WB)) + dsb(); + + __local_flush_tlb_kernel_page(kaddr); + tlb_op(TLB_V7_UIS_PAGE, "c8, c7, 1", kaddr); + + if (tlb_flag(TLB_BARRIER)) { + dsb(); + isb(); + } +} + +static inline void __flush_tlb_kernel_page(unsigned long kaddr) +{ + const unsigned int __tlb_flag = __cpu_tlb_flags; + + kaddr &= PAGE_MASK; + + if (tlb_flag(TLB_WB)) + dsb(); + + __local_flush_tlb_kernel_page(kaddr); tlb_op(TLB_V7_UIS_PAGE, "c8, c3, 1", kaddr); if (tlb_flag(TLB_BARRIER)) { diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index c2edfff573c2..5883b8ae77c8 100644 --- a/arch/arm/kernel/smp_tlb.c +++ b/arch/arm/kernel/smp_tlb.c @@ -104,7 +104,7 @@ void flush_tlb_all(void) if (tlb_ops_need_broadcast()) on_each_cpu(ipi_flush_tlb_all, NULL, 1); else - local_flush_tlb_all(); + __flush_tlb_all(); broadcast_tlb_a15_erratum(); } @@ -113,7 +113,7 @@ void flush_tlb_mm(struct mm_struct *mm) if (tlb_ops_need_broadcast()) on_each_cpu_mask(mm_cpumask(mm), ipi_flush_tlb_mm, mm, 1); else - local_flush_tlb_mm(mm); + __flush_tlb_mm(mm); broadcast_tlb_mm_a15_erratum(mm); } @@ -126,7 +126,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_page, &ta, 1); } else - local_flush_tlb_page(vma, uaddr); + __flush_tlb_page(vma, uaddr); broadcast_tlb_mm_a15_erratum(vma->vm_mm); } @@ -137,7 +137,7 @@ void flush_tlb_kernel_page(unsigned long kaddr) ta.ta_start = kaddr; on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1); } else - local_flush_tlb_kernel_page(kaddr); + __flush_tlb_kernel_page(kaddr); broadcast_tlb_a15_erratum(); } diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 4a0544492f10..84e6f772e204 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c @@ -162,10 +162,7 @@ static void flush_context(unsigned int cpu) } /* Queue a TLB invalidate and flush the I-cache if necessary. */ - if (!tlb_ops_need_broadcast()) - cpumask_set_cpu(cpu, &tlb_flush_pending); - else - cpumask_setall(&tlb_flush_pending); + cpumask_setall(&tlb_flush_pending); if (icache_is_vivt_asid_tagged()) __flush_icache_all(); @@ -245,8 +242,6 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk) if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) { local_flush_bp_all(); local_flush_tlb_all(); - if (erratum_a15_798181()) - dummy_flush_tlb_a15_erratum(); } atomic64_set(&per_cpu(active_asids, cpu), asid); -- cgit v1.2.3 From 587b9b6487acddf777301c867c24f31fdf4ada4a Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Thu, 23 May 2013 18:29:18 +0100 Subject: ARM: tlb: don't bother with barriers for branch predictor maintenance Branch predictor maintenance is only required when we are either changing the kernel's view of memory (switching tables completely) or dealing with ASID rollover. Both of these use-cases require subsequent TLB invalidation, which has the relevant barrier instructions to ensure completion and visibility of the maintenance, so this patch removes the instruction barrier from [local_]flush_bp_all. Reviewed-by: Catalin Marinas Signed-off-by: Will Deacon --- arch/arm/include/asm/tlbflush.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h index 3316264916e9..9b725d2bcb6b 100644 --- a/arch/arm/include/asm/tlbflush.h +++ b/arch/arm/include/asm/tlbflush.h @@ -527,6 +527,10 @@ static inline void __flush_tlb_kernel_page(unsigned long kaddr) } } +/* + * Branch predictor maintenance is paired with full TLB invalidation, so + * there is no need for any barriers here. + */ static inline void local_flush_bp_all(void) { const int zero = 0; @@ -536,9 +540,6 @@ static inline void local_flush_bp_all(void) asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero)); else if (tlb_flag(TLB_V6_BP)) asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero)); - - if (tlb_flag(TLB_BARRIER)) - isb(); } #include -- cgit v1.2.3 From 2c813980c6113ac2c407fbed99f53242088c3038 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Mon, 18 Feb 2013 22:07:47 +0000 Subject: ARM: tlb: don't perform inner-shareable invalidation for local BP ops Now that the ASID allocator doesn't require inner-shareable maintenance, we can convert the local_bp_flush_all function to perform only non-shareable flushing, in a similar manner to the TLB invalidation routines. Reviewed-by: Catalin Marinas Signed-off-by: Will Deacon --- arch/arm/include/asm/tlbflush.h | 22 ++++++++++++++++++++-- arch/arm/kernel/smp_tlb.c | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h index 9b725d2bcb6b..84718240340c 100644 --- a/arch/arm/include/asm/tlbflush.h +++ b/arch/arm/include/asm/tlbflush.h @@ -531,17 +531,35 @@ static inline void __flush_tlb_kernel_page(unsigned long kaddr) * Branch predictor maintenance is paired with full TLB invalidation, so * there is no need for any barriers here. */ +static inline void __local_flush_bp_all(void) +{ + const int zero = 0; + const unsigned int __tlb_flag = __cpu_tlb_flags; + + if (tlb_flag(TLB_V6_BP)) + asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero)); +} + static inline void local_flush_bp_all(void) { const int zero = 0; const unsigned int __tlb_flag = __cpu_tlb_flags; + __local_flush_bp_all(); if (tlb_flag(TLB_V7_UIS_BP)) - asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero)); - else if (tlb_flag(TLB_V6_BP)) asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero)); } +static inline void __flush_bp_all(void) +{ + const int zero = 0; + const unsigned int __tlb_flag = __cpu_tlb_flags; + + __local_flush_bp_all(); + if (tlb_flag(TLB_V7_UIS_BP)) + asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero)); +} + #include #ifdef CONFIG_ARM_ERRATA_798181 static inline int erratum_a15_798181(void) diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index 5883b8ae77c8..83ccca303df8 100644 --- a/arch/arm/kernel/smp_tlb.c +++ b/arch/arm/kernel/smp_tlb.c @@ -173,5 +173,5 @@ void flush_bp_all(void) if (tlb_ops_need_broadcast()) on_each_cpu(ipi_flush_bp_all, NULL, 1); else - local_flush_bp_all(); + __flush_bp_all(); } -- cgit v1.2.3 From 3ea128065ed20d33bd02ff6dab689f88e38000be Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Fri, 10 May 2013 18:07:19 +0100 Subject: ARM: barrier: allow options to be passed to memory barrier instructions On ARMv7, the memory barrier instructions take an optional `option' field which can be used to constrain the effects of a memory barrier based on shareability and access type. This patch allows the caller to pass these options if required, and updates the smp_*() barriers to request inner-shareable barriers, affecting only stores for the _wmb variant. wmb() is also changed to use the -st version of dsb. Reported-by: Albin Tonnerre Reviewed-by: Catalin Marinas Signed-off-by: Will Deacon --- arch/arm/include/asm/assembler.h | 4 ++-- arch/arm/include/asm/barrier.h | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index a5fef710af32..fcc1b5bf6979 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h @@ -220,9 +220,9 @@ #ifdef CONFIG_SMP #if __LINUX_ARM_ARCH__ >= 7 .ifeqs "\mode","arm" - ALT_SMP(dmb) + ALT_SMP(dmb ish) .else - ALT_SMP(W(dmb)) + ALT_SMP(W(dmb) ish) .endif #elif __LINUX_ARM_ARCH__ == 6 ALT_SMP(mcr p15, 0, r0, c7, c10, 5) @ dmb diff --git a/arch/arm/include/asm/barrier.h b/arch/arm/include/asm/barrier.h index 8dcd9c702d90..60f15e274e6d 100644 --- a/arch/arm/include/asm/barrier.h +++ b/arch/arm/include/asm/barrier.h @@ -14,27 +14,27 @@ #endif #if __LINUX_ARM_ARCH__ >= 7 -#define isb() __asm__ __volatile__ ("isb" : : : "memory") -#define dsb() __asm__ __volatile__ ("dsb" : : : "memory") -#define dmb() __asm__ __volatile__ ("dmb" : : : "memory") +#define isb(option) __asm__ __volatile__ ("isb " #option : : : "memory") +#define dsb(option) __asm__ __volatile__ ("dsb " #option : : : "memory") +#define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory") #elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6 -#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \ +#define isb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \ : : "r" (0) : "memory") -#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ +#define dsb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ : : "r" (0) : "memory") -#define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \ +#define dmb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \ : : "r" (0) : "memory") #elif defined(CONFIG_CPU_FA526) -#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \ +#define isb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \ : : "r" (0) : "memory") -#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ +#define dsb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ : : "r" (0) : "memory") -#define dmb() __asm__ __volatile__ ("" : : : "memory") +#define dmb(x) __asm__ __volatile__ ("" : : : "memory") #else -#define isb() __asm__ __volatile__ ("" : : : "memory") -#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ +#define isb(x) __asm__ __volatile__ ("" : : : "memory") +#define dsb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ : : "r" (0) : "memory") -#define dmb() __asm__ __volatile__ ("" : : : "memory") +#define dmb(x) __asm__ __volatile__ ("" : : : "memory") #endif #ifdef CONFIG_ARCH_HAS_BARRIERS @@ -42,7 +42,7 @@ #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) #define mb() do { dsb(); outer_sync(); } while (0) #define rmb() dsb() -#define wmb() mb() +#define wmb() do { dsb(st); outer_sync(); } while (0) #else #define mb() barrier() #define rmb() barrier() @@ -54,9 +54,9 @@ #define smp_rmb() barrier() #define smp_wmb() barrier() #else -#define smp_mb() dmb() -#define smp_rmb() dmb() -#define smp_wmb() dmb() +#define smp_mb() dmb(ish) +#define smp_rmb() smp_mb() +#define smp_wmb() dmb(ishst) #endif #define read_barrier_depends() do { } while(0) -- cgit v1.2.3 From 62cbbc42e0019aff6310259f275ae812463f8836 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Thu, 23 May 2013 18:43:58 +0100 Subject: ARM: tlb: reduce scope of barrier domains for TLB invalidation Our TLB invalidation routines may require a barrier before the maintenance (in order to ensure pending page table writes are visible to the hardware walker) and barriers afterwards (in order to ensure completion of the maintenance and visibility in the instruction stream). Whilst this is expensive, the cost can be reduced somewhat by reducing the scope of the barrier instructions: - The barrier before only needs to apply to stores (pte writes) - Local ops are required only to affect the non-shareable domain - Global ops are required only to affect the inner-shareable domain This patch makes these changes for the TLB flushing code. Reviewed-by: Catalin Marinas Signed-off-by: Will Deacon --- arch/arm/include/asm/tlbflush.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h index 84718240340c..38960264040c 100644 --- a/arch/arm/include/asm/tlbflush.h +++ b/arch/arm/include/asm/tlbflush.h @@ -335,13 +335,13 @@ static inline void local_flush_tlb_all(void) const unsigned int __tlb_flag = __cpu_tlb_flags; if (tlb_flag(TLB_WB)) - dsb(); + dsb(nshst); __local_flush_tlb_all(); tlb_op(TLB_V7_UIS_FULL, "c8, c7, 0", zero); if (tlb_flag(TLB_BARRIER)) { - dsb(); + dsb(nsh); isb(); } } @@ -352,13 +352,13 @@ static inline void __flush_tlb_all(void) const unsigned int __tlb_flag = __cpu_tlb_flags; if (tlb_flag(TLB_WB)) - dsb(); + dsb(ishst); __local_flush_tlb_all(); tlb_op(TLB_V7_UIS_FULL, "c8, c3, 0", zero); if (tlb_flag(TLB_BARRIER)) { - dsb(); + dsb(ish); isb(); } } @@ -388,13 +388,13 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm) const unsigned int __tlb_flag = __cpu_tlb_flags; if (tlb_flag(TLB_WB)) - dsb(); + dsb(nshst); __local_flush_tlb_mm(mm); tlb_op(TLB_V7_UIS_ASID, "c8, c7, 2", asid); if (tlb_flag(TLB_BARRIER)) - dsb(); + dsb(nsh); } static inline void __flush_tlb_mm(struct mm_struct *mm) @@ -402,7 +402,7 @@ static inline void __flush_tlb_mm(struct mm_struct *mm) const unsigned int __tlb_flag = __cpu_tlb_flags; if (tlb_flag(TLB_WB)) - dsb(); + dsb(ishst); __local_flush_tlb_mm(mm); #ifdef CONFIG_ARM_ERRATA_720789 @@ -412,7 +412,7 @@ static inline void __flush_tlb_mm(struct mm_struct *mm) #endif if (tlb_flag(TLB_BARRIER)) - dsb(); + dsb(ish); } static inline void @@ -445,13 +445,13 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); if (tlb_flag(TLB_WB)) - dsb(); + dsb(nshst); __local_flush_tlb_page(vma, uaddr); tlb_op(TLB_V7_UIS_PAGE, "c8, c7, 1", uaddr); if (tlb_flag(TLB_BARRIER)) - dsb(); + dsb(nsh); } static inline void @@ -462,7 +462,7 @@ __flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); if (tlb_flag(TLB_WB)) - dsb(); + dsb(ishst); __local_flush_tlb_page(vma, uaddr); #ifdef CONFIG_ARM_ERRATA_720789 @@ -472,7 +472,7 @@ __flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) #endif if (tlb_flag(TLB_BARRIER)) - dsb(); + dsb(ish); } static inline void __local_flush_tlb_kernel_page(unsigned long kaddr) @@ -498,13 +498,13 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr) kaddr &= PAGE_MASK; if (tlb_flag(TLB_WB)) - dsb(); + dsb(nshst); __local_flush_tlb_kernel_page(kaddr); tlb_op(TLB_V7_UIS_PAGE, "c8, c7, 1", kaddr); if (tlb_flag(TLB_BARRIER)) { - dsb(); + dsb(nsh); isb(); } } @@ -516,13 +516,13 @@ static inline void __flush_tlb_kernel_page(unsigned long kaddr) kaddr &= PAGE_MASK; if (tlb_flag(TLB_WB)) - dsb(); + dsb(ishst); __local_flush_tlb_kernel_page(kaddr); tlb_op(TLB_V7_UIS_PAGE, "c8, c3, 1", kaddr); if (tlb_flag(TLB_BARRIER)) { - dsb(); + dsb(ish); isb(); } } @@ -578,7 +578,7 @@ static inline void dummy_flush_tlb_a15_erratum(void) * Dummy TLBIMVAIS. Using the unmapped address 0 and ASID 0. */ asm("mcr p15, 0, %0, c8, c3, 1" : : "r" (0)); - dsb(); + dsb(ish); } #else static inline int erratum_a15_798181(void) @@ -612,7 +612,7 @@ static inline void flush_pmd_entry(void *pmd) tlb_l2_op(TLB_L2CLEAN_FR, "c15, c9, 1 @ L2 flush_pmd", pmd); if (tlb_flag(TLB_WB)) - dsb(); + dsb(ishst); } static inline void clean_pmd_entry(void *pmd) -- cgit v1.2.3 From 73a6fdc48bf52e93c26874dc8c0f0f8d5585a809 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Mon, 13 May 2013 11:39:50 +0100 Subject: ARM: spinlock: use inner-shareable dsb variant prior to sev instruction When unlocking a spinlock, we use the sev instruction to signal other CPUs waiting on the lock. Since sev is not a memory access instruction, we require a dsb in order to ensure that the sev is not issued ahead of the store placing the lock in an unlocked state. However, as sev is only concerned with other processors in a multiprocessor system, we can restrict the scope of the preceding dsb to the inner-shareable domain. Furthermore, we can restrict the scope to consider only stores, since there are no independent loads on the unlock path. A side-effect of this change is that a spin_unlock operation no longer forces completion of pending TLB invalidation, something which we rely on when unlocking runqueues to ensure that CPU migration during TLB maintenance routines doesn't cause us to continue before the operation has completed. This patch adds the -ishst suffix to the ARMv7 definition of dsb_sev() and adds an inner-shareable dsb to the context-switch path when running a preemptible, SMP, v7 kernel. Reviewed-by: Catalin Marinas Signed-off-by: Will Deacon --- arch/arm/include/asm/spinlock.h | 2 +- arch/arm/include/asm/switch_to.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h index f8b8965666e9..2c1e748f52d8 100644 --- a/arch/arm/include/asm/spinlock.h +++ b/arch/arm/include/asm/spinlock.h @@ -46,7 +46,7 @@ static inline void dsb_sev(void) { #if __LINUX_ARM_ARCH__ >= 7 __asm__ __volatile__ ( - "dsb\n" + "dsb ishst\n" SEV ); #else diff --git a/arch/arm/include/asm/switch_to.h b/arch/arm/include/asm/switch_to.h index fa09e6b49bf1..c99e259469f7 100644 --- a/arch/arm/include/asm/switch_to.h +++ b/arch/arm/include/asm/switch_to.h @@ -3,6 +3,16 @@ #include +/* + * For v7 SMP cores running a preemptible kernel we may be pre-empted + * during a TLB maintenance operation, so execute an inner-shareable dsb + * to ensure that the maintenance completes in case we migrate to another + * CPU. + */ +#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP) && defined(CONFIG_CPU_V7) +#define finish_arch_switch(prev) dsb(ish) +#endif + /* * switch_to(prev, next) should switch from task `prev' to `next' * `prev' will never be the same as `next'. schedule() itself -- cgit v1.2.3 From 6af396a6b6c698eb3834184518fc9a59bc22c817 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Wed, 12 Jun 2013 10:03:30 +0100 Subject: ARM: cacheflush: use -ishst dsb variant for ensuring flush completion flush_cache_vmap contains a dsb to ensure that any cacheflushing operations to flush out newly written ptes have completed. This patch adds the -ishst option to the dsb, since that is all that is required for completing cacheflushing in the inner-shareable domain. Signed-off-by: Will Deacon --- arch/arm/include/asm/cacheflush.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index 17d0ae8672fa..04d73262e003 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h @@ -352,7 +352,7 @@ static inline void flush_cache_vmap(unsigned long start, unsigned long end) * set_pte_at() called from vmap_pte_range() does not * have a DSB after cleaning the cache line. */ - dsb(); + dsb(ishst); } static inline void flush_cache_vunmap(unsigned long start, unsigned long end) -- cgit v1.2.3 From 8947c09d05da9f0436f423518f449beaa5ea1bdc Mon Sep 17 00:00:00 2001 From: Christoffer Dall Date: Tue, 6 Aug 2013 05:34:16 +0100 Subject: ARM: 7808/1: KVM: mm: Get rid of L_PTE_USER ref from PAGE_S2_DEVICE THe L_PTE_USER actually has nothing to do with stage 2 mappings and the L_PTE_S2_RDWR value sets the readable bit, which was what L_PTE_USER was used for before proper handling of stage 2 memory defines. Changelog: [v3]: Drop call to kvm_set_s2pte_writable in mmu.c [v2]: Change default mappings to be r/w instead of r/o, as per Marc Zyngier's suggestion. Cc: Marc Zyngier Signed-off-by: Christoffer Dall Signed-off-by: Russell King --- arch/arm/include/asm/pgtable.h | 2 +- arch/arm/kvm/mmu.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 04aeb02d2e11..be956dbf6bae 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -100,7 +100,7 @@ extern pgprot_t pgprot_s2_device; #define PAGE_HYP _MOD_PROT(pgprot_kernel, L_PTE_HYP) #define PAGE_HYP_DEVICE _MOD_PROT(pgprot_hyp_device, L_PTE_HYP) #define PAGE_S2 _MOD_PROT(pgprot_s2, L_PTE_S2_RDONLY) -#define PAGE_S2_DEVICE _MOD_PROT(pgprot_s2_device, L_PTE_USER | L_PTE_S2_RDONLY) +#define PAGE_S2_DEVICE _MOD_PROT(pgprot_s2_device, L_PTE_S2_RDWR) #define __PAGE_NONE __pgprot(_L_PTE_DEFAULT | L_PTE_RDONLY | L_PTE_XN | L_PTE_NONE) #define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN) diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index ca6bea4859b4..9583c95adbb7 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -495,7 +495,6 @@ int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa, for (addr = guest_ipa; addr < end; addr += PAGE_SIZE) { pte_t pte = pfn_pte(pfn, PAGE_S2_DEVICE); - kvm_set_s2pte_writable(&pte); ret = mmu_topup_memory_cache(&cache, 2, 2); if (ret) -- cgit v1.2.3 From 28256d612726a28a8b9d3c49f2b74198c4423d6a Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Mon, 13 May 2013 15:21:49 +0100 Subject: ARM: cacheflush: split user cache-flushing into interruptible chunks Flushing a large, non-faulting VMA from userspace can potentially result in a long time spent flushing the cache line-by-line without preemption occurring (in the case of CONFIG_PREEMPT=n). Whilst this doesn't affect the stability of the system, it can certainly affect the responsiveness and CPU availability for other tasks. This patch splits up the user cacheflush code so that it flushes in chunks of a page. After each chunk has been flushed, we may reschedule if appropriate and, before processing the next chunk, we allow any pending signals to be handled before resuming from where we left off. Signed-off-by: Will Deacon --- arch/arm/include/asm/thread_info.h | 11 +++++++ arch/arm/kernel/traps.c | 65 +++++++++++++++++++++++++++++++++----- 2 files changed, 68 insertions(+), 8 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h index 214d4158089a..7d77645128a8 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h @@ -43,6 +43,16 @@ struct cpu_context_save { __u32 extra[2]; /* Xscale 'acc' register, etc */ }; +struct arm_restart_block { + union { + /* For user cache flushing */ + struct { + unsigned long start; + unsigned long end; + } cache; + }; +}; + /* * low level task data that entry.S needs immediate access to. * __switch_to() assumes cpu_context follows immediately after cpu_domain. @@ -68,6 +78,7 @@ struct thread_info { unsigned long thumbee_state; /* ThumbEE Handler Base register */ #endif struct restart_block restart_block; + struct arm_restart_block arm_restart_block; }; #define INIT_THREAD_INFO(tsk) \ diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index cab094c234ee..4d268d912b0e 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -499,6 +499,54 @@ static int bad_syscall(int n, struct pt_regs *regs) return regs->ARM_r0; } +static long do_cache_op_restart(struct restart_block *); + +static inline int +__do_cache_op(unsigned long start, unsigned long end) +{ + int ret; + unsigned long chunk = PAGE_SIZE; + + do { + if (signal_pending(current)) { + struct thread_info *ti = current_thread_info(); + + ti->restart_block = (struct restart_block) { + .fn = do_cache_op_restart, + }; + + ti->arm_restart_block = (struct arm_restart_block) { + { + .cache = { + .start = start, + .end = end, + }, + }, + }; + + return -ERESTART_RESTARTBLOCK; + } + + ret = flush_cache_user_range(start, start + chunk); + if (ret) + return ret; + + cond_resched(); + start += chunk; + } while (start < end); + + return 0; +} + +static long do_cache_op_restart(struct restart_block *unused) +{ + struct arm_restart_block *restart_block; + + restart_block = ¤t_thread_info()->arm_restart_block; + return __do_cache_op(restart_block->cache.start, + restart_block->cache.end); +} + static inline int do_cache_op(unsigned long start, unsigned long end, int flags) { @@ -510,17 +558,18 @@ do_cache_op(unsigned long start, unsigned long end, int flags) down_read(&mm->mmap_sem); vma = find_vma(mm, start); - if (vma && vma->vm_start < end) { - if (start < vma->vm_start) - start = vma->vm_start; - if (end > vma->vm_end) - end = vma->vm_end; - + if (!vma || vma->vm_start >= end) { up_read(&mm->mmap_sem); - return flush_cache_user_range(start, end); + return -EINVAL; } + + if (start < vma->vm_start) + start = vma->vm_start; + if (end > vma->vm_end) + end = vma->vm_end; up_read(&mm->mmap_sem); - return -EINVAL; + + return __do_cache_op(start, end); } /* -- cgit v1.2.3 From d9524dc32cab52714dee0c8e59c7437ee33a239a Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Tue, 21 Aug 2012 15:33:19 +0100 Subject: ARM: cacheflush: don't round address range up to nearest page The flush_cache_user_range macro takes a pair of addresses describing the start and end of the virtual address range to flush. Due to an accidental oversight when flush_cache_range_user was introduced, the address range was rounded up so that the start and end addresses were page-aligned. For historical reference, the interesting commits in history.git are: 10eacf1775e1 ("[ARM] Clean up ARM cache handling interfaces (part 1)") 71432e79b76b ("[ARM] Add flush_cache_user_page() for sys_cacheflush()") This patch removes the alignment code, reducing the amount of flushing required for ranges that are not an exact multiple of PAGE_SIZE. Reviewed-by: Catalin Marinas Reported-by: Jonathan Austin Signed-off-by: Will Deacon --- arch/arm/include/asm/cacheflush.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index 17d0ae8672fa..bfd37e58f855 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h @@ -268,8 +268,7 @@ extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr * Harvard caches are synchronised for the user space address range. * This is used for the ARM private sys_cacheflush system call. */ -#define flush_cache_user_range(start,end) \ - __cpuc_coherent_user_range((start) & PAGE_MASK, PAGE_ALIGN(end)) +#define flush_cache_user_range(s,e) __cpuc_coherent_user_range(s,e) /* * Perform necessary cache operations to ensure that data previously -- cgit v1.2.3 From 09096f6a0ee2f2a26f3f11cf466fab0364405a23 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Tue, 20 Aug 2013 06:39:24 +0100 Subject: ARM: 7822/1: add workaround for ambiguous C99 stdint.h types The C99 types uintXX_t that are usually defined in 'stdint.h' are not as unambiguous on ARM as you would expect. For the types below, there is a difference on ARM between GCC built for bare metal ARM, GCC built for glibc and the kernel itself, which results in build errors if you try to build with -ffreestanding and include 'stdint.h' (such as when you include 'arm_neon.h' in order to use NEON intrinsics) As the typedefs for these types in 'stdint.h' are based on builtin defines supplied by GCC, we can tweak these to align with the kernel's idea of those types, so 'linux/types.h' and 'stdint.h' can be safely included from the same source file (provided that -ffreestanding is used). int32_t uint32_t uintptr_t bare metal GCC long unsigned long unsigned int glibc GCC int unsigned int unsigned int kernel int unsigned int unsigned long Acked by: Dave Martin Acked-by: Nicolas Pitre Acked-by: Mikael Pettersson Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King --- arch/arm/include/asm/types.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 arch/arm/include/asm/types.h (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h new file mode 100644 index 000000000000..a53cdb8f068c --- /dev/null +++ b/arch/arm/include/asm/types.h @@ -0,0 +1,40 @@ +#ifndef _ASM_TYPES_H +#define _ASM_TYPES_H + +#include + +/* + * The C99 types uintXX_t that are usually defined in 'stdint.h' are not as + * unambiguous on ARM as you would expect. For the types below, there is a + * difference on ARM between GCC built for bare metal ARM, GCC built for glibc + * and the kernel itself, which results in build errors if you try to build with + * -ffreestanding and include 'stdint.h' (such as when you include 'arm_neon.h' + * in order to use NEON intrinsics) + * + * As the typedefs for these types in 'stdint.h' are based on builtin defines + * supplied by GCC, we can tweak these to align with the kernel's idea of those + * types, so 'linux/types.h' and 'stdint.h' can be safely included from the same + * source file (provided that -ffreestanding is used). + * + * int32_t uint32_t uintptr_t + * bare metal GCC long unsigned long unsigned int + * glibc GCC int unsigned int unsigned int + * kernel int unsigned int unsigned long + */ + +#ifdef __INT32_TYPE__ +#undef __INT32_TYPE__ +#define __INT32_TYPE__ int +#endif + +#ifdef __UINT32_TYPE__ +#undef __UINT32_TYPE__ +#define __UINT32_TYPE__ unsigned int +#endif + +#ifdef __UINTPTR_TYPE__ +#undef __UINTPTR_TYPE__ +#define __UINTPTR_TYPE__ unsigned long +#endif + +#endif /* _ASM_TYPES_H */ -- cgit v1.2.3 From 7610b607b03ada21e89d964ec27d87a5b93c3d7f Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 6 Jul 2013 22:59:10 +0100 Subject: ARM: debug: provide 8250 debug uart flow control configuration option Move the definition out of the machine class debug-macro.S header into the Kconfig files. Signed-off-by: Russell King --- arch/arm/Kconfig.debug | 9 +++++++++ arch/arm/include/asm/hardware/debug-8250.S | 2 +- arch/arm/mach-ebsa110/include/mach/debug-macro.S | 1 - arch/arm/mach-footbridge/include/mach/debug-macro.S | 1 - arch/arm/mach-gemini/include/mach/debug-macro.S | 1 - arch/arm/mach-rpc/include/mach/debug-macro.S | 1 - 6 files changed, 10 insertions(+), 5 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 9064ed492fb5..8d3bc84fb612 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -856,6 +856,15 @@ config DEBUG_LL_INCLUDE default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 default "mach/debug-macro.S" +config DEBUG_UART_8250 + def_bool ARCH_EBSA110 || (FOOTBRIDGE && !DEBUG_DC21285_PORT) || \ + ARCH_GEMINI || ARCH_RPC + +config DEBUG_UART_8250_FLOW_CONTROL + bool "Enable flow control for 8250 UART" + depends on DEBUG_UART_8250 + default y if ARCH_EBSA110 || FOOTBRIDGE || ARCH_GEMINI || ARCH_RPC + config DEBUG_UNCOMPRESS bool depends on ARCH_MULTIPLATFORM diff --git a/arch/arm/include/asm/hardware/debug-8250.S b/arch/arm/include/asm/hardware/debug-8250.S index 22c689255e6e..bca304576be0 100644 --- a/arch/arm/include/asm/hardware/debug-8250.S +++ b/arch/arm/include/asm/hardware/debug-8250.S @@ -21,7 +21,7 @@ .endm .macro waituart,rd,rx -#ifdef FLOW_CONTROL +#ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL 1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT] tst \rd, #UART_MSR_CTS beq 1001b diff --git a/arch/arm/mach-ebsa110/include/mach/debug-macro.S b/arch/arm/mach-ebsa110/include/mach/debug-macro.S index bb02c05e6812..9b66e79632a9 100644 --- a/arch/arm/mach-ebsa110/include/mach/debug-macro.S +++ b/arch/arm/mach-ebsa110/include/mach/debug-macro.S @@ -18,5 +18,4 @@ .endm #define UART_SHIFT 2 -#define FLOW_CONTROL #include diff --git a/arch/arm/mach-footbridge/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S index c169f0c99b2a..18130fe99f28 100644 --- a/arch/arm/mach-footbridge/include/mach/debug-macro.S +++ b/arch/arm/mach-footbridge/include/mach/debug-macro.S @@ -23,7 +23,6 @@ .endm #define UART_SHIFT 0 -#define FLOW_CONTROL #include #else diff --git a/arch/arm/mach-gemini/include/mach/debug-macro.S b/arch/arm/mach-gemini/include/mach/debug-macro.S index 837670763b85..cdee448dd34e 100644 --- a/arch/arm/mach-gemini/include/mach/debug-macro.S +++ b/arch/arm/mach-gemini/include/mach/debug-macro.S @@ -17,5 +17,4 @@ .endm #define UART_SHIFT 2 -#define FLOW_CONTROL #include diff --git a/arch/arm/mach-rpc/include/mach/debug-macro.S b/arch/arm/mach-rpc/include/mach/debug-macro.S index 6d28cc99b124..a92753d0daeb 100644 --- a/arch/arm/mach-rpc/include/mach/debug-macro.S +++ b/arch/arm/mach-rpc/include/mach/debug-macro.S @@ -19,5 +19,4 @@ .endm #define UART_SHIFT 2 -#define FLOW_CONTROL #include -- cgit v1.2.3 From 4a00364736519764a76af566be98eeeabb6fbce5 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 6 Jul 2013 23:13:15 +0100 Subject: ARM: debug: provide 8250 debug uart register shift configuration option Move the definition of the UART register shift out of the platform specific header file into the Kconfig files. Signed-off-by: Russell King --- arch/arm/Kconfig.debug | 28 ++++++++++++++++++++-- arch/arm/include/asm/hardware/debug-8250.S | 4 ++++ arch/arm/include/debug/mvebu.S | 1 - arch/arm/include/debug/nspire.S | 1 - arch/arm/include/debug/pxa.S | 1 - arch/arm/include/debug/rockchip.S | 1 - arch/arm/include/debug/sunxi.S | 1 - arch/arm/mach-dove/include/mach/debug-macro.S | 1 - arch/arm/mach-ebsa110/include/mach/debug-macro.S | 1 - .../arm/mach-footbridge/include/mach/debug-macro.S | 1 - arch/arm/mach-gemini/include/mach/debug-macro.S | 1 - arch/arm/mach-iop13xx/include/mach/debug-macro.S | 1 - arch/arm/mach-iop32x/include/mach/debug-macro.S | 1 - arch/arm/mach-iop33x/include/mach/debug-macro.S | 1 - arch/arm/mach-ixp4xx/include/mach/debug-macro.S | 1 - arch/arm/mach-kirkwood/include/mach/debug-macro.S | 1 - arch/arm/mach-lpc32xx/include/mach/debug-macro.S | 1 - arch/arm/mach-mv78xx0/include/mach/debug-macro.S | 1 - arch/arm/mach-orion5x/include/mach/debug-macro.S | 1 - arch/arm/mach-rpc/include/mach/debug-macro.S | 1 - 20 files changed, 30 insertions(+), 20 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 8d3bc84fb612..f7c0efc615c7 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -275,6 +275,7 @@ choice config DEBUG_MMP_UART2 bool "Kernel low-level debugging message via MMP UART2" depends on ARCH_MMP + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on MMP UART2. @@ -282,6 +283,7 @@ choice config DEBUG_MMP_UART3 bool "Kernel low-level debugging message via MMP UART3" depends on ARCH_MMP + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on MMP UART3. @@ -326,6 +328,7 @@ choice config DEBUG_MVEBU_UART bool "Kernel low-level debugging messages via MVEBU UART (old bootloaders)" depends on ARCH_MVEBU + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on MVEBU based platforms. @@ -344,6 +347,7 @@ choice config DEBUG_MVEBU_UART_ALTERNATE bool "Kernel low-level debugging messages via MVEBU UART (new bootloaders)" depends on ARCH_MVEBU + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on MVEBU based platforms. @@ -365,6 +369,7 @@ choice config DEBUG_NSPIRE_CLASSIC_UART bool "Kernel low-level debugging via TI-NSPIRE 8250 UART" depends on ARCH_NSPIRE + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on TI-NSPIRE classic models. @@ -453,6 +458,7 @@ choice config DEBUG_PXA_UART1 depends on ARCH_PXA bool "Use PXA UART1 for low-level debug" + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on PXA UART1. @@ -477,6 +483,7 @@ choice bool "Kernel low-level debugging messages via Rockchip RK29 UART0" depends on ARCH_ROCKCHIP select DEBUG_ROCKCHIP_UART + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on Rockchip based platforms. @@ -485,6 +492,7 @@ choice bool "Kernel low-level debugging messages via Rockchip RK29 UART1" depends on ARCH_ROCKCHIP select DEBUG_ROCKCHIP_UART + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on Rockchip based platforms. @@ -493,6 +501,7 @@ choice bool "Kernel low-level debugging messages via Rockchip RK29 UART2" depends on ARCH_ROCKCHIP select DEBUG_ROCKCHIP_UART + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on Rockchip based platforms. @@ -501,6 +510,7 @@ choice bool "Kernel low-level debugging messages via Rockchip RK3X UART0" depends on ARCH_ROCKCHIP select DEBUG_ROCKCHIP_UART + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on Rockchip based platforms. @@ -509,6 +519,7 @@ choice bool "Kernel low-level debugging messages via Rockchip RK3X UART1" depends on ARCH_ROCKCHIP select DEBUG_ROCKCHIP_UART + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on Rockchip based platforms. @@ -517,6 +528,7 @@ choice bool "Kernel low-level debugging messages via Rockchip RK3X UART2" depends on ARCH_ROCKCHIP select DEBUG_ROCKCHIP_UART + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on Rockchip based platforms. @@ -525,6 +537,7 @@ choice bool "Kernel low-level debugging messages via Rockchip RK3X UART3" depends on ARCH_ROCKCHIP select DEBUG_ROCKCHIP_UART + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on Rockchip based platforms. @@ -587,6 +600,7 @@ choice config DEBUG_SUNXI_UART0 bool "Kernel low-level debugging messages via sunXi UART0" depends on ARCH_SUNXI + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on Allwinner A1X based platforms on the UART0. @@ -594,6 +608,7 @@ choice config DEBUG_SUNXI_UART1 bool "Kernel low-level debugging messages via sunXi UART1" depends on ARCH_SUNXI + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on Allwinner A1X based platforms on the UART1. @@ -857,8 +872,17 @@ config DEBUG_LL_INCLUDE default "mach/debug-macro.S" config DEBUG_UART_8250 - def_bool ARCH_EBSA110 || (FOOTBRIDGE && !DEBUG_DC21285_PORT) || \ - ARCH_GEMINI || ARCH_RPC + def_bool ARCH_DOVE || ARCH_EBSA110 || \ + (FOOTBRIDGE && !DEBUG_DC21285_PORT) || \ + ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \ + ARCH_IOP33X || ARCH_IXP4XX || ARCH_KIRKWOOD || \ + ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC + +config DEBUG_UART_8250_SHIFT + int "Register offset shift for the 8250 debug UART" + depends on DEBUG_UART_8250 + default 0 if FOOTBRIDGE || ARCH_IOP32X + default 2 config DEBUG_UART_8250_FLOW_CONTROL bool "Enable flow control for 8250 UART" diff --git a/arch/arm/include/asm/hardware/debug-8250.S b/arch/arm/include/asm/hardware/debug-8250.S index bca304576be0..a0e6e173c554 100644 --- a/arch/arm/include/asm/hardware/debug-8250.S +++ b/arch/arm/include/asm/hardware/debug-8250.S @@ -9,6 +9,10 @@ */ #include +#ifndef UART_SHIFT +#define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT +#endif + .macro senduart,rd,rx strb \rd, [\rx, #UART_TX << UART_SHIFT] .endm diff --git a/arch/arm/include/debug/mvebu.S b/arch/arm/include/debug/mvebu.S index 6517311a1c91..0d0d82062f63 100644 --- a/arch/arm/include/debug/mvebu.S +++ b/arch/arm/include/debug/mvebu.S @@ -26,5 +26,4 @@ orr \rv, \rv, #0x00012000 .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/include/debug/nspire.S b/arch/arm/include/debug/nspire.S index 886fd276fcbc..887463672b66 100644 --- a/arch/arm/include/debug/nspire.S +++ b/arch/arm/include/debug/nspire.S @@ -23,6 +23,5 @@ #endif #ifdef CONFIG_DEBUG_NSPIRE_CLASSIC_UART -#define UART_SHIFT 2 #include #endif diff --git a/arch/arm/include/debug/pxa.S b/arch/arm/include/debug/pxa.S index e1e795aa3d7f..f10fba50c770 100644 --- a/arch/arm/include/debug/pxa.S +++ b/arch/arm/include/debug/pxa.S @@ -29,5 +29,4 @@ ldr \rv, =PXA_UART_REG_VIRT_BASE .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/include/debug/rockchip.S b/arch/arm/include/debug/rockchip.S index cfd883e69588..80ae8cadb064 100644 --- a/arch/arm/include/debug/rockchip.S +++ b/arch/arm/include/debug/rockchip.S @@ -38,5 +38,4 @@ ldr \rv, =ROCKCHIP_UART_DEBUG_VIRT_BASE .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/include/debug/sunxi.S b/arch/arm/include/debug/sunxi.S index 04eb56d5db2c..65d09816c720 100644 --- a/arch/arm/include/debug/sunxi.S +++ b/arch/arm/include/debug/sunxi.S @@ -23,5 +23,4 @@ ldr \rv, =SUNXI_UART_DEBUG_VIRT_BASE .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-dove/include/mach/debug-macro.S b/arch/arm/mach-dove/include/mach/debug-macro.S index 5929cbc59161..182a6108a2e6 100644 --- a/arch/arm/mach-dove/include/mach/debug-macro.S +++ b/arch/arm/mach-dove/include/mach/debug-macro.S @@ -15,5 +15,4 @@ orr \rv, \rv, #0x00012000 .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-ebsa110/include/mach/debug-macro.S b/arch/arm/mach-ebsa110/include/mach/debug-macro.S index 9b66e79632a9..984f0fa4812a 100644 --- a/arch/arm/mach-ebsa110/include/mach/debug-macro.S +++ b/arch/arm/mach-ebsa110/include/mach/debug-macro.S @@ -17,5 +17,4 @@ mov \rp, \rv .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-footbridge/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S index 18130fe99f28..a209936d6d98 100644 --- a/arch/arm/mach-footbridge/include/mach/debug-macro.S +++ b/arch/arm/mach-footbridge/include/mach/debug-macro.S @@ -22,7 +22,6 @@ orr \rp, \rp, #0x7c000000 @ physical .endm -#define UART_SHIFT 0 #include #else diff --git a/arch/arm/mach-gemini/include/mach/debug-macro.S b/arch/arm/mach-gemini/include/mach/debug-macro.S index cdee448dd34e..2d94ea46ec64 100644 --- a/arch/arm/mach-gemini/include/mach/debug-macro.S +++ b/arch/arm/mach-gemini/include/mach/debug-macro.S @@ -16,5 +16,4 @@ ldr \rv, =IO_ADDRESS(GEMINI_UART_BASE) @ virtual .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-iop13xx/include/mach/debug-macro.S b/arch/arm/mach-iop13xx/include/mach/debug-macro.S index d869a6f67e5c..4a776ca41960 100644 --- a/arch/arm/mach-iop13xx/include/mach/debug-macro.S +++ b/arch/arm/mach-iop13xx/include/mach/debug-macro.S @@ -20,5 +20,4 @@ orr \rp, \rp, #0x00d80000 .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-iop32x/include/mach/debug-macro.S b/arch/arm/mach-iop32x/include/mach/debug-macro.S index 363bdf90b34d..a090573f16c8 100644 --- a/arch/arm/mach-iop32x/include/mach/debug-macro.S +++ b/arch/arm/mach-iop32x/include/mach/debug-macro.S @@ -17,5 +17,4 @@ mov \rv, \rp .endm -#define UART_SHIFT 0 #include diff --git a/arch/arm/mach-iop33x/include/mach/debug-macro.S b/arch/arm/mach-iop33x/include/mach/debug-macro.S index 361be1f6026e..894bf7ce857e 100644 --- a/arch/arm/mach-iop33x/include/mach/debug-macro.S +++ b/arch/arm/mach-iop33x/include/mach/debug-macro.S @@ -18,5 +18,4 @@ orr \rp, #0xff000000 @ physical .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-ixp4xx/include/mach/debug-macro.S b/arch/arm/mach-ixp4xx/include/mach/debug-macro.S index ff686cbc5df4..403bd35a5468 100644 --- a/arch/arm/mach-ixp4xx/include/mach/debug-macro.S +++ b/arch/arm/mach-ixp4xx/include/mach/debug-macro.S @@ -22,5 +22,4 @@ orr \rp, \rp, #0xc8000000 @ physical .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-kirkwood/include/mach/debug-macro.S b/arch/arm/mach-kirkwood/include/mach/debug-macro.S index f785d401a607..51eee02ab5e0 100644 --- a/arch/arm/mach-kirkwood/include/mach/debug-macro.S +++ b/arch/arm/mach-kirkwood/include/mach/debug-macro.S @@ -15,5 +15,4 @@ orr \rv, \rv, #0x00012000 .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-lpc32xx/include/mach/debug-macro.S b/arch/arm/mach-lpc32xx/include/mach/debug-macro.S index 351bd6c84909..11f986eb471c 100644 --- a/arch/arm/mach-lpc32xx/include/mach/debug-macro.S +++ b/arch/arm/mach-lpc32xx/include/mach/debug-macro.S @@ -25,5 +25,4 @@ ldrne \rv, =0xF4090000 .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-mv78xx0/include/mach/debug-macro.S b/arch/arm/mach-mv78xx0/include/mach/debug-macro.S index a7df02b049b7..0fce467ede13 100644 --- a/arch/arm/mach-mv78xx0/include/mach/debug-macro.S +++ b/arch/arm/mach-mv78xx0/include/mach/debug-macro.S @@ -15,5 +15,4 @@ orr \rv, \rv, #0x00012000 .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-orion5x/include/mach/debug-macro.S b/arch/arm/mach-orion5x/include/mach/debug-macro.S index f340ed8f8dd0..52f29ef747b2 100644 --- a/arch/arm/mach-orion5x/include/mach/debug-macro.S +++ b/arch/arm/mach-orion5x/include/mach/debug-macro.S @@ -17,5 +17,4 @@ orr \rv, \rv, #0x00012000 .endm -#define UART_SHIFT 2 #include diff --git a/arch/arm/mach-rpc/include/mach/debug-macro.S b/arch/arm/mach-rpc/include/mach/debug-macro.S index a92753d0daeb..fcb545083547 100644 --- a/arch/arm/mach-rpc/include/mach/debug-macro.S +++ b/arch/arm/mach-rpc/include/mach/debug-macro.S @@ -18,5 +18,4 @@ orr \rp, \rp, #0x03000000 @ physical .endm -#define UART_SHIFT 2 #include -- cgit v1.2.3 From c3faa9b7573bf8668869c0ef3075430dc9f053c6 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 7 Jul 2013 00:01:39 +0100 Subject: ARM: debug: provide 8250 debug uart phys/virt address configuration options Move the definition of the UART register addresses out of the platform specific header file into the Kconfig files. Signed-off-by: Russell King --- arch/arm/Kconfig.debug | 59 ++++++++++++++++++++++ arch/arm/include/asm/hardware/debug-8250.S | 9 +++- arch/arm/include/debug/mvebu.S | 16 ------ arch/arm/include/debug/nspire.S | 4 +- arch/arm/include/debug/pxa.S | 19 ------- arch/arm/include/debug/rockchip.S | 29 ----------- arch/arm/include/debug/sunxi.S | 14 ----- arch/arm/mach-dove/include/mach/debug-macro.S | 10 ---- arch/arm/mach-ebsa110/include/mach/debug-macro.S | 7 --- .../arm/mach-footbridge/include/mach/debug-macro.S | 9 ---- arch/arm/mach-gemini/include/mach/debug-macro.S | 7 --- arch/arm/mach-iop13xx/include/mach/debug-macro.S | 10 ---- arch/arm/mach-iop32x/include/mach/debug-macro.S | 7 --- arch/arm/mach-iop33x/include/mach/debug-macro.S | 8 --- arch/arm/mach-ixp4xx/include/mach/debug-macro.S | 13 ----- arch/arm/mach-kirkwood/include/mach/debug-macro.S | 10 ---- arch/arm/mach-lpc32xx/include/mach/debug-macro.S | 10 ---- arch/arm/mach-mv78xx0/include/mach/debug-macro.S | 10 ---- arch/arm/mach-orion5x/include/mach/debug-macro.S | 10 ---- arch/arm/mach-rpc/include/mach/debug-macro.S | 8 --- 20 files changed, 68 insertions(+), 201 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index f7c0efc615c7..cf4262ec0f60 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -878,6 +878,65 @@ config DEBUG_UART_8250 ARCH_IOP33X || ARCH_IXP4XX || ARCH_KIRKWOOD || \ ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC +config DEBUG_UART_PHYS + hex "Physical base address of debug UART" + default 0x01c28000 if DEBUG_SUNXI_UART0 + default 0x01c28400 if DEBUG_SUNXI_UART1 + default 0x03010fe0 if ARCH_RPC + default 0x10124000 if DEBUG_RK3X_UART0 + default 0x10126000 if DEBUG_RK3X_UART1 + default 0x20060000 if DEBUG_RK29_UART0 + default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 + default 0x20068000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 + default 0x40090000 if ARCH_LPC32XX + default 0x40100000 if DEBUG_PXA_UART1 + default 0x42000000 if ARCH_GEMINI + default 0x7c0003f8 if FOOTBRIDGE + default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART + default 0xc8000000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN + default 0xc8000003 if ARCH_IXP4XX && CPU_BIG_ENDIAN + default 0xd0012000 if DEBUG_MVEBU_UART + default 0xd4017000 if DEBUG_MMP_UART2 + default 0xd4018000 if DEBUG_MMP_UART3 + default 0xf0000be0 if ARCH_EBSA110 + default 0xf1012000 if DEBUG_MVEBU_UART_ALTERNATE + default 0xf1012000 if ARCH_DOVE || ARCH_KIRKWOOD || ARCH_MV78XX0 || \ + ARCH_ORION5X + default 0xfe800000 if ARCH_IOP32X + default 0xffd82340 if ARCH_IOP13XX + default 0xfffff700 if ARCH_IOP33X + depends on DEBUG_UART_8250 + +config DEBUG_UART_VIRT + hex "Virtual base address of debug UART" + default 0xe0010fe0 if ARCH_RPC + default 0xf0000be0 if ARCH_EBSA110 + default 0xf1c28000 if DEBUG_SUNXI_UART0 + default 0xf1c28400 if DEBUG_SUNXI_UART1 + default 0xf2100000 if DEBUG_PXA_UART1 + default 0xf4090000 if ARCH_LPC32XX + default 0xf4200000 if ARCH_GEMINI + default 0xfd012000 if ARCH_MV78XX0 + default 0xfde12000 if ARCH_DOVE + default 0xfe012000 if ARCH_ORION5X + default 0xfe017000 if DEBUG_MMP_UART2 + default 0xfe018000 if DEBUG_MMP_UART3 + default 0xfe800000 if ARCH_IOP32X + default 0xfeb24000 if DEBUG_RK3X_UART0 + default 0xfeb26000 if DEBUG_RK3X_UART1 + default 0xfec12000 if DEBUG_MVEBU_UART || DEBUG_MVEBU_UART_ALTERNATE + default 0xfed60000 if DEBUG_RK29_UART0 + default 0xfed64000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 + default 0xfed68000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 + default 0xfed12000 if ARCH_KIRKWOOD + default 0xfee003f8 if FOOTBRIDGE + default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART + default 0xfee82340 if ARCH_IOP13XX + default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN + default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN + default 0xfefff700 if ARCH_IOP33X + depends on DEBUG_UART_8250 + config DEBUG_UART_8250_SHIFT int "Register offset shift for the 8250 debug UART" depends on DEBUG_UART_8250 diff --git a/arch/arm/include/asm/hardware/debug-8250.S b/arch/arm/include/asm/hardware/debug-8250.S index a0e6e173c554..ea5f1710b524 100644 --- a/arch/arm/include/asm/hardware/debug-8250.S +++ b/arch/arm/include/asm/hardware/debug-8250.S @@ -1,7 +1,7 @@ /* * arch/arm/include/asm/hardware/debug-8250.S * - * Copyright (C) 1994-1999 Russell King + * Copyright (C) 1994-2013 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -9,6 +9,13 @@ */ #include +#ifdef CONFIG_DEBUG_UART_PHYS + .macro addruart, rp, rv, tmp + ldr \rp, =CONFIG_DEBUG_UART_PHYS + ldr \rv, =CONFIG_DEBUG_UART_VIRT + .endm +#endif + #ifndef UART_SHIFT #define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT #endif diff --git a/arch/arm/include/debug/mvebu.S b/arch/arm/include/debug/mvebu.S index 0d0d82062f63..6309be5238e6 100644 --- a/arch/arm/include/debug/mvebu.S +++ b/arch/arm/include/debug/mvebu.S @@ -10,20 +10,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - -#ifdef CONFIG_DEBUG_MVEBU_UART_ALTERNATE -#define ARMADA_370_XP_REGS_PHYS_BASE 0xf1000000 -#else -#define ARMADA_370_XP_REGS_PHYS_BASE 0xd0000000 -#endif - -#define ARMADA_370_XP_REGS_VIRT_BASE 0xfec00000 - - .macro addruart, rp, rv, tmp - ldr \rp, =ARMADA_370_XP_REGS_PHYS_BASE - ldr \rv, =ARMADA_370_XP_REGS_VIRT_BASE - orr \rp, \rp, #0x00012000 - orr \rv, \rv, #0x00012000 - .endm - #include diff --git a/arch/arm/include/debug/nspire.S b/arch/arm/include/debug/nspire.S index 887463672b66..3e9329aa17b9 100644 --- a/arch/arm/include/debug/nspire.S +++ b/arch/arm/include/debug/nspire.S @@ -8,7 +8,7 @@ * published by the Free Software Foundation. * */ - +#ifdef CONFIG_DEBUG_NSPIRE_CX_UART #define NSPIRE_EARLY_UART_PHYS_BASE 0x90020000 #define NSPIRE_EARLY_UART_VIRT_BASE 0xfee20000 @@ -17,8 +17,6 @@ ldr \rv, =(NSPIRE_EARLY_UART_VIRT_BASE) @ virtual base address .endm - -#ifdef CONFIG_DEBUG_NSPIRE_CX_UART #include #endif diff --git a/arch/arm/include/debug/pxa.S b/arch/arm/include/debug/pxa.S index f10fba50c770..09e54f357894 100644 --- a/arch/arm/include/debug/pxa.S +++ b/arch/arm/include/debug/pxa.S @@ -10,23 +10,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - -#if defined(CONFIG_DEBUG_PXA_UART1) -#define PXA_UART_REG_PHYS_BASE 0x40100000 -#define PXA_UART_REG_VIRT_BASE 0xf2100000 -#elif defined(CONFIG_DEBUG_MMP_UART2) -#define PXA_UART_REG_PHYS_BASE 0xd4017000 -#define PXA_UART_REG_VIRT_BASE 0xfe017000 -#elif defined(CONFIG_DEBUG_MMP_UART3) -#define PXA_UART_REG_PHYS_BASE 0xd4018000 -#define PXA_UART_REG_VIRT_BASE 0xfe018000 -#else -#error "Select uart for DEBUG_LL" -#endif - - .macro addruart, rp, rv, tmp - ldr \rp, =PXA_UART_REG_PHYS_BASE - ldr \rv, =PXA_UART_REG_VIRT_BASE - .endm - #include diff --git a/arch/arm/include/debug/rockchip.S b/arch/arm/include/debug/rockchip.S index 80ae8cadb064..3ad023899820 100644 --- a/arch/arm/include/debug/rockchip.S +++ b/arch/arm/include/debug/rockchip.S @@ -9,33 +9,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - -#if defined(CONFIG_DEBUG_RK29_UART0) -#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20060000 -#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed60000 -#elif defined(CONFIG_DEBUG_RK29_UART1) -#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20064000 -#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed64000 -#elif defined(CONFIG_DEBUG_RK29_UART2) -#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20068000 -#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed68000 -#elif defined(CONFIG_DEBUG_RK3X_UART0) -#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x10124000 -#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfeb24000 -#elif defined(CONFIG_DEBUG_RK3X_UART1) -#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x10126000 -#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfeb26000 -#elif defined(CONFIG_DEBUG_RK3X_UART2) -#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20064000 -#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed64000 -#elif defined(CONFIG_DEBUG_RK3X_UART3) -#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20068000 -#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed68000 -#endif - - .macro addruart, rp, rv, tmp - ldr \rp, =ROCKCHIP_UART_DEBUG_PHYS_BASE - ldr \rv, =ROCKCHIP_UART_DEBUG_VIRT_BASE - .endm - #include diff --git a/arch/arm/include/debug/sunxi.S b/arch/arm/include/debug/sunxi.S index 65d09816c720..4c3d89cfeb8f 100644 --- a/arch/arm/include/debug/sunxi.S +++ b/arch/arm/include/debug/sunxi.S @@ -9,18 +9,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - -#if defined(CONFIG_DEBUG_SUNXI_UART0) -#define SUNXI_UART_DEBUG_PHYS_BASE 0x01c28000 -#define SUNXI_UART_DEBUG_VIRT_BASE 0xf1c28000 -#elif defined(CONFIG_DEBUG_SUNXI_UART1) -#define SUNXI_UART_DEBUG_PHYS_BASE 0x01c28400 -#define SUNXI_UART_DEBUG_VIRT_BASE 0xf1c28400 -#endif - - .macro addruart, rp, rv, tmp - ldr \rp, =SUNXI_UART_DEBUG_PHYS_BASE - ldr \rv, =SUNXI_UART_DEBUG_VIRT_BASE - .endm - #include diff --git a/arch/arm/mach-dove/include/mach/debug-macro.S b/arch/arm/mach-dove/include/mach/debug-macro.S index 182a6108a2e6..9b85a81588ea 100644 --- a/arch/arm/mach-dove/include/mach/debug-macro.S +++ b/arch/arm/mach-dove/include/mach/debug-macro.S @@ -5,14 +5,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - -#include - - .macro addruart, rp, rv, tmp - ldr \rp, =DOVE_SB_REGS_PHYS_BASE - ldr \rv, =DOVE_SB_REGS_VIRT_BASE - orr \rp, \rp, #0x00012000 - orr \rv, \rv, #0x00012000 - .endm - #include diff --git a/arch/arm/mach-ebsa110/include/mach/debug-macro.S b/arch/arm/mach-ebsa110/include/mach/debug-macro.S index 984f0fa4812a..0cea548ce305 100644 --- a/arch/arm/mach-ebsa110/include/mach/debug-macro.S +++ b/arch/arm/mach-ebsa110/include/mach/debug-macro.S @@ -10,11 +10,4 @@ * published by the Free Software Foundation. * **/ - - .macro addruart, rp, rv, tmp - mov \rp, #0xf0000000 - orr \rp, \rp, #0x00000be0 - mov \rp, \rv - .endm - #include diff --git a/arch/arm/mach-footbridge/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S index a209936d6d98..553c47de578d 100644 --- a/arch/arm/mach-footbridge/include/mach/debug-macro.S +++ b/arch/arm/mach-footbridge/include/mach/debug-macro.S @@ -14,16 +14,7 @@ #include #ifndef CONFIG_DEBUG_DC21285_PORT - /* For NetWinder debugging */ - .macro addruart, rp, rv, tmp - mov \rp, #0x000003f8 - orr \rv, \rp, #0xfe000000 @ virtual - orr \rv, \rv, #0x00e00000 @ virtual - orr \rp, \rp, #0x7c000000 @ physical - .endm - #include - #else #include /* For EBSA285 debugging */ diff --git a/arch/arm/mach-gemini/include/mach/debug-macro.S b/arch/arm/mach-gemini/include/mach/debug-macro.S index 2d94ea46ec64..9dabd4bfcda2 100644 --- a/arch/arm/mach-gemini/include/mach/debug-macro.S +++ b/arch/arm/mach-gemini/include/mach/debug-macro.S @@ -9,11 +9,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include - - .macro addruart, rp, rv, tmp - ldr \rp, =GEMINI_UART_BASE @ physical - ldr \rv, =IO_ADDRESS(GEMINI_UART_BASE) @ virtual - .endm - #include diff --git a/arch/arm/mach-iop13xx/include/mach/debug-macro.S b/arch/arm/mach-iop13xx/include/mach/debug-macro.S index 4a776ca41960..90b5e64ee4ce 100644 --- a/arch/arm/mach-iop13xx/include/mach/debug-macro.S +++ b/arch/arm/mach-iop13xx/include/mach/debug-macro.S @@ -10,14 +10,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - - .macro addruart, rp, rv, tmp - mov \rp, #0x00002300 - orr \rp, \rp, #0x00000040 - orr \rv, \rp, #0xfe000000 @ virtual - orr \rv, \rv, #0x00e80000 - orr \rp, \rp, #0xff000000 @ physical - orr \rp, \rp, #0x00d80000 - .endm - #include diff --git a/arch/arm/mach-iop32x/include/mach/debug-macro.S b/arch/arm/mach-iop32x/include/mach/debug-macro.S index a090573f16c8..7ea745e73f5f 100644 --- a/arch/arm/mach-iop32x/include/mach/debug-macro.S +++ b/arch/arm/mach-iop32x/include/mach/debug-macro.S @@ -10,11 +10,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - - .macro addruart, rp, rv, tmp - mov \rp, #0xfe000000 @ physical as well as virtual - orr \rp, \rp, #0x00800000 @ location of the UART - mov \rv, \rp - .endm - #include diff --git a/arch/arm/mach-iop33x/include/mach/debug-macro.S b/arch/arm/mach-iop33x/include/mach/debug-macro.S index 894bf7ce857e..52781ae2f29c 100644 --- a/arch/arm/mach-iop33x/include/mach/debug-macro.S +++ b/arch/arm/mach-iop33x/include/mach/debug-macro.S @@ -10,12 +10,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - - .macro addruart, rp, rv, tmp - mov \rp, #0x00ff0000 - orr \rp, \rp, #0x0000f700 - orr \rv, #0xfe000000 @ virtual - orr \rp, #0xff000000 @ physical - .endm - #include diff --git a/arch/arm/mach-ixp4xx/include/mach/debug-macro.S b/arch/arm/mach-ixp4xx/include/mach/debug-macro.S index 403bd35a5468..ff706fa2f406 100644 --- a/arch/arm/mach-ixp4xx/include/mach/debug-macro.S +++ b/arch/arm/mach-ixp4xx/include/mach/debug-macro.S @@ -9,17 +9,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - - .macro addruart, rp, rv, tmp -#ifdef __ARMEB__ - mov \rp, #3 @ Uart regs are at off set of 3 if - @ byte writes used - Big Endian. -#else - mov \rp, #0 -#endif - orr \rv, \rp, #0xfe000000 @ virtual - orr \rv, \rv, #0x00f00000 - orr \rp, \rp, #0xc8000000 @ physical - .endm - #include diff --git a/arch/arm/mach-kirkwood/include/mach/debug-macro.S b/arch/arm/mach-kirkwood/include/mach/debug-macro.S index 51eee02ab5e0..011ec2526b8a 100644 --- a/arch/arm/mach-kirkwood/include/mach/debug-macro.S +++ b/arch/arm/mach-kirkwood/include/mach/debug-macro.S @@ -5,14 +5,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - -#include - - .macro addruart, rp, rv, tmp - ldr \rp, =KIRKWOOD_REGS_PHYS_BASE - ldr \rv, =KIRKWOOD_REGS_VIRT_BASE - orr \rp, \rp, #0x00012000 - orr \rv, \rv, #0x00012000 - .endm - #include diff --git a/arch/arm/mach-lpc32xx/include/mach/debug-macro.S b/arch/arm/mach-lpc32xx/include/mach/debug-macro.S index 11f986eb471c..c7bb4bcbe2e2 100644 --- a/arch/arm/mach-lpc32xx/include/mach/debug-macro.S +++ b/arch/arm/mach-lpc32xx/include/mach/debug-macro.S @@ -15,14 +15,4 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ - -/* - * Debug output is hardcoded to standard UART 5 -*/ - - .macro addruart, rp, rv, tmp - ldreq \rp, =0x40090000 - ldrne \rv, =0xF4090000 - .endm - #include diff --git a/arch/arm/mach-mv78xx0/include/mach/debug-macro.S b/arch/arm/mach-mv78xx0/include/mach/debug-macro.S index 0fce467ede13..c8284a2171fd 100644 --- a/arch/arm/mach-mv78xx0/include/mach/debug-macro.S +++ b/arch/arm/mach-mv78xx0/include/mach/debug-macro.S @@ -5,14 +5,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - -#include - - .macro addruart, rp, rv, tmp - ldr \rp, =MV78XX0_REGS_PHYS_BASE - ldr \rv, =MV78XX0_REGS_VIRT_BASE - orr \rp, \rp, #0x00012000 - orr \rv, \rv, #0x00012000 - .endm - #include diff --git a/arch/arm/mach-orion5x/include/mach/debug-macro.S b/arch/arm/mach-orion5x/include/mach/debug-macro.S index 52f29ef747b2..7489963fd8b4 100644 --- a/arch/arm/mach-orion5x/include/mach/debug-macro.S +++ b/arch/arm/mach-orion5x/include/mach/debug-macro.S @@ -7,14 +7,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - -#include - - .macro addruart, rp, rv, tmp - ldr \rp, =ORION5X_REGS_PHYS_BASE - ldr \rv, =ORION5X_REGS_VIRT_BASE - orr \rp, \rp, #0x00012000 - orr \rv, \rv, #0x00012000 - .endm - #include diff --git a/arch/arm/mach-rpc/include/mach/debug-macro.S b/arch/arm/mach-rpc/include/mach/debug-macro.S index fcb545083547..88a575ebd268 100644 --- a/arch/arm/mach-rpc/include/mach/debug-macro.S +++ b/arch/arm/mach-rpc/include/mach/debug-macro.S @@ -10,12 +10,4 @@ * published by the Free Software Foundation. * */ - - .macro addruart, rp, rv, tmp - mov \rp, #0x00010000 - orr \rp, \rp, #0x00000fe0 - orr \rv, \rp, #0xe0000000 @ virtual - orr \rp, \rp, #0x03000000 @ physical - .endm - #include -- cgit v1.2.3 From 2facbc88733b34e1f992cde054c88b8e07607043 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 7 Jul 2013 00:11:35 +0100 Subject: ARM: debug: move 8250 debug include into arch/arm/include/debug/ Now that the 8250 debug include can stand alone without requiring platforms to provide any macros, move it into the debug directory so it can be directly included. This allows us to get rid of a lot of debug-macros include files. Signed-off-by: Russell King --- arch/arm/Kconfig.debug | 10 ++---- arch/arm/include/asm/hardware/debug-8250.S | 40 ---------------------- arch/arm/include/debug/8250.S | 36 +++++++++++++++++++ arch/arm/include/debug/mvebu.S | 13 ------- arch/arm/include/debug/nspire.S | 4 --- arch/arm/include/debug/pxa.S | 13 ------- arch/arm/include/debug/rockchip.S | 12 ------- arch/arm/include/debug/sunxi.S | 12 ------- arch/arm/mach-dove/include/mach/debug-macro.S | 8 ----- arch/arm/mach-ebsa110/include/mach/debug-macro.S | 13 ------- .../arm/mach-footbridge/include/mach/debug-macro.S | 4 --- arch/arm/mach-gemini/include/mach/debug-macro.S | 12 ------- arch/arm/mach-iop13xx/include/mach/debug-macro.S | 13 ------- arch/arm/mach-iop32x/include/mach/debug-macro.S | 13 ------- arch/arm/mach-iop33x/include/mach/debug-macro.S | 13 ------- arch/arm/mach-ixp4xx/include/mach/debug-macro.S | 12 ------- arch/arm/mach-kirkwood/include/mach/debug-macro.S | 8 ----- arch/arm/mach-lpc32xx/include/mach/debug-macro.S | 18 ---------- arch/arm/mach-mv78xx0/include/mach/debug-macro.S | 8 ----- arch/arm/mach-orion5x/include/mach/debug-macro.S | 10 ------ arch/arm/mach-rpc/include/mach/debug-macro.S | 13 ------- 21 files changed, 38 insertions(+), 247 deletions(-) delete mode 100644 arch/arm/include/asm/hardware/debug-8250.S create mode 100644 arch/arm/include/debug/8250.S delete mode 100644 arch/arm/include/debug/mvebu.S delete mode 100644 arch/arm/include/debug/pxa.S delete mode 100644 arch/arm/include/debug/rockchip.S delete mode 100644 arch/arm/include/debug/sunxi.S delete mode 100644 arch/arm/mach-dove/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-ebsa110/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-gemini/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-iop13xx/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-iop32x/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-iop33x/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-ixp4xx/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-kirkwood/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-lpc32xx/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-mv78xx0/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-orion5x/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-rpc/include/mach/debug-macro.S (limited to 'arch/arm/include') diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index cf4262ec0f60..f27f8eebded1 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -830,6 +830,7 @@ config DEBUG_STI_UART config DEBUG_LL_INCLUDE string + default "debug/8250.S" if DEBUG_UART_8250 default "debug/bcm2835.S" if DEBUG_BCM2835 default "debug/cns3xxx.S" if DEBUG_CNS3XXX default "debug/exynos.S" if DEBUG_EXYNOS_UART @@ -846,21 +847,14 @@ config DEBUG_LL_INCLUDE DEBUG_IMX6SL_UART default "debug/keystone.S" if DEBUG_KEYSTONE_UART0 || \ DEBUG_KEYSTONE_UART1 - default "debug/mvebu.S" if DEBUG_MVEBU_UART || \ - DEBUG_MVEBU_UART_ALTERNATE default "debug/mxs.S" if DEBUG_IMX23_UART || DEBUG_IMX28_UART default "debug/nomadik.S" if DEBUG_NOMADIK_UART - default "debug/nspire.S" if DEBUG_NSPIRE_CX_UART || \ - DEBUG_NSPIRE_CLASSIC_UART + default "debug/nspire.S" if DEBUG_NSPIRE_CX_UART default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART - default "debug/pxa.S" if DEBUG_PXA_UART1 || DEBUG_MMP_UART2 || \ - DEBUG_MMP_UART3 - default "debug/rockchip.S" if DEBUG_ROCKCHIP_UART default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 default "debug/socfpga.S" if DEBUG_SOCFPGA_UART default "debug/sti.S" if DEBUG_STI_UART - default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1 default "debug/tegra.S" if DEBUG_TEGRA_UART default "debug/u300.S" if DEBUG_U300_UART default "debug/ux500.S" if DEBUG_UX500_UART diff --git a/arch/arm/include/asm/hardware/debug-8250.S b/arch/arm/include/asm/hardware/debug-8250.S deleted file mode 100644 index ea5f1710b524..000000000000 --- a/arch/arm/include/asm/hardware/debug-8250.S +++ /dev/null @@ -1,40 +0,0 @@ -/* - * arch/arm/include/asm/hardware/debug-8250.S - * - * Copyright (C) 1994-2013 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include - -#ifdef CONFIG_DEBUG_UART_PHYS - .macro addruart, rp, rv, tmp - ldr \rp, =CONFIG_DEBUG_UART_PHYS - ldr \rv, =CONFIG_DEBUG_UART_VIRT - .endm -#endif - -#ifndef UART_SHIFT -#define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT -#endif - - .macro senduart,rd,rx - strb \rd, [\rx, #UART_TX << UART_SHIFT] - .endm - - .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT] - and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE - teq \rd, #UART_LSR_TEMT | UART_LSR_THRE - bne 1002b - .endm - - .macro waituart,rd,rx -#ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL -1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT] - tst \rd, #UART_MSR_CTS - beq 1001b -#endif - .endm diff --git a/arch/arm/include/debug/8250.S b/arch/arm/include/debug/8250.S new file mode 100644 index 000000000000..92cab395677a --- /dev/null +++ b/arch/arm/include/debug/8250.S @@ -0,0 +1,36 @@ +/* + * arch/arm/include/debug/8250.S + * + * Copyright (C) 1994-2013 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include + + .macro addruart, rp, rv, tmp + ldr \rp, =CONFIG_DEBUG_UART_PHYS + ldr \rv, =CONFIG_DEBUG_UART_VIRT + .endm + +#define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT + + .macro senduart,rd,rx + strb \rd, [\rx, #UART_TX << UART_SHIFT] + .endm + + .macro busyuart,rd,rx +1002: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT] + and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE + teq \rd, #UART_LSR_TEMT | UART_LSR_THRE + bne 1002b + .endm + + .macro waituart,rd,rx +#ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL +1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT] + tst \rd, #UART_MSR_CTS + beq 1001b +#endif + .endm diff --git a/arch/arm/include/debug/mvebu.S b/arch/arm/include/debug/mvebu.S deleted file mode 100644 index 6309be5238e6..000000000000 --- a/arch/arm/include/debug/mvebu.S +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Early serial output macro for Marvell SoC - * - * Copyright (C) 2012 Marvell - * - * Lior Amsalem - * Gregory Clement - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -*/ -#include diff --git a/arch/arm/include/debug/nspire.S b/arch/arm/include/debug/nspire.S index 3e9329aa17b9..9c2fbeceedd0 100644 --- a/arch/arm/include/debug/nspire.S +++ b/arch/arm/include/debug/nspire.S @@ -19,7 +19,3 @@ #include #endif - -#ifdef CONFIG_DEBUG_NSPIRE_CLASSIC_UART -#include -#endif diff --git a/arch/arm/include/debug/pxa.S b/arch/arm/include/debug/pxa.S deleted file mode 100644 index 09e54f357894..000000000000 --- a/arch/arm/include/debug/pxa.S +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Early serial output macro for Marvell PXA/MMP SoC - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * Copyright (C) 2013 Haojian Zhuang - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -*/ -#include diff --git a/arch/arm/include/debug/rockchip.S b/arch/arm/include/debug/rockchip.S deleted file mode 100644 index 3ad023899820..000000000000 --- a/arch/arm/include/debug/rockchip.S +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Early serial output macro for Rockchip SoCs - * - * Copyright (C) 2012 Maxime Ripard - * - * Maxime Ripard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -*/ -#include diff --git a/arch/arm/include/debug/sunxi.S b/arch/arm/include/debug/sunxi.S deleted file mode 100644 index 4c3d89cfeb8f..000000000000 --- a/arch/arm/include/debug/sunxi.S +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Early serial output macro for Allwinner A1X SoCs - * - * Copyright (C) 2012 Maxime Ripard - * - * Maxime Ripard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -*/ -#include diff --git a/arch/arm/mach-dove/include/mach/debug-macro.S b/arch/arm/mach-dove/include/mach/debug-macro.S deleted file mode 100644 index 9b85a81588ea..000000000000 --- a/arch/arm/mach-dove/include/mach/debug-macro.S +++ /dev/null @@ -1,8 +0,0 @@ -/* - * arch/arm/mach-dove/include/mach/debug-macro.S - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -*/ -#include diff --git a/arch/arm/mach-ebsa110/include/mach/debug-macro.S b/arch/arm/mach-ebsa110/include/mach/debug-macro.S deleted file mode 100644 index 0cea548ce305..000000000000 --- a/arch/arm/mach-ebsa110/include/mach/debug-macro.S +++ /dev/null @@ -1,13 +0,0 @@ -/* arch/arm/mach-ebsa110/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * -**/ -#include diff --git a/arch/arm/mach-footbridge/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S index 553c47de578d..02247f313e94 100644 --- a/arch/arm/mach-footbridge/include/mach/debug-macro.S +++ b/arch/arm/mach-footbridge/include/mach/debug-macro.S @@ -13,9 +13,6 @@ #include -#ifndef CONFIG_DEBUG_DC21285_PORT -#include -#else #include /* For EBSA285 debugging */ .equ dc21285_high, ARMCSR_BASE & 0xff000000 @@ -43,4 +40,3 @@ .macro waituart,rd,rx .endm -#endif diff --git a/arch/arm/mach-gemini/include/mach/debug-macro.S b/arch/arm/mach-gemini/include/mach/debug-macro.S deleted file mode 100644 index 9dabd4bfcda2..000000000000 --- a/arch/arm/mach-gemini/include/mach/debug-macro.S +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Copyright (C) 2001-2006 Storlink, Corp. - * Copyright (C) 2008-2009 Paulius Zaleckas - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include diff --git a/arch/arm/mach-iop13xx/include/mach/debug-macro.S b/arch/arm/mach-iop13xx/include/mach/debug-macro.S deleted file mode 100644 index 90b5e64ee4ce..000000000000 --- a/arch/arm/mach-iop13xx/include/mach/debug-macro.S +++ /dev/null @@ -1,13 +0,0 @@ -/* - * arch/arm/mach-iop13xx/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include diff --git a/arch/arm/mach-iop32x/include/mach/debug-macro.S b/arch/arm/mach-iop32x/include/mach/debug-macro.S deleted file mode 100644 index 7ea745e73f5f..000000000000 --- a/arch/arm/mach-iop32x/include/mach/debug-macro.S +++ /dev/null @@ -1,13 +0,0 @@ -/* - * arch/arm/mach-iop32x/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include diff --git a/arch/arm/mach-iop33x/include/mach/debug-macro.S b/arch/arm/mach-iop33x/include/mach/debug-macro.S deleted file mode 100644 index 52781ae2f29c..000000000000 --- a/arch/arm/mach-iop33x/include/mach/debug-macro.S +++ /dev/null @@ -1,13 +0,0 @@ -/* - * arch/arm/mach-iop33x/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include diff --git a/arch/arm/mach-ixp4xx/include/mach/debug-macro.S b/arch/arm/mach-ixp4xx/include/mach/debug-macro.S deleted file mode 100644 index ff706fa2f406..000000000000 --- a/arch/arm/mach-ixp4xx/include/mach/debug-macro.S +++ /dev/null @@ -1,12 +0,0 @@ -/* arch/arm/mach-ixp4xx/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -*/ -#include diff --git a/arch/arm/mach-kirkwood/include/mach/debug-macro.S b/arch/arm/mach-kirkwood/include/mach/debug-macro.S deleted file mode 100644 index 011ec2526b8a..000000000000 --- a/arch/arm/mach-kirkwood/include/mach/debug-macro.S +++ /dev/null @@ -1,8 +0,0 @@ -/* - * arch/arm/mach-kirkwood/include/mach/debug-macro.S - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -*/ -#include diff --git a/arch/arm/mach-lpc32xx/include/mach/debug-macro.S b/arch/arm/mach-lpc32xx/include/mach/debug-macro.S deleted file mode 100644 index c7bb4bcbe2e2..000000000000 --- a/arch/arm/mach-lpc32xx/include/mach/debug-macro.S +++ /dev/null @@ -1,18 +0,0 @@ -/* - * arch/arm/mach-lpc32xx/include/mach/debug-macro.S - * - * Author: Kevin Wells - * - * Copyright (C) 2010 NXP Semiconductors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ -#include diff --git a/arch/arm/mach-mv78xx0/include/mach/debug-macro.S b/arch/arm/mach-mv78xx0/include/mach/debug-macro.S deleted file mode 100644 index c8284a2171fd..000000000000 --- a/arch/arm/mach-mv78xx0/include/mach/debug-macro.S +++ /dev/null @@ -1,8 +0,0 @@ -/* - * arch/arm/mach-mv78xx0/include/mach/debug-macro.S - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -*/ -#include diff --git a/arch/arm/mach-orion5x/include/mach/debug-macro.S b/arch/arm/mach-orion5x/include/mach/debug-macro.S deleted file mode 100644 index 7489963fd8b4..000000000000 --- a/arch/arm/mach-orion5x/include/mach/debug-macro.S +++ /dev/null @@ -1,10 +0,0 @@ -/* - * arch/arm/mach-orion5x/include/mach/debug-macro.S - * - * Debugging macro include header - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -*/ -#include diff --git a/arch/arm/mach-rpc/include/mach/debug-macro.S b/arch/arm/mach-rpc/include/mach/debug-macro.S deleted file mode 100644 index 88a575ebd268..000000000000 --- a/arch/arm/mach-rpc/include/mach/debug-macro.S +++ /dev/null @@ -1,13 +0,0 @@ -/* arch/arm/mach-rpc/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * -*/ -#include -- cgit v1.2.3 From 0b4cccbec60678212eccdb42dc1e1c233ddf7092 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 7 Jul 2013 11:42:46 +0100 Subject: ARM: debug: add support for word accesses to debug/8250.S Add 32-bit word access support to debug/8250.S and convert Picoxcell and SoCFPGA to this. Signed-off-by: Russell King --- arch/arm/Kconfig.debug | 14 ++++++++++++-- arch/arm/include/debug/8250.S | 24 +++++++++++++++++++++--- arch/arm/include/debug/8250_32.S | 27 --------------------------- arch/arm/include/debug/picoxcell.S | 19 ------------------- arch/arm/include/debug/socfpga.S | 21 --------------------- 5 files changed, 33 insertions(+), 72 deletions(-) delete mode 100644 arch/arm/include/debug/8250_32.S delete mode 100644 arch/arm/include/debug/picoxcell.S delete mode 100644 arch/arm/include/debug/socfpga.S (limited to 'arch/arm/include') diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index f27f8eebded1..09e70090cfdc 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -451,6 +451,7 @@ choice config DEBUG_PICOXCELL_UART depends on ARCH_PICOXCELL bool "Use PicoXcell UART for low-level debug" + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on PicoXcell based platforms. @@ -593,6 +594,7 @@ choice config DEBUG_SOCFPGA_UART depends on ARCH_SOCFPGA bool "Use SOCFPGA UART for low-level debug" + select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on SOCFPGA based platforms. @@ -851,9 +853,7 @@ config DEBUG_LL_INCLUDE default "debug/nomadik.S" if DEBUG_NOMADIK_UART default "debug/nspire.S" if DEBUG_NSPIRE_CX_UART default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART - default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 - default "debug/socfpga.S" if DEBUG_SOCFPGA_UART default "debug/sti.S" if DEBUG_STI_UART default "debug/tegra.S" if DEBUG_TEGRA_UART default "debug/u300.S" if DEBUG_U300_UART @@ -886,6 +886,7 @@ config DEBUG_UART_PHYS default 0x40100000 if DEBUG_PXA_UART1 default 0x42000000 if ARCH_GEMINI default 0x7c0003f8 if FOOTBRIDGE + default 0x80230000 if DEBUG_PICOXCELL_UART default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART default 0xc8000000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN default 0xc8000003 if ARCH_IXP4XX && CPU_BIG_ENDIAN @@ -897,6 +898,7 @@ config DEBUG_UART_PHYS default 0xf1012000 if ARCH_DOVE || ARCH_KIRKWOOD || ARCH_MV78XX0 || \ ARCH_ORION5X default 0xfe800000 if ARCH_IOP32X + default 0xffc02000 if DEBUG_SOCFPGA_UART default 0xffd82340 if ARCH_IOP13XX default 0xfffff700 if ARCH_IOP33X depends on DEBUG_UART_8250 @@ -915,6 +917,7 @@ config DEBUG_UART_VIRT default 0xfe012000 if ARCH_ORION5X default 0xfe017000 if DEBUG_MMP_UART2 default 0xfe018000 if DEBUG_MMP_UART3 + default 0xfe230000 if DEBUG_PICOXCELL_UART default 0xfe800000 if ARCH_IOP32X default 0xfeb24000 if DEBUG_RK3X_UART0 default 0xfeb26000 if DEBUG_RK3X_UART1 @@ -922,6 +925,7 @@ config DEBUG_UART_VIRT default 0xfed60000 if DEBUG_RK29_UART0 default 0xfed64000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 default 0xfed68000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 + default 0xfec02000 if DEBUG_SOCFPGA_UART default 0xfed12000 if ARCH_KIRKWOOD default 0xfee003f8 if FOOTBRIDGE default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART @@ -937,6 +941,12 @@ config DEBUG_UART_8250_SHIFT default 0 if FOOTBRIDGE || ARCH_IOP32X default 2 +config DEBUG_UART_8250_WORD + bool "Use 32-bit accesses for 8250 UART" + depends on DEBUG_UART_8250 + depends on DEBUG_UART_8250_SHIFT >= 2 + default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART + config DEBUG_UART_8250_FLOW_CONTROL bool "Enable flow control for 8250 UART" depends on DEBUG_UART_8250 diff --git a/arch/arm/include/debug/8250.S b/arch/arm/include/debug/8250.S index 92cab395677a..7a2baf913aa0 100644 --- a/arch/arm/include/debug/8250.S +++ b/arch/arm/include/debug/8250.S @@ -14,14 +14,32 @@ ldr \rv, =CONFIG_DEBUG_UART_VIRT .endm +#ifdef CONFIG_DEBUG_UART_8250_WORD + .macro store, rd, rx:vararg + str \rd, \rx + .endm + + .macro load, rd, rx:vararg + ldr \rd, \rx + .endm +#else + .macro store, rd, rx:vararg + strb \rd, \rx + .endm + + .macro load, rd, rx:vararg + ldrb \rd, \rx + .endm +#endif + #define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT .macro senduart,rd,rx - strb \rd, [\rx, #UART_TX << UART_SHIFT] + store \rd, [\rx, #UART_TX << UART_SHIFT] .endm .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT] +1002: load \rd, [\rx, #UART_LSR << UART_SHIFT] and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE teq \rd, #UART_LSR_TEMT | UART_LSR_THRE bne 1002b @@ -29,7 +47,7 @@ .macro waituart,rd,rx #ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL -1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT] +1001: load \rd, [\rx, #UART_MSR << UART_SHIFT] tst \rd, #UART_MSR_CTS beq 1001b #endif diff --git a/arch/arm/include/debug/8250_32.S b/arch/arm/include/debug/8250_32.S deleted file mode 100644 index 8db01eeabbb4..000000000000 --- a/arch/arm/include/debug/8250_32.S +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2011 Picochip Ltd., Jamie Iles - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Derived from arch/arm/mach-davinci/include/mach/debug-macro.S to use 32-bit - * accesses to the 8250. - */ - -#include - - .macro senduart,rd,rx - str \rd, [\rx, #UART_TX << UART_SHIFT] - .endm - - .macro busyuart,rd,rx -1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT] - and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE - teq \rd, #UART_LSR_TEMT | UART_LSR_THRE - bne 1002b - .endm - - /* The UART's don't have any flow control IO's wired up. */ - .macro waituart,rd,rx - .endm diff --git a/arch/arm/include/debug/picoxcell.S b/arch/arm/include/debug/picoxcell.S deleted file mode 100644 index bc1f07c49cd4..000000000000 --- a/arch/arm/include/debug/picoxcell.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2011 Picochip Ltd., Jamie Iles - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - */ - -#define UART_SHIFT 2 -#define PICOXCELL_UART1_BASE 0x80230000 -#define PHYS_TO_IO(x) (((x) & 0x00ffffff) | 0xfe000000) - - .macro addruart, rp, rv, tmp - ldr \rv, =PHYS_TO_IO(PICOXCELL_UART1_BASE) - ldr \rp, =PICOXCELL_UART1_BASE - .endm - -#include "8250_32.S" diff --git a/arch/arm/include/debug/socfpga.S b/arch/arm/include/debug/socfpga.S deleted file mode 100644 index 966b2f994946..000000000000 --- a/arch/arm/include/debug/socfpga.S +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#define UART_SHIFT 2 -#define DEBUG_LL_UART_OFFSET 0x00002000 - - .macro addruart, rp, rv, tmp - mov \rp, #DEBUG_LL_UART_OFFSET - orr \rp, \rp, #0x00c00000 - orr \rv, \rp, #0xfe000000 @ virtual base - orr \rp, \rp, #0xff000000 @ physical base - .endm - -#include "8250_32.S" - -- cgit v1.2.3 From 5c972af407419c79e1e922fb241fa0d06b4f1ffd Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 7 Jul 2013 12:32:16 +0100 Subject: ARM: debug: provide PL01x debug uart phys/virt address configuration options Move the definition of the UART register addresses out of the platform specific header files into the Kconfig files. Acked-by: Ryan Mallon Signed-off-by: Russell King --- arch/arm/Kconfig.debug | 54 ++++++++++++++++++++-- arch/arm/include/asm/hardware/debug-pl01x.S | 7 +++ arch/arm/include/debug/bcm2835.S | 9 ---- arch/arm/include/debug/cns3xxx.S | 7 --- arch/arm/include/debug/highbank.S | 6 --- arch/arm/include/debug/mxs.S | 14 ------ arch/arm/include/debug/nomadik.S | 8 ---- arch/arm/include/debug/nspire.S | 10 ---- arch/arm/include/debug/u300.S | 11 ----- arch/arm/include/debug/vexpress.S | 46 ------------------ arch/arm/mach-ep93xx/include/mach/debug-macro.S | 9 ---- .../arm/mach-integrator/include/mach/debug-macro.S | 7 --- arch/arm/mach-realview/include/mach/debug-macro.S | 17 ------- arch/arm/mach-versatile/include/mach/debug-macro.S | 8 ---- 14 files changed, 57 insertions(+), 156 deletions(-) (limited to 'arch/arm/include') diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 09e70090cfdc..f9573d9a6d96 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -92,6 +92,7 @@ choice config DEBUG_BCM2835 bool "Kernel low-level debugging on BCM2835 PL011 UART" depends on ARCH_BCM2835 + select DEBUG_UART_PL01X config DEBUG_CLPS711X_UART1 bool "Kernel low-level debugging messages via UART1" @@ -110,6 +111,7 @@ choice config DEBUG_CNS3XXX bool "Kernel Kernel low-level debugging on Cavium Networks CNS3xxx" depends on ARCH_CNS3XXX + select DEBUG_UART_PL01X help Say Y here if you want the debug print routines to direct their output to the CNS3xxx UART0. @@ -177,6 +179,7 @@ choice config DEBUG_HIGHBANK_UART bool "Kernel low-level debugging messages via Highbank UART" depends on ARCH_HIGHBANK + select DEBUG_UART_PL01X help Say Y here if you want the debug print routines to direct their output to the UART on Highbank based devices. @@ -191,6 +194,7 @@ choice config DEBUG_IMX23_UART bool "i.MX23 Debug UART" depends on SOC_IMX23 + select DEBUG_UART_PL01X help Say Y here if you want kernel low-level debugging support on i.MX23. @@ -212,6 +216,7 @@ choice config DEBUG_IMX28_UART bool "i.MX28 Debug UART" depends on SOC_IMX28 + select DEBUG_UART_PL01X help Say Y here if you want kernel low-level debugging support on i.MX28. @@ -362,6 +367,7 @@ choice config DEBUG_NOMADIK_UART bool "Kernel low-level debugging messages via NOMADIK UART" depends on ARCH_NOMADIK + select DEBUG_UART_PL01X help Say Y here if you want kernel low-level debugging support on NOMADIK based platforms. @@ -377,6 +383,7 @@ choice config DEBUG_NSPIRE_CX_UART bool "Kernel low-level debugging via TI-NSPIRE PL011 UART" depends on ARCH_NSPIRE + select DEBUG_UART_PL01X help Say Y here if you want kernel low-level debugging support on TI-NSPIRE CX models. @@ -467,6 +474,7 @@ choice config DEBUG_REALVIEW_STD_PORT bool "RealView Default UART" depends on ARCH_REALVIEW + select DEBUG_UART_PL01X help Say Y here if you want the debug print routines to direct their output to the serial port on RealView EB, PB11MP, PBA8 @@ -475,6 +483,7 @@ choice config DEBUG_REALVIEW_PB1176_PORT bool "RealView PB1176 UART" depends on MACH_REALVIEW_PB1176 + select DEBUG_UART_PL01X help Say Y here if you want the debug print routines to direct their output to the standard serial port on the RealView @@ -706,6 +715,7 @@ choice config DEBUG_U300_UART bool "Kernel low-level debugging messages via U300 UART0" depends on ARCH_U300 + select DEBUG_UART_PL01X help Say Y here if you want the debug print routines to direct their output to the uart port on U300 devices. @@ -731,6 +741,7 @@ choice config DEBUG_VEXPRESS_UART0_CA9 bool "Use PL011 UART0 at 0x10009000 (V2P-CA9 core tile)" depends on ARCH_VEXPRESS + select DEBUG_UART_PL01X help This option selects UART0 at 0x10009000. Except for custom models, this applies only to the V2P-CA9 tile. @@ -738,6 +749,7 @@ choice config DEBUG_VEXPRESS_UART0_RS1 bool "Use PL011 UART0 at 0x1c090000 (RS1 complaint tiles)" depends on ARCH_VEXPRESS + select DEBUG_UART_PL01X help This option selects UART0 at 0x1c090000. This applies to most of the tiles using the RS1 memory map, including all new A-class @@ -746,6 +758,7 @@ choice config DEBUG_VEXPRESS_UART0_CRX bool "Use PL011 UART0 at 0xb0090000 (Cortex-R compliant tiles)" depends on ARCH_VEXPRESS && !MMU + select DEBUG_UART_PL01X help This option selects UART0 at 0xb0090000. This is appropriate for Cortex-R series tiles and SMMs, such as Cortex-R5 and Cortex-R7 @@ -865,6 +878,11 @@ config DEBUG_LL_INCLUDE default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 default "mach/debug-macro.S" +config DEBUG_UART_PL01X + def_bool ARCH_EP93XX || \ + ARCH_INTEGRATOR || \ + ARCH_VERSATILE + config DEBUG_UART_8250 def_bool ARCH_DOVE || ARCH_EBSA110 || \ (FOOTBRIDGE && !DEBUG_DC21285_PORT) || \ @@ -877,17 +895,30 @@ config DEBUG_UART_PHYS default 0x01c28000 if DEBUG_SUNXI_UART0 default 0x01c28400 if DEBUG_SUNXI_UART1 default 0x03010fe0 if ARCH_RPC + default 0x10009000 if DEBUG_REALVIEW_STD_PORT || DEBUG_CNS3XXX || \ + DEBUG_VEXPRESS_UART0_CA9 + default 0x1010c000 if DEBUG_REALVIEW_PB1176_PORT default 0x10124000 if DEBUG_RK3X_UART0 default 0x10126000 if DEBUG_RK3X_UART1 + default 0x101f1000 if ARCH_VERSATILE + default 0x101fb000 if DEBUG_NOMADIK_UART + default 0x16000000 if ARCH_INTEGRATOR + default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1 default 0x20060000 if DEBUG_RK29_UART0 default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 default 0x20068000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 + default 0x20201000 if DEBUG_BCM2835 default 0x40090000 if ARCH_LPC32XX default 0x40100000 if DEBUG_PXA_UART1 default 0x42000000 if ARCH_GEMINI default 0x7c0003f8 if FOOTBRIDGE default 0x80230000 if DEBUG_PICOXCELL_UART - default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART + default 0x80070000 if DEBUG_IMX23_UART + default 0x80074000 if DEBUG_IMX28_UART + default 0x808c0000 if ARCH_EP93XX + default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART + default 0xb0090000 if DEBUG_VEXPRESS_UART0_CRX + default 0xc0013000 if DEBUG_U300_UART default 0xc8000000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN default 0xc8000003 if ARCH_IXP4XX && CPU_BIG_ENDIAN default 0xd0012000 if DEBUG_MVEBU_UART @@ -900,23 +931,34 @@ config DEBUG_UART_PHYS default 0xfe800000 if ARCH_IOP32X default 0xffc02000 if DEBUG_SOCFPGA_UART default 0xffd82340 if ARCH_IOP13XX + default 0xfff36000 if DEBUG_HIGHBANK_UART default 0xfffff700 if ARCH_IOP33X - depends on DEBUG_UART_8250 + depends on DEBUG_UART_8250 || DEBUG_UART_PL01X config DEBUG_UART_VIRT hex "Virtual base address of debug UART" default 0xe0010fe0 if ARCH_RPC default 0xf0000be0 if ARCH_EBSA110 + default 0xf0009000 if DEBUG_CNS3XXX + default 0xf01fb000 if DEBUG_NOMADIK_UART + default 0xf0201000 if DEBUG_BCM2835 + default 0xf11f1000 if ARCH_VERSATILE + default 0xf1600000 if ARCH_INTEGRATOR default 0xf1c28000 if DEBUG_SUNXI_UART0 default 0xf1c28400 if DEBUG_SUNXI_UART1 default 0xf2100000 if DEBUG_PXA_UART1 default 0xf4090000 if ARCH_LPC32XX default 0xf4200000 if ARCH_GEMINI + default 0xf8009000 if DEBUG_VEXPRESS_UART0_CA9 + default 0xf8090000 if DEBUG_VEXPRESS_UART0_RS1 + default 0xfb009000 if DEBUG_REALVIEW_STD_PORT + default 0xfb10c000 if DEBUG_REALVIEW_PB1176_PORT default 0xfd012000 if ARCH_MV78XX0 default 0xfde12000 if ARCH_DOVE default 0xfe012000 if ARCH_ORION5X default 0xfe017000 if DEBUG_MMP_UART2 default 0xfe018000 if DEBUG_MMP_UART3 + default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART default 0xfe230000 if DEBUG_PICOXCELL_UART default 0xfe800000 if ARCH_IOP32X default 0xfeb24000 if DEBUG_RK3X_UART0 @@ -927,13 +969,17 @@ config DEBUG_UART_VIRT default 0xfed68000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 default 0xfec02000 if DEBUG_SOCFPGA_UART default 0xfed12000 if ARCH_KIRKWOOD + default 0xfedc0000 if ARCH_EP93XX default 0xfee003f8 if FOOTBRIDGE - default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART + default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART + default 0xfee36000 if DEBUG_HIGHBANK_UART default 0xfee82340 if ARCH_IOP13XX default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN default 0xfefff700 if ARCH_IOP33X - depends on DEBUG_UART_8250 + default 0xff003000 if DEBUG_U300_UART + default DEBUG_UART_PHYS if !MMU + depends on DEBUG_UART_8250 || DEBUG_UART_PL01X config DEBUG_UART_8250_SHIFT int "Register offset shift for the 8250 debug UART" diff --git a/arch/arm/include/asm/hardware/debug-pl01x.S b/arch/arm/include/asm/hardware/debug-pl01x.S index f9fd083eff63..9d1e286cecfd 100644 --- a/arch/arm/include/asm/hardware/debug-pl01x.S +++ b/arch/arm/include/asm/hardware/debug-pl01x.S @@ -12,6 +12,13 @@ */ #include +#ifdef CONFIG_DEBUG_UART_PHYS + .macro addruart, rp, rv, tmp + ldr \rp, =CONFIG_DEBUG_UART_PHYS + ldr \rv, =CONFIG_DEBUG_UART_VIRT + .endm +#endif + .macro senduart,rd,rx strb \rd, [\rx, #UART01x_DR] .endm diff --git a/arch/arm/include/debug/bcm2835.S b/arch/arm/include/debug/bcm2835.S index aed9199bd847..726e06942933 100644 --- a/arch/arm/include/debug/bcm2835.S +++ b/arch/arm/include/debug/bcm2835.S @@ -10,13 +10,4 @@ * published by the Free Software Foundation. * */ - -#define BCM2835_DEBUG_PHYS 0x20201000 -#define BCM2835_DEBUG_VIRT 0xf0201000 - - .macro addruart, rp, rv, tmp - ldr \rp, =BCM2835_DEBUG_PHYS - ldr \rv, =BCM2835_DEBUG_VIRT - .endm - #include diff --git a/arch/arm/include/debug/cns3xxx.S b/arch/arm/include/debug/cns3xxx.S index d04c150baa1c..2d5fb519df2b 100644 --- a/arch/arm/include/debug/cns3xxx.S +++ b/arch/arm/include/debug/cns3xxx.S @@ -9,11 +9,4 @@ * it under the terms of the GNU General Public License, Version 2, as * published by the Free Software Foundation. */ - - .macro addruart,rp,rv,tmp - mov \rp, #0x00009000 - orr \rv, \rp, #0xf0000000 @ virtual base - orr \rp, \rp, #0x10000000 - .endm - #include diff --git a/arch/arm/include/debug/highbank.S b/arch/arm/include/debug/highbank.S index 8cad4322a5a2..3c6f63ff0d37 100644 --- a/arch/arm/include/debug/highbank.S +++ b/arch/arm/include/debug/highbank.S @@ -8,10 +8,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - - .macro addruart,rp,rv,tmp - ldr \rv, =0xfee36000 - ldr \rp, =0xfff36000 - .endm - #include diff --git a/arch/arm/include/debug/mxs.S b/arch/arm/include/debug/mxs.S index d86951551ca1..8a10ed264b0f 100644 --- a/arch/arm/include/debug/mxs.S +++ b/arch/arm/include/debug/mxs.S @@ -10,18 +10,4 @@ * published by the Free Software Foundation. * */ - -#ifdef CONFIG_DEBUG_IMX23_UART -#define UART_PADDR 0x80070000 -#elif defined (CONFIG_DEBUG_IMX28_UART) -#define UART_PADDR 0x80074000 -#endif - -#define UART_VADDR 0xfe100000 - - .macro addruart, rp, rv, tmp - ldr \rp, =UART_PADDR @ physical - ldr \rv, =UART_VADDR @ virtual - .endm - #include diff --git a/arch/arm/include/debug/nomadik.S b/arch/arm/include/debug/nomadik.S index 735417922ce2..a6d238eba216 100644 --- a/arch/arm/include/debug/nomadik.S +++ b/arch/arm/include/debug/nomadik.S @@ -9,12 +9,4 @@ * published by the Free Software Foundation. * */ - - .macro addruart, rp, rv, tmp - mov \rp, #0x00100000 - add \rp, \rp, #0x000fb000 - add \rv, \rp, #0xf0000000 @ virtual base - add \rp, \rp, #0x10000000 @ physical base address - .endm - #include diff --git a/arch/arm/include/debug/nspire.S b/arch/arm/include/debug/nspire.S index 9c2fbeceedd0..fc17e50cc6d4 100644 --- a/arch/arm/include/debug/nspire.S +++ b/arch/arm/include/debug/nspire.S @@ -8,14 +8,4 @@ * published by the Free Software Foundation. * */ -#ifdef CONFIG_DEBUG_NSPIRE_CX_UART -#define NSPIRE_EARLY_UART_PHYS_BASE 0x90020000 -#define NSPIRE_EARLY_UART_VIRT_BASE 0xfee20000 - -.macro addruart, rp, rv, tmp - ldr \rp, =(NSPIRE_EARLY_UART_PHYS_BASE) @ physical base address - ldr \rv, =(NSPIRE_EARLY_UART_VIRT_BASE) @ virtual base address -.endm - #include -#endif diff --git a/arch/arm/include/debug/u300.S b/arch/arm/include/debug/u300.S index 6f04f08a203c..58b9d6286cd4 100644 --- a/arch/arm/include/debug/u300.S +++ b/arch/arm/include/debug/u300.S @@ -4,15 +4,4 @@ * Debugging macro include header. * Author: Linus Walleij */ -#define U300_SLOW_PER_PHYS_BASE 0xc0010000 -#define U300_SLOW_PER_VIRT_BASE 0xff000000 - - .macro addruart, rp, rv, tmp - /* If we move the address using MMU, use this. */ - ldr \rp, = U300_SLOW_PER_PHYS_BASE @ MMU off, physical address - ldr \rv, = U300_SLOW_PER_VIRT_BASE @ MMU on, virtual address - orr \rp, \rp, #0x00003000 - orr \rv, \rv, #0x00003000 - .endm - #include diff --git a/arch/arm/include/debug/vexpress.S b/arch/arm/include/debug/vexpress.S index acafb229e2b6..114bf4cc6ea1 100644 --- a/arch/arm/include/debug/vexpress.S +++ b/arch/arm/include/debug/vexpress.S @@ -48,50 +48,4 @@ .endm #include - -#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_CA9) - - .macro addruart,rp,rv,tmp - mov \rp, #DEBUG_LL_UART_OFFSET - orr \rv, \rp, #DEBUG_LL_VIRT_BASE - orr \rp, \rp, #DEBUG_LL_PHYS_BASE - .endm - -#include - -#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_RS1) - - .macro addruart,rp,rv,tmp - mov \rp, #DEBUG_LL_UART_OFFSET_RS1 - orr \rv, \rp, #DEBUG_LL_VIRT_BASE - orr \rp, \rp, #DEBUG_LL_PHYS_BASE_RS1 - .endm - -#include - -#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_CRX) - - .macro addruart,rp,tmp,tmp2 - ldr \rp, =DEBUG_LL_UART_PHYS_CRX - .endm - -#include - -#else /* CONFIG_DEBUG_LL_UART_NONE */ - - .macro addruart, rp, rv, tmp - /* Safe dummy values */ - mov \rp, #0 - mov \rv, #DEBUG_LL_VIRT_BASE - .endm - - .macro senduart,rd,rx - .endm - - .macro waituart,rd,rx - .endm - - .macro busyuart,rd,rx - .endm - #endif diff --git a/arch/arm/mach-ep93xx/include/mach/debug-macro.S b/arch/arm/mach-ep93xx/include/mach/debug-macro.S index af54e43132cf..a1bfe4cbf74a 100644 --- a/arch/arm/mach-ep93xx/include/mach/debug-macro.S +++ b/arch/arm/mach-ep93xx/include/mach/debug-macro.S @@ -9,13 +9,4 @@ * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. */ -#include - - .macro addruart, rp, rv, tmp - ldr \rp, =EP93XX_APB_PHYS_BASE @ Physical base - ldr \rv, =EP93XX_APB_VIRT_BASE @ virtual base - orr \rp, \rp, #0x000c0000 - orr \rv, \rv, #0x000c0000 - .endm - #include diff --git a/arch/arm/mach-integrator/include/mach/debug-macro.S b/arch/arm/mach-integrator/include/mach/debug-macro.S index 411b116077e4..03ee0fd88605 100644 --- a/arch/arm/mach-integrator/include/mach/debug-macro.S +++ b/arch/arm/mach-integrator/include/mach/debug-macro.S @@ -10,11 +10,4 @@ * published by the Free Software Foundation. * */ - - .macro addruart, rp, rv, tmp - mov \rp, #0x16000000 @ physical base address - mov \rv, #0xf0000000 @ virtual base - add \rv, \rv, #0x16000000 >> 4 - .endm - #include diff --git a/arch/arm/mach-realview/include/mach/debug-macro.S b/arch/arm/mach-realview/include/mach/debug-macro.S index 8cc372dc66a8..99488f4a7d41 100644 --- a/arch/arm/mach-realview/include/mach/debug-macro.S +++ b/arch/arm/mach-realview/include/mach/debug-macro.S @@ -9,21 +9,4 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - -#ifdef CONFIG_DEBUG_REALVIEW_STD_PORT -#define DEBUG_LL_UART_OFFSET 0x00009000 -#elif defined(CONFIG_DEBUG_REALVIEW_PB1176_PORT) -#define DEBUG_LL_UART_OFFSET 0x0010c000 -#endif - -#ifndef DEBUG_LL_UART_OFFSET -#error "Unknown RealView platform" -#endif - - .macro addruart, rp, rv, tmp - mov \rp, #DEBUG_LL_UART_OFFSET - orr \rv, \rp, #0xfb000000 @ virtual base - orr \rp, \rp, #0x10000000 @ physical base - .endm - #include diff --git a/arch/arm/mach-versatile/include/mach/debug-macro.S b/arch/arm/mach-versatile/include/mach/debug-macro.S index d0fbd7f1cb00..c25697774d10 100644 --- a/arch/arm/mach-versatile/include/mach/debug-macro.S +++ b/arch/arm/mach-versatile/include/mach/debug-macro.S @@ -10,12 +10,4 @@ * published by the Free Software Foundation. * */ - - .macro addruart, rp, rv, tmp - mov \rp, #0x001F0000 - orr \rp, \rp, #0x00001000 - orr \rv, \rp, #0xf1000000 @ virtual base - orr \rp, \rp, #0x10000000 @ physical base - .endm - #include -- cgit v1.2.3 From 4e218b99285485a6788339ee660cc535c7bd5017 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 7 Jul 2013 12:36:46 +0100 Subject: ARM: debug: move PL01X debug include into arch/arm/include/debug/ Now that the PL01X debug include can mostly stand alone without requiring platforms to provide any macros, move it into the debug directory so it can be directly included. This allows us to get rid of a lot of debug-macros include files. The autodetect case for Versatile Express and the ux500 are left alone; these are more complicated implementations. Acked-by: Rob Herring Acked-by: Ryan Mallon Signed-off-by: Russell King --- arch/arm/Kconfig.debug | 12 ++------ arch/arm/include/asm/hardware/debug-pl01x.S | 36 ---------------------- arch/arm/include/debug/bcm2835.S | 13 -------- arch/arm/include/debug/cns3xxx.S | 12 -------- arch/arm/include/debug/highbank.S | 11 ------- arch/arm/include/debug/mxs.S | 13 -------- arch/arm/include/debug/nomadik.S | 12 -------- arch/arm/include/debug/nspire.S | 11 ------- arch/arm/include/debug/pl01x.S | 36 ++++++++++++++++++++++ arch/arm/include/debug/u300.S | 7 ----- arch/arm/include/debug/ux500.S | 2 +- arch/arm/include/debug/vexpress.S | 2 +- arch/arm/mach-ep93xx/include/mach/debug-macro.S | 12 -------- .../arm/mach-integrator/include/mach/debug-macro.S | 13 -------- arch/arm/mach-realview/include/mach/debug-macro.S | 12 -------- arch/arm/mach-versatile/include/mach/debug-macro.S | 13 -------- 16 files changed, 40 insertions(+), 177 deletions(-) delete mode 100644 arch/arm/include/asm/hardware/debug-pl01x.S delete mode 100644 arch/arm/include/debug/bcm2835.S delete mode 100644 arch/arm/include/debug/cns3xxx.S delete mode 100644 arch/arm/include/debug/highbank.S delete mode 100644 arch/arm/include/debug/mxs.S delete mode 100644 arch/arm/include/debug/nomadik.S delete mode 100644 arch/arm/include/debug/nspire.S create mode 100644 arch/arm/include/debug/pl01x.S delete mode 100644 arch/arm/include/debug/u300.S delete mode 100644 arch/arm/mach-ep93xx/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-integrator/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-realview/include/mach/debug-macro.S delete mode 100644 arch/arm/mach-versatile/include/mach/debug-macro.S (limited to 'arch/arm/include') diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index f9573d9a6d96..b4b298654224 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -846,10 +846,8 @@ config DEBUG_STI_UART config DEBUG_LL_INCLUDE string default "debug/8250.S" if DEBUG_UART_8250 - default "debug/bcm2835.S" if DEBUG_BCM2835 - default "debug/cns3xxx.S" if DEBUG_CNS3XXX + default "debug/pl01x.S" if DEBUG_UART_PL01X default "debug/exynos.S" if DEBUG_EXYNOS_UART - default "debug/highbank.S" if DEBUG_HIGHBANK_UART default "debug/icedcc.S" if DEBUG_ICEDCC default "debug/imx.S" if DEBUG_IMX1_UART || \ DEBUG_IMX25_UART || \ @@ -862,18 +860,12 @@ config DEBUG_LL_INCLUDE DEBUG_IMX6SL_UART default "debug/keystone.S" if DEBUG_KEYSTONE_UART0 || \ DEBUG_KEYSTONE_UART1 - default "debug/mxs.S" if DEBUG_IMX23_UART || DEBUG_IMX28_UART - default "debug/nomadik.S" if DEBUG_NOMADIK_UART - default "debug/nspire.S" if DEBUG_NSPIRE_CX_UART default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 default "debug/sti.S" if DEBUG_STI_UART default "debug/tegra.S" if DEBUG_TEGRA_UART - default "debug/u300.S" if DEBUG_U300_UART default "debug/ux500.S" if DEBUG_UX500_UART - default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \ - DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1 || \ - DEBUG_VEXPRESS_UART0_CRX + default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT default "debug/vt8500.S" if DEBUG_VT8500_UART0 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 default "mach/debug-macro.S" diff --git a/arch/arm/include/asm/hardware/debug-pl01x.S b/arch/arm/include/asm/hardware/debug-pl01x.S deleted file mode 100644 index 9d1e286cecfd..000000000000 --- a/arch/arm/include/asm/hardware/debug-pl01x.S +++ /dev/null @@ -1,36 +0,0 @@ -/* arch/arm/include/asm/hardware/debug-pl01x.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * -*/ -#include - -#ifdef CONFIG_DEBUG_UART_PHYS - .macro addruart, rp, rv, tmp - ldr \rp, =CONFIG_DEBUG_UART_PHYS - ldr \rv, =CONFIG_DEBUG_UART_VIRT - .endm -#endif - - .macro senduart,rd,rx - strb \rd, [\rx, #UART01x_DR] - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #UART01x_FR] - tst \rd, #UART01x_FR_TXFF - bne 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #UART01x_FR] - tst \rd, #UART01x_FR_BUSY - bne 1001b - .endm diff --git a/arch/arm/include/debug/bcm2835.S b/arch/arm/include/debug/bcm2835.S deleted file mode 100644 index 726e06942933..000000000000 --- a/arch/arm/include/debug/bcm2835.S +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Debugging macro include header - * - * Copyright (C) 2010 Broadcom - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - */ -#include diff --git a/arch/arm/include/debug/cns3xxx.S b/arch/arm/include/debug/cns3xxx.S deleted file mode 100644 index 2d5fb519df2b..000000000000 --- a/arch/arm/include/debug/cns3xxx.S +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Debugging macro include header - * - * Copyright 1994-1999 Russell King - * Copyright 2008 Cavium Networks - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, Version 2, as - * published by the Free Software Foundation. - */ -#include diff --git a/arch/arm/include/debug/highbank.S b/arch/arm/include/debug/highbank.S deleted file mode 100644 index 3c6f63ff0d37..000000000000 --- a/arch/arm/include/debug/highbank.S +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include diff --git a/arch/arm/include/debug/mxs.S b/arch/arm/include/debug/mxs.S deleted file mode 100644 index 8a10ed264b0f..000000000000 --- a/arch/arm/include/debug/mxs.S +++ /dev/null @@ -1,13 +0,0 @@ -/* arch/arm/mach-mxs/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - */ -#include diff --git a/arch/arm/include/debug/nomadik.S b/arch/arm/include/debug/nomadik.S deleted file mode 100644 index a6d238eba216..000000000000 --- a/arch/arm/include/debug/nomadik.S +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * -*/ -#include diff --git a/arch/arm/include/debug/nspire.S b/arch/arm/include/debug/nspire.S deleted file mode 100644 index fc17e50cc6d4..000000000000 --- a/arch/arm/include/debug/nspire.S +++ /dev/null @@ -1,11 +0,0 @@ -/* - * linux/arch/arm/include/debug/nspire.S - * - * Copyright (C) 2013 Daniel Tang - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, as - * published by the Free Software Foundation. - * - */ -#include diff --git a/arch/arm/include/debug/pl01x.S b/arch/arm/include/debug/pl01x.S new file mode 100644 index 000000000000..37c6895b87e6 --- /dev/null +++ b/arch/arm/include/debug/pl01x.S @@ -0,0 +1,36 @@ +/* arch/arm/include/debug/pl01x.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ +#include + +#ifdef CONFIG_DEBUG_UART_PHYS + .macro addruart, rp, rv, tmp + ldr \rp, =CONFIG_DEBUG_UART_PHYS + ldr \rv, =CONFIG_DEBUG_UART_VIRT + .endm +#endif + + .macro senduart,rd,rx + strb \rd, [\rx, #UART01x_DR] + .endm + + .macro waituart,rd,rx +1001: ldr \rd, [\rx, #UART01x_FR] + tst \rd, #UART01x_FR_TXFF + bne 1001b + .endm + + .macro busyuart,rd,rx +1001: ldr \rd, [\rx, #UART01x_FR] + tst \rd, #UART01x_FR_BUSY + bne 1001b + .endm diff --git a/arch/arm/include/debug/u300.S b/arch/arm/include/debug/u300.S deleted file mode 100644 index 58b9d6286cd4..000000000000 --- a/arch/arm/include/debug/u300.S +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (C) 2006-2013 ST-Ericsson AB - * License terms: GNU General Public License (GPL) version 2 - * Debugging macro include header. - * Author: Linus Walleij - */ -#include diff --git a/arch/arm/include/debug/ux500.S b/arch/arm/include/debug/ux500.S index fbd24beeb1fa..aa7f63a8b5e0 100644 --- a/arch/arm/include/debug/ux500.S +++ b/arch/arm/include/debug/ux500.S @@ -45,4 +45,4 @@ ldr \rv, =UART_VIRT_BASE @ yes, virtual address .endm -#include +#include diff --git a/arch/arm/include/debug/vexpress.S b/arch/arm/include/debug/vexpress.S index 114bf4cc6ea1..524acd5a223e 100644 --- a/arch/arm/include/debug/vexpress.S +++ b/arch/arm/include/debug/vexpress.S @@ -47,5 +47,5 @@ .endm -#include +#include #endif diff --git a/arch/arm/mach-ep93xx/include/mach/debug-macro.S b/arch/arm/mach-ep93xx/include/mach/debug-macro.S deleted file mode 100644 index a1bfe4cbf74a..000000000000 --- a/arch/arm/mach-ep93xx/include/mach/debug-macro.S +++ /dev/null @@ -1,12 +0,0 @@ -/* - * arch/arm/mach-ep93xx/include/mach/debug-macro.S - * Debugging macro include header - * - * Copyright (C) 2006 Lennert Buytenhek - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - */ -#include diff --git a/arch/arm/mach-integrator/include/mach/debug-macro.S b/arch/arm/mach-integrator/include/mach/debug-macro.S deleted file mode 100644 index 03ee0fd88605..000000000000 --- a/arch/arm/mach-integrator/include/mach/debug-macro.S +++ /dev/null @@ -1,13 +0,0 @@ -/* arch/arm/mach-integrator/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * -*/ -#include diff --git a/arch/arm/mach-realview/include/mach/debug-macro.S b/arch/arm/mach-realview/include/mach/debug-macro.S deleted file mode 100644 index 99488f4a7d41..000000000000 --- a/arch/arm/mach-realview/include/mach/debug-macro.S +++ /dev/null @@ -1,12 +0,0 @@ -/* arch/arm/mach-realview/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include diff --git a/arch/arm/mach-versatile/include/mach/debug-macro.S b/arch/arm/mach-versatile/include/mach/debug-macro.S deleted file mode 100644 index c25697774d10..000000000000 --- a/arch/arm/mach-versatile/include/mach/debug-macro.S +++ /dev/null @@ -1,13 +0,0 @@ -/* arch/arm/mach-versatile/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * -*/ -#include -- cgit v1.2.3 From f2acf003cd399994172a5ec342b47741841746f1 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 7 Jul 2013 16:05:49 +0100 Subject: ARM: debug: move keystone debug to generic 8250 code Keystone's debugging is just a copy of the old 8250_32 code with a different base address. Incorporate this into the generic 8250 debug code. Signed-off-by: Russell King --- arch/arm/Kconfig.debug | 11 +++++++--- arch/arm/include/debug/keystone.S | 43 --------------------------------------- 2 files changed, 8 insertions(+), 46 deletions(-) delete mode 100644 arch/arm/include/debug/keystone.S (limited to 'arch/arm/include') diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 8a8df447670b..cd2f88e22609 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -266,6 +266,7 @@ choice config DEBUG_KEYSTONE_UART0 bool "Kernel low-level debugging on KEYSTONE2 using UART0" depends on ARCH_KEYSTONE + select DEBUG_UART_8250 help Say Y here if you want the debug print routines to direct their output to UART0 serial port on KEYSTONE2 devices. @@ -273,6 +274,7 @@ choice config DEBUG_KEYSTONE_UART1 bool "Kernel low-level debugging on KEYSTONE2 using UART1" depends on ARCH_KEYSTONE + select DEBUG_UART_8250 help Say Y here if you want the debug print routines to direct their output to UART1 serial port on KEYSTONE2 devices. @@ -873,8 +875,6 @@ config DEBUG_LL_INCLUDE DEBUG_IMX53_UART ||\ DEBUG_IMX6Q_UART || \ DEBUG_IMX6SL_UART - default "debug/keystone.S" if DEBUG_KEYSTONE_UART0 || \ - DEBUG_KEYSTONE_UART1 default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 default "debug/sti.S" if DEBUG_STI_UART @@ -903,6 +903,8 @@ config DEBUG_UART_PHYS hex "Physical base address of debug UART" default 0x01c28000 if DEBUG_SUNXI_UART0 default 0x01c28400 if DEBUG_SUNXI_UART1 + default 0x02530c00 if DEBUG_KEYSTONE_UART0 + default 0x02531000 if DEBUG_KEYSTONE_UART1 default 0x03010fe0 if ARCH_RPC default 0x10009000 if DEBUG_REALVIEW_STD_PORT || DEBUG_CNS3XXX || \ DEBUG_VEXPRESS_UART0_CA9 @@ -973,6 +975,8 @@ config DEBUG_UART_VIRT default 0xfe800000 if ARCH_IOP32X default 0xfeb24000 if DEBUG_RK3X_UART0 default 0xfeb26000 if DEBUG_RK3X_UART1 + default 0xfeb30c00 if DEBUG_KEYSTONE_UART0 + default 0xfeb31000 if DEBUG_KEYSTONE_UART1 default 0xfec12000 if DEBUG_MVEBU_UART || DEBUG_MVEBU_UART_ALTERNATE default 0xfed60000 if DEBUG_RK29_UART0 default 0xfed64000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 @@ -1002,7 +1006,8 @@ config DEBUG_UART_8250_WORD bool "Use 32-bit accesses for 8250 UART" depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250 depends on DEBUG_UART_8250_SHIFT >= 2 - default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART + default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART || \ + ARCH_KEYSTONE config DEBUG_UART_8250_FLOW_CONTROL bool "Enable flow control for 8250 UART" diff --git a/arch/arm/include/debug/keystone.S b/arch/arm/include/debug/keystone.S deleted file mode 100644 index 9aef9ba3f4f0..000000000000 --- a/arch/arm/include/debug/keystone.S +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Early serial debug output macro for Keystone SOCs - * - * Copyright 2013 Texas Instruments, Inc. - * Santosh Shilimkar - * - * Based on RMKs low level debug code. - * Copyright (C) 1994-1999 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include - -#define UART_SHIFT 2 -#if defined(CONFIG_DEBUG_KEYSTONE_UART0) -#define UART_PHYS 0x02530c00 -#define UART_VIRT 0xfeb30c00 -#elif defined(CONFIG_DEBUG_KEYSTONE_UART1) -#define UART_PHYS 0x02531000 -#define UART_VIRT 0xfeb31000 -#endif - - .macro addruart, rp, rv, tmp - ldr \rv, =UART_VIRT @ physical base address - ldr \rp, =UART_PHYS @ virtual base address - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #UART_TX << UART_SHIFT] - .endm - - .macro busyuart,rd,rx -1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT] - and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE - teq \rd, #UART_LSR_TEMT | UART_LSR_THRE - bne 1002b - .endm - - .macro waituart,rd,rx - .endm -- cgit v1.2.3 From ae3c99a26c60ed0893fc5aedfbb55e32dfc8ab43 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Fri, 2 Aug 2013 20:53:37 +0100 Subject: ARM: 7806/1: allow DEBUG_UNCOMPRESS for Tegra DEBUG_UNCOMPRESS was previously disallowed for Tegra due to tegra.S's use of global data that was not linked into the decompressor. Solve this by declaring this symbol in tegra.S when it is being built into the decompressor. For the kernel proper, leave the declaration in mach-tegra/common.c as explained in the comment. Signed-off-by: Stephen Warren Tested-by: Alexandre Courbot Signed-off-by: Russell King --- arch/arm/Kconfig.debug | 2 +- arch/arm/include/debug/tegra.S | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'arch/arm/include') diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 2d57da324562..d739d47fce56 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1039,7 +1039,7 @@ config DEBUG_UNCOMPRESS bool depends on ARCH_MULTIPLATFORM default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \ - !DEBUG_TEGRA_UART + (!DEBUG_TEGRA_UART || !ZBOOT_ROM) help This option influences the normal decompressor output for multiplatform kernels. Normally, multiplatform kernels disable diff --git a/arch/arm/include/debug/tegra.S b/arch/arm/include/debug/tegra.S index 883d7c22fd9d..be6a720dd183 100644 --- a/arch/arm/include/debug/tegra.S +++ b/arch/arm/include/debug/tegra.S @@ -221,3 +221,32 @@ 1002: #endif .endm + +/* + * Storage for the state maintained by the macros above. + * + * In the kernel proper, this data is located in arch/arm/mach-tegra/common.c. + * That's because this header is included from multiple files, and we only + * want a single copy of the data. In particular, the UART probing code above + * assumes it's running using physical addresses. This is true when this file + * is included from head.o, but not when included from debug.o. So we need + * to share the probe results between the two copies, rather than having + * to re-run the probing again later. + * + * In the decompressor, we put the symbol/storage right here, since common.c + * isn't included in the decompressor build. This symbol gets put in .text + * even though it's really data, since .data is discarded from the + * decompressor. Luckily, .text is writeable in the decompressor, unless + * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug. + */ +#if defined(ZIMAGE) +tegra_uart_config: + /* Debug UART initialization required */ + .word 1 + /* Debug UART physical address */ + .word 0 + /* Debug UART virtual address */ + .word 0 + /* Scratch space for debug macro */ + .word 0 +#endif -- cgit v1.2.3 From 6a7d2c625656df5f8ad6e33aa3d164eefb1df8dc Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Tue, 27 Aug 2013 21:15:02 +0100 Subject: ARM: 7828/1: ARMv7-M: implement restart routine common to all v7-M machines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The newly introduced function is to be used as .restart callback for ARMv7-M machines. The used register is architecturally defined, so it should work for all M-class machines. Acked-by: Jonathan Austin Signed-off-by: Uwe Kleine-König Signed-off-by: Russell King --- arch/arm/include/asm/v7m.h | 12 ++++++++++++ arch/arm/kernel/Makefile | 2 +- arch/arm/kernel/v7m.c | 19 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 arch/arm/kernel/v7m.c (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/v7m.h b/arch/arm/include/asm/v7m.h index fa88d09fa3d9..615781c61627 100644 --- a/arch/arm/include/asm/v7m.h +++ b/arch/arm/include/asm/v7m.h @@ -15,6 +15,10 @@ #define V7M_SCB_VTOR 0x08 +#define V7M_SCB_AIRCR 0x0c +#define V7M_SCB_AIRCR_VECTKEY (0x05fa << 16) +#define V7M_SCB_AIRCR_SYSRESETREQ (1 << 2) + #define V7M_SCB_SCR 0x10 #define V7M_SCB_SCR_SLEEPDEEP (1 << 2) @@ -42,3 +46,11 @@ */ #define EXC_RET_STACK_MASK 0x00000004 #define EXC_RET_THREADMODE_PROCESSSTACK 0xfffffffd + +#ifndef __ASSEMBLY__ + +enum reboot_mode; + +void armv7m_restart(enum reboot_mode mode, const char *cmd); + +#endif /* __ASSEMBLY__ */ diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 86d10dd47dc4..5140df5f23aa 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -24,7 +24,7 @@ obj-$(CONFIG_ATAGS_PROC) += atags_proc.o obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o ifeq ($(CONFIG_CPU_V7M),y) -obj-y += entry-v7m.o +obj-y += entry-v7m.o v7m.o else obj-y += entry-armv.o endif diff --git a/arch/arm/kernel/v7m.c b/arch/arm/kernel/v7m.c new file mode 100644 index 000000000000..4d2cba94f5cc --- /dev/null +++ b/arch/arm/kernel/v7m.c @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2013 Uwe Kleine-Koenig for Pengutronix + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation. + */ +#include +#include +#include +#include + +void armv7m_restart(enum reboot_mode mode, const char *cmd) +{ + dsb(); + __raw_writel(V7M_SCB_AIRCR_VECTKEY | V7M_SCB_AIRCR_SYSRESETREQ, + BASEADDR_V7M_SCB + V7M_SCB_AIRCR); + dsb(); +} -- cgit v1.2.3 From 849b882b52df0f276d9ffded01d85654aa0da422 Mon Sep 17 00:00:00 2001 From: Douglas Anderson Date: Thu, 29 Aug 2013 00:08:01 +0100 Subject: ARM: 7829/1: Add ".text.unlikely" and ".text.hot" to arm unwind tables It appears that gcc may put some code in ".text.unlikely" or ".text.hot" sections. Right now those aren't accounted for in unwind tables. Add them. I found some docs about this at: http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gcc.pdf Without this, if you have slub_debug turned on, you can get messages that look like this: unwind: Index not found 7f008c50 Signed-off-by: Doug Anderson Acked-by: Mike Frysinger Signed-off-by: Russell King --- arch/arm/include/asm/module.h | 2 ++ arch/arm/kernel/module.c | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h index 0d3a28dbc8e5..ed690c49ef93 100644 --- a/arch/arm/include/asm/module.h +++ b/arch/arm/include/asm/module.h @@ -12,6 +12,8 @@ enum { ARM_SEC_CORE, ARM_SEC_EXIT, ARM_SEC_DEVEXIT, + ARM_SEC_HOT, + ARM_SEC_UNLIKELY, ARM_SEC_MAX, }; diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c index 85c3fb6c93c2..084dc8896986 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c @@ -292,12 +292,20 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, maps[ARM_SEC_CORE].unw_sec = s; else if (strcmp(".ARM.exidx.exit.text", secname) == 0) maps[ARM_SEC_EXIT].unw_sec = s; + else if (strcmp(".ARM.exidx.text.unlikely", secname) == 0) + maps[ARM_SEC_UNLIKELY].unw_sec = s; + else if (strcmp(".ARM.exidx.text.hot", secname) == 0) + maps[ARM_SEC_HOT].unw_sec = s; else if (strcmp(".init.text", secname) == 0) maps[ARM_SEC_INIT].txt_sec = s; else if (strcmp(".text", secname) == 0) maps[ARM_SEC_CORE].txt_sec = s; else if (strcmp(".exit.text", secname) == 0) maps[ARM_SEC_EXIT].txt_sec = s; + else if (strcmp(".text.unlikely", secname) == 0) + maps[ARM_SEC_UNLIKELY].txt_sec = s; + else if (strcmp(".text.hot", secname) == 0) + maps[ARM_SEC_HOT].txt_sec = s; } for (i = 0; i < ARM_SEC_MAX; i++) -- cgit v1.2.3