Commit 98368ab4 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'microblaze-3.20-rc1' of git://git.monstr.eu/linux-2.6-microblaze

Pull Microblaze pupdates from Michal Simek:
 - Remove various compilation errors
 - Various code cleanup patches
 - Add missing MB versions/architectures for autodetection

* tag 'microblaze-3.20-rc1' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Remove *.dtb files in make clean
  microblaze: whitespace fix
  microblaze/uaccess: fix sparse errors
  microblaze: intc: Reformat output
  microblaze: intc: Refactor DT sanity check
  microblaze: intc: Don't override error codes
  microblaze: Add target architecture
  microblaze: Add missing PVR version codes
  microblaze: Fix variable types to remove W=1 warning
  microblaze: Use unsigned type for limit comparison in cache.c
  microblaze: Use unsigned type for proper comparison in cpuinfo*.c
  microblaze: Use unsigned type for "for" loop because of comparison-kgdb.c
  microblaze: Change extern inline to static inline
  microblaze: Mark get_frame_size as static
  microblaze: Use unsigned return type in do_syscall_trace_enter
  microblaze: Declare microblaze_kgdb_break in header
  microblaze: Remove unused prom header from reset.c
  microblaze: Remove unused prom_parse.c
  microblaze: Wire-up execveat syscall
  microblaze: Use empty asm-generic/linkage.h
