Commit graph

544 commits

Author SHA1 Message Date
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
Linus Torvalds cdb7532f7b 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:
  sh: Fix dreamcast build for IRQ changes.
  sh: Fix clock multiplier on SH7722.
  sh: Wire up kdump crash kernel exec in die().
  sh: sr.bl toggling around idle sleep.
  sh: disable genrtc support.
  fs: Kill sh dependency for binfmt_flat.
  sh: Disable psw support for R7785RP.
  sh: Fix page size alignment in __copy_user_page().
  sh: Fix up various compile warnings for SE boards.
  sh: Wire up signalfd/timerfd/eventfd syscalls.
  sh: revert addition of page fault notifiers
  spelling fixes: arch/sh/
  input: hp680_ts compile fixes.
  sh: landisk: Header cleanups.
  sh: landisk: rtc-rs5c313 support.
  sh: Kill off pmb slab cache destructor.
  sh: Fix up psw build rules for r7780rp.
  sh: Shut up compiler warnings in __do_page_fault().
2007-05-22 17:26:18 -07:00
dmitry pervushin dfbbbe9295 sh: Fix clock multiplier on SH7722.
This fixes up the master clock multiplier and initial rate
propagation for the SH7722 clocks.

Signed-off-by: dmitry pervushin <dimka@nomadgs.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-21 14:34:45 +09:00
Paul Mundt e113276624 sh: Wire up kdump crash kernel exec in die().
Now that we have the basic kdump support in place, add it in to
die() so we can enter the crash kernel automatically.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-21 14:34:37 +09:00
Paul Mundt f3a9022fd1 sh: sr.bl toggling around idle sleep.
As pointed out by Saito-san, without the sr.bl manipulation we can
occasionally hit delays in the idle loop due to interrupt handling, so
ensure that interrupts are blocked before going to sleep.

At the same time, we throw in TIF_POLLING_NRFLAG for the !hlt_counter
case (primarily used by the ST-40 parts).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-21 14:34:25 +09:00
Paul Mundt 9af9a413d2 sh: Disable psw support for R7785RP.
While R7780RP and R7780MP support this, R7785RP does not.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-21 14:33:17 +09:00
Paul Mundt 0d08b5fb37 sh: Fix page size alignment in __copy_user_page().
SH-3 comes up with the PAGE_SIZE on a misaligned boundary:

arch/sh/mm/copy_page.S: Assembler messages:
arch/sh/mm/copy_page.S:132: Warning: misaligned data

fix it up with explicit alignment.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-21 14:33:13 +09:00
Paul Mundt 27641dee99 sh: Fix up various compile warnings for SE boards.
- setup-sh7750.c only defines the sh7751_ipr_map when building
  with SH7751 support.

- 7722 Solution Engine was missing a mach-type entry, causing
  the macro in cf-enabler to be undefined.

- arch/sh/mm/init.c needs linux/pagemap.h.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-21 14:32:47 +09:00
Paul Mundt 26bbfda8b1 sh: Wire up signalfd/timerfd/eventfd syscalls.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-21 14:32:14 +09:00
Christoph Hellwig fce692e798 sh: revert addition of page fault notifiers
Just at the time you added them on sh we're removing them from other
architectures. As there's no user yet this patch just removes them
completely. Once you actually have a kprobes patch it should follow
the direct call to kprobes_fault_handler model that powerpc, s390 and
sparc64 employ in 2.6.22-rc1 and that I'm updating other architectures
to.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-21 14:32:10 +09:00
Simon Arlott e868d61272 spelling fixes: arch/sh/
Spelling fixes in arch/sh/.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-21 14:31:39 +09:00
Sam Ravnborg ca967258b6 all-archs: consolidate .data section definition in asm-generic
With this consolidation we can now modify the .data
section definition in one spot for all archs.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2007-05-19 09:11:57 +02:00
Sam Ravnborg 7664709b44 all-archs: consolidate .text section definition in asm-generic
Move definition of .text section to asm-generic.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2007-05-19 09:11:57 +02:00
kogiidena ad47c12b35 sh: landisk: rtc-rs5c313 support.
Add the rs5c313 platform device to the landisk setup code.

