Commit Graph

664 Commits

Author SHA1 Message Date
Magnus Damm d59645d6ba sh: intc - remove redundant irq code for sh03, snapgear and titan
This patch removes redundant board specific interrupt code for boards
using sh775x processors and 4 IRQ lines in "Individual Interrupt Mode"
aka IRLM.

Three boards are affected: sh03, snapgear and titan.

The right way to do this is to use cpu specific code provided by intc.
A nice side effect is that sh03 now compiles, board not BROKEN any more.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:47 +09:00
Paul Mundt ad89f87a84 rtc: rtc-sh: Support 4-digit year on SH7705/SH7710/SH7712.
All SH-4 parts have a 4-digit year, while the SH-3 parts typically
only use a 2-digit one. The SH7705, SH7710, and SH7712 SH-3 parts
however opted to extend it to 4-digit and still look and act like
an SH-3 RTC in all other ways.

This adds a capability flag (RTC_CAP_4_DIGIT_YEAR) that these
corner-case CPU subtypes can set in their platform data and cleans
up some of the ifdef mess in the driver as a result.

Reported-by: Markus Brunner <super.firetwister@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:47 +09:00
Paul Mundt 7da3b8ef66 sh: Initial multiple-node support for SH-X3.
Wire up CPU#0 URAM as node 1 on SH-X3.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:47 +09:00
Magnus Damm 1ee010087e sh: intc - add support for x3
This patch converts the cpu specific interrupt setup code for x3 from
intc2 to intc. New vectors are also added to match the preliminary
information.

Use plat_irq_setup_pins() to select between IRQ and IRL mode for IRQ0-3.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:47 +09:00
Magnus Damm 137b53b71c sh: intc - fix IRQ4 and IRQ5 typo on sh3
The intc tables for sh3 currently contain a typo where the bit
fields in IPRD are mixed up for IRQ4 and IRQ5. This patch makes
sure the correct bit fields are used - all according to the
datasheets.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:47 +09:00
Paul Mundt ac38e4d33d sh: Fix cache disabling build failures on nommu.
The cache disabling stuff screwed up some of the sh4 nommu
builds, fix it up again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:47 +09:00
Magnus Damm c9d03d9a80 sh: simplify se7780 IRQ code
The new intc code handles IRQ3 and IRQ7 in the cpu specific code
already, so there is no reason to duplicate that here.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:47 +09:00
Magnus Damm e29bfbc443 sh: intc - add support for SH7760
This patch converts the cpu specific interrupt setup code for sh7760
from ipr + intc2 to intc. New vectors are also added to match the
information provided by the datasheet.

Vectors for IRQ4-IRQ7 are enabled by default. Use plat_irq_setup_pins()
if pins IRL0-3 should be used in IRLM mode.

The patch also adds the SIM block to the serial port platform data.
Version two of this patch fixes MMCIF problems reported by Manuel Lauss.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:46 +09:00
Magnus Damm a0e23267d4 sh: intc - add support for SH7785
This patch converts the cpu specific interrupt setup code for sh7785
from intc2 to intc. New vectors are also added to match the information
provided by the datasheet.

No IRQ/IRL pin vectors are enabled by default. Use plat_irq_setup_pins()
to select between IRL and IRQ mode.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:46 +09:00
Paul Mundt e7bd34a15b sh: Support explicit L1 cache disabling.
This reworks the cache mode configuration in Kconfig, and allows for
explicit selection of write-back/write-through/off configurations.
All of the cache flushing routines are optimized away for the off
case.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:46 +09:00
Magnus Damm ac919986d7 sh: intc - avoid SH7710 specific vector on SH7712
This patch makes sure that the sh7710 specific ipsec vector is missing
if building for a sh7712. All according to the datasheet.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:46 +09:00
Magnus Damm 1301e71562 sh: intc - add missing vectors for SH7707
This patch adds a few missing vectors for sh7707. The only interrupt
controller differences between sh7707 and sh7709 seem to be added
vectors for one LCD controller and two PCMCIA slots.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:46 +09:00
Magnus Damm ec58f1f32d sh: intc - add support for SH7706, SH7707, SH7708, SH7709
This patch unifies the cpu specific interrupt setup code for
sh7706, sh7707, sh7708 and sh7709 and moves the code into a new
file called setup-sh770x.c.  It makes sense to share the setup code
between these processors because most hardware blocks are identical
from a software point of view. With this patch the sh770x processors
now have a complete set of vectors that match with the information
provided by the data sheets. This is a big improvement for sh7708.

Vectors for IRQ4 and IRQ5 are enabled by default. Use
plat_irq_setup_pins() if pins IRQ0-3 should be used in IRQ mode.

This patch also unifies the platform device setup code which means
that the rtc driver now has platform data for all sh770x processors.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:46 +09:00
Magnus Damm 28b146c84e sh: intc - add support for SH7710
This patch converts the cpu specific interrupt setup code
for sh7710 from ipr to intc. While at it new vectors are added
to match the information provided by the datasheet. Version two
simplifies the Kconfig part.

Vectors for IRQ4 and IRQ5 are enabled by default. Use
plat_irq_setup_pins() if pins IRQ0-3 should be used in IRQ mode.

This patch also adds sh7710 specific platform data for the rtc
driver. The base address of SCIF1 is adjusted to match the
datasheet.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:45 +09:00
Magnus Damm 70e8be0a4e sh: intc - add support for SH7705
This patch converts the cpu specific interrupt setup code for
sh7705 from ipr to intc. While at it new vectors are added to
match the information provided by the datasheet.

Vectors for IRQ4 and IRQ5 are enabled by default.

Use plat_irq_setup_pins() if pins IRQ0-3 should be used in IRQ mode.

