aboutsummaryrefslogtreecommitdiff
path: root/arch/sh/include
AgeCommit message (Collapse)AuthorFilesLines
2009-09-11sh: add romimage-macros.hKuninori Morimoto2-69/+74
romimage macros which are used in kfr2r09 is very useful for other board. This patch divides kfr2r09's romimage.h into romimage-macros and partner-jet-setup. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-09-09PCI: remove pcibios_scan_all_fns()Alex Chiang1-1/+0
This was #define'd as 0 on all platforms, so let's get rid of it. This change makes pci_scan_slot() slightly easier to read. Cc: Yoshinori Sato <[email protected]> Cc: Tony Luck <[email protected]> Cc: David Howells <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Reviewed-by: Matthew Wilcox <[email protected]> Acked-by: Russell King <[email protected]> Acked-by: Ralf Baechle <[email protected]> Acked-by: Kyle McMartin <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Paul Mundt <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Alex Chiang <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
2009-09-09sh: Factor in cpu id for selection of cache colour fixmap.Paul Mundt1-3/+3
In the SMP VIPT case the page copy/clear ops still perform colouring, care needs to be taken that CPUs don't end up stepping on each other, so we give them a bit of room to work with. At the same time, we reduce the worst-case colouring given that these pages are always consumed. Signed-off-by: Paul Mundt <[email protected]>
2009-09-08dmaengine: sh: Add Support SuperH DMA Engine driverNobuhiro Iwamatsu1-0/+13
This supported all DMA channels, and it was tested in SH7722, SH7780, SH7785 and SH7763. This can not use with SH DMA API. Signed-off-by: Nobuhiro Iwamatsu <[email protected]> Reviewed-by: Matt Fleming <[email protected]> Acked-by: Maciej Sosnowski <[email protected]> Acked-by: Paul Mundt <[email protected]> Signed-off-by: Dan Williams <[email protected]>
2009-09-03sh: Fix up and optimize the kmap_coherent() interface.Paul Mundt3-2/+13
This fixes up the kmap_coherent/kunmap_coherent() interface for recent changes both in the page fault path and the shared cache flushers, as well as adding in some optimizations. One of the key things to note here is that the TLB flush itself is deferred until the unmap, and the call in to update_mmu_cache() itself goes away, relying on the regular page fault path to handle the lazy dcache writeback if necessary. Signed-off-by: Paul Mundt <[email protected]>
2009-09-01sh: Kill off kgdb's magical NMI debouncing.Paul Mundt1-3/+0
The kgdb stub has traditionally tied in to the NMI slot, and manually handled debounce. Now that we have a generic way to do this instead, all of the stub-specific debounce silliness can be killed off. Signed-off-by: Paul Mundt <[email protected]>
2009-09-01sh: nmi_debug support.Paul Mundt2-1/+2
This implements support for NMI debugging that was shamelessly copied from the avr32 port. A bit of special magic is needed in the interrupt exception path given that the NMI exception handler is stubbed in to the regular exception handling table despite being reported in INTEVT. So we mangle the lookup and kick off an EXPEVT-style exception dispatch from the INTEVT path for exceptions that do_IRQ() has no chance of handling. As a result, we also drop the evt2irq() conversion from the do_IRQ() path and just do it in assembly. Signed-off-by: Paul Mundt <[email protected]>
2009-09-01Merge branch 'master' into sh/smpPaul Mundt22-50/+411
Conflicts: arch/sh/mm/cache-sh4.c
2009-08-31sh: unwinder: Fix up uninitialized variable warnings on sh2a build.Paul Mundt1-1/+1
A couple of these popped up on the sh2a build, causing build failures. Signed-off-by: Paul Mundt <[email protected]>
2009-08-29sh: Only shout about fixing up unexpected unaligned accessesMatt Fleming1-1/+1
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 <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-29net: sh_eth: add value of ether_link pin in platform_dataYoshihiro Shimoda1-0/+3
The method of ETHER_LINK pin is board dependence. This patch adding paramters are: - no_ether_link : If set to 1, do not use ETHER_LINK - ether_link_active_low : If set to 1, ETHER_LINK is active low. Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2009-08-28sh: sh7785lcr: fix prototype board on 32bit MMU mode.Yoshihiro Shimoda1-0/+2
Fix up PCA9564 resources on 32bit MMU mode using prototype board. Signed-off-by: Yoshihiro Shimoda <[email protected]> Tested-by: Raul Porcel <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-28sh: Tidy up watchdog build for SH-2.Paul Mundt1-9/+10
Signed-off-by: Paul Mundt <[email protected]>
2009-08-25sh: Fix an off-by-1 in FTRACE_SYSCALL_MAX.Paul Mundt1-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 <[email protected]>
2009-08-24Merge branch 'sh/st-integration'Paul Mundt6-5/+38
2009-08-24sh: Move the FTRACE_SYSCALL_MAX definition in to asm/ftrace.h.Paul Mundt1-0/+1
Needed by ftrace changes in -tip. Signed-off-by: Paul Mundt <[email protected]>
2009-08-24sh: fix sys_cacheflush error checkingGiuseppe Cavallaro1-0/+7
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 <[email protected]> Signed-off-by: Stuart Menefy <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-24sh: Add sys_cacheflush() call for SH CPUs.Stuart Menefy4-3/+15
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 <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-24sh: Read from CCN_PVR instead of ROM for delay.Stuart Menefy1-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 <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-24sh: Remove implicit sign extension from assembler immediatesStuart Menefy1-1/+1
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 <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-24sh: Allow use of GENERIC_IOMAPDavid McKay1-0/+10
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 <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-23Merge branches 'sh/hwblk' and 'sh/pm-runtime'Paul Mundt2-2/+18
2009-08-23sh: Runtime PM for SuperH Mobile platform bus devicesMagnus Damm2-1/+12
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 <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-22Merge branch 'sh/dwarf-unwinder'Paul Mundt4-18/+52
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 <[email protected]>
2009-08-22sh: unwinder: Use a special bug flag for unwinder traps.Paul Mundt1-5/+6
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 <[email protected]>
2009-08-21sh: Handle the DWARF op, DW_CFA_undefinedMatt Fleming1-0/+3
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 <[email protected]>
2009-08-21sh: unwinder: Introduce UNWINDER_BUG() and UNWINDER_BUG_ON()Matt Fleming3-0/+36
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 <[email protected]>
2009-08-21sh: unwinder: Set the flags for DW_CFA_val_offset ops as DWARF_VAL_OFFSETMatt Fleming1-0/+1
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 <[email protected]>
2009-08-21sh: unwinder: Fix memory leak and create our own kmem cacheMatt Fleming1-16/+6
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 <[email protected]>
2009-08-21sh: Add initial support for SH7757 CPU subtypeYoshihiro Shimoda3-1/+248
Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-21sh: Make cache flushers SMP-aware.Paul Mundt1-12/+29
This does a bit of rework for making the cache flushers SMP-aware. The function pointer-based flushers are renamed to local variants with the exported interface being commonly implemented and wrapping as necessary. Signed-off-by: Paul Mundt <[email protected]>
2009-08-21sh: Kill off unused cpu/cacheflush.h.Paul Mundt2-43/+31
All CPU-specific overloads are done at runtime now, so this common header can go away and simply be folded back in to asm/ version. Signed-off-by: Paul Mundt <[email protected]>
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 <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
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 <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-20sh: Use local TLB flush for get_mmu_context() ASID exhaustion.Paul Mundt1-1/+1
When get_mmu_context() runs out of new ASIDs it flushes the TLB and wraps around. Despite the fact the ASIDs are tracked per-CPU, a global TLB flush was being used. Switch this over to a local one, as matches the intent. Signed-off-by: Paul Mundt <[email protected]>
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 <[email protected]> Cc: Chu Lih Kwek <[email protected]>, Cc: General Lai <[email protected]>, Cc: Robert Cozens <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-20sh: Better description of SH-4 PTEA register update.Michael Trimarchi1-0/+8
Signed-off-by: Michael Trimarchi <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-19Merge branch 'master' into sh/cachetlbPaul Mundt3-0/+6
Conflicts: arch/sh/kernel/Makefile_64
2009-08-18sh: Prevent heartbeat from scribbling over non-LED bits.Kuninori Morimoto1-0/+1
While most platforms implement LED banks in sets of 8/16/32, some use different configurations. This adds a LED mask to the heartbeat platform data to allow platforms to constrain the bitmap, which is otherwise derived from the register size. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-18sh: mach-kfr2409: add FLLFRQ value for PLL correction.Kuninori Morimoto1-0/+1
FLLFRQ setting is needed to use correct PLL clock for kfr2409. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2009-08-17sh: unwinder: Move initialization to early_initcall() and tidy up locking.Paul Mundt1-2/+0
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 <[email protected]>
2009-08-16sh: Add support for DWARF GNU extensionsMatt Fleming1-0/+4
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 <[email protected]>
2009-08-16sh: Fix up the SH-5 build with caches enabled.Paul Mundt3-13/+16
Signed-off-by: Paul Mundt <[email protected]>
2009-08-16sh: Convert cache disabled SH-5 over to new cache interface.Paul Mundt2-33/+0
The caches enabled case needs more work, but is presently broken regardless, so this can be done incrementally. Signed-off-by: Paul Mundt <[email protected]>
2009-08-15Merge branch 'master' into sh/hwblkPaul Mundt15-75/+523
2009-08-15sh: Convert SH7705 extended mode to new cacheflush interface.Paul Mundt1-35/+0
Signed-off-by: Paul Mundt <[email protected]>
2009-08-15sh: Convert SH-2A to new cacheflush interface.Paul Mundt1-30/+0
Signed-off-by: Paul Mundt <[email protected]>
2009-08-15sh: Migrate SH-4 cacheflush ops to function pointers.Paul Mundt4-89/+26
This paves the way for allowing individual CPUs to overload the individual flushing routines that they care about without having to depend on weak aliases. SH-4 is converted over initially, as it wires up pretty much everything. The majority of the other CPUs will simply use the default no-op implementation with their own region flushers wired up. Signed-off-by: Paul Mundt <[email protected]>
2009-08-15sh: Kill off unused flush_icache_user_range().Paul Mundt6-9/+0
We use flush_cache_page() outright in copy_to_user_page(), and nothing else needs it, so just kill it off. SH-5 still defines its own version, but that too will go away in the same fashion once it converts over. Signed-off-by: Paul Mundt <[email protected]>