Commit Graph

2362 Commits

Author SHA1 Message Date
Tejun Heo 384be2b18a Merge branch 'percpu-for-linus' into percpu-for-next
Conflicts:
	arch/sparc/kernel/smp_64.c
	arch/x86/kernel/cpu/perf_counter.c
	arch/x86/kernel/setup_percpu.c
	drivers/cpufreq/cpufreq_ondemand.c
	mm/percpu.c

Conflicts in core and arch percpu codes are mostly from commit
ed78e1e078dd44249f88b1dd8c76dafb39567161 which substituted many
num_possible_cpus() with nr_cpu_ids.  As for-next branch has moved all
the first chunk allocators into mm/percpu.c, the changes are moved
from arch code to mm/percpu.c.

Signed-off-by: Tejun Heo <tj@kernel.org>
2009-08-14 14:45:31 +09:00
Paul Mundt 718dbf376a Merge branch 'sh/dwarf-unwinder' 2009-08-14 05:10:57 +09:00
Matt Fleming f826466772 sh: Delete DWARF_ARCH_UNWIND_OFFSET
Trying to figure out the best value for DWARF_ARCH_UNWIND_OFFSET is
tricky at best. Various things can change the size (and offset from the
beginning of the function) of the prologue. Notably, turning on ftrace
adds calls to mcount at the beginning of functions, thereby pushing the
prologue further into the function.

So replace DWARF_ARCH_UNWIND_OFFSET with some code that continues to
execute CFA instructions until the value of return address register is
defined. This is safe to do because we know that the return address must
have been pushed onto the frame before our first function call; we just
can't figure out where at compile-time.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-14 05:00:21 +09:00
Paul Mundt f54aab4a74 sh: oprofile: Kill off dead valid_kernel_stack().
This is no longer used, kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-14 04:59:50 +09:00
Paul Mundt bf43a160ff sh: unwinder: Restore put_unaligned() for an unaligned destination.
The destination address might be unaligned, so set it with
put_unaligned() for safety. This restores the previous behaviour, albeit
through the proper API.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-14 03:06:13 +09:00
Paul Mundt 3497447f15 sh: unwinder: Fix up usage of unaligned accessors.
This was using internal symbols for unaligned accesses, bypassing the
exposed interface for variable sized safe accesses. This converts all of
the __get_unaligned_cpuXX() users over to get_unaligned() directly,
relying on the cast to select the proper internal routine.

Additionally, the __put_unaligned_cpuXX() case is superfluous given that
the destination address is aligned in all of the current cases, so just
drop that outright.

Furthermore, this switches to the asm/unaligned.h header instead of the
asm-generic version, which was silently bypassing the SH-4A optimized
unaligned ops.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-14 02:10:59 +09:00
Matt Fleming cafb0ddac6 sh: Add CFI annotations for exception return.
Annotate various assembly code paths with CFI assembler directives so
that DWARF unwind info is available for the unwinder.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-14 02:02:07 +09:00
Matt Fleming 0b930489b8 sh: Setup the frame register in asm code
In order to use DWARF unwinder info the frame register has to contain a
valid value. Whilst GCC takes care of this for C code, we have to do it
ourselves for assembly.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-14 01:59:55 +09:00
Matt Fleming bd353861c7 sh: dwarf unwinder support.
This is a first cut at a generic DWARF unwinder for the kernel. It's
still lacking DWARF64 support and the DWARF expression support hasn't
been tested very well but it is generating proper stacktraces on SH for
WARN_ON() and NULL dereferences.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-14 01:58:43 +09:00
Matt Fleming 0eff9f66de sh: Use the new stack unwinder API
Instead of implementing our own stack unwinder via dump_trace() we
should use the new stack unwinder API because it is more modular. This
change allows us to decouple the interface for generating stacktraces
from the implementation of a stack unwinder.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-13 19:52:53 +09:00
Matt Fleming bf61ad1f87 sh: Allow multiple stack unwinders to be setup
Provide an interface for registering stack unwinders, where each
unwinder is given a rating that describes its accuracy and
complexity. The more accurate an unwinder is, the more complex it is.

If a the current stack unwinder faults, then the stack unwinder with the
next highest accuracy will be used in its place (provided one is
available). For example, this allows unwinders, such as the DWARF
unwinder, to liberally sprinkle BUG()s to catch badly formed DWARF debug
info.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-13 19:49:03 +09:00
Matt Fleming 4e14dfc722 sh: Use the generalized stacktrace ops
Copy the stacktrace ops code from x86 and provide a central function for
use by functions that need to dump a callstack.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-13 11:50:08 +09:00
Marcin Slusarz 922b0dc59b sh: use printk_once
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-13 11:48:08 +09:00
Paul Mundt e290861f99 Merge branch 'sh/stable-updates' 2009-08-13 11:48:01 +09:00
Magnus Damm dbefd606a3 sh: fix i2c init order on ap325rxa V2
Convert the AP325RXA board code to register devices at
arch_initcall() time instead of device_initcall(). This
fix unbreaks pcf8563 RTC driver support.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-13 11:43:43 +09:00
Magnus Damm ba3a170191 sh: fix i2c init order on Migo-R V2
Convert the Migo-R board code to register devices at
arch_initcall() time instead of __initcall(). This fix
unbreaks migor_ts touch screen driver support.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-13 11:39:02 +09:00
Magnus Damm ba9a633787 sh: convert processor device setup functions to arch_initcall()
Convert the processor platform device setup
functions from __initcall() and sometimes
device_initcall() to arch_initcall().

This makes sure that the platform devices are
registered a bit earlier so the devices are
available when drivers register using initcall
levels earlier than device_initcall().

A good example is platform devices needed by
i2c-sh_mobile.c which registers a bit earlier
using subsys_initcall().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-13 11:36:33 +09:00
Magnus Damm b4a757367d sh: clean up Migo-R header file
This patch moves the Migo-R specific header file from
mach-common/ into mach-migor/ and removes unused cruft.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-07 03:59:24 +09:00
Magnus Damm 2d2bcd319a sh: fix romImage mach dir usage
This patch moves all the romImage related header files into
the mach/ directory.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-07 03:58:38 +09:00
Magnus Damm 7766e16bee sh: LED9, LED10 and LED11 support for Solution Engine 7724
This patch adds support for LED9, LED10 and LED11 on
the Solution Engine 7724 board. If CONFIG_PM is enabled
then these LEDs are used to show the hardware sleep
mode used by the processor. Useful to debug cpuidle.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-07 03:55:38 +09:00
Magnus Damm 33893d7aa0 sh: kfr2r09 board support - NAND flash
This patch adds support for the NAND flash chip
attached to CS4 on the KFR2R09 board. The device is
driven by the platform device driver "onenand-flash".

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-07 03:55:32 +09:00
Magnus Damm 9f26e659d8 sh: kfr2r09 board support - LCDC panel
This patch adds support for the WQVGA LCD display used by
the KFR2R09 board. The LCD module is a TX07D34VM0AAA made
by Hitachi, and this module is made up by a R61517 chip
together with a 240x400 pixel display. The screen is
attached to the SuperH Mobile LCDC using a 18-bit SYS bus.

The register settings used by the SYS panel setup code are
based on an out-of-tree driver which apart from duplicating
all LCDC driver code and writing to non-existing hardware
registers also never was posted for upstream merge.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-07 03:55:29 +09:00
Christoph Hellwig c1155e3499 sh: convert to asm-generic/hardirq.h
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-05 17:56:07 +09:00
Paul Mundt 0837f52463 sh: Partially unroll the SH-4 __flush_xxx_region() flushers.
This does a bit of unrolling for the SH-4 region flushers.

