aboutsummaryrefslogtreecommitdiffstats
path: root/arch (follow)
AgeCommit message (Collapse)AuthorFilesLines
2009-08-24sh: Use internal watchdog timer to perform resetJon Frosdick1-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>
2009-08-24sh: kgdb: do not reload VBR while handling debugger breackpointGiuseppe Cavallaro1-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>
2009-08-24sh: Allow use of GENERIC_IOMAPDavid McKay3-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>
2009-08-24sh: Improve unwind info for signalsCarl Shaw1-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>
2009-08-24sh: cleanup of do_address_error()Andre Draszik1-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>
2009-08-24sh: Allow user control over misaligned fixup handlingAndre Draszik1-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>
2009-08-24sh: ratelimit unaligned fixupsAndre Draszik1-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>
2009-08-23Merge branches 'sh/hwblk' and 'sh/pm-runtime'Paul Mundt95-523/+1693
2009-08-23sh: drop static UIO clocks for sh7722, sh7723 and sh7724Magnus Damm3-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>
2009-08-23sh: let ARCH_SHMOBILE select PM and PM_RUNTIMEMagnus Damm1-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>
2009-08-23sh: Fix section mismatch in platform bus notifier.Paul Mundt1-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>
2009-08-23sh: Runtime PM for SuperH Mobile platform bus devicesMagnus Damm4-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>
2009-08-23Merge branch 'sh/hwblk' into sh/pm-runtimePaul Mundt98-1087/+5776
2009-08-23Merge branch 'master' into for-linusRafael J. Wysocki2-11/+13
2009-08-22sh: unwinder: cacheline align slab cache objects.Paul Mundt1-2/+5
The CIE and FDE structs are big enough and accessed regularly enough in certain configurations to make cacheline alignment useful. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-22Merge branch 'sh/dwarf-unwinder'Paul Mundt10-130/+265
Conflicts: arch/sh/kernel/cpu/sh3/entry.S
2009-08-22sh64: dummy unwinder BUG wrappers.Paul Mundt1-0/+5
sh64 does not yet support GENERIC_BUG, but still wants unwinder support. Alias UNWINDER_BUG and UNWINDER_BUG_ON to their BUG counterparts until the conversion to GENERIC_BUG is completed. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-22sh: unwinder: Use a special bug flag for unwinder traps.Paul Mundt4-35/+24
This simplifies the unwinder trap handling, dropping the use of the special trapa vector and simply piggybacking on top of the BUG support. A new BUGFLAG_UNWINDER is added for flagging the unwinder fault, before continuing on with regular BUG dispatch. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-22Merge branch 'sh/dwarf-unwinder' of git://github.com/mfleming/linux-2.6 into sh/dwarf-unwinderPaul Mundt10-105/+252
2009-08-22sh: Export unwind_stack() to satisfy modular oprofile.Paul Mundt1-0/+2
If the oprofile code is built as a module, unwind_stack() as used by the oprofile backtrace code is not available, causing build breakage. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-21x86: don't call '->send_IPI_mask()' with an empty maskLinus Torvalds1-11/+10
As noted in 83d349f35e1ae72268c5104dbf9ab2ae635425d4 ("x86: don't send an IPI to the empty set of CPU's"), some APIC's will be very unhappy with an empty destination mask. That commit added a WARN_ON() for that case, and avoided the resulting problem, but didn't fix the underlying reason for why those empty mask cases happened. This fixes that, by checking the result of 'cpumask_andnot()' of the current CPU actually has any other CPU's left in the set of CPU's to be sent a TLB flush, and not calling down to the IPI code if the mask is empty. The reason this started happening at all is that we started passing just the CPU mask pointers around in commit 4595f9620 ("x86: change flush_tlb_others to take a const struct cpumask"), and when we did that, the cpumask was no longer thread-local. Before that commit, flush_tlb_mm() used to create it's own copy of 'mm->cpu_vm_mask' and pass that copy down to the low-level flush routines after having tested that it was not empty. But after changing it to just pass down the CPU mask pointer, the lower level TLB flush routines would now get a pointer to that 'mm->cpu_vm_mask', and that could still change - and become empty - after the test due to other CPU's having flushed their own TLB's. See http://bugzilla.kernel.org/show_bug.cgi?id=13933 for details. Tested-by: Thomas Björnell <thomas.bjornell@gmail.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-08-21x86: don't send an IPI to the empty set of CPU'sLinus Torvalds1-0/+3
The default_send_IPI_mask_logical() function uses the "flat" APIC mode to send an IPI to a set of CPU's at once, but if that set happens to be empty, some older local APIC's will apparently be rather unhappy. So just warn if a caller gives us an empty mask, and ignore it. This fixes a regression in 2.6.30.x, due to commit 4595f9620 ("x86: change flush_tlb_others to take a const struct cpumask"), documented here: http://bugzilla.kernel.org/show_bug.cgi?id=13933 which causes a silent lock-up. It only seems to happen on PPro, P2, P3 and Athlon XP cores. Most developers sadly (or not so sadly, if you're a developer..) have more modern CPU's. Also, on x86-64 we don't use the flat APIC mode, so it would never trigger there even if the APIC didn't like sending an empty IPI mask. Reported-by: Pavel Vilim <wylda@volny.cz> Reported-and-tested-by: Thomas Björnell <thomas.bjornell@gmail.com> Reported-and-tested-by: Martin Rogge <marogge@onlinehome.de> Cc: Mike Travis <travis@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-08-21sh: Handle the DWARF op, DW_CFA_undefinedMatt Fleming2-2/+14
Allow a DWARF register to have an undefined value. When applied to the DWARF return address register this lets lets us label a function as having no direct caller, e.g. kernel_thread_helper(). Signed-off-by: Matt Fleming <matt@console-pimps.org>
2009-08-21sh: Fix bug calculating the end of the FDE instructionsMatt Fleming1-3/+4
The 'end' member of struct dwarf_fde denotes one byte past the end of the CFA instruction stream for an FDE. The value of 'end' was being calcualted incorrectly, it was being set too high. This resulted in dwarf_cfa_execute_insns() interpreting data past the end of valid instructions, thus causing all sorts of weird crashes. Signed-off-by: Matt Fleming <matt@console-pimps.org>
2009-08-21sh: Setup the frame pointer in handle_interruptMatt Fleming1-0/+2
When CONFIG_DWARF_UNWINDER is enabled setup r14 in handle_interrupt, so that we can figure out what function was running when we were interrupted. Signed-off-by: Matt Fleming <matt@console-pimps.org>
2009-08-21sh: unwinder: Introduce UNWINDER_BUG() and UNWINDER_BUG_ON()Matt Fleming8-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>
2009-08-21sh: unwinder: Set the flags for DW_CFA_val_offset ops as DWARF_VAL_OFFSETMatt Fleming2-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>
2009-08-21sh: unwinder: Fix memory leak and create our own kmem cacheMatt Fleming2-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>
2009-08-21sh: Add initial support for SH7757 CPU subtypeYoshihiro Shimoda12-7/+2935
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-21sh: update kfr2r09 defconfigMagnus Damm1-15/+197
Update the kfr2r09 defconfig with support for LCDC and USB gadget. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-21sh: add kfr2r09 romimage defconfigMagnus Damm1-0/+774
Add romImage defconfig for the kfr2r09 board. This defconfig should be used to build the kernel based boot loader. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-21sh: jump to p1 during boot on kfr2r09Magnus Damm1-0/+13
Add a P1 jump to the the kfr2r09 romimage code. With this patch applied the initial zImage assembly code will run with instruction cache enabled. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-21sh: invalidate icache and tlbs during boot on kfr2r09Magnus Damm1-0/+6
Add instruction cache and TLB invalidation code for the the kfr2r09 romimage target. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-21sh: i2c compile fix for kfr2r09Magnus Damm1-0/+7
Fix the kfr2r09 board code so it compiles if CONFIG_I2C=n. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20Merge branch 'master' into for-linusRafael J. Wysocki15-102/+133
2009-08-20sh: enable rtc-ds1302 in snapgear_defconfig.Paul Mundt1-5/+72
This is the only board that presently supports this rtc, so make sure it is enabled by default to get some build coverage. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20sh: DSP save/restore ordering and a0 sign extension fixups.Paul Mundt1-13/+13
As an excellent indicator of how much testing the DSP code gets, a couple of rather glaring bugs in the DSP save/restore paths were found: - In the DSP restore case a0 needs to be popped off before a0g, or the value of a0g is clobbered by the MSB of a0 in the case of sign extension. - Beyond that, the save and restore orders were out of sync, so this fixes that up as well. At the same time, we switch over to using movs.l for both the save and restore of the general DSP registers as opposed to using sts.l (which was initially put in place to work around a bug in ancient binutils versions which the kernel no longer supports). Reported-by: Chee Soon Yip <yip.cheesoon@renesas.com> Cc: Chu Lih Kwek <kwek.chulih@renesas.com>, Cc: General Lai <general.lai@renesas.com>, Cc: Robert Cozens <Robert.Cozens@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20sh: Better description of SH-4 PTEA register update.Michael Trimarchi2-3/+14
Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20sh: Fix up the CONFIG_FTRACE_SYSCALLS=n build.Paul Mundt1-0/+4
-tip can't be bothered keeping interfaces stable long enough for anyone to use them without having their builds broken without notification, so just ifdef around the problematic symbols until the new interfaces become available upstream. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20Merge branch 'sh/r8a66597-udc'Paul Mundt2-0/+136
2009-08-20sh: add r8a66597 usb1 gadget to the se7724 boardMagnus Damm1-0/+33
Add USB gadget support for port CN26 on the Solution Engine 7724 board. The r8a66597-udc driver is hooked up as a platform device and some registers are configured to enable the USB in gadget mode. The hardware driving the USB port is the on-chip USB1 block in the sh7724 processor configured as USB gadget controller. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20sh: add r8a66597 usb0 gadget to the kfr2r09 boardMagnus Damm1-0/+103
Add USB gadget support for port YC301 on the KFR2R09 board. The r8a66597-udc driver is hooked up as a platform device, clocks are enabled via I2C and some registers are configured to enable the USB in gadget mode. The hardware driving the USB port is the on-chip USB0 block in the sh7724 processor configured as USB gadget controller. This board is using external hardware to detect USB hotplug events and allows the processor to dynamically start and stop clocks. This well thought out hardware feature is unused at this point and plug and play is unfortunately unsupported. To properly support all hardware features the USB gadget stack may need some adjustment. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20sh: Add mach-types entry for EcoVec board.Paul Mundt1-0/+1
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-20sh: Add EcoVec (SH7724) board supportKuninori Morimoto5-0/+1696
This adds preliminary support for the EcoVec board. Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-19Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblazeLinus Torvalds8-85/+99
* 'next' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: Update Microblaze defconfigs microblaze: Use klimit instead of _end for memory init microblaze: Enable ppoll syscall microblaze: Sane handling of missing timer/intc in device tree microblaze: use the generic ack_bad_irq implementation
2009-08-19sh: Add SH7724 support to NR_ONCHIP_DMA_CHANNELSKuninori Morimoto1-3/+3
This patch also update help comment Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-19sh: USB0 resource area fix for ms7724seKuninori Morimoto1-1/+1
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-18Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpuLinus Torvalds2-9/+9
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: percpu: use the right flag for get_vm_area() percpu, sparc64: fix sparse possible cpu map handling init: set nr_cpu_ids before setup_per_cpu_areas()
2009-08-18Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tipLinus Torvalds5-8/+25
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86, mce: Don't initialize MCEs on unknown CPUs x86, mce: don't log boot MCEs on Pentium M (model == 13) CPUs x86: Annotate section mismatch warnings in kernel/apic/x2apic_uv_x.c x86, mce: therm_throt: Don't log redundant normality x86: Fix UV BAU destination subnode id
2009-08-18Merge branch 'master' into for-linusRafael J. Wysocki57-396/+1094