]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
15 years agosh: add pll_clk to sh7785
Magnus Damm [Mon, 25 May 2009 08:10:19 +0000 (08:10 +0000)]
sh: add pll_clk to sh7785

This patch converts the sh7785 pll implementation from the
all-in-one code in frqmr_recalc() and frqmr_build_rate_table()
to a separate struct clk. This allows us to remove the processor
specific multiplier and use generic rate table functions.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: clkfwk: Make clock-cpg usable for non-legacy platforms.
Paul Mundt [Fri, 22 May 2009 05:00:34 +0000 (14:00 +0900)]
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>
15 years agosh: clkfwk: beyond ARRAY_SIZE of onchip_ops for sh7722.
Roel Kluin [Thu, 21 May 2009 18:25:23 +0000 (18:25 +0000)]
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>
15 years agosh: clkfwk branch compile fix for clock-sh7722
Magnus Damm [Wed, 20 May 2009 13:44:40 +0000 (13:44 +0000)]
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>
15 years agosh: clkfwk: Add MSTP bits to SH7785 clock framework.
Paul Mundt [Thu, 14 May 2009 08:38:46 +0000 (17:38 +0900)]
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>
15 years agosh: clkfwk: Map tree hierarchy in debugfs.
Paul Mundt [Wed, 13 May 2009 12:51:28 +0000 (21:51 +0900)]
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>
15 years agosh: clkfwk: rate table construction and rounding for SH7785.
Paul Mundt [Wed, 13 May 2009 11:28:15 +0000 (20:28 +0900)]
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>
15 years agosh: clkfwk: Update SH7785 for refactored clock framework.
Paul Mundt [Wed, 13 May 2009 08:55:00 +0000 (17:55 +0900)]
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>
15 years agosh: clkfwk: Rework legacy CPG clock handling.
Paul Mundt [Wed, 13 May 2009 08:38:11 +0000 (17:38 +0900)]
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>
15 years agosh: clkfwk: Provide a generic clk_set_rate_ex() path for root clocks.
Paul Mundt [Wed, 13 May 2009 08:05:51 +0000 (17:05 +0900)]
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>
15 years agosh: clkfwk: Handle NULL clkops for root clocks.
Paul Mundt [Wed, 13 May 2009 08:03:09 +0000 (17:03 +0900)]
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>
15 years agosh: clkfwk: module_clk -> peripheral_clk rename.
Paul Mundt [Wed, 13 May 2009 07:59:40 +0000 (16:59 +0900)]
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>
15 years agoMerge branch 'master' into sh/clkfwk
Paul Mundt [Tue, 12 May 2009 10:54:36 +0000 (19:54 +0900)]
Merge branch 'master' into sh/clkfwk