This patch also adds sh7705 specific platform data for the rtc driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:45 +09:00
Magnus Damm b58d134c7f sh: missing symbol fix for sh4-202
This patch adds a plat_irq_setup() symbol for sh4-202. Without
this fix it is impossible to build a working kernel using the
microdev_defconfig.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-22 13:32:07 +09:00
Paul Mundt da2f5f7bf4 sh: Fix DSP opcode regression for SH3-DSP parts.
Older versions of binutils do not support -Wa,-isa= tuning, which is
something we rely on for enabling DSP opcode support on the newer
parts. SH3-DSP parts can still be handled with -Wa,-dsp even if the
newer parts require the newer versions of binutils for supporting the
new opcodes.

This was broken in -rc1 when the SH4AL-DSP support was being reworked,
and is needed to get SH3-DSP working with older toolchains again.

Reported-by: Markus Brunner <super.firetwister@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-21 16:56:56 +09:00
Andy Whitcroft 96989d9d75 sh: remove extraneous ; on scif_sercon_putc wait loop
It seems we have gained an extraneous trailing ';' on one of the
wait loops in scif_sercon_putc().  Although this is completely
benign as the apparent payload is also the empty statement, it
invites error in the future.  Clean it up now.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-17 01:25:34 +09:00
Paul Mundt 5556410e22 sh: panic on machvec section misalignment.
Now that __initmv references the machvec section unconditionally
there have been cases where folks have been mistakenly flagging
non-machvec structures with the machvec section attribute (presumably
to shut up modpost). This leads to obscure breakage in earlyprintk
amongst other places and is rather non-obvious.

Add a simple sanity check to try and catch __initmv misuse and
panic early.

Reported-by: Markus Brunner <super.firetwister@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-07 19:13:23 +09:00
Paul Mundt 662ae2169a sh: Fix PTRACE_PEEKTEXT/PEEKDATA fallout from generic_ptrace_peekdata().
When generic_ptrace_peekdata() was merged, the break for these cases
ended up getting dropped, which lead to each PEEKTEXT/PEEKDATA op leaking
in to PEEKUSR and get_user_pages() always -EFAULTing. Add the break back
in.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-04 13:39:21 +09:00
Magnus Damm cc6f33db30 sh: fix defconfigs for sh7751r boards
This patch fixes up the defconfig for various sh7751r based boards
by updating them to the single cpu subtype CONFIG_CPU_SUBTYPE_SH7751R.
The following sh4 boards are updated: hs7751rvoip, landisk, lboxre2,
systemh, titan.

The current defconfigs with two subtypes defined trigger a configuration
bug which result in kernel configurations with missing board support
code. We end up with kernels without board code and with generic machvec
only.

So we need this patch to make sure the board code gets compiled in.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-03 10:17:47 +09:00
Magnus Damm 5ca95c48f1 sh: fix cf support on r2d boards
This patch makes sure cf support is enabled on R2D-PLUS but disabled
on R2D-1. Without this fix R2D-1 boards hang on bootup.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-03 10:16:29 +09:00
Magnus Damm a3b3e23015 sh: update r2d defconfig
- Disable CONFIG_SH_DMA to avoid boot up freeze on R2D-1
- Disable CONFIG_SH_STANDARD_BIOS to support R2D-PLUS boot loaders

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-03 10:15:53 +09:00
David McCullough 49dd3ff3a5 sh: update snapgear defconfig.
Updated the snapgear defconfig to get a booting kernel.

Signed-off-by: David McCullough <david_mccullough@au.securecomputing.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-03 10:14:09 +09:00
Paul Mundt e0a3647fd7 sh: Fix SH-X3 FPU exception handling.
SH-X3 has the FPU exceptions on different vectors completely,
patch in do_fpu_state_restore() to the proper vectors.

Results in a much happier userspace.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-01 16:55:07 +09:00
Paul Mundt 06f862c8ce sh: Fix pgd mismatch from cached TTB in unhandled fault.
When reading the cached TTB value and extracting the pgd, we
accidentally applied a __va() to it and bumped it off in to bogus
space which ended up causing multiple faults in the error path.

Fix it up so unhandled faults don't do strange and highly unorthodox
things when oopsing.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-01 16:39:51 +09:00
Paul Mundt 56c74c733c sh: Don't include fault-nommu on SH-2/SH-2A.
fault-nommu defines the page fault handler stubs for SH-3/4 parts,
but is not needed on SH-2/SH-2A now that the entry code has been
logically separated.

Add it in for SH-3 and SH-4 explicitly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-01 16:26:21 +09:00
Paul Mundt c71799433a sh: Fix irqflags tracing for SH-3/4 nommu.
We were missing the trace_hardirqs_on() instrumentation in the nommu
case, resync with the MMU version of the page fault handler to have
this behaving consistently. Also explicitly re-enable IRQs now that
the assembly code isn't doing it for us any more.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-01 16:19:49 +09:00
Paul Mundt c347d12cd1 sh: Fix lockdep debugging oops on SH-3/4.
In the SH-3/4 TLB access violation path we were enabling IRQs before
the call in to trace_hardirqs_on(), which ended up triggering:

        if (DEBUG_LOCKS_WARN_ON(!irqs_disabled()))
                return;

in kernel/lockdep.c:2031. Fix this up by removing the early re-enable,
we were already re-enabling IRQs post-trace_hardirqs_on() already, so
the semantics are now as was initially intended.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-08-01 16:17:07 +09:00
Paul Mundt e06c4e5775 sh: Fix fs.h removal from mm.h regressions.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-31 13:01:43 +09:00
David McCullough c64ac9f058 sh: fix get_wchan() for SH kernels without framepointers
Do not follow the frame pointers (/proc/X/task/1/stat) unless we were
compiled with them.

Signed-off-by: David McCullough <david_mccullough@au.securecomputing.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-26 17:46:07 +09:00
David McCullough 1f25756a11 sh: arch/sh/boot - fix shell usage
Fix the shell call to explicitly use bash, since they are bash
specific and not all systems have bash as the default.

