summaryrefslogtreecommitdiffstats
path: root/arch/sh
Commit message (Collapse)AuthorAgeFilesLines
* sh: unwinder: Introduce UNWINDER_BUG() and UNWINDER_BUG_ON()Matt Fleming2009-08-218-26/+95
| | | | | | | | | | | | | | We can't assume that if we execute the unwinder code and the unwinder was already running that it has faulted. Clearly two kernel threads can invoke the unwinder at the same time and may be running simultaneously. The previous approach used BUG() and BUG_ON() in the unwinder code to detect whether the unwinder was incapable of unwinding the stack, and that the next available unwinder should be used instead. A better approach is to explicitly invoke a trap handler to switch unwinders when the current unwinder cannot continue. Signed-off-by: Matt Fleming <matt@console-pimps.org>
* sh: unwinder: Set the flags for DW_CFA_val_offset ops as DWARF_VAL_OFFSETMatt Fleming2009-08-212-1/+3
| | | | | | | | | | | The handling of DW_CFA_val_offset ops was incorrectly using the DWARF_REG_OFFSET flag but the register's value cannot be calculated using the DWARF_REG_OFFSET method. Create a new flag to indicate that a different method must be used to calculate the register's value even though there is no implementation for DWARF_VAL_OFFSET yet; it's mainly just a place holder. Signed-off-by: Matt Fleming <matt@console-pimps.org>
* sh: unwinder: Fix memory leak and create our own kmem cacheMatt Fleming2009-08-212-81/+142
| | | | | | | | | | | | | | | | | | Plug a memory leak in dwarf_unwinder_dump() where we didn't free the memory that we had previously allocated for the DWARF frames and DWARF registers. Now is also a opportune time to implement our own mempool and kmem cache. It's a good idea to have a certain number of frame and register objects in reserve at all times, so that we are guaranteed to have our allocation satisfied even when memory is scarce. Since we have pools to allocate from we can implement the registers for each frame as a linked list as opposed to a sparsely populated array. Whilst it's true that the lookup time for a linked list is larger than for arrays, there's only usually a maximum of 8 registers per frame. So the overhead isn't that much of a concern. Signed-off-by: Matt Fleming <matt@console-pimps.org>
* sh: unwinder: Move initialization to early_initcall() and tidy up locking.Paul Mundt2009-08-173-23/+15
| | | | | | | | This moves the initialization over to an early_initcall(). This fixes up some lockdep interaction issues. At the same time, kill off some superfluous locking in the init path. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add support for DWARF GNU extensionsMatt Fleming2009-08-162-1/+17
| | | | | | | | | | | | | | Also, remove the "fix" to DW_CFA_def_cfa_register where we reset the frame's cfa_offset to 0. This action is incorrect when handling DW_CFA_def_cfa_register as the DWARF spec specifically states that the previous contents of cfa_offset should be used with the new register. The reason that I thought cfa_offset should be reset to 0 was because it was being assigned a bogus value prior to executing the DW_CFA_def_cfa_register op. It turns out that the bogus cfa_offset value came from interpreting .cfi_escape pseudo-ops (those used by the GNU extensions) as CFA_DW_def_cfa ops. Signed-off-by: Matt Fleming <matt@console-pimps.org>
* sh: Try again at getting the initial return address for an unwindMatt Fleming2009-08-161-35/+6
| | | | | | | | | | | | | | | | | | The previous hack for calculating the return address for the first frame we unwind (dwarf_unwinder_dump) didn't always work. The problem was that it assumed once it read the rule for calculating the return address, there would be no new rules for calculating it. This isn't true because the way in which the CFA is calculated can change as you progress through a function and the return address is figured out using the CFA. Therefore, the way to calculate the return address can change. So, instead of using some offset from the beginning of dwarf_unwind_stack which is just a flakey approach, and instead of executing instructions from the FDE until the return address is setup, we now figure out the pc in dwarf_unwind_stack() just before we call dwarf_cfa_execute_insns(). Signed-off-by: Matt Fleming <matt@console-pimps.org>
* sh: Merge the _32/_64 variants of arch/sh/kernel/Makefile.Paul Mundt2009-08-163-64/+39
| | | | | | | This uses the BITS export as per x86 in order to allow the same Makefile to be used. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* Merge branch 'sh/stable-updates'Paul Mundt2009-08-152-6/+73
|\
| * sh: sh7724 ddr self-refresh changesMagnus Damm2009-08-151-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates the SuperH Mobile sleep assembly code with support for DBSC memory controller found in the sh7724 processor. Without this fix the memory hooked up to the sh7724 processor will never enter self-refresh mode before suspending to ram. The effect of this is that the memory contents most likeley will be lost upon resume which may or may not be what you want. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: use in-soc KEYSC on se7724Magnus Damm2009-08-151-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates the Solution Engine 7724 board code to use in-SoC KEYSC resources for the keyboard platform device. Using the in-SoC key scan controller fixes a crash-during-resume issue. Without this patch the KEYSC hardware block located in the board specific FPGA is used together with an external IRQ which is routed through the FPGA and handled by some board specific demux code. This board specific FPGA interrupt code does not implement desc->set_wake() so the enable_irq_wake() call in the sh_keysc driver will fail at suspend-to-ram time and the disable_irq_wake() will bomb out when resuming. Changing the platform data to use the in-SoC KEYSC hardware makes the se7724 board support code less special which is a good thing. Also, the board specific KEYSC pin setup code selects in-SoC pin functions already which makes the current FPGA platform device data look like a typo. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Set the cfa_offset to 0 if we see a DW_CFA_def_cfa_register opMatt Fleming2009-08-151-0/+1
| | | | | | | | | | | | | | | | | | The way that the CFA is calculated can change as we progress through a function. If we see a DW_CFA_def_cfa_register op we need to reset the frame's cfa_offset value which may have been previously setup. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: delay slot future proofing via EXPMASK on SH-4A parts.Paul Mundt2009-08-151-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements EXPMASK initialization code for SH-4A parts, where it is possible to disable compat features that will go away in newer cores. Presently this includes disabling support for non-nop instructions in the rte delay slot, as well as a sleep instruction being placed in a delay slot (neither of which the kernel does any longer). As a result of this, any future offenders will have illegal slot exceptions generated for them. Associative writes for the memory-mapped cache array are still left enabled, until such a point that special cache operations for SH-4A are provided to move off of the current (and rather dated) SH-4 versions. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Make sure rte delay slots are nopped out on all parts.Paul Mundt2009-08-152-2/+4
| | | | | | | | | | | | | | | | | | Future SH parts do not support any instruction but a nop in the rte delay slot, so make the change for all offending parts. SH-5 is excluded from this, and already has its own set of restrictions with regards to rte delay slot handling. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: stacktrace: Properly terminate the trace entry buffer.Paul Mundt2009-08-151-0/+4
| | | | | | | | | | | | | | | | | | This inserts a ULONG_MAX entry at the end of the valid entries in the stack trace buffer so the default code doesn't need to scan to the end of available slots. This also makes the trace buffer termination behaviour consistent with the other architectures. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: flag the default unwinder as reliable.Paul Mundt2009-08-151-1/+1
| | | | | | | | | | | | | | | | This flags the default unwinder as reliable, as it tends to be reliable enough for the purposes of the stacktrace buffer. We leave the unreliable cases for the unwind methods that we know to be completely broken. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: stacktrace: Add reliability checks in address saving ops.Paul Mundt2009-08-151-0/+6
| | | | | | | | | | | | | | This adopts the reliability checks from the x86 stacktrace code so known bad addresses are not recorded in the stack trace buffer. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: unwinder: Convert frame allocations to GFP_ATOMIC.Paul Mundt2009-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | save_stack_trace_tsk() and friends can be called from atomic context (as triggered by latencytop), and subsequently hit two problematic allocation points that were using GFP_KERNEL (these were dwarf_unwind_stack() and dwarf_frame_alloc_regs()). Convert these over to GFP_ATOMIC and get latencytop working with the DWARF unwinder. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | Merge branch 'sh/dwarf-unwinder'Paul Mundt2009-08-1413-1/+1363
|\ \
| * | sh: Delete DWARF_ARCH_UNWIND_OFFSETMatt Fleming2009-08-142-14/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to figure out the best value for DWARF_ARCH_UNWIND_OFFSET is tricky at best. Various things can change the size (and offset from the beginning of the function) of the prologue. Notably, turning on ftrace adds calls to mcount at the beginning of functions, thereby pushing the prologue further into the function. So replace DWARF_ARCH_UNWIND_OFFSET with some code that continues to execute CFA instructions until the value of return address register is defined. This is safe to do because we know that the return address must have been pushed onto the frame before our first function call; we just can't figure out where at compile-time. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: unwinder: Restore put_unaligned() for an unaligned destination.Paul Mundt2009-08-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The destination address might be unaligned, so set it with put_unaligned() for safety. This restores the previous behaviour, albeit through the proper API. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: unwinder: Fix up usage of unaligned accessors.Paul Mundt2009-08-141-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was using internal symbols for unaligned accesses, bypassing the exposed interface for variable sized safe accesses. This converts all of the __get_unaligned_cpuXX() users over to get_unaligned() directly, relying on the cast to select the proper internal routine. Additionally, the __put_unaligned_cpuXX() case is superfluous given that the destination address is aligned in all of the current cases, so just drop that outright. Furthermore, this switches to the asm/unaligned.h header instead of the asm-generic version, which was silently bypassing the SH-4A optimized unaligned ops. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Add CFI annotations for exception return.Matt Fleming2009-08-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Annotate various assembly code paths with CFI assembler directives so that DWARF unwind info is available for the unwinder. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Setup the frame register in asm codeMatt Fleming2009-08-143-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to use DWARF unwinder info the frame register has to contain a valid value. Whilst GCC takes care of this for C code, we have to do it ourselves for assembly. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: dwarf unwinder support.Matt Fleming2009-08-1410-1/+1322
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a first cut at a generic DWARF unwinder for the kernel. It's still lacking DWARF64 support and the DWARF expression support hasn't been tested very well but it is generating proper stacktraces on SH for WARN_ON() and NULL dereferences. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: oprofile: Kill off dead valid_kernel_stack().Paul Mundt2009-08-141-27/+0
|/ / | | | | | | | | | | This is no longer used, kill it off. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Use the new stack unwinder APIMatt Fleming2009-08-133-15/+12
| | | | | | | | | | | | | | | | | | | | Instead of implementing our own stack unwinder via dump_trace() we should use the new stack unwinder API because it is more modular. This change allows us to decouple the interface for generating stacktraces from the implementation of a stack unwinder. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Allow multiple stack unwinders to be setupMatt Fleming2009-08-134-3/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide an interface for registering stack unwinders, where each unwinder is given a rating that describes its accuracy and complexity. The more accurate an unwinder is, the more complex it is. If a the current stack unwinder faults, then the stack unwinder with the next highest accuracy will be used in its place (provided one is available). For example, this allows unwinders, such as the DWARF unwinder, to liberally sprinkle BUG()s to catch badly formed DWARF debug info. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Use the generalized stacktrace opsMatt Fleming2009-08-136-71/+251
| | | | | | | | | | | | | | | | Copy the stacktrace ops code from x86 and provide a central function for use by functions that need to dump a callstack. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: use printk_onceMarcin Slusarz2009-08-131-5/+1
| | | | | | | | | | | | Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: linux-sh@vger.kernel.org Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | Merge branch 'sh/stable-updates'Paul Mundt2009-08-134-14/+6
|\ \ | |/
| * sh: fix i2c init order on ap325rxa V2Magnus Damm2009-08-131-1/+1
| | | | | | | | | | | | | | | | | | Convert the AP325RXA board code to register devices at arch_initcall() time instead of device_initcall(). This fix unbreaks pcf8563 RTC driver support. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: fix i2c init order on Migo-R V2Magnus Damm2009-08-131-1/+1
| | | | | | | | | | | | | | | | | | Convert the Migo-R board code to register devices at arch_initcall() time instead of __initcall(). This fix unbreaks migor_ts touch screen driver support. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: convert processor device setup functions to arch_initcall()Magnus Damm2009-08-1324-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the processor platform device setup functions from __initcall() and sometimes device_initcall() to arch_initcall(). This makes sure that the platform devices are registered a bit earlier so the devices are available when drivers register using initcall levels earlier than device_initcall(). A good example is platform devices needed by i2c-sh_mobile.c which registers a bit earlier using subsys_initcall(). Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * mm: Remove duplicate definitions in MIPS and SHBenjamin Herrenschmidt2009-07-271-8/+0
| | | | | | | | | | | | | | | | Those definitions are already provided by asm-generic Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| * mm: Pass virtual address to [__]p{te,ud,md}_free_tlb()Benjamin Herrenschmidt2009-07-272-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mm: Pass virtual address to [__]p{te,ud,md}_free_tlb() Upcoming paches to support the new 64-bit "BookE" powerpc architecture will need to have the virtual address corresponding to PTE page when freeing it, due to the way the HW table walker works. Basically, the TLB can be loaded with "large" pages that cover the whole virtual space (well, sort-of, half of it actually) represented by a PTE page, and which contain an "indirect" bit indicating that this TLB entry RPN points to an array of PTEs from which the TLB can then create direct entries. Thus, in order to invalidate those when PTE pages are deleted, we need the virtual address to pass to tlbilx or tlbivax instructions. The old trick of sticking it somewhere in the PTE page struct page sucks too much, the address is almost readily available in all call sites and almost everybody implemets these as macros, so we may as well add the argument everywhere. I added it to the pmd and pud variants for consistency. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: David Howells <dhowells@redhat.com> [MN10300 & FRV] Acked-by: Nick Piggin <npiggin@suse.de> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> [s390] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | sh: clean up Migo-R header fileMagnus Damm2009-08-072-64/+14
| | | | | | | | | | | | | | | | This patch moves the Migo-R specific header file from mach-common/ into mach-migor/ and removes unused cruft. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: fix romImage mach dir usageMagnus Damm2009-08-074-1/+1
| | | | | | | | | | | | | | | | This patch moves all the romImage related header files into the mach/ directory. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: LED9, LED10 and LED11 support for Solution Engine 7724Magnus Damm2009-08-071-0/+26
| | | | | | | | | | | | | | | | | | | | This patch adds support for LED9, LED10 and LED11 on the Solution Engine 7724 board. If CONFIG_PM is enabled then these LEDs are used to show the hardware sleep mode used by the processor. Useful to debug cpuidle. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: kfr2r09 board support - NAND flashMagnus Damm2009-08-071-0/+23
| | | | | | | | | | | | | | | | | | This patch adds support for the NAND flash chip attached to CS4 on the KFR2R09 board. The device is driven by the platform device driver "onenand-flash". Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: kfr2r09 board support - LCDC panelMagnus Damm2009-08-074-0/+448
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the WQVGA LCD display used by the KFR2R09 board. The LCD module is a TX07D34VM0AAA made by Hitachi, and this module is made up by a R61517 chip together with a 240x400 pixel display. The screen is attached to the SuperH Mobile LCDC using a 18-bit SYS bus. The register settings used by the SYS panel setup code are based on an out-of-tree driver which apart from duplicating all LCDC driver code and writing to non-existing hardware registers also never was posted for upstream merge. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: convert to asm-generic/hardirq.hChristoph Hellwig2009-08-051-10/+3
| | | | | | | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Fix up early printk build error.Paul Mundt2009-08-041-0/+1
| | | | | | | | | | | | Missing endif in the early printk case, fix it up.. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Add SH7724 DMAC support.Kuninori Morimoto2009-08-042-1/+3
| | | | | | | | | | Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: ms7724se: add 1280x720 lcdc output supportKuninori Morimoto2009-08-041-10/+18
| | | | | | | | | | | | | | | | | | There was no big meaning in the support of SVGA, but 720p support is necessary for ms7724se board. So, this patch support 720p instead of SVGA. Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: clean up MSTPCRn register definitionsMagnus Damm2009-08-043-9/+0
| | | | | | | | | | | | | | | | This patch removes the unused MSTPCRn register definitions from the SuperH Mobile code for sh7722, sh7723 and sh7724. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: hwblk support for sh7724Magnus Damm2009-08-044-58/+201
| | | | | | | | | | | | | | This patch adds hwblk support for the sh7724 processor. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Add early printk support for SH770x CPUs.Rafael Ignacio Zurita2009-08-042-4/+3
| | | | | | | | | | | | | | This adds early printk support for SH770x (tested on SH7709 based hp6xx). Signed-off-by: Rafael Ignacio Zurita <rizurita@yahoo.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Add romImage target to archhelp.Paul Mundt2009-07-301-0/+1
| | | | | | | | | | | | | | Adds an archhelp blurb for the romImage target so it is reflected in 'make help'. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: kfr2r09 romImage support V2Magnus Damm2009-07-302-0/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is romImage support for the kfr2r09 board V2. The partner-jet-setup.txt file is converted into assembly code which becomes the first code to execute from the reset vector. The file partner-jet-setup.txt can also be used to setup the hardware using a JTAG debugger so booting from RAM can be done without burning the code to flash. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: romImage support V2Magnus Damm2009-07-306-3/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains support for the romImage build target V2. The resulting romImage file should be burned to rom or flash and could be used as small boot loader. Board code should keep their setup code in the file romimage.h located in their mach include directory. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
OpenPOWER on IntegriCloud