Based on an earlier patch by SUGIOKA Toshinobu.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 18:09:54 +09:00
Paul Mundt 8174252752 sh: Split out SH-4 __flush_xxx_region() ops.
This splits out the SH-4 __flush_xxx_region() functions and defines them
as weak symbols. This allows us to provide optimized versions without
having to ifdef cache-sh4.c to death.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 18:06:01 +09:00
Paul Mundt d14d751ff9 sh64: Kill off special clear_page() implementation.
This can use the now generic clear_page() implementation, which is backed
by the sh64 optimized memset routine. This also fixes up the case where
PAGE_SIZE != 4kB.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 17:17:00 +09:00
Paul Mundt c7914834ef sh: Tidy up NEFF-based sign extension for SH-5.
This consolidates all of the NEFF-based sign extension for SH-5.
In the future the other SH code will need to make use of this as well,
so make it generic in preparation for more 32/64 consolidation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 17:14:39 +09:00
Paul Mundt c0fe478dbb sh: Provide __flush_anon_page().
This provides a __flush_anon_page() that handles both the aliasing and
non-aliasing cases. This fixes up some crashes with heavy
get_user_pages() users.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 16:02:43 +09:00
Paul Mundt b5eb10ae90 sh: Drop unused arguments for kunmap_coherent().
kunmap_coherent() doesn't do anything with its arguments, so just kill
them off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 16:00:36 +09:00
Paul Mundt 222db3e5f2 sh: Bring kmap_coherent() out-of-line.
kmap_coherent() has gotten too big to leave as an inline, so we
bring it out-of-line.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:59:15 +09:00
Paul Mundt 700487c158 sh: Add a PG_dcache_dirty sanity check in kmap_coherent().
This plugs in a BUG_ON() in kmap_coherent() for PG_dcache_dirty pages
to catch when things go horribly wrong. Copied from the MIPS
implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:57:44 +09:00
Paul Mundt 11d82905e0 sh: Fix up early printk build error.
Missing endif in the early printk case, fix it up..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:54:33 +09:00
Magnus Damm df47cd096c sh: Runtime PM pdev hwblk - Solution Engine 7724
Add hwblk_id to Solution Engine 7724 board specific
on-chip sh7724 platform devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:06:13 +09:00
Magnus Damm 442c37534c sh: Runtime PM pdev hwblk - kfr2r09
Add hwblk_id to kfr2r09 board specific on-chip sh7724
platform devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:06:11 +09:00
Magnus Damm 593a0c898a sh: Runtime PM pdev hwblk - sh7724
Add hwblk_id to on-chip sh7724 platform devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:06:09 +09:00
Magnus Damm d3a6f6260a sh: Runtime PM pdev hwblk - AP325RXA
Add hwblk_id to AP325RXA board specific on-chip sh7723
platform devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:06:06 +09:00
Magnus Damm 09d21f9c83 sh: Runtime PM pdev hwblk - sh7723
Add hwblk_id to on-chip sh7723 platform devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:06:01 +09:00
Magnus Damm 66d9c51ac4 sh: Runtime PM pdev hwblk - Solution Engine 7722
Add hwblk_id to Solution Engine 7722 board specific
on-chip sh7722 platform devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:05:58 +09:00
Magnus Damm 2de63cf376 sh: Runtime PM pdev hwblk - Migo-R
Add hwblk_id to Migo-R board specific on-chip sh7722
platform devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:05:56 +09:00
Magnus Damm f69d578274 sh: Runtime PM pdev hwblk - sh7722
Add hwblk_id to on-chip sh7722 platform devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:05:53 +09:00
Magnus Damm 9aaa74908b sh: Runtime PM pdev hwblk
These patches extend struct platform device data for a bunch of
SuperH Mobile processors and embedded boards. The patches simply
add hardware block ids to on-chip platform devices. Platform
devices off chip (such as external ethernet controllers or flash
chips) are left out which gives them a special case hardware block
id of zero.

Upcoming Runtime PM code will make use of the hardware block id
to group devices together. The hardware block id can also be used
to extend the SuperH Mobile clock framework implementation.

This series of patches depend on the following:
"Driver Core: Add platform device arch data V3".

This patch adds a hwblk_id member to struct pdev_archdata. This member
should be used to point out on-chip hardware block id.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 15:05:50 +09:00
Paul Mundt 00111076f7 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6 into sh/hwblk 2009-08-04 15:05:39 +09:00
Kuninori Morimoto edc67b2942 sh: Add SH7724 DMAC support.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 14:41:49 +09:00
Kuninori Morimoto 4f3243117a sh: ms7724se: add 1280x720 lcdc output support
There was no big meaning in the support of SVGA,
but 720p support is necessary for ms7724se board.
So, this patch support 720p instead of SVGA.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 14:41:22 +09:00
Magnus Damm 133b170f08 sh: clean up MSTPCRn register definitions
This patch removes the unused MSTPCRn register definitions
from the SuperH Mobile code for sh7722, sh7723 and sh7724.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 14:40:58 +09:00
Magnus Damm 6ba4a8f0f5 sh: hwblk support for sh7724
This patch adds hwblk support for the sh7724 processor.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 14:40:55 +09:00
Rafael Ignacio Zurita 05aa788275 sh: Add early printk support for SH770x CPUs.
This adds early printk support for SH770x (tested on SH7709 based hp6xx).

Signed-off-by: Rafael Ignacio Zurita <rizurita@yahoo.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-04 14:38:08 +09:00
Paul Mundt fdeb076f20 sh: Add romImage target to archhelp.
Adds an archhelp blurb for the romImage target so it is reflected in
'make help'.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-30 00:27:35 +09:00
Magnus Damm d162300e6c sh: kfr2r09 romImage support V2
This patch is romImage support for the kfr2r09 board V2.

The partner-jet-setup.txt file is converted into assembly code
which becomes the first code to execute from the reset vector.

The file partner-jet-setup.txt can also be used to setup
the hardware using a JTAG debugger so booting from RAM can
be done without burning the code to flash.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-30 00:24:07 +09:00
Magnus Damm 3c928320b2 sh: romImage support V2
This patch contains support for the romImage build target V2.

The resulting romImage file should be burned to rom
or flash and could be used as small boot loader.

Board code should keep their setup code in the file
romimage.h located in their mach include directory.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-30 00:24:03 +09:00
Stuart Menefy fd78a76aef sh: Rework irqflags tracing to fix up CONFIG_PROVE_LOCKING.
This cleans up the irqflags tracing code quite a bit and ties it
in to various missing callsites that caused an imbalance when
CONFIG_PROVE_LOCKING was enabled.

Previously this was catching on:

 987 #ifdef CONFIG_PROVE_LOCKING
 988     DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled);
 989     DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
 990 #endif
 991     retval = -EAGAIN;

with hardirqs being doubly enabled, and subsequently bailing out
with the following call trace:

	Call trace:
	[<88035224>] __lock_acquire+0x616/0x6a6
	[<88015a8c>] do_fork+0xf8/0x2b0
	[<880331ec>] trace_hardirqs_on_caller+0xd4/0x114
	[<88241074>] _spin_unlock_irq+0x20/0x64
	[<88035224>] __lock_acquire+0x616/0x6a6
	[<8800386c>] kernel_thread+0x48/0x70
	[<88024ecc>] ____call_usermodehelper+0x0/0x110
	[<88024ecc>] ____call_usermodehelper+0x0/0x110
	[<88003894>] kernel_thread_helper+0x0/0x14
	[<88024bac>] __call_usermodehelper+0x38/0x70
	[<88025dc0>] worker_thread+0x150/0x274
	[<88035b9c>] lock_release+0x0/0x198
	[<88024b74>] __call_usermodehelper+0x0/0x70
	[<88028cf0>] autoremove_wake_function+0x0/0x30
	[<88028bf2>] kthread+0x3e/0x70
	[<88025c70>] worker_thread+0x0/0x274
	[<8800389c>] kernel_thread_helper+0x8/0x14
	[<88028bb4>] kthread+0x0/0x70
	[<88003894>] kernel_thread_helper+0x0/0x14

Reported-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-29 23:01:24 +09:00
Paul Mundt 82b242214b Revert "sh: Bump the earlytimer bits back to time_init()."
This reverts commit 1d29ebebcb.

Bumping up the earlytimer initialization causes IRQs to be enabled too
early, which blows up lockdep:

...
NR_IRQS:256 nr_irqs:256
------------[ cut here ]------------
Badness at kernel/lockdep.c:2128

