Commit Graph

2314 Commits

Author SHA1 Message Date
Paul Mundt 8fc40238b4 sh: Prefer slab_is_available() over after_bootmem.
This kills off after_bootmem and switches to using slab_is_available()
instead. Presently the only place this is used is by the sh64 ioremap,
and there's not much point in keeping the reference around otherwise.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 14:21:03 +09:00
Paul Mundt 36aa1e32f4 sh: clkfwk: Make clock-cpg usable for non-legacy platforms.
This adds a new SH_CLK_CPG for parts that have CPG support.
SH_CLK_CPG_LEGACY is made to depend on this, and still needs to be set
for platforms that want clock-cpg to register the legacy clocks. With
this new config item in place, it is now possible to start layering more
generic CPG code in place while other platforms transition off of the
legacy clocks.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 14:00:34 +09:00
Paul Mundt 62fad39be0 sh: Add a NR_IRQS_LEGACY for external IRQ0-7.
This adds a NR_IRQS_LEGACY definition, which will be used by sparse irq.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 13:50:18 +09:00
Paul Mundt 2f3ed17e01 sh: Wrap irq_to_desc_alloc_cpu() around CONFIG_SPARSE_IRQ temporarily.
irq_to_desc_alloc_cpu() has been renamed to irq_to_desc_alloc_node() in
-next, but as we can not presently enable SPARSE_IRQ without the early
irq_desc alloc patch, protect it with an ifdef until the interface has
settled and we are ready to enable it system-wide.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 13:47:52 +09:00
Paul Mundt 5f8371cec9 Merge branches 'sh/stable-updates' and 'sh/sparseirq' 2009-05-22 13:29:37 +09:00
Magnus Damm 37869fa2da sh: ap325 camera without i2c driver fix
This patch fixes the ap325rxa ncm03j camera code to handle
the case where no i2c driver is present. Without this fix
i2c_transfer() may be passed NULL as adapter which results
in a crash.

Triggered when i2c-sh_mobile.c failed to probe() due to
missing MSTP clocks.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 13:19:11 +09:00
Roel Kluin 7fc1e5c15f sh: clkfwk: beyond ARRAY_SIZE of onchip_ops for sh7722.
Do not go beyond ARRAY_SIZE of onchip_ops

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 12:58:02 +09:00
Magnus Damm 30cff215b5 sh: clkfwk branch compile fix for clock-sh7722
Fix clkfwk branch compile error in clock-sh7722.c.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 02:57:11 +09:00
Paul Mundt d8586ba6e1 sh: irq: Provide an arch_probe_nr_irqs() that wraps the machvec def.
This is just a simple arch_probe_nr_irqs() stub that wraps to the
platform defined number of IRQs. This can be made gradually more
intelligent based on what we can infer from the INTC tables and so on.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 01:36:13 +09:00
Paul Mundt 05ff3004d2 sh: irq: Teach ipr and intc about dynamically allocating irq_descs.
This hooks in irq_to_desc_alloc_cpu() to the necessary code paths in the
intc and ipr controller registration paths. As these are the primary call
paths for all SH CPUs, this alone will make all CPUs sparse IRQ ready.

There is the added benefit now that each CPU contains specific IPR and
INTC tables, so only the vectors with interrupt sources backing them will
ever see an irq_desc instantiation. This effectively packs irq_desc
down to match the CPU, rather than padding NR_IRQS out to cover the valid
vector range.

Boards with extra sources will still have to fiddle with the nr_irqs
setting, but they can continue doing so through the machvec as before.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 01:28:33 +09:00
Paul Mundt fa1d43ab45 sh: irq: Convert from irq_desc[] to irq_to_desc().
This converts a few places that were using the old irq_desc[] array over
to the shiny new irq_to_desc() helper. Preperatory work for sparse irq
support.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 01:26:16 +09:00
Paul Mundt 55620c86eb sh: irq: Rework the SR.IMASK bitmap handling.
This tidies up how the SR.IMASK bitmap is managed, using the bitmap API
directly instead. At the same time, tidy up the irq_chip conversion a
bit.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-22 01:16:17 +09:00
Paul Mundt 62669e61a5 sh: mach-hp6xx: Fix up the hp6xx build for hd64461 changes.
Fixes several compile errors due to the recent hd64461 I/O base changes.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-20 11:27:13 +09:00
Paul Mundt bec36eca6f sh: hd64461: Fix up I/O base register offsets.
hd64461 is mapped in a fixed location, so the I/O base itself is fairly
meaningless as a configuration item. Additionally, this makes it
impossible to share hd64461 code alongside generic drivers (in the case
of sh_dac_audio), so simply make it commonly defined and permit the
mach_is_foo() logic to work out the proper semantics.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-15 12:03:04 +09:00
Magnus Damm 9304d0ccf1 sh: intc tables for sh7770
This patch adds INTC tables for sh7770, thanks
goes to Paul for the first prototype version.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-14 17:42:31 +09:00
Paul Mundt ad3256e361 sh: Provide FORCE_MAX_ZONEORDER.
Several platforms want to be able to do large physically contiguous
allocations (primarily nommu and video codecs on SH-Mobile), provide a
MAX_ORDER override for those cases.

Tested-by: Conrad Parker <conrad@metadecks.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-14 17:40:08 +09:00
Paul Mundt 549b5e358d sh: clkfwk: Add MSTP bits to SH7785 clock framework.
This plugs in all of the MSTP functions in to the clock framework,
and hands them off to the platform devices that want them.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-14 17:38:46 +09:00
Paul Mundt cedcf3366f sh: clkfwk: Map tree hierarchy in debugfs.
This adopts the OMAP clock framework debugfs bits and replaces the aging
procfs bits. The procfs clocks entry was primarily a debugging aid, and
used to be tied in to cpuinfo before the clock list grew too unweildly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-13 21:51:28 +09:00
Paul Mundt cc96eace48 sh: clkfwk: rate table construction and rounding for SH7785.
This adds support for constructing a rate table by looking at potential
divisors for a specified clock. Each FQRMR clock is given its own table.
Presently each table is rebuilt when the parent propagates down a new
rate, so some more logic needs to be added to do this more intelligently.

Additionally, a fairly generic round_rate() implementation is then
layered on top of it, which subsequently provides us with cpufreq support.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-13 20:28:15 +09:00
Paul Mundt a77b5ac0ea sh: clkfwk: Update SH7785 for refactored clock framework.
This updates the SH7785 CPU code as well as the SH7785LCR board support
code for making use of the newly refactored clock framework. Support for
the legacy CPG clocks is dropped at this point, with the extal frequency
fed in from the board code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-13 17:55:00 +09:00
Paul Mundt 253b0887b3 sh: clkfwk: Rework legacy CPG clock handling.
This moves out the old legacy CPG clocks to their own file, and converts
over the existing users. With these clocks going away and each CPU
dealing with them on their own, CPUs can gradually move over to the new
interface.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-13 17:38:11 +09:00
Paul Mundt 100890c55e sh: clkfwk: Provide a generic clk_set_rate_ex() path for root clocks.
In the case of root clocks (such as clkin oscillators, extal, etc.), the
rate information is entirely platform dependent and needs to be lazily
set and propagated from the platform code. This provides a method for
establishing the rate update on these types of clocks that define no
set_rate() op of their own.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-13 17:05:51 +09:00
Paul Mundt d672fef027 sh: clkfwk: Handle NULL clkops for root clocks.
root clocks may simply be placeholders for rate and ancestry information,
and have no real associated operations of their own. Account for this,
so we are still able to use these sorts of clocks for rate propagation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-13 17:03:09 +09:00
Paul Mundt af777ce42d sh: clkfwk: module_clk -> peripheral_clk rename.
For consistenct naming, and to allow us to fix up some confusion in the
SH-Mobile clock framework, amongst other places.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-13 16:59:40 +09:00
Paul Mundt fd5b12458b Merge branch 'master' into sh/clkfwk 2009-05-12 19:54:36 +09:00
Paul Mundt 8be5f1a68f sh: Kill off the remnants of the old timer code.
Now with all of the TMU users moved over to the new TMU driver, and the
old TMU driver killed off, the left-over infrastructure can go along
with it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:53:55 +09:00
Magnus Damm f19900b2e6 sh: remove old TMU driver
This patch removes the old TMU driver (CONFIG_SH_TMU/timer-tmu.c)

As replacement, select the sh_tmu driver with CONFIG_SH_TIMER_TMU
and configure timer channel using platform data.

If multiple TMU channels are enabled using platform data, use the
earlytimer parameter on the kernel command line to select channel.
For instance, use "earlytimer=sh_tmu.0" to select the first channel.

To verify which timer is being used, look at printouts or the timer
irq count in /proc/interrupts.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:53:14 +09:00
Magnus Damm 2b23a8826a sh: CMT platform data for sh7720/sh7721
This patch adds CMT platform data for sh7720 and sh7721.
All 5 32-bit CMT channels unfortunately share a single IRQ.
Both clockevent and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:53:09 +09:00
Magnus Damm 4a1a5a2f60 sh: TMU platform data for sh7720/sh7721
This patch adds TMU platform data for sh7720 and sh7721.
Both clockevent and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:53:01 +09:00
Magnus Damm e5ad00896a sh: TMU platform data for sh7710/sh7712
This patch adds TMU platform data for sh7710 and sh7712.
Both clockevent and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:52:52 +09:00
Magnus Damm c8a9011bce sh: TMU platform data for sh7706/sh7707/sh7708/sh7709
Add TMU platform data for sh7706/sh7707/sh7708/sh7709.
Both clockevent and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:52:45 +09:00
Magnus Damm acd664ab54 sh: TMU platform data for sh7705
This patch adds TMU platform data for sh7705. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:52:39 +09:00
Magnus Damm 6a3501b63d sh: TMU platform data for sh7724
This patch adds TMU platform data for sh7724. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:37:52 +09:00
Magnus Damm f2710ebcd0 sh: TMU platform data for sh7366
This patch adds TMU platform data for sh7366. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:37:39 +09:00
Magnus Damm e37677a429 sh: TMU platform data for sh7343
This patch adds TMU platform data for sh7343. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:37:33 +09:00
Magnus Damm 67d889bd82 sh: add sh4-202 INTC tables
This patch adds INTC tables for sh4-202 with support
for HUDI, TMU0, TMU1, TMU2, RTC, SCIF and WDT.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:37:26 +09:00
Magnus Damm 5f8a29ba39 sh: TMU platform data for sh4-202
This patch adds TMU platform data for sh4-202. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:37:21 +09:00
Magnus Damm f251935e02 sh: TMU platform data for sh7770
This patch adds TMU platform data for sh7770. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:35:59 +09:00
Magnus Damm 5d8728a71f sh: add sh7770_generic_defconfig
This patch adds a generic sh7770 defconfig file.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:35:51 +09:00
Magnus Damm 0ee8b4d7c7 sh: TMU platform data for sh7763
This patch adds TMU platform data for sh7763. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:34:40 +09:00
Paul Mundt 9fe5ee0efb sh: clkfwk: Use arch_clk_init() for on-chip clock registration.
CPUs registering on-chip clocks should be using arch_clk_init() with the
new scheme so that the CPUs have the opportunity to establish the
topology prior to the initial root clock rate propagation. This ensures
that CPUs with on-chip clocks that use CLK_ENABLE_ON_INIT are properly
enabled at the initial propagation time, without having to further poke
the root clocks.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 19:29:04 +09:00
Paul Mundt f3f8290cb3 sh: clkfwk: Handle clk_get_sys() returning an ERR_PTR.
clk_get() needs to also perform an IS_ERR() check to see whether
clk_get_sys() failed or not.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 16:07:40 +09:00
Paul Mundt 0dae89572c sh: clkfwk: Wire up clk_get_sys() support.
This stubs in clk_get_sys() from the ARM clkdev implementation.
Tentatively conver the clk_get() lookup code to use this, and once the
rest of the in-tree users are happy with this, it can replace the
fallback lookups.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 06:18:09 +09:00
Paul Mundt 007e8363b6 sh: clkfwk: Kill off clk_recalc_rate().
The only user for this is the SH-Mobile r_clk, which is now added as a
root clock and can be kicked via propagate_rate() as usual. Given that,
there is no longer any need for the special clk_recalc_rate(), so we kill
it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 06:05:32 +09:00
Paul Mundt f5c84cf508 sh: clkfwk: Tidy up on-chip clock registration and rate propagation.
This tidies up the set_rate hack that the on-chip clocks were abusing to
trigger rate propagation, which is now handled generically.

Additionally, now that CLK_ENABLE_ON_INIT is wired up where it needs to
be for these clocks, the clk_enable() can go away. In some cases this was
bumping up the refcount higher than it should have been.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 05:59:27 +09:00
Paul Mundt aa87aa343f sh: clkfwk: Improve the generic clk_set_parent() implementation.
This causes the generic clk_set_parent() implementation to be a bit more
intelligent. A clk_reparent() is added to move the clock over to the new
parent's sibling list, which then allows the generic rate propagation
code to succeed. This also becomes a nop if the new and old parents are
unchanged.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 05:51:05 +09:00
Paul Mundt ae891a4264 sh: clkfwk: Fix up the clk_enable() error path.
There are a couple of instances where a clk_enable() can fail, which the
SH-Mobile code presently handles, but doesn't get reported all the way
back up. This fixes up the return type so the errors make it all the way
down to the drivers.

Additionally, we now also error out properly if the parent enable fails.
Prep work for aggressively turning off unused clocks on boot.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 05:30:10 +09:00
Paul Mundt 154502e160 sh: clkfwk: Convert SH-Mobile CPUs to use CLK_ENABLE_ON_INIT.
Kill off all of the clk_always_enabled leftovers and use the new flag
directly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 05:18:13 +09:00
Paul Mundt 4ff29ff8e8 sh: clkfwk: Consolidate the ALWAYS_ENABLED / NEEDS_INIT mess.
There is no real distinction here in behaviour, either a clock needs to
be enabled on initialiation or not. The ALWAYS_ENABLED flag was always
intended to only apply to clocks that were physically always on and could
simply not be disabled at all from software. Unfortunately over time this
was abused and the meaning became a bit blurry.

So, we kill off both of all of those paths now, as well as the newer
NEEDS_INIT flag, and consolidate on a CLK_ENABLE_ON_INIT. Clocks that
need to be enabled on initialization can set this, and it will purposely
enable them and bump the refcount up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 05:14:53 +09:00
Paul Mundt b1f6cfe48c sh: clkfwk: refactor rate propagation.
This resyncs the rate propagation strategy with the scheme used by the
OMAP clock framework. Child clocks are tracked on a list under each
parent and propagation happens there specifically rather than constantly
iterating over the global clock list.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 04:27:43 +09:00
Paul Mundt a02cb230bb sh: clkfwk: Add a followparent_recalc() helper.
This adds a followparent_recalc() helper for clocks that just follow the
parent's rate. Switch over the few CPUs that use this scheme for some of
their clocks.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 03:50:44 +09:00
Paul Mundt b68d820143 sh: clkfwk: Make recalc return an unsigned long.
This is prep work for cleaning up some of the rate propagation bits.
Trivial conversion.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-12 03:45:08 +09:00
Magnus Damm ccc195655f sh: TMU platform data for sh7780
This patch adds TMU platform data for sh7780. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-11 22:02:04 +09:00
Magnus Damm 50e2d0d3b4 sh: r7780 highlander clock fixes
Update the r7780 highlander defconfig to fix
PCLK value, while at it fix cmdline on r7785.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-11 22:02:00 +09:00
Magnus Damm 3d6ad46021 sh: multiple vectors per irq - sh7760
Update intc tables and platform data to use one linux irq
per maskable interrupt source instead of keeping the one-to-one
mapping between vectors and linux irqs.

This fixes potential irq masking issues for sh7760 hardware
blocks such as DMAC/TMU2/REF.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-11 21:59:58 +09:00
Magnus Damm c42f32dca3 sh: TMU platform data for sh7760
This patch adds TMU platform data for sh7760. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-11 18:45:52 +09:00
Magnus Damm 03f408f1aa sh: TMU platform data for sh775x
This patch adds TMU platform data for sh775x. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-11 18:45:49 +09:00
Magnus Damm 53c0054c3f sh: include empty_zero_page in text
Include empty_zero_page in _text. This fixes a problem
introduced by c3e2586b79
which results in broken boot on R2D-Plus.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-11 18:42:14 +09:00
Yoshihiro Shimoda 7bce6c2740 sh: sh7785lcr: fix I2C device address map for 32-bit mode
This fixes up the broken I2C offset in 32-bit mode.
The cause is because the board datasheet had a mistake.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-11 16:56:16 +09:00
Paul Mundt 780f98ff1f sh: Account for INITIAL_JIFFIES when using jiffies clocksource.
In the case where we fall back on the generic jiffies clocksource,
INITIAL_JIFFIES needs to be accounted for so that printk times aren't
completely skewed.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-11 12:15:14 +09:00
Paul Mundt d9d674e500 sh: Fix up typo in arch/sh/kernel/vmlinux.lds.S
.init_ramfs ought to be .init.ramfs, fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-11 12:12:38 +09:00
Paul Mundt 567bb8fd47 sh: Fix up R0 dependence in __arch_swab16/32.
There is nothing in these routines that inherently depends on R0 use.
Given that these routines are inlined, it is rather easy to blow up the
compiler by exhausting the spill class when performing a 64-bit swab.

This presently manifests itself as the following:

CC      fs/ocfs2/suballoc.o
fs/ocfs2/suballoc.c: In function 'ocfs2_reserve_suballoc_bits':
fs/ocfs2/suballoc.c:638: error: unrecognizable insn:
(insn 2793 1230 1231 103 arch/sh/include/asm/swab.h:33 (set (reg:HI 853)
        (subreg:HI (reg:SI 149 macl) 2)) -1 (expr_list:REG_DEAD (reg:SI 149 macl)
        (nil)))
fs/ocfs2/suballoc.c:638: internal compiler error: in extract_insn, at recog.c:1991

This patch switches over to using an arbitrarily assigned register instead.