15 years agosh: Kill off the remnants of the old timer code.
Paul Mundt [Tue, 12 May 2009 10:53:55 +0000 (19:53 +0900)]
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>
15 years agosh: remove old TMU driver
Magnus Damm [Tue, 12 May 2009 10:25:54 +0000 (10:25 +0000)]
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>
15 years agosh: CMT platform data for sh7720/sh7721
Magnus Damm [Tue, 12 May 2009 10:21:11 +0000 (10:21 +0000)]
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>
15 years agosh: TMU platform data for sh7720/sh7721
Magnus Damm [Tue, 12 May 2009 10:17:52 +0000 (10:17 +0000)]
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>
15 years agosh: TMU platform data for sh7710/sh7712
Magnus Damm [Tue, 12 May 2009 10:15:30 +0000 (10:15 +0000)]
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>
15 years agosh: TMU platform data for sh7706/sh7707/sh7708/sh7709
Magnus Damm [Tue, 12 May 2009 10:04:49 +0000 (10:04 +0000)]
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>
15 years agosh: TMU platform data for sh7705
Magnus Damm [Tue, 12 May 2009 10:01:01 +0000 (10:01 +0000)]
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>
15 years agosh: TMU platform data for sh7724
Magnus Damm [Tue, 12 May 2009 09:50:46 +0000 (09:50 +0000)]
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>
15 years agosh: TMU platform data for sh7366
Magnus Damm [Tue, 12 May 2009 09:48:21 +0000 (09:48 +0000)]
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>
15 years agosh: TMU platform data for sh7343
Magnus Damm [Tue, 12 May 2009 09:39:06 +0000 (09:39 +0000)]
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>
15 years agosh: add sh4-202 INTC tables
Magnus Damm [Tue, 12 May 2009 09:34:26 +0000 (09:34 +0000)]
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>
15 years agosh: TMU platform data for sh4-202
Magnus Damm [Tue, 12 May 2009 09:28:25 +0000 (09:28 +0000)]
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>
15 years agosh: TMU platform data for sh7770
Magnus Damm [Tue, 12 May 2009 09:20:08 +0000 (09:20 +0000)]
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>
15 years agosh: add sh7770_generic_defconfig
Magnus Damm [Tue, 12 May 2009 09:18:13 +0000 (09:18 +0000)]
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>
15 years agosh: TMU platform data for sh7763
Magnus Damm [Tue, 12 May 2009 09:13:59 +0000 (09:13 +0000)]
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>
15 years agosh: clkfwk: Use arch_clk_init() for on-chip clock registration.
Paul Mundt [Tue, 12 May 2009 10:29:04 +0000 (19:29 +0900)]
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>
15 years agosh: clkfwk: Handle clk_get_sys() returning an ERR_PTR.
Paul Mundt [Tue, 12 May 2009 07:07:40 +0000 (16:07 +0900)]
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>
15 years agosh: clkfwk: Wire up clk_get_sys() support.
Paul Mundt [Mon, 11 May 2009 21:18:09 +0000 (06:18 +0900)]
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>
15 years agosh: clkfwk: Kill off clk_recalc_rate().
Paul Mundt [Mon, 11 May 2009 21:05:32 +0000 (06:05 +0900)]
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>
15 years agosh: clkfwk: Tidy up on-chip clock registration and rate propagation.
Paul Mundt [Mon, 11 May 2009 20:59:27 +0000 (05:59 +0900)]
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>
15 years agosh: clkfwk: Improve the generic clk_set_parent() implementation.
Paul Mundt [Mon, 11 May 2009 20:51:05 +0000 (05:51 +0900)]
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>
15 years agosh: clkfwk: Fix up the clk_enable() error path.
Paul Mundt [Mon, 11 May 2009 20:30:10 +0000 (05:30 +0900)]
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>
15 years agosh: clkfwk: Convert SH-Mobile CPUs to use CLK_ENABLE_ON_INIT.
Paul Mundt [Mon, 11 May 2009 20:18:13 +0000 (05:18 +0900)]
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>
15 years agosh: clkfwk: Consolidate the ALWAYS_ENABLED / NEEDS_INIT mess.
Paul Mundt [Mon, 11 May 2009 20:14:53 +0000 (05:14 +0900)]
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>
15 years agosh: clkfwk: refactor rate propagation.
Paul Mundt [Mon, 11 May 2009 19:27:43 +0000 (04:27 +0900)]
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>
15 years agosh: clkfwk: Add a followparent_recalc() helper.
Paul Mundt [Mon, 11 May 2009 18:50:44 +0000 (03:50 +0900)]
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>
15 years agosh: clkfwk: Make recalc return an unsigned long.
Paul Mundt [Mon, 11 May 2009 18:45:08 +0000 (03:45 +0900)]
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>
15 years agosh: TMU platform data for sh7780
Magnus Damm [Mon, 11 May 2009 11:37:16 +0000 (11:37 +0000)]
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>
15 years agosh: r7780 highlander clock fixes
Magnus Damm [Mon, 11 May 2009 11:34:16 +0000 (11:34 +0000)]
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>
15 years agosh: multiple vectors per irq - sh7760
Magnus Damm [Mon, 11 May 2009 09:01:08 +0000 (09:01 +0000)]
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>
15 years agosh: TMU platform data for sh7760
Magnus Damm [Mon, 11 May 2009 09:06:24 +0000 (09:06 +0000)]
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>
15 years agosh: TMU platform data for sh775x
Magnus Damm [Mon, 11 May 2009 08:54:54 +0000 (08:54 +0000)]
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>
15 years agosh: include empty_zero_page in text
Magnus Damm [Mon, 11 May 2009 08:45:27 +0000 (08:45 +0000)]
sh: include empty_zero_page in text