Pid : 0, Comm:          swapper
CPU : 0                 Not tainted  (2.6.31-rc3-00205-g3ed6e12-dirty #2443)

PC is at trace_hardirqs_on_caller+0x48/0x10c
PR is at trace_hardirqs_on_caller+0x3c/0x10c
...

Revert it back to late_time_init time, which fixes up lockdep.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-29 22:43:58 +09:00
Paul Mundt 3ed6e12939 sh: Handle a NULL vma in __update_tlb() for the fast-path.
The TLB miss fast-path presently calls in to update_mmu_cache() to
set up the entry, and does so with a NULL vma. Check for vma validity
in the __update_tlb() ptrace checks.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-29 22:06:58 +09:00
Paul Mundt 9cef749269 sh: update_mmu_cache() consolidation.
This splits out a separate __update_cache()/__update_tlb() for
update_mmu_cache() to wrap in to. This lets us share the common
__update_cache() bits while keeping special __update_tlb() handling
broken out.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-29 00:12:17 +09:00
Benjamin Herrenschmidt 4733fd328f mm: Remove duplicate definitions in MIPS and SH
Those definitions are already provided by asm-generic

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-27 17:26:44 -07:00
Benjamin Herrenschmidt 9e1b32caa5 mm: Pass virtual address to [__]p{te,ud,md}_free_tlb()
mm: Pass virtual address to [__]p{te,ud,md}_free_tlb()

Upcoming paches to support the new 64-bit "BookE" powerpc architecture
will need to have the virtual address corresponding to PTE page when
freeing it, due to the way the HW table walker works.

Basically, the TLB can be loaded with "large" pages that cover the whole
virtual space (well, sort-of, half of it actually) represented by a PTE
page, and which contain an "indirect" bit indicating that this TLB entry
RPN points to an array of PTEs from which the TLB can then create direct
entries. Thus, in order to invalidate those when PTE pages are deleted,
we need the virtual address to pass to tlbilx or tlbivax instructions.

The old trick of sticking it somewhere in the PTE page struct page sucks
too much, the address is almost readily available in all call sites and
almost everybody implemets these as macros, so we may as well add the
argument everywhere. I added it to the pmd and pud variants for consistency.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: David Howells <dhowells@redhat.com> [MN10300 & FRV]
Acked-by: Nick Piggin <npiggin@suse.de>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> [s390]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-27 12:10:38 -07:00
Paul Mundt 0dfae7d5a2 sh: Use the now generic SH-4 clear/copy page ops for all MMU platforms.
Now that the SH-4 page clear/copy ops are generic, they can be used for
all platforms with CONFIG_MMU=y. SH-5 remains the odd one out, but it too
will gradually be converted over to using this interface.

SH-3 platforms which do not contain aliases will see no impact from this
change, while aliasing SH-3 platforms will get the same interface as
SH-4.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-27 21:30:17 +09:00
Paul Mundt 221c007b02 sh: Rename arch/sh/lib/clear_page.S -> __clear_user.S.
Now that this only contains the __clear_user() function, rename it
accordingly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-27 20:55:46 +09:00
Paul Mundt dfff0fa65a sh: wire up clear_user_highpage() for sh4, convert sh7705.
This wires up clear_user_highpage() on SH-4 and subsequently converts the
SH7705 32kB cache mode over to using it. Now that the SH-4 implementation
handles all of the dcache purging directly in the aliasing case, there is
no need to do this in the default clear_page() implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-27 20:53:22 +09:00
Paul Mundt a3beddd0aa Merge branch 'sh/kfr2r09' 2009-07-23 18:43:48 +09:00
Magnus Damm 5bdef865eb sh: kfr2r09 board support - mach-type and defconfig
This patch adds a defconfig and a mach-types entry for
the kfr2r09 board.

At this point only a few devices like SCIF, KEYSC and
NOR Flash are supported together with sh7724 devices
such as IIC0, IIC1 and the multimedia blocks exported
via UIO.

Kexec is supported, but booting from flash is not (yet).

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-23 18:43:16 +09:00
Magnus Damm 39a6bf1426 sh: kfr2r09 board support - KEYSC keypad
This patch adds KEYSC keypad support to the kfr2r09 board.

The keys driven by the sh7724 on-chip KEYSC block are
described as a platform device and platform data for
the sh_keysc driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-23 13:15:22 +09:00
Magnus Damm a366aa64f3 sh: kfr2r09 board support - NOR flash
This patch adds NOR flash support to the kfr2r09 board.

NOR flash support is added by describing the NOR flash
chip hooked up to CS0 as platform device data for the
physmap-flash MTD driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-23 13:15:20 +09:00
Magnus Damm e7d165146a sh: kfr2r09 board support - SCIF console
This patch adds basic kfr2r09 board support. Only
the SCIF1 console is supported with this patch, but
this patch and a proper sh7724 configuration is all
that is needed. Combine with an initramfs to have a
small RAM based kernel and distribution booted as
zImage from RAM via JTAG.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-23 13:15:18 +09:00
Magnus Damm 955c9863bb sh: convert processor device setup functions to arch_initcall()
Convert the processor platform device setup
functions from __initcall() and sometimes
device_initcall() to arch_initcall().

This makes sure that the platform devices are
registered a bit earlier so the devices are
available when drivers register using initcall
levels earlier than device_initcall().

A good example is platform devices needed by
i2c-sh_mobile.c which registers a bit earlier
using subsys_initcall().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-23 13:06:07 +09:00
Magnus Damm 2c59b0b70b usb: m66592-udc platform data on_chip support
Convert the m66592-udc driver to use the on_chip flag
from platform data to enable on chip behaviour instead
of relying on CONFIG_SUPERH_BUILT_IN_M66592 ugliness.

This makes the code cleaner and also allows us to support
both external and internal m66592 with the same kernel.

It also makes the Kconfig part more future proof since
we with this patch can add support for new processors
with on-chip m66592 without modifying the Kconfig.

The patch adds a m66592 header file for platform data
and ties in platform data to the existing m66592 devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-23 13:04:15 +09:00
Paul Mundt 2277ab4a1d sh: Migrate from PG_mapped to PG_dcache_dirty.
This inverts the delayed dcache flush a bit to be more in line with other
platforms. At the same time this also gives us the ability to do some
more optimizations and cleanup. Now that the update_mmu_cache() callsite
only tests for the bit, the implementation can gradually be split out and
made generic, rather than relying on special implementations for each of
the peculiar CPU types.

SH7705 in 32kB mode and SH-4 still need slightly different handling, but
this is something that can remain isolated in the varying page copy/clear
routines. On top of that, SH-X3 is dcache coherent, so there is no need
to bother with any of these tests in the PTEAEX version of
update_mmu_cache(), so we kill that off too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-22 19:20:49 +09:00
Paul Mundt c0b96cf639 sh: Provide _PAGE_SPECIAL for 32-bit.
Allocate one of the unused PTE bits for _PAGE_SPECIAL directly. This is
prep work for fast gup and the zero page revival.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-22 16:50:57 +09:00
Paul Mundt fc6cca3917 Merge branches 'sh/compressors' and 'sh/stable-updates' 2009-07-21 17:37:18 +09:00
Paul Mundt ef9b542fce sh: bzip2/lzma uImage support.
This builds on the bzip2/lzma zImage support change and wires it up for
uImages. Based on the blackfin implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-21 17:24:36 +09:00
Tim Abbott 6bde607e69 sh: Clean up linker script using new BSS_SECTION macro.
Updated to use the fixed BSS linker script macros from this
thread:

	http://www.spinics.net/lists/kernel/msg913238.html

Signed-off-by: Tim Abbott <tabbott@ksplice.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-20 23:30:24 +09:00
Paul Mundt c358fc46ef Merge branches 'sh/hwblk' and 'sh/platform-updates' 2009-07-20 04:28:11 +09:00
Magnus Damm 719a72b7c7 usb: r8a66597-hcd platform data on_chip support
Convert the r8a66597-hcd driver to use the on_chip flag
from platform data to enable on chip behaviour instead
of relying on CONFIG_SUPERH_ON_CHIP_R8A66597 ugliness.

This makes the code cleaner and also allows us to support
both external and internal r8a66597 with the same kernel.

It also makes the Kconfig part more future proof since
we with this patch can add support for new processors
with on-chip r8a66597 without modifying the Kconfig.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-20 04:27:10 +09:00
Magnus Damm 2094e504a7 sh: hwblk support for sh7723
This patch adds hwblk support for the sh7723 processor.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-20 04:23:44 +09:00
Magnus Damm 0f8ee1874f sh: Add support for multiple hwblk counters
Extend the SuperH hwblk code to support more than one counter.
Contains ground work for the future Runtime PM implementation.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-20 04:23:39 +09:00
Paul Mundt 72849873cd sh: Kill off zero-sized vmlinux_64.lds.S
This seems to be some merge damage, kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-14 06:51:54 -04:00
Matt Fleming 05dd2cd3bb sh: Restore previous behaviour on kernel fault
The last commit changed the behaviour on kernel faults when we were
doing something other than syncing the page tables. vmalloc_sync_one()
needs to return NULL if the page tables are up to date, because the
reason for the fault was not a missing/inconsitent page table entry. By
returning NULL if the page tables are sync'd we signal to the calling
function that further work must be done to resolve this fault.

Also, remove the superfluous __va() around the first argument to
vmalloc_sync_one(). The value of pgd_k is already a virtual address and
using it wth __va() causes a NULL dereference.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-13 17:43:22 -04:00
Alexey Dobriyan 405f55712d headers: smp_lock.h redux
* Remove smp_lock.h from files which don't need it (including some headers!)
* Add smp_lock.h to files which do need it
* Make smp_lock.h include conditional in hardirq.h
  It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

  This will make hardirq.h inclusion cheaper for every PREEMPT=n config
  (which includes allmodconfig/allyesconfig, BTW)

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-12 12:22:34 -07:00
Paul Mundt 3e28ad7b24 Merge branches 'sh/compressors' and 'sh/ftrace' 2009-07-12 11:45:25 -04:00
Paul Mundt 040f43e0bf sh64: Don't use PHYSADDR() for output_addr calculation.
Opencode the MEMORY_START offset directly, sh64 uses a slightly different
calculation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 13:36:25 -04:00
Paul Mundt 59f002964f sh: rename arch/sh/boot/compressed/misc_32.c -> misc.c
This is now used by both sh64 and regular sh, kill off the old sh64
version now too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 13:32:24 -04:00
Paul Mundt b14c6d428a sh: Consolidate the sh64 changes in arch/sh/boot/compressed/misc_32.c
This makes some minor changes to misc_32.c so that it can be used by
sh64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 13:30:38 -04:00
Paul Mundt 07e88e1bfc sh: bzip2/lzma zImage support.
This plugs in bzip2 and lzma support for zImages.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 13:21:19 -04:00
Paul Mundt df8ce2595f sh: Tidy up gzip-based zImage decompression.
This brings the zImage handling in to the current century, in preparation
for handling the other compression types.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-12 01:37:30 +09:00
Paul Mundt e460ab27b6 sh: Fix up stack overflow check with ftrace disabled.
Presently the STACK_CHECK() code is called in to multiple times, although
it's only necessary from the mcount entry. The code still attempts to
treat the nop case as an ftrace path resulting in superfluous code flow
for the case where ftrace is disabled. And finally, this also fixes up
references to a few undefined symbols when FUNCTION_TRACER=n.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 21:06:53 +09:00
Paul Mundt a470b95e99 sh: Fix up ftrace build error when STACK_DEBUG=n.
Presently the closest reference to function_trace_stop is within a
CONFIG_STACK_DEBUG block. When this is turned off, the build bails out
with a pcrel too far error. Reorder things a bit to handle the various
combinations.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 20:33:34 +09:00
Paul Mundt fe27932052 sh: Use DECLARE_EXPORT() for mcount symbol export.
The function prototype for mcount is not defined if we are not building
with ftrace support enabled, so use DECLARE_EXPORT() to stub one in.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 20:32:14 +09:00
Paul Mundt 9f14b84afd sh: Replace DEBUG_STACKOVERFLOW with STACK_DEBUG.
STACK_DEBUG ties in to mcount in order to do function-granular stack
overflow checks as opposed to lazily checking from IRQ context. As the
default is nohz, the frequency of overflow checking is too irregular to
catch much useful information, and so the mcount approach employed by
sparc64 is adopted instead.

This kills off the old check entirely from the do_IRQ() path and now
adopts CONFIG_MCOUNT instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 20:05:34 +09:00
Paul Mundt 473d1cf4ee sh: Decouple mcount from ftrace.
This adds a general CONFIG_MCOUNT in order to permit mcount generation
without ftrace support. This is primarily for allowing platforms to
enable aggressive stack overflow checking without having to enable ftrace
support. Based on the sparc64 implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 19:56:58 +09:00
Paul Mundt f686d8c11c Merge branches 'sh/ftrace' and 'sh/stable-updates' 2009-07-11 10:08:33 +09:00
Matt Fleming 7816fecd03 sh: Mark __switch_to() as __notrace_funcgraph
Annotate __switch_to() so that the function graph tracer does not try to
trace it. Use __notrace_funcgraph, as opposed to notrace, so that other
tracers can continue to trace __switch_to().

The reason that we don't want to trace __switch_to() with the function
graph tracer is because of how the return address stack in task_struct
is implemented. When we enter __switch_to we store the real return
address on prev's ret_stack. When we return from __switch_to() we've
patched the return address on the kernel stack to be
return_to_handler. Calling return_to_handler we do,

       -> ftrace_return_to_handler()
       	  -> ftrace_pop_return_ftrace()

Which tries to pop the real return address from current->ret_stack. The
problem being that we stored the return address on prev->ret_stack, but
current now points to next, and next->ret_stack doesn't contain the
correct return address (and is possibly even empty).

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 10:08:06 +09:00
Matt Fleming 327933f5d6 sh: Function graph tracer support
Add both dynamic and static function graph tracer support for sh.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 10:08:01 +09:00
Matt Fleming b99610fb9c sh: Provide diagnostic kernel stack checks
Enable kernel stack checking code in both the dynamic ftrace and mcount
code paths. Check the stack to see if it's overflowing and make sure
that the stack pointer contains an address that's either in init_stack
or after the bss.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11 10:07:58 +09:00
Peter Zijlstra c99e6efe1b sched: INIT_PREEMPT_COUNT
Pull the initial preempt_count value into a single
definition site.

Maintainers for: alpha, ia64 and m68k, please have a look,
your arch code is funny.

The header magic is a bit odd, but similar to the KERNEL_DS
one, CPP waits with expanding these macros until the
INIT_THREAD_INFO macro itself is expanded, which is in
arch/*/kernel/init_task.c where we've already included
sched.h so we're good.

Cc: tony.luck@intel.com
Cc: rth@twiddle.net
Cc: geert@linux-m68k.org
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-10 14:24:05 -07:00
Tim Abbott 2802e34590 sh: Clean up linker script using new linker script macros.
This patch converts the sh architecture to use the new linker script
macros in include/asm-generic/vmlinux.lds.h.

Signed-off-by: Tim Abbott <tabbott@ksplice.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-10 15:58:16 +09:00
Tejun Heo 023bf6f1b8 linker script: unify usage of discard definition
Discarded sections in different archs share some commonality but have
considerable differences.  This led to linker script for each arch
implementing its own /DISCARD/ definition, which makes maintaining
tedious and adding new entries error-prone.

This patch makes all linker scripts to move discard definitions to the
end of the linker script and use the common DISCARDS macro.  As ld
uses the first matching section definition, archs can include default
discarded sections by including them earlier in the linker script.

ia64 is notable because it first throws away some ia64 specific
subsections and then include the rest of the sections into the final
image, so those sections must be discarded before the inclusion.

defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
alpha, sparc, sparc64 and s390.  Michal Simek tested microblaze.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Tony Luck <tony.luck@intel.com>
2009-07-09 11:27:40 +09:00
Paul Mundt 7119888df1 Merge branches 'sh/ftrace' and 'sh/cachetlb' 2009-07-06 20:19:28 +09:00
Matt Fleming c652d780c9 sh: Add ftrace syscall tracing support
Now that I've added TIF_SYSCALL_FTRACE the thread flags do not fit into
a single byte any more. Code testing them now needs to be aware of the
upper and lower bytes.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-06 20:16:33 +09:00
Matt Fleming c1340c053b sh: Define HAVE_FUNCTION_TRACE_MCOUNT_TEST
Enable HAVE_FUNCTION_TRACE_MCOUNT_TEST and test the value of
function_trace_stop from our assembly code as opposed to using the
generic C function. This should optimise our mcount/ftrace code path.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-06 19:53:53 +09:00
Matt Fleming ca0d17277f sh: Fix the value of MCOUNT_INSN_OFFSET
It seems that MCOUNT_INSN_OFFSET was calculating the distance between
the wrong functions. The value that should have actually been computed
is the distance between ftrace_call and ftrace_stub. I discovered this
when I added some code to ftrace_caller.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-06 19:52:08 +09:00
Paul Mundt 0f60bb25b4 sh: Tidy up vmalloc fault handling.
This rewrites the vmalloc fault handling as per x86, which subsequently
allows for easy future tie-in for vmalloc_sync_all().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-05 03:18:47 +09:00
Paul Mundt c63c3105e4 sh: use kprobes_built_in() for notify_page_fault().
Kill off the KPROBES ifdef, as per x86.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-05 02:50:10 +09:00
Paul Mundt 1ecc6ab669 Merge branches 'sh/hwblk', 'sh/cpuidle' and 'sh/stable-updates' 2009-07-05 00:33:40 +09:00
Matt Fleming 5084f61a4d sh: Use bootmem ontop of lmb for NUMA
Like the UP case, use lmb as the foundation of memory resource
management on NUMA.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-05 00:32:11 +09:00
Magnus Damm 7426394f20 sh: cpuidle for SuperH Mobile using hwblk
This patch adds cpuidle support for SuperH Mobile.

The sleep mode selected by cpuidle is compared with
the mode selected by the hwblk sleep code and the
best allowed mode is entered.

At this point "Sleep mode" and "Sleep mode + SF" are
supported. This code can easily be extended to support
"Software suspend mode", but the assembly code must
first be updated to avoid loosing interrupts.

Also, update the code to only copy the assembly snippet
into internal memory once at bootup.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-05 00:29:54 +09:00
Magnus Damm a61c1a6366 sh: hwblk for sh7722
This patch contains the sh7722 specific hwblk implementation.

Hwblk ids are added to the processor specific header file,
module stop bits and areas are kept track of as hwblks,
clocks are converted to make use of the shared hwblk code.
Code to determine allowed sleep modes is also added.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-05 00:28:55 +09:00
Magnus Damm 79714acbab sh: hwblk base implementation
This patch is the hwblk base implementation, containing
structures and shared functions dealing with hardware blocks.

A each processor model should provide a list of hwblks and
describe which module stop bit that is associated with each
hwblck and how the hwblks are grouped together into areas.

The shared code keeps track of the usage count for each
hwblk and the areas. Fallback implementations for processor
specific code are also kept as weak symbols.

The clock framework, the runtime pm code and cpuidle will
all tie into this hwblk implementation.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-05 00:28:39 +09:00
Magnus Damm 9731f4a202 sh: add r8a66597 usb0 host to the se7724 board
Add USB host support for port CN27 on the Solution Engine 7724
board. The r8a66597-hcd driver is hooked up as a platform device
and some registers are configured to enable the USB host function.
The hardware driving the USB port is the on-chip USB0 block in
the sh7724 processor configured as USB host controller.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-05 00:23:56 +09:00
Tejun Heo c43768cbb7 Merge branch 'master' into for-next
Pull linus#master to merge PER_CPU_DEF_ATTRIBUTES and alpha build fix
changes.  As alpha in percpu tree uses 'weak' attribute instead of
inline assembly, there's no need for __used attribute.

Conflicts:
	arch/alpha/include/asm/percpu.h
	arch/mn10300/kernel/vmlinux.lds.S
	include/linux/percpu-defs.h
2009-07-04 07:13:18 +09:00
Matt Fleming c601a51af1 sh: Use bootmem ontop of lmb
Rework the bootmem allocator to use the lmb framework.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-03 16:16:54 +09:00
Paul Mundt 47220f623c sh: define PERF_COUNTER_INDEX_OFFSET.
Fixes up recent build breakage.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-03 13:08:28 +09:00
Matt Fleming 34e19ada99 sh: Fix compiler error and include the definition of IS_ERR_VALUE
When arch/sh/include/asm/syscall_32.h is included from a file that
doesn't also include linux/err.h the following error is produced,

In file included from /home/matt/src/kernels/sh-2.6/arch/sh/include/asm/syscall.h:5,
                 from kernel/trace/trace_syscalls.c:3:
/home/matt/src/kernels/sh-2.6/arch/sh/include/asm/syscall_32.h: In function 'syscall_get_error':
/home/matt/src/kernels/sh-2.6/arch/sh/include/asm/syscall_32.h:28: error: implicit declaration of function 'IS_ERR_VALUE'
make[2]: *** [kernel/trace/trace_syscalls.o] Error 1
make[1]: *** [kernel/trace] Error 2
make: *** [kernel] Error 2

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-02 03:32:48 +09:00
Magnus Damm 0802d9e55c sh: re-add LCDC fbdev support to the Migo-R defconfig
Re-add LCDC fbdev support to the Migo-R defconfig.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-01 15:31:33 +09:00
Magnus Damm 84f7597c11 sh: fix se7724 ceu names
Use "ceu0" and "ceu1" as CEU names instead of "ceu".
This fixes "memchunk" kernel command line selection
on the solution engine 7724 board.

With this patch applied use "memchunk.ceu0=1m" or
"memchunk.ceu1=1m" on kernel command line to override
physically memory size to one meg for CEU0 or CEU1.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-01 15:31:29 +09:00
Kuninori Morimoto ec87805c63 sh: ms7724se: Enable sh_eth in defconfig.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-29 16:50:49 +09:00
Joe Perches 9a660a6e1a arch/sh/boards/mach-se/7206/io.c: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-29 16:35:09 +09:00
Kuninori Morimoto a80cad950f sh: ms7724se: Add sh_eth support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-26 16:24:02 +09:00
Paul Mundt 1fbcf37128 sh: Kill off unused DEBUG_BOOTMEM symbol.
This was killed off in generic code some time ago, kill off the left over
symbol.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-25 21:17:19 +09:00
Paul Mundt 163b2f0ba9 sh64: Hook up page fault events for software perf counters.
sh64 can use these as well, so tie them up there as well.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-25 02:49:03 +09:00
Paul Mundt 7433ab7703 sh: Hook up page fault events for software perf counters.
This adds page fault instrumentation for the software performance
counters. Follows the x86 and powerpc changes.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-25 02:30:10 +09:00
Paul Mundt d94d4adb7d sh: make set_perf_counter_pending() static inline.
Fixes up a recently introduced build error.

Reported-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-24 22:35:30 +09:00
Tejun Heo 405d967dc7 linker script: throw away .discard section
x86 throws away .discard section but no other archs do.  Also,
.discard is not thrown away while linking modules.  Make every arch
and module linking throw it away.  This will be used to define dummy
variables for percpu declarations and definitions.

This patch is based on Ivan Kokshaysky's alpha percpu patch.

[ Impact: always throw away everything in .discard ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Bryan Wu <cooloney@kernel.org>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Ingo Molnar <mingo@elte.hu>
2009-06-24 15:13:38 +09:00
Paul Mundt bb38c222e0 sh: Fix up HAVE_PERF_COUNTERS typo.
That's HAVE_PERF_COUNTERS not HAVE_PERF_COUNTER. This was right
initially but I seem to have screwed it up while re-typing it out
by hand on another machine when I checked it in. Hmph.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-24 01:41:05 +09:00
Paul Mundt 971121f271 sh: Fix up more dma-mapping fallout.
commit dbe6f18691
("dma-mapping: mark dma_sync_single and dma_sync_sg as deprecated"
conveniently broke every single SH build.

In the future it would be great if people could at least bother
figuring out how to use grep.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-23 17:36:23 +09:00
Paul Mundt 2eb2a43682 sh: SH7786 SMP support.
SH7786 is roughly identical to SH-X3 proto SMP, though there are only 2
CPUs. This just wraps in to the existing SH-X3 SMP code with some minor
changes for SH7786, including wiring up the IPIs properly, enabling
IRQ_PER_CPU, and so forth.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-23 17:30:17 +09:00
Paul Mundt b29fa1fbc2 sh: Wire up the uncached fixmap on sh64 as well.
Now that sh64 also can use the uncached section, wire up the fixmap for
it as well.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-23 17:30:17 +09:00
Paul Mundt 997d003093 sh: Use local TLB flush in set_pte_phys().
set_pte_phys() presently uses the global flush_tlb_one(), which locks on
SMP trying to do the IPI. As we have not even initialized the other CPUs
at this point, switch to the local_ variant so the flush happens on the
boot CPU.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-23 17:30:17 +09:00
Paul Mundt 2e046b9487 sh: Provide cpu_idle_wait() to fix up cpuidle/SMP build.
Crib the x86 cpu_idle_wait() implementation and shove it in with the
idle code, subsequently enabling ARCH_HAS_CPU_IDLE_WAIT.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-23 17:30:17 +09:00
Linus Torvalds d06063cc22 Move FAULT_FLAG_xyz into handle_mm_fault() callers
This allows the callers to now pass down the full set of FAULT_FLAG_xyz
flags to handle_mm_fault().  All callers have been (mechanically)
converted to the new calling convention, there's almost certainly room
for architectures to clean up their code and then add FAULT_FLAG_RETRY
when that support is added.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-21 13:08:22 -07:00
Linus Torvalds 15fc204afc 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: (56 commits)
  sh: Fix declaration of __kernel_sigreturn and __kernel_rt_sigreturn
  sh: Enable soc-camera in ap325rxa/migor/se7724 defconfigs.
  sh: remove stray markers.
  sh: defconfig updates.
  sh: pci: Initial PCI-Express support for SH7786 Urquell board.
  sh: Generic HAVE_PERF_COUNTER support.
  SH: convert migor to soc-camera as platform-device
  SH: convert ap325rxa to soc-camera as platform-device
  soc-camera: unify i2c camera device platform data
  sh: add platform data for r8a66597-hcd in setup-sh7723
  sh: add platform data for r8a66597-hcd in setup-sh7366
  sh: x3proto: add platform data for r8a66597-hcd
  sh: highlander: add platform data for r8a66597-hcd
  sh: sh7785lcr: add platform data for r8a66597-hcd
  sh: turn off irqs when disabling CMT/TMU timers
  sh: use kzalloc() for cpg clocks
  sh: unbreak WARN_ON()
  sh: Use generic atomic64_t implementation.
  sh: Revised clock function in highlander
  sh: Update r7780mp defconfig
  ...
2009-06-18 14:07:35 -07:00
Oleg Nesterov bba7fc0a21 ptrace: remove PT_DTRACE from avr32, mn10300, parisc, s390, sh, xtensa
avr32, mn10300, parisc, s390, sh, xtensa:

They never set PT_DTRACE, but clear it after do_execve().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Chris Zankel <chris@zankel.net>
Acked-by: Roland McGrath <roland@redhat.com>
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18 13:03:48 -07:00
Matt Fleming 9445571169 sh: Fix declaration of __kernel_sigreturn and __kernel_rt_sigreturn
GCC 4.5.0 complains about the declaration of variables
__kernel_sigreturn and __kernel_rt_sigreturn because they have type
void.  Correctly declare these symbols as functions to fix the
following error,

arch/sh/kernel/signal_32.c: In function 'setup_frame':
arch/sh/kernel/signal_32.c:368:14: error: taking address of expression of type 'void'
arch/sh/kernel/signal_32.c: In function 'setup_rt_frame':
arch/sh/kernel/signal_32.c:452:14: error: taking address of expression of type 'void'
make[1]: *** [arch/sh/kernel/signal_32.o] Error 1
make: *** [arch/sh/kernel] Error 2

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-18 18:25:21 +09:00
Paul Mundt 99d921c2ff sh: Enable soc-camera in ap325rxa/migor/se7724 defconfigs.
The MEDIA_SUPPORT option disabled soc-camera support, so re-enable it for
the impacted defconfigs.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-18 16:09:38 +09:00
Christoph Hellwig 4505ffda54 sh: remove stray markers.
arch/sh has a couple of stray markers without any users introduced
in commit 3d58695edb.  Remove them in
preparation of removing the markers in favour of the TRACE_EVENT
macro (and also because we don't keep dead code around).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-18 13:38:26 +09:00
Paul Mundt b7d3740ace sh: defconfig updates.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-18 13:28:09 +09:00
Matthew Wilcox a6c140969b Delete pcibios_select_root
This function was only used by pci_claim_resource(), and the last commit
deleted that use.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-17 14:04:42 -07:00
Paul Mundt 5713e60210 sh: pci: Initial PCI-Express support for SH7786 Urquell board.
This adds initial support for the PCI-Express module in the SH7786,
particularly as it relates to the urquell platform. Presently it is
only supported in root complex mode, with endpoint mode still requiring
more debugging. 29/32-bit mode and lane configurations are selectable via
board mode pins, and are otherwise fixed.

Only 4x and 1x PCI channels are presently handled, the PCI bridge still
requires additional debugging and stabilization in hardware.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 18:20:48 +09:00
Paul Mundt 3d3638da49 Merge branches 'sh/pci-express-integration', 'sh/rsk-updates', 'sh/platform-updates' and 'sh/perf_counter' 2009-06-17 16:37:26 +09:00
Paul Mundt 9c93e59697 sh: Generic HAVE_PERF_COUNTER support.
This enables support for the generic software-based perf counters.

Hardware counter support could be added in the future, but the lack
of a performance counter IRQ makes this rather dubious.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 16:34:45 +09:00
Guennadi Liakhovetski 2cb582ca0d SH: convert migor to soc-camera as platform-device
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 16:22:48 +09:00
Guennadi Liakhovetski 194a17305c SH: convert ap325rxa to soc-camera as platform-device
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 16:22:41 +09:00
Guennadi Liakhovetski 0a861e9eb7 soc-camera: unify i2c camera device platform data
Unify i2c camera device platform data to point to struct soc_camera_link
for a smooth transition to soc-camera as a platform driver.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 16:22:34 +09:00
Yoshihiro Shimoda f73c8f53cc sh: add platform data for r8a66597-hcd in setup-sh7723
and remove redundant parameter for r8a66597-hcd.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 16:21:48 +09:00
Yoshihiro Shimoda 6b64929c1e sh: add platform data for r8a66597-hcd in setup-sh7366
and remove redundant parameter for r8a66597-hcd.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 16:21:00 +09:00
Yoshihiro Shimoda fcaf99d20d sh: x3proto: add platform data for r8a66597-hcd
and remove redundant parameter for r8a66597-hcd.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 16:19:43 +09:00
Yoshihiro Shimoda 6239b20d1b sh: highlander: add platform data for r8a66597-hcd
and remove redundant parameter for r8a66597-hcd.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 16:19:34 +09:00
Yoshihiro Shimoda 5a62a22514 sh: sh7785lcr: add platform data for r8a66597-hcd
and remove redundant parameter for r8a66597-hcd.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 16:19:00 +09:00
Magnus Damm 4c7eb4ebc9 sh: use kzalloc() for cpg clocks
Convert the shared clock cpg code from bootmem to slab.
Without this patch the current bootmem code triggers
WARN_ON() because the slab is available.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 15:39:53 +09:00
Magnus Damm 0ec39885b2 sh: unbreak WARN_ON()
Fix WARN_ON() by modifying the bug trap handling code to
always return in the in-kernel instruction pointer case.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 15:39:52 +09:00
Randy Dunlap e4c9dd0fba kmap_types: make most arches use generic header file
Convert most arches to use asm-generic/kmap_types.h.

Move the KM_FENCE_ macro additions into asm-generic/kmap_types.h,
controlled by __WITH_KM_FENCE from each arch's kmap_types.h file.

Would be nice to be able to add custom KM_types per arch, but I don't yet
see a nice, clean way to do that.

Built on x86_64, i386, mips, sparc, alpha(tonyb), powerpc(tonyb), and
68k(tonyb).

Note: avr32 should be able to remove KM_PTE2 (since it's not used) and
then just use the generic kmap_types.h file.  Get avr32 maintainer
approval.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: <linux-arch@vger.kernel.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Bryan Wu <cooloney@kernel.org>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: "Luck Tony" <tony.luck@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-16 19:47:51 -07:00
Alexey Dobriyan bb1f17b037 mm: consolidate init_mm definition
* create mm/init-mm.c, move init_mm there
* remove INIT_MM, initialize init_mm with C99 initializer
* unexport init_mm on all arches:

  init_mm is already unexported on x86.

  One strange place is some OMAP driver (drivers/video/omap/) which
  won't build modular, but it's already wants get_vm_area() export.
  Somebody should look there.

[akpm@linux-foundation.org: add missing #includes]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Cc: Americo Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-16 19:47:28 -07:00
Paul Mundt f01789c688 sh: Use generic atomic64_t implementation.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-17 10:43:13 +09:00
Nobuhiro Iwamatsu 39f4490c70 sh: Revised clock function in highlander
Clock function was changed, but highlander used old function.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-16 16:49:11 +09:00
Nobuhiro Iwamatsu 02a146dffa sh: Update r7780mp defconfig
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-16 16:49:06 +09:00
Nobuhiro Iwamatsu 15ba400ebb sh: Add support mtd mapping for highlander
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-16 16:49:03 +09:00
Paul Mundt 66765fe1b6 sh: pci: SH7786 PCI ops.
This adds in preliminary support for the SH7786 PCIe module PCI ops,
and the corresponding module definitions.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-16 06:26:08 +09:00
Paul Mundt 8c6b44d00a sh: pci: Allow register_pci_controller() to handle overlapping regions.
Some host controllers (such as SH7786) have overlapping regions that are
fixed in hardware. The resource allocator does the right thing in
managing this space already, so the conflict case is non-fatal.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-16 06:01:58 +09:00
Magnus Damm 724cfb9440 sh: smsc911x support for the rsk7203 board
This patch adds support for the LAN9118 ethernet on rsk7203.

The LAN9118 controller is hooked up using a 16-bit data bus,
but the rsk7203 board does not swap the byte lanes as needed
between the sh7203 processor and the the ethernet controller.

In the processor the CS memory window is configured in 16-bit
mode but the smsc911x driver is told to do 32-bit accesses to
improve performance. The SMSC911X_SWAP_FIFO flag is used
to tell the driver to do software byte swapping of fifo data.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-16 05:57:07 +09:00
Paul Mundt 8b27fc6de1 sh: Set EARLY_SCIF_CONSOLE_PORT sanely for SH7786.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-16 03:58:25 +09:00
Paul Mundt 5d0e945a24 sh: urquell: Add system FPGA mode pin support.
Urquell has a system FPGA capable of reading the mode pin states from
software, wire this up in the machvec.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-15 19:02:37 +09:00
Matt Fleming 0c50f6f383 sh: Make the atomic functions safe for irqsoff tracing
The irqsoff tracer uses the atomic_* functions internally, but the
implementations of those functions in arch/sh/include/asm/atomic-irq.h
disable irqs to achieve atomicity. A continuous loop ensues where we
disable interrupts, trace the interrupt disabling, call atomic_*
functions, disable interrupts, trace the interrupt disabling, etc..

The simplest solution to all this is to just convert uses of
local_irq_save()/local_irq_restore() the raw_* equivalents because the
raw_* equivalents don't call trace_hardirqs_on()/trace_hardirqs_off().

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-15 00:31:17 +09:00
Paul Mundt 3767f3f1ee sh: Convert sh64 to use the generic checksum code.
This plugs in GENERIC_CSUM support on sh64, and kills off all of the old
references.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-15 00:00:42 +09:00
Paul Mundt 2b74b85693 sh: Derive COMMAND_LINE_SIZE from asm-generic/setup.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:27:41 +09:00
Paul Mundt 7fb8156d50 sh: Switch to asm-generic versions for identical headers.
This switches over mman/param/parport/serial/socket/ucontext.h.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:26:48 +09:00
Paul Mundt bdc90d461d sh: Convert to asm-generic/signal.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:25:57 +09:00
Paul Mundt a8bd468313 sh: Convert to asm-generic/types.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:25:27 +09:00
Paul Mundt 84f8369015 sh: Convert to asm-generic/scatterlist.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:25:04 +09:00
Paul Mundt 508fb69886 sh: Convert to asm-generic/unaligned.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:24:43 +09:00
Paul Mundt 5db455bd55 sh: Convert to asm-generic/module.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:24:14 +09:00
Paul Mundt 7b2758228f sh: Conver to asm-generic/mmu_context.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:23:41 +09:00
Paul Mundt f8f06bc74b sh: Tidy up duplication in irq/swab/timex.h.
The asm-generic versions have some helper definitions that we can use
instead, drop our definitions and use those instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:21:54 +09:00
Paul Mundt 6f2ea72975 sh: Convert ipc/shm bits to their asm-generic versions.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:20:27 +09:00
Paul Mundt 4b1239559e sh: Convert to asm-generic/termbits.h and termios.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:17:57 +09:00
Paul Mundt bc8d422d11 sh: Convert to asm-generic/posix_types.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 23:16:27 +09:00
Paul Mundt 9deaa3bcff sh: Convert to asm-generic/dma.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 21:45:06 +09:00
Paul Mundt 4822994a23 sh: Convert to asm-generic/current.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 21:34:26 +09:00
Paul Mundt bff7b55bdb Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-14 21:22:15 +09:00
Paul Mundt 6fe32a4685 sh: Bump the earlytimer probe devices up.
Presently the earlytimer probe handles the clockevents driver, which
requires that the clockevents driver be registered first. This bumps it
up by 1 to include the clocksource device, which can be safely ignored
if it doesn't exist, as we will simply error out on that path and defer
to the jiffies clocksource.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 20:02:30 +09:00
Paul Mundt a34c7e3e7b sh: Use generic sched_clock().
The generic sched_clock() handles INITIAL_JIFFIES now as well, so we can
just use that instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 19:48:48 +09:00
Paul Mundt 1d29ebebcb sh: Bump the earlytimer bits back to time_init().
These were handled through late_time_init due to kmalloc() and friends
not being available earlier on previously. Now with slab caches being
available much earlier, this is no longer necessary, and we can move the
initialization up to an earlier point. One of the benefits with this is
that printk times are available a bit earlier!

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 19:45:40 +09:00
Rusty Russell e09377bae4 cpumask: Use accessors for cpu_*_mask: sh
Use the accessors rather than frobbing bits directly (the new versions
are const).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 18:24:16 +09:00
Rusty Russell 74c86d6757 cpumask: use mm_cpumask() wrapper: sh
Makes code futureproof against the impending change to mm->cpu_vm_mask.

It's also a chance to use the new cpumask_ ops which take a pointer
(the older ones are deprecated, but there's no hurry for arch code).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 18:24:15 +09:00
Rusty Russell 819807df6e cpumask: arch_send_call_function_ipi_mask: sh
We're weaning the core code off handing cpumask's around on-stack.
This introduces arch_send_call_function_ipi_mask(), and by defining
it, the old arch_send_call_function_ipi is defined by the core code.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 18:24:14 +09:00
Rusty Russell 0cb73f4c46 cpumask: remove the now-obsoleted pcibus_to_cpumask(): sh
cpumask_of_pcibus() is the new version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 18:24:13 +09:00
Huang Weiyi 78c99ba1b1 sh: pci: remove duplicated #include's
Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-14 17:48:43 +09:00
Linus Torvalds cd166bd0dd Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  add generic lib/checksum.c
  asm-generic: add a generic uaccess.h
  asm-generic: add generic NOMMU versions of some headers
  asm-generic: add generic atomic.h and io.h
  asm-generic: add legacy I/O header files
  asm-generic: add generic versions of common headers
  asm-generic: make bitops.h usable
  asm-generic: make pci.h usable directly
  asm-generic: make get_rtc_time overridable
  asm-generic: rename page.h and uaccess.h
  asm-generic: rename atomic.h to atomic-long.h
  asm-generic: add a generic unistd.h
  asm-generic: add generic ABI headers
  asm-generic: add generic sysv ipc headers
  asm-generic: introduce asm/bitsperlong.h
  asm-generic: rename termios.h, signal.h and mman.h
2009-06-12 18:15:51 -07:00
Rusty Russell 5933048c69 module: cleanup FIXME comments about trimming exception table entries.
Everyone cut and paste this comment from my original one.  We now do
it generically, so cut the comments.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Amerigo Wang <amwang@redhat.com>
2009-06-12 21:47:05 +09:30
Arnd Bergmann 5b02ee3d21 asm-generic: merge branch 'master' of torvalds/linux-2.6
Fixes a merge conflict against the x86 tree caused by a fix to
atomic.h which I renamed to atomic_long.h.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2009-06-12 11:32:58 +02:00
Paul Mundt 19470e185a sh: Wire up sys_perf_counter_open.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-12 01:33:22 +03:00
Paul Mundt cf64c800f0 Merge branch 'sh/ftrace' of git://github.com/mfleming/linux-2.6 2009-06-12 01:12:44 +03:00
Arnd Bergmann 5b17e1cd89 asm-generic: rename page.h and uaccess.h
The current asm-generic/page.h only contains the get_order
function, and asm-generic/uaccess.h only implements
unaligned accesses. This renames the file to getorder.h
and uaccess-unaligned.h to make room for new page.h
and uaccess.h file that will be usable by all simple
(e.g. nommu) architectures.

Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2009-06-11 21:02:17 +02:00
Arnd Bergmann 72099ed271 asm-generic: rename atomic.h to atomic-long.h
The existing asm-generic/atomic.h only defines the
atomic_long type. This renames it to atomic-long.h
so we have a place to add a truly generic atomic.h
that can be used on all non-SMP systems.

Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
2009-06-11 21:02:17 +02:00
Arnd Bergmann c31ae4bb4a asm-generic: introduce asm/bitsperlong.h
This provides a reliable way for asm-generic/types.h and other
files to find out if it is running on a 32 or 64 bit platform.

We cannot use CONFIG_64BIT for this in headers that are included
from user space because CONFIG symbols are not available there.
We also cannot do it inside of asm/types.h because some headers
need the word size but cannot include types.h.

The solution is to introduce a new header <asm/bitsperlong.h>
that defines both __BITS_PER_LONG for user space and
BITS_PER_LONG for usage in the kernel. The asm-generic
version falls back to 32 bit unless the architecture overrides
it, which I did for all 64 bit platforms.

Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2009-06-11 21:02:14 +02:00
Arnd Bergmann 63b852a6b6 asm-generic: rename termios.h, signal.h and mman.h
The existing asm-generic versions are incomplete and included
by some architectures. New architectures should be able
to use a generic version, so rename the existing files and
change all users, which lets us add the new files.

Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2009-06-11 21:01:52 +02:00
Matt Fleming 9e28c46b7d sh: Fix dynamic ftrace's NOP action.
Ftrace on sh handles nop'ing out trace function calls differently than
other architectures. Instead of inserting NOP instructions in place of
the call to the function tracer we branch over the call instructions
and continue executing the main body of the function.

This patch fixes a bug in the implementation of ftrace_modify_code()
where we check that the old value of the code we're about to replace
is an expected one. In the ftrace_make_call() code path
ftrace_modify_code() was comparing the old instruction value with NOP
instructions. The compare was failing because we never actually insert
NOP instructions. It makes sense to just get rid of the NOP
instructions in ftrace_nop and compare the old code with the address
of the function body if we're expecting ftrace to have nop'd out the
function trace call.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2009-06-11 19:00:58 +01:00
Matt Fleming 7780b6a299 sh: Update my email address
Use my current email address as my gentoo account will be closed at
some point.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2009-06-11 09:26:43 +01:00
Paul Mundt 54ff328b46 sh: Tie sparseirq in to Kconfig.
Now that the dependent patches are merged, we are ready to enable
sparseirq support. This simply adds the Kconfig option, and then converts
from the _cpu to the _node allocation routines to follow the upstream
sparseirq API changes.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 10:33:09 +03:00
Paul Mundt 6a1555fdde sh: Wire up sys_rt_tgsigqueueinfo.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:38:05 +03:00
Paul Mundt 75c936aec0 sh: Fix sys_pwritev() syscall table entry for sh32.
There was a typo here that had this as sys_writev() instead of
sys_pwritev(), fix this up. sh64 got this right, as did the preadv()
case.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:33:53 +03:00
Aoi Shinkai 4c7c997886 sh: Fix sh4a llsc-based cmpxchg()
This fixes up a typo in the ll/sc based cmpxchg code which apparently
wasn't getting a lot of testing due to the swapped old/new pair. With
that fixed up, the ll/sc code also starts using it and provides its own
atomic_add_unless().

Signed-off-by: Aoi Shinkai <shinkoi2005@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:31:55 +03:00
Kuninori Morimoto f168dd00a9 sh: sh7724: Add JPU support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Acked-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:17:17 +03:00
Kuninori Morimoto c5eeff1f8e sh: sh7724: INTC setting update
This patch follows Rev 0.50 manual

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:17:12 +03:00
Magnus Damm 46e9371c0e sh: sh7722 clock framework rewrite
This patch rewrites the sh7722 clock framework code.
The new code makes use of the recently merged div4,
div6 and mstp32 helper code. Both extal and dll are
supported as input clocks to the pll.

While at it, now when all SuperH Mobile processors
are converted, fix CONFIG_SH_CLK_CPG_LEGACY to depend
on CONFIG_ARCH_SHMOBILE.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:15:15 +03:00
Magnus Damm 4ed3739484 sh: sh7366 clock framework rewrite
This patch rewrites the sh7366 clock framework code.
The new code makes use of the recently merged div4,
div6 and mstp32 helper code. Both extal and dll are
supported as input clocks to the pll.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:15:07 +03:00
Magnus Damm bc49b6eaac sh: sh7343 clock framework rewrite
This patch rewrites the sh7343 clock framework code.
The new code makes use of the recently merged div4,
div6 and mstp32 helper code. Both extal and dll are
supported as input clocks to the pll.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:14:34 +03:00
Magnus Damm b621370a35 sh: sh7724 clock framework rewrite V3
This patch contains V3 of the sh7724 clock framework
rewrite. The new code makes use of the recently merged
div4, div6 and mstp32 helper code. Both extal and fll are
supported as input clocks to the pll. The div6 clocks are
fed through a divide-by-3 block.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:14:28 +03:00
Magnus Damm c521dc0203 sh: sh7723 clock framework rewrite V2
This patch contains V2 of the sh7723 clock framework
rewrite. The new code makes use of the recently merged
div4, div6 and mstp32 helper code. Both extal and dll
are supported as input clocks to the pll.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:13:36 +03:00
Magnus Damm 098dee99d1 sh: add enable()/disable()/set_rate() to div6 code
This patch updates the div6 clock helper code to add support
for enable(), disable() and set_rate() callbacks.

Needed by the camera clock enabling board code on Migo-R.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:12:58 +03:00
Magnus Damm c01641b42a sh: add AP325RXA mode pin configuration
This patch adds mode pin configuration to ap325rxa.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:09:33 +03:00
Magnus Damm 0ec80fddf1 sh: add Migo-R mode pin configuration
This patch adds mode pin configuration and
a machvec structure to Migo-R.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:09:27 +03:00
Magnus Damm ed740cb9b7 sh: sh7722 mode pin definitions
This patch adds sh7722 mode pin and pin function
controller comments.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:09:19 +03:00
Magnus Damm 36e5b26bda sh: sh7724 mode pin comments
This patch adds comments for the sh7724 mode pins
and pin function controller.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:09:12 +03:00
Magnus Damm e4218ef506 sh: sh7723 mode pin V2
This patch is sh7723 mode pin V2. Mode pins and
pin function controller comments are added.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:09:01 +03:00
Magnus Damm 0d4fdbb64f sh: rework mode pin code
This patch reworks the mode pin code to keep the pin
definitions in one place. The mode pins values are now
the value of the bit instead of bit number.

With this patch in place the sh7785 header file contains
mode pin comments. The sh7785 clock code and the sh7785lcr
board code are updated to reflect the new shared mode pins.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:08:53 +03:00
Magnus Damm 2693e2740d sh: clock div6 helper code
This patch adds div6 clock helper code. The div6 clocks
are simply 6-bit divide-by-n modules where n is 1 to 64.

Needed for vclk on sh7722, sh7723, sh7343 and sh7366.
sh7724 needs this even more for vclk, fclka, fclkb,
irdaclk and spuclk.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:07:13 +03:00
Magnus Damm a50de78dc6 sh: clock div4 frequency table offset fix
This patch fixes the per clock offset calculation in
sh_clk_div4_register(). Without this patch the offset
to the frequency table for each clock is incorrect.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-11 09:07:04 +03:00
Paul Mundt cf9fe114e3 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-11 09:01:14 +03:00
Paul Mundt c1d0d32a60 sh: plug vsyscall dir in to archclean.
The vsyscall targets are presently not cleaned up, so just handle it in
the archclean rule.

Reported-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-10 09:48:33 +03:00
Magnus Damm 48c72fccbf sh: 16-bit get_unaligned() sh4a fix
This patch fixes the 16-bit case of the sh4a specific
unaligned access implementation. Without this patch
the 16-bit version of sh4a get_unaligned() results in
a 32-bit read which may read more data than intended
and/or cross page boundaries.

Unbreaks mtd NOR write handling on Migo-R.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-04 20:20:24 +09:00
Kuninori Morimoto 138f025267 sh: sh7723: L2 cache initialization.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-02 12:12:59 +09:00
Kuninori Morimoto b4bd9eb0d8 sh: sh7724: L2 cache initialization.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-02 12:12:57 +09:00
Kuninori Morimoto fab88d9fe9 sh: add weak l2_cache_init function.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-02 12:12:55 +09:00
Kuninori Morimoto d974ac24b7 sh: add RAMCR definition for sh4
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-02 12:12:53 +09:00
Kuninori Morimoto 4778541470 sh: fix CONFIG_SH_PCLK_FREQ bug for sh7724
CONFIG_SH_PCLK_FREQ=33333333 is correct for sh7724.
sh7724 master clock is 33333333, but peripheral is 41666666.
This bug came to light because sh-sci driver had changed clk
from "module_clk" to "peripheral_clk"

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-02 12:08:52 +09:00
Paul Mundt 0bf8513ed0 sh: Tidy up SH-4A boot_cpu_data.flags probing.
This tidies up the boot_cpu_data.flags probing on SH-4A. All of them have
a few things in common, which we can blindly set, rather than having each
subtype have to set the same flags. We can also make assumptions about
cache ways and the validity of PTEA, so this also kills off CPU_HAS_PTEA
as a config option. There was also a bug in the FPU probing, which is now
tidied up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 19:50:08 +09:00
Paul Mundt 7863d3f7ae sh: Tidy up the optional L2 probing, wire it up for SH7786.
This tidies up the L2 probing, as it may or may not be implemented on a
CPU, regardless of whether it is supported. This converts the cvr
validity checks from BUG_ON()'s to simply clearing the CPU_HAS_L2_CACHE
flag and moving on with life.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 19:38:41 +09:00
Magnus Damm 43909a9380 sh: hook up shared div4 clock code to sh7785
Hook up the shared 4-bit divisor clock code to sh7785.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 18:07:50 +09:00
Magnus Damm a1153e27ee sh: shared div4 clock code
Add shared code for 4-bit divisor clocks.

Processor specific code can use SH_CLK_DIV4()
to initialize div4 clocks, and then use
sh_clk_div4_register() for registration.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 18:07:37 +09:00
Magnus Damm e89d53e605 sh: hook up shared mstp32 clock code to sh7785
Hook up the shared 32-bit module stop bit code to sh7785.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 18:06:36 +09:00
Magnus Damm 6881e8bf3d sh: shared mstp32 clock code
Add shared 32-bit module stop bit clock support.

Processor specific code can use SH_CLK_MSTP32()
to initialize module stop bit clocks, and then
use sh_clk_mstp32() for registration.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 18:05:37 +09:00
Kuninori Morimoto 98fbe45bea sh: SH7724 has an L2 cache.
Add the CPU_HAS_L2_CACHE flag to SH7724.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 15:59:03 +09:00
Magnus Damm 1823f6d5e6 sh: sh7785 pll configuration from mode pin
This patch modifies the sh7785 clock code to use the MODE4
value to switch between 72x and 36x PLL multiplication.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 15:57:12 +09:00
Magnus Damm 63d12e2323 sh: sh7785lcr mode pin configuration
This patch adds mode pin support to the sh7785lcr board.

The harware allows the user to control the mode pins using
dip switches S1 and S2, but from the software the pins are
fixed to the factory default since we have no way to reading
out this configuration from software.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 15:56:59 +09:00
Magnus Damm 4a44b32969 sh: sh7785 mode pin definitions
This patch adds sh7785 mode pin definitions. Mode pins and
pin function controller comments are added as well.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 15:56:00 +09:00
Magnus Damm eb9b9b56ee sh: boot word / mode pin support V2
Add mode pin support for the SuperH architecture V2.

With this patch applied the board code can add their
own function to export the cpu mode pin configuration.
In most cases this will be a constant bitmap, but
boards that allow reading this from a register can
instead read out the pin state from hardware.

The code warns if a pin is tested but no board specific
mode pin function has been provided.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-06-01 15:44:49 +09:00
Oskar Schirmer c3dc5bec05 flat: fix data sections alignment
The flat loader uses an architecture's flat_stack_align() to align the
stack but assumes word-alignment is enough for the data sections.

However, on the Xtensa S6000 we have registers up to 128bit width
which can be used from userspace and therefor need userspace stack and
data-section alignment of at least this size.

This patch drops flat_stack_align() and uses the same alignment that
is required for slab caches, ARCH_SLAB_MINALIGN, or wordsize if it's
not defined by the architecture.

It also fixes m32r which was obviously kaput, aligning an
uninitialized stack entry instead of the stack pointer.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Oskar Schirmer <os@emlix.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Bryan Wu <cooloney@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Cc: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Johannes Weiner <jw@emlix.com>
Acked-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-05-29 08:40:02 -07:00
Paul Mundt 5582b0648d sh: pci-sh7780: Fix up for PCI_DISABLE_MWI changes.
This fixes a build error where references to pci_cache_line_size are
undefined, as this ceases to be exported when PCI_DISABLE_MWI is enabled,
as is now the default.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-27 00:12:58 +09:00
Paul Mundt 464c9e1037 Merge branch 'sh/clkfwk' 2009-05-26 23:50:40 +09:00
Paul Mundt b7e2ac6194 sh: pci: Disable MWI and make pci_dma_burst_advice() a bit more accurate.
None of the SH PCI controllers support MWI, it is always treated as a
direct memory write, so simply disable it outright. In the case of the
PCI cache line size, consult that for the pci_dma_burst_advice()
strategy, and switch over to PCI_DMA_BURST_MULTIPLE, as PPC64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-26 23:13:13 +09:00
Paul Mundt d076d2bd0d sh: pci-sh7751: Initialize io_map_base in controller definition.
As there is only a single controller and remapping has no impact for the
address range in question, just initialize it directly in the controller
definition. This fixes up boot time warnings about not having the field
initialized.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-26 23:10:15 +09:00
Paul Mundt f9e2b97dc2 sh: Add a KBUILD_DEFCONFIG for sh64.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-26 17:12:20 +09:00
Magnus Damm 61ce5393e4 sh: remove clk_ops->build_rate_table()
This patch removes the ->build_rate_table() callback,
->recalc() may instead be used for this purpose.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-26 17:08:45 +09:00
Magnus Damm df109e630f sh: use shared frequency tables on sh7785
This patch converts the sh7785 clock code to make use
of clk_rate_table_build() and clk_rate_table_round().
The ->build_rate_table() callback is removed, the
table building is instead handled in ->recalc().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-26 17:08:42 +09:00
Magnus Damm c94a85746f sh: add shared clock framework frequency table code
Add SuperH-specific clock framework helper functions:
- clk_rate_table_build() - build cpufreq table from divisors/multipliers
- clk_rate_table_round() - use cpufreq table to find matching frequency

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-26 17:08:39 +09:00
Magnus Damm c9904dd159 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>
2009-05-26 17:08:36 +09:00
Paul Mundt 5b25ab29ba sh: Record ms7724se in mach-types.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-26 17:02:18 +09:00
Kuninori Morimoto 287c129716 sh: Add ms7724se (SH7724) board support
This adds preliminary support for the ms7724se solution engine board.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-26 17:01:47 +09:00
Paul Mundt 3709ab8dfa sh: irq: Fix up imask build warnings.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-26 13:52:28 +09:00
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