summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'arc-4.2-rc1' of ↵Linus Torvalds2015-07-01106-2333/+6998
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC architecture updates from Vineet Gupta: - support for HS38 cores based on ARCv2 ISA ARCv2 is the next generation ISA from Synopsys and basis for the HS3{4,6,8} families of processors which retain the traditional ARC mantra of low power and configurability and are now more performant and feature rich. HS38x is a 10 stage pipeline core which supports MMU (with huge pages) and SMP (upto 4 cores) among other features. + www.synopsys.com/dw/ipdir.php?ds=arc-hs38-processor + http://news.synopsys.com/2014-10-14-New-DesignWare-ARC-HS38-Processor-Doubles-Performance-for-Embedded-Linux-Applications + http://www.embedded.com/electronics-news/4435975/Synopsys-ARC-HS38-core-gives-2X-boost-to-Linux-based-apps - support for ARC SDP (Software Development platform): Main Board + CPU Cards = AXS101: CPU Card with ARC700 in silicon @ 700 MHz = AXS103: CPU Card with HS38x in FPGA - refactoring of ARCompact port to accomodate new ARCv2 ISA - misc updates/cleanups * tag 'arc-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: (72 commits) ARC: Fix build failures for ARCompact in linux-next after ARCv2 support ARCv2: Allow older gcc to cope with new regime of ARCv2/ARCompact support ARCv2: [vdk] dts files and defconfig for HS38 VDK ARCv2: [axs103] Support ARC SDP FPGA platform for HS38x cores ARC: [axs101] Prepare for AXS103 ARCv2: [nsim*hs*] Support simulation platforms for HS38x cores ARCv2: All bits in place, allow ARCv2 builds ARCv2: SLC: Handle explcit flush for DMA ops (w/o IO-coherency) ARCv2: STAR 9000837815 workaround hardware exclusive transactions livelock ARC: Reduce bitops lines of code using macros ARCv2: barriers arch: conditionally define smp_{mb,rmb,wmb} ARC: add smp barriers around atomics per Documentation/atomic_ops.txt ARC: add compiler barrier to LLSC based cmpxchg ARCv2: SMP: intc: IDU 2nd level intc for dynamic IRQ distribution ARCv2: SMP: clocksource: Enable Global Real Time counter ARCv2: SMP: ARConnect debug/robustness ARCv2: SMP: Support ARConnect (MCIP) for Inter-Core-Interrupts et al ARC: make plat_smp_ops weak to allow over-rides ARCv2: clocksource: Introduce 64bit local RTC counter ...
| * ARC: Fix build failures for ARCompact in linux-next after ARCv2 supportVineet Gupta2015-06-282-9/+3
| | | | | | | | | | Reported-by: Guenter Roeck <private@roeck-us.net> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: Allow older gcc to cope with new regime of ARCv2/ARCompact supportVineet Gupta2015-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | -no-ll64 is specific to ARCv2 ISA, and is obviously not supported by older ARC gcc - in this case the one hosted by linux-next sanity build service. Ensure that it doesn't get included for ISA_ARCOMPACT Reported-by: Guenter Roeck <private@roeck-us.net> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: [vdk] dts files and defconfig for HS38 VDKRuud Derwig2015-06-2510-0/+490
| | | | | | | | | | | | | | | | | | | | | | | | | | - CONFIG_ARC_UBOOT_SUPPORT to handle arguments passed in r0, r1, r2 - CONFIG_DEVTMPFS_MOUNT for mouting rootfs since it uses external cpio for rootfs Cc: Grant Likely <grant.likely@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: devicetree@vger.kernel.org Signed-off-by: Ruud Derwig <rderwig@synopsys.com> [vgupta: folded the Main baord DT files for smp/up into one] Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: [axs103] Support ARC SDP FPGA platform for HS38x coresVineet Gupta2015-06-2510-12/+720
| | | | | | | | | | | | | | Cc: Grant Likely <grant.likely@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: devicetree@vger.kernel.org Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: [axs101] Prepare for AXS103Alexey Brodkin2015-06-252-17/+21
| | | | | | | | | | | | | | | | | | | | To avoid duplicating the MB DTS file, move the MB intc entry into cpu card specific file Cc: Grant Likely <grant.likely@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: devicetree@vger.kernel.org Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: [nsim*hs*] Support simulation platforms for HS38x coresVineet Gupta2015-06-259-0/+601
| | | | | | | | | | | | | | Cc: Grant Likely <grant.likely@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: devicetree@vger.kernel.org Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: All bits in place, allow ARCv2 buildsVineet Gupta2015-06-251-5/+4
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: SLC: Handle explcit flush for DMA ops (w/o IO-coherency)Vineet Gupta2015-06-253-2/+85
| | | | | | | | | | | | | | | | | | L2 cache on ARCHS processors is called SLC (System Level Cache) For working DMA (in absence of hardware assisted IO Coherency) we need to manage SLC explicitly when buffers transition between cpu and controllers. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: STAR 9000837815 workaround hardware exclusive transactions livelockVineet Gupta2015-06-251-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A quad core SMP build could get into hardware livelock with concurrent LLOCK/SCOND. Workaround that by adding a PREFETCHW which is serialized by SCU (System Coherency Unit). It brings the cache line in Exclusive state and makes others invalidate their lines. This gives enough time for winner to complete the LLOCK/SCOND, before others can get the line back. The prefetchw in the ll/sc loop is not nice but this is the only software workaround for current version of RTL. Cc: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: Reduce bitops lines of code using macrosVineet Gupta2015-06-251-333/+144
| | | | | | | | | | | | | | No semantical changes ! Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: barriersVineet Gupta2015-06-253-4/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ARCv2 based HS38 cores are weakly ordered and thus explicit barriers for kernel proper. SMP barrier is provided by DMB instruction which also guarantees local barrier hence used as backend of smp_*mb() as well as *mb() APIs Also hookup barriers into MMIO accessors to avoid ordering issues in IO Cc: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * arch: conditionally define smp_{mb,rmb,wmb}Vineet Gupta2015-06-251-0/+25
| | | | | | | | | | | | | | | | | | | | That way arches can define the minimal versions and still #include asm-generic for defaults (vs. defining defaults in arch code) See new barrier.h in arc for usage ! Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: add smp barriers around atomics per Documentation/atomic_ops.txtVineet Gupta2015-06-254-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - arch_spin_lock/unlock were lacking the ACQUIRE/RELEASE barriers Since ARCv2 only provides load/load, store/store and all/all, we need the full barrier - LLOCK/SCOND based atomics, bitops, cmpxchg, which return modified values were lacking the explicit smp barriers. - Non LLOCK/SCOND varaints don't need the explicit barriers since that is implicity provided by the spin locks used to implement the critical section (the spin lock barriers in turn are also fixed in this commit as explained above Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: stable@vger.kernel.org Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: add compiler barrier to LLSC based cmpxchgVineet Gupta2015-06-251-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When auditing cmpxchg call sites, Chuck noted that gcc was optimizing away some of the desired LDs. | do { | new = old = *ipi_data_ptr; | new |= 1U << msg; | } while (cmpxchg(ipi_data_ptr, old, new) != old); was generating to below | 8015cef8: ld r2,[r4,0] <-- First LD | 8015cefc: bset r1,r2,r1 | | 8015cf00: llock r3,[r4] <-- atomic op | 8015cf04: brne r3,r2,8015cf10 | 8015cf08: scond r1,[r4] | 8015cf0c: bnz 8015cf00 | | 8015cf10: brne r3,r2,8015cf00 <-- Branch doesn't go to orig LD Although this was fixed by adding a ACCESS_ONCE in this call site, it seems safer (for now at least) to add compiler barrier to LLSC based cmpxchg Reported-by: Chuck Jordan <cjordan@synopsys,com> Cc: <stable@vger.kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: SMP: intc: IDU 2nd level intc for dynamic IRQ distributionVineet Gupta2015-06-222-1/+228
| | | | | | | | | | | | Cc: Jason Cooper <jason@lakedaemon.net> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: SMP: clocksource: Enable Global Real Time counterVineet Gupta2015-06-224-0/+56
| | | | | | | | | | | | Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: SMP: ARConnect debug/robustnessVineet Gupta2015-06-223-11/+72
| | | | | | | | | | | | | | - Handle possible interrupt coalescing from MCIP - chk if prev IPI ack before sending new Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: SMP: Support ARConnect (MCIP) for Inter-Core-Interrupts et alVineet Gupta2015-06-227-8/+230
| | | | | | | | | | | | Cc: Jason Cooper <jason@lakedaemon.net> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: make plat_smp_ops weak to allow over-ridesVineet Gupta2015-06-221-1/+1
| | | | | | | | | | | | | | | | This allows platforms to provide their own cpu wakeup routines as well as IPI send / clear backends, while allowing a SMP kernel w/o any such backend to build/boot Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: clocksource: Introduce 64bit local RTC counterVineet Gupta2015-06-223-2/+62
| | | | | | | | | | | | Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: extable: Enable sorting at build timeVineet Gupta2015-06-221-0/+5
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: Adhere to Zero Delay loop restrictionVineet Gupta2015-06-223-15/+41
| | | | | | | | | | | | Branch insn can't be scheduled as last insn of Zero Overhead loop Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: optimised string/mem lib routinesClaudiu Zissulescu2015-06-224-2/+411
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: MMUv4: support aliasing icache configVineet Gupta2015-06-222-4/+14
| | | | | | | | | | | | This is also default for AXS103 release Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: MMUv4: cache programming model changesVineet Gupta2015-06-224-18/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Caveats about cache flush on ARCv2 based cores - dcache is PIPT so paddr is sufficient for cache maintenance ops (no need to setup PTAG reg - icache is still VIPT but only aliasing configs need PTAG setup So basically this is departure from MMU-v3 which always need vaddr in line ops registers (DC_IVDL, DC_FLDL, IC_IVIL) but paddr in DC_PTAG, IC_PTAG respectively. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: MMUv4: TLB programming Model changesVineet Gupta2015-06-226-5/+114
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: STAR 9000814690: Really Re-enable interrupts to avoid deadlocksVineet Gupta2015-06-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue was, on HS when interrupt is taken, IRQ_ACT is set and that is NOT cleared unless we do RTIE (or manually clear it). Linux interrupt handling has top and bottom halves. Latter lead to softirqs (which can reschedule) AND expect interrupts to be REALLY re-enabled which was NOT happening for us since we only SETI, dont clear IRQ_ACT So we can have a state when both cores have taken interrupt (IRQ_ACT set), get rescheduled, both send IPI and wait in CSD lock which will never be cleared as cores can't take the pending IPI IRQ due to existing IRQ_ACT set. So local_irq_enable() now drops the IRQ_ACT.act bit to re-enable IRQs. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: STAR 9000808988: signals involving Delay SlotVineet Gupta2015-06-222-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Anton as LTP:munmap01 failing with Illegal Instruction Exception. --------------------->8-------------------------------------- mmap2(NULL, 24576, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0x200d2000 munmap(0x200d2000, 24576) = 0 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x200d2000} --- potentially unexpected fatal signal 4. Path: /munmap01 CPU: 0 PID: 61 Comm: munmap01 Not tainted 3.13.0-g5d5c46d9a556 #8 task: 9f1a8000 ti: 9f154000 task.ti: 9f154000 [ECR ]: 0x00020100 => Illegal Insn [EFA ]: 0x0001354c [BLINK ]: 0x200515d4 [ERET ]: 0x1354c @off 0x1354c in [/munmap01] VMA: 0x00010000 to 0x00018000 [STAT32]: 0x800802c0 ... --------------------->8-------------------------------------- The issue was 1. munmap01 accessed unmapped memory (on purpose) with signal handler installed for SIGSEGV 2. The faulting instruction happened to be in Delay Slot 00011864 <main>: 11908: bl.d 13284 <tst_resm> 1190c: stb r16,[r2] 3. kernel sets up the reg file for signal handler and correctly clears the DE bit in pt_regs->status32 placeholder 4. However RESTORE_CALLEE_SAVED_USER macro is not adjusted for ARCv2, and it over-writes the above with orig/stale value of status32 5. After RTIE, userspace signal handler executes a non branch instruction with DE bit set, triggering Illegal Instruction Exception. Reported-by: Anton Kolesov <akolesov@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: STAR 9000793984: Handle return from intr to Delay SlotVineet Gupta2015-06-223-0/+53
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: Support for ARCv2 ISA and HS38x coresVineet Gupta2015-06-2222-33/+737
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The notable features are: - SMP configurations of upto 4 cores with coherency - Optional L2 Cache and IO-Coherency - Revised Interrupt Architecture (multiple priorites, reg banks, auto stack switch, auto regfile save/restore) - MMUv4 (PIPT dcache, Huge Pages) - Instructions for * 64bit load/store: LDD, STD * Hardware assisted divide/remainder: DIV, REM * Function prologue/epilogue: ENTER_S, LEAVE_S * IRQ enable/disable: CLRI, SETI * pop count: FFS, FLS * SETcc, BMSKN, XBFU... Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARCv2: [intc] HS38 core interrupt controllerVineet Gupta2015-06-224-0/+282
| | | | | | | | | | | | Cc: Jason Cooper <jason@lakedaemon.net> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: uncached base is hard constant for ARC, don't save itVineet Gupta2015-06-222-3/+2
| | | | | | | | | | | | | | ioremap already uses the hard define, just make sure BCR value matches that Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: intc: split into ARCompact ISA specific, common bitsVineet Gupta2015-06-197-379/+412
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: Make way for pt_regs != user_regs_structVineet Gupta2015-06-192-9/+137
| | | | | | | | | | | | | | | | | | These have been register compatible so far. However ARCv2 mandates different pt_regs layout (due to h/w auto save). To keep pt_regs same for both, we start by removing the assumption - used mainly for block copies between the 2 structs in signal handling and ptrace Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: [arcompact] simplify SWITCH_TO_KERNEL_STKVineet Gupta2015-06-191-36/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously this macro was overloaded with stack switching, saving SP at right slot in pt_regs, saving/setup of r25 and setting SP baseline to where pt_regs->sp is saved (vs. bottom of pt_regs) Now it only does SP switch, and leaves SP pointing to bottom of pt_regs. r25 saving is no longer done here to allow for future reordering of regfile in pt_regs w/o touching this macro Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: use single EXCEPTION_PROLOGUEVineet Gupta2015-06-191-8/+6
| | | | | | | | | | | | | | Returning from pure kernel mode and exception mode use the same code anyways. Remove one the duplicate blocks Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: micro-optimize Trap handlerVineet Gupta2015-06-192-4/+5
| | | | | | | | | | | | | | | | | | | | | | Elide the need to re-read ECR in Trap handler by ensuring that EXCEPTION_PROLOGUE does that at the very end just before returning to Trap handler ARCv2 EXCEPTION_PROLOGUE already did that, so same for ARcompact and the common trap handler adjusted to use cached ECR Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: move some code around for cache locality in return pathVineet Gupta2015-06-192-48/+52
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: split into ARCompact ISA specific, common bitsVineet Gupta2015-06-195-681/+711
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: Ensure that restore_regs is local to compilation unitVineet Gupta2015-06-191-4/+4
| | | | | | | | | | | | | | | | | | This fixes the possible link/relo errors, since restore_regs will be provided by ISA code, but called from ARC common code. The .L prefix reassures binutils that it will be in same compilation unit. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: comments cleanupVineet Gupta2015-06-191-26/+20
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: Trap handler to use r10 for syscall vs. brkpt decisionVineet Gupta2015-06-191-2/+2
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: FAKE_RET_FROM_EXCPN can always use r9Vineet Gupta2015-06-192-21/+19
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: confine EXCEPTION_* macros to one fileVineet Gupta2015-06-192-15/+17
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: canonical'ize EXCEPTION_{PROLOGUE,EPILOGUE}Vineet Gupta2015-06-192-18/+3
| | | | | | | | | | | | | | -EXCEPTION_EPILOGUE introduced -EXCEPTION_PROLOGUE now also includes reg file saving Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: Introduce INTERRUPT_{PROLOGUE,EPILOGUE}Vineet Gupta2015-06-193-79/+23
| | | | | | | | | | | | -common'ize macros for level 1 and level 2 interrupts Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: entry.S: common'ize scrtach reg freeup in intr + exceptionsVineet Gupta2015-06-192-27/+18
| | | | | | | | Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: untangle cache flush loopVineet Gupta2015-06-191-25/+55
| | | | | | | | | | | | | | - Remove the ifdef'ery and write distinct versions for each mmu ver even if there is some code duplication Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
| * ARC: cacheflush: No need to retain DC_CTRL from __before_dc_op()Vineet Gupta2015-06-191-20/+19
| | | | | | | | | | | | | | | | | | That is because __after_dc_op() already reads it for status check, so it is better anyways to use that "newer" value. Also reduces the clutter in callers for passing from/to these routines. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
OpenPOWER on IntegriCloud