While the same issue does not exist in the SH-5 case, there is likewise no harm
in having an alternate register used for the byterev/shari pair.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-10 14:25:39 +09:00
Paul Mundt 457daa2b66 sh: Hook up cc-cross-prefix support.
This implements a simple case that just iterates through the common
cases, looking at UTS_MACHINE for hints.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-10 01:28:01 +09:00
Paul Mundt b412a49af9 sh: Consolidate the boot link and entry offset definitions.
Consolidate these in a single place in the Kconfig menus. At the same
time, disable their interactivity and set them according to the board
config defaults.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-10 01:23:25 +09:00
Paul Mundt 1eca133cc9 sh: Merge the split arch/sh/boot/compressed/ Makefiles.
This kills off the _64 variant and moves the _32 one over as the generic
one to use.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-10 00:58:21 +09:00
Paul Mundt b208835624 sh: Provide a BITS definition, use it in the arch/sh/boot/ Makefiles.
This introduces a BITS export that can handily be picked up by Makefiles
for cleaner sharing. Reflect its use in arch/sh/boot/compressed/ in
preparation for unifying the Makefiles.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-10 00:55:45 +09:00
Paul Mundt a2e76c80d9 sh: Provide a tighter BOOT_LINK_OFFSET definition for the Cayman board.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-10 00:54:39 +09:00
Paul Mundt 20b27fa337 sh: Fix up the sh64 zImage build.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-10 00:36:22 +09:00
Paul Mundt 7b022d07a0 sh: Tidy up the ldscript output format specifier.
Tie this in to the Makefile directly, where we already know what we are
running on. This tidies up the linker script a bit, and is prep work for
unifying the arch/sh/boot/compressed linker scripts.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-10 00:25:08 +09:00
Paul Mundt dce97c8cb2 sh: Move the unified linker script in place, kill off old _64 one.
Just forcefully rename the _32 variant overtop, and kill off the now
unused _64 version.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 23:36:10 +09:00
Paul Mundt c3e2586b79 sh: Integrate sh64 bits in vmlinux_32.lds.S.
This adds all of the requisite bits from vmlinux_64.lds.S in to the _32
variant, resulting in a unified and generic linker script that can be
shared across both.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 23:33:02 +09:00
Paul Mundt 7cd0378ef4 sh: Fix up SHmedia module ELF relocations.
This fixes up the LSB setting for SHmedia branching in updated symbols
when processing module relocations.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 18:03:37 +09:00
Paul Mundt 1031a3a57e sh: Provide an __sdivsi3_2 export for sh64.
Newer code paths that are heavier in 64-bit math manage to get this
generated by newer compilers, provide a definition and export
accordingly. This is trivially wrapped around the existing __sdivsi3
code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 17:57:21 +09:00
Paul Mundt 2bcfffa423 sh: Rename opcode_t to insn_size_t.
This is now clashing with a driver, so just rename it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 16:02:08 +09:00
Paul Mundt 6dbe47a170 sh: Provide __read_{read,write}sl() definitions for sh64.
These are presently only defined for sh32, use the plain unoptimized
versions for sh64. Fixes up smsc911x build.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 14:44:30 +09:00
Paul Mundt 2fedaacdc0 sh: Cleanup irqflags size mismatch on SH-5 build.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 14:38:49 +09:00
Peter Griffin cd89436e54 sh: Add UBC trap vector for SH2A
Signed-off-by: Peter Griffin <pgriffin@mpc-data.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 00:11:33 +09:00
Peter Griffin ba0d474082 sh: Add ptrace support for NOMMU debugging
Signed-off-by: Peter Griffin <pgriffin@mpc-data.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 00:11:27 +09:00
Kieran Bingham e73173dbe5 sh: Fix UBC setup and registers for SH2A
Signed-off-by: Kieran Bingham <kieranbingham@gmail.com>
Signed-off-by: Peter Griffin <pgriffin@mpc-data.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 00:09:21 +09:00
Kieran Bingham be6514c629 sh: Add in some ptrace definitions from GDB.
Plugs in PT_TEXT_END_ADDR/PT_TEXT_ADDR/PT_DATA_ADDR/PT_TEXT_LEN
definitions.

Signed-off-by: Kieran Bingham <kieranbingham@gmail.com>
Signed-off-by: Peter Griffin <pgriffin@mpc-data.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-09 00:06:03 +09:00
Paul Mundt 3b226e15be sh: Add clock id to sh-sci platform data on SH-Mobile CPUs.
This adds the clock specifier to all of the SH-Mobile sh-sci ports.
Impacted CPUs are SH7343/SH7366/SH7722/SH7723/SH7724.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 23:28:54 +09:00
Paul Mundt 7b551f9daa sh: Kill off the GENERIC_CALIBRATE_DELAY ifndef.
Now that everyone is using the clock framework directly and we
unconditionally provide our own calibrate_delay() function, having it
wrapped in an ifndef is no longer useful. So, kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 22:14:01 +09:00
Paul Mundt ccdaeb4c8f sh: TMU platform data for SH-X3 proto CPU.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 22:09:30 +09:00
Paul Mundt c3d480ded1 sh: TMU platform data for SH7786.
Wires up all 12 TMU channels, with TMU0 and 1 used as clockevent and
clocksource respectively.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 21:57:04 +09:00
Paul Mundt c29418c2ae sh: Always fixup unaligned userspace accesses on sh64.
sh64 has traditionally had this configurable via a Kconfig option
(CONFIG_SH64_USER_MISALIGNED_FIXUP). In practice it has never really been
terribly useful to turn this off, so just get rid of the option entirely.

We leave the sysctl around so we don't end up breaking existing root
file systems, and to allow folks that really want this off to do so at
their own risk.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 20:32:56 +09:00
Paul Mundt 30d88cf52f sh: Kill off extra cflags Kconfig entry.
There is no real reason to use this anymore, as the build system
generally knows what it is doing with regards to cflags mangling.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 20:20:56 +09:00
Paul Mundt 6eac1af011 sh: Always select RTC_LIB, not just for SUPERH32.
The RTC_LIB helpers are used in arch/sh/kernel/time.c, which was
previously only the case for the 32-bit variant. Now that this has
become the common implementation, move the RTC_LIB select to reflect
that. Fixes up the sh64 build.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 19:48:47 +09:00
Paul Mundt b366328335 sh: Drop dead rules from arch/sh/kernel/Makefile_64.
Several of these options are specific to the SHcompact ISA and will need
to be rewritten for SHmedia if they are to be supported at all. Drop
the impossible rules for now.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 18:01:03 +09:00
Magnus Damm 47dd6f4439 sh: TMU platform data for sh7723
This patch adds TMU platform data for sh7723. Both clockevent
and clocksource support is enabled. While at it, adjust the
CMT clocksource rating to prioritize the TMU.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 17:47:16 +09:00
Magnus Damm 583d1d549f sh: enable TMU clocksource on sh7722
This patch enables the TMU clocksource on sh7722.
To prioritize TMU over CMT we also adjust the CMT
clock source rating.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 17:46:57 +09:00
Magnus Damm 4f5ecaa054 sh: clock framework update, fix count and kill off kref
This patch updates the clock framework use count code.
With this patch the enable() and disable() callbacks
only get called when counting from and to zero.
While at it the kref stuff gets replaced with an int.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 17:46:22 +09:00
Paul Mundt 7d170b1bc5 sh: Move out cayman-specific panic handler code to its own file.
This moves out the cayman-specific panic handler code to a better
location, and leaves the generic implementation a simple stub that is
still used under emulation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 17:41:59 +09:00
Paul Mundt ef9f89996e sh: Kill off unused sh64 debug code.
None of the print_page() code and associated helpers are presently used
by anything in-tree, so just kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 17:36:57 +09:00
Paul Mundt cb3a86c89e sh: Kill off sh64's hand-rolled syscall tracer.
This is no longer necessary, as there are now sufficient generic
alternatives available.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 17:25:35 +09:00
Paul Mundt 1af2fe45fe sh: Kill off the global rtc_lock with extreme prejudice.
Now that all of the possible users for rtc_lock have gone away, it is no
longer necessary to keep this lock definition around.

This follows several other architectures that have either recently
dropped it or never supported it in the first place.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 16:59:05 +09:00
Paul Mundt cd1408f22d sh: mach-sh03: Give the sh03 rtc its own spinlock.
This converts the sh03 rtc code off of using the global rtc_lock and on
to its own spinlock. There are no other possible users of the rtc_lock,
so serializing with it is not necessary.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 16:57:35 +09:00
Paul Mundt 6459d7bb72 sh: Kill off dead timer sysclass pm hooks.
With the conversion to generic clockevents these are completely unused,
so just kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 16:47:48 +09:00
Paul Mundt 5ac5496411 sh: Kill off dead handle_timer_tick() code.
Nothing is using this anymore now that we have fully converted to generic
time, so kill it off completely.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 16:44:00 +09:00
Paul Mundt 6d134b9e8d sh: Wire up GENERIC_CMOS_UPDATE for the platforms that need it.
Now that everything has converted over to generic timekeeping, we need an
alternate method for keeping the RTC updated for those platforms that are
still using the rtc_sh_get/set_time pairs, presently limited to SH-03 and
the Dreamcast. This wires up the GENERIC_CMOS_UPDATE hooks for those to
maintain the same behaviour.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 16:36:13 +09:00
Paul Mundt b179b72fad sh: Rename arch/sh/kernel/time_32.c to arch/sh/kernel/time.c.
This is now fully generic, and used both by _32 and _64 variants.
Rename it accordingly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 16:17:36 +09:00
Paul Mundt add47067a8 sh: Finish the sh64 migration off of ARCH_USES_GETTIMEOFFSET.
This adds sh_tmu support to the SH-5 subtypes, which subsequently allows
us to kill off time_64.c and use the now generic time_32.c. As a bonus,
SH-5 now supports highres timers and tickless for the first time.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 16:12:17 +09:00
Paul Mundt c2ecb4c4a7 sh: Move out rtc-sh registration from time_64.c to setup-sh5.c
Now that the onchip_remap() mess is sorted out, the rtc-sh support code
for SH-5 can follow the same approach as the other CPUs.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 15:39:25 +09:00
Paul Mundt 4fa48e1774 sh: Enable new TMU driver support for all SH-3 and SH-4 CPUs.
The TMU block is supported on all SH-3 and SH-4 subtypes, so just select
it there, rather than conditionalizing it per subtype.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 15:28:15 +09:00
Magnus Damm e367592cc9 sh: TMU platform data for sh7785
This patch adds TMU platform data for sh7785. Both clockevent
and clocksource support is enabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 11:40:09 +09:00
Magnus Damm 06ee846a25 sh: r7785 highlander clock fixes
Update the r7785 highlander defconfig to fix
PCLK value and that mode4 is set high.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 11:40:04 +09:00
Magnus Damm b3cacf3181 sh: call clock framework init() callback once
Make sure that clk->ops->init() only gets called once in
the case of CLK_ALWAYS_ENABLED. Without this patch the
init() callback may be called multiple times.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 11:38:28 +09:00
Magnus Damm 5dafc91fca sh: sh7785 early scif fix
This patch moves the SH4 case of EARLY_SCIF_CONSOLE_PORT
so the SH7785 default value gets used. Without this patch
the value for SH7785 is set to 0xffe80000.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-08 11:38:26 +09:00
Paul Mundt c51279ec0d sh: Kill off unused SH-5 irq_describe cruft.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-07 18:17:20 +09:00
Paul Mundt 0fb849b9d7 sh: Integrate the SH-5 onchip_remap() more coherently.
Presently this is special-cased for early initialization. While there are
situations where these static early initializations are still necessary,
with minor changes it is possible to use this for the regular ioremap
implementation as well. This allows us to kill off the special-casing for
the remap completely and to start tidying up all of the SH-5
special-casing in drivers.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-07 18:10:27 +09:00
Paul Mundt ae318a148e sh: sh64 still needs ARCH_USES_GETTIMEOFFSET temporarily.
sh64 is still using this, so re-enable it temporarily while SH-5 gets
converted to use the generic code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-07 17:55:09 +09:00
Paul Mundt ee1acbfabd sh: Handle shm_align_mask also for HAVE_ARCH_UNMAPPED_AREA_TOPDOWN.
Presently shm_align_mask is only looked at for the bottom up case, but we
still want this for proper colouring constraints in the topdown case.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-07 16:38:16 +09:00
Paul Mundt 40c8bca76e sh: Flag IRQSTACKS as BROKEN for now.
There still seems to be some stack corruption to sort out here, so flag
this as BROKEN until this issue is sorted out.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-07 15:24:36 +09:00
Paul Mundt 25483efeb2 sh: Move dummy clockevents broadcast timer to its new home.
The old arch/sh/kernel/timers/ directly will be going away completely
once the rest of the TMU users are migrated, so move the dummy broadcast
driver up a level in preparation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 18:29:27 +09:00
Paul Mundt dec56e6312 sh: Kill off the now unused ARCH_USES_GETTIMEOFFSET code.
Now that the stragglers (MTU2/CMT/etc.) have been rewritten and we are
selecting both GENERIC_TIME and GENERIC_CLOCKEVENTS, the get_offset()
timer op is completely unused. As a result, we are now able to kill off
the ARCH_USES_GETTIMEOFFSET references.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 18:18:14 +09:00
Paul Mundt 938edae11e sh: select both GENERIC_TIME and GENERIC_CLOCKEVENTS.
Now that the rest of the timers that didn't support clockevents have been
rewritten, both of these can be enabled by default.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 18:12:26 +09:00
Paul Mundt 46a12f7426 sh: Consolidate MTU2/CMT/TMU timer platform data.
All of the SH timers use a roughly identical structure for platform data,
which presently is broken out for each block. Consolidate all of these
definitions, as there is no reason for them to be broken out in the first
place.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 17:57:17 +09:00
Magnus Damm d43a41bf8b sh: TMU platform data for sh7722
This patch adds TMU platform data for sh7722. Only clockevent
mode is enabled for now, clocksource requires this patch:
"clocksource: setup mult_orig in clocksource_enable()"

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 17:41:37 +09:00
Magnus Damm 9570ef2042 clocksource: SuperH TMU Timer driver
This patch adds a TMU driver for the SuperH architecture.

The TMU driver is a platform driver with early platform
support to allow using a TMU channel as clockevent or
clocksource during system bootup or later.

Clocksource or clockevent can be selected.
Both periodic and oneshot clockevents are supported.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 17:41:15 +09:00
Magnus Damm 3280c8865e sh: remove old MTU2 driver
This patch removes the old MTU2 driver (CONFIG_SH_MTU2/timer-mtu2.c)

As replacement, select the sh_cmt driver with CONFIG_SH_TIMER_MTU2
and configure timer channel using platform data.

If multiple MTU channels are enabled using platform data, use the
earlytimer parameter on the kernel command line to select channel.
For instance, use "earlytimer=sh_mtu2.0" to select the first channel.

To verify which timer is being used, look at printouts or the timer
irq count in /proc/interrupts.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 17:40:13 +09:00
Magnus Damm da107c6ef9 sh: sh2a MTU2 platform data
This patch adds MTU2 platform data for the following cpus:
 - sh7201 (3/5 channels)
 - sh7203/sh7263 (2/4 channels)
 - sh7206 (3/5 channels)
 - MXG (3/5 channels)

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 17:38:07 +09:00
Magnus Damm d5ed4c2e5c clocksource: SuperH MTU2 Timer driver
This patch adds a MTU2 driver for the SuperH architecture.

The MTU2 driver is a platform driver with early platform
support to allow using a MTU2 channel as only clockevent
during system bootup.

Clocksource on sh2a is currently unsupported due to code
generation issues with 64-bit math, so at this point only
periodic clockevent support is in place.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 17:36:02 +09:00
john stultz 7563431107 time: sh: convert to use arch_getoffset() infrastructure
Convert sh to use GENERIC_TIME via the arch_getoffset() infrastructure.

Signed-off-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 17:32:55 +09:00
Thomas Gleixner d804983982 sh: remove obsolete hw_interrupt_type
Impact: cleanup

Convert the last remaining users to struct irq_chip and remove the
define.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 17:28:13 +09:00
Thomas Gleixner 0cd5f7b0c7 sh: remove obsolete no_irq_type
Impact: cleanup

convert the last remaining users to no_irq_chip

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-03 17:28:13 +09:00
Paul Mundt 66fdc95172 Merge branch 'timers/clocksource' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-tip 2009-05-03 17:24:55 +09:00
Magnus Damm f425752fc6 sh: remove old CMT driver
This patch removes the old CMT driver (CONFIG_SH_CMT/timer-cmt.c)

As replacement, select the sh_cmt driver with CONFIG_SH_TIMER_CMT
and configure timer channel using platform data.

If multiple CMT channels are enabled using platform data, use the
earlytimer parameter on the kernel command line to select channel.
For instance, use "earlytimer=sh_cmt.0" to select the first channel.

To verify which timer is being used, look at printouts or the timer
irq count in /proc/interrupts.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-30 13:21:14 +09:00
Magnus Damm 698aa99da5 sh: sh2/sh2a 16-bit CMT platform data
This patch adds 16-bit cmt platform data for the following cpus:
 - sh7619 (2 channels)
 - sh7203/sh7263 (2 channels)
 - sh7206 (2 channels)

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-30 13:20:37 +09:00
Magnus Damm e6be3a2586 sh: pass through ioremap() for non-mmu processors.
All 32-bit SuperH processors currently go through __ioremap_mode()
and check for IO_TRAPPED and directly mapped segments. With this
patch we simplify the MMU less case with a pass through version of
 __ioremap_mode() which just returns the physical address.

The effects of this is change are:
 - fix non-MMU ioremap() of high address hardware blocks (sh7203 CMT)
 - make sure IO_TRAPPED is not selected

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-30 12:56:37 +09:00
Paul Mundt 4278600644 sh: register the rtc-generic platform device properly.
The device registration was accidentally omitted, add it back in. Do some
basic device probing as well, so this doesn't show up for platforms that
tie in to the RTC interface properly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-28 23:12:10 +09:00
Magnus Damm 8e0b842948 sh: setup timers in late_time_init()
This patch moves the SuperH timer setup code from time_init()
to late_time_init(). Good things about this change:
 - interrupts: they are enabled at late_time_init()
 - mm: regular kmalloc() can be used at late_time_init()

