From e236fe93e306055c0f927eb09b4d5b10deadbb28 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 1 Sep 2014 15:56:23 +0200 Subject: microblaze: Use empty asm-generic/linkage.h The difference between microblaze and default version in linux/linkage.h is just value stored in the padding bytes which was 0 and in generic is 0x90. Different value shouldn't have any effect. Signed-off-by: Michal Simek --- arch/microblaze/include/asm/linkage.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/include/asm/linkage.h b/arch/microblaze/include/asm/linkage.h index 3a8e36d057eb..0540bbaad897 100644 --- a/arch/microblaze/include/asm/linkage.h +++ b/arch/microblaze/include/asm/linkage.h @@ -1,15 +1 @@ -/* - * Copyright (C) 2006 Atmark Techno, Inc. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - */ - -#ifndef _ASM_MICROBLAZE_LINKAGE_H -#define _ASM_MICROBLAZE_LINKAGE_H - -#define __ALIGN .align 4 -#define __ALIGN_STR ".align 4" - -#endif /* _ASM_MICROBLAZE_LINKAGE_H */ +#include -- cgit v1.2.3 From add4b1b02da7e7ec35c34dd04d351ac53f3f0dd8 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 15:29:54 +0100 Subject: microblaze: Wire-up execveat syscall Add new execveat syscall. Signed-off-by: Michal Simek --- arch/microblaze/include/asm/unistd.h | 2 +- arch/microblaze/include/uapi/asm/unistd.h | 1 + arch/microblaze/kernel/syscall_table.S | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h index 0a53362d5548..76ed17b56fea 100644 --- a/arch/microblaze/include/asm/unistd.h +++ b/arch/microblaze/include/asm/unistd.h @@ -38,6 +38,6 @@ #endif /* __ASSEMBLY__ */ -#define __NR_syscalls 388 +#define __NR_syscalls 389 #endif /* _ASM_MICROBLAZE_UNISTD_H */ diff --git a/arch/microblaze/include/uapi/asm/unistd.h b/arch/microblaze/include/uapi/asm/unistd.h index c712677f8a2a..32850c73be09 100644 --- a/arch/microblaze/include/uapi/asm/unistd.h +++ b/arch/microblaze/include/uapi/asm/unistd.h @@ -403,5 +403,6 @@ #define __NR_getrandom 385 #define __NR_memfd_create 386 #define __NR_bpf 387 +#define __NR_execveat 388 #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S index 0166e890486c..29c8568ec55c 100644 --- a/arch/microblaze/kernel/syscall_table.S +++ b/arch/microblaze/kernel/syscall_table.S @@ -388,3 +388,4 @@ ENTRY(sys_call_table) .long sys_getrandom /* 385 */ .long sys_memfd_create .long sys_bpf + .long sys_execveat -- cgit v1.2.3 From 32db31da49ffc969d95c434cc47864b30b1bff9c Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 15:30:49 +0100 Subject: microblaze: Remove unused prom_parse.c of_parse_dma_window is completely unused. Signed-off-by: Michal Simek --- arch/microblaze/kernel/Makefile | 2 +- arch/microblaze/kernel/prom_parse.c | 35 ----------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 arch/microblaze/kernel/prom_parse.c (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/Makefile b/arch/microblaze/kernel/Makefile index 08d50cc55e7d..f08bacaf8a95 100644 --- a/arch/microblaze/kernel/Makefile +++ b/arch/microblaze/kernel/Makefile @@ -16,7 +16,7 @@ extra-y := head.o vmlinux.lds obj-y += dma.o exceptions.o \ hw_exception_handler.o intc.o irq.o \ - platform.o process.o prom.o prom_parse.o ptrace.o \ + platform.o process.o prom.o ptrace.o \ reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o obj-y += cpu/ diff --git a/arch/microblaze/kernel/prom_parse.c b/arch/microblaze/kernel/prom_parse.c deleted file mode 100644 index 068762f55fd6..000000000000 --- a/arch/microblaze/kernel/prom_parse.c +++ /dev/null @@ -1,35 +0,0 @@ -#undef DEBUG - -#include -#include -#include -#include -#include -#include -#include - -void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop, - unsigned long *busno, unsigned long *phys, unsigned long *size) -{ - const u32 *dma_window; - u32 cells; - const unsigned char *prop; - - dma_window = dma_window_prop; - - /* busno is always one cell */ - *busno = *(dma_window++); - - prop = of_get_property(dn, "ibm,#dma-address-cells", NULL); - if (!prop) - prop = of_get_property(dn, "#address-cells", NULL); - - cells = prop ? *(u32 *)prop : of_n_addr_cells(dn); - *phys = of_read_number(dma_window, cells); - - dma_window += cells; - - prop = of_get_property(dn, "ibm,#dma-size-cells", NULL); - cells = prop ? *(u32 *)prop : of_n_size_cells(dn); - *size = of_read_number(dma_window, cells); -} -- cgit v1.2.3 From b366f11b9a81ad0cc7ed3cbdaca15bb98f96db25 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 15:31:59 +0100 Subject: microblaze: Remove unused prom header from reset.c Completely unused header by this file. Signed-off-by: Michal Simek --- arch/microblaze/kernel/reset.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c index fbe58c6554a8..bab4c8330ef4 100644 --- a/arch/microblaze/kernel/reset.c +++ b/arch/microblaze/kernel/reset.c @@ -9,7 +9,6 @@ #include #include -#include /* Trigger specific functions */ #ifdef CONFIG_GPIOLIB -- cgit v1.2.3 From f396a4d2314bf1cb83148d9b8fc47995e6c27e1f Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 15:32:57 +0100 Subject: microblaze: Declare microblaze_kgdb_break in header This patch removes the warning: arch/microblaze/kernel/kgdb.c:81:6: warning: no previous prototype for 'microblaze_kgdb_break' [-Wmissing-prototypes] Signed-off-by: Michal Simek --- arch/microblaze/include/asm/kgdb.h | 3 +++ arch/microblaze/kernel/kgdb.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/include/asm/kgdb.h b/arch/microblaze/include/asm/kgdb.h index 78b17d40b235..ad27acb2b15f 100644 --- a/arch/microblaze/include/asm/kgdb.h +++ b/arch/microblaze/include/asm/kgdb.h @@ -23,6 +23,9 @@ static inline void arch_kgdb_breakpoint(void) __asm__ __volatile__("brki r16, 0x18;"); } +struct pt_regs; +asmlinkage void microblaze_kgdb_break(struct pt_regs *regs); + #endif /* __ASSEMBLY__ */ #endif /* __MICROBLAZE_KGDB_H__ */ #endif /* __KERNEL__ */ diff --git a/arch/microblaze/kernel/kgdb.c b/arch/microblaze/kernel/kgdb.c index 09a5e8286137..4bd44b6cbc3b 100644 --- a/arch/microblaze/kernel/kgdb.c +++ b/arch/microblaze/kernel/kgdb.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #define GDB_REG 0 @@ -77,7 +78,7 @@ void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs) pt_regb[i] = gdb_regs[i]; } -void microblaze_kgdb_break(struct pt_regs *regs) +asmlinkage void microblaze_kgdb_break(struct pt_regs *regs) { if (kgdb_handle_exception(1, SIGTRAP, 0, regs) != 0) return; -- cgit v1.2.3 From 8543e6c96762fcc930af5725088c2b9e4865c3aa Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 15:41:13 +0100 Subject: microblaze: Use unsigned return type in do_syscall_trace_enter Registers are not signed types. The patch removes warnings: arch/microblaze/kernel/ptrace.c: In function 'do_syscall_trace_enter': arch/microblaze/kernel/ptrace.c:152:14: warning: signed and unsigned type in conditional expression [-Wsign-compare] return ret ?: regs->r12; Signed-off-by: Michal Simek --- arch/microblaze/include/asm/syscall.h | 2 +- arch/microblaze/kernel/ptrace.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/include/asm/syscall.h b/arch/microblaze/include/asm/syscall.h index 53cfaf34c343..04a5bece8168 100644 --- a/arch/microblaze/include/asm/syscall.h +++ b/arch/microblaze/include/asm/syscall.h @@ -97,7 +97,7 @@ static inline void syscall_set_arguments(struct task_struct *task, microblaze_set_syscall_arg(regs, i++, *args++); } -asmlinkage long do_syscall_trace_enter(struct pt_regs *regs); +asmlinkage unsigned long do_syscall_trace_enter(struct pt_regs *regs); asmlinkage void do_syscall_trace_leave(struct pt_regs *regs); static inline int syscall_get_arch(void) diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c index bb10637ce688..8cfa98cadf3d 100644 --- a/arch/microblaze/kernel/ptrace.c +++ b/arch/microblaze/kernel/ptrace.c @@ -132,9 +132,9 @@ long arch_ptrace(struct task_struct *child, long request, return rval; } -asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) +asmlinkage unsigned long do_syscall_trace_enter(struct pt_regs *regs) { - long ret = 0; + unsigned long ret = 0; secure_computing_strict(regs->r12); -- cgit v1.2.3 From e14ebe417c7c4e58c50ef143d99d797757749762 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 15:45:38 +0100 Subject: microblaze: Mark get_frame_size as static It is used only locally in unwind.c. The patch removes warning: arch/microblaze/kernel/unwind.c:62:13: warning: no previous prototype for 'get_frame_size' [-Wmissing-prototypes] inline long get_frame_size(unsigned long instr) Signed-off-by: Michal Simek --- arch/microblaze/kernel/unwind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/unwind.c b/arch/microblaze/kernel/unwind.c index 1f7b8d449668..61c04eed14d5 100644 --- a/arch/microblaze/kernel/unwind.c +++ b/arch/microblaze/kernel/unwind.c @@ -59,7 +59,7 @@ struct stack_trace; * * Return - Number of stack bytes the instruction reserves or reclaims */ -inline long get_frame_size(unsigned long instr) +static inline long get_frame_size(unsigned long instr) { return abs((s16)(instr & 0xFFFF)); } -- cgit v1.2.3 From b6db0a56218c38455e52780338ad61e284a67e4c Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 15:51:30 +0100 Subject: microblaze: Change extern inline to static inline With compilers which follow the C99 standard (like modern versions of gcc and clang), "extern inline" does the opposite thing from older versions of gcc (emits code for an externally linkable version of the inline function). "static inline" does the intended behavior in all cases instead. Description taken from: "staging, rtl8192e, LLVMLinux: Change extern inline to static inline" (sha1: 6d91857d4826b382b3fd4fad95f52713be646f96) The patch removes compilation warnings W=1: ./arch/microblaze/include/asm/delay.h:18:20: warning: no previous prototype for '__delay' [-Wmissing-prototypes] extern inline void __delay(unsigned long loops) ./arch/microblaze/include/asm/delay.h:46:20: warning: no previous prototype for '__udelay' [-Wmissing-prototypes] extern inline void __udelay(unsigned int x) ./arch/microblaze/include/asm/pgalloc.h:63:22: warning: no previous prototype for 'get_pgd_slow' [-Wmissing-prototypes] extern inline pgd_t *get_pgd_slow(void) ./arch/microblaze/include/asm/pgalloc.h:73:22: warning: no previous prototype for 'get_pgd_fast' [-Wmissing-prototypes] extern inline pgd_t *get_pgd_fast(void) ./arch/microblaze/include/asm/pgalloc.h:87:20: warning: no previous prototype for 'free_pgd_fast' [-Wmissing-prototypes] extern inline void free_pgd_fast(pgd_t *pgd) ./arch/microblaze/include/asm/pgalloc.h:94:20: warning: no previous prototype for 'free_pgd_slow' [-Wmissing-prototypes] extern inline void free_pgd_slow(pgd_t *pgd) ./arch/microblaze/include/asm/pgalloc.h:149:20: warning: no previous prototype for 'pte_free_fast' [-Wmissing-prototypes] extern inline void pte_free_fast(pte_t *pte) ./arch/microblaze/include/asm/pgalloc.h:156:20: warning: no previous prototype for 'pte_free_kernel' [-Wmissing-prototypes] extern inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) ./arch/microblaze/include/asm/pgalloc.h:161:20: warning: no previous prototype for 'pte_free_slow' [-Wmissing-prototypes] extern inline void pte_free_slow(struct page *ptepage) Signed-off-by: Michal Simek --- arch/microblaze/include/asm/delay.h | 4 ++-- arch/microblaze/include/asm/pgalloc.h | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/include/asm/delay.h b/arch/microblaze/include/asm/delay.h index 60cb39deb533..ea2a9cd9b159 100644 --- a/arch/microblaze/include/asm/delay.h +++ b/arch/microblaze/include/asm/delay.h @@ -15,7 +15,7 @@ #include -extern inline void __delay(unsigned long loops) +static inline void __delay(unsigned long loops) { asm volatile ("# __delay \n\t" \ "1: addi %0, %0, -1\t\n" \ @@ -43,7 +43,7 @@ extern inline void __delay(unsigned long loops) extern unsigned long loops_per_jiffy; -extern inline void __udelay(unsigned int x) +static inline void __udelay(unsigned int x) { unsigned long long tmp = diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h index 7fdf7fabc7d7..61436d69775c 100644 --- a/arch/microblaze/include/asm/pgalloc.h +++ b/arch/microblaze/include/asm/pgalloc.h @@ -60,7 +60,7 @@ extern unsigned long get_zero_page_fast(void); extern void __bad_pte(pmd_t *pmd); -extern inline pgd_t *get_pgd_slow(void) +static inline pgd_t *get_pgd_slow(void) { pgd_t *ret; @@ -70,7 +70,7 @@ extern inline pgd_t *get_pgd_slow(void) return ret; } -extern inline pgd_t *get_pgd_fast(void) +static inline pgd_t *get_pgd_fast(void) { unsigned long *ret; @@ -84,14 +84,14 @@ extern inline pgd_t *get_pgd_fast(void) return (pgd_t *)ret; } -extern inline void free_pgd_fast(pgd_t *pgd) +static inline void free_pgd_fast(pgd_t *pgd) { *(unsigned long **)pgd = pgd_quicklist; pgd_quicklist = (unsigned long *) pgd; pgtable_cache_size++; } -extern inline void free_pgd_slow(pgd_t *pgd) +static inline void free_pgd_slow(pgd_t *pgd) { free_page((unsigned long)pgd); } @@ -146,19 +146,19 @@ static inline pte_t *pte_alloc_one_fast(struct mm_struct *mm, return (pte_t *)ret; } -extern inline void pte_free_fast(pte_t *pte) +static inline void pte_free_fast(pte_t *pte) { *(unsigned long **)pte = pte_quicklist; pte_quicklist = (unsigned long *) pte; pgtable_cache_size++; } -extern inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) +static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) { free_page((unsigned long)pte); } -extern inline void pte_free_slow(struct page *ptepage) +static inline void pte_free_slow(struct page *ptepage) { __free_page(ptepage); } -- cgit v1.2.3 From e76fdb324844cc0367f8c6ea5d13278a81568ccb Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 15:56:17 +0100 Subject: microblaze: Use unsigned type for "for" loop because of comparison-kgdb.c This patch removes warnings reported by W=1: arch/microblaze/kernel/kgdb.c: In function 'pt_regs_to_gdb_regs': arch/microblaze/kernel/kgdb.c:43:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] arch/microblaze/kernel/kgdb.c:51:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] arch/microblaze/kernel/kgdb.c: In function 'gdb_regs_to_pt_regs': arch/microblaze/kernel/kgdb.c:77:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] arch/microblaze/kernel/kgdb.c: In function 'sleeping_thread_to_gdb_regs': arch/microblaze/kernel/kgdb.c:99:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] arch/microblaze/kernel/kgdb.c:103:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Michal Simek --- arch/microblaze/kernel/kgdb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/kgdb.c b/arch/microblaze/kernel/kgdb.c index 4bd44b6cbc3b..8736af5806ae 100644 --- a/arch/microblaze/kernel/kgdb.c +++ b/arch/microblaze/kernel/kgdb.c @@ -36,9 +36,10 @@ struct pvr_s pvr; void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) { - int i; + unsigned int i; unsigned long *pt_regb = (unsigned long *)regs; int temp; + /* registers r0 - r31, pc, msr, ear, esr, fsr + do not save pt_mode */ for (i = 0; i < (sizeof(struct pt_regs) / 4) - 1; i++) gdb_regs[i] = pt_regb[i]; @@ -68,7 +69,7 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs) { - int i; + unsigned int i; unsigned long *pt_regb = (unsigned long *)regs; /* pt_regs and gdb_regs have the same 37 values. @@ -92,7 +93,7 @@ asmlinkage void microblaze_kgdb_break(struct pt_regs *regs) /* untested */ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) { - int i; + unsigned int i; unsigned long *pt_regb = (unsigned long *)(p->thread.regs); /* registers r0 - r31, pc, msr, ear, esr, fsr + do not save pt_mode */ -- cgit v1.2.3 From bdb96e3cad21f5973c95f0e6687db4a57eff7c53 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 16:02:00 +0100 Subject: microblaze: Use unsigned type for proper comparison in cpuinfo*.c Compare the same types together. Compilation warnings: arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c: In function 'set_cpuinfo_pvr_full': arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:47:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:52:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:57:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c:94:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] arch/microblaze/kernel/cpu/cpuinfo-static.c: In function 'set_cpuinfo_static': arch/microblaze/kernel/cpu/cpuinfo-static.c:40:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Michal Simek --- arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c | 2 +- arch/microblaze/kernel/cpu/cpuinfo-static.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c index 93c26cf50de5..a32daec96c12 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c +++ b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c @@ -33,7 +33,7 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) { struct pvr_s pvr; - int temp; /* for saving temp value */ + u32 temp; /* for saving temp value */ get_pvr(&pvr); CI(ver_code, VERSION); diff --git a/arch/microblaze/kernel/cpu/cpuinfo-static.c b/arch/microblaze/kernel/cpu/cpuinfo-static.c index 4854285b26e7..85dbda4a08a8 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo-static.c +++ b/arch/microblaze/kernel/cpu/cpuinfo-static.c @@ -22,7 +22,7 @@ static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER; void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu) { - int i = 0; + u32 i = 0; ci->use_instr = (fcpu(cpu, "xlnx,use-barrel") ? PVR0_USE_BARREL_MASK : 0) | -- cgit v1.2.3 From 2558cd8cab793e9c8c3b17bdf06552bfb98d49e5 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 15:38:00 +0100 Subject: microblaze: Use unsigned type for limit comparison in cache.c The patch removes warnings: arch/microblaze/kernel/cpu/cache.c:146:14: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] Signed-off-by: Michal Simek --- arch/microblaze/kernel/cpu/cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/cpu/cache.c b/arch/microblaze/kernel/cpu/cache.c index a6e44410672d..0bde47e4fa69 100644 --- a/arch/microblaze/kernel/cpu/cache.c +++ b/arch/microblaze/kernel/cpu/cache.c @@ -140,10 +140,10 @@ do { \ /* It is used only first parameter for OP - for wic, wdc */ #define CACHE_RANGE_LOOP_1(start, end, line_length, op) \ do { \ - int volatile temp = 0; \ - int align = ~(line_length - 1); \ + unsigned int volatile temp = 0; \ + unsigned int align = ~(line_length - 1); \ end = ((end & align) == end) ? end - line_length : end & align; \ - WARN_ON(end - start < 0); \ + WARN_ON(end < start); \ \ __asm__ __volatile__ (" 1: " #op " %1, r0;" \ "cmpu %0, %1, %2;" \ -- cgit v1.2.3 From ed4602e13f8d7b764308d6db58ff9932353f16a3 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Dec 2014 15:38:07 +0100 Subject: microblaze: Fix variable types to remove W=1 warning This patch removes this warning: arch/microblaze/kernel/signal.c: In function 'setup_rt_frame': arch/microblaze/kernel/signal.c:177:3: warning: signed and unsigned type in conditional expression [-Wsign-compare] Signed-off-by: Michal Simek --- arch/microblaze/kernel/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 8955a3829cf0..235706055b7f 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c @@ -158,7 +158,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, { struct rt_sigframe __user *frame; int err = 0, sig = ksig->sig; - int signal; + unsigned long signal; unsigned long address = 0; #ifdef CONFIG_MMU pmd_t *pmdp; @@ -174,7 +174,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, && current_thread_info()->exec_domain->signal_invmap && sig < 32 ? current_thread_info()->exec_domain->signal_invmap[sig] - : sig; + : (unsigned long)sig; if (ksig->ka.sa.sa_flags & SA_SIGINFO) err |= copy_siginfo_to_user(&frame->info, &ksig->info); -- cgit v1.2.3 From 81653edd99ee2297ad6ab49a4f91a1d5dce577f1 Mon Sep 17 00:00:00 2001 From: Erico Nunes Date: Fri, 2 Jan 2015 00:40:33 -0200 Subject: microblaze: Add missing PVR version codes PVR version code was missing in the cpu_ver_lookup table for the following versions: 8.50.b 8.50.c 9.2 9.3 This caused /proc/cpuinfo to display "CPU-Ver: Unknown" for these versions. This was detected and the patch tested with MicroBlaze version 8.50.c. The other codes were taken from the Xilinx MicroBlaze Processor Reference Guides UG081 (v14.7) and UG984 (v2014.1). Signed-off-by: Erico Nunes Signed-off-by: Michal Simek --- arch/microblaze/kernel/cpu/cpuinfo.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/cpu/cpuinfo.c b/arch/microblaze/kernel/cpu/cpuinfo.c index 234acad79b9e..b60442dcdedc 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo.c +++ b/arch/microblaze/kernel/cpu/cpuinfo.c @@ -41,8 +41,12 @@ const struct cpu_ver_key cpu_ver_lookup[] = { {"8.40.a", 0x18}, {"8.40.b", 0x19}, {"8.50.a", 0x1a}, + {"8.50.b", 0x1c}, + {"8.50.c", 0x1e}, {"9.0", 0x1b}, {"9.1", 0x1d}, + {"9.2", 0x1f}, + {"9.3", 0x20}, {NULL, 0}, }; -- cgit v1.2.3 From ed89466f2368fc15c72ce5344d582c640dcf53a6 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 5 Jan 2015 12:01:17 +0100 Subject: microblaze: Add target architecture Add missing target architectures - virtex7, ultrascale virtex and ultrascale kintex. Signed-off-by: Michal Simek --- arch/microblaze/kernel/cpu/cpuinfo.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/cpu/cpuinfo.c b/arch/microblaze/kernel/cpu/cpuinfo.c index b60442dcdedc..d1dd6e83d59b 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo.c +++ b/arch/microblaze/kernel/cpu/cpuinfo.c @@ -65,11 +65,14 @@ const struct family_string_key family_string_lookup[] = { {"spartan3adsp", 0xc}, {"spartan6", 0xd}, {"virtex6", 0xe}, + {"virtex7", 0xf}, /* FIXME There is no key code defined for spartan2 */ {"spartan2", 0xf0}, {"kintex7", 0x10}, {"artix7", 0x11}, {"zynq7000", 0x12}, + {"UltraScale Virtex", 0x13}, + {"UltraScale Kintex", 0x14}, {NULL, 0}, }; -- cgit v1.2.3 From 2c80a072a6c1cc4490fbbde5ba82bc7faf0374f0 Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Fri, 19 Dec 2014 10:21:04 -0800 Subject: microblaze: intc: Don't override error codes Just pass on error codes instead of overriding them. Signed-off-by: Soren Brinkmann Signed-off-by: Michal Simek --- arch/microblaze/kernel/intc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c index 15c7c12ea0e7..01ae73088578 100644 --- a/arch/microblaze/kernel/intc.c +++ b/arch/microblaze/kernel/intc.c @@ -148,13 +148,13 @@ static int __init xilinx_intc_of_init(struct device_node *intc, ret = of_property_read_u32(intc, "xlnx,num-intr-inputs", &nr_irq); if (ret < 0) { pr_err("%s: unable to read xlnx,num-intr-inputs\n", __func__); - return -EINVAL; + return ret; } ret = of_property_read_u32(intc, "xlnx,kind-of-intr", &intr_mask); if (ret < 0) { pr_err("%s: unable to read xlnx,kind-of-intr\n", __func__); - return -EINVAL; + return ret; } if (intr_mask > (u32)((1ULL << nr_irq) - 1)) -- cgit v1.2.3 From d50466c90724d5aae4d38a9a9bc163bea6f94098 Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Fri, 19 Dec 2014 10:21:05 -0800 Subject: microblaze: intc: Refactor DT sanity check Avoid funky casts and arithmetic. Signed-off-by: Soren Brinkmann Signed-off-by: Michal Simek --- arch/microblaze/kernel/intc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c index 01ae73088578..8965fd379570 100644 --- a/arch/microblaze/kernel/intc.c +++ b/arch/microblaze/kernel/intc.c @@ -157,7 +157,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc, return ret; } - if (intr_mask > (u32)((1ULL << nr_irq) - 1)) + if (intr_mask >> nr_irq) pr_info(" ERROR: Mismatch in kind-of-intr param\n"); pr_info("%s: num_irq=%d, edge=0x%x\n", -- cgit v1.2.3 From 231856ae7ccb5ee49b2f722e1d8ba7a45df1a978 Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Fri, 19 Dec 2014 10:21:06 -0800 Subject: microblaze: intc: Reformat output A message was using pr_info level output for a message including "ERROR" which is not really a fatal error. Remove the 'ERROR' from that message, use pr_warn loglevel and add the function name to the output to give users a chance to find the culprit in case the warning triggers. Signed-off-by: Soren Brinkmann Signed-off-by: Michal Simek --- arch/microblaze/kernel/intc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c index 8965fd379570..719feee1e043 100644 --- a/arch/microblaze/kernel/intc.c +++ b/arch/microblaze/kernel/intc.c @@ -158,7 +158,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc, } if (intr_mask >> nr_irq) - pr_info(" ERROR: Mismatch in kind-of-intr param\n"); + pr_warn("%s: mismatch in kind-of-intr param\n", __func__); pr_info("%s: num_irq=%d, edge=0x%x\n", intc->full_name, nr_irq, intr_mask); -- cgit v1.2.3 From 0774bf6a8b49ccd35fad58a1eed0d2382f34912e Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Tue, 6 Jan 2015 17:44:02 +0200 Subject: microblaze/uaccess: fix sparse errors virtio wants to read bitwise types from userspace using get_user. At the moment this triggers sparse errors, since the value is passed through an integer. Fix that up using __force. Signed-off-by: Michael S. Tsirkin Signed-off-by: Michal Simek --- arch/microblaze/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h index 59a89a64a865..e41bebf8d473 100644 --- a/arch/microblaze/include/asm/uaccess.h +++ b/arch/microblaze/include/asm/uaccess.h @@ -220,7 +220,7 @@ extern long __user_bad(void); } else { \ __gu_err = -EFAULT; \ } \ - x = (typeof(*(ptr)))__gu_val; \ + x = (__force typeof(*(ptr)))__gu_val; \ __gu_err; \ }) @@ -242,7 +242,7 @@ extern long __user_bad(void); default: \ /* __gu_val = 0; __gu_err = -EINVAL;*/ __gu_err = __user_bad();\ } \ - x = (__typeof__(*(ptr))) __gu_val; \ + x = (__force __typeof__(*(ptr))) __gu_val; \ __gu_err; \ }) -- cgit v1.2.3 From 132d5dfc04698e4226ca9787214bd4e277ed39f2 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Tue, 6 Jan 2015 17:45:03 +0200 Subject: microblaze: whitespace fix Align using tabs to make code prettier. Signed-off-by: Michael S. Tsirkin Signed-off-by: Michal Simek --- arch/microblaze/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h index e41bebf8d473..62942fd12672 100644 --- a/arch/microblaze/include/asm/uaccess.h +++ b/arch/microblaze/include/asm/uaccess.h @@ -306,7 +306,7 @@ extern long __user_bad(void); #define __put_user_check(x, ptr, size) \ ({ \ - typeof(*(ptr)) volatile __pu_val = x; \ + typeof(*(ptr)) volatile __pu_val = x; \ typeof(*(ptr)) __user *__pu_addr = (ptr); \ int __pu_err = 0; \ \ -- cgit v1.2.3 From a01d37d914f98c430854bbae2402e6f51d9a8d0b Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 20 Jan 2015 09:40:14 +0100 Subject: microblaze: Remove *.dtb files in make clean dts/Makefile is called only for simpleImage target which is causing that *.dtb are not removed. This patch fix it. Signed-off-by: Michal Simek --- arch/microblaze/boot/Makefile | 3 +-- arch/microblaze/boot/dts/Makefile | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'arch/microblaze') diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile index 8e211cc28dac..91d2068da1b9 100644 --- a/arch/microblaze/boot/Makefile +++ b/arch/microblaze/boot/Makefile @@ -34,5 +34,4 @@ $(obj)/simpleImage.%: vmlinux FORCE $(call if_changed,strip) @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' - -clean-files += simpleImage.*.unstrip linux.bin.ub +clean-files += simpleImage.*.unstrip linux.bin.ub dts/*.dtb diff --git a/arch/microblaze/boot/dts/Makefile b/arch/microblaze/boot/dts/Makefile index c4982d16e555..a3d2e42c3c97 100644 --- a/arch/microblaze/boot/dts/Makefile +++ b/arch/microblaze/boot/dts/Makefile @@ -16,5 +16,3 @@ quiet_cmd_cp = CP $< $@$2 # Rule to build device tree blobs DTC_FLAGS := -p 1024 - -clean-files += *.dtb -- cgit v1.2.3