Signed-off-by: kogiidena <kogiidena@eggplant.ddo.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-14 09:18:34 +09:00
Paul Mundt 38c425f69c sh: Kill off pmb slab cache destructor.
This is the last remaining slab destructor in the kernel, which
we kill off and move the resultant list tracking logic up to
the pmb_alloc()/pmb_free() paths.

As Christoph Lameter pointed out, it's potentially unsafe to be
taking the list lock in the destructor anyways, so this is also
more fundamentally correct.

With this in place, we're all set for killing off slab destructors
from the kernel entirely.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-14 09:18:34 +09:00
Paul Mundt 0facbe3a34 sh: Fix up psw build rules for r7780rp.
When reordering the Makefile rules, the psw support was being
clobbered. Fix it up so it's linked in again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-14 09:18:34 +09:00
Paul Mundt b8947444a7 sh: Shut up compiler warnings in __do_page_fault().
GCC doesn't seem to be able to figure this one out for
itself, so just shut it up..

  CC      arch/sh/mm/fault.o
arch/sh/mm/fault.c: In function '__do_page_fault':
arch/sh/mm/fault.c:288: warning: 'ptl' may be used uninitialized in this function

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-14 09:18:34 +09:00
Linus Torvalds d84c4124c4 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:
  sh: Fix stacktrace simplification fallout.
  sh: SH7760 DMABRG support.
  sh: clockevent/clocksource/hrtimers/nohz TMU support.
  sh: Truncate MAX_ACTIVE_REGIONS for the common case.
  rtc: rtc-sh: Fix rtc_dev pointer for rtc_update_irq().
  sh: Convert to common die chain.
  sh: Wire up utimensat syscall.
  sh: landisk mv_nr_irqs definition.
  sh: Fixup ndelay() xloops calculation for alternate HZ.
  sh: Add 32-bit opcode feature CPU flag.
  sh: Fix PC adjustments for varying opcode length.
  sh: Support for SH-2A 32-bit opcodes.
  sh: Kill off redundant __div64_32 symbol export.
  sh: Share exception vector table for SH-3/4.
  sh: Always define TRAPA_BUG_OPCODE.
  sh: __GFP_REPEAT for pte allocations, too.
  rtc: rtc-sh: Fix up dev_dbg() warnings.
  sh: generic quicklist support.
2007-05-09 13:08:20 -07:00
Paul Mundt a3cf4ea872 sh: Fix stacktrace simplification fallout.
When the stacktrace simplification changes went in the function
definition on SH got skipped, fix it up so things build again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-09 18:55:14 +09:00
Manuel Lauss fc467a2623 sh: SH7760 DMABRG support.
The DMABRG is a special DMA unit within the SH7760 which does data
transfers from main memory to Audio units and USB shared memory.
It has 3 IRQ lines which generate 10 events, which have to be masked
unmasked and acked in a single 32bit register. It works independently
from the tradition SH DMAC, but blocks usage of DMAC channel 0.

This patch adds 2 functions to associate callbacks with DMABRG events
and initialization.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-09 17:36:15 +09:00
Paul Mundt 57be2b484a sh: clockevent/clocksource/hrtimers/nohz TMU support.
This adds basic support for clockevents and clocksources,
presently only implemented for TMU-based systems (which
are the majority of SH-3 and SH-4 systems).

The old NO_IDLE_HZ implementation is also dropped completely,
the only users of this were on TMU-based systems anyways.

More work needs to be done to generalize the TMU handling,
in that the current implementation is rather tied to the
notion of TMU0 and TMU1 utilization.

Additionally, as more SH timers switch over to this scheme,
we'll be able to gut most of the remaining system timer
infrastructure that existed before.

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