Together with moving to late_time_init() this patch changes
the sh_cmt driver to always allocate with kmalloc(). This
simplifies the code a bit and also fixes section mismatches.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-28 18:01:25 +09:00
Tim Abbott 882016ff36 sh: Use __INIT macro instead of .text.init.
The sh architecture has some code in the .text.init section, but it
does not reference that section in its linker scripts.

This change moves this code from the .text.init section to the
.init.text section, which is presumably where it belongs.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-27 19:51:58 -07:00
Jean-Christophe PLAGNIOL-VILLARD c2e0090c66 sh: mach-r2d: add physmap-flash support for R2D+ boards.
The RTS7751R2D_1 boards only support 1MB of socket-mounted MBM29F040
flash, which we just leave alone as it's not terribly interesting.

This adds support for the s29gl256p on the r2d+ boards that makes a bit
more sense to expose to the user.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-27 17:54:41 +09:00
Paul Mundt 47c8a08bbe sh: rtc-generic support.
This adds rtc-generic support for SUPERH32.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-27 17:34:39 +09:00
Paul Mundt ecd4ca52bf sh: Fix up unsigned syscall_nr in SH-5 pt_regs.
syscall_nr is presently defined as unsigned in the SH-5 pt_regs,
while the syscall restarting code wants it to be signed. Fix this
up, and bring it in line with the other SH parts.

Reported-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-27 17:05:38 +09:00
Paul Mundt 5be7c0a4d3 sh: select GENERIC_TIME for new CMT driver.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-27 14:40:47 +09:00
Paul Mundt fc4967b8c6 sh: update defconfigs for PCI changes.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-27 14:06:26 +09:00
Paul Mundt 339b042bb4 Merge branches 'sh/stable-updates' and 'sh/pci-rework' 2009-04-27 09:45:43 +09:00
Yoshihiro Shimoda 40f4a6d522 sh: sh7785lcr: fix defconfig for 29-bit mode
Fix the problem that cannot work 29-bit mode when use sh7785lcr_defconfig.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-27 09:17:38 +09:00
Tim Abbott bbe215c231 sh: convert to use __HEAD and HEAD_TEXT macros.
This has the consequence of changing the section name use for head
code from ".text.head" to ".head.text".  Since this commit changes all
users in the architecture, this change should be harmless.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Paul Mundt <lethal@linux-sh.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-26 09:20:39 -07:00
Paul Mundt 3e98f9f15e sh: pci: Fix up the build for CONFIG_PCI=n.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-24 15:39:39 +09:00
Paul Mundt 99ce567ba9 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-04-22 09:27:47 +09:00
Magnus Damm 8e19608e8b clocksource: pass clocksource to read() callback
Pass clocksource pointer to the read() callback for clocksources.  This
allows us to share the callback between multiple instances.

[hugh@veritas.com: fix powerpc build of clocksource pass clocksource mods]
[akpm@linux-foundation.org: cleanup]
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-21 13:41:47 -07:00
Paul Mundt 4db25d496c Merge branch 'sh/stable-updates' into sh/for-2.6.30 2009-04-21 17:12:16 +09:00
Toshinobu Sugioka 8c31813f31 sh: Fix mmap2 for handling differing PAGE_SIZEs.
mmap2 uses a fixed page shift of 12, regardless of the PAGE_SIZE setting.
Fix up the mmap2 code to add some sanity checks on the mapping, and to
update pgoff accordingly.

Error handling bits based on 4280e3126f
("frv: fix mmap2 error handling").

Signed-off-by: Toshinobu Sugioka <sugioka@itonet.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-21 07:34:53 +09:00
Paul Mundt cf242007a1 sh: pci: Rename pci-new.c to pci.c.
pci-new.c is now in a state to replace the old pci.c, rename it
accordingly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 21:53:33 +09:00
Paul Mundt 35bcfffd86 sh: pci: Roll pci-lib in to pci-new.
Now that the pci-auto cruft is gone, pci-lib can go away.
Roll it back in to pci-new.c where it originally split off from.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 21:51:19 +09:00
Paul Mundt 805fcc8899 sh: pci: Kill off the last remnants of the now unused pci-auto code.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 21:46:42 +09:00
Paul Mundt 2d5efc190e sh: pci: Move the se7751 fixups in to arch/sh/drivers/pci/.
The se7751 was still doing the PCI fixups in its own board directory,
so we move it over to arch/sh/drivers/pci/ with the rest of the board
fixups. It has bitrotted significantly over the years, so will still
likely need a bit of work to bring back up to date.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 21:42:59 +09:00
Paul Mundt 951a681bda sh: pci: Convert dreamcast to new-style interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 21:34:36 +09:00
Paul Mundt 37c8ac361e sh: pci: Consolidate lboxre2 and r2d IRQ fixups.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 21:27:15 +09:00
Paul Mundt 84972ec0c2 sh: pci: Rename SH7751 platform ops files to fixups.
None of these contain pci_ops, only IRQ routing bits, rename them
accordingly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 21:17:10 +09:00
Paul Mundt 757e3c16f8 sh: pci: Rewrite SH7751 PCI support to follow SH7780.
This follows the similar sort of scheme that the refactored SH7780 code
uses, using a 64MB CS3 mapping to handle the window0 case, and simply
discarding window1. This vastly simplifies the code, and allows most of
the board-specific setup to go die.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 21:11:07 +09:00
Paul Mundt a5b0804712 sh: pci: Rename ops-cayman -> fixups-cayman.
Now that ops-cayman.c only contains IRQ routing fixups, rename it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 20:41:45 +09:00
Paul Mundt 48e4237d96 sh: pci: Convert the SH-5 code over to the new interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 20:40:48 +09:00
Paul Mundt 3444f5ec49 sh: pci: Tidy up the dreamcast PCI support.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 20:22:05 +09:00
Paul Mundt 0db38cea69 sh: pci: Kill off legacy ide quirks.
These fixups seem to have bitrotted a bit since their introduction in the
2.4 days. As we never had much use for them in the first place, and
nothing is using them any more, kill them off the rest of the way.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 19:54:47 +09:00
Paul Mundt 0e75148108 sh: pci: Consolidate pcibios_setup() in pci-lib.
This wasn't really being used for anything useful, so just stub it in
pci-lib.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 19:48:48 +09:00
Paul Mundt c563bf0965 sh: pci: Kill off dead references to is_pci_ioaddr and friends.
Some old boards are still using this in their I/O routines, kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 19:39:57 +09:00
Paul Mundt d556fcc101 sh: pci: Flag the dreamcast BBA as IORESOURCE_PCI_FIXED.
This isn't a real BAR, so prevent any attempts to move it, as we don't
wish to encourage a bus luck by overzealous PCI initialization code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 19:31:20 +09:00
Paul Mundt bb3396477b sh: pci: Kill off superfluous lboxre2 pci fixups.
This is a verbatim copy of the r2d one, use that instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 19:26:45 +09:00
Paul Mundt 5ba7205fc4 sh: pci: Kill off the now unused hose->io_base.
Nothing is using this any more, so kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 19:00:32 +09:00
Paul Mundt 3f8daeacd7 sh: pci: Consolidate the remaining common bits.
This moves the remaining common bits in to pci-lib. Thereby reducing
pci.c/pci-new.c to simple bus fixups and controller registration.

As more platforms are moved over, the old code will disappear completely
and the pci-new bits will be rolled in to pci-lib, eventually replacing
pci.c completely.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 18:53:41 +09:00
Paul Mundt 5160d3f782 sh: pci: Consolidate bus<->resource mapping in pci-lib.
Now that the io and mem offsets are tracked accordingly, the pci-new
version of the bus<->resource mappers can be used generically. This
moves them in to pci-lib.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 18:47:21 +09:00
Paul Mundt 09cfeb133e sh: pci: Track io and mem_offset per-channel.
This implements a per-hose offset for I/O and mem resources.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 18:42:00 +09:00
Paul Mundt e79066a659 sh: pci: New-style controller registration.
This moves off of the board_pci_channels[] approach for bus registration
and over to a cleaner register_pci_controller(), all derived from the
MIPS code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 18:29:22 +09:00
Paul Mundt 99f95f1178 sh: pci: Rework fixed region checks in ioremap().
Not all PCI channels have non-translatable memory windows, this is a
special property of the on-chip PCIC with its 0xfd00... mapping, handle
this explicitly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 18:24:57 +09:00
Paul Mundt 0bb34a6bf1 sh: pci: Consolidate pci_iomap() and use the generic I/O base.
This consolidates the pci_iomap() definitions and reworks how the I/O
port base is handled. PCI channels can register their own I/O map base,
or if none is provided, the system-wide generic I/O base is used instead.

Functionally nothing changes, while this allows us to kill off lots of
I/O address special casing and lookups.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 16:38:00 +09:00
Paul Mundt 394b6d2fe6 sh: pci: Kill off unused pcibios_fixup().
This is left over cruft that hasn't been used by anything in a long time,
kill off bits that weren't purged previously.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 16:18:46 +09:00
Paul Mundt a3c0e0d003 sh: pci: Consolidate pcibios_align_resource() definitions.
This introduces a saner pcibios_align_resource() that can be used
regardless of whether pci-auto or pci-new are being used, and
consolidates it in pci-lib.c.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 16:14:29 +09:00
Paul Mundt 9833385131 sh: pci: HAVE_PCI_MMAP support.
Derived from the MIPS version, now uses pgprot_noncached().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 15:51:45 +09:00
Paul Mundt 4c5107e445 sh: pci: Split out new-style PCI core.
This splits off a 'pci-new.c' which is aimed at gradually replacing the
pci-auto backend and the arch/sh/drivers/pci/pci.c core respectively.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 15:43:36 +09:00
Paul Mundt 9ade1217c9 sh: pci: Drop asm-generic/pci.h, so we can use our own fixups.
The new PCI code wants its own bus<->resource mappings instead of the
generic equivalents, so drop the asm-generic include in preparation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-20 15:38:25 +09:00
Paul Mundt 8fb2bae4b4 sh: sh7724: Register CMT as an early platform device here too.
Follows the SH7722/SH7723 changes.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-19 13:14:29 +09:00
Paul Mundt d9aed8b95f sh: sh7724: Don't default enable the RTC clock.
rtc-sh takes care of this now, so no need to have this always enabled.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-19 13:12:04 +09:00
Paul Mundt 22fd67c5c9 Merge branches 'sh/earlytimer' and 'sh/shmobile-r2r-staging' 2009-04-19 13:08:33 +09:00
Magnus Damm 28fde6863e sh: Early Platform Data for SuperH Mobile
Use plat_early_device_setup() to register Early Platform Data
for SuperH Mobile processors.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-19 13:06:25 +09:00
Magnus Damm 87a00dc059 sh: Add plat_early_device_setup()
Add a plat_early_device_setup() function to allow
processor-specific code to register Early Platform Data.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-19 13:06:25 +09:00
Magnus Damm eaab89197b sh: arch earlytimer support
Extend the 32-bit SuperH timer code to register and probe
the earlytimer class of Early Platform Drivers.

This registers the sh_cmt driver if compiled-in.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-19 13:06:24 +09:00
Paul Mundt 62c7ae87cb sh: pci: Start unifying the SH7780 PCIC initialization.
This starts moving out the common initialization bits from the various
fixup paths in to the shared init path.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 20:37:16 +09:00
Paul Mundt a6d377b696 sh: pci: Consolidate SH7780 PCIC IRQ routing.
Now that the platform code is a bit leaner, we can start consolidating
the various IRQ routing implementations. There are effectively only 2
variants, and the others can use those directly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 20:11:44 +09:00
Paul Mundt 4c7a47de89 sh: pci: Kill off platform-specific multi-window mappings.
Commit 68b42d1b54 ("sh: sh7785lcr: Map
whole PCI address space.") changed around the semantics of how various
chip-selects are made accessible to PCI. Now that there is a single
large mapping covering from CS0-CS6, there is no longer any need to
do multi-window mapping. Subsequently, all of the differing
implementations can be consolidated in to pci-sh7780.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 17:21:36 +09:00
Paul Mundt ab1363a892 sh: pci: Consolidate PCI I/O and mem window definitions for SH7780.
This consolidates all of the PCI I/O and memory window definitions across
the pci-sh7780 users in pci-sh7780 itself. No functional changes, in that
every platform had exactly the same implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 17:07:47 +09:00
Paul Mundt f1dcab7566 sh: pci: Set the I/O port base to the SH7780 I/O window default.
Presently the I/O port base isn't being set anywhere, which allows things
like generic_inl() to blow up. Fix this up to point at the PCI IO window.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 17:00:27 +09:00
Paul Mundt c66c1d79a9 sh: pci: Set pci_cache_line_size on SH7780 via the PCICLS register.
The SH7780 PCIC contains a read-only cache line size register that we can
derive pci_cache_line_size from. So, make sure that the software idea of
the cache line size actually matches the host controller's idea.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 16:38:00 +09:00
Paul Mundt ab78cbcf68 sh: pci: Use the proper write size for class/sub-class code.
Don't use pci_write_reg() for these, as it defaults to 32-bit. Rather
than using the helper, use __raw_writeb() directly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 15:08:01 +09:00
Paul Mundt 4e7b7fdb12 sh: pci: Rework SH7780 host controller detection.
This reworks how the host controller is probed, and makes it a bit more
verbose in the event a new type of controller is detected. Additionally,
we also log the revision information.

This now uses the proper access sizes for the vendor/device registers,
rather than relying on a larger access that encapsulated both of them.
Not all devices support 32-bit read cycles for these registers.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 15:05:19 +09:00
Paul Mundt 0bbc9bc318 sh: pci: Set class/sub-class code correctly for SH7780 PCIC.
The SH7780 PCI host controller implements a configuration header that
requires a fair bit of hand-holding to initialize properly. By default
it appears as a pre-2.0 host controller given the zeroed out class code,
so fix this up properly.

Some boards that happened to be using the R7780RP version of the PCIC
fixups had set this correctly, but this belongs in the standard
initialization, and is by no means board specific.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 14:09:09 +09:00
Paul Mundt 7e4ba0d77c sh: pci: Prefer P1SEG over P1SEGADDR for CONFIG_CMD.
P1SEGADDR is obsolete and will be killed off completely in the future,
so transition off of it and reference P1SEG explicitly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 14:07:57 +09:00
Paul Mundt b627b4ed3d sh: pci: Move se7780 INTC fixups out of pci-sh7780.c.
These fixups belong in the board INTC setup code, not in the middle of
pci-sh7780.c.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 13:00:18 +09:00
Paul Mundt 84971bb401 sh: pci: Kill off useless debugging printk() in pci-sh7780 init.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-17 12:44:25 +09:00
Paul Mundt 0232ba9ce0 sh: pci: Kill off unused SH4_PCIC_NO_RESET code.
Nothing ended up using this anymore, so just kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 18:01:31 +09:00
Paul Mundt f1a9ba8f15 sh: pci: drop duplicate PCIC fixups for SE7780 and SH7785LCR.
SE7780 has the same PCIC fixup as SDK7780, and SH7785LCR the same
as R7780RP. Switch to using those, and drop the duplicate code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:15 +09:00
Paul Mundt 3aabce8d3d sh: sh7785lcr: Update for recent PCI changes.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:15 +09:00
Paul Mundt 10591578c8 sh: drop duplicate symbol export on dreamcast and sh7785lcr.
With board_pci_channels now being exported in a single place, update the
boards that duplicated the export.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:15 +09:00
Magnus Damm aa5d3ff99c sh: export board_pci_channels in one place
Instead of sometimes exporting board_pci_channels[] in the board specific
code just export it in one place.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:14 +09:00
Magnus Damm 8ce0143b11 sh: pci io port base address code
Adds a __get_pci_io_base() function which is used to match a port range
against struct pci_channel. This allows us to detect if a port range is
assigned to pci or happens to be legacy port io. While at it, remove unused
cpu-specific cruft.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:14 +09:00
Magnus Damm ef339f241b sh: pci memory range checking code
This patch changes the code to use __is_pci_memory() instead of
is_pci_memaddr(). __is_pci_memory() loops through all the pci
channels on the system to match memory windows.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:14 +09:00
Magnus Damm ef53fdeb7e sh: add io_base member to pci_channel
Store the io window base address in struct pci_channel and use that one
instead of SH77xx_PCI_IO_BASE.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:13 +09:00
Magnus Damm e4c6a3604e sh: add reg_base member to pci_channel
Store the base address of the pci host controller registers in struct
pci_channel and use the address in pci_read_reg() and pci_write_reg().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:13 +09:00
Magnus Damm b6706ef10f sh: hook in struct pci_channel in sysdata
Store a struct pci_channel pointer in bus->sysdata. This makes whatever
struct pci_channel assigned to a bus available for sh4_pci_read() and
sh4_pci_write(). We also modify PCIBIOS_MIN_IO and PCIBIOS_MIN_MEM to
use bus->sysdata - this to gives us support for multiple pci channels.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:13 +09:00
Magnus Damm 710fa3c811 sh: avoid using PCIBIOS_MIN_xxx
Replaces PCIBIOS_MIN_IO and PCIBIOS_MIN_MEM with direct struct
pci_channel access. This allows us to have more than one pci
channel.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:13 +09:00
Magnus Damm d0e3db40e2 sh: add init member to pci_channel data
This patch adds an init callback to struct pci_channel and makes sure
it is initialized properly. Code is added to call this init function
from pcibios_init(). Return values are adjusted and a warning is is
printed if init fails.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:12 +09:00
Magnus Damm b8b47bfbe4 sh: pass along struct pci_channel
These patches rework the pci code for the sh architecture.

Currently each board implements some kind of ioport to address mapping.
Some boards use generic_io_base others try passing addresses as io ports.
This is the first set of patches that try to unify the pci code as much
as possible to avoid duplicated code. This will in the end lead to fewer
lines board specific code and more generic code.

This patch makes sure a struct pci_channel pointer is passed along to
various pci functions such as pci_read_reg(), pci_write_reg(),
pci_fixup_pcic(), sh7751_pcic_init() and sh7780_pcic_init().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 16:00:12 +09:00
Paul Mundt bc9f3d4291 sh: Add a generic defconfig for SH7724 platforms.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 15:44:58 +09:00
Paul Mundt 59fe700dcb sh: Have SH7724 select ARCH_SHMOBILE.
This is an SH-Mobile CPU, so select ARCH_SHMOBILE. This enables all of
the PM functionality, amongst other things.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 15:43:42 +09:00
Paul Mundt 6a3395beb9 sh: sh7724: Add CMT clockevents support.
This enables support for the CMT clockevents driver on SH7724.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 15:36:13 +09:00
Kuninori Morimoto ad95b78c9f sh: sh7724: Add VEU support.
This adds uio_pdrv_genirq support for the VEU.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 14:52:13 +09:00
Kuninori Morimoto cd5b9ef776 sh: sh7724: Add VPU support.
This adds uio_pdrv_genirq support for the VPU.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 14:50:55 +09:00
Kuninori Morimoto 40c7e8be55 sh: sh7724: Add I2C support.
This adds support for the SH-Mobile I2C controller on the SH7724.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 14:49:00 +09:00
Kuninori Morimoto 0207a2efb4 sh: Add support for SH7724 (SH-Mobile R2R) CPU subtype.
This implements initial support for the SH-Mobile R2R CPU.
Based on Rev 0.11 of the initial SH7724 hardware manual.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 14:40:56 +09:00
Paul Mundt b8c193f88e sh: sh7723: Don't default enable the RTC clock.
rtc-sh takes care of this now, so no need to have this always enabled.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 14:16:33 +09:00
Paul Mundt 6bf853aeb1 sh: sh7722: Don't default enable the RTC clock.
rtc-sh takes care of this now, so no need to have this always enabled.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16 14:15:38 +09:00
Paul Mundt e588a00fe5 sh: Add in PCI bus for DMA API debugging.
This adds in the pci_bus_type for DMA API debug.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-14 15:23:40 +09:00
Paul Mundt 7b41f5688c sh: Pre-allocate a reasonable number of DMA debug entries.
This prevents the DMA API debugging from running out of entries right
away on boot. Defines 4096 entries by default, which while a bit on the
heavy side, ought to leave enough breathing room for some time.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-14 15:22:15 +09:00
Kuninori Morimoto 0ee50254df sh: sh7786: modify usb setup timeout judgment bug.
This corrects a race with the PHY RST bit not being set properly if the
PLL status changes right before timeout. This resulted in it potentially
failing even if the device came up in time.

Special thanks to Mr. Juha Leppanen and Iwamatsu-san for reporting this
out and reviewing it.

Reported-by: Juha Leppanen <juha_motorsportcom@luukku.com>
Reviewed-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Tested-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-14 07:25:35 +09:00
Kuninori Morimoto fc3f55e672 sh: ap325: use edge control for ov772x camera
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-13 22:45:10 +09:00
Paul Mundt 3cc000b583 sh: Plug in support for ARCH=sh64 using sh SRCARCH.
This adds in support for building with ARCH=sh64 using the sh SRCARCH.
This tidies up the randconfig generation somewhat to make sure that we
don't end up with impossible configurations, and without having to rely
on things like KCONFIG_ALLCONFIG to detect the proper CPU support subset.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-11 08:39:27 +09:00
Kuninori Morimoto 1bc5718533 sh: urquell: Fix up address mapping in board comments.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-10 13:35:28 -07:00
Paul Mundt f802d969b6 sh: Add support for DMA API debugging.
This wires up support for the generic DMA API debugging.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-09 10:36:54 -07:00
Paul Mundt b35346fd25 sh: Provide cpumask_of_pcibus() to fix NUMA build.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-07 17:11:15 -07:00
Kuninori Morimoto 6e97938125 sh: urquell: Add board comment
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-07 09:57:42 -07:00
Paul Mundt 090fed50ca sh: wire up sys_preadv/sys_pwritev() syscalls.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-06 09:00:16 -07:00
Yoshihiro Shimoda 9bb019f4c2 sh: sh7785lcr: fix PCI address map for 32-bit mode
Fix the problem that cannot work PCI device on 32-bit mode because
influence of the commit 68b42d1b54
("sh: sh7785lcr: Map whole PCI address space."). So this patch was
implement like a 29-bit mode, map whole physical address space of
DDR-SDRAM.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-06 08:55:51 -07:00
Linus Torvalds 45e36c1666 Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (23 commits)
  sh: sh7785lcr: Map whole PCI address space.
  sh: Fix up DSP context save/restore.
  sh: Fix up number of on-chip DMA channels on SH7091.
  sh: update defconfigs.
  sh: Kill off broken direct-mapped cache mode.
  sh: Wire up ARCH_HAS_DEFAULT_IDLE for cpuidle.
  sh: Add a command line option for disabling I/O trapping.
  sh: Select ARCH_HIBERNATION_POSSIBLE.
  sh: migor: Fix up CEU use flags.
  input: migor_ts: add wakeup support
  rtc: rtc-sh: use set_irq_wake()
  input: sh_keysc: use enable/disable_irq_wake()
  sh: intc: set_irq_wake() support
  sh: intc: install enable, disable and shutdown callbacks
  clocksource: sh_cmt: use remove_irq() and remove clockevent workaround
  sh: ap325 and Migo-R use new sh_mobile_ceu_info flags
  sh: Fix up -Wformat-security whining.
  sh: ap325rxa: Add ov772x support, again.
  sh: Sanitize asm/mmu.h for assembly use.
  sh: Tidy up sh7786 pinmux table.
  ...
2009-04-05 11:15:54 -07:00
Takashi Yoshii 68b42d1b54 sh: sh7785lcr: Map whole PCI address space.
PCI still doesn't work on sh7785lcr 29bit 256M map mode.

On SH7785, PCI -> SHwy address translation is not base+offset but
somewhat like base|offset (See HW Manual (rej09b0261) Fig. 13.11).
So, you can't export CS2,3,4,5 by 256M at CS2 (results CS0,1,2,3
exported, I guess).  There are two candidates.

a) 128M@CS2 + 128M@CS4
b) 512M@CS0

Attached patch is B. It maps 512M Byte at 0 independently of memory
size. It results CS0 to CS6 and perhaps some more being accessible
from PCI.

Tested on
7785lcr 29bit 128M map
7785lcr 29bit 256M map
(NOT tested on 32bit)

Signed-off-by: Takashi YOSHII <yoshii.takashi@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-04 11:50:52 -04:00
Michael Trimarchi 01ab10393c sh: Fix up DSP context save/restore.
There were a number of issues with the DSP context save/restore code,
mostly left-over relics from when it was introduced on SH3-DSP with
little follow-up testing, resulting in things like task_pt_dspregs()
referencing incorrect state on the stack.

This follows the MIPS convention of tracking the DSP state in the
thread_struct and handling the state save/restore in switch_to() and
finish_arch_switch() respectively. The regset interface is also updated,
which allows us to finally be rid of task_pt_dspregs() and the special
cased task_pt_regs().

Signed-off-by: Michael Trimarchi <michael@evidence.eu.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-04 11:48:11 -04:00
Paul Mundt a27873cd23 sh: Fix up number of on-chip DMA channels on SH7091.
This accidentally regressed when the multi-IRQ changes went in,
switching SH7091 from 4 to 6 channels. Add SH7091 back in to the
4-channel dependency list.

Reported-by: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-04 11:40:22 -04:00
Linus Torvalds 811158b147 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (28 commits)
  trivial: Update my email address
  trivial: NULL noise: drivers/mtd/tests/mtd_*test.c
  trivial: NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h
  trivial: Fix misspelling of "Celsius".
  trivial: remove unused variable 'path' in alloc_file()
  trivial: fix a pdlfush -> pdflush typo in comment
  trivial: jbd header comment typo fix for JBD_PARANOID_IOFAIL
  trivial: wusb: Storage class should be before const qualifier
  trivial: drivers/char/bsr.c: Storage class should be before const qualifier
  trivial: h8300: Storage class should be before const qualifier
  trivial: fix where cgroup documentation is not correctly referred to
  trivial: Give the right path in Documentation example
  trivial: MTD: remove EOL from MODULE_DESCRIPTION
  trivial: Fix typo in bio_split()'s documentation
  trivial: PWM: fix of #endif comment
  trivial: fix typos/grammar errors in Kconfig texts
  trivial: Fix misspelling of firmware
  trivial: cgroups: documentation typo and spelling corrections
  trivial: Update contact info for Jochen Hein
  trivial: fix typo "resgister" -> "register"
  ...
2009-04-03 15:24:35 -07:00
Robin Holt f5f7eac41d Allow rwlocks to re-enable interrupts
Pass the original flags to rwlock arch-code, so that it can re-enable
interrupts if implemented for that architecture.

Initially, make __raw_read_lock_flags and __raw_write_lock_flags stubs
which just do the same thing as non-flags variants.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Signed-off-by: Robin Holt <holt@sgi.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: <linux-arch@vger.kernel.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-02 19:05:11 -07:00
Alexey Dobriyan 6f2c55b843 Simplify copy_thread()
First argument unused since 2.3.11.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-02 19:04:51 -07:00
Paul Mundt 53a52abcf3 sh: update defconfigs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-02 22:02:26 +09:00
Paul Mundt e8208828dc sh: Kill off broken direct-mapped cache mode.
Forcing direct-mapped worked on certain older 2-way set associative
parts, but was always error prone on 4-way parts. As these are the
norm these days, there is not much point in continuing to support this
mode. Most of the folks that used direct-mapped mode generally just
wanted writethrough caching in the first place..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-02 17:40:16 +09:00
Paul Mundt e869a90ee1 sh: Wire up ARCH_HAS_DEFAULT_IDLE for cpuidle.
cpuidle wants ARCH_HAS_DEFAULT_IDLE defined in order to use the
default idle loop. So, make it accessible and enable it for all
sh machines.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-02 13:08:31 +09:00
Paul Mundt eeee7853c4 sh: Add a command line option for disabling I/O trapping.
This adds a 'noiotrap' kernel command line option to permit disabling of
I/O trapping. This is mostly useful for running on emulators where the
physical device limitations are not an issue.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-02 12:31:16 +09:00
Paul Mundt 8dafc34616 sh: Select ARCH_HIBERNATION_POSSIBLE.
Now that the requisite patches have gone in, this can safely be enabled
across the board for all of the 32-bit SH platforms.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-02 11:56:38 +09:00
Paul Mundt 64935056f0 sh: migor: Fix up CEU use flags.
Follows the same change as per ap325rxa, which was inadvertently omitted.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-02 11:25:12 +09:00
Paul Mundt c4361bb64b Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-04-02 11:17:41 +09:00
Kuninori Morimoto 46368fa051 sh: ap325 and Migo-R use new sh_mobile_ceu_info flags
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-31 14:37:31 +09:00
Linus Torvalds d17abcd541 Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask:
  oprofile: Thou shalt not call __exit functions from __init functions
  cpumask: remove the now-obsoleted pcibus_to_cpumask(): generic
  cpumask: remove cpumask_t from core
  cpumask: convert rcutorture.c
  cpumask: use new cpumask_ functions in core code.
  cpumask: remove references to struct irqaction's mask field.
  cpumask: use mm_cpumask() wrapper: kernel/fork.c
  cpumask: use set_cpu_active in init/main.c
  cpumask: remove node_to_first_cpu
  cpumask: fix seq_bitmap_*() functions.
  cpumask: remove dangerous CPU_MASK_ALL_PTR, &CPU_MASK_ALL
2009-03-30 18:00:26 -07:00
Paul Mundt 0bd4781d40 sh: Fix up -Wformat-security whining.
Triggers -Werror on gcc-4.3:

arch/sh/kernel/setup.c: In function 'early_parse_mem':
arch/sh/kernel/setup.c:111: error: format not a string literal and no format arguments
...

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-31 08:25:54 +09:00
Kuninori Morimoto 4713125876 sh: ap325rxa: Add ov772x support, again.
Now that the V4L bits have finally settled..

This patch adds support for a secondary ov772x camera on ap325rxa.
This is supported in addition to the regular soc_camera_platform camera.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-31 08:08:47 +09:00
Francesco VIRLINZI 3b4df71b36 sh: Sanitize asm/mmu.h for assembly use.
This patch adds the ifndef __ASSEMBLY__ preprocessor to allow the
defines in the file to be used also in assembly code.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-31 07:42:37 +09:00
Kuninori Morimoto 1c58b0b1a1 sh: Tidy up sh7786 pinmux table.
Formatting and typo fix.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-31 07:39:51 +09:00
Nobuhiro Iwamatsu f36b59d1a4 sh: Add MMU dependency for kexec
Kexec is not likely to work on NON-MMU CPU because this added
depend on MMU for kexec.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-31 07:38:37 +09:00
Kuninori Morimoto 71c1d19e45 sh: urquell: enable LAN device
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-31 07:37:54 +09:00
Kuninori Morimoto 0824806b2a sh: Remove buggy definition from SH7786 pinmux_data[]
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-31 07:36:24 +09:00
Guennadi Liakhovetski 2d9329f3a5 V4L/DVB (10665): soc-camera: add data signal polarity flags to drivers
All soc-camera camera and host drivers must specify supported data signal
polarity, after all drivers are fixed, we'll add a suitable test to
soc_camera_bus_param_compatible().

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:52 -03:00
Matt LaPlante 692105b8ac trivial: fix typos/grammar errors in Kconfig texts
Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-30 15:22:01 +02:00
Rusty Russell 1a8a51004a cpumask: remove references to struct irqaction's mask field.
Impact: cleanup

It's unused, since about 1995.  So remove all initialization of it in
preparation for actually removing the field.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
2009-03-30 22:05:14 +10:30
Rusty Russell 0451fb2ebc cpumask: remove node_to_first_cpu
Everyone defines it, and only one person uses it
(arch/mips/sgi-ip27/ip27-nmi.c).  So just open code it there.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-mips@linux-mips.org
2009-03-30 22:05:12 +10:30
Wolfram Sang 8e99ada8de i2c-algo-pca: Rework waiting for a free bus
Waiting for a free bus now accepts the timeout value in jiffies and does
proper checking using time_before.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-03-28 21:34:45 +01:00
Linus Torvalds a8416961d3 Merge branch 'irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (32 commits)
  x86: disable __do_IRQ support
  sparseirq, powerpc/cell: fix unused variable warning in interrupt.c
  genirq: deprecate obsolete typedefs and defines
  genirq: deprecate __do_IRQ
  genirq: add doc to struct irqaction
  genirq: use kzalloc instead of explicit zero initialization
  genirq: make irqreturn_t an enum
  genirq: remove redundant if condition
  genirq: remove unused hw_irq_controller typedef
  irq: export remove_irq() and setup_irq() symbols
  irq: match remove_irq() args with setup_irq()
  irq: add remove_irq() for freeing of setup_irq() irqs
  genirq: assert that irq handlers are indeed running in hardirq context
  irq: name 'p' variables a bit better
  irq: further clean up the free_irq() code flow
  irq: refactor and clean up the free_irq() code flow
  irq: clean up manage.c
  irq: use GFP_KERNEL for action allocation in request_irq()
  kernel/irq: fix sparse warning: make symbol static
  irq: optimize init_kstat_irqs/init_copy_kstat_irqs
  ...
2009-03-26 16:06:50 -07:00
David S. Miller 08abe18af1 Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
	drivers/net/wimax/i2400m/usb-notif.c
2009-03-26 15:23:24 -07:00
Steve Glendinning eaeed5d31d sh: add support for SMSC Polaris platform
Polaris is an SMSC reference platform with a SH7709S CPU and LAN9118
ethernet controller.  This patch adds support for it.

Updated following feedback from Nobuhiro Iwamatsu.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Reviewed-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-21 01:26:33 +09:00
Rafael Ignacio Zurita 3bf509230a sh: fix the HD64461 level-triggered interrupts handling
Rework the hd64461 demuxer code to fix the HD64461 level-triggered
interrupts handling, using handle_level_irq() as needed.

Signed-off-by: Rafael Ignacio Zurita <rizurita@yahoo.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-20 18:57:48 +09:00
Magnus Damm 615e73b3cd sh: disallow kexec virtual entry
Older versions of kexec-tools has a zImage loader that
passes a virtual address as entry point. The elf loader
otoh it passes a physical address as entry point, and
pages are always passed as physical addresses as well.

Only allow physical addresses from now on.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-20 18:56:04 +09:00
Paul Mundt 7e6b6f2b94 sh: kexec jump: fix for ftrace.
Save and restore ftrace state when returning from kexec jump in
machine_kexec(). Follows the x86 change.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-18 19:07:16 +09:00
Paul Mundt a6bab7b5c1 sh: kexec: Drop SR.BL bit toggling.
For the time being, this creates far more problems than it solves,
evident by the second local_irq_disable(). Kill all of this off
and rely on IRQ disabling to protect against the VBR reload.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-18 19:06:15 +09:00
Magnus Damm b7cf6ddc13 sh: add kexec jump support
Add kexec jump support to the SuperH architecture.

Similar to the x86 implementation, with the following
exceptions:

- Instead of separating the assembly code flow into
two parts for regular kexec and kexec jump we use a
single code path. In the assembly snippet regular
kexec is just kexec jump that never comes back.

- Instead of using a swap page when moving data between
pages the page copy assembly routine has been modified
to exchange the data between the pages using registers.

- We walk the page list twice in machine_kexec() to
do and undo physical to virtual address conversion.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-18 18:57:43 +09:00
Magnus Damm e4e063d0c2 sh: rework kexec segment code
Rework the kexec code to avoid using P2SEG. Instead
we walk the page list in machine_kexec() and convert
the addresses from physical to virtual using C.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-18 18:44:32 +09:00
Magnus Damm 7be5c55af0 sh: simplify kexec vbr code
Setup the vbr register in machine_kexec(). This
instead of passing values to the assembly snippet.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-18 18:44:22 +09:00
Paul Mundt c20351846e sh: Flush only the needed range when unmapping a VMA.
This follows the ARM change from Aaro Koskinen:

	When unmapping N pages (e.g. shared memory) the amount of TLB
	flushes done can be (N*PAGE_SIZE/ZAP_BLOCK_SIZE)*N although it
	should be N at maximum. With PREEMPT kernel ZAP_BLOCK_SIZE is 8
	pages, so there is a noticeable performance penalty when
	unmapping a large VMA and the system is spending its time in
	flush_tlb_range().

	The problem is that tlb_end_vma() is always flushing the full VMA
	range. The subrange that needs to be flushed can be calculated by
	tlb_remove_tlb_entry(). This approach was suggested by Hugh
	Dickins, and is also used by other arches.

	The speed increase is roughly 3x for 8M mappings and for larger
	mappings even more.

Bits and peices are taken from the ARM patch as well as the existing
arch/um implementation that is quite similar.

The end result is a significant reduction in both partial and full TLB
flushes initiated through flush_tlb_range().

At the same time, the nommu implementation was broken, had a superfluous
cache flush, and subsequently would have triggered a BUG_ON() if a
code-path had triggered it. Tidy this up for correctness and provide a
nopped-out implementation there.

More background on the initial discussion can be found at:

	http://marc.info/?t=123609820900002&r=1&w=2
	http://marc.info/?t=123660375800003&r=1&w=2

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-17 21:19:49 +09:00
Paul Mundt 3a3b311ca3 sh: Update debugfs ASID dumping for 16-bit ASID support.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-17 17:59:31 +09:00
Paul Mundt c54a43e90b sh: tlb-pteaex: Kill off legacy PTEA updates.
While harmless, PTEA has different semantics on these parts, and is only
used in extended TLB mode. Kill off the legacy support.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-17 17:58:33 +09:00
Paul Mundt 8263a67e16 sh: Support for extended ASIDs on PTEAEX-capable SH-X3 cores.
This adds support for extended ASIDs (up to 16-bits) on newer SH-X3 cores
that implement the PTAEX register and respective functionality. Presently
only the 65nm SH7786 (90nm only supports legacy 8-bit ASIDs).

The main change is in how the PTE is written out when loading the entry
in to the TLB, as well as in how the TLB entry is selectively flushed.

While SH-X2 extended mode splits out the memory-mapped U and I-TLB data
arrays for extra bits, extended ASID mode splits out the address arrays.
While we don't use the memory-mapped data array access, the address
array accesses are necessary for selective TLB flushes, so these are
implemented newly and replace the generic SH-4 implementation.

With this, TLB flushes in switch_mm() are almost non-existent on newer
parts.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-17 17:49:49 +09:00
Nobuhiro Iwamatsu da78800632 sh: sh7763rdp: Change IRQ number for sh_eth of sh7763rdp
IRQ for sh_eth of sh7763rdp became multi handling.
Therefore, the IRQ number of sh_eth is changed, too.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-17 15:20:59 +09:00
Nobuhiro Iwamatsu 32910e2c52 sh: espt-giga board support
This adds support for the ESPT-Giga (Ethernet Serial Parallel
Translator) SH7763-based reference board.

Board support is relatively sparse, presently supporting serial,
gigabit ethernet, USB host, and MTD.

More information (in Japanese) available at:

	http://www.cente.jp/product/cente_hard/ESPT-Giga.html

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-17 15:18:52 +09:00
Paul Mundt 40f49e7ed7 sh: dma: Make G2 DMA configurable.
Follow the PVR2 DMAC change for G2 DMA.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-17 12:47:56 +09:00
Paul Mundt da62e71d13 sh: dma: Make PVR2 DMA configurable.
With arch/sh/drivers/dma/ always being built, the Dreamcast DMA engines
are being unconditionally built in, regardless of whether the DMA API is
enabled or not. This is a regression from previous behaviour, but there
is not much advantage in building them all in unconditionally regardless.
Add a new config option to make it optional, and update the only user of
it to reflect that.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-17 09:30:36 +09:00
Nobuhiro Iwamatsu 988f831df3 sh: Move IRQ multi definition of DMAC to defconfig
When SuperH CPU has IRQ multi of DMAC, SH_DMA_IRQ_MULTI becomes enable.
The following CPU's are Multi IRQ of DMAC now.
 - SH775X and SH7091
 - SH776X
 - SH7780
 - SH7785

If SH_DMA_IRQ_MULTI becomes enable, dma-sh api driver is optimized
for Multi IRQ.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16 20:14:25 +09:00
Francesco VIRLINZI 50cca715a6 sh: clkfwk: Safer resume from hibernation.
This patch fixes a possible problem in the resume from
hibenration. It temporaneally saves the clk->rate on the
stack to avoid any possible change during the clk->set_parent(..)
call.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16 20:11:00 +09:00
Paul Mundt e9edb3fec2 sh: Consolidate SH-Mobile CPU code in arch/sh/kernel/cpu/shmobile/.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16 20:00:17 +09:00
Magnus Damm 93356d0747 sh: add ap325 lcd power off support
Improve the ap325 board code to allow the lcd panel
and backlight to be powered off.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16 19:53:02 +09:00
Magnus Damm 7759491274 sh: SuperH Mobile suspend support
This patch contains CONFIG_SUSPEND support to the SuperH
architecture. If enabled, SuperH Mobile processors will
register their suspend callbacks during boot.

To suspend, use "echo mem > /sys/power/state". To allow
wakeup, make sure "/sys/device/platform/../power/wakeup"
contains "enabled". Additional per-device driver patches
are most likely needed.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16 19:52:53 +09:00
Nobuhiro Iwamatsu 7a516280b6 sh: Fix compile error by operands(mov.l) in sh3/entry.S
-- log --
arch/sh/kernel/cpu/sh4/../sh3/entry.S:365: Error: invalid operands for opcode
make[4]: *** [arch/sh/kernel/cpu/sh4/../sh3/entry.o] Error 1
make[3]: *** [arch/sh/kernel/cpu/sh4] Error 2
-- log --

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16 19:49:21 +09:00
Nobuhiro Iwamatsu 02ebd32f52 sh: Disable get_dma_error_irq for non-SH4 targets.
dma-sh's get_dma_error_irq() is only used by SH4, as the SH3
doesn't have the DMA Error interrupt.

Disable it out for non-SH4 builds.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16 19:49:01 +09:00
Francesco VIRLINZI a83c0b739f sh: PMB hibernation support
This implements preliminary suspend/resume support for the PMB.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16 19:46:17 +09:00
Nobuhiro Iwamatsu 039a718ebb sh: Revert CONFIG_NR_ONCHIP_DMA_CHANNELS to MAX_DMA_CHANNELS
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16 19:43:08 +09:00
Kuninori Morimoto 4c3f450ba4 sh: Add OHCI USB support for SH7786
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16 19:40:34 +09:00
Ingo Molnar edb35028e4 Merge branches 'irq/genirq' and 'linus' into irq/core 2009-03-16 09:20:13 +01:00
Magnus Damm 600fa578a9 sh: improve sh7785lcr power off code
Improve the sh7785lcr power off implementation to
never return. It takes some time before the board
is actually powered off, just hang after asking
the harware to power down.

This removes the serial port garbage printout.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-11 17:25:10 +09:00
Francesco VIRLINZI 4a55026fd7 sh: clkfwk: Add resume from hibernation support.
This patch adds PM support to the clock framework.
With this, resume from hibernation is properly supported.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-11 17:18:50 +09:00
Francesco VIRLINZI d680c76ecc sh: clkfwk: add clk_set_parent/clk_get_parent
This patch adds the clk_set_parent/clk_get_parent routines to the sh
clock framework.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-11 17:18:46 +09:00
Nobuhiro Iwamatsu 71b973a42c sh: dma-sh updates for multi IRQ and new SH-4A CPUs.
This adds DMA support for newer SH-4A CPUs, particularly SH7763/64/80/85.

This also enables multi IRQ support for platforms that have multiple
vectors bound to the same IRQ source.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10 17:26:49 +09:00
Paul Mundt ae68df5635 sh: Generate uImage by default on Urquell board.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10 17:00:48 +09:00
Paul Mundt dc65a977ce sh: Define ARCH_SHMOBILE for SH-Mobile CPUs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10 16:26:29 +09:00
Yoshihiro Shimoda 8ffe313342 sh: pci-sh7780: fix pci memory address for fixed PMB
Fix the problem that cannot work a PCI device when 32-bit physical
address mode.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10 15:51:49 +09:00
Yoshihiro Shimoda df4d4f1a47 sh: sh7785lcr: Updates for fixed PMB.
Add a new defconfig for SH7785LCR in 32-bit mode, and update the power
off code to avoid 29-bit assumptions.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10 15:50:44 +09:00
Yoshihiro Shimoda 2f47f44790 sh: Support fixed 32-bit PMB mappings from bootloader.
This provides a method for supporting fixed PMB mappings inherited from
the bootloader, as an alternative to the dynamic PMB mapping currently
used by the kernel. In the future these methods will be combined.

P1/P2 area is handled like a regular 29-bit physical address, and local
bus device are assigned P3 area addresses.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10 15:49:54 +09:00
Magnus Damm 508407149a sh: Show sleep state with Migo-R LEDs
If CONFIG_PM is set, let Migo-R LEDs show sleep states.
D11 will show STATUS0 and D12 PDSTATUS.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10 15:26:56 +09:00
Paul Mundt 74aaf024c9 Merge branch 'sh/stable-updates' 2009-03-10 15:25:18 +09:00
Nobuhiro Iwamatsu ba087e6f69 sh: Add media/soc_camera.h to board setup of Renesas AP325RXA
Other compilation errors were revised by commit of
"sh: ap325rxa: Revert ov772x support"
(08c2f5b4d7) but other compilation
errors are given.
We revert this commit and need to add new header(media/soc_camera.h).
This change revises new compilation error.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10 15:20:54 +09:00
Paul Mundt e161183ba6 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-03-10 15:17:26 +09:00
Magnus Damm 2ef7f0dab6 sh: hibernation support
Add Suspend-to-disk / swsusp / CONFIG_HIBERNATION support
to the SuperH architecture.

To suspend, use "swapon /dev/sda2; echo disk > /sys/power/state"
To resume, pass "resume=/dev/sda2" on the kernel command line.

The patch "pm: rework includes, remove arch ifdefs V2" is
needed to allow the generic swsusp code to build properly.

Hibernation is not enabled with this patch though, a patch
setting ARCH_HIBERNATION_POSSIBLE will be submitted later.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10 12:55:40 +09:00
Paul Mundt edab56f4c9 sh: multiple vectors per irq - sh7720.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 19:21:02 +09:00
Paul Mundt 56d604defa sh: multiple vectors per irq - sh7710.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 19:20:48 +09:00
Paul Mundt 0caedb02c4 sh: multiple vectors per irq - sh7705.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 19:20:32 +09:00
Paul Mundt 592acbda89 sh: multiple vectors per irq - sh770x.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 19:20:14 +09:00
Paul Mundt 053bfc5360 sh: multiple vectors per irq - mxg.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 19:19:54 +09:00
Paul Mundt 5dece2bbda sh: multiple vectors per irq - sh7619.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 19:19:31 +09:00
Paul Mundt f858abbecd sh: multiple vectors per irq - sh7206.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 18:34:15 +09:00
Paul Mundt d55eedd57d sh: multiple vectors per irq - sh7201.
Follow the conversions as per the other subtypes.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 18:21:38 +09:00
Paul Mundt e45efe68d1 sh: multiple vectors per irq - sh7263.
Convert over the SH7263 IRQ groups as well.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 18:02:33 +09:00
Paul Mundt bb943a286c sh: multiple vectors per irq - sh7203.
Follow the conversions as per the other subtypes.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 17:58:51 +09:00
Nobuhiro Iwamatsu 075901af28 sh: Restore RTC IRQ setting for SH7763 setup.
This was accidentally dropped in the multiple vectors per irq conversion.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 14:37:34 +09:00
Nobuhiro Iwamatsu a6bc77241d sh: multiple vectors per irq - sh7763
Update intc tables and platform data to use one linux irq
per maskable interrupt source instead of keeping the one-to-one
mapping between vectors and linux irqs.

This fixes potential irq masking issues for sh7763 hardware
blocks such as RTC/SCIF/DMAC/GETHER/PCIC5/MMCIF/SIM/GPIO/USBF.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-06 14:18:43 +09:00
Paul Mundt a4b1fddcd4 sh: Set a sensible default for the SH7786 pclk.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-05 17:52:34 +09:00
Kuninori Morimoto 929ef1a1f5 sh: urquell: Add smc91x support and update defconfig accordingly.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-05 17:37:12 +09:00
Kuninori Morimoto 5ac072e110 sh: Urquell board support.
This adds preliminary support for the SH7786-based Urquell board.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-03 16:22:00 +09:00
Paul Mundt 37042fbd8b sh: SH7786 is an SH-X3 core, select CPU_SHX3.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-03 15:57:02 +09:00
Kuninori Morimoto 55ba99eb21 sh: Add support for SH7786 CPU subtype.
This adds preliminary support for the SH7786 CPU subtype.

While this is a dual-core CPU, only UP is supported for now. L2 cache
support is likewise not yet implemented.

More information on this particular CPU subtype is available at:

	http://www.renesas.com/fmwk.jsp?cnt=sh7786_root.jsp&fp=/products/mpumcu/superh_family/sh7780_series/sh7786_group/

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-03 15:40:25 +09:00
David S. Miller aa4abc9bcc Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/wireless/iwlwifi/iwl-tx.c
	net/8021q/vlan_core.c
	net/core/dev.c
2009-03-01 21:35:16 -08:00
Paul Mundt 0d5e19ab07 sh: Fix up SH-X3 general exception handler build.
With the recent entry.S refactoring, the SH-X3 path had a mov.l for a
register to register copy, resulting in:

  AS      arch/sh/kernel/cpu/sh4/../sh3/entry.o
arch/sh/kernel/cpu/sh4/../sh3/entry.S: Assembler messages:
arch/sh/kernel/cpu/sh4/../sh3/entry.S:366: Error: invalid operands for opcode
make[3]: *** [arch/sh/kernel/cpu/sh4/../sh3/entry.o] Error 1

Switch it over to a mov to fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 17:02:28 +09:00
Magnus Damm 57e41c86e2 sh: multiple vectors per irq - sh7785
Update intc tables and platform data to use one linux irq
per maskable interrupt source instead of keeping the one-to-one
mapping between vectors and linux irqs.

This fixes potential irq masking issues for sh7785 hardware
blocks such as SCIF/DMAC/PCIC5/MMCIF/GDTA/FLCTL/GPIO

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Tested-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 16:53:50 +09:00
Magnus Damm a842fb2d11 sh: multiple vectors per irq - sh7780
Update intc tables and platform data to use one linux irq
per maskable interrupt source instead of keeping the one-to-one
mapping between vectors and linux irqs.

This fixes potential irq masking issues for sh7780 hardware
blocks such as SCIF/RTC/DMAC/PCIC5/MMCIF/FLCTL/GPIO

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 16:53:50 +09:00
Magnus Damm 69977e7e25 sh: multiple vectors per irq - sh7750
Update intc tables and platform data to use one linux irq
per maskable interrupt source instead of keeping the one-to-one
mapping between vectors and linux irqs.

This fixes potential irq masking issues for sh775x hardware
blocks such as SCI/SCIF/RTC/DMAC/TMU2/REF.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 16:53:50 +09:00
Magnus Damm bdaa6e8062 sh: multiple vectors per irq - base
Instead of keeping the single vector -> single linux irq mapping
we extend the intc code to support merging of vectors to a single
linux irq. This helps processors such as sh7750, sh7780 and sh7785
which have more vectors than masking ability. With this patch in
place we can modify the intc tables to use one irq per maskable
irq source. Please note the following:

 - If multiple vectors share the same enum then only the
   first vector will be available as a linux irq.

 - Drivers may need to be rewritten to get pending irq
   source from the hardware block instead of irq number.

This patch together with the sh7785 specific intc tables solves
DMA controller irq issues related to buggy interrupt masking.

Reported-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 16:53:50 +09:00
Magnus Damm 3e91faec47 sh: fix P4 iounmap() pass-through
Fix iounmap() of pass-through P4 addresses. Without this patch
iounmap() on the sh7780 rtc area results in a warning message.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 16:50:00 +09:00
Paul Mundt a73090ffaf sh: Disable unsupportable prefetching on SH-3.
The SH-3 does not support 'pref'-based prefetching, only SH-2A and SH-4A
parts do. Remove SH-3 from the list.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 16:42:05 +09:00
Magnus Damm 0197f21ca5 sh: prefetch early exception data on sh4/sh4a.
Prefetch early exception data. There is unused space in our
exception handler cache line anyway, so this is almost free.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 16:41:17 +09:00
Magnus Damm 4f099ebb27 sh: remove EXPEVT vector from stack on sh3/sh4/sh4a
Remove EXPEVT vector from the stack, lookup_exception_vector()
for sh3/sh4/sh4a is already using k2 to get the vector.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 16:26:19 +09:00
Magnus Damm 1dd22722f6 sh: rework register restore code for sh3/sh4/sh4a
This patch reworks the sh3/sh4/sh4a register restore code in
the following ways:
 - break out restore_regs() from restore_all()
 - the register saving order is unchanged
 - use restore_regs() in sh_bios_handler and restore_all
 - document the function

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 16:26:14 +09:00
Magnus Damm 1d015cf02a sh: shared register saving code for sh3/sh4/sh4a
This patch reworks the sh3/sh4/sh4a register saving code in
the following ways:
 - break out prepare_stack_save_dsp() from handle_exception()
 - break out save_regs() from handle_exception()
 - the register saving order is unchanged
 - align new functions to fit in cache lines
 - separate exception code from interrupt code
 - keep main code flow in a single cache line per exception vector
 - use bsr/rts for regular functions (save pr first)
 - keep data in one shared cache line (exception_data)
 - document the functions
 - tie in the hp6xx code

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 16:26:10 +09:00
Paul Mundt 08c2f5b4d7 sh: ap325rxa: Revert ov772x support.
This change depends on some v4l changes that have been pushed back to
2.6.30, so drop this and fall back on the old soc_camera code until then.

Reported-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Acked-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-27 15:41:14 +09:00
Patrick Ohly cb9eff0978 net: new user space API for time stamping of incoming and outgoing packets
User space can request hardware and/or software time stamping.
Reporting of the result(s) via a new control message is enabled
separately for each field in the message because some of the
fields may require additional computation and thus cause overhead.
User space can tell the different kinds of time stamps apart
and choose what suits its needs.

When a TX timestamp operation is requested, the TX skb will be cloned
and the clone will be time stamped (in hardware or software) and added
to the socket error queue of the skb, if the skb has a socket
associated with it.

The actual TX timestamp will reach userspace as a RX timestamp on the
cloned packet. If timestamping is requested and no timestamping is
done in the device driver (potentially this may use hardware
timestamping), it will be done in software after the device's
start_hard_xmit routine.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-15 22:43:33 -08:00
Ingo Molnar 8f8573ae9f Merge branches 'irq/genirq', 'irq/sparseirq' and 'irq/urgent' into irq/core 2009-02-13 11:57:18 +01:00
Paul Mundt 41480ae7a3 Merge branch 'sh/stable-updates' 2009-02-12 17:27:56 +09:00
Tobias Klauser 270c5609e2 sh: Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-12 17:26:09 +09:00
Paul Mundt 508eb2ce22 sh: Restrict old CMT timer code to SH-2/SH-2A.
None of the other platforms use this, and need individual porting.
Restrict it back to the supported set of CPU subtypes.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-02-04 15:28:06 +09:00
Paul Mundt c161e40f45 sh: Don't enable GENERIC_TIME for the CMT clockevent driver yet.
GENERIC_TIME still depends on the clocksource bits being there, which is
presently not supported. This allows the CMT clockevent driver to be used
alongside alternate system timers that do not yet provide a clocksource
of their own (MTU2 and so on in the case of SH-2A).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 18:11:25 +09:00
Paul Mundt d63f3a5857 sh: Fix up MTU2 support for SH7203.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 18:10:13 +09:00
Paul Mundt f5ad881b42 sh: Use SYS_SUPPORTS_CMT for managing CMT timer dependencies.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 18:08:58 +09:00
Magnus Damm 424f59d04d sh: CMT platform data for sh7723/sh7722/sh7366/sh7343
CMT platform data for SuperH Mobile sh7723/sh7722/sh7343/sh7366.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 17:02:51 +09:00
Magnus Damm 3fb1b6ad06 sh: CMT clockevent platform driver
SuperH CMT clockevent driver.

Both 16-bit and 32-bit CMT versions are supported, but only 32-bit
is tested. This driver contains support for both clockevents and
clocksources, but no unregistration is supported at this point.

Works fine as clock source and/or event in periodic or oneshot mode.
Tested on sh7722 and sh7723, but should work with any cpu/architecture.

This version is lacking clocksource and early platform driver support
for now - this to minimize the amount of dependencies.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 16:56:32 +09:00
Magnus Damm 07821d3310 sh: fix no sys_timer case
Handle the case with a sys_timer set to NULL.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 16:45:47 +09:00
Magnus Damm 70f0800133 sh: tmu disable support
Add TMU disable support so we can use other clockevents.
Also, setup the clockevent rating.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 16:44:18 +09:00
Magnus Damm 955c077872 sh: rework clocksource and sched_clock
Rework and simplify the sched_clock and clocksource code. Instead
of registering the clocksource in a shared file we move it into the
tmu driver. Also, add code to handle sched_clock in the case of no
clocksource.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 16:44:17 +09:00
Roel Kluin dc66ff6220 SH: fix start_thread and user_stack_pointer macros
Fix macros start_thread and user_stack_pointer.
When these macros aren't called with a variable named regs as second
argument, this will result in a build failure.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 15:41:15 +09:00
Matt Fleming 84fdf6cda3 sh: Use the atomic_t "counter" member
Now that atomic_t is a generic opaque type for all architectures, it is
unwise to use intimate knowledge of its internals when manipulating it.

Instead of relying on the "counter" member being at offset 0 from the
beginning of an atomic_t, explicitly reference the member. This guards
us from any changes to the layout of the beginning of the atomic_t type.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:57:10 +09:00
Matt Fleming 42990701f9 sh: Relax inline assembly constraints
When dereferencing the memory address contained in a register and
modifying the value at that memory address, the register should not be
listed in the inline asm outputs. The value at the memory address is an
output (which is taken care of with the "memory" clobber), not the register.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:57:09 +09:00
Paul Mundt e4e3c3f17f Merge branch 'sh/stable-updates' 2009-01-29 11:56:45 +09:00
Takashi Yoshii c20f326a62 sh: Fix up T-bit error handling in SH-4A mutex fastpath.
This corrects a deadlock encountered on ap325 in the cases where the
mutex is contended and the slow-path needs to be fallen back upon.

Signed-off-by: Takashi YOSHII <yoshii.takashi@renesas.com>
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:56:03 +09:00
Paul Mundt 03f07876df sh: Fix up spurious syscall restarting.
The T-bit manipulation for syscall error checking had the side effect of
spuriously returning ERESTART* errno values over EINTR. So, we simplify
the error checking a bit and leave the T-bit alone.

Reported-by: Kaz Kojima <kkojima@rr.iij4u.or.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:56:03 +09:00
Carmelo AMOROSO 0f6dee232f sh: fcnvds fix with denormalized numbers on SH-4 FPU.
This fixes a bug in the FPU exception handler for the FCNVDS instruction.
To get the register number the instruction is shifted right by 9,
though it should be shifted right by 8.

More information at ST Linux bugzilla:

	https://bugzilla.stlinux.com/show_bug.cgi?id=4892

Signed-off-by: Giuseppe Di Giore <giuseppe.di-giore@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:56:02 +09:00
Christopher SMITH 4886516310 sh: Only reserve memory under CONFIG_ZERO_PAGE_OFFSET when it != 0.
Signed-off-by: Chris Smith <chris.smith@st.com>
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:56:02 +09:00
Stuart Menefy cadc4e1a2b sh: Handle calling csum_partial with misaligned data
In rare circumstances csum_partial() can be called with data which is
not 16 or 32 bit aligned. This is been observed with RPC calls for NFS
file systems for example. Add support for handling this without resorting
to the misaligned fixup code (which is why this hasn't been seen as a
problem). This mimics the i386 version, which has had this support for
some time.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:56:02 +09:00
Kuninori Morimoto 3d22fca7ab sh: ap325rxa: Enable ov772x in defconfig.
This patch updates the ap325 defconfig to include
ov772x camera driver.
Old camera is still supported.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:56:02 +09:00
Kuninori Morimoto 7a65d245fa sh: ap325rxa: Add ov772x support.
This patch add ov772x camera settings to ap325,
Old camera is still supported. And it will be 2nd camera
if you select ov772x and soc_camera_platform in same time.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:56:02 +09:00
Kuninori Morimoto 86746284e2 sh: ap325rxa: control camera power toggling.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:56:02 +09:00
Kuninori Morimoto 334d99072d sh: mach-migor: Enable ov772x and tw9910 in defconfig.
This patch updates the Migo-R defconfig to include
ov772x camera and tw9910 video driver

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29 11:56:02 +09:00
Paul Mundt ae5e6d05a6 sh: mach-highlander and mach-rsk require gpiolib.
Fix up the build for mach-highlander and mach-rsk. These operated on the
assumption that GENERIC_GPIO support with an optional GPIOLIB was
possible. This used to be true, but has not been the case since commit-id
d56cc8bc661ac1ceded8d45ba2d53bb134fee17d ("sh: use gpiolib"), where the
GENERIC_GPIO implementation was rewritten to use GPIOLIB directly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-27 14:49:10 +09:00
Paul Mundt 57e97cb8be sh: Fix up GENERIC_GPIO build for ARCH_WANT_OPTIONAL_GPIO cases.
CPUs define pinmux tables through the optional interface, while boards
that require demux of their own require it explicitly. Roll the Makefile
rules back to depend on GENERIC_GPIO, which covers both cases.

Fixes a link error with an undefined reference to register_pinmux() on
optional platforms.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-27 14:49:10 +09:00
Magnus Damm 69edbba002 sh: use gpiolib
This patch updates the SuperH gpio code to make use of gpiolib. The
gpiolib callbacks get() and set() are lockless, but we use our own
spinlock for the other operations to make sure hardware register
bitfield accesses stay atomic.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-27 14:49:10 +09:00
Magnus Damm 3292094e88 sh: lockless gpio_set_value()
This patch optimizes the gpio data register handling for gpio_set_value().

Instead of using the good old spinlock-plus-read-modify-write strategy
we now use a shadow register and atomic operations.

This improves the bitbanging mmc performance on Migo-R from 26 Kbytes/s
to 40 Kbytes/s.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-27 14:49:10 +09:00
Magnus Damm 0fc64cc0a2 sh: lockless gpio_get_value()
This patch separates the register read and write functions to
allow lockless gpio_get_value().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-27 14:49:09 +09:00
Magnus Damm 18801be7f8 sh: make gpio_get/set_value() O(1)
This patch modifies the table based SuperH gpio implementation to
make use of direct table lookups. With this change the functions
gpio_get_value() and gpio_set_value() are O(1).

Tested on Migo-R using bitbanging mmc. Performance is improved from
11 KBytes/s to 26 Kbytes/s.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-27 14:49:09 +09:00
Linus Torvalds cfb901bf84 Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  i2c: Warn on deprecated binding model use
  eeprom: More consistent symbol names
  eeprom: Move 93cx6 eeprom driver to /drivers/misc/eeprom
  spi: Move at25 (for SPI eeproms) to /drivers/misc/eeprom
  i2c: Move old eeprom driver to /drivers/misc/eeprom
  i2c: Move at24 to drivers/misc/eeprom
  i2c: Quilt tree has moved
  i2c: Delete many unused adapter IDs
  i2c: Delete 10 unused driver IDs
2009-01-26 15:11:41 -08:00
Jean Delvare dd7f8dbe2b eeprom: More consistent symbol names
Now that all EEPROM drivers live in the same place, let's harmonize
their symbol names.

Also fix eeprom's dependencies, it definitely needs sysfs, and is no
longer experimental after many years in the kernel tree.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
2009-01-26 21:19:57 +01:00
SUGIOKA Toshinobu 2afb447f33 sh: fix unaligned and nonexistent address handling
unaligned and nonexistent address causes wrong exception
handling in traps_32.c(handle_unaligned_access).

'handle_unalinged_ins' should return -EFAULT if address error
is fixed up with kernel exception table, otherwise
'handle_unaligned_access' increases already fixed program counter
and then crash.

for example
   ioctl(fd, TCGETA, (struct termio *)-1)
never return and stay in TASK_UNINTERRUPTIBLE state forever
in my kernel.

Signed-off-by: SUGIOKA Toshinobu <sugioka@itonet.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 18:35:55 +09:00
Magnus Damm 3442c0d627 sh: export the sh7343 JPU to user space
This patch exports the sh7343 JPU to user space using uio_pdrv_genirq,
very similar to the sh7722 JPU patch by Hayama-san.

While at it fix up the end of the sh7722 JPU iomem resource.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:44:26 +09:00
Paul Mundt 5e8766f1c1 sh: update defconfigs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:44:16 +09:00
Paul Mundt e16038aba3 sh: Kill off obsolete busses from arch/sh/Kconfig.
ISA can go away now that the hd6446x PCMCIA drivers no longer exist
in-tree. The rationale for enabling CONFIG_ISA in the first place is
likewise no longer valid given that the subsystem has changed since
the time that assertion was valid.

While we are at it, kill off SBUS, MCA, EISA, and so on. These are
not supported and never will be.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:44:01 +09:00
Paul Mundt 604437f0f8 sh: sh7785lcr/highlander/hp6xx need linux/irq.h.
More build fixes..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:43:25 +09:00
Magnus Damm 70e5c4f084 sh: Migo-R MMC support using spi_gpio and mmc_spi.
This patch adds CN9 MMC support for MigoR using the mmc_spi
driver on top of the bitbanging spi_gpio driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:43:23 +09:00
Magnus Damm fbdd9a70c2 sh: ap325rxa MMC support using spi_gpio and mmc_spi
This patch adds CN3 MMC support for ap325rxa using the mmc_spi
driver on top of the bitbanging spi_gpio driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:43:15 +09:00
Paul Mundt 10f0fc17f5 sh: mach-x3proto: needs linux/irq.h.
Since commit ba84be2338
("remove linux/hardirq.h from asm-generic/local.h"), the asm/irq.h
definitions that mach-x3proto/setup.c depends on are no longer available,
causing the build to die. So, include linux/irq.h explicitly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:42:58 +09:00
Paul Mundt 5e6136135d sh: Drop the BKL from sys_execve() on SH-5.
Brings it in line with the SH implementation, the BKL is not
necessary here.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:42:55 +09:00
Steve Glendinning 8ed3592e56 sh: convert rsk7203 to use smsc911x.
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:42:34 +09:00
Steve Glendinning 02da916ae6 sh: convert magicpanelr2 platform to use smsc911x.
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:42:25 +09:00
Steve Glendinning 90b764916a sh: convert ap325rxa platform to use smsc911x.
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:42:21 +09:00
Kuninori Morimoto deae7b860a sh: mach-migor: Add tw9910 support.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:41:55 +09:00
Kuninori Morimoto b9afb0bae5 sh: mach-migor: Delete soc_camera_platform setup.
Migo-R can use ov772x camera driver in Linux 2.6.29.
Therefore, soc_camera_platform setting is no longer needed.
This patch removes it.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:41:52 +09:00
Kuninori Morimoto ff04ea40ea sh: mach-migor: Add ov772x support.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:41:28 +09:00
Mike Frysinger c2bcc4a7ff asm-sh/posix_types_{32,64}.h: drop __GLIBC__/__USE_ALL usage
Bring sh in line with all the other ports.  Not sure how sh missed this
change as all the other arches were being updated ...

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:41:21 +09:00
Julia Lawall 7bfa122c19 arch/sh/mm: Move a dereference below a NULL test
If the NULL test is necessary, then the dereference should be moved below
the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/).

// <smpl>
@disable is_null@
identifier f;
expression E;
identifier fld;
statement S;
@@

+ if (E == NULL) S
  f(...,E->fld,...);
- if (E == NULL) S

@@
identifier f;
expression E;
identifier fld;
statement S;
@@

+ if (!E) S
  f(...,E->fld,...);
- if (!E) S
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-21 17:41:14 +09:00
Linus Torvalds bca268565f Merge branch 'syscalls' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'syscalls' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: (44 commits)
  [CVE-2009-0029] s390 specific system call wrappers
  [CVE-2009-0029] System call wrappers part 33
  [CVE-2009-0029] System call wrappers part 32
  [CVE-2009-0029] System call wrappers part 31
  [CVE-2009-0029] System call wrappers part 30
  [CVE-2009-0029] System call wrappers part 29
  [CVE-2009-0029] System call wrappers part 28
  [CVE-2009-0029] System call wrappers part 27
  [CVE-2009-0029] System call wrappers part 26
  [CVE-2009-0029] System call wrappers part 25
  [CVE-2009-0029] System call wrappers part 24
  [CVE-2009-0029] System call wrappers part 23
  [CVE-2009-0029] System call wrappers part 22
  [CVE-2009-0029] System call wrappers part 21
  [CVE-2009-0029] System call wrappers part 20
  [CVE-2009-0029] System call wrappers part 19
  [CVE-2009-0029] System call wrappers part 18
  [CVE-2009-0029] System call wrappers part 17
  [CVE-2009-0029] System call wrappers part 16
  [CVE-2009-0029] System call wrappers part 15
  ...
2009-01-14 19:58:40 -08:00
Harvey Harrison 74d96f0186 byteorder: make swab.h include asm/swab.h like a regular header
Add swab.h to kbuild.asm and remove the individual entries from
each arch, mark as unifdef as some arches have some kernel-only
bits inside.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-14 19:56:50 -08:00
Heiko Carstens 1134723e96 [CVE-2009-0029] Remove __attribute__((weak)) from sys_pipe/sys_pipe2
Remove __attribute__((weak)) from common code sys_pipe implemantation.
IA64, ALPHA, SUPERH (32bit) and SPARC (32bit) have own implemantations
with the same name. Just rename them.
For sys_pipe2 there is no architecture specific implementation.

Cc: Richard Henderson <rth@twiddle.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2009-01-14 14:15:15 +01:00
Heiko Carstens e55380edf6 [CVE-2009-0029] Rename old_readdir to sys_old_readdir
This way it matches the generic system call name convention.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2009-01-14 14:15:15 +01:00
Yinghai Lu dee4102a9a sparseirq: use kstat_irqs_cpu instead
Impact: build fix

Ingo Molnar wrote:

> tip/arch/blackfin/kernel/irqchip.c: In function 'show_interrupts':
> tip/arch/blackfin/kernel/irqchip.c:85: error: 'struct kernel_stat' has no member named 'irqs'
> make[2]: *** [arch/blackfin/kernel/irqchip.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
>

So could move kstat_irqs array to irq_desc struct.

(s390, m68k, sparc) are not touched yet, because they don't support genirq

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-01-11 15:53:13 +01:00
David Howells 8feae13110 NOMMU: Make VMAs per MM as for MMU-mode linux
Make VMAs per mm_struct as for MMU-mode linux.  This solves two problems:

 (1) In SYSV SHM where nattch for a segment does not reflect the number of
     shmat's (and forks) done.

 (2) In mmap() where the VMA's vm_mm is set to point to the parent mm by an
     exec'ing process when VM_EXECUTABLE is specified, regardless of the fact
     that a VMA might be shared and already have its vm_mm assigned to another
     process or a dead process.

A new struct (vm_region) is introduced to track a mapped region and to remember
the circumstances under which it may be shared and the vm_list_struct structure
is discarded as it's no longer required.

This patch makes the following additional changes:

 (1) Regions are now allocated with alloc_pages() rather than kmalloc() and
     with no recourse to __GFP_COMP, so the pages are not composite.  Instead,
     each page has a reference on it held by the region.  Anything else that is
     interested in such a page will have to get a reference on it to retain it.
     When the pages are released due to unmapping, each page is passed to
     put_page() and will be freed when the page usage count reaches zero.

 (2) Excess pages are trimmed after an allocation as the allocation must be
     made as a power-of-2 quantity of pages.

 (3) VMAs are added to the parent MM's R/B tree and mmap lists.  As an MM may
     end up with overlapping VMAs within the tree, the VMA struct address is
     appended to the sort key.

 (4) Non-anonymous VMAs are now added to the backing inode's prio list.

 (5) Holes may be punched in anonymous VMAs with munmap(), releasing parts of
     the backing region.  The VMA and region structs will be split if
     necessary.

 (6) sys_shmdt() only releases one attachment to a SYSV IPC shared memory
     segment instead of all the attachments at that addresss.  Multiple
     shmat()'s return the same address under NOMMU-mode instead of different
     virtual addresses as under MMU-mode.

 (7) Core dumping for ELF-FDPIC requires fewer exceptions for NOMMU-mode.

 (8) /proc/maps is now the global list of mapped regions, and may list bits
     that aren't actually mapped anywhere.

 (9) /proc/meminfo gains a line (tagged "MmapCopy") that indicates the amount
     of RAM currently allocated by mmap to hold mappable regions that can't be
     mapped directly.  These are copies of the backing device or file if not
     anonymous.

These changes make NOMMU mode more similar to MMU mode.  The downside is that
NOMMU mode requires some extra memory to track things over NOMMU without this
patch (VMAs are no longer shared, and there are now region structs).

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Mike Frysinger <vapier.adi@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
2009-01-08 12:04:47 +00:00
Bjorn Helgaas e55823492d PCI: sh: use generic INTx swizzle from PCI core
Use the generic pci_common_swizzle() instead of arch-specific code.

Note that pci_common_swizzle() loops based on dev->bus->self, not
dev->bus->parent as the sh simple_swizzle() did.  I think they
are equivalent for this purpose.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:13:15 -08:00
Bjorn Helgaas 6aa6e49817 PCI: sh: use generic pci_swizzle_interrupt_pin()
Use the generic pci_swizzle_interrupt_pin() instead of arch-specific code.

Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07 11:12:52 -08:00
Harvey Harrison 1af84a6253 sh: introduce asm/swab.h
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 18:10:27 -08:00
Russell King ba84be2338 remove linux/hardirq.h from asm-generic/local.h
While looking at reducing the amount of architecture namespace pollution
in the generic kernel, I found that asm/irq.h is included in the vast
majority of compilations on ARM (around 650 files.)

Since asm/irq.h includes a sub-architecture include file on ARM, this
causes a negative impact on the ccache's ability to re-use the build
results from other sub-architectures, so we have a desire to reduce the
dependencies on asm/irq.h.

It turns out that a major cause of this is the needless include of
linux/hardirq.h into asm-generic/local.h.  The patch below removes this
include, resulting in some 250 to 300 files (around half) of the kernel
then omitting asm/irq.h.

My test builds still succeed, provided two ARM files are fixed
(arch/arm/kernel/traps.c and arch/arm/mm/fault.c) - so there may be
negative impacts for this on other architectures.

Note that x86 does not include asm/irq.h nor linux/hardirq.h in its
asm/local.h, so this patch can be viewed as bringing the generic version
into line with the x86 version.

[kosaki.motohiro@jp.fujitsu.com: add #include <linux/irqflags.h> to acpi/processor_idle.c]
[adobriyan@gmail.com: fix sparc64]
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:13 -08:00
Matthew Wilcox ea43546750 atomic_t: unify all arch definitions
The atomic_t type cannot currently be used in some header files because it
would create an include loop with asm/atomic.h.  Move the type definition
to linux/types.h to break the loop.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:10 -08:00
Gary Hade c04fc586c1 mm: show node to memory section relationship with symlinks in sysfs
Show node to memory section relationship with symlinks in sysfs

Add /sys/devices/system/node/nodeX/memoryY symlinks for all
the memory sections located on nodeX.  For example:
/sys/devices/system/node/node1/memory135 -> ../../memory/memory135
indicates that memory section 135 resides on node1.

Also revises documentation to cover this change as well as updating
Documentation/ABI/testing/sysfs-devices-memory to include descriptions
of memory hotremove files 'phys_device', 'phys_index', and 'state'
that were previously not described there.

In addition to it always being a good policy to provide users with
the maximum possible amount of physical location information for
resources that can be hot-added and/or hot-removed, the following
are some (but likely not all) of the user benefits provided by
this change.
Immediate:
  - Provides information needed to determine the specific node
    on which a defective DIMM is located.  This will reduce system
    downtime when the node or defective DIMM is swapped out.
  - Prevents unintended onlining of a memory section that was
    previously offlined due to a defective DIMM.  This could happen
    during node hot-add when the user or node hot-add assist script
    onlines _all_ offlined sections due to user or script inability
    to identify the specific memory sections located on the hot-added
    node.  The consequences of reintroducing the defective memory
    could be ugly.
  - Provides information needed to vary the amount and distribution
    of memory on specific nodes for testing or debugging purposes.
Future:
  - Will provide information needed to identify the memory
    sections that need to be offlined prior to physical removal
    of a specific node.

Symlink creation during boot was tested on 2-node x86_64, 2-node
ppc64, and 2-node ia64 systems.  Symlink creation during physical
memory hot-add tested on a 2-node x86_64 system.

Signed-off-by: Gary Hade <garyhade@us.ibm.com>
Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:00 -08:00
Linus Torvalds 7d3b56ba37 Merge branch 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (77 commits)
  x86: setup_per_cpu_areas() cleanup
  cpumask: fix compile error when CONFIG_NR_CPUS is not defined
  cpumask: use alloc_cpumask_var_node where appropriate
  cpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_t
  x86: use cpumask_var_t in acpi/boot.c
  x86: cleanup some remaining usages of NR_CPUS where s/b nr_cpu_ids
  sched: put back some stack hog changes that were undone in kernel/sched.c
  x86: enable cpus display of kernel_max and offlined cpus
  ia64: cpumask fix for is_affinity_mask_valid()
  cpumask: convert RCU implementations, fix
  xtensa: define __fls
  mn10300: define __fls
  m32r: define __fls
  h8300: define __fls
  frv: define __fls
  cris: define __fls
  cpumask: CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
  cpumask: zero extra bits in alloc_cpumask_var_node
  cpumask: replace for_each_cpu_mask_nr with for_each_cpu in kernel/time/
  cpumask: convert mm/
  ...
2009-01-03 12:04:39 -08:00
Mike Travis 7eb1955336 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask into merge-rr-cpumask
Conflicts:
	arch/x86/kernel/io_apic.c
	kernel/rcuclassic.c
	kernel/sched.c
	kernel/time/tick-sched.c

Signed-off-by: Mike Travis <travis@sgi.com>
[ mingo@elte.hu: backmerged typo fix for io_apic.c ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-01-03 18:53:31 +01:00
Linus Torvalds b840d79631 Merge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (66 commits)
  x86: export vector_used_by_percpu_irq
  x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and()
  sched: nominate preferred wakeup cpu, fix
  x86: fix lguest used_vectors breakage, -v2
  x86: fix warning in arch/x86/kernel/io_apic.c
  sched: fix warning in kernel/sched.c
  sched: move test_sd_parent() to an SMP section of sched.h
  sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0
  sched: activate active load balancing in new idle cpus
  sched: bias task wakeups to preferred semi-idle packages
  sched: nominate preferred wakeup cpu
  sched: favour lower logical cpu number for sched_mc balance
  sched: framework for sched_mc/smt_power_savings=N
  sched: convert BALANCE_FOR_xx_POWER to inline functions
  x86: use possible_cpus=NUM to extend the possible cpus allowed
  x86: fix cpu_mask_to_apicid_and to include cpu_online_mask
  x86: update io_apic.c to the new cpumask code
  x86: Introduce topology_core_cpumask()/topology_thread_cpumask()
  x86: xen: use smp_call_function_many()
  x86: use work_on_cpu in x86/kernel/cpu/mcheck/mce_amd_64.c
  ...

Fixed up trivial conflict in kernel/time/tick-sched.c manually
2009-01-02 11:44:09 -08:00
Al Viro 18d8fda7c3 take init_fs to saner place
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-12-31 18:07:42 -05:00
Rusty Russell 33edcf133b Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-12-30 08:02:35 +10:30
Linus Torvalds 1db2a5c11e Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: (85 commits)
  [S390] provide documentation for hvc_iucv kernel parameter.
  [S390] convert ctcm printks to dev_xxx and pr_xxx macros.
  [S390] convert zfcp printks to pr_xxx macros.
  [S390] convert vmlogrdr printks to pr_xxx macros.
  [S390] convert zfcp dumper printks to pr_xxx macros.
  [S390] convert cpu related printks to pr_xxx macros.
  [S390] convert qeth printks to dev_xxx and pr_xxx macros.
  [S390] convert sclp printks to pr_xxx macros.
  [S390] convert iucv printks to dev_xxx and pr_xxx macros.
  [S390] convert ap_bus printks to pr_xxx macros.
  [S390] convert dcssblk and extmem printks messages to pr_xxx macros.
  [S390] convert monwriter printks to pr_xxx macros.
  [S390] convert s390 debug feature printks to pr_xxx macros.
  [S390] convert monreader printks to pr_xxx macros.
  [S390] convert appldata printks to pr_xxx macros.
  [S390] convert setup printks to pr_xxx macros.
  [S390] convert hypfs printks to pr_xxx macros.
  [S390] convert time printks to pr_xxx macros.
  [S390] convert cpacf printks to pr_xxx macros.
  [S390] convert cio printks to pr_xxx macros.
  ...
2008-12-28 12:33:21 -08:00
Rusty Russell 7479a2939d cpumask: sh: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask
Impact: New APIs

The old node_to_cpumask/node_to_pcibus returned a cpumask_t: these
return a pointer to a struct cpumask.  Part of removing cpumasks from
the stack.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul Mundt <lethal@linux-sh.org>
2008-12-26 22:23:39 +10:30
Martin Schwidefsky fc5243d98a [S390] arch_setup_additional_pages arguments
arch_setup_additional_pages currently gets two arguments, the binary
format descripton and an indication if the process uses an executable
stack or not. The second argument is not used by anybody, it could
be removed without replacement.

What actually does make sense is to pass an indication if the process
uses the elf interpreter or not. The glibc code will not use anything
from the vdso if the process does not use the dynamic linker, so for
statically linked binaries the architecture backend can choose not
to map the vdso.

Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:38:54 +01:00
Paul Mundt 59de580af1 sh: oprofile: Fix up the module build.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 19:32:27 +09:00
Takanari Hayama 7d91fcfcb9 sh: add UIO support for JPU on SH7722.
Add JPU support on Migo-R via UIO. This make use of Magnus's
generic UIO platform driver. Chunk of contiguous memory to hold
intermediate image and compressed data during encode and decode.

Signed-off-by: Takanari Hayama <taki@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:49 +09:00
Paul Mundt 6f5cd2bd59 sh: mach-rsk: Use uImage generation by default for rsk7201/7203.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:49 +09:00
Paul Mundt 2ea40dec26 sh: mach-sh03: Fix up pata_platform build breakage.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:49 +09:00
Magnus Damm b5868e8cde sh: enable deferred io LCDC on Migo-R
Enable LCDC deferred io on Migo-R using 1s delay.

As with other deferred io frame buffers user space code should
use fsync() on the frame buffer device to trigger an update.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:49 +09:00
Magnus Damm 0790555437 sh: add LCDC interrupt configuration to AP325 and Migo-R
Add LCDC interrupt resources for AP325 and Migo-R. The LCDC driver does
not require interrupts at this point, but changes such as one-shot SYS
mode using deferred io, and wait-for-vblank will both need this.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:48 +09:00
Magnus Damm da9fdc8b44 sh: split coherent pages
Split pages returned by dma_alloc_coherent() and make sure
we free them one by one.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:48 +09:00
Paul Mundt 78fb40263f sh: dma: Kill off ISA DMA wrapper.
There are no more users for this code, and it has been deprecated for
some time, so just kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:47 +09:00
Paul Mundt 5d2685d0b3 sh: Conditionalize the code dumper on CONFIG_DUMP_CODE.
We don't really want this enabled by default, but it is still quite
useful for debugging. So, make it conditional and leave it off by
default.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:47 +09:00
Paul Mundt fe58cac35f sh: Kill off the unused SH_ALPHANUMERIC debug option.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:47 +09:00
Paul Mundt 740a3e677b sh: Enable skipping of bss on debug platforms for sh32 also.
This enables the same functionality that sh64 has for sh32. When running
on simulated hardware or via remote memory via the debug interface,
memory is gauranteed to be zero on boot already, and skipping the zeroing
of BSS has measurable boot time benefits.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:47 +09:00
Paul Mundt 8a655053ca doc: Update sh cpufreq documentation.
The sh cpufreq driver is no longer limited to just the SH-3 and SH-4,
update the documentation to reflect this fact accordingly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:47 +09:00
Paul Mundt 0146d78759 sh: mrshpc_setup_windows() needs to be inline.
While no one should be including this file multiple times, flag it
inline anyways just in case.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:46 +09:00
Paul Mundt 073da9c0de sh: Kill off cf-enabler with extreme prejudice.
Now that the rest of the boards that were using cf-enabler "generically"
have switched to setting up their mappings on their own, only the mach-se
boards were left using it. All of the cf-enabler using mach-se boards
use a special initialization of the MRSHPC windows rather than going
through the special PTE as other SH-4 platforms do. This consolidates
the MRSHPC setup logic, hooks it up on the boards that care, and gets rid
of any and all remaining references to cf-enabler.

This has been long overdue, as cf-enabler has been the bane of
arch/sh/kernel for the last 7 years. Good riddance.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:46 +09:00
Paul Mundt 8c197c3afb sh: Add a simple edosk7705_defconfig for build testing.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:46 +09:00
Paul Mundt 866ef8f48f sh: mach-edosk7705: Fix up edosk7705 so it all builds again.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:45 +09:00
Paul Mundt 0ef0e6ca42 sh: mach-microdev: Split out the fdc37c93xapm initialization code.
This makes the microdev code a bit more readable, and moves the
setup for the SuperIO out on its own.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:45 +09:00
Paul Mundt 43eeb0fb9f sh: mach-sh03: Use __set_io_port_base(), kill off special ioport_map().
This also fixes up a long-standing bug for this platform where the PIO
base was set to a register offset, rather than the actual PIO offset
itself.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:45 +09:00
Paul Mundt 8db806ec80 sh: mach-sh03: Move off of cf_enabler to pata_platform, as per landisk.
This gets rid of the cf enabler use on mach-sh03 and switches to use
pata_platform with the proper address directly. cf_enabler is
subsequently disabled for mach-sh03.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:45 +09:00
Paul Mundt 98a955da85 sh: board-shmin: Convert shmin to use __set_io_port_base().
Drop the special mv_ioport_map() implementation, as this can simply use
__set_io_port_base() directly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:45 +09:00
Paul Mundt 2125a46083 sh: Kill off dead mv_init_pci() from machvec.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:45 +09:00
Paul Mundt 43f8f9b95b sh: Simplify kernel_thread_helper() for sh32.
This can use the same implementation as sh64, the generated assembly is
the same between the new and old version, so there is not much point in
leaving it open coded in inline assembly.

This is preparatory work for future consolidation of the _32/_64
variants.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:44 +09:00
Paul Mundt 7b80fb32b3 sh: Kill off mv_heartbeat() from the machvec.
Nothing is using this any more, so get rid of it before anyone gets the
bright idea to start using it again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:44 +09:00
Paul Mundt b94ea27570 sh: Kill off the cayman and microdev special heartbeat code.
These can use the generic code instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:44 +09:00
Paul Mundt ca0c14e447 sh: Kill off sh_bios_in_gdb_mode().
With the reworked kgdb support, we always detach and reinitialize the
stub. This was mostly a feature for handoffs between sh-ipl+g and the
kgdb stub, but virtually no sh-ipl+g versions ever had this working
right in the first place.

Given that the sh-ipl+g stubs in general use today don't even support
the GDB stub, and we have already killed off the special casing in the
sh-sci serial driver, kill off this now unused symbol too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:44 +09:00
Paul Mundt a9df1ed92f sh: export sh_bios_get_node_addr() symbol for stnic module.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:44 +09:00
Paul Mundt 8e32018b04 sh: Run sh_bios through a long overdue Lindent.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:44 +09:00
Paul Mundt d9341b51f2 sh: oprofile: Convert op_model_sh7750 to new common interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:43 +09:00
Dave Peverley 40a8b421b6 sh: oprofile: Backtrace support.
This patch improves the oprofile support on sh and adds backtrace
support.

Signed-off-by: Dave Peverley <dpeverley@mpc-data.co.uk>
Signed-off-by: Chris Smith <chris.smith@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:43 +09:00
Paul Mundt 60a51fbe5d sh: oprofile: Refactor common setup code for multiple driver support.
This re-implements the old op_model_null code in to something more
generic, where multiple drivers, backtrace, etc. can all be interfaced.
Based largely on arch/mips/oprofile/common.c.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:43 +09:00
Matt Fleming 70fe224743 sh: Enable GENERIC_HARDIRQS_NO__DO_IRQ for all SuperH machines
After the recent changes to switch SuperH board support over to irq_chip
it is now possible to set GENERIC_HARDIRQS_NO__DO_IRQ for all SuperH
boards.

Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:42 +09:00
Matt Fleming 1a94757fae sh: Convert Cayman boards from hw_interrupt_type to irq_chip
I've been unable to even compile-test this change because I don't have
an sh5 toolchain. All uses of hw_interrupt_type for SuperH boards have
now been converted to use irq_chip.

Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:06 +09:00
Matt Fleming e85a47744b sh: Convert Dreamcast support from hw_interrupt_type to irq_chip
Switch the dreamcast IRQ code over to the irq_chip way of doing things,
so that we can set GENERIC_HARDIRQS_NO__DO_IRQ for all SuperH boards.

Also, whilst I'm here change some things to make checkpatch.pl happy:
	- Indent with tabs, not with spaces
	- Include <linux/io.h>, not <asm/io.h>
	- Fix the multi-line comment style
	- Fix some typos in the comments

Tested-by: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:06 +09:00
Matt Fleming bd0a22d21f sh: Convert SystemH board support from hw_interrupt_type to irq_chip
... as part of the hw_interrupt_type to irq_chip crusade.

Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:05 +09:00
Matt Fleming be729fd890 sh: Convert Microdev boards from hw_interrupt_type to irq_chip
This is part of the SH move to irq_chip.

Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:05 +09:00
Paul Mundt 180ae2037f sh: Provide sdivsi3/udivsi3/udivdi3 for sh64, kill off libgcc linking.
This moves in the necessary libgcc bits and kills off the libgcc linking
for sh64 kernels as well.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:05 +09:00
Paul Mundt 4466b20cfc sh: Add SH-5 optimized memcpy()/memset()/strcpy()/strlen().
Adopted from the uClibc optimized string versions.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:05 +09:00
Paul Mundt 776d6c298a sh: Kill off remaining CONFIG_SH_KGDB bits.
Now that we use the generic stub, kill off all of the left over
references.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:05 +09:00
Paul Mundt ab6e570ba3 sh: Generic kgdb stub support.
This migrates from the old bitrotted kgdb stub implementation and moves
to the generic stub. In the process support for SH-2/SH-2A is also added,
which the old stub never provided.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:04 +09:00
Paul Mundt d7b01f78a3 sh: Enable HAVE_ARCH_TRACEHOOK for all SH, now that SH-5 supports it too.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:04 +09:00
Paul Mundt dd76279b47 sh: Provide linux/regset.h interface for SH-5.
Plugs in general and FPU regsets.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:04 +09:00
Paul Mundt 94e2fb3d3e sh: Provide asm/syscall.h for SH-5.
This provides the asm/syscall.h implementation for sh64 parts.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:04 +09:00
Paul Mundt 6ac034375f sh: Handle cases where setup{_rt,}_frame() fail on SH-5 signal delivery.
Presently these cases are not handled properly due to the return value
not being passed back. This needs to be correct to get proper behaviour
out of things like the tracehook signal notifier, amongst others.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:04 +09:00
Paul Mundt f15b2dc02f sh: Fix up syscall_get_nr() comment in syscall_32.h.
Residual copy-and-paste damage, fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:04 +09:00
Paul Mundt 35724a0aed sh: Fix up the cpu_asid() return value on nommu.
This ought to be unsigned long, rather than defaulting to int.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:03 +09:00
Paul Mundt a99d6fde69 sh: Convert sh64 /proc/asids to debugfs and generic sh.
This converts the sh64 /proc/asids entry to debugfs and enables it for
all SH parts that have debugfs enabled.

On MMU systems this can be used to determine which processes are using
which ASIDs which in turn can be used for finer grained cache tag
analysis.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:03 +09:00
Paul Mundt 4d1f3bbec4 sh: Kill off sh64's unused alloc/free_task_struct() definitions.
These were left over from some time ago, sh64 never got around to
defining __HAVE_ARCH_TASK_STRUCT_ALLOCATOR during the conversion, and it
has no need to. Kill these off and use the generic versions instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:03 +09:00
Paul Mundt 4eec8834f0 sh: mach-migor: Kill off unused Migo-R machvec.
This kills off the special Migo-R machvec, as nothing is using it. By
default this will switch to using the generic machvec, which provides the
same functionality. This saves us a bit of space in the machvec section.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:03 +09:00
Magnus Damm 4545bfa00a sh: add ov772x reset delay on Migo-R
Add reset delay for the ov772x device on Migo-R.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:03 +09:00
Paul Mundt a6bc25abc8 sh: Drop the special qemu defconfig.
QEMU can now use rts7751r2dplus_defconfig directly, there is no more need
for a neutered defconfig.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:03 +09:00
Aoi Shinkai bd40e81323 sh: Delete unnecessary mov in the interrupt exception entry point.
The INTEVT read at interrupt exception entry is uneccessary, as the read
is deferred until we are ready to enter do_IRQ(). The kgdb nmi path still
requires it, so move it there.

Signed-off-by: Aoi Shinkai <shinkoi2005@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:02 +09:00
Paul Mundt 06be372454 sh: Fix an off-by-1 check in __mutex_fastpath_unlock().
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:02 +09:00
Paul Mundt a47925ffd1 sh: Update rsk701_defconfig to reflect mach-rsk changes.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:02 +09:00
Paul Mundt ff15b90506 sh: Enable leds-gpio in rsk7203 defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:02 +09:00
Paul Mundt ea0aac1e13 sh: Consolidate rsk7203/7201 in to a new mach-rsk.
RSK+ platforms have quite a few characteristics in common, so roll them
together in to a shiny new RSK mach-type.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:02 +09:00
Paul Mundt b5cfeac990 sh: Provide ftrace_make_call()/ftrace_make_nop().
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:02 +09:00
Paul Mundt 4bc3e7192c sh: Disable -Werror for arch/sh/oprofile/.
drivers/oprofile/ objects have proven to be problematic in this regard,
so simply disable -Werror for now.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:44:02 +09:00
Takashi YOSHII 3b041227f7 sh: Add plain udivsi3 (not _i4*) for gcc-4.1 and lower.
We chan't share code for udivsi3 and udivsi3_i4, because they
have a different clobber list. Copy udivsi3 from gcc-4.1.2.

As shown in arch/sh/lib/udivsi3.S (and -Os.S),

  .global __udivsi3_i4i
  .global __udivsi3_i4
  .global __udivsi3
__udivsi3_i4i:
  ...

Three symbols are sharing one code, which is actually udivsi3_i4i.
But, this results unwanted code with gcc 4.1.

In gcc, these three are treated as pseudo instructions that have
their own clobber list apart from the usual calling convention.

According to sh's machine description. The clobber list is as
follows:

 - udivsi3_i4i : t,r1,pr,mach,macl
 - udivsi3_i4  : t,r0,r1,r4,r5,pr,dr0,dr2,dr4
 - udivsi3     : t,r4,pr

The caller of udivsi3 will be left with a broken r1 and mac*.

gcc-4.1.x and older(at least to 3.4) generate udivsi3.
ST's gcc-4.1.1 seems to be OK because it has _i4i.

Signed-off-by: Takashi YOSHII <yoshii.takashi@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:53 +09:00
Nick Andrew 1fdae0e59a Fix incorrect use of loose in c-checksum.c
Fix incorrect use of loose in c-checksum.c

It should be 'lose', not 'loose'.

Signed-off-by: Nick Andrew <nick@nick-andrew.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:52 +09:00
Paul Mundt 77ba93a7ac sh: Fix up the SH-4A mutex fastpath semantics.
This fixes up the __mutex_fastpath_xxx() routines to match the semantics
noted in the comment. Previously these were looping rather than doing a
single-pass, which is counter-intuitive, as the slow path takes care of
the looping for us in the event of contention.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:52 +09:00
Magnus Damm c6f17cb227 sh: allow CONFIG_CPU_IDLE
Allow users to select CONFIG_CPU_IDLE regardless of processor type or board.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:52 +09:00
Magnus Damm af998a9a0a sh: allow CONFIG_PM
Allow users to select CONFIG_PM regardless of processor type or board.
Suspend and hibernation are only allowed on supported platforms.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:52 +09:00
Magnus Damm 3e51762759 sh: move the hp6xx pm code
Move the not-so-generic pm code from arch/sh/kernel/pm.c to the
platform directory together with the rest of the hp6xx pm code.

This is done to let non-hp6xx platforms enable CONFIG_PM.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:52 +09:00
Magnus Damm 04645185d0 sh: update se7343 defconfig
Update the se7343 defconfig with:
 - use 33MHz PCLK
 - increase max number of SCIFs
 - add serial console configuration to compiled-in kernel command line
 - add 8250 serial port support
 - add sh-mobile-i2c driver
 - add uio driver to export VEU and VPU
 - add usb support and isp1161 host controller
 - add dm9601 ethernet-over-usb support
 - remove smc91x support

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:52 +09:00
Magnus Damm 21c601bb2e sh: remove ioport cruft and smc91x from se7343
Remove out-of-date se7343 ioport code including some old support
for unknown-ne2000-pcmcia-card, cf-over-pcmcia and a mysterical
smc91x that once must have been on a special daughterboard.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:51 +09:00
Magnus Damm 5e5aacb0de sh: add isp1161 usb host device to se7343
Add isp1161 platform data to get usb host working on se7343.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:51 +09:00
Magnus Damm 6aacba72db sh: add st16c2550 devices to se7343
Add 8250 platform data to setup the ST16C2550C chip on se7343.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:51 +09:00
Magnus Damm 5727003b5d sh: fix number of interrupts on se7343
Fix to make sure that the on-board interrupt sources are included
in the interrupt count on se7343.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:51 +09:00
Magnus Damm 551ea2b40e sh: sh7343 scif configuration update
Fix interrupt values for the first sh7343 SCIF port and
update the configuration to include the remaining 3 ones.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:51 +09:00
Magnus Damm 0c0daec7ca sh: propagate r_clk
Make sure the 32 KHz r_clk rate gets propagated correctly. Without
this fix the clocks for RTC, CMT, KEYSC and RWDT are stuck at 0 Hz.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:51 +09:00
Peter Griffin 6feb348783 sh: RSK+ 7201 board support.
This patch adds support for the RTE RSK+ 7201 board.

Signed-off-by: Peter Griffin <pgriffin@mpc-data.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:51 +09:00
Peter Griffin 2825999e8a sh: Add support for SH7201 CPU subtype.
This patch adds support for the SH-2A FPU based SH7201 processor subtype.

Signed-off-by: Peter Griffin <pgriffin@mpc-data.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:50 +09:00
Matt Fleming 135210b378 sh: Switch HD64461 from hw_interrupt_type to irq_chip
Use struct irq_chip for the interrupt handler for the HD64461. Also
convert some in{b,w} and out{b,w} calls to the equivalent __raw_* calls.
Include <linux/io.h> and not <asm/io.h> to stop checkpatch.pl
complaining.

This change should now allow machines with HD64461 to define
GENERIC_HARDIRQS_NO__DO_IRQ.

Acked-by: Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:50 +09:00
Yoshihiro Shimoda 331ff103c7 sh: pci-sh7780: fix pci memory address mask
Fix the problem that cannot work a PCI device when system memory size is
256Mbyte in 29bit address mode.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:50 +09:00
Paul Mundt 22f131aa8d sh: Provide a dyn_arch_ftrace struct definition.
Needed for dynamic ftrace API changes.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:50 +09:00
Paul Mundt 1da1180c6e sh: Split out the idle loop for reuse between _32/_64 variants.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:50 +09:00
Paul Mundt eb67cf14ae sh: Consolidate cpu_relax()/cpu_sleep() definitions across _32/_64.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:50 +09:00
Paul Mundt f74c034d52 sh: do not latency trace idle.
Description snipped from Steven Rostedt's PPC patch:

    When idle is called, interrupts are blocked, but the idle
    function will still wake up on an interrupt. The problem is
    that the interrupt disabled latency tracer will take this call
    to idle as a latency.

    This patch disables the latency tracing when going into idle.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:49 +09:00
Paul Mundt 75fd24c107 sh: Tidy up backtrace formatting with kallsyms disabled.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:49 +09:00
Paul Mundt 9cfc9a9b6f sh: Add a simple code dumper for SUPERH32 show_regs().
This implements a simple show_code() that is in turn plugged in to
show_regs() to provide minimal code dumping at the end of the trace.

Built on top of a simple instruction disassembler derived from the
binutils opcode table.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:49 +09:00
Paul Mundt edfd6da040 sh: Add a few more branch types to the branch emulator.
This plugs in some extra encodings for matching more bsr/bsrf/jsr
branches.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:49 +09:00
Paul Mundt 5dd614761f sh: Re-add support for best fit ISA tuning if none is available.
This was removed in the libgcc integration, but there are still some
compilers that need this. We also relax the rules on the ISA tuning in
the cases where there are no matches for the CPU tuning and adopt the
-any default, which matches the intent of the isa-y target list. This
compensates for mismatches where binutils supports a wide array of
targets whilst the compiler is much more restricted.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:49 +09:00
Paul Mundt 624c6a6750 sh: More movmem alias symbol exports for older compilers.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:49 +09:00
Paul Mundt 95b781c239 sh: Provide optimized unaligned loads on SH-4A.
This adds support for unaligned loads on SH-4A, using the SH-4A's
neutered movua.l instruction. As movua.l is r0-inspired, stores are
still handled through the packed struct.

Based on asm-generic/unaligned.h by Harvey Harrison.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:48 +09:00
Magnus Damm 716777db72 sh: P4 ioremap pass-through
This patch adds a pass-through case when ioremapping P4 addresses.

Addresses passed to ioremap() should be physical addresses, so the
best option is usually to convert the virtual address to a physical
address before calling ioremap. This will give you a virtual address
in P2 which matches the physical address and this works well for
most internal hardware blocks on the SuperH architecture.

However, some hardware blocks must be accessed through P4. Converting
the P4 address to a physical and then back to a P2 does not work. One
example of this is the sh7722 TMU block, it must be accessed through P4.

Without this patch P4 addresses will be mapped using PTEs which
requires the page allocator to be up and running.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:43:48 +09:00
Michael Trimarchi 0c9122323a sh: Add SH-4A optimized fastpath mutex implementation.
Add fast mutex path implementation for the SH4A architecture

Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:55 +09:00
Steve Glendinning f617682e9c sh: add SH DMAC burst mode constant
The SH7709 datasheet defines bit 5 as set for burst mode, clear for
cycle-steal mode.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:54 +09:00
Steve Glendinning c2c5883b3f sh: fix DMAOR register access on SH7709
sh7709 hardware manual says DMAOR is 16 bits long on this platform.

Tested and working with a modified smsc911x ethernet driver (sh-dma
support patch for this driver is coming soon).

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:54 +09:00
Steve Glendinning 8085ac7531 sh: Add platform-specific constants for SH7709
I'm using these constants in support of an in-house development board,
and thought they may be useful to other users of SH7709.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:54 +09:00
Paul Mundt 0d5bbe0bc2 sh: Provide optimized non-atomic bitops for SH-2A.
This ties in the new SH-2A 32-bit non-atomic bitops.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:54 +09:00
Paul Mundt 8bcc5c1c33 sh: Add -m4al tuning for SH4AL-DSP.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:54 +09:00
Paul Mundt 9ef100287a sh: Add exports for __udivsi3/__sdivsi3 and the _i4 versions.
Needed by older compilers.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:54 +09:00
Paul Mundt 16b529d1d7 sh: Convert to generic bitops for IRQ-toggling implementation.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:53 +09:00
Paul Mundt 709420dd4e sh: Specify sane default image targets for the SH-2 platforms.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:53 +09:00
Paul Mundt 1aad54a99b sh: Migrate necessary libgcc bits in to arch/sh/lib for SUPERH32.
This moves in the necessary libgcc bits for SUPERH32 and drops the
libgcc linking for the regular targets. This in turn allows us to rip
out quite a few hacks both in sh_ksyms_32 and arch/sh/Makefile.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:53 +09:00
Paul Mundt e9bf51e5cc sh: __udivdi3 -> do_div() in softfloat lib.
Inhibit the generation of __udivdi3 for the softfloat lib, use do_div()
outright.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:53 +09:00
Paul Mundt 00e825c6b9 sh: Fix clock framework compiler warnings.
CC      arch/sh/kernel/cpu/clock.o
  arch/sh/kernel/cpu/clock.c: In function 'clk_disable':
  arch/sh/kernel/cpu/clock.c:156: warning: 'return' with a value, in function returning void

Introduced by ("sh: enable and disable clocks recursively").

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:53 +09:00
Matt Fleming fad57feba7 sh: dynamic ftrace support.
First cut at dynamic ftrace support.

Signed-off-by: Matt Fleming <mjf@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:52 +09:00
Magnus Damm ef6aff6884 sh: remove old sh_mobile mstpc clocks
Remove the old sh_mobile mstpcr clocks.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:52 +09:00
Magnus Damm b51339fff2 sh: sh_mobile lcdc clock framework support
Add clock framework support to the lcdc driver and
adjust the board specific code accordingly.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:52 +09:00
Magnus Damm 765786e0ae sh: sh_mobile usb clock framework support
Add clock framework support to the usb/r8a66597 driver and
adjust the cpu specific code accordingly.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:51 +09:00
Magnus Damm af5be79a7f sh: sh_mobile usbf clock framework support
Add clock framework support to the usbf/m66592 driver and
adjust the cpu specific code accordingly.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:51 +09:00
Magnus Damm a42b6dd69c sh: sh_mobile ceu clock framework support
Add clock framework support to the sh_mobile ceu and
adjust the board specific code accordingly.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:51 +09:00
Magnus Damm 090d951b69 sh: sh_mobile keysc clock framework support
Add clock framework support to the sh_mobile keysc driver and
adjust the board specific code accordingly.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:51 +09:00
Magnus Damm a5616bd0f1 sh: sh_mobile i2c clock framework support
Add clock framework support to the sh_mobile i2c driver and
adjust the processor specific code accordingly.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22 18:42:51 +09:00