Include empty_zero_page in _text. This fixes a problem
introduced by c3e2586b794b12ffcdf69b4e547030b51e18e6d9
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>
15 years agosh: sh7785lcr: fix I2C device address map for 32-bit mode
Yoshihiro Shimoda [Mon, 11 May 2009 06:51:28 +0000 (06:51 +0000)]
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>
15 years agosh: Account for INITIAL_JIFFIES when using jiffies clocksource.
Paul Mundt [Mon, 11 May 2009 03:15:14 +0000 (12:15 +0900)]
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>
15 years agosh: Fix up typo in arch/sh/kernel/vmlinux.lds.S
Paul Mundt [Mon, 11 May 2009 03:12:38 +0000 (12:12 +0900)]
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>
15 years agosh: Fix up R0 dependence in __arch_swab16/32.
Paul Mundt [Sun, 10 May 2009 05:25:39 +0000 (14:25 +0900)]
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>
15 years agosh: Hook up cc-cross-prefix support.
Paul Mundt [Sat, 9 May 2009 16:28:01 +0000 (01:28 +0900)]
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>
15 years agosh: Consolidate the boot link and entry offset definitions.
Paul Mundt [Sat, 9 May 2009 16:23:25 +0000 (01:23 +0900)]
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>
15 years agosh: Merge the split arch/sh/boot/compressed/ Makefiles.
Paul Mundt [Sat, 9 May 2009 15:58:21 +0000 (00:58 +0900)]
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>
15 years agosh: Provide a BITS definition, use it in the arch/sh/boot/ Makefiles.
Paul Mundt [Sat, 9 May 2009 15:55:45 +0000 (00:55 +0900)]
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>
15 years agosh: Provide a tighter BOOT_LINK_OFFSET definition for the Cayman board.
Paul Mundt [Sat, 9 May 2009 15:54:39 +0000 (00:54 +0900)]
sh: Provide a tighter BOOT_LINK_OFFSET definition for the Cayman board.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix up the sh64 zImage build.
Paul Mundt [Sat, 9 May 2009 15:36:22 +0000 (00:36 +0900)]
sh: Fix up the sh64 zImage build.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Tidy up the ldscript output format specifier.
Paul Mundt [Sat, 9 May 2009 15:25:08 +0000 (00:25 +0900)]
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>
15 years agosh: Move the unified linker script in place, kill off old _64 one.
Paul Mundt [Sat, 9 May 2009 14:36:10 +0000 (23:36 +0900)]
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>
15 years agosh: Integrate sh64 bits in vmlinux_32.lds.S.
Paul Mundt [Sat, 9 May 2009 14:33:02 +0000 (23:33 +0900)]
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>
15 years agosh: Fix up SHmedia module ELF relocations.
Paul Mundt [Sat, 9 May 2009 09:03:37 +0000 (18:03 +0900)]
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>
15 years agosh: Provide an __sdivsi3_2 export for sh64.
Paul Mundt [Sat, 9 May 2009 08:57:21 +0000 (17:57 +0900)]
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>
15 years agosh: Rename opcode_t to insn_size_t.
Paul Mundt [Sat, 9 May 2009 07:02:08 +0000 (16:02 +0900)]
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>
15 years agosh: Provide __read_{read,write}sl() definitions for sh64.
Paul Mundt [Sat, 9 May 2009 05:44:30 +0000 (14:44 +0900)]
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>
15 years agosh: Cleanup irqflags size mismatch on SH-5 build.
Paul Mundt [Sat, 9 May 2009 05:38:49 +0000 (14:38 +0900)]
sh: Cleanup irqflags size mismatch on SH-5 build.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Fix up the sh64 earlyprintk build.
Paul Mundt [Sat, 9 May 2009 05:31:37 +0000 (14:31 +0900)]
sh: Fix up the sh64 earlyprintk build.

