aboutsummaryrefslogtreecommitdiff
path: root/arch/arc/include
AgeCommit message (Collapse)AuthorFilesLines
2013-03-20ARC: Fix the typo in event identifier flags used by ptraceVineet Gupta2-2/+2
orig_r8_IS_EXCPN and orig_r8_IS_BRKPT were same values due to a copy/paste error. Although it looks bad and is wrong, it really doesn't affect gdb working. orig_r8_IS_BRKPT is the one relevant to debugging (breakpoints), since it is used to provide EFA vs. ERET to a ptrace "stop_pc" request. So when gdb has inserted a breakpoint, orig_r8_IS_BRKPT is already set, and anything else (i.e. orig_r8_IS_EXCPN) becoming same as it, really doesn't hurt gdb. The corollary case, could be nasty but nobody uses the ptrace "stop_pc" request in that case Signed-off-by: Vineet Gupta <[email protected]>
2013-03-19arc: fix dma_address assignment during dma_map_sg()Pierrick Hascoet1-1/+1
Signed-off-by: Pierrick Hascoet <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2013-03-18ARC: Remove SET_PERSONALITY (tracks cross-arch change)Vineet Gupta1-3/+0
Tracks commit e72837e3e7b "default SET_PERSONALITY() in linux/elf.h" Signed-off-by: Vineet Gupta <[email protected]>
2013-03-11ARC: ABIv3: fork/vfork wrappers not needed in "no-legacy-syscall" ABIVineet Gupta1-2/+0
When switching to clone() only ABI - I missed out pruning the low level asm syscall wrappers Signed-off-by: Vineet Gupta <[email protected]>
2013-03-11ARC: make allyesconfig build breakagesVineet Gupta2-6/+4
CC drivers/mmc/host/mmc_spi.o drivers/mmc/host/mmc_spi.c:118: error: redefinition of 'struct scratch' make[3]: *** [drivers/mmc/host/mmc_spi.o] Error 1 make[2]: *** [drivers/mmc/host] Error 2 make[1]: *** [drivers/mmc] Error 2 make: *** [drivers] Error 2 CC arch/arc/kernel/kgdb.o In file included from include/linux/kgdb.h:20, from arch/arc/kernel/kgdb.c:11: /home/vineetg/arc/k.org/arc-port/arch/arc/include/asm/kgdb.h:34: warning: 'struct pt_regs' declared inside parameter list /home/vineetg/arc/k.org/arc-port/arch/arc/include/asm/kgdb.h:34: warning: its scope is only this definition or declaration, which is probably not what you want arch/arc/kernel/kgdb.c:172: error: conflicting types for 'kgdb_trap' CC arch/arc/kernel/kgdb.o arch/arc/kernel/kgdb.c: In function 'pt_regs_to_gdb_regs': arch/arc/kernel/kgdb.c:62: error: dereferencing pointer to incomplete type Signed-off-by: Vineet Gupta <[email protected]>
2013-02-27ARC: split elf.h into uapi and export it for userspaceVineet Gupta3-26/+38
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-27ARC: Fixup the current ABI versionVineet Gupta1-1/+1
The upstream kernel ABI (v3) is different from current out-of-tree (v2): * no-legacy-syscalls * user_regs_struct layout has changed So we rev up the ABI version Signed-off-by: Vineet Gupta <[email protected]>
2013-02-27ARC: gdbserver using regset interface possibly brokenVineet Gupta1-5/+1
ptrace regset interface relies on ELF_NGREG for ceiling the size of user request. So any larger request (even if legit) would be clipped. The existing def of ELF_NGREG didn't use user_regs_struct and was technically one placeholder short (stop_pc) - although the current code would still work because pt_regs includes a bunch of extra fields, making ELF_NGREG >= sizeof(struct user_regs_struct)/sizeof(long) But we need to remove this ambiguity, specially since pt_regs should NOT be directly associated with with anything userspace-ish. Signed-off-by: Vineet Gupta <[email protected]>
2013-02-26ARC: make a copy of flat DTVineet Gupta1-0/+2
The flat DT (currently embedded in vmlinux) is in .init section. The unflattened/binary tree doesn't copy strings through and references them from orig flat DT - which could cause catestrohpy if of_* APIs are called post init, say from a driver which is a loadable module. Reported-by: James Hogan <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: Provide a default serial.h for uart drivers needing BASE_BAUDVineet Gupta1-0/+25
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: [Review] Multi-platform image #7: SMP common code to use callbacksVineet Gupta1-21/+15
This again is for switch from singleton platform SMP API to multi-platform paradigm Platform code is not yet setup to populate the callbacks, that happens in next commit Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2013-02-15ARC: [Review] Multi-platform image #6: cpu-to-dma-addr optionalVineet Gupta1-0/+16
All the current platforms can work with 0x8000_0000 based dma_addr_t since the Bus Bridges typically ignore the top bit (the only excpetion was Angel4 PCI-AHB bridge which we no longer care for). That way we don't need plat-specific cpu-addr to bus-addr conversion. Hooks still provided - just in case a platform has an obscure device which say needs 0 based bus address. That way <asm/dma_mapping.h> no longer needs to unconditinally include <plat/dma_addr.h> Also verfied that on Angel4 board, other peripherals (IDE-disk / EMAC) work fine with 0x8000_0000 based dma addresses. Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2013-02-15ARC: [Review] Multi-platform image #5: NR_IRQS defined by ARC coreVineet Gupta1-0/+2
For now this will suffice for all platforms, later exotic ones needs to get this from DeviceTree Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]>
2013-02-15ARC: [Review] Multi-platform image #4: Isolate platform headersVineet Gupta1-1/+0
-Top level ARC makefile removes -I for platform headers -asm/irq.h no longer includes plat/irq.h -platform makefile adds -I for it's specfic platform headers -platform code to directly include it's plat/irq.h -Linker script needed plat/memmap.h for CCM info, already in .config Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2013-02-15ARC: [Review] Multi-platform image #3: switch to board callbackVineet Gupta2-6/+0
-platform API is retired and instead callbacks are used Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2013-02-15ARC: [Review] Multi-platform image #2: Board callback InfrastructureVineet Gupta2-1/+85
The orig platform code orgnaization was singleton design pattern - only one platform (and board thereof) would build at a time. Thus any platform/board specific code (e.g. irq init, early init ...) expected by ARC common code was exported as well defined set of APIs, with only ONE instance building ever. Now with multiple-platform build requirement, that design of code no longer holds - multiple board specific calls need to build at the same time - so ARC common code can't use the API approach, it needs a callback based design where each board registers it's specific set of functions, and at runtime, depending on board detection, the callbacks are used from the registry. This commit adds all the infrastructure, where board specific callbacks are specified as a "maThine description". All the hooks are placed in right spots, no board callbacks registered yet (with MACHINE_STARt/END constructs) so the hooks will not run. Next commit will actually convert the platform to this infrastructure. Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2013-02-15ARC: Add support for ioremap_prot APIGilad Ben-Yossef2-0/+5
Implement ioremap_prot() to allow mapping IO memory with variable protection via TLB. Implementing this allows the /dev/mem driver to use its generic access() VMA callback, which in turn allows ptrace to examine data in memory mapped regions mapped via /dev/mem, such as Arc DCCM. The end result is that it is possible to examine values of variables placed into DCCM in user space programs via GDB. CC: Alexey Brodkin <[email protected]> CC: Noam Camus <[email protected]> Acked-by: Vineet Gupta <[email protected]> Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: UAPI Disintegrate arch/arc/include/asmVineet Gupta14-75/+108
1. ./genfilelist.pl arch/arc/include/asm/ 2. Create arch/arc/include/uapi/asm/Kbuild as follows +# UAPI Header export list +include include/uapi/asm-generic/Kbuild.asm 3. ./disintegrate-one.pl arch/arc/include/{,uapi/}asm/<above-list> 4. Edit arch/arc/include/asm/Kbuild to remove ref to asm-generic/Kbuild.asm - To work around empty uapi/asm/setup.h added a placholder comment. - Also a manual #ifdef __ASSEMBLY__ for a late ptrace change Signed-off-by: Vineet Gupta <[email protected]> Cc: David Howells <[email protected]>
2013-02-15ARC: Support for single cycle Close Coupled Mem (CCM)Vineet Gupta1-0/+33
* Includes mapping of CCMs in address space * Annotations to move arbitrary code/data into CCM * Moving some of the critical code/data into CCM * Runtime detection/reporting Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: perf support (software counters only)Vineet Gupta1-0/+13
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: Boot #2: Verbose Boot reporting / feature verificationVineet Gupta3-10/+182
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: kgdb supportMischa Jonker1-0/+61
Signed-off-by: Mischa Jonker <[email protected]> Signed-off-by: Vineet Gupta <[email protected]> Cc: Jason Wessel <[email protected]> Acked-by: Jason Wessel <[email protected]>
2013-02-15ARC: Unaligned access emulationVineet Gupta3-1/+32
ARC700 doesn't natively support unaligned access, but can be emulated -Unaligned Access Exception -Disassembly at the Fault address to find the exact insn (long/short) Also per Arnd's comment, we runtime control it using 2 sysctl knobs: * SYSCTL_ARCH_UNALIGN_ALLOW: Runtime enable/disble * SYSCTL_ARCH_UNALIGN_NO_WARN: Warn on each emulation attempt Originally contributed by Tim Yao <[email protected]> Signed-off-by: Vineet Gupta <[email protected]> Cc: Tim Yao <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2013-02-15ARC: kprobes supportVineet Gupta2-0/+67
Origin port done by Rajeshwar Ranga Signed-off-by: Vineet Gupta <[email protected]> Cc: Rajeshwar Ranga <[email protected]>
2013-02-15ARC: disassembly (needed by kprobes/kgdb/unaligned-access-emul)Vineet Gupta1-0/+116
In-kernel disassembler Due Credits * Orig written by Rajeshwar Ranga * Consolidation/cleanups by Mischa Jonker Signed-off-by: Vineet Gupta <[email protected]> Cc: Rajeshwar Ranga <[email protected]> Cc: Mischa Jonker <[email protected]>
2013-02-15ARC: DWARF2 .debug_frame based stack unwinderVineet Gupta2-0/+170
-Originally written by Rajeshwar Ranga -Derived off of generic unwinder in 2.6.19 and adapted to ARC Signed-off-by: Vineet Gupta <[email protected]> Cc: Rajeshwar Ranga <[email protected]>
2013-02-15ARC: SMP supportVineet Gupta6-0/+181
ARC common code to enable a SMP system + ISS provided SMP extensions. ARC700 natively lacks SMP support, hence some of the core features are are only enabled if SoCs have the necessary h/w pixie-dust. This includes: -Inter Processor Interrupts (IPI) -Cache coherency -load-locked/store-conditional ... The low level exception handling would be completely broken in SMP because we don't have hardware assisted stack switching. Thus a fair bit of this code is repurposing the MMU_SCRATCH reg for event handler prologues to keep them re-entrant. Many thanks to Rajeshwar Ranga for his initial "major" contributions to SMP Port (back in 2008), and to Noam Camus and Gilad Ben-Yossef for help with resurrecting that in 3.2 kernel (2012). Note that this platform code is again singleton design pattern - so multiple SMP platforms won't build at the moment - this deficiency is addressed in subsequent patches within this series. Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Rajeshwar Ranga <[email protected]> Cc: Noam Camus <[email protected]> Cc: Gilad Ben-Yossef <[email protected]>
2013-02-15ARC: Module supportVineet Gupta1-0/+4
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: Support for high priority interrupts in the in-core intcVineet Gupta2-1/+100
There is a bit of hack/kludge right now where we disable preemption if a L2 (High prio) IRQ is taken while L1 (Low prio) is active. Need to revisit this Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: Futex supportVineet Gupta1-0/+151
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: [optim] Cache "current" in Register r25Vineet Gupta4-1/+80
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: [DeviceTree] Convert some Kconfig items to runtime valuesVineet Gupta1-0/+2
* mem size now runtime configured (prev CONFIG_ARC_PLAT_SDRAM_SIZE) * core cpu clk runtime configured (prev CONFIG_ARC_PLAT_CLK) Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Grant Likely <[email protected]>
2013-02-15ARC: [DeviceTree] Basic supportVineet Gupta2-0/+16
This is minimal infrastructure needed for devicetree work. It uses an a sample "skeleton" devicetree - embedded in kernel image - to print the board, manufacturer by parsing the top-level "compatible" string. As of now we don't need any additional "board" specific "machine_desc". TODO: support interpreting the command line as boot-loader passed dtb Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Grant Likely <[email protected]> Cc: [email protected] Cc: Rob Herring <[email protected]> Cc: James Hogan <[email protected]> Reviewed-by: Rob Herring <[email protected]> Reviewed-by: James Hogan <[email protected]>
2013-02-15ARC: [plat-arcfpga] Static platform device for CONFIG_SERIAL_ARCVineet Gupta1-0/+1
N.B. This is old style of hardcoding platform device specific info in code and it's instantiation thererof using platform_add_devices(). Subsequent patches replace this with DeviceTree based runtime probe. This patch has been retained just as an example of "don't-do-this" for newer kernel ports. Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]>
2013-02-15ARC: Boot #1: low-level, setup_arch(), /proc/cpuinfo, mem initVineet Gupta2-0/+27
Signed-off-by: Vineet Gupta <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2013-02-15ARC: I/O and DMA MappingsVineet Gupta3-0/+322
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: TLB flush HandlingVineet Gupta2-0/+45
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: MMU Exception HandlingVineet Gupta3-0/+236
* MMU I-TLB / D-TLB Miss Exceptions - Fast Path TLB Refill Handler - slowpath TLB creation via do_page_fault() -> update_mmu_cache() * Duplicate PD Exception Handler Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: MMU Context ManagementVineet Gupta3-0/+239
ARC700 MMU provides for tagging TLB entries with a 8-bit ASID to avoid having to flush the TLB every task switch. It also allows for a quick way to invalidate all the TLB entries for task useful for: * COW sementics during fork() * task exit()ing Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: Page Table ManagementVineet Gupta3-0/+627
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: Cache Flush ManagementVineet Gupta4-0/+229
* ARC700 has VIPT L1 Caches * Caches don't snoop and are not coherent * Given the PAGE_SIZE and Cache associativity, we don't support aliasing D$ configurations (yet), but do allow aliasing I$ configs Signed-off-by: Vineet Gupta <[email protected]>
2013-02-15ARC: [Review] Prevent incorrect syscall restartsVineet Gupta1-0/+3
Per Al Viro's "signals for dummies" https://lkml.org/lkml/2012/12/6/366 there are 3 golden rules for (not) restarting syscalls: " What we need to guarantee is * restarts do not happen on signals caught in interrupts or exceptions * restarts do not happen on signals caught in sigreturn() * restart should happen only once, even if we get through do_signal() many times." ARC Port already handled #1, this patch fixes #2 and #3. We use the additional state in pt_regs->orig_r8 to ckh if restarting has already been done once. Thanks to Al Viro for spotting this. Signed-off-by: Vineet Gupta <[email protected]> Cc: Al Viro <[email protected]>
2013-02-15ARC: [Review] Preparing to fix incorrect syscall restarts due to signalsVineet Gupta2-16/+37
To avoid multiple syscall restarts (multiple signals) or no restart at all (sigreturn), we need just an extra bit of state "literally 1 bit" in struct pt_regs. orig_r8 is the best place to do this, however given the way it is encoded currently, we can't add anything simplistically. Current orig_r8: * syscalls -> 1 to NR_SYSCALLS * Exceptions -> NR_SYSCALLS + 1 * Break-point-> NR_SYSCALLS + 2 In new scheme it is a bit-field * lower short word contains the exact event type (and a new bit to represent restart semantics : if syscall was already / can't be restarted) * upper short word optionally containing the syscall num - needed by likes of tracehooks etc This patch only changes how orig_r8 is organised and nothing should change behaviourily. Signed-off-by: Vineet Gupta <[email protected]> Cc: Al Viro <[email protected]>
2013-02-15ARC: Signal handlingVineet Gupta3-0/+84
Includes following fixes courtesy review by Al-Viro * Tracer poke to Callee-regs were lost Before going off into do_signal( ) we save the user-mode callee regs (as they are not saved by default as part of pt_regs). This is to make sure that that a Tracer (if tracing related signal) is able to do likes of PEEKUSR(callee-reg). However in return path we were simply discarding the user-mode callee regs, which would break a POKEUSR(callee-reg) from a tracer. * Issue related to multiple syscall restarts are addressed in next patch Signed-off-by: Vineet Gupta <[email protected]> Cc: Al Viro <[email protected]> Acked-by: Jonas Bonn <[email protected]>
2013-02-11ARC: Timers/counters/delay managementVineet Gupta5-0/+119
ARC700 includes 2 in-core 32bit timers TIMER0 and TIMER1. Both have exactly same capabilies. * programmable to count from TIMER<n>_CNT to TIMER<n>_LIMIT * for count 0 and LIMIT ~1, provides a free-running counter by auto-wrapping when limit is reached. * optionally interrupt when LIMIT is reached (oneshot event semantics) * rearming the interrupt provides periodic semantics * run at CPU clk ARC Linux uses TIMER0 for clockevent (periodic/oneshot) and TIMER1 for clocksource (free-running clock). Newer cores provide RTSC insn which gives a 64bit cpu clk snapshot hence is more apt for clocksource when available. SMP poses a bit of challenge for global timekeeping clocksource / sched_clock() backend: -TIMER1 based local clocks are out-of-sync hence can't be used (thus we default to jiffies based cs as well as sched_clock() one/both of which platform can override with it's specific hardware assist) -RTSC is only allowed in SMP if it's cross-core-sync (Kconfig glue ensures that) and thus usable for both requirements. Signed-off-by: Vineet Gupta <[email protected]> Cc: Thomas Gleixner <[email protected]>
2013-02-11ARC: Process-creation/scheduling/idle-loopVineet Gupta4-6/+72
Signed-off-by: Vineet Gupta <[email protected]> Cc: Al Viro <[email protected]> Cc: Thomas Gleixner <[email protected]>
2013-02-11ARC: Syscall support (no-legacy-syscall ABI)Vineet Gupta4-0/+140
This includes support for generic clone/for/vfork/execve Signed-off-by: Vineet Gupta <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Al Viro <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
2013-02-11ARC: Non-MMU Exception HandlingVineet Gupta1-7/+0
Signed-off-by: Vineet Gupta <[email protected]>
2013-02-11ARC: Interrupt HandlingVineet Gupta3-0/+32
This contains: -bootup arch IRQ init: init_IRQ(), arc_init_IRQ() -generic IRQ subsystem glue: arch_do_IRQ() -basic IRQ chip setup for in-core intc Signed-off-by: Vineet Gupta <[email protected]> Cc: Thomas Gleixner <[email protected]>
2013-02-11ARC: Low level IRQ/Trap/Exception HandlingVineet Gupta1-0/+495
Signed-off-by: Vineet Gupta <[email protected]> Cc: Al Viro <[email protected]>