Signed-off-by: David McCullough <david_mccullough@au.securecomputing.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-26 17:43:41 +09:00
Magnus Damm d89ddd1c84 sh: remove support for sh7300 and solution engine 7300
This patch removes old dead code:
- kill off sh7300 cpu support
- get rid of broken solution engine 7300 board support

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-26 15:37:57 +09:00
Paul Mundt e257ad062a sh: Kill off virt_to_bus()/bus_to_virt().
Wire up ARCH_NO_VIRT_TO_BUS, and kill off the remaining users. The
dma-mapping code really wanted virt_to_phys()/phys_to_virt() anyways,
there are no inherently special bus addresses.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-26 15:37:40 +09:00
Paul Mundt ac79fd58a2 sh: Restrict DSP support to specific CPUs.
Not all CPUs support the DSP, and this leads to problems when mixing
and matching CPU types and DSP opcodes. Fix this up by only allowing
CONFIG_SH_DSP to be enabled for the CPUs that explicitly have such a
block.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-26 15:35:24 +09:00
Paul Mundt b067c50a7f sh: Silence sq compile warning on sh4 nommu.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-26 15:35:17 +09:00
Paul Mundt 3c6b6c7fb7 sh: Kill the rest of the SE73180 cruft.
There was a stray header, and the mach-type removal was also
missed.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-26 15:34:56 +09:00
Magnus Damm 870e8a2438 sh: remove support for sh73180 and solution engine 73180
This patch removes old dead code:
- kill off sh73180 cpu support
- get rid of broken solution engine 73180 board support

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-25 10:49:21 +09:00
Magnus Damm 347b9bdddb sh: remove old broken pint code
The code in arch/sh/kernel/cpu/irq/pint.c doesn't compile, so let's
get rid of it to make space for a future pint implementation on top
of intc.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-25 10:46:32 +09:00
Paul Mundt f0b859e3d6 sh: Reclaim beginning of P3 space for vmalloc area.
The first 1MB of P3 space was reserved and used for page colouring,
as we've reworked that to use fixmaps, we can reclaim the space and
hand it back to VMALLOC_START.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-25 10:43:47 +09:00
Adrian McMenamin eb695dbf00 sh: Fix Dreamcast DMA issues.
The current SH DMA API is somewhat broken, not correctly matching
virtual channel to the correct SH DMAC. This wasn't noticeable when
using g2 DMA for the sound driver - one channel 0 is as good as any
other! - but caused the pvr2 driver to fail.

This patch fixes the pvr2 problem and consequently fixes the sound
driver to ensure it continues to function.

Signed-off by: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-24 13:30:55 +09:00
Paul Mundt 8cf1a74305 sh: Add kmap_coherent()/kunmap_coherent() interface for SH-4.
This wires up kmap_coherent() and kunmap_coherent() on SH-4, and
moves away from the p3map_mutex and reserved P3 space, opting to
use fixmaps for colouring instead.

The copy_user_page()/clear_user_page() implementations are moved
to this, which fixes the nasty blowups with spinlock debugging
as a result of having some of these calls nested under the page
table lock.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-24 13:28:26 +09:00
Thomas Gleixner 18de5bc4c1 clockevents: fix resume logic
We need to make sure, that the clockevent devices are resumed, before
the tick is resumed. The current resume logic does not guarantee this.

Add CLOCK_EVT_MODE_RESUME and call the set mode functions of the clock
event devices before resuming the tick / oneshot functionality.

Fixup the existing users.

Thanks to Nigel Cunningham for tracking down a long standing thinko,
which affected the jinxed VAIO.

[akpm@linux-foundation.org: xen build fix]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-21 17:49:15 -07:00
Magnus Damm 56386f6424 sh: intc - add support for SH7750 and its variants
This patch converts the cpu specific 7750 setup code to use the
new intc controller. Many new vectors are added and multiple
processor variants including 7091, 7750, 7750s, 7750r, 7751 and
7751r should all have the correct vectors hooked up.

IRLM interrupts can be enabled using ipr_irq_enable_irlm() which
now is marked as __init.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 18:44:49 +09:00
Paul Mundt 339547bf5d sh: Move entry point code to .text.head.
Follow Al Viro's m68k change from l-k:

	i.e. tell modpost that entry point code (that has to be outside
	of .init.text for external reasons) is OK to refer to .init.*

Shuts up some section mismatch warnings from modpost.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 17:40:03 +09:00
Paul Mundt bf73af2314 sh: heartbeat: Shut up resource size warning.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 17:35:42 +09:00
Magnus Damm ee54505199 sh: update r2d defconfig and fix SH7751R pci compliation
This patch updates the r2d board support in a few ways:

- CPU_SUBTYPE_SH7751R is selected in the defconfig to play well
  with the r2d board Kconfig entry. Without this the defconfig
  results in no board enabled.

- Enable EARLY_PRINTK.
- Enable SH_STANDARD_BIOS
	- this works well for early printk on the r2d board.

- Add "earlyprink=bios" to the cmdline for early serial port
  output by default.

- CONFIG_SUBTYPE_SH7751R support is added to the sh-specific
  pci makefile.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 17:25:48 +09:00
Paul Mundt 98d877c487 sh: Many symbol exports for nommu allmodconfig.
allmodconfig generates a lot of interesting code, a lot of the
generated symbols we've never exported before, so this fixes
those up. Verified with both GCC3 and GCC4 toolchains.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 16:59:49 +09:00
Magnus Damm 3a353824df sh: zero terminate 8250 platform data for r2d board
struct plat_serial8250_port should contain a terminating zero entry

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 16:34:22 +09:00
Paul Mundt 6894e0a943 sh: cpufreq: Fix up the build for SH-2.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 16:03:02 +09:00
Paul Mundt fc10020292 sh: Make on-chip DMA channel selection explicit.
Currently this has a prompt to allow users to change it. There's
no reason to do this, and it has caused breakage and confusion
in the past, so remove it entirely.

We'll get rid of this when the whole driver is tidied for
the driver model.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 14:24:57 +09:00
Paul Mundt 3e7678333a sh: Fix up CPU dependencies for on-chip DMAC.
We only handle SH-3 and SH-4 at present, don't expose it to the
other CPUs.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 14:23:04 +09:00
Paul Mundt da9f0ac2f1 Merge branch 'clkfwk' 2007-07-20 13:38:49 +09:00
Paul Mundt cb5ec75b8b sh: cpufreq: clock framework support.
This gets the SH cpufreq working again. We follow the changes
in the AVR32 implementation for wrapping in to the clock framework.
CPUs that wish to use this are required to define rate rounding
primitives in order to satisfy clk_round_rate().

This works well enough for the common case, though we should
look at unifying this driver across all of the platforms that
implement clock framework support in one capacity or another.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 13:38:19 +09:00
Paul Mundt fe04d7798f sh: Support rate rounding for SH7722 FRQCR clocks.
Now that the round_rate() op is supported, hook it up on SH7722
for the FRQCR (CPU, PCLK, etc.) clocks.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 13:30:07 +09:00
Paul Mundt f6991b0456 sh: Implement clk_round_rate() in the clock framework.
This is an optional component of the clock framework. However,
as we're going to be using this in the cpufreq drivers, add
support for it to the framework.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 13:29:09 +09:00
Paul Mundt bd5f0d1c25 sh: Fix up PCI section mismatch warnings.
Flag pcibios_setup() and pcibios_fixup_bus() as __devinit.
Follows the sh64 change.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 13:22:47 +09:00
Paul Mundt 0c99adb0a6 sh: Wire up fallocate() syscall.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:27:09 +09:00
Magnus Damm 39c7aa9ea9 sh: intc - add support for 7780
This patch converts the cpu specific 7780 setup code to use the
new intc controller. Many new vectors are added and also support for
external interrupt sense configuration. So with this patch it is now
possible to configure external interrupt pins as edge or level
triggered using set_irq_type().

No external interrupts are registered by default.
Use plat_irq_setup_pins() to select between IRQ or IRL mode.

This patch also fixes the Alarm IRQ for the RTC.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:21 +09:00
Magnus Damm 680c45981a sh: intc - improve group support
This patch improves intc group support, ie it makes it possible to
group interrupts together and mask / unmask the entire group. This
also works with priorities, so setting a priority for an entire group
is also possible. This patch is needed to properly support certain
processors such as the 7780.

Fixes for NULL pointers in DECLARE_INTC_DESC() are also included.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:21 +09:00
Paul Mundt e5e3dfc80a sh: push-switch: Correct license string.
This was accidentally set as "GPLv2", whereas the kernel expects v2
to be written "GPL v2", this caused complaints regarding the use
of the platform device APIs when built as a module.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:20 +09:00
Paul Mundt 792e947a29 sh: cpufreq: Fix driver dependencies and flag as broken.
This is only supported on SH-4, so don't expose it for the other
CPUs. Additionally, it's suffered some bitrot, so add a BROKEN
dependency as well until we fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:20 +09:00
Magnus Damm 90015c8938 sh: IPR/INTC2 IRQ setup consolidation.
This patch unifies the cpu specific interrupt setup functions for
interrupt controller blocks such as ipr, intc2 and intc. There is no
point in having separate functions for each interrupt controller, so
let's clean this up.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:20 +09:00
Magnus Damm 493a358e0a sh: clean up interrupt code for solution engine 7722 board
This patch cleans up solution engine 7722 specific interrupt code.
The main purpose is to replace the mux function with use of
set_irq_chained_handler() and replace hard coded register poking
code with set_irq_type(). The board specific interrupts are also
moved to start from SE7722_FPGA_IRQ_BASE.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:20 +09:00
Magnus Damm 1b06428ee5 sh: intc - add support for 7722 processor
This patch converts the cpu specific 7722 setup code to use the
new intc controller. Many new vectors are added and also support
for external interrupt sense configuration. So with this patch
it is now possible to configure external interrupt pins as edge
or level triggered using set_irq_type().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:20 +09:00
Magnus Damm 02ab3f7079 sh: intc - shared IPR and INTC2 controller
This is the second version of the shared interrupt controller patch
for the sh architecture, fixing up handling of intc_reg_fns[].

The three main advantages with this controller over the existing
ones are:

	- Both priority (ipr) and bitmap (intc2) registers are
	  supported
	- External pin sense configuration is supported, ie edge
	  vs level triggered
	- CPU/Board specific code maps 1:1 with datasheet for
	  easy verification

This controller can easily coexist with the current IPR and INTC2
controllers, but the idea is that CPUs/Boards should be moved over
to this controller over time so we have a single code base to
maintain.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:20 +09:00
Magnus Damm 53aba19f82 sh: Fix irq assignment for uarts on sh7722
This patch contains two serial port related fixes for sh7722:
- Make sure the irqs for the first serial port is correct
- Add the second and third serial port to the platform data

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:20 +09:00
Kristoffer Ericson 4aafae27d0 sh: hd64461 tidying.
Kill off the hd64461 io.c, as all of the hd64461 users are now
using the generic I/O routines.

[ hd64461/ moved to hd64461.c by Paul ]

Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:19 +09:00
Yoshihiro Shimoda e6c972f218 sh: r7780rp: Add R8A66597 and M66592 support.
This wires up the platform devices for the USB expansion boards for
the Highlander boards.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 12:18:19 +09:00
Paul Mundt 20c2df83d2 mm: Remove slab destructors from kmem_cache_create().
Slab destructors were no longer supported after Christoph's
c59def9f22 change. They've been
BUGs for both slab and slub, and slob never supported them
either.

This rips out support for the dtor pointer from kmem_cache_create()
completely and fixes up every single callsite in the kernel (there were
about 224, not including the slab allocator definitions themselves,
or the documentation references).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 10:11:58 +09:00
Fenghua Yu 5fb7dc37dc define new percpu interface for shared data
per cpu data section contains two types of data.  One set which is
exclusively accessed by the local cpu and the other set which is per cpu,
but also shared by remote cpus.  In the current kernel, these two sets are
not clearely separated out.  This can potentially cause the same data
cacheline shared between the two sets of data, which will result in
unnecessary bouncing of the cacheline between cpus.

One way to fix the problem is to cacheline align the remotely accessed per
cpu data, both at the beginning and at the end.  Because of the padding at
both ends, this will likely cause some memory wastage and also the
interface to achieve this is not clean.

This patch:

Moves the remotely accessed per cpu data (which is currently marked
as ____cacheline_aligned_in_smp) into a different section, where all the data
elements are cacheline aligned. And as such, this differentiates the local
only data and remotely accessed data cleanly.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: <linux-arch@vger.kernel.org>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-19 10:04:44 -07:00
Nick Piggin 83c54070ee mm: fault feedback #2
This patch completes Linus's wish that the fault return codes be made into
bit flags, which I agree makes everything nicer.  This requires requires
all handle_mm_fault callers to be modified (possibly the modifications
should go further and do things like fault accounting in handle_mm_fault --
however that would be for another patch).

[akpm@linux-foundation.org: fix alpha build]
[akpm@linux-foundation.org: fix s390 build]
[akpm@linux-foundation.org: fix sparc build]
[akpm@linux-foundation.org: fix sparc64 build]
[akpm@linux-foundation.org: fix ia64 build]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ian Molton <spyro@f2s.com>
Cc: Bryan Wu <bryan.wu@analog.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Matthew Wilcox <willy@debian.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Richard Curnow <rc@rc0.org.uk>
Cc: William Lee Irwin III <wli@holomorphy.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
Cc: Chris Zankel <chris@zankel.net>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
[ Still apparently needs some ARM and PPC loving - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-19 10:04:41 -07:00
Alexey Dobriyan f284ce7269 PTRACE_POKEDATA consolidation
Identical implementations of PTRACE_POKEDATA go into generic_ptrace_pokedata()
function.

AFAICS, fix bug on xtensa where successful PTRACE_POKEDATA will nevertheless
return EPERM.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17 10:23:03 -07:00
Alexey Dobriyan 7664732315 PTRACE_PEEKDATA consolidation
Identical implementations of PTRACE_PEEKDATA go into generic_ptrace_peekdata()
function.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17 10:23:03 -07:00
Pavel Emelianov bcdcd8e725 Report that kernel is tainted if there was an OOPS
If the kernel OOPSed or BUGed then it probably should be considered as
tainted.  Thus, all subsequent OOPSes and SysRq dumps will report the
tainted kernel.  This saves a lot of time explaining oddities in the
calltraces.

Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
[ Added parisc patch from Matthew Wilson  -Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17 10:23:02 -07:00
Linus Torvalds b91cba52e9 Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6: (68 commits)
  sh: sh-rtc support for SH7709.
  sh: Revert __xdiv64_32 size change.
  sh: Update r7785rp defconfig.
  sh: Export div symbols for GCC 4.2 and ST GCC.
  sh: fix race in parallel out-of-tree build
  sh: Kill off dead mach.c for hp6xx.
  sh: hd64461.h cleanup and added comments.
  sh: Update the alignment when 4K stacks are used.
  sh: Add a .bss.page_aligned section for 4K stacks.
  sh: Don't let SH-4A clobber SH-4 CFLAGS.
  sh: Add parport stub for SuperIO ports.
  sh: Drop -Wa,-dsp for DSP tuning.
  sh: Update dreamcast defconfig.
  fb: pvr2fb: A few more __devinit annotations for PCI.
  fb: pvr2fb: Fix up section mismatch warnings.
  sh: Select IPR-IRQ for SH7091.
  sh: Correct __xdiv64_32/div64_32 return value size.
  sh: Fix timer-tmu build for SH-3.
  sh: Add cpu and mach links to CLEAN_FILES.
  sh: Preliminary support for the SH-X3 CPU.
  ...
2007-07-16 10:32:02 -07:00
Heiko Carstens 608e261968 generic bug: use show_regs() instead of dump_stack()
The current generic bug implementation has a call to dump_stack() in case a
WARN_ON(whatever) gets hit.  Since report_bug(), which calls dump_stack(),
gets called from an exception handler we can do better: just pass the
pt_regs structure to report_bug() and pass it to show_regs() in case of a
warning.  This will give more debug informations like register contents,
etc...  In addition this avoids some pointless lines that dump_stack()
emits, since it includes a stack backtrace of the exception handler which
is of no interest in case of a warning.  E.g.  on s390 the following lines
are currently always present in a stack backtrace if dump_stack() gets
called from report_bug():

 [<000000000001517a>] show_trace+0x92/0xe8)
 [<0000000000015270>] show_stack+0xa0/0xd0
 [<00000000000152ce>] dump_stack+0x2e/0x3c
 [<0000000000195450>] report_bug+0x98/0xf8
 [<0000000000016cc8>] illegal_op+0x1fc/0x21c
 [<00000000000227d6>] sysc_return+0x0/0x10

Acked-by: Jeremy Fitzhardinge <jeremy@goop.org>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Kyle McMartin <kyle@parisc-linux.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-16 09:05:51 -07:00
Kristoffer Ericson e509ac4bbc sh: sh-rtc support for SH7709.
Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-16 09:51:39 +09:00
Paul Mundt 075fc19bde sh: Revert __xdiv64_32 size change.
It's only __div64_32 that needs the fix, __xdiv64_32 behaves as
expected with the original size.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-13 12:27:13 +09:00
Paul Mundt 2f5a5dc0c1 sh: Update r7785rp defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-13 09:30:57 +09:00
Paul Mundt 2414b86d21 sh: Export div symbols for GCC 4.2 and ST GCC.
GCC 4.2 can emit integer variants of the FP division routines, so
these need to be exported in order to keep the modules happy.

4.1.x versions of the ST compiler have these things backported,
and so also generate these symbols (whereas vanilla gcc 4.1.x
does not), so handle the __GNUC_STM_RELEASE__ case to accomodate
updated versions of the 4.1.x toolchain.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-13 09:30:31 +09:00
Erik Johansson 8cb661d6a4 sh: fix race in parallel out-of-tree build
Depending on which of the three dependencies for archprepare (in
arch/sh/Makefile) get built first, the directory include/asm-sh may or
may not exist when the maketools target is built. If the directory does
not exist, awk will fail to generate machtypes.h. This patch fixes this
by creating the directory before awk is executed.

Signed-off-by: Erik Johansson <erik.johansson@motorola.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-12 16:37:00 +09:00
Kristoffer Ericson 0caf3ead51 sh: Kill off dead mach.c for hp6xx.
Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-12 10:47:08 +09:00
Robert P. J. Day bdf4fa536b sh: Update the alignment when 4K stacks are used.
Use the newly added .bss.page_aligned section for aligning the stacks
rather than THREAD_SIZE.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-12 10:41:52 +09:00
Paul Mundt e181127a7a sh: Add a .bss.page_aligned section for 4K stacks.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-12 10:40:36 +09:00
Paul Mundt aab1b16a61 sh: Don't let SH-4A clobber SH-4 CFLAGS.
Older compilers don't support the -m4a{,nofpu} flags, which has the
side-effect of allowing FP operations to be emitted. Switch this to
incremental tuning, so we at least have -m4-nofpu as a fallback for
the gcc3 toolchains.

Without this, certain modules emit references to __udivsi3_i4 and
__sdivsi3_i4.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-12 09:48:54 +09:00
Paul Mundt 5296307de6 sh: Drop -Wa,-dsp for DSP tuning.
We already hand off the proper ISA variant with the dsp specifier
appended, so we don't need to explicitly set -dsp. This causes some
confusion with certain toolchains that are restricted to -dsp family
opcodes artificially.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-07 07:25:56 +09:00
Paul Mundt ac6b9f28d8 sh: Update dreamcast defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-07 04:09:02 +09:00
Paul Mundt 989e5ab3e8 sh: Select IPR-IRQ for SH7091.
Fixes a compile failure for the Dreamcast.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-07 03:36:06 +09:00
Paul Mundt 04c7d9579f sh: Correct __xdiv64_32/div64_32 return value size.
These should be returning a uint32_t, whereas they were erroneously
returning a u64 before. As the register sizes are 32-bits, this doesn't
really make a lot of sense.

Reported-by: Katsuya MATSUBARA <matsu@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-06 10:58:04 +09:00
Paul Mundt 880dec1007 sh: Add cpu and mach links to CLEAN_FILES.
These weren't being cleaned up, so add them to the CLEAN_FILES.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-06 10:22:59 +09:00
Paul Mundt 70876facfa Merge branch 'x3' 2007-06-20 18:29:27 +09:00
Paul Mundt 2b1bd1ac5d sh: Preliminary support for the SH-X3 CPU.
This adds basic support for UP SH-X3.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-20 18:27:10 +09:00
Paul Mundt 027e56e685 sh: Hook up hard_smp_processor_id() for INTC2 block.
We need to know the CPU ID in order to calculate the mask and ack
registers effectively. Stub this in for UP.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-20 18:23:49 +09:00
Paul Mundt b2309d6840 sh: Update se7722 defconfig.
Hook up the multi-node stuff for the SE7722.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-20 18:09:10 +09:00
Paul Mundt 824e55f95f sh: Fix up cf-enabler dependency for SE boards.
This was using CONFIG_SH_SOLUTION_ENGINE, where we really wanted
CONFIG_SOLUTION_ENGINE. While we're at it, move the whole CF
enabler mess somewhere better suited.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-20 18:01:52 +09:00
Paul Mundt 3aeb884b4e sh: Handle -ERESTART_RESTARTBLOCK for restartable syscalls.
The current implementation only handles -ERESTARTNOHAND, whereas we
also need to handle -ERESTART_RESTARTBLOCK in the handle_signal()
case for restartable system calls.

As noted by Carl:

This fixes the LTP test nanosleep03 - the current kernel causes
-ERESTART_RESTARTBLOCK to reach user space rather than the correct
-EINTR.

Reported-by: Carl Shaw <shaw.carl@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-19 12:33:21 +09:00
Paul Mundt 0630e45c88 sh: Check oops_may_print() in unhandled fault.
Only print out pgd/pte data in the oops path if oops_may_print()
holds true. Follows the i386 implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-18 19:02:47 +09:00
Paul Mundt 5527398218 sh: oops_enter()/oops_exit() in die().
As Russell helpfully pointed out on linux-arch:

	http://marc.info/?l=linux-arch&m=118208089204630&w=2

We were missing the oops_enter/exit() in the sh die() implementation.
As we do support lockdep, it's beneficial to add these calls so lockdep
properly disables itself in the die() case.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-18 18:57:13 +09:00
Kaz Kojima 69a331470f sh: Fix restartable syscall arg5 clobbering.
We use R0 as the 5th argument of syscall.  When the syscall restarts
after signal handling, we should restore the old value of R0.
The attached patch does it. Without this patch, I've experienced random
failures in the situation which signals are issued frequently.

Signed-off-by: Kaz Kojima <kkojima@rr.iij4u.or.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-18 10:08:20 +09:00
Paul Mundt eee4c4694f sh: Update SH-2/SH-2A defconfigs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-15 19:45:33 +09:00
Magnus Damm 68abdbbb03 sh: rework ipr code
This patch reworks the ipr code by grouping the offset array together
with the ipr_data structure in a new data structure called ipr_desc.
This new structure also contains the name of the controller in struct
irq_chip. The idea behind putting struct irq_chip in there is that we
can use offsetof() to locate the base addresses in the irq_chip
callbacks. This strategy has much in common with the recently merged
intc2 code.

One logic change has been made - the original ipr code enabled the
interrupts by default but with this patch they are all disabled by
default.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-15 18:56:19 +09:00
Paul Mundt 50f63f2518 sh: Only support PMB for SH-X cores.
We don't have a PMB for SH-X2 or later, so only enable it for
the few CPUs that support it. Fixes up the boot for SH4AL-DSP.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-15 18:30:42 +09:00
Magnus Damm d619500aed sh: rework intc2 code
The shared intc2 code currently contains cpu-specific #ifdefs.
This is a tad unclean and it prevents us from using the shared code
to drive board-specific irqs on the se7780 board.

This patch reworks the intc2 code by moving the base addresses of
the intc2 registers into struct intc2_desc. This new structure also
contains the name of the controller in struct irq_chip. The idea
behind putting struct irq_chip in there is that we can use offsetof()
to locate the base addresses in the irq_chip callbacks.

One logic change has been made - the original shared intc2 code
enabled the interrupts by default but with this patch they are all
disabled by default.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-15 10:41:54 +09:00
Paul Mundt d3efbdd6c5 sh: Fix up the math-emu build.
math-emu wasn't converted for the trap_no/errno_code changes,
get it building again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-11 15:57:42 +09:00
Paul Mundt a1e2833d13 sh: Kill off broken dma page ops.
There's no point in keeping these around, they've been broken
for some time, and the dmaenging/async_tx framework provides a
far more reasonable interface.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-11 15:56:31 +09:00
Paul Mundt 9f9a5de466 sh: Fixup misaligned data for sh2 lockdep.
lockdep/irqflags tracing on SH-2 ends up with a misaligned
branch, fix it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-11 15:33:44 +09:00
Paul Mundt 357d59469c sh: Tidy up dependencies for SH-2 build.
SH-2 can presently get in to some pretty bogus states, so
we tidy up the dependencies a bit and get it all building
again.

This gets us a bit closer to a functional allyesconfig
and allmodconfig, though there are still a few things to
fix up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-11 15:32:07 +09:00
Yoshihiro Shimoda 54039591ce sh: Provide a defconfig for R7780MP.
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-11 10:26:56 +09:00
Paul Mundt b9601c5e59 sh: Kill off dead SH7604 support.
This was added during 2.5.x, but was never moved along. This
can easily be resurrected if someone has one they wish to work
with, but it's not worth keeping around in its current form.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 11:55:28 +09:00
Paul Mundt 33d63bd83b sh: memory hot-add for sparsemem users support.
This enables simple hotplug support for sparsemem users. Presently
this only permits memory being added in to node 0 on ZONE_NORMAL.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:51 +00:00
Paul Mundt 05a117847b sh: Fix up cpu to node mapping in sysfs.
Currently cpu_to_node() is always 0 in the UP case, though
we do want to have the CPU association linked in under sysfs
even in the cases where we're only on a single CPU.

Fix this up, so we have the cpu0 link on all of the available
nodes that don't already have a CPU link of their own.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:50 +00:00
Paul Mundt 5bbeafca8d sh: Fix the SH7722 flatmem build.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:50 +00:00
Paul Mundt 1300b1b177 sh: Make NUMA depend on sparsemem.
The only platforms that are supporting NUMA are doing so via
sparsemem, so update the dependency.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:49 +00:00
Paul Mundt 520588f47f sh: URAM node support for SH7722.
This adds the URAM block on SH7722 as a separate node.
Sparsemem is required for this, or it can simply be disabled
by explicitly selecting a flatmem model.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:49 +00:00
Paul Mundt b241cb0c88 sh: Support for multiple nodes.
This adds basic support for multiple nodes on SH machines.
This is primarily useful for boards with many different
memory blocks that are otherwise unused (SH7722/SH7785 URAM
and so forth).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:49 +00:00
Paul Mundt 07cbb41b53 sh: Use asm/sections.h for linker section symbols.
Kill off a bunch of externs, and use sections.h instead..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:48 +00:00
Paul Mundt 2de212ebd8 sh: Fix up max_zone_pfns[] with multiple nodes.
Currently using multiple nodes tramples the ZONE_NORMAL
max low pfn, tidy up the logic a bit to get it all working
as expected.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:48 +00:00
Paul Mundt f11b71e657 sh: Wire up mempolicy syscalls.
Wire up mbind and get/set_mempolicy() in their reserved places.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:47 +00:00
Paul Mundt b66d51cb80 sh: Tidy compiler warnings for SH-2A build.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:46 +00:00
Paul Mundt 6240d92f2f sh: Wrap CPU tuning through cc-option.
Some compilers don't support the explicit CPU tuning, while binutils
is still able to handle the special subtype-specific opcodes. Make
the CFLAG optional, falling back on the compiler default if nothing
better exists.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:46 +00:00
Paul Mundt fa1ec92e1d sh: Enable IPR-IRQ for SH7206.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:46 +00:00
Paul Mundt 2826fa61c1 sh: Mark sparsemem regions present earlier.
We have to call in to sparse_memory_present_with_active_regions()
earlier in order for sparsemem to be happy. This was being called
too late, and was causing troubles with the platforms that needed
to enable sparsemem.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:45 +00:00
Paul Mundt d22d9b3a1d sh: Register multiple nodes in topology_init().
If we have multiple nodes, register these at topology_init() time.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:45 +00:00
Paul Mundt 91e656aacf sh: Allow for bootmem debug support.
Handy for debugging bootmem troubles.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:43 +00:00
Paul Mundt dfbb904280 sh: sparsemem support.
This implements basic sparsemem support for SH. Presently this only
uses static sparsemem, and we still permit explicit selection of
flatmem. Those boards that want sparsemem can select it as usual.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:43 +00:00
Nobuhiro Iwamatsu 678597be5e sh: Add L-BOX RE2 to mach-types.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:42 +00:00
Takashi YOSHII 3a3c60fc0b sh: Align .machvec.init section on a 4-byte boundary.
.machvec.init can be misaligned with the recent machvec changes,
forcibly align it on the boundary that it expects, as before.

Signed-off-by: Takashi YOSHII <takashi.yoshii.ze@hitachi.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:41 +00:00
Paul Mundt 05627486ab sh: Fix SH-4 CPU selects.
Now that select no longer works for selecting the "closest" CPU,
we have to explicitly reference the precise sub-type in the few
places where it actually matters (presently only setup code and
some legacy sh-sci cruft).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:40 +00:00
Paul Mundt fd8f20e8e2 sh: Rip out special unknown machvec.
This kills off the BareCPU board as a "special" machvec, rather,
we leave this as a default for when no other vector is available,
or when we want to use it in combination with other vectors for
testing with generic ops. As sh_mv is copied out anyways (or
overloaded when an alternate vector is explicitly selected), this
doesn't consume any additional memory.

The generic machvec can be forcibly selected with sh_mv=generic,
or by not having any other boards enabled.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:40 +00:00
Paul Mundt 82f81f4784 sh: Kill off machvec aliases.
We now throw all of the machvecs in to .machvec.init and either
select one on the command line, or copy out the first (and
usually only) one to sh_mv. The rest are freed as usual.

This gets rid of all of the silly sh_mv aliasing and makes the
selection explicit rather than link-order dependent.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:39 +00:00
Paul Mundt 25f8151bdc sh: Get multiple boards in one image working again.
This tidies up the build rules and permits multiple boards to be
linked in to the same kernel. The earlier Kconfig work ensures that
the CPU configuration is consistent across the boards, as this is
the only thing that we can't do dynamically.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:39 +00:00
Paul Mundt ba36197cf4 sh: Fixup cmdline handling from machvec changes.
The command line wasn't being saved off properly after the machvec
changes went in, fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:38 +00:00
Paul Mundt f3d2229852 sh: Rework CPU/board dependencies.
This was a big mess, rework the logic a bit so that we constrain
to a particular subtype and figure out the board support based
on that. This makes building subtype specific kernels supporting
multiple boards possible again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:38 +00:00
Paul Mundt 882c12c4e1 sh: Shut up SH2-DSP compile warnings.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:37 +00:00
Paul Mundt 9655ad03af sh: Fixup machvec support.
This fixes up much of the machvec handling, allowing for it to be
overloaded on boot. Making practical use of this still requires
some Kconfig munging, however.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:37 +00:00
Paul Mundt e08f457c7c sh: __user annotations for __get/__put_user().
This adds in some more __user annotations. These weren't being
handled properly in some of the __get_user and __put_user paths,
so tidy those up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:36 +00:00
Paul Mundt 7a302a9674 sh: Split out CPU topology initialization.
Split out the CPU topology initialization to a separate file,
and switch it to a percpu type, rather than an NR_CPUS array.

At the same time, switch to only registering present CPUs,
rather than using the possible CPU map.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-08 02:43:35 +00:00
Paul Mundt 9a412847fb sh: Fix se73180 platform device registration.
Copy and paste error from se7343, fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-04 11:07:23 +09:00
Paul Mundt 0fd1475414 sh: ioremap() through PMB needs asm/mmu.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-04 10:58:23 +09:00
Paul Mundt 63dfc3c77b sh: voyagergx: Fix build warnings.
pr_debug() was using a %x on an unsigned long, which was making
the build a bit noisy.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-04 10:53:00 +09:00
Paul Mundt 907c9d7004 sh: Fix SH4-202 clock fwk set_rate() mismatch.
With the SH7722 changes, ->set_rate() also takes an algo_id,
SH4-202 was overlooked when this change went in.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-04 10:51:59 +09:00
Paul Mundt 8b19a7ce56 sh: microdev: Fix compile warnings.
irq.c needs linux/interrupt.h.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-04 10:50:42 +09:00
Paul Mundt c596b1a380 sh: Fix in_nmi symbol build error.
If CONFIG_KGDB_NMI is disabled, we're left with a stray in_nmi
reference that can't be resolved. Move the symbol under the ifdef,
too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-06-04 10:39:50 +09:00
Andrew Morton 4e1c208420 sh: support older gcc's
Make my version of gcc happy.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-31 13:48:57 +09:00
Evgeniy Polyakov 66c5227ecd sh: trivial build cleanups.
Several errors were spotted during building for custom config (SMP
included). Although SMP still does not compile (no ipi and
__smp_call_function) and does not work, this looks a bit cleaner.
Some other errors obtained via gcc-4.1.0 build.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-31 13:46:21 +09:00
Manuel Lauss f75522cea1 sh: Fix vsyscall build failure.
CC      arch/sh/kernel/vsyscall/vsyscall.o
a/arch/sh/kernel/vsyscall/vsyscall.c: In function 'arch_setup_additional_pages':
a/arch/sh/kernel/vsyscall/vsyscall.c:63: error: dereferencing pointer to incomplete type
a/arch/sh/kernel/vsyscall/vsyscall.c:67: error: dereferencing pointer to incomplete type
a/arch/sh/kernel/vsyscall/vsyscall.c:82: error: dereferencing pointer to incomplete type
a/arch/sh/kernel/vsyscall/vsyscall.c:85: error: dereferencing pointer to incomplete type
a/arch/sh/kernel/vsyscall/vsyscall.c: In function 'arch_vma_name':
a/arch/sh/kernel/vsyscall/vsyscall.c:91: error: dereferencing pointer to incomplete type

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-31 13:44:55 +09:00
Manuel Lauss bdff33ddd9 sh: Trivial fix for dma-api compile failure.
Trivial fix for arch/sh/drivers/dma/dma-api.c compile failure:

  CC      arch/sh/drivers/dma/dma-api.o
a/arch/sh/drivers/dma/dma-api.c: In function 'dma_wait_for_completion':
a/arch/sh/drivers/dma/dma-api.c:233: error: 'TASK_UNINTERRUPTIBLE' undeclared (first use in this function)
a/arch/sh/drivers/dma/dma-api.c:233: error: (Each undeclared identifier is reported only once
a/arch/sh/drivers/dma/dma-api.c:233: error: for each function it appears in.)
a/arch/sh/drivers/dma/dma-api.c:233: warning: implicit declaration of function 'schedule'

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-31 13:44:17 +09:00
Takashi YOSHII 370ac91aab sh: Fix pcrel too far for in_nmi label.
Add lost in_nmi definition to solve pcrel too far.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-31 13:42:21 +09:00
Paul Mundt ddd43b063d sh: section mismatch fixes for system timer.
Fix up a couple of section mismatch warnings regarding sys_timer.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-23 12:24:32 +09:00