sci_rxd_in() on SH-5 wants to be using SCSPTR, not SCSPTR2.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add UBC trap vector for SH2A
Peter Griffin [Fri, 8 May 2009 14:51:51 +0000 (15:51 +0100)]
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>
15 years agosh: Add ptrace support for NOMMU debugging
Peter Griffin [Fri, 8 May 2009 14:50:54 +0000 (15:50 +0100)]
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>
15 years agosh: Fix UBC setup and registers for SH2A
Kieran Bingham [Fri, 8 May 2009 14:49:50 +0000 (15:49 +0100)]
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>
15 years agosh: Add in some ptrace definitions from GDB.
Kieran Bingham [Fri, 8 May 2009 14:48:15 +0000 (15:48 +0100)]
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>
15 years agoserial: sh-sci: Fix up h8300 support.
Yoshinori Sato [Tue, 28 Apr 2009 04:40:15 +0000 (04:40 +0000)]
serial: sh-sci: Fix up h8300 support.

- Dummy SCIF functions define.
- h8300 specific header include.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agoserial: sh-sci: Fix up section mismatch in error path.
Paul Mundt [Fri, 8 May 2009 14:48:33 +0000 (23:48 +0900)]
serial: sh-sci: Fix up section mismatch in error path.

The sci_probe_single() path attempts to use sci_remove() for the error
path, while sci_remove() is still flagged as __devexit. So, we simply
discard the section annotation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Add clock id to sh-sci platform data on SH-Mobile CPUs.
Paul Mundt [Fri, 8 May 2009 14:28:54 +0000 (23:28 +0900)]
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>
15 years agosh-sci: improve clock framework support
Magnus Damm [Wed, 21 Jan 2009 15:14:30 +0000 (15:14 +0000)]
sh-sci: improve clock framework support

Use enable/disable hooks for clock framework integration.
Make sure we control the clock for the serial console as well.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh-sci: ioremap() in a single place
Magnus Damm [Wed, 21 Jan 2009 15:14:22 +0000 (15:14 +0000)]
sh-sci: ioremap() in a single place

Handle ioremap() in sci_config_port only.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh-sci: replace sci_init_ports()
Magnus Damm [Wed, 21 Jan 2009 15:14:14 +0000 (15:14 +0000)]
sh-sci: replace sci_init_ports()

Replace sci_init_ports() with sci_init_single().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh-sci: allow single port platform devices
Magnus Damm [Wed, 21 Jan 2009 15:13:50 +0000 (15:13 +0000)]
sh-sci: allow single port platform devices

Allow registration of single port sh-sci platform devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh-sci: use to_sci_port() if possible
Magnus Damm [Wed, 21 Jan 2009 15:14:38 +0000 (15:14 +0000)]
sh-sci: use to_sci_port() if possible

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh-sci: rework serial console support
Magnus Damm [Wed, 21 Jan 2009 15:14:06 +0000 (15:14 +0000)]
sh-sci: rework serial console support

Rework sh-sci serial console code.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh-sci: remove early_sci_setup()
Magnus Damm [Wed, 21 Jan 2009 15:13:58 +0000 (15:13 +0000)]
sh-sci: remove early_sci_setup()