parents ab0475df a01d37d9
...@@ -34,5 +34,4 @@ $(obj)/simpleImage.%: vmlinux FORCE ...@@ -34,5 +34,4 @@ $(obj)/simpleImage.%: vmlinux FORCE
$(call if_changed,strip) $(call if_changed,strip)
@echo 'Kernel: $@ is ready' ' (#'`cat .version`')' @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
clean-files += simpleImage.*.unstrip linux.bin.ub dts/*.dtb
clean-files += simpleImage.*.unstrip linux.bin.ub
...@@ -16,5 +16,3 @@ quiet_cmd_cp = CP $< $@$2 ...@@ -16,5 +16,3 @@ quiet_cmd_cp = CP $< $@$2
# Rule to build device tree blobs # Rule to build device tree blobs
DTC_FLAGS := -p 1024 DTC_FLAGS := -p 1024
clean-files += *.dtb
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <linux/param.h> #include <linux/param.h>
extern inline void __delay(unsigned long loops) static inline void __delay(unsigned long loops)
{ {
asm volatile ("# __delay \n\t" \ asm volatile ("# __delay \n\t" \
"1: addi %0, %0, -1\t\n" \ "1: addi %0, %0, -1\t\n" \
...@@ -43,7 +43,7 @@ extern inline void __delay(unsigned long loops) ...@@ -43,7 +43,7 @@ extern inline void __delay(unsigned long loops)
extern unsigned long loops_per_jiffy; extern unsigned long loops_per_jiffy;
extern inline void __udelay(unsigned int x) static inline void __udelay(unsigned int x)
{ {
unsigned long long tmp = unsigned long long tmp =
......
...@@ -23,6 +23,9 @@ static inline void arch_kgdb_breakpoint(void) ...@@ -23,6 +23,9 @@ static inline void arch_kgdb_breakpoint(void)
__asm__ __volatile__("brki r16, 0x18;"); __asm__ __volatile__("brki r16, 0x18;");
} }
struct pt_regs;
asmlinkage void microblaze_kgdb_break(struct pt_regs *regs);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __MICROBLAZE_KGDB_H__ */ #endif /* __MICROBLAZE_KGDB_H__ */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
/* #include <asm-generic/linkage.h>
* 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 */
...@@ -60,7 +60,7 @@ extern unsigned long get_zero_page_fast(void); ...@@ -60,7 +60,7 @@ extern unsigned long get_zero_page_fast(void);
extern void __bad_pte(pmd_t *pmd); 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; pgd_t *ret;
...@@ -70,7 +70,7 @@ extern inline pgd_t *get_pgd_slow(void) ...@@ -70,7 +70,7 @@ extern inline pgd_t *get_pgd_slow(void)
return ret; return ret;
} }
extern inline pgd_t *get_pgd_fast(void) static inline pgd_t *get_pgd_fast(void)
{ {
unsigned long *ret; unsigned long *ret;
...@@ -84,14 +84,14 @@ extern inline pgd_t *get_pgd_fast(void) ...@@ -84,14 +84,14 @@ extern inline pgd_t *get_pgd_fast(void)
return (pgd_t *)ret; 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; *(unsigned long **)pgd = pgd_quicklist;
pgd_quicklist = (unsigned long *) pgd; pgd_quicklist = (unsigned long *) pgd;
pgtable_cache_size++; 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); free_page((unsigned long)pgd);
} }
...@@ -146,19 +146,19 @@ static inline pte_t *pte_alloc_one_fast(struct mm_struct *mm, ...@@ -146,19 +146,19 @@ static inline pte_t *pte_alloc_one_fast(struct mm_struct *mm,
return (pte_t *)ret; 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; *(unsigned long **)pte = pte_quicklist;
pte_quicklist = (unsigned long *) pte; pte_quicklist = (unsigned long *) pte;
pgtable_cache_size++; 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); 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); __free_page(ptepage);
} }
......
...@@ -97,7 +97,7 @@ static inline void syscall_set_arguments(struct task_struct *task, ...@@ -97,7 +97,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
microblaze_set_syscall_arg(regs, i++, *args++); 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); asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
static inline int syscall_get_arch(void) static inline int syscall_get_arch(void)
......
...@@ -220,7 +220,7 @@ extern long __user_bad(void); ...@@ -220,7 +220,7 @@ extern long __user_bad(void);
} else { \ } else { \
__gu_err = -EFAULT; \ __gu_err = -EFAULT; \
} \ } \
x = (typeof(*(ptr)))__gu_val; \ x = (__force typeof(*(ptr)))__gu_val; \
__gu_err; \ __gu_err; \
}) })
...@@ -242,7 +242,7 @@ extern long __user_bad(void); ...@@ -242,7 +242,7 @@ extern long __user_bad(void);
default: \ default: \
/* __gu_val = 0; __gu_err = -EINVAL;*/ __gu_err = __user_bad();\ /* __gu_val = 0; __gu_err = -EINVAL;*/ __gu_err = __user_bad();\
} \ } \
x = (__typeof__(*(ptr))) __gu_val; \ x = (__force __typeof__(*(ptr))) __gu_val; \
__gu_err; \ __gu_err; \
}) })
...@@ -306,7 +306,7 @@ extern long __user_bad(void); ...@@ -306,7 +306,7 @@ extern long __user_bad(void);
#define __put_user_check(x, ptr, size) \ #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); \ typeof(*(ptr)) __user *__pu_addr = (ptr); \
int __pu_err = 0; \ int __pu_err = 0; \
\ \
......
...@@ -38,6 +38,6 @@ ...@@ -38,6 +38,6 @@
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#define __NR_syscalls 388 #define __NR_syscalls 389
#endif /* _ASM_MICROBLAZE_UNISTD_H */ #endif /* _ASM_MICROBLAZE_UNISTD_H */
...@@ -403,5 +403,6 @@ ...@@ -403,5 +403,6 @@
#define __NR_getrandom 385 #define __NR_getrandom 385
#define __NR_memfd_create 386 #define __NR_memfd_create 386
#define __NR_bpf 387 #define __NR_bpf 387
#define __NR_execveat 388
#endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */
...@@ -16,7 +16,7 @@ extra-y := head.o vmlinux.lds ...@@ -16,7 +16,7 @@ extra-y := head.o vmlinux.lds
obj-y += dma.o exceptions.o \ obj-y += dma.o exceptions.o \
hw_exception_handler.o intc.o irq.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 reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o
obj-y += cpu/ obj-y += cpu/
......
...@@ -140,10 +140,10 @@ do { \ ...@@ -140,10 +140,10 @@ do { \
/* It is used only first parameter for OP - for wic, wdc */ /* It is used only first parameter for OP - for wic, wdc */
#define CACHE_RANGE_LOOP_1(start, end, line_length, op) \ #define CACHE_RANGE_LOOP_1(start, end, line_length, op) \
do { \ do { \
int volatile temp = 0; \ unsigned int volatile temp = 0; \
int align = ~(line_length - 1); \ unsigned int align = ~(line_length - 1); \
end = ((end & align) == end) ? end - line_length : end & align; \ end = ((end & align) == end) ? end - line_length : end & align; \
WARN_ON(end - start < 0); \ WARN_ON(end < start); \
\ \
__asm__ __volatile__ (" 1: " #op " %1, r0;" \ __asm__ __volatile__ (" 1: " #op " %1, r0;" \
"cmpu %0, %1, %2;" \ "cmpu %0, %1, %2;" \
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
{ {
struct pvr_s pvr; struct pvr_s pvr;
int temp; /* for saving temp value */ u32 temp; /* for saving temp value */
get_pvr(&pvr); get_pvr(&pvr);
CI(ver_code, VERSION); CI(ver_code, VERSION);
......
...@@ -22,7 +22,7 @@ static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER; ...@@ -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) void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu)
{ {
int i = 0; u32 i = 0;
ci->use_instr = ci->use_instr =
(fcpu(cpu, "xlnx,use-barrel") ? PVR0_USE_BARREL_MASK : 0) | (fcpu(cpu, "xlnx,use-barrel") ? PVR0_USE_BARREL_MASK : 0) |
......
...@@ -41,8 +41,12 @@ const struct cpu_ver_key cpu_ver_lookup[] = { ...@@ -41,8 +41,12 @@ const struct cpu_ver_key cpu_ver_lookup[] = {
{"8.40.a", 0x18}, {"8.40.a", 0x18},
{"8.40.b", 0x19}, {"8.40.b", 0x19},
{"8.50.a", 0x1a}, {"8.50.a", 0x1a},
{"8.50.b", 0x1c},
{"8.50.c", 0x1e},
{"9.0", 0x1b}, {"9.0", 0x1b},
{"9.1", 0x1d}, {"9.1", 0x1d},
{"9.2", 0x1f},
{"9.3", 0x20},
{NULL, 0}, {NULL, 0},
}; };
...@@ -61,11 +65,14 @@ const struct family_string_key family_string_lookup[] = { ...@@ -61,11 +65,14 @@ const struct family_string_key family_string_lookup[] = {
{"spartan3adsp", 0xc}, {"spartan3adsp", 0xc},
{"spartan6", 0xd}, {"spartan6", 0xd},
{"virtex6", 0xe}, {"virtex6", 0xe},
{"virtex7", 0xf},
/* FIXME There is no key code defined for spartan2 */ /* FIXME There is no key code defined for spartan2 */
{"spartan2", 0xf0}, {"spartan2", 0xf0},
{"kintex7", 0x10}, {"kintex7", 0x10},
{"artix7", 0x11}, {"artix7", 0x11},
{"zynq7000", 0x12}, {"zynq7000", 0x12},
{"UltraScale Virtex", 0x13},
{"UltraScale Kintex", 0x14},
{NULL, 0}, {NULL, 0},
}; };
......
...@@ -148,17 +148,17 @@ static int __init xilinx_intc_of_init(struct device_node *intc, ...@@ -148,17 +148,17 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
ret = of_property_read_u32(intc, "xlnx,num-intr-inputs", &nr_irq); ret = of_property_read_u32(intc, "xlnx,num-intr-inputs", &nr_irq);
if (ret < 0) { if (ret < 0) {
pr_err("%s: unable to read xlnx,num-intr-inputs\n", __func__); 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); ret = of_property_read_u32(intc, "xlnx,kind-of-intr", &intr_mask);
if (ret < 0) { if (ret < 0) {
pr_err("%s: unable to read xlnx,kind-of-intr\n", __func__); pr_err("%s: unable to read xlnx,kind-of-intr\n", __func__);
return -EINVAL; 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_warn("%s: mismatch in kind-of-intr param\n", __func__);
pr_info("%s: num_irq=%d, edge=0x%x\n", pr_info("%s: num_irq=%d, edge=0x%x\n",
intc->full_name, nr_irq, intr_mask); intc->full_name, nr_irq, intr_mask);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/kgdb.h>
#include <asm/pvr.h> #include <asm/pvr.h>
#define GDB_REG 0 #define GDB_REG 0
...@@ -35,9 +36,10 @@ struct pvr_s pvr; ...@@ -35,9 +36,10 @@ struct pvr_s pvr;
void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) 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; unsigned long *pt_regb = (unsigned long *)regs;
int temp; int temp;
/* registers r0 - r31, pc, msr, ear, esr, fsr + do not save pt_mode */ /* registers r0 - r31, pc, msr, ear, esr, fsr + do not save pt_mode */
for (i = 0; i < (sizeof(struct pt_regs) / 4) - 1; i++) for (i = 0; i < (sizeof(struct pt_regs) / 4) - 1; i++)
gdb_regs[i] = pt_regb[i]; gdb_regs[i] = pt_regb[i];
...@@ -67,7 +69,7 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) ...@@ -67,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) 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; unsigned long *pt_regb = (unsigned long *)regs;
/* pt_regs and gdb_regs have the same 37 values. /* pt_regs and gdb_regs have the same 37 values.
...@@ -77,7 +79,7 @@ void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs) ...@@ -77,7 +79,7 @@ void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs)
pt_regb[i] = gdb_regs[i]; 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) if (kgdb_handle_exception(1, SIGTRAP, 0, regs) != 0)
return; return;
...@@ -91,7 +93,7 @@ void microblaze_kgdb_break(struct pt_regs *regs) ...@@ -91,7 +93,7 @@ void microblaze_kgdb_break(struct pt_regs *regs)
/* untested */ /* untested */
void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) 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); unsigned long *pt_regb = (unsigned long *)(p->thread.regs);
/* registers r0 - r31, pc, msr, ear, esr, fsr + do not save pt_mode */ /* registers r0 - r31, pc, msr, ear, esr, fsr + do not save pt_mode */
......
#undef DEBUG
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/etherdevice.h>
#include <linux/of_address.h>
#include <asm/prom.h>
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);
}
...@@ -132,9 +132,9 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -132,9 +132,9 @@ long arch_ptrace(struct task_struct *child, long request,
return rval; 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); secure_computing_strict(regs->r12);
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <asm/prom.h>
/* Trigger specific functions */ /* Trigger specific functions */
#ifdef CONFIG_GPIOLIB #ifdef CONFIG_GPIOLIB
......
...@@ -158,7 +158,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, ...@@ -158,7 +158,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
{ {
struct rt_sigframe __user *frame; struct rt_sigframe __user *frame;
int err = 0, sig = ksig->sig; int err = 0, sig = ksig->sig;
int signal; unsigned long signal;
unsigned long address = 0; unsigned long address = 0;
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
pmd_t *pmdp; pmd_t *pmdp;
...@@ -174,7 +174,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, ...@@ -174,7 +174,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
&& current_thread_info()->exec_domain->signal_invmap && current_thread_info()->exec_domain->signal_invmap
&& sig < 32 && sig < 32
? current_thread_info()->exec_domain->signal_invmap[sig] ? current_thread_info()->exec_domain->signal_invmap[sig]
: sig; : (unsigned long)sig;
if (ksig->ka.sa.sa_flags & SA_SIGINFO) if (ksig->ka.sa.sa_flags & SA_SIGINFO)
err |= copy_siginfo_to_user(&frame->info, &ksig->info); err |= copy_siginfo_to_user(&frame->info, &ksig->info);
......
...@@ -388,3 +388,4 @@ ENTRY(sys_call_table) ...@@ -388,3 +388,4 @@ ENTRY(sys_call_table)
.long sys_getrandom /* 385 */ .long sys_getrandom /* 385 */
.long sys_memfd_create .long sys_memfd_create
.long sys_bpf .long sys_bpf
.long sys_execveat
...@@ -59,7 +59,7 @@ struct stack_trace; ...@@ -59,7 +59,7 @@ struct stack_trace;
* *
* Return - Number of stack bytes the instruction reserves or reclaims * 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)); return abs((s16)(instr & 0xFFFF));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment