summaryrefslogtreecommitdiffstats
path: root/arch/sh
Commit message (Collapse)AuthorAgeFilesLines
* sh: Only shout about fixing up unexpected unaligned accessesMatt Fleming2009-08-293-6/+8
| | | | | | | | | Some unaligned accesses are completely expected. For example, the trapped_io code uses the unaligned access fixup code path so there's no need to warn about having to fixup the unaligned access. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: sh7785lcr: fix prototype board on 32bit MMU mode.Yoshihiro Shimoda2009-08-284-0/+28
| | | | | | | | Fix up PCA9564 resources on 32bit MMU mode using prototype board. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Tested-by: Raul Porcel <armin76@gentoo.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Tidy up watchdog build for SH-2.Paul Mundt2009-08-281-9/+10
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add LCDC Panel support for EcoVec24Kuninori Morimoto2009-08-271-2/+28
| | | | | Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add CEU support for EcoVec24Kuninori Morimoto2009-08-271-0/+109
| | | | | Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add support LCDC for EcoVec24Kuninori Morimoto2009-08-271-0/+109
| | | | | Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add USB support for EcoVec24Kuninori Morimoto2009-08-271-0/+97
| | | | | Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add SH-ETH support for EcoVec24Kuninori Morimoto2009-08-271-1/+52
| | | | | Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: modify to enable boot for EcoVec24Kuninori Morimoto2009-08-272-25/+28
| | | | | Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: fix CPU_SH7723/7724 numbering bugKuninori Morimoto2009-08-271-1/+1
| | | | | Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix an off-by-1 in FTRACE_SYSCALL_MAX.Paul Mundt2009-08-251-1/+1
| | | | | | | | | | This is supposed to be the equivalent of __NR_syscalls, not __NR_syscalls -1. The x86 code this was based on had simply fallen out of sync at the time this was implemented. Fix it up now. As a result, tracing of __NR_perf_counter_open works as advertised. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* Merge branch 'sh/st-integration'Paul Mundt2009-08-2427-116/+452
|\
| * sh: Simplify "multi-evt" interrupt handling.Pawel Moll2009-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the way in which "multi-evt" interrups are handled. The intc_evt2irq_table and related intc_evt2irq() have been removed and the "redirecting" handler is installed for the coupled interrupts. Thanks to that the do_IRQ() function don't have to use another level of indirection for all the interrupts... Signed-off-by: Pawel Moll <pawel.moll@st.com> Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: fix sys_cacheflush error checkingGiuseppe Cavallaro2009-08-242-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | sys_cacheflush should return with EINVAL if the cache parameter is not one of ICACHE, DCACHE or BCACHE. So, we need to include 0 in the first check. It also adds the three definitions above as wrapper of the existent macros. PS: ltp cacheflush01 test now passes. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Fix problems with cache flushing when cache is in write-through modeStuart Menefy2009-08-241-0/+34
| | | | | | | | | | | | | | | | Change the method used to flush the cache in write-through mode to avoid corrupted data being written back to memory. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Fix overzealous checking in __ioremap()Stuart Menefy2009-08-241-8/+0
| | | | | | | | | | | | | | Allow peripherals before the start of RAM to be remapped. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Fixes some write posting issues in the interrupt handling for SHStuart Menefy2009-08-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | It is possible for the CPU to re-enable it's interrupt block bit before the write to the interrupt controller has actually masked out the external interupt at the controller. We get around this by reading back from the interrupt controller which will ensure the write has happened. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Fix underflow in SH udelay() code.Stuart Menefy2009-08-241-2/+3
| | | | | | | | | | Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Add sys_cacheflush() call for SH CPUs.Stuart Menefy2009-08-247-5/+60
| | | | | | | | | | | | | | | | | | | | | | Adds a system call to allow user code to flush code from the cache. You can use instructions for the data side, but the iside can only be done by a flush ROM which really only works with a direct mapped cache. The later SH4's have 2 way Iside, so this call allows a portable way to flush the cache. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Improve comments int SH4 cache flushing codeStuart Menefy2009-08-241-0/+11
| | | | | | | | | | | | | | | | This is a pure documentation, to try to explain why the cache flushing code for the SH4 is implemented the way it is. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Optimise memcpy_to/fromio for SH4Stuart Menefy2009-08-241-21/+72
| | | | | | | | | | | | | | | | | | | | Optimise memcpy_to/fromio. This is used extensivly by MTD, so is a worthwhile performance gain. The main savings come from not repeatedly calling readl/writel, and doing word instead of byte at a time transfers. Also using "movca.l" on SH4 gives a small performance win. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: generic_in/outs{bwl} optimizations.Stuart Menefy2009-08-241-42/+8
| | | | | | | | | | | | | | | | | | After performing the port2addr conversion, and checking that the data is correctly aligned, simply call __raw_readsX/writesX. These have already been optimised. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Read from CCN_PVR instead of ROM for delay.Stuart Menefy2009-08-241-1/+5
| | | | | | | | | | | | | | | | Reading from the ROM is not a good idea as it could disturb some flash operation that it is in progress. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Remove implicit sign extension from assembler immediatesStuart Menefy2009-08-245-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SH instruction set has several instructions which accept an 8 bit immediate operand. For logical instructions this operand is zero extended, for arithmetic instructions the operand is sign extended. After adding an option to the assembler to check this, it was found that several pieces of assembly code were assuming this behaviour, and in one case getting it wrong. So this patch explicitly sign extends any immediate operands, which makes it obvious what is happening, and fixes the one case which got it wrong. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Allow for kernel command line concatenation.Pawel Moll2009-08-242-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far kernel command line arguments could be passed in by a bootloader or defined as CONFIG_CMDLINE, which completely overwriting the first one. This change allows a developer to declare selected kernel parameters in a kernel configuration (eg. project-specific defconfig), retaining possibility of passing others by a bootloader. The obvious examples of the first type are MTD partition or bigphysarea-like region definitions, while "debug" option or network configuration should be given by a bootloader or a JTAG boot script. Signed-off-by: Pawel Moll <pawel.moll@st.com> Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Use internal watchdog timer to perform resetJon Frosdick2009-08-241-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | This patches will trigger a reboot using the watchdog timer instead of double fault. Unlike the previous method, this one actually works in 32 bit mode. Reset should also be cleaner. Signed-off-by: Jon Frosdick <jon.frosdick@st.com> Signed-off-by: Carl Shaw <carl.shaw@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: kgdb: do not reload VBR while handling debugger breackpointGiuseppe Cavallaro2009-08-241-2/+0
| | | | | | | | | | | | | | | | | | Save the VBR allowing GDB to dump full registers set but do not reload it as soon as the kgdb_handle_exception is invoked. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Allow use of GENERIC_IOMAPDavid McKay2009-08-243-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The synopsys PCI cell used in the later STMicro chips requires code to be run in order to do IO cycles, rather than just memory mapping the IO space. Rather than extending the existing SH infrastructure to allow this, use the GENERIC_IOMAP implmentation to save re-inventing the wheel. This set of changes allows the SH to be built with GENERIC_IOMAP enabled, it just ifdef's out the functions provided by the GENERIC_IOMAP implementation, and provides a few required missing functions. Signed-off-by: David McKay <david.mckay@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Improve unwind info for signalsCarl Shaw2009-08-241-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC does not issue unwind information for function epilogues. Unfortunately we can catch a signal during an epilogue. The signal handler writes the current context and signal return code onto the stack overwriting previous contents. During unwinding, libgcc can try to restore registers from the stack and restores corrupted ones. This can lead to segmentation, misaligned access and sigbus faults. For example, consider the following code: mov.l r12,@-r15 mov.l r14,@-r15 sts.l pr,@-r15 mov r15,r14 <do stuff> mov r14, r15 lds.l @r15+, pr <<< SIGNAL HERE mov.l @r15+, r14 mov.l @r15+, r12 rts Unwind is aware that pr was pushed to stack in prolog, so tries to restore it. Unfortunately it restores the last word of the signal handler code placed on the stack by the kernel. This patch tries to avoid the problem by adding a guard region on the stack between where the function pushes data and where the signal handler pushes its return code. We probably don't see this problem often because exception handling unwinding in an epilogue only occurs due to a pthread cancel signal. Also the kernel signal stack handler alignment of 8 bytes could hide the occurance of this problem sometimes as the stack may not be trampled at a particular required word. This is not guaranteed to always work. It relies on a frame pointer existing for the function (so it can get the correct sp value) which is not always the case for the SH4. Modifications will also be made to libgcc for the case where there is no fp. Signed-off-by: Carl Shaw <carl.shaw@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: cleanup of do_address_error()Andre Draszik2009-08-241-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a few problems with the existing code in do_address_error(). a) the variable used to printk()d the offending instruction wasn't initialized correctly. This is a fix to bug 5727 b) behaviour for CONFIG_CPU_SH2A wasn't correct c) the 'ignore address error' behaviour didn't update the PC, causing an infinite loop. Signed-off-by: Andre Draszik <andre.draszik@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Allow user control over misaligned fixup handlingAndre Draszik2009-08-241-0/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch brings the SH4 misaligned trap handler in line with what happens on ARM: Add a /proc/cpu/alignment which can be read from to get alignment trap statistics and written to to influence the behaviour of the alignment trap handling. The value to write is a bitfield, which has the following meaning: 1 warn, 2 fixup, 4 signal In addition, we add a /proc/cpu/kernel_alignment, to enable or disable warnings in case of kernel code causing alignment errors. Signed-off by: Andre Draszik <andre.draszik@st.com> Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: ratelimit unaligned fixupsAndre Draszik2009-08-241-13/+4
| | | | | | | | | | | | | | | | | | | | This patch makes sure we see messages about unaligned access fixups every now and then. Else especially userspace apps suffering from bad programming won't ever be noticed... Signed-off by: Andre Draszik <andre.draszik@st.com> Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Move the FTRACE_SYSCALL_MAX definition in to asm/ftrace.h.Paul Mundt2009-08-242-2/+1
|/ | | | | | Needed by ftrace changes in -tip. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* Merge branches 'sh/hwblk' and 'sh/pm-runtime'Paul Mundt2009-08-2316-12/+491
|\
| * sh: drop static UIO clocks for sh7722, sh7723 and sh7724Magnus Damm2009-08-233-10/+10
| | | | | | | | | | | | | | | | | | | | The Runtime PM patch for UIO driver implements coarse grained dynamic power management for UIO devices. With that patch in place we can get rid of the static clock configuration. Which in turn makes it possible for cpuidle to enter deeper sleep. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: let ARCH_SHMOBILE select PM and PM_RUNTIMEMagnus Damm2009-08-231-0/+2
| | | | | | | | | | | | | | | | | | | | With the Runtime PM driver changes in place, we must have Runtime PM support in place. Otherwise there is no way to enable clocks to the Runtime PM enabled hardware blocks. This patch makes Runtime PM mandatory on SuperH Mobile. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Fix section mismatch in platform bus notifier.Paul Mundt2009-08-231-3/+2
| | | | | | | | | | | | | | | | The runtime PM for SH-Mobile code had platform_bus_notify() as __devinit, which is rather bogus. Kill off the annotation, which subsequently silences the section mismatch warnings. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Runtime PM for SuperH Mobile platform bus devicesMagnus Damm2009-08-234-1/+317
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is V3 of the SuperH Mobile Runtime PM platform bus implentation matching Rafael's Runtime PM v16. The code gets invoked from the SuperH specific Runtime PM platform bus functions that override the weak symbols for: - platform_pm_runtime_suspend() - platform_pm_runtime_resume() - platform_pm_runtime_idle() This Runtime PM implementation performs two levels of power management. At the time of platform bus runtime suspend the clock to the device is stopped instantly. Later on if all devices within the power domain has their clocks stopped then the device driver ->runtime_suspend() callbacks are used to save hardware register state for each device. Device driver ->runtime_suspend() calls are scheduled from cpuidle context using platform_pm_runtime_suspend_idle(). When all devices have been fully suspended the processor is allowed to enter deep sleep from cpuidle. The runtime resume operation turns on clocks and also restores registers if needed. It is worth noting that the devices start in a suspended state and the device driver is responsible for calling runtime resume before accessing the actual hardware. In this particular platform bus implementation runtime resume is not allowed from interrupt context. Runtime suspend is however allowed from interrupt context as long as the synchronous functions are avoided. [ updated for v17 -- PFM. ] Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Runtime PM pdev hwblk - kfr2r09 LCDCMagnus Damm2009-08-151-0/+3
| | | | | | | | | | | | | | This patch simply adds LCDC hwblk_id data for the kfr2r09 board. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * Merge branch 'master' into sh/hwblkPaul Mundt2009-08-1542-204/+2462
| |\
| * | sh: Runtime PM pdev hwblk - Solution Engine 7724Magnus Damm2009-08-041-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | Add hwblk_id to Solution Engine 7724 board specific on-chip sh7724 platform devices. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Runtime PM pdev hwblk - kfr2r09Magnus Damm2009-08-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Add hwblk_id to kfr2r09 board specific on-chip sh7724 platform devices. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Runtime PM pdev hwblk - sh7724Magnus Damm2009-08-041-0/+43
| | | | | | | | | | | | | | | | | | | | | Add hwblk_id to on-chip sh7724 platform devices. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Runtime PM pdev hwblk - AP325RXAMagnus Damm2009-08-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Add hwblk_id to AP325RXA board specific on-chip sh7723 platform devices. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Runtime PM pdev hwblk - sh7723Magnus Damm2009-08-041-0/+40
| | | | | | | | | | | | | | | | | | | | | Add hwblk_id to on-chip sh7723 platform devices. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Runtime PM pdev hwblk - Solution Engine 7722Magnus Damm2009-08-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add hwblk_id to Solution Engine 7722 board specific on-chip sh7722 platform devices. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Runtime PM pdev hwblk - Migo-RMagnus Damm2009-08-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Add hwblk_id to Migo-R board specific on-chip sh7722 platform devices. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Runtime PM pdev hwblk - sh7722Magnus Damm2009-08-041-0/+31
| | | | | | | | | | | | | | | | | | | | | Add hwblk_id to on-chip sh7722 platform devices. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Runtime PM pdev hwblkMagnus Damm2009-08-041-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These patches extend struct platform device data for a bunch of SuperH Mobile processors and embedded boards. The patches simply add hardware block ids to on-chip platform devices. Platform devices off chip (such as external ethernet controllers or flash chips) are left out which gives them a special case hardware block id of zero. Upcoming Runtime PM code will make use of the hardware block id to group devices together. The hardware block id can also be used to extend the SuperH Mobile clock framework implementation. This series of patches depend on the following: "Driver Core: Add platform device arch data V3". This patch adds a hwblk_id member to struct pdev_archdata. This member should be used to point out on-chip hardware block id. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | Merge branch 'for-linus' of ↵Paul Mundt2009-08-042-12/+4
| |\ \ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6 into sh/hwblk
OpenPOWER on IntegriCloud