Remove unused early_sci_setup() function from sh-sci.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh-sci: add platform device private data
Magnus Damm [Wed, 21 Jan 2009 15:13:42 +0000 (15:13 +0000)]
sh-sci: add platform device private data

This patch adds per-platform private data to the sh-sci driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: Kill off the GENERIC_CALIBRATE_DELAY ifndef.
Paul Mundt [Fri, 8 May 2009 13:14:01 +0000 (22:14 +0900)]
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>
15 years agosh: TMU platform data for SH-X3 proto CPU.
Paul Mundt [Fri, 8 May 2009 13:09:30 +0000 (22:09 +0900)]
sh: TMU platform data for SH-X3 proto CPU.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15 years agosh: TMU platform data for SH7786.
Paul Mundt [Fri, 8 May 2009 12:57:04 +0000 (21:57 +0900)]
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>
15 years agosh: Always fixup unaligned userspace accesses on sh64.
Paul Mundt [Fri, 8 May 2009 11:32:56 +0000 (20:32 +0900)]
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>
15 years agosh: Kill off extra cflags Kconfig entry.
Paul Mundt [Fri, 8 May 2009 11:20:56 +0000 (20:20 +0900)]
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>
15 years agosh: Always select RTC_LIB, not just for SUPERH32.
Paul Mundt [Fri, 8 May 2009 10:48:47 +0000 (19:48 +0900)]
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>
15 years agosh: Drop dead rules from arch/sh/kernel/Makefile_64.
Paul Mundt [Fri, 8 May 2009 09:01:03 +0000 (18:01 +0900)]
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>
15 years agosh: TMU platform data for sh7723
Magnus Damm [Fri, 8 May 2009 08:32:18 +0000 (08:32 +0000)]
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>
15 years agosh: enable TMU clocksource on sh7722
Magnus Damm [Fri, 8 May 2009 08:27:19 +0000 (08:27 +0000)]
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>
15 years agosh: clock framework update, fix count and kill off kref
Magnus Damm [Fri, 8 May 2009 08:23:29 +0000 (08:23 +0000)]
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>
15 years agosh: Move out cayman-specific panic handler code to its own file.
Paul Mundt [Fri, 8 May 2009 08:41:59 +0000 (17:41 +0900)]
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>
15 years agosh: Kill off unused sh64 debug code.
Paul Mundt [Fri, 8 May 2009 08:36:57 +0000 (17:36 +0900)]
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>
15 years agosh: Kill off sh64's hand-rolled syscall tracer.
Paul Mundt [Fri, 8 May 2009 08:25:35 +0000 (17:25 +0900)]
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>
15 years agosh: Kill off the global rtc_lock with extreme prejudice.
Paul Mundt [Fri, 8 May 2009 07:59:05 +0000 (16:59 +0900)]
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>
15 years agosh: mach-sh03: Give the sh03 rtc its own spinlock.
Paul Mundt [Fri, 8 May 2009 07:57:35 +0000 (16:57 +0900)]
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>
15 years agosh: Kill off dead timer sysclass pm hooks.
Paul Mundt [Fri, 8 May 2009 07:47:48 +0000 (16:47 +0900)]
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>
15 years agosh: Kill off dead handle_timer_tick() code.
Paul Mundt [Fri, 8 May 2009 07:44:00 +0000 (16:44 +0900)]
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>
15 years agosh: Wire up GENERIC_CMOS_UPDATE for the platforms that need it.
Paul Mundt [Fri, 8 May 2009 07:36:13 +0000 (16:36 +0900)]
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>
15 years agosh: Rename arch/sh/kernel/time_32.c to arch/sh/kernel/time.c.
Paul Mundt [Fri, 8 May 2009 07:17:36 +0000 (16:17 +0900)]
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>
15 years agosh: Finish the sh64 migration off of ARCH_USES_GETTIMEOFFSET.
Paul Mundt [Fri, 8 May 2009 07:12:17 +0000 (16:12 +0900)]
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>