diff options
34 files changed, 659 insertions, 346 deletions
diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index e4decc6b8947..04dff5bdcbf7 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -29,21 +29,17 @@ config HEXAGON select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS_BROADCAST select MODULES_USE_ELF_RELA + select GENERIC_CPU_DEVICES + select GENERIC_KERNEL_THREAD + select GENERIC_KERNEL_EXECVE ---help--- Qualcomm Hexagon is a processor architecture designed for high performance and low power across a wide variety of applications. -config HEXAGON_ARCH_V1 - bool - -config HEXAGON_ARCH_V2 - bool - -config HEXAGON_ARCH_V3 - bool - -config HEXAGON_ARCH_V4 - bool +config HEXAGON_PHYS_OFFSET + def_bool y + ---help--- + Platforms that don't load the kernel at zero set this. config FRAME_POINTER def_bool y @@ -81,9 +77,6 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM def_bool y -config GENERIC_FIND_NEXT_BIT - def_bool y - config GENERIC_HWEIGHT def_bool y @@ -103,14 +96,14 @@ choice config HEXAGON_COMET bool "Comet Board" - select HEXAGON_ARCH_V2 ---help--- Support for the Comet platform. endchoice -config HEXAGON_VM - def_bool y +config HEXAGON_ARCH_VERSION + int "Architecture version" + default 2 config CMDLINE string "Default kernel command string" @@ -122,12 +115,6 @@ config CMDLINE minimum, you should specify the memory size and the root device (e.g., mem=64M root=/dev/nfs). -config HEXAGON_ANGEL_TRAPS - bool "Use Angel Traps" - default n - ---help--- - Enable angel debug traps (for printk's). - config SMP bool "Multi-Processing support" ---help--- diff --git a/arch/hexagon/Makefile b/arch/hexagon/Makefile index d00d900b2566..207711a0fd0c 100644 --- a/arch/hexagon/Makefile +++ b/arch/hexagon/Makefile @@ -15,20 +15,9 @@ KBUILD_CFLAGS += -fno-short-enums # LDFLAGS_MODULE += -shared CFLAGS_MODULE += -mlong-calls -cflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1) -cflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2) -cflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3) -cflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4) - -aflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1) -aflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2) -aflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3) -aflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4) - -ldflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1) -ldflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2) -ldflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3) -ldflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4) +cflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION}) +aflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION}) +ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION}) KBUILD_CFLAGS += $(cflags-y) KBUILD_AFLAGS += $(aflags-y) diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild index bdb54ceb53bc..1da17caac23c 100644 --- a/arch/hexagon/include/asm/Kbuild +++ b/arch/hexagon/include/asm/Kbuild @@ -25,7 +25,6 @@ generic-y += kdebug.h generic-y += kmap_types.h generic-y += local64.h generic-y += local.h -generic-y += local.h generic-y += mman.h generic-y += msgbuf.h generic-y += pci.h @@ -41,6 +40,7 @@ generic-y += sembuf.h generic-y += shmbuf.h generic-y += shmparam.h generic-y += siginfo.h +generic-y += sizes.h generic-y += socket.h generic-y += sockios.h generic-y += statfs.h diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h index 468fbb0781cd..8a64ff2337f6 100644 --- a/arch/hexagon/include/asm/atomic.h +++ b/arch/hexagon/include/asm/atomic.h @@ -1,7 +1,7 @@ /* * Atomic operations for the Hexagon architecture * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. * * * This program is free software; you can redistribute it and/or modify @@ -117,35 +117,37 @@ static inline int atomic_sub_return(int i, atomic_t *v) #define atomic_sub(i, v) atomic_sub_return(i, (v)) /** - * atomic_add_unless - add unless the number is a given value + * __atomic_add_unless - add unless the number is a given value * @v: pointer to value * @a: amount to add * @u: unless value is equal to u * - * Returns 1 if the add happened, 0 if it didn't. + * Returns old value. + * */ + static inline int __atomic_add_unless(atomic_t *v, int a, int u) { - int output, __oldval; + int __oldval; + register int tmp; + asm volatile( "1: %0 = memw_locked(%2);" " {" " p3 = cmp.eq(%0, %4);" " if (p3.new) jump:nt 2f;" - " %0 = add(%0, %3);" - " %1 = #0;" + " %1 = add(%0, %3);" " }" - " memw_locked(%2, p3) = %0;" + " memw_locked(%2, p3) = %1;" " {" " if !p3 jump 1b;" - " %1 = #1;" " }" "2:" - : "=&r" (__oldval), "=&r" (output) + : "=&r" (__oldval), "=&r" (tmp) : "r" (v), "r" (a), "r" (u) : "memory", "p3" ); - return output; + return __oldval; } #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) diff --git a/arch/hexagon/include/asm/elf.h b/arch/hexagon/include/asm/elf.h index 1f14e082588e..e1b933a0e121 100644 --- a/arch/hexagon/include/asm/elf.h +++ b/arch/hexagon/include/asm/elf.h @@ -1,7 +1,7 @@ /* * ELF definitions for the Hexagon architecture * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -104,6 +104,16 @@ typedef unsigned long elf_fpregset_t; * Bypass the whole "regsets" thing for now and use the define. */ +#if CONFIG_HEXAGON_ARCH_VERSION >= 4 +#define CS_COPYREGS(DEST,REGS) \ +do {\ + DEST.cs0 = REGS->cs0;\ + DEST.cs1 = REGS->cs1;\ +} while (0) +#else +#define CS_COPYREGS(DEST,REGS) +#endif + #define ELF_CORE_COPY_REGS(DEST, REGS) \ do { \ DEST.r0 = REGS->r00; \ @@ -148,13 +158,12 @@ do { \ DEST.p3_0 = REGS->preds; \ DEST.gp = REGS->gp; \ DEST.ugp = REGS->ugp; \ - DEST.pc = pt_elr(REGS); \ + CS_COPYREGS(DEST,REGS); \ + DEST.pc = pt_elr(REGS); \ DEST.cause = pt_cause(REGS); \ DEST.badva = pt_badva(REGS); \ } while (0); - - /* * This is used to ensure we don't load something for the wrong architecture. * Checks the machine and ABI type. @@ -168,15 +177,15 @@ do { \ #define ELF_DATA ELFDATA2LSB #define ELF_ARCH EM_HEXAGON -#ifdef CONFIG_HEXAGON_ARCH_V2 +#if CONFIG_HEXAGON_ARCH_VERSION == 2 #define ELF_CORE_EFLAGS 0x1 #endif -#ifdef CONFIG_HEXAGON_ARCH_V3 +#if CONFIG_HEXAGON_ARCH_VERSION == 3 #define ELF_CORE_EFLAGS 0x2 #endif -#ifdef CONFIG_HEXAGON_ARCH_V4 +#if CONFIG_HEXAGON_ARCH_VERSION == 4 #define ELF_CORE_EFLAGS 0x3 #endif diff --git a/arch/hexagon/include/asm/hexagon_vm.h b/arch/hexagon/include/asm/hexagon_vm.h index c144bee6cabe..67bb6d6f3337 100644 --- a/arch/hexagon/include/asm/hexagon_vm.h +++ b/arch/hexagon/include/asm/hexagon_vm.h @@ -1,7 +1,7 @@ /* * Declarations for to Hexagon Virtal Machine. * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -31,10 +31,26 @@ * for tracing/debugging. */ -/* - * Lets make this stuff visible only if configured, - * so we can unconditionally include the file. - */ +#define HVM_TRAP1_VMVERSION 0 +#define HVM_TRAP1_VMRTE 1 +#define HVM_TRAP1_VMSETVEC 2 +#define HVM_TRAP1_VMSETIE 3 +#define HVM_TRAP1_VMGETIE 4 +#define HVM_TRAP1_VMINTOP 5 +#define HVM_TRAP1_VMCLRMAP 10 +#define HVM_TRAP1_VMNEWMAP 11 +#define HVM_TRAP1_FORMERLY_VMWIRE 12 +#define HVM_TRAP1_VMCACHE 13 +#define HVM_TRAP1_VMGETTIME 14 +#define HVM_TRAP1_VMSETTIME 15 +#define HVM_TRAP1_VMWAIT 16 +#define HVM_TRAP1_VMYIELD 17 +#define HVM_TRAP1_VMSTART 18 +#define HVM_TRAP1_VMSTOP 19 +#define HVM_TRAP1_VMVPID 20 +#define HVM_TRAP1_VMSETREGS 21 +#define HVM_TRAP1_VMGETREGS 22 +#define HVM_TRAP1_VMTIMEROP 24 #ifndef __ASSEMBLY__ @@ -175,31 +191,19 @@ static inline long __vmintop_clear(long i) #else /* Only assembly code should reference these */ -#define HVM_TRAP1_VMRTE 1 -#define HVM_TRAP1_VMSETVEC 2 -#define HVM_TRAP1_VMSETIE 3 -#define HVM_TRAP1_VMGETIE 4 -#define HVM_TRAP1_VMINTOP 5 -#define HVM_TRAP1_VMCLRMAP 10 -#define HVM_TRAP1_VMNEWMAP 11 -#define HVM_TRAP1_FORMERLY_VMWIRE 12 -#define HVM_TRAP1_VMCACHE 13 -#define HVM_TRAP1_VMGETTIME 14 -#define HVM_TRAP1_VMSETTIME 15 -#define HVM_TRAP1_VMWAIT 16 -#define HVM_TRAP1_VMYIELD 17 -#define HVM_TRAP1_VMSTART 18 -#define HVM_TRAP1_VMSTOP 19 -#define HVM_TRAP1_VMVPID 20 -#define HVM_TRAP1_VMSETREGS 21 -#define HVM_TRAP1_VMGETREGS 22 - #endif /* __ASSEMBLY__ */ /* * Constants for virtual instruction parameters and return values */ +/* vmnewmap arguments */ + +#define VM_TRANS_TYPE_LINEAR 0 +#define VM_TRANS_TYPE_TABLE 1 +#define VM_TLB_INVALIDATE_FALSE 0 +#define VM_TLB_INVALIDATE_TRUE 1 + /* vmsetie arguments */ #define VM_INT_DISABLE 0 @@ -224,6 +228,8 @@ static inline long __vmintop_clear(long i) #define HVM_VMEST_UM_MSK 1 #define HVM_VMEST_IE_SFT 30 #define HVM_VMEST_IE_MSK 1 +#define HVM_VMEST_SS_SFT 29 +#define HVM_VMEST_SS_MSK 1 #define HVM_VMEST_EVENTNUM_SFT 16 #define HVM_VMEST_EVENTNUM_MSK 0xff #define HVM_VMEST_CAUSE_SFT 0 @@ -260,6 +266,8 @@ static inline long __vmintop_clear(long i) #define HVM_GE_C_INVI 0x15 #define HVM_GE_C_PRIVI 0x1B #define HVM_GE_C_XMAL 0x1C +#define HVM_GE_C_WREG 0x1D +#define HVM_GE_C_PCAL 0x1E #define HVM_GE_C_RMAL 0x20 #define HVM_GE_C_WMAL 0x21 #define HVM_GE_C_RPROT 0x22 diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h index e527cfeff5ba..1b7698e19139 100644 --- a/arch/hexagon/include/asm/io.h +++ b/arch/hexagon/include/asm/io.h @@ -1,7 +1,7 @@ /* * IO definitions for the Hexagon architecture * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -40,6 +40,8 @@ #define IO_SPACE_LIMIT 0xffff #define _IO_BASE ((void __iomem *)0xfe000000) +#define IOMEM(x) ((void __force __iomem *)(x)) + extern int remap_area_pages(unsigned long start, unsigned long phys_addr, unsigned long end, unsigned long flags); @@ -176,6 +178,18 @@ static inline void writel(u32 data, volatile void __iomem *addr) #define __raw_readl readl /* + * http://comments.gmane.org/gmane.linux.ports.arm.kernel/117626 + */ + +#define readb_relaxed __raw_readb +#define readw_relaxed __raw_readw +#define readl_relaxed __raw_readl + +#define writeb_relaxed __raw_writeb +#define writew_relaxed __raw_writew +#define writel_relaxed __raw_writel + +/* * Need an mtype somewhere in here, for cache type deals? * This is probably too long for an inline. */ diff --git a/arch/hexagon/include/asm/mem-layout.h b/arch/hexagon/include/asm/mem-layout.h index af16e977c55e..60556f8c45d8 100644 --- a/arch/hexagon/include/asm/mem-layout.h +++ b/arch/hexagon/include/asm/mem-layout.h @@ -1,7 +1,7 @@ /* * Memory layout definitions for the Hexagon architecture * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -32,16 +32,25 @@ #define PAGE_OFFSET _AC(0xc0000000, UL) /* - * LOAD_ADDRESS is the physical/linear address of where in memory - * the kernel gets loaded. The 12 least significant bits must be zero (0) - * due to limitations on setting the EVB - * + * Compiling for a platform that needs a crazy physical offset + * (like if the memory starts at 1GB and up) means we need + * an actual PHYS_OFFSET. Should be set up in head.S. */ -#ifndef LOAD_ADDRESS -#define LOAD_ADDRESS 0x00000000 +#ifdef CONFIG_HEXAGON_PHYS_OFFSET +#ifndef __ASSEMBLY__ +extern unsigned long __phys_offset; +#endif +#define PHYS_OFFSET __phys_offset +#endif + +#ifndef PHYS_OFFSET +#define PHYS_OFFSET 0 #endif +#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT) +#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET + #define TASK_SIZE (PAGE_OFFSET) /* not sure how these are used yet */ @@ -55,7 +64,7 @@ enum fixed_addresses { __end_of_fixed_addresses }; -#define MIN_KERNEL_SEG 0x300 /* From 0xc0000000 */ +#define MIN_KERNEL_SEG (PAGE_OFFSET >> PGDIR_SHIFT) /* L1 shift is 22 bits */ extern int max_kernel_seg; /* @@ -63,8 +72,7 @@ extern int max_kernel_seg; * supposed to be based on the amount of physical memory available */ -#define VMALLOC_START (PAGE_OFFSET + VMALLOC_OFFSET + \ - (unsigned long)high_memory) +#define VMALLOC_START ((unsigned long) __va(high_memory + VMALLOC_OFFSET)) /* Gap between physical ram and vmalloc space for guard purposes. */ #define VMALLOC_OFFSET PAGE_SIZE diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h index 692adc213429..93f5669b4aa1 100644 --- a/arch/hexagon/include/asm/page.h +++ b/arch/hexagon/include/asm/page.h @@ -1,7 +1,7 @@ /* * Page management definitions for the Hexagon architecture * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -96,8 +96,8 @@ typedef struct page *pgtable_t; * MIPS says they're only used during mem_init. * also, check if we need a PHYS_OFFSET. */ -#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET) -#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET)) +#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) +#define __va(x) ((void *)((unsigned long)(x) - PHYS_OFFSET + PAGE_OFFSET)) /* The "page frame" descriptor is defined in linux/mm.h */ struct page; @@ -140,6 +140,11 @@ static inline void clear_page(void *page) */ #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) +#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) +#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) + +#define page_to_virt(page) __va(page_to_phys(page)) + /* * For port to Hexagon Virtual Machine, MAYBE we check for attempts * to reference reserved HVM space, but in any case, the VM will be @@ -147,6 +152,7 @@ static inline void clear_page(void *page) */ #define kern_addr_valid(addr) (1) +#include <asm/mem-layout.h> #include <asm-generic/memory_model.h> /* XXX Todo: implement assembly-optimized version of getorder. */ #include <asm-generic/getorder.h> diff --git a/arch/hexagon/include/asm/processor.h b/arch/hexagon/include/asm/processor.h index 6dd5d3706869..45a825402f63 100644 --- a/arch/hexagon/include/asm/processor.h +++ b/arch/hexagon/include/asm/processor.h @@ -1,7 +1,7 @@ /* * Process/processor support for the Hexagon architecture * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -100,12 +100,49 @@ extern unsigned long get_wchan(struct task_struct *p); */ struct hexagon_switch_stack { - unsigned long long r1716; - unsigned long long r1918; - unsigned long long r2120; - unsigned long long r2322; - unsigned long long r2524; - unsigned long long r2726; + union { + struct { + unsigned long r16; + unsigned long r17; + }; + unsigned long long r1716; + }; + union { + struct { + unsigned long r18; + unsigned long r19; + }; + unsigned long long r1918; + }; + union { + struct { + unsigned long r20; + unsigned long r21; + }; + unsigned long long r2120; + }; + union { + struct { + unsigned long r22; + unsigned long r23; + }; + unsigned long long r2322; + }; + union { + struct { + unsigned long r24; + unsigned long r25; + }; + unsigned long long r2524; + }; + union { + struct { + unsigned long r26; + unsigned long r27; + }; + unsigned long long r2726; + }; + unsigned long fp; unsigned long lr; }; diff --git a/arch/hexagon/include/asm/vm_mmu.h b/arch/hexagon/include/asm/vm_mmu.h index 9a94de7969bb..096537d8f4c5 100644 --- a/arch/hexagon/include/asm/vm_mmu.h +++ b/arch/hexagon/include/asm/vm_mmu.h @@ -1,7 +1,7 @@ /* * Hexagon VM page table entry definitions * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2011,2013 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -68,14 +68,13 @@ #define __HEXAGON_C_WB 0x0 /* Write-back, no L2 */ #define __HEXAGON_C_WT 0x1 /* Write-through, no L2 */ +#define __HEXAGON_C_UNC 0x6 /* Uncached memory */ +#if CONFIG_HEXAGON_ARCH_VERSION >= 2 #define __HEXAGON_C_DEV 0x4 /* Device register space */ -#define __HEXAGON_C_WT_L2 0x5 /* Write-through, with L2 */ -/* this really should be #if CONFIG_HEXAGON_ARCH = 2 but that's not defined */ -#if defined(CONFIG_HEXAGON_COMET) || defined(CONFIG_QDSP6_ST1) -#define __HEXAGON_C_UNC __HEXAGON_C_DEV #else -#define __HEXAGON_C_UNC 0x6 /* Uncached memory */ +#define __HEXAGON_C_DEV __HEXAGON_C_UNC #endif +#define __HEXAGON_C_WT_L2 0x5 /* Write-through, with L2 */ #define __HEXAGON_C_WB_L2 0x7 /* Write-back, with L2 */ /* diff --git a/arch/hexagon/include/uapi/asm/ptrace.h b/arch/hexagon/include/uapi/asm/ptrace.h index 1ffce0c6ee07..065e5b32313f 100644 --- a/arch/hexagon/include/uapi/asm/ptrace.h +++ b/arch/hexagon/include/uapi/asm/ptrace.h @@ -36,4 +36,9 @@ extern const char *regs_query_register_name(unsigned int offset); ((struct pt_regs *) \ ((unsigned long)current_thread_info() + THREAD_SIZE) - 1) +#if CONFIG_HEXAGON_ARCH_VERSION >= 4 +#define arch_has_single_step() (1) +#endif + + #endif diff --git a/arch/hexagon/include/uapi/asm/registers.h b/arch/hexagon/include/uapi/asm/registers.h index c20406f63b5c..487d6ceca5e7 100644 --- a/arch/hexagon/include/uapi/asm/registers.h +++ b/arch/hexagon/include/uapi/asm/registers.h @@ -57,10 +57,17 @@ struct pt_regs { }; union { struct { - unsigned long gp; unsigned long ugp; + unsigned long gp; }; - long long int ugpgp; + long long int gpugp; + }; + union { + struct { + unsigned long cs0; + unsigned long cs1; + }; + long long int cs1cs0; }; /* * Be extremely careful with rearranging these, if at all. Some code @@ -204,9 +211,11 @@ struct pt_regs { #define pt_psp(regs) ((regs)->hvmer.vmpsp) #define pt_badva(regs) ((regs)->hvmer.vmbadva) +#define pt_set_singlestep(regs) ((regs)->hvmer.vmest |= (1<<HVM_VMEST_SS_SFT)) +#define pt_clr_singlestep(regs) ((regs)->hvmer.vmest &= ~(1<<HVM_VMEST_SS_SFT)) + #define pt_set_rte_sp(regs, sp) do {\ - pt_psp(regs) = (sp);\ - (regs)->SP = (unsigned long) &((regs)->hvmer);\ + pt_psp(regs) = (regs)->SP = (sp);\ } while (0) #define pt_set_kmode(regs) \ diff --git a/arch/hexagon/include/uapi/asm/signal.h b/arch/hexagon/include/uapi/asm/signal.h index 939556817d34..98106e55ad4f 100644 --- a/arch/hexagon/include/uapi/asm/signal.h +++ b/arch/hexagon/include/uapi/asm/signal.h @@ -19,8 +19,12 @@ #ifndef _ASM_SIGNAL_H #define _ASM_SIGNAL_H +#include <uapi/asm/registers.h> + extern unsigned long __rt_sigtramp_template[2]; +void do_signal(struct pt_regs *regs); + #include <asm-generic/signal.h> #endif diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h index 4a87cc47075c..ffee405d6803 100644 --- a/arch/hexagon/include/uapi/asm/unistd.h +++ b/arch/hexagon/include/uapi/asm/unistd.h @@ -27,6 +27,9 @@ */ #define sys_mmap2 sys_mmap_pgoff +#define __ARCH_WANT_SYS_EXECVE #define __ARCH_WANT_SYS_CLONE +#define __ARCH_WANT_SYS_VFORK +#define __ARCH_WANT_SYS_FORK #include <asm-generic/unistd.h> diff --git a/arch/hexagon/include/uapi/asm/user.h b/arch/hexagon/include/uapi/asm/user.h index cef13ee1413f..3dae94d9ced7 100644 --- a/arch/hexagon/include/uapi/asm/user.h +++ b/arch/hexagon/include/uapi/asm/user.h @@ -55,9 +55,15 @@ struct user_regs_struct { unsigned long pc; unsigned long cause; unsigned long badva; +#if CONFIG_HEXAGON_ARCH_VERSION < 4 unsigned long pad1; /* pad out to 48 words total */ unsigned long pad2; /* pad out to 48 words total */ unsigned long pad3; /* pad out to 48 words total */ +#else + unsigned long cs0; + unsigned long cs1; + unsigned long pad1; /* pad out to 48 words total */ +#endif }; #endif diff --git a/arch/hexagon/kernel/Makefile b/arch/hexagon/kernel/Makefile index 6c19501b487c..29fc933a7722 100644 --- a/arch/hexagon/kernel/Makefile +++ b/arch/hexagon/kernel/Makefile @@ -1,6 +1,6 @@ extra-y := head.o vmlinux.lds -obj-$(CONFIG_SMP) += smp.o topology.o +obj-$(CONFIG_SMP) += smp.o obj-y += setup.o irq_cpu.o traps.o syscalltab.o signal.o time.o obj-y += process.o trampoline.o reset.o ptrace.o vdso.o diff --git a/arch/hexagon/kernel/asm-offsets.c b/arch/hexagon/kernel/asm-offsets.c index 2d5e84d3b00d..308be68d4fb3 100644 --- a/arch/hexagon/kernel/asm-offsets.c +++ b/arch/hexagon/kernel/asm-offsets.c @@ -5,7 +5,7 @@ * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com * Copyright (C) 2000 MIPS Technologies, Inc. * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -44,7 +44,8 @@ int main(void) COMMENT("Hexagon pt_regs definitions"); OFFSET(_PT_SYSCALL_NR, pt_regs, syscall_nr); - OFFSET(_PT_UGPGP, pt_regs, ugpgp); + OFFSET(_PT_GPUGP, pt_regs, gpugp); + OFFSET(_PT_CS1CS0, pt_regs, cs1cs0); OFFSET(_PT_R3130, pt_regs, r3130); OFFSET(_PT_R2928, pt_regs, r2928); OFFSET(_PT_R2726, pt_regs, r2726); diff --git a/arch/hexagon/kernel/dma.c b/arch/hexagon/kernel/dma.c index 65c7bdcf565e..b74f9bae31a3 100644 --- a/arch/hexagon/kernel/dma.c +++ b/arch/hexagon/kernel/dma.c @@ -1,7 +1,7 @@ /* * DMA implementation for Hexagon * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -23,12 +23,18 @@ #include <linux/genalloc.h> #include <asm/dma-mapping.h> #include <linux/module.h> +#include <asm/page.h> struct dma_map_ops *dma_ops; EXPORT_SYMBOL(dma_ops); int bad_dma_address; /* globals are automatically initialized to zero */ +static inline void *dma_addr_to_virt(dma_addr_t dma_addr) +{ + return phys_to_virt((unsigned long) dma_addr); +} + int dma_supported(struct device *dev, u64 mask) { if (mask == DMA_BIT_MASK(32)) @@ -60,6 +66,12 @@ static void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, { void *ret; + /* + * Our max_low_pfn should have been backed off by 16MB in + * mm/init.c to create DMA coherent space. Use that as the VA + * for the pool. + */ + if (coherent_pool == NULL) { coherent_pool = gen_pool_create(PAGE_SHIFT, -1); @@ -67,7 +79,7 @@ static void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, panic("Can't create %s() memory pool!", __func__); else gen_pool_add(coherent_pool, - (PAGE_OFFSET + (max_low_pfn << PAGE_SHIFT)), + pfn_to_virt(max_low_pfn), hexagon_coherent_pool_size, -1); } @@ -75,7 +87,7 @@ static void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, if (ret) { memset(ret, 0, size); - *dma_addr = (dma_addr_t) (ret - PAGE_OFFSET); + *dma_addr = (dma_addr_t) virt_to_phys(ret); } else *dma_addr = ~0; @@ -118,8 +130,8 @@ static int hexagon_map_sg(struct device *hwdev, struct scatterlist *sg, s->dma_length = s->length; - flush_dcache_range(PAGE_OFFSET + s->dma_address, - PAGE_OFFSET + s->dma_address + s->length); + flush_dcache_range(dma_addr_to_virt(s->dma_address), + dma_addr_to_virt(s->dma_address + s->length)); } return nents; @@ -149,11 +161,6 @@ static inline void dma_sync(void *addr, size_t size, } } -static inline void *dma_addr_to_virt(dma_addr_t dma_addr) -{ - return phys_to_virt((unsigned long) dma_addr); -} - /** * hexagon_map_page() - maps an address for device DMA * @dev: pointer to DMA device diff --git a/arch/hexagon/kernel/head.S b/arch/hexagon/kernel/head.S index d859402c73ba..b9b63d085db2 100644 --- a/arch/hexagon/kernel/head.S +++ b/arch/hexagon/kernel/head.S @@ -1,7 +1,7 @@ /* * Early kernel startup code for Hexagon * - * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. + * |