aboutsummaryrefslogtreecommitdiff
path: root/arch/arc
AgeCommit message (Collapse)Author
2013-02-27ARC: split elf.h into uapi and export it for userspaceVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-27ARC: Fixup the current ABI versionVineet Gupta
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 <vgupta@synopsys.com>
2013-02-27ARC: gdbserver using regset interface possibly brokenVineet Gupta
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 <vgupta@synopsys.com>
2013-02-26ARC: Kconfig cleanup tracking cross-arch Kconfig pruning in merge windowVineet Gupta
Since ARC port was not yet upstream, we missed a bunch of cross-arch Kconfig removals: * GENERIC_SIGALTSTACK: d64008a8f3 "burying unused conditionals" * HAVE_IRQ_WORK: 6147a9d807 "irq_work: Remove CONFIG_HAVE_IRQ_WORK" * ARCH_NO_VIRT_TO_BUS: e0cf2ef484 "arch Kconfig: centralise CONFIG_ARCH_NO_VIRT_TO_BUS" Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-26ARC: make a copy of flat DTVineet Gupta
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 <james.hogan@imgtec.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: [plat-arcfpga] DT arc-uart bindings change: "baud" => "current-speed"Vineet Gupta
Per Grant's review comment - driver changes via tty tree Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: Ensure CONFIG_VIRT_TO_BUS is not enabledVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reported-by: James Hogan <james.hogan@imgtec.com>
2013-02-15ARC: Fix pt_orig_r8 accessVineet Gupta
Syscall restarting fixes made pt_regs->orig_r8 a short word, which was not reflected in the assembler code - thus could potentially break gdb debugging. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: [3.9] Fallout of hlist iterator updateVineet Gupta
Commit 0bbacca "hlist: drop the node parameter from iterators" changed the iterator across the board - but ARC port being out-of-tree missed it. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: 64bit RTSC timestamp hardware issueVineet Gupta
The 64bit RTSC is not reliable, causing spurious "jumps" in higher word, making Linux timekeeping go bonkers. So as of now just use the lower 32bit timestamp. A cleaner approach would have been removing RTSC support altogether as the 32bit RTSC is equivalent to old TIMER1 based solution, but some customers can use the 32bit RTSC in SMP syn fashion (vs. TIMER1 which being incore can't be done easily). A fallout of this is sched_clock()'s hardware assisted version needs to go away since it can't use 32bit wrapping counter - instead we use the generic "weak" jiffies based version. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: Don't fiddle with non-existent cachesVineet Gupta
!CONFIG_ARC_HAS_(I|D)CACHE makes Linux disable caches (assuming they exist in hardware) - mostly for debugging issues with new peripherals. However, independent of CONFIG_ARC_HAS_(I|D)CACHE, Linux also needs to handle, non-existant caches, using the information in Cache BCRs (Build Configuration Reg) Reported-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: Provide a default serial.h for uart drivers needing BASE_BAUDVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: [plat-arcfpga] defconfig for fully loaded ARC LinuxVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: [Review] Multi-platform image #8: platform registers SMP callbacksVineet Gupta
Platforms export their SMP callbacks by populating arc_smp_ops. The population itself needs to be done pretty early, from init_early callback. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: [Review] Multi-platform image #7: SMP common code to use callbacksVineet Gupta
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 <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: [Review] Multi-platform image #6: cpu-to-dma-addr optionalVineet Gupta
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 <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: [Review] Multi-platform image #5: NR_IRQS defined by ARC coreVineet Gupta
For now this will suffice for all platforms, later exotic ones needs to get this from DeviceTree Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: [Review] Multi-platform image #4: Isolate platform headersVineet Gupta
-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 <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: [Review] Multi-platform image #3: switch to board callbackVineet Gupta
-platform API is retired and instead callbacks are used Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: [Review] Multi-platform image #2: Board callback InfrastructureVineet Gupta
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 <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: Fold boards sub-menu into platform/SoC menuVineet Gupta
This is more natural and is now doable since the choice constructs are gone. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: [Review] Multi-platform image #1: Kconfig enablementVineet Gupta
This mini patchseries addresses the lack of multi-platform-image support in ARC port. Older build system only supported one platform(soc) to build at a time and further only one board of that platform could be built. There was no technical reason for that - we just didn't have the need. So the first step towards multi-platform (and multi-board) builds it to allow build system to do that. So as applicable, <choice .. endchoice> => <menu .. endmenu> Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: Add support for ioremap_prot APIGilad Ben-Yossef
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 <Alexey.Brodkin@synopsys.com> CC: Noam Camus <noamc@ezchip.com> Acked-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: UAPI Disintegrate arch/arc/include/asmVineet Gupta
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 <vgupta@synopsys.com> Cc: David Howells <dhowells@redhat.com>
2013-02-15ARC: Hostlink Pseudo-Driver for Metaware DebuggerVineet Gupta
This allows ARC Target to do I/O to host in absence of any peripherals whatsoever, assisted by Metaware Hostlink facility. Further we have a FUSE based filesystem which makes us mount/access host filesystem on target and do fops. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: Support for single cycle Close Coupled Mem (CCM)Vineet Gupta
* 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 <vgupta@synopsys.com>
2013-02-15ARC: perf support (software counters only)Vineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: [plat-arfpga] BVCI Latency Unit setupVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: Boot #2: Verbose Boot reporting / feature verificationVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: kgdb supportMischa Jonker
Signed-off-by: Mischa Jonker <mjonker@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Jason Wessel <jason.wessel@windriver.com> Acked-by: Jason Wessel <jason.wessel@windriver.com>
2013-02-15ARC: Unaligned access emulationVineet Gupta
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 <tim.yao@amlogic.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Tim Yao <tim.yao@amlogic.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: kprobes supportVineet Gupta
Origin port done by Rajeshwar Ranga Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Rajeshwar Ranga <rajeshwar.ranga@gmail.com>
2013-02-15ARC: disassembly (needed by kprobes/kgdb/unaligned-access-emul)Vineet Gupta
In-kernel disassembler Due Credits * Orig written by Rajeshwar Ranga * Consolidation/cleanups by Mischa Jonker Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Rajeshwar Ranga <rajeshwar.ranga@gmail.com> Cc: Mischa Jonker <mjonker@synopsys.com>
2013-02-15ARC: stacktracing APIs based on dw2 unwinderVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: DWARF2 .debug_frame based stack unwinderVineet Gupta
-Originally written by Rajeshwar Ranga -Derived off of generic unwinder in 2.6.19 and adapted to ARC Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Rajeshwar Ranga <rajeshwar.ranga@gmail.com>
2013-02-15ARC: SMP supportVineet Gupta
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 <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Rajeshwar Ranga <rajeshwar.ranga@gmail.com> Cc: Noam Camus <noamc@ezchip.com> Cc: Gilad Ben-Yossef <gilad@benyossef.com>
2013-02-15ARC: Diagnostics: show_regs() etcVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: Module supportVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: Support for high priority interrupts in the in-core intcVineet Gupta
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 <vgupta@synopsys.com>
2013-02-15ARC: OProfile supportVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Robert Richter <rric@kernel.org> Cc: oprofile-list@lists.sf.net Reviewed-by: James Hogan <james.hogan@imgtec.com>
2013-02-15ARC: Futex supportVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: ptrace supportVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: [optim] Cache "current" in Register r25Vineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: [plat-arcfpga] defconfigVineet Gupta
With this we get to a running kernel on ISS ---------------------------------->8----------------------------------- Linux version 3.8.0-rc3+ (vineetg@vineetg-Latitude) (gcc version 4.4.7 (ARCompact elf32 toolchain (built 20121213)) ) #3 Thu Jan 17 14:22:05 IST 2013 Board "arc-angel4" from snps (Manufacturer) Memory size set via devicetree 256M [plat-arcfpga]: registering early dev resources bootconsole [early_ARCuart0] enabled pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 pcpu-alloc: [0] 0 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32624 Kernel command line: console=ttyARC0,115200n8 PID hash table entries: 1024 (order: -1, 4096 bytes) Dentry cache hash table entries: 32768 (order: 4, 131072 bytes) Inode-cache hash table entries: 16384 (order: 3, 65536 bytes) Memory Available: 248M / 256M (1312K code, 463K data, 4184K init, 1400K reserv) SLUB: Genslabs=12, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS:16 Console: colour dummy device 80x25 Calibrating delay loop... 39.73 BogoMIPS (lpj=198656) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 devtmpfs: initialized [plat-arcfpga]: registering device resources bio: create slab <bio-0> at 0 Switching to clocksource ARC RTSC io scheduler noop registered (default) arc-uart: ttyARC0 at MMIO 0xc0fc1000 (irq = 5) is a arc-uart console [ttyARC0] enabled, bootconsole disabled console [ttyARC0] enabled, bootconsole disabled mousedev: PS/2 mouse device common for all mice Warning: unable to open an initial console. Freeing unused kernel memory: 4184k [80002000] to [80418000] Mounting proc Mounting sysfs Mounting devpts Setting hostname to ARCLinux Starting System logger (syslogd) Bringing up loopback device ifconfig: socket: Function not implemented route: socket: Function not implemented Disk not detected ! Mounting tmpfs mount: mounting tmpfs on /dev/shm failed: Invalid argument /etc/init.d/rcS: line 76: can't create /proc/sys/kernel/msgmni: nonexistent directory Please press Enter to activate this console. *********************************************************************** Welcome to ARCLinux *********************************************************************** [ARCLinux]$ ---------------------------------->8----------------------------------- Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: Last bits (stubs) to get to a running kernel with UARTVineet Gupta
This was part of port buildup strategy from Arnd to have a minimal kernel at first and then add optional features (stacktracing, ptrace, smp, kprobes, oprofile....) Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-02-15ARC: [plat-arcfpga]: Enabling DeviceTree for Angel4 boardVineet Gupta
* arc-uart platform device now populated dynamically, using of_platform_populate() - applies to any other device whatsoever. * uart in turn requires incore arc-intc to be also present in DT * A irq-domain needs to be instantiated for IRQ requests by DT probed device (e.g. arc-uart) TODO: switch over to linear irq domain once all devs have been transitioned to DT Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: [DeviceTree] Convert some Kconfig items to runtime valuesVineet Gupta
* 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 <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Grant Likely <grant.likely@secretlab.ca>
2013-02-15ARC: [DeviceTree] Basic supportVineet Gupta
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 <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: devicetree-discuss@lists.ozlabs.org Cc: Rob Herring <rob.herring@calxeda.com> Cc: James Hogan <james.hogan@imgtec.com> Reviewed-by: Rob Herring <rob.herring@calxeda.com> Reviewed-by: James Hogan <james.hogan@imgtec.com>
2013-02-15ARC: [plat-arcfpga] Static platform device for CONFIG_SERIAL_ARCVineet Gupta
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 <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de>
2013-02-15ARC: Boot #1: low-level, setup_arch(), /proc/cpuinfo, mem initVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Acked-by: Arnd Bergmann <arnd@arndb.de>