summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
Commit message (Collapse)AuthorAgeFilesLines
* sh: Mass ctrl_in/outX to __raw_read/writeX conversion.Paul Mundt2010-01-2640-203/+203
| | | | | | | | | | | 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-215-17/+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: Track the uncached mapping size.Paul Mundt2010-01-211-1/+9
| | | | | | | | | This provides a variable for tracking the uncached mapping size, and uses it for pretty printing the uncached lowmem range. Beyond this, we'll also be building on top of this for figuring out from where the remainder of P2 becomes usable when constructing unrelated mappings. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Rework P2 to only include kernel text.Paul Mundt2010-01-211-77/+92
| | | | | | | | | | | | | | | | This effectively neutralizes P2 by getting rid of P1 identity mapping for all available memory and instead only establishes a single unbuffered PMB entry (16MB -- the smallest available) that covers the kernel. As using segmentation for abusing caching attributes in drivers is no longer supported (and there are no drivers that can be enabled in 32-bit mode that do this), this provides us with all of the uncached access needs by the kernel itself. Drivers and their ilk need to specify their caching attributes when remapping through page tables, as usual. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: initial PMB mapping iteration by helper macro.Paul Mundt2010-01-211-147/+60
| | | | | | | | | All of the cached/uncached mapping setup is duplicated for each size, and also misses out on the 16MB case. Rather than duplicating the same iter code for that we just consolidate it in to a helper macro that builds an iter for each size. The 16MB case is then trivially bolted on at the end. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: machine_ops based reboot support.Paul Mundt2010-01-207-90/+115
| | | | | | | | | | This provides a machine_ops-based reboot interface loosely cloned from x86, and converts the native sh32 and sh64 cases over to it. Necessary both for tying in SMP support and also enabling platforms like SDK7786 to add support for their microcontroller-based power managers. 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-192-3/+4
| | | | | | | 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-193-62/+8
| | | | | | | 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-195-28/+28
| | | | | | | 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>
* Merge branch 'sh/ioremap-fixed'Paul Mundt2010-01-181-3/+4
|\
| * sh: Add fixed ioremap supportMatt Fleming2010-01-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Some devices need to be ioremap'd and accessed very early in the boot process. It is not possible to use the standard ioremap() function in this case because that requires kmalloc()'ing some virtual address space and kmalloc() may not be available so early in boot. This patch provides fixmap mappings that allow physical address ranges to be remapped into the kernel address space during the early boot stages. Signed-off-by: Matt Fleming <matt@console-pimps.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: Setup early PMB mappings.Matt Fleming2010-01-181-0/+241
|/ | | | | | | | | | | | | | | | | | | | | | More and more boards are going to start shipping that boot with the MMU in 32BIT mode by default. Previously we relied on the bootloader to setup PMB mappings for use by the kernel but we also need to cater for boards whose bootloaders don't set them up. If CONFIG_PMB_LEGACY is not enabled we have full control over our PMB mappings and can compress our address space. Usually, the distance between the the cached and uncached mappings of RAM is always 512MB, however we can compress the distance to be the amount of RAM on the board. pmb_init() now becomes much simpler. It no longer has to calculate any mappings, it just has to synchronise the software PMB table with the hardware. Tested on SDK7786 and SH7785LCR. Signed-off-by: Matt Fleming <matt@console-pimps.org> 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: fixed PMB mode refactoring.Paul Mundt2010-01-133-12/+10
| | | | | | | | | | | | | | | | | | | | | | This introduces some much overdue chainsawing of the fixed PMB support. fixed PMB was introduced initially to work around the fact that dynamic PMB mode was relatively broken, though they were never intended to converge. The main areas where there are differences are whether the system is booted in 29-bit mode or 32-bit mode, and whether legacy mappings are to be preserved. Any system booting in true 32-bit mode will not care about legacy mappings, so these are roughly decoupled. Regardless of the entry point, PMB and 32BIT are directly related as far as the kernel is concerned, so we also switch back to having one select the other. With legacy mappings iterated through and applied in the initialization path it's now possible to finally merge the two implementations and permit dynamic remapping overtop of remaining entries regardless of whether boot mappings are crafted by hand or inherited from the boot loader. 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-1317-383/+1030
|\ \ \
| | * | sh: Kill off dead UBC headers.Paul Mundt2010-01-052-13/+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-053-72/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | sh: Fix up breakpoint trap handler patching on SH-2A.Paul Mundt2010-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | SH-2A was referencing the old handler that no longer exists, fix it up. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| | * | sh: Convert ptrace to hw_breakpoint API.Paul Mundt2009-12-282-3/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the initial step for converting singlestep handling via ptrace over to hw_breakpoints. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| | * | sh: kgdb: Rework breakpoint handling on top of notifier chain.Paul Mundt2009-12-222-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This kills off kgdb's breakpoint handler and ties in to the notifier chain instead. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| | * | sh: Don't NOTIFY_STOP for non-UBC breakpoint traps.Paul Mundt2009-12-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Presently the hw_breakpoint code is the primary notifier dispatch for breakpoint traps, although it's only UBC traps that are of particular interest there. This patches in a check to allow non-UBC generated breakpoints to pass through down the remainder of the notifier chain, giving things like kgdb a chance at getting notified. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| | * | sh: Fix up hw-breakpoints build for API changes.Paul Mundt2009-12-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The event callback handling has been removed in favour of going through a generic event handler to handle overflows. Follows the x86 change. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| | * | Merge branch 'master' into sh/hw-breakpointsPaul Mundt2009-12-2141-1050/+1535
| | |\ \ | | | |/
| | * | Merge branch 'master' into sh/hw-breakpointsPaul Mundt2009-12-0849-1188/+2430
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-085-108/+424
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-139-250/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Use SLAB_PANIC for thread_info slab cache.Paul Mundt2010-01-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Presently this has a BUG_ON() for failure cases, as powerpc does. Switch this over to a SLAB_PANIC instead. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | | | sh: Always provide thread_info allocators.Paul Mundt2010-01-122-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Presently the thread_info allocators are special cased, depending on THREAD_SHIFT < PAGE_SHIFT. This provides a sensible definition for them regardless of configuration, in preparation for extended CPU state. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | | | sh: Move start_thread() out of line.Paul Mundt2010-01-121-0/+12
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | start_thread() will become a bit heavier with the xstate freeing to be added in, so move it out-of-line in preparation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | | sh: sh_bios detection.Paul Mundt2010-01-121-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds some VBR sanity checks in the sh_bios code to ensure that the BIOS VBR is in range before blindly trapping in to it. This permits boards with varying boot loader configurations to always leave support for sh-bios enabled and it will just be disabled at run-time if not found. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | | sh: Split out the unaligned counters and user bits.Paul Mundt2010-01-121-134/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This splits out the unaligned access counters and userspace bits in to their own generic interface, which will allow them to be wired up on sh64 too. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | | sh: Consolidate the sh_bios earlyprintk code.Paul Mundt2010-01-123-88/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the sh-sci earlyprintk is taken care of by the sh-sci driver directly, there's no longer any reason for having a split-out early_printk framework. sh_bios is the only other thing that uses it, so we just migrate the leftovers in to there. As it's possible to have multiple early_param()'s for the same string, there's not much point in having this split out anymore anyways, particularly since the sh_bios dependencies are still special-cased within sh-sci itself. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | | sh: Kill off more unused sh_bios callbacks.Paul Mundt2010-01-121-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | sh_bios_char_out() is not used by anything in-tree these days, so just get rid of it. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | | sh64: Fix up early serial fixmap.Paul Mundt2010-01-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was conditionalized on CONFIG_EARLY_PRINTK, which has subsequently gone away. Now that the serial driver always supports the early console, make sure we always establish the mapping. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | | sh: Tidy up the sh bios VBR handling.Paul Mundt2010-01-123-31/+43
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | This moves the VBR handling out of the main trap handling code and in to the sh-bios helper code. A couple of accessors are added in order to permit other kernel code to get at the VBR value for state save/restore paths. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: Only use bl bit toggling for sleeping idle.Paul Mundt2009-12-211-2/+2
| | | | | | | | | | | | | | | | | | | | | We don't actually require this in the cpu_relax() polling case, so just cuddle these around the sleeping version. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: Restore bl bit toggling in idle loop.Paul Mundt2009-12-211-0/+2
| | | | | | | | | | | | | | | | | | | | | This fixes up some crashes with IRQs racing the need_resched() test under QEMU. 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>
* | | Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6Linus Torvalds2009-12-1637-1018/+1500
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (33 commits) sh: Fix test of unsigned in se7722_irq_demux() sh: mach-ecovec24: Add FSI sound support sh: mach-ecovec24: Add mt9t112 camera support sh: mach-ecovec24: Add tw9910 support sh: MSIOF/mmc_spi platform data for the Ecovec24 board sh: ms7724se: Add ak4642 support sh: Fix up FPU build for SH5 sh: Remove old early serial console code V2 sh: sh5 scif pdata (sh5-101/sh5-103) sh: sh4a scif pdata (sh7757/sh7763/sh7770/sh7780/sh7785/sh7786/x3) sh: sh4a scif pdata (sh7343/sh7366/sh7722/sh7723/sh7724) sh: sh4 scif pdata (sh7750/sh7760/sh4-202) sh: sh3 scif pdata (sh7705/sh770x/sh7710/sh7720) sh: sh2a scif pdata (sh7201/sh7203/sh7206/mxg) sh: sh2 scif pdata (sh7616) sh-sci: Extend sh-sci driver with early console V2 sh: Stub in P3 ioremap support for nommu parts. sh: wire up vmallocinfo support in ioremap() implementations. sh: Make the unaligned trap handler always obey notification levels. sh: Couple kernel and user write page perm bits for CONFIG_X2TLB ...
| * \ \ Merge branch 'master' of ↵Paul Mundt2009-12-151-26/+2
| |\ \ \ | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
| * | | | sh: Fix up FPU build for SH5Matt Fleming2009-12-155-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Remove old early serial console code V2Magnus Damm2009-12-152-149/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now when the sh-sci driver can do early serial output, get rid of the old duplicated code. This patch is V2 and removes support for "earlyprintk=serial" together with the following kconfig options: CONFIG_EARLY_SCIF_CONSOLE CONFIG_EARLY_SCIF_CONSOLE_PORT CONFIG_EARLY_PRINTK With this patch applied "earlyprintk=" support is always built-in the SuperH kernel. For this to work the serial driver must have early platform support and in the case of sh-sci the serial console needs to be enabled: CONFIG_SERIAL_SH_SCI_CONSOLE=y So after enabling the SuperH SCI console kconfig option you also need to point out port using the kernel command line: "earlyprintk=sh-sci.N[,baudrate][,keep]" Remember that clocks may be disabled by the boot loader so you may have to do some board specific static clock setup before earlyprintk will work on your platform. Signed-off-by: Magnus Damm <damm@opensource.se> 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>
OpenPOWER on IntegriCloud