summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu
Commit message (Collapse)AuthorAgeFilesLines
* sh: Mass ctrl_in/outX to __raw_read/writeX conversion.Paul Mundt2010-01-2636-189/+189
| | | | | | | | | | | The old ctrl in/out routines are non-portable and unsuitable for cross-platform use. While drivers/sh has already been sanitized, there is still quite a lot of code that is not. This converts the arch/sh/ bits over, which permits us to flag the routines as deprecated whilst still building with -Werror for the architecture code, and to ensure that future users are not added. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Kill off the special uncached section and fixmap.Paul Mundt2010-01-214-5/+7
| | | | | | | | Now that cached_to_uncached works as advertized in 32-bit mode and we're never going to be able to map < 16MB anyways, there's no need for the special uncached section. Kill it off. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Handle SH-4 FPU variants with broken CVR values.Paul Mundt2010-01-201-2/+3
| | | | | | | | | Usually we can look to the CVR to work out whether we have an FPU or not. Unfortunately not all parts comply with this, so just set the flag manually for all SH-4 parts and clear it on the only SH-4 that doesn't have one (SH4-501). Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: support SIU sourcing from external clock on sh7722Guennadi Liakhovetski2010-01-192-7/+112
| | | | | | | | | | Implement .set_rate() for all SH "div4 clocks," .enable(), .disable(), and .set_parent() for those, that support them. This allows, among other uses, reparenting of SIU clocks to the external source, and enabling and disabling of the IrDA clock on sh7722. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: SH7786 clock framework rewrite.Paul Mundt2010-01-191-96/+88
| | | | | | | | | This rewrites the SH7786 clock framework support completely. It's reworked to provide all of the DIV4 and MSTP function clocks. This brings it in line with the current clock framework code and lets us drop SH7786 from the list of CPUs that require legacy CPG handling. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh64: Fixup build breakage from breakpoint handler rename.Paul Mundt2010-01-191-1/+1
| | | | | | | The breakpoint handler was renamed on sh32, but sh64 was overlooked in the conversion. Fix it up now. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh64: Use the shared FPU state restorer.Paul Mundt2010-01-192-60/+7
| | | | | | | This kills off the sh64-specific state restorer and switches over to the generic one. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh64: Fix up the build for the thread_xstate changes.Paul Mundt2010-01-191-6/+6
| | | | | | | This updates the sh64 processor info with the sh32 changes in order to tie in to the generic task_xstate management code. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Need IRQs enabled for init_fpu().Paul Mundt2010-01-181-0/+2
| | | | | | | | | | This tosses in a local_irq_enable()/disable() pair around the init_fpu() callsite in the FPU state restore exception handler. Fixes up a slab BUG triggered by making a slab cache allocation that can sleep whilst irqs_disabled(). This follows the behaviour undertaken by the x86 implementation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up the secondary CPU entry point for 32bit mode.Paul Mundt2010-01-151-1/+4
| | | | | | | | Presently the secondary CPU entry point is only aimed at 29bit phys mode, causing it to point to a stray virtual address in 32bit mode. Fix it up after consulting with our shiny new __in_29bit_mode(). Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up L2 cache comment typo.Paul Mundt2010-01-131-1/+1
| | | | | | Valid sizes include 256kB, not 258kB. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: PVR detection for 2nd cut SH7786.Matt Fleming2010-01-131-0/+1
| | | | | | | The mass produced cuts use an updated PVR value, add them to the list. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
*-. Merge branches 'sh/xstate', 'sh/hw-breakpoints' and 'sh/stable-updates'Paul Mundt2010-01-138-256/+340
|\ \
| | * sh: Kill off dead UBC headers.Paul Mundt2010-01-051-12/+8
| | | | | | | | | | | | | | | | | | Nothing is using these now, so kill them all off. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| | * sh: Abstracted SH-4A UBC support on hw-breakpoint core.Paul Mundt2010-01-052-4/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the next big chunk of hw_breakpoint support. This decouples the SH-4A support from the core and moves it out in to its own stub, following many of the conventions established with the perf events layering. In addition to extending SH-4A support to encapsulate the remainder of the UBC channels, clock framework support for handling the UBC interface clock is added as well, allowing for dynamic clock gating. This also fixes up a regression introduced by the SIGTRAP handling that broke the ksym_tracer, to the extent that the current support works well with all of the ksym_tracer/ptrace/kgdb. The kprobes singlestep code will follow in turn. With this in place, the remaining UBC variants (SH-2A and SH-4) can now be trivially plugged in. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| | * Merge branch 'master' into sh/hw-breakpointsPaul Mundt2009-12-2127-768/+1497
| | |\ | |_|/ |/| |
| | * Merge branch 'master' into sh/hw-breakpointsPaul Mundt2009-12-0819-375/+1202
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflict between FPU thread flag migration and debug thread flag addition. Conflicts: arch/sh/include/asm/thread_info.h arch/sh/include/asm/ubc.h arch/sh/kernel/process_32.c
| | * | sh: hw-breakpoints: Add preliminary support for SH-4A UBC.Paul Mundt2009-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds preliminary support for the SH-4A UBC to the hw-breakpoints API. Presently only a single channel is implemented, and the ptrace interface still needs to be converted. This is the first step to cleaning up the long-standing UBC mess, making the UBC more generally accessible, and finally making it SMP safe. An additional abstraction will be layered on top of this as with the perf events code to permit the various CPU families to wire up support for their own specific UBCs, as many variations exist. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | | sh: Move over to dynamically allocated FPU context.Paul Mundt2010-01-135-240/+194
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows the x86 xstate changes and implements a task_xstate slab cache that is dynamically sized to match one of hard FP/soft FP/FPU-less. This also tidies up and consolidates some of the SH-2A/SH-4 FPU fragmentation. Now fpu state restorers are commonly defined, with the init_fpu()/fpu_init() mess reworked to follow the x86 convention. The fpu_init() register initialization has been replaced by xstate setup followed by writing out to hardware via the standard restore path. As init_fpu() now performs a slab allocation a secondary lighterweight restorer is also introduced for the context switch. In the future the DSP state will be rolled in here, too. More work remains for math emulation and the SH-5 FPU, which presently uses its own special (UP-only) interfaces. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: dmaengine support for SH7785Nobuhiro Iwamatsu2009-12-171-0/+14
| | | | | | | | | | | | | | | | | | | | | Add dmaengine platform device to SH7785. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: dmaengine support for sh7724.Guennadi Liakhovetski2009-12-171-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Add a dmaengine platform device to sh7724, fix DMA channel interrupt numbers. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: Fix up FPU build for SH5Matt Fleming2009-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | After the recent FPU optimisation commit the signature of save_fpu() changed. "regs" wasn't used in the implementation of save_fpu() anyway. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: sh5 scif pdata (sh5-101/sh5-103)Magnus Damm2009-12-151-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch breaks out the sh5 scif serial port platform data from a shared platform device to one platform device per port. Also, move the serial port to the list of early platform devices. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: sh4a scif pdata (sh7757/sh7763/sh7770/sh7780/sh7785/sh7786/x3)Magnus Damm2009-12-157-270/+551
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch breaks out the sh4a scif serial port platform data from a shared platform device to one platform device per port. Also, add serial ports to the list of early platform devices. All sh4a except SuperH Mobile processors are modified by this patch. While at it, sh7757 gets early platform device support. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: sh4a scif pdata (sh7343/sh7366/sh7722/sh7723/sh7724)Magnus Damm2009-12-155-193/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch breaks out the sh4a scif serial port platform data from a shared platform device to one platform device per port. Also, add serial ports to the list of early platform devices. Only sh4a SuperH Mobile processors are modified by this patch. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: sh4 scif pdata (sh7750/sh7760/sh4-202)Magnus Damm2009-12-153-61/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch breaks out the sh4 scif serial port platform data from a shared platform device to one platform device per port. Also, add serial ports to the list of early platform devices. While at it, get rid of the R2D ifdef in the processor code and adjust the defconfigs to use ttySC1. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: sh3 scif pdata (sh7705/sh770x/sh7710/sh7720)Magnus Damm2009-12-154-87/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch breaks out the sh3 scif serial port platform data from a shared platform device to one platform device per port. Also, add serial ports to the list of early platform devices. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: sh2a scif pdata (sh7201/sh7203/sh7206/mxg)Magnus Damm2009-12-154-119/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch breaks out the sh2a scif serial port platform data from a shared platform device to one platform device per port. Also, add serial ports to the list of early platform devices. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: sh2 scif pdata (sh7616)Magnus Damm2009-12-151-25/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch breaks out the sh2 scif serial port platform data from a shared platform device to one platform device per port. Also, add serial ports to the list of early platform devices. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: Replace an explicit computation by the use of the container_of macroNicolas Palix2009-12-091-3/+4
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro container_of from kernel.h performs the same pointer arithmetic operation. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ type T; expression mptr; expression member; @@ - (void *)((char *)mptr - offsetof(T, member)) + container_of(mptr, T, member) // </smpl> Signed-off-by: Nicolas Palix <npalix@diku.dk> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Make associative cache writes fatal on all SH-4A parts.Paul Mundt2009-12-041-9/+4
| | | | | | | | | | | | | | | | | | Now that associative cache writes are no longer needed by the SH-4/SH-4A cache flush code, associative write support can be explicitly disabled for all SH-4A parts. This makes any associative write throw an exception, as this behaviour can not be assumed to exist on future parts. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: allow runtime pm without suspend/resume callbacksMagnus Damm2009-12-041-6/+11
| | | | | | | | | | | | | | | | | | This patch updates the Runtime PM code for SuperH Mobile to allow drivers to have NULL as pm or callback value. With this in place there is no need for no-op functions. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: fix sh7724 VEU3F resource sizeMagnus Damm2009-12-041-2/+2
| | | | | | | | | | | | | | Fix one-off VEU3F size error for sh7724. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Add CPG save/restore code for sh7724 R-standbyMagnus Damm2009-11-301-0/+11
| | | | | | | | | | | | | | | | | | Add sh7724 code to save and restore CPG state during R-standby. Only CPG registers IRDACLKCR and SPUCLKCR require software save and restore. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Apply the sleazy FPU changes for SH-2A FPU as well.Paul Mundt2009-11-241-4/+12
| | | | | | | | | | | | This plugs in the fpu_counter manipulation for the SH-2A side also. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Minor optimisations to FPU handlingStuart Menefy2009-11-243-17/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of small optimisations to FPU handling, in particular: - move the task USEDFPU flag from the thread_info flags field (which is accessed asynchronously to the thread) to a new status field, which is only accessed by the thread itself. This allows locking to be removed in most cases, or can be reduced to a preempt_lock(). This mimics the i386 behaviour. - move the modification of regs->sr and thread_info->status flags out of save_fpu() to __unlazy_fpu(). This gives the compiler a better chance to optimise things, as well as making save_fpu() symmetrical with restore_fpu() and init_fpu(). - implement prepare_to_copy(), so that when creating a thread, we can unlazy the FPU prior to copying the thread data structures. Also make sure that the FPU is disabled while in the kernel, in particular while booting, and for newly created kernel threads, In a very artificial benchmark, the execution time for 2500000 context switches was reduced from 50 to 45 seconds. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | Merge branch 'master' into sh/st-integrationPaul Mundt2009-11-2416-333/+1140
|\ \
| * \ Merge branch 'sh/stable-updates'Paul Mundt2009-11-182-2/+2
| |\ \ | | |/
| * | sh: Fix up the CONFIG_PERF_EVENTS=n build for SH-4.Paul Mundt2009-11-121-4/+5
| | | | | | | | | | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: perf events: Document SH-4A raw event codes.Paul Mundt2009-11-091-0/+38
| | | | | | | | | | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: perf events: Add support for SH7750-style counters.Paul Mundt2009-11-052-0/+258
| | | | | | | | | | | | | | | | | | | | | This adds perf events support for the SH7750/SH7750S/SH7091 performance counters. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Default-enable SPU clock for SH7724.Paul Mundt2009-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Wanted by the SPU2 UIO driver, which really ought to be handling this itself. Default enable it for now, until the driver gets a bit more intelligent. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: sh7724: Add SPU2 supportKuninori Morimoto2009-11-051-0/+68
| | | | | | | | | | | | | | | Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Add RWDT save/restore code for sh7724 R-standbyMagnus Damm2009-11-041-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add sh7724 code to save and restore RWDT state during R-standby. Without this patch the watchdog will generate a reset shortly after resuming from R-standby. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Add R-standby sleep mode supportMagnus Damm2009-10-302-7/+18
| | | | | | | | | | | | | | | | | | | | | Add R-standby specific bits to the SuperH Mobile sleep code. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Use RSMEM for sleep code on sh7724Magnus Damm2009-10-301-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | Use RSMEM instead of ILMEM for sleep mode code storage on SH7724. This allows us to use R-standby mode on SH7724. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Add MMU and Cache handling sleep mode codeMagnus Damm2009-10-302-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add MMU and cache handling functionality to the SuperH Mobile sleep code. The MMU and cache registers are saved and restored. The MMU is disabled and the cache is flushed and disabled before entering sleep modes if the SUSP_SH_MMU flag is set. This flag should be set in the case of R-standby and most likely for future U-standby support as well. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Keep track of allowed sleep modesMagnus Damm2009-10-302-18/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code to keep track of supported sleep modes. This to only export cpuidle modes that are backed by board support code. Also, do not allow suspend-to-ram if sdram board code is missing. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Rework SuperH Mobile sleep mode codeMagnus Damm2009-10-302-164/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the SuperH Mobile sleep code from including board specific code to allowing each board to provide pre/post code snippets. These snippets should contain sdram management code to enter and leave self-refresh. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Allow boards to register memory pre/post sleep codeMagnus Damm2009-10-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code to allow boards registering self-contained functions for going to/from self-refresh. At this point the board code is unused. When all supported boards have been converted then the new sleep code will make use of these functions. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
OpenPOWER on IntegriCloud