diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 09df2608f40a9c3dc73220abf96e177b5ade447f..fbc5c78c9ac75de0eafdae726b8bc061c73afcce 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -28,6 +28,7 @@ config HEXAGON select GENERIC_CLOCKEVENTS_BROADCAST select MODULES_USE_ELF_RELA select GENERIC_CPU_DEVICES + select HAVE_DMA_ATTRS ---help--- Qualcomm Hexagon is a processor architecture designed for high performance and low power across a wide variety of applications. diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild index eadcc118f9506d8fbfddfd5b0dc7e65c6f3f9673..0e69796b58c763d83e5b5eb99ed19cdfb951b9eb 100644 --- a/arch/hexagon/include/asm/Kbuild +++ b/arch/hexagon/include/asm/Kbuild @@ -41,6 +41,7 @@ generic-y += scatterlist.h generic-y += sections.h generic-y += segment.h generic-y += sembuf.h +generic-y += serial.h generic-y += shmbuf.h generic-y += shmparam.h generic-y += siginfo.h @@ -56,4 +57,5 @@ generic-y += trace_clock.h generic-y += types.h generic-y += ucontext.h generic-y += unaligned.h +generic-y += vga.h generic-y += xor.h diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h index 7aae4cb2a29a217a82b3ac482bfe7a1ea079327a..17dc63780c0695ec36d958bd753820d5ae36797a 100644 --- a/arch/hexagon/include/asm/atomic.h +++ b/arch/hexagon/include/asm/atomic.h @@ -26,7 +26,20 @@ #include #define ATOMIC_INIT(i) { (i) } -#define atomic_set(v, i) ((v)->counter = (i)) + +/* Normal writes in our arch don't clear lock reservations */ + +static inline void atomic_set(atomic_t *v, int new) +{ + asm volatile( + "1: r6 = memw_locked(%0);\n" + " memw_locked(%0,p0) = %1;\n" + " if (!P0) jump 1b;\n" + : + : "r" (&v->counter), "r" (new) + : "memory", "p0", "r6" + ); +} /** * atomic_read - reads a word, atomically diff --git a/arch/hexagon/include/asm/delay.h b/arch/hexagon/include/asm/delay.h index 53079719d6678d4105437986a371f901966a4c39..8933b9b1a3bfd39dc092f7941f5d9d8f9b235f20 100644 --- a/arch/hexagon/include/asm/delay.h +++ b/arch/hexagon/include/asm/delay.h @@ -21,6 +21,7 @@ #include +extern void __delay(unsigned long cycles); extern void __udelay(unsigned long usecs); #define udelay(usecs) __udelay((usecs)) diff --git a/arch/hexagon/include/asm/dma-mapping.h b/arch/hexagon/include/asm/dma-mapping.h index 85e9935660cbaf70626f61bda3e6a4a3f60cc0ef..16965427f6b4827d1b9807fe98248f80540e910b 100644 --- a/arch/hexagon/include/asm/dma-mapping.h +++ b/arch/hexagon/include/asm/dma-mapping.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/hexagon/include/asm/elf.h b/arch/hexagon/include/asm/elf.h index e1b933a0e121ee92c38d48d93044a431a8d33bd0..80311e7b8ca601c7352be572ad138cab19ed360c 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-2012, 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 @@ -202,7 +202,7 @@ do { \ #define CORE_DUMP_USE_REGSET /* Hrm is this going to cause problems for changing PAGE_SIZE? */ -#define ELF_EXEC_PAGESIZE 4096 +#define ELF_EXEC_PAGESIZE PAGE_SIZE /* * This is the location that an ET_DYN program is loaded if exec'ed. Typical diff --git a/arch/hexagon/include/asm/hexagon_vm.h b/arch/hexagon/include/asm/hexagon_vm.h index 67bb6d6f33372392635e617827ed44e82b3c5188..1f6918b428dec4a520d44a9ca88cbc3969604457 100644 --- a/arch/hexagon/include/asm/hexagon_vm.h +++ b/arch/hexagon/include/asm/hexagon_vm.h @@ -55,27 +55,27 @@ #ifndef __ASSEMBLY__ enum VM_CACHE_OPS { - ickill, - dckill, - l2kill, - dccleaninva, - icinva, - idsync, - fetch_cfg + hvmc_ickill, + hvmc_dckill, + hvmc_l2kill, + hvmc_dccleaninva, + hvmc_icinva, + hvmc_idsync, + hvmc_fetch_cfg }; enum VM_INT_OPS { - nop, - globen, - globdis, - locen, - locdis, - affinity, - get, - peek, - status, - post, - clear + hvmi_nop, + hvmi_globen, + hvmi_globdis, + hvmi_locen, + hvmi_locdis, + hvmi_affinity, + hvmi_get, + hvmi_peek, + hvmi_status, + hvmi_post, + hvmi_clear }; extern void _K_VM_event_vector(void); @@ -98,95 +98,95 @@ long __vmvpid(void); static inline long __vmcache_ickill(void) { - return __vmcache(ickill, 0, 0); + return __vmcache(hvmc_ickill, 0, 0); } static inline long __vmcache_dckill(void) { - return __vmcache(dckill, 0, 0); + return __vmcache(hvmc_dckill, 0, 0); } static inline long __vmcache_l2kill(void) { - return __vmcache(l2kill, 0, 0); + return __vmcache(hvmc_l2kill, 0, 0); } static inline long __vmcache_dccleaninva(unsigned long addr, unsigned long len) { - return __vmcache(dccleaninva, addr, len); + return __vmcache(hvmc_dccleaninva, addr, len); } static inline long __vmcache_icinva(unsigned long addr, unsigned long len) { - return __vmcache(icinva, addr, len); + return __vmcache(hvmc_icinva, addr, len); } static inline long __vmcache_idsync(unsigned long addr, unsigned long len) { - return __vmcache(idsync, addr, len); + return __vmcache(hvmc_idsync, addr, len); } static inline long __vmcache_fetch_cfg(unsigned long val) { - return __vmcache(fetch_cfg, val, 0); + return __vmcache(hvmc_fetch_cfg, val, 0); } /* interrupt operations */ static inline long __vmintop_nop(void) { - return __vmintop(nop, 0, 0, 0, 0); + return __vmintop(hvmi_nop, 0, 0, 0, 0); } static inline long __vmintop_globen(long i) { - return __vmintop(globen, i, 0, 0, 0); + return __vmintop(hvmi_globen, i, 0, 0, 0); } static inline long __vmintop_globdis(long i) { - return __vmintop(globdis, i, 0, 0, 0); + return __vmintop(hvmi_globdis, i, 0, 0, 0); } static inline long __vmintop_locen(long i) { - return __vmintop(locen, i, 0, 0, 0); + return __vmintop(hvmi_locen, i, 0, 0, 0); } static inline long __vmintop_locdis(long i) { - return __vmintop(locdis, i, 0, 0, 0); + return __vmintop(hvmi_locdis, i, 0, 0, 0); } static inline long __vmintop_affinity(long i, long cpu) { - return __vmintop(locdis, i, cpu, 0, 0); + return __vmintop(hvmi_affinity, i, cpu, 0, 0); } static inline long __vmintop_get(void) { - return __vmintop(get, 0, 0, 0, 0); + return __vmintop(hvmi_get, 0, 0, 0, 0); } static inline long __vmintop_peek(void) { - return __vmintop(peek, 0, 0, 0, 0); + return __vmintop(hvmi_peek, 0, 0, 0, 0); } static inline long __vmintop_status(long i) { - return __vmintop(status, i, 0, 0, 0); + return __vmintop(hvmi_status, i, 0, 0, 0); } static inline long __vmintop_post(long i) { - return __vmintop(post, i, 0, 0, 0); + return __vmintop(hvmi_post, i, 0, 0, 0); } static inline long __vmintop_clear(long i) { - return __vmintop(clear, i, 0, 0, 0); + return __vmintop(hvmi_clear, i, 0, 0, 0); } #else /* Only assembly code should reference these */ diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h index 1b7698e19139000d235fbb1f71674b21b538aa48..70298996e9b2cbb69a4e05d863ce0c7fec6f90c2 100644 --- a/arch/hexagon/include/asm/io.h +++ b/arch/hexagon/include/asm/io.h @@ -189,6 +189,8 @@ static inline void writel(u32 data, volatile void __iomem *addr) #define writew_relaxed __raw_writew #define writel_relaxed __raw_writel +#define mmiowb() + /* * 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/kgdb.h b/arch/hexagon/include/asm/kgdb.h index 32a6fb66944a96e889a2b861d0f461b3a115d332..ccd3ac336b24387141ed446ce0c4302032a4b696 100644 --- a/arch/hexagon/include/asm/kgdb.h +++ b/arch/hexagon/include/asm/kgdb.h @@ -34,10 +34,11 @@ static inline void arch_kgdb_breakpoint(void) * 32 gpr + sa0/1 + lc0/1 + m0/1 + gp + ugp + pred + pc = 42 total. * vm regs = psp+elr+est+badva = 4 * syscall+restart = 2 more - * so 48 = 42 +4 + 2 + * also add cs0/1 = 2 + * so 48 = 42 + 4 + 2 + 2 */ #define DBG_USER_REGS 42 -#define DBG_MAX_REG_NUM (DBG_USER_REGS + 6) +#define DBG_MAX_REG_NUM (DBG_USER_REGS + 8) #define NUMREGBYTES (DBG_MAX_REG_NUM*4) #endif /* __HEXAGON_KGDB_H__ */ diff --git a/arch/hexagon/include/asm/pgalloc.h b/arch/hexagon/include/asm/pgalloc.h index 4c9d382d7798e6640f52034f5e713a025a7bdab8..77da3b0ae3c2b2c37636f4f0e8dc3ee296e80268 100644 --- a/arch/hexagon/include/asm/pgalloc.h +++ b/arch/hexagon/include/asm/pgalloc.h @@ -45,7 +45,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) * map with a copy of the kernel's persistent map. */ - memcpy(pgd, swapper_pg_dir, PTRS_PER_PGD*sizeof(pgd_t *)); + memcpy(pgd, swapper_pg_dir, PTRS_PER_PGD*sizeof(pgd_t)); mm->context.generation = kmap_generation; /* Physical version is what is passed to virtual machine on switch */ diff --git a/arch/hexagon/include/asm/smp.h b/arch/hexagon/include/asm/smp.h index 2b9b974e09522bcbaac7e0e4deac5935694d31e0..ca171c13891d2c3ec449726916fff899ae867586 100644 --- a/arch/hexagon/include/asm/smp.h +++ b/arch/hexagon/include/asm/smp.h @@ -29,7 +29,6 @@ enum ipi_message_type { IPI_NOP = 0, IPI_RESCHEDULE = 1, IPI_CALL_FUNC, - IPI_CALL_FUNC_SINGLE, IPI_CPU_STOP, IPI_TIMER, }; diff --git a/arch/hexagon/include/uapi/asm/registers.h b/arch/hexagon/include/uapi/asm/registers.h index 487d6ceca5e7d407a69bd5c126c1f340bed10fb5..e7be31840a90330d2abc472eceece6e3d15926df 100644 --- a/arch/hexagon/include/uapi/asm/registers.h +++ b/arch/hexagon/include/uapi/asm/registers.h @@ -6,8 +6,6 @@ #ifndef _ASM_REGISTERS_H #define _ASM_REGISTERS_H -#define SP r29 - #ifndef __ASSEMBLY__ /* See kernel/entry.S for further documentation. */ @@ -215,7 +213,7 @@ struct pt_regs { #define pt_clr_singlestep(regs) ((regs)->hvmer.vmest &= ~(1<SP = (sp);\ + pt_psp(regs) = (regs)->r29 = (sp);\ } while (0) #define pt_set_kmode(regs) \ diff --git a/arch/hexagon/include/uapi/asm/setup.h b/arch/hexagon/include/uapi/asm/setup.h index e48285e4af967241e896e5940ea5bf013551b908..7e3952d6221cdf68ac4abf87275dc5d1b9496d2b 100644 --- a/arch/hexagon/include/uapi/asm/setup.h +++ b/arch/hexagon/include/uapi/asm/setup.h @@ -19,7 +19,12 @@ #ifndef _ASM_SETUP_H #define _ASM_SETUP_H +#ifdef __KERNEL__ #include +#else +#define __init +#endif + #include extern char external_cmdline_buffer; diff --git a/arch/hexagon/kernel/Makefile b/arch/hexagon/kernel/Makefile index 29fc933a77225694b53f34770849b7d1b9d8cf99..009228b8611ca0483f221250d6c57c56ce341b87 100644 --- a/arch/hexagon/kernel/Makefile +++ b/arch/hexagon/kernel/Makefile @@ -15,3 +15,5 @@ obj-y += vm_vectors.o obj-$(CONFIG_HAS_DMA) += dma.o obj-$(CONFIG_STACKTRACE) += stacktrace.o + +obj-$(CONFIG_VGA_CONSOLE) += screen_info.o diff --git a/arch/hexagon/kernel/hexagon_ksyms.c b/arch/hexagon/kernel/hexagon_ksyms.c index 32b1379d68772a7077929d6bb95f7ea09590458b..c041d8ecb1e2fd9f4b7b45035627968980488bde 100644 --- a/arch/hexagon/kernel/hexagon_ksyms.c +++ b/arch/hexagon/kernel/hexagon_ksyms.c @@ -18,23 +18,39 @@ * 02110-1301, USA. */ +#include #include +#include #include +/* Additional functions */ +EXPORT_SYMBOL(__clear_user_hexagon); EXPORT_SYMBOL(__copy_from_user_hexagon); EXPORT_SYMBOL(__copy_to_user_hexagon); +EXPORT_SYMBOL(__iounmap); +EXPORT_SYMBOL(__strnlen_user); EXPORT_SYMBOL(__vmgetie); EXPORT_SYMBOL(__vmsetie); +EXPORT_SYMBOL(__vmyield); +EXPORT_SYMBOL(empty_zero_page); +EXPORT_SYMBOL(ioremap_nocache); EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memset); +/* Additional variables */ +EXPORT_SYMBOL(__phys_offset); +EXPORT_SYMBOL(_dflt_cache_att); +EXPORT_SYMBOL(bad_dma_address); + #define DECLARE_EXPORT(name) \ extern void name(void); EXPORT_SYMBOL(name) /* Symbols found in libgcc that assorted kernel modules need */ DECLARE_EXPORT(__hexagon_memcpy_likely_aligned_min32bytes_mult8bytes); -DECLARE_EXPORT(__hexagon_divsi3); -DECLARE_EXPORT(__hexagon_modsi3); -DECLARE_EXPORT(__hexagon_udivsi3); -DECLARE_EXPORT(__hexagon_umodsi3); +/* Additional functions */ +DECLARE_EXPORT(__divsi3); +DECLARE_EXPORT(__modsi3); +DECLARE_EXPORT(__udivsi3); +DECLARE_EXPORT(__umodsi3); +DECLARE_EXPORT(csum_tcpudp_magic); diff --git a/arch/hexagon/kernel/kgdb.c b/arch/hexagon/kernel/kgdb.c index 82d5c2593323ed420ac6b9af62309d85a032e355..038580cc5abfa09cbfbbe9c6eee3b6f81a15dc27 100644 --- a/arch/hexagon/kernel/kgdb.c +++ b/arch/hexagon/kernel/kgdb.c @@ -18,6 +18,8 @@ * 02110-1301, USA. */ +#include +#include #include #include diff --git a/arch/hexagon/kernel/ptrace.c b/arch/hexagon/kernel/ptrace.c index de829eb7f1858f948ac54c7fcbae0c8c91aa6e53..390a9ad14ca15fa9d08b90fe76115ed90ebfeb71 100644 --- a/arch/hexagon/kernel/ptrace.c +++ b/arch/hexagon/kernel/ptrace.c @@ -183,6 +183,7 @@ static const struct user_regset_view hexagon_user_view = { .e_machine = ELF_ARCH, .ei_osabi = ELF_OSABI, .regsets = hexagon_regsets, + .e_flags = ELF_CORE_EFLAGS, .n = ARRAY_SIZE(hexagon_regsets) }; diff --git a/arch/hexagon/kernel/reset.c b/arch/hexagon/kernel/reset.c index 6aeabc962b3b41348ea84e55970d4b2db67cd25d..76483c10130d653e8ecc6c287ec1c56e33099e36 100644 --- a/arch/hexagon/kernel/reset.c +++ b/arch/hexagon/kernel/reset.c @@ -33,6 +33,5 @@ void machine_restart(char *cmd) { } -void pm_power_off(void) -{ -} +void (*pm_power_off)(void) = NULL; +EXPORT_SYMBOL(pm_power_off); diff --git a/arch/hexagon/kernel/screen_info.c b/arch/hexagon/kernel/screen_info.c new file mode 100644 index 0000000000000000000000000000000000000000..1e1ceb18bafe7476770cba5bbfd65fb05f6a5ef5 --- /dev/null +++ b/arch/hexagon/kernel/screen_info.c @@ -0,0 +1,3 @@ +#include + +struct screen_info screen_info; diff --git a/arch/hexagon/kernel/smp.c b/arch/hexagon/kernel/smp.c index 9faaa940452b98ad0f10ecd695af138133e990a6..ff759f26b96aef8cbffbfc9c860aa7f2966ff27b 100644 --- a/arch/hexagon/kernel/smp.c +++ b/arch/hexagon/kernel/smp.c @@ -64,10 +64,6 @@ static inline void __handle_ipi(unsigned long *ops, struct ipi_data *ipi, generic_smp_call_function_interrupt(); break; - case IPI_CALL_FUNC_SINGLE: - generic_smp_call_function_single_interrupt(); - break; - case IPI_CPU_STOP: /* * call vmstop() @@ -248,7 +244,7 @@ void smp_send_stop(void) void arch_send_call_function_single_ipi(int cpu) { - send_ipi(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); + send_ipi(cpumask_of(cpu), IPI_CALL_FUNC); } void arch_send_call_function_ipi_mask(const struct cpumask *mask) diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c index 9903fad997f3e2dc210b85905e832d268df31b5b..17fbf45bf1502ad4c7212346e9333b95d2914937 100644 --- a/arch/hexagon/kernel/time.c +++ b/arch/hexagon/kernel/time.c @@ -191,9 +191,6 @@ void __init time_init_deferred(void) { struct resource *resource = NULL; struct clock_event_device *ce_dev = &hexagon_clockevent_dev; - struct device_node *dn; - struct resource r; - int err; ce_dev->cpumask = cpu_all_mask; @@ -232,6 +229,15 @@ void __init time_init(void) late_time_init = time_init_deferred; } +void __delay(unsigned long cycles) +{ + unsigned long long start = __vmgettime(); + + while ((__vmgettime() - start) < cycles) + cpu_relax(); +} +EXPORT_SYMBOL(__delay); + /* * This could become parametric or perhaps even computed at run-time, * but for now we take the observed simulator jitter.