Commit Graph

1519 Commits (9fa8cfe706f9c20067c042a064999d5825a35330)

Author SHA1 Message Date
Paul Mundt 1bec157a1f sh: Force pending restarted system calls to return -EINTR.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-24 14:37:35 +09:00
Nobuhiro Iwamatsu aa88f169d6 sh: ap325rxa: create CPLD data area in mtd
AP320 and AP325RXA has CPLD data in NOR Flash.
If this area erased, this board can not boot.
This patch create CPLD data area and set writeable mask bit.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-24 13:57:42 +09:00
Paul Mundt e7ab3cd251 sh: Add FPU registers to regset interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-21 19:04:55 +09:00
Paul Mundt 4b4cf7595a sh: Add missing asm/ftrace.h.
This was missed with the ftrace support commit.. check it in now.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-21 17:17:53 +09:00
Paul Mundt 9d2b1f81dd sh: ftrace support.
This adds support for ftrace to SH. This only includes CONFIG_FTRACE,
and does not handle dynamic ftrace presently.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-21 16:43:45 +09:00
Paul Mundt 3d58695edb sh: Trivial trace_mark() instrumentation for core events.
This implements a few trace points across events that are deemed
interesting. This implements a number of trace points:

	- The page fault handler / TLB miss
	- IPC calls
	- Kernel thread creation

The original LTTng patch had the slow-path instrumented, which
fails to account for the vast majority of events. In general
placing this in the fast-path is not a huge performance hit, as
we don't take page faults for kernel addresses.

The other bits of interest are some of the other trap handlers, as
well as the syscall entry/exit (which is better off being handled
through the tracehook API). Most of the other trap handlers are corner
cases where alternate means of notification exist, so there is little
value in placing extra trace points in these locations.

Based on top of the points provided both by the LTTng instrumentation
patch as well as the patch shipping in the ST-Linux tree, albeit in a
stripped down form.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-21 13:56:39 +09:00
Paul Mundt 8f2baee280 sh: Kill off duplicate page fault notifiers in slow path.
We already have hooks in place in the __do_page_fault() fast-path,
so kill them off in the slow path.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-21 12:11:25 +09:00
Paul Mundt 887f1ae3bc sh: Look up the trap vector for the page fault notifier.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-21 12:06:43 +09:00
Paul Mundt 4c59e2942e sh: Move lookup_exception_vector() out to asm/system_32.h.
There are other places where we want to have access to the trap/exception
number, so move out the lookup_exception_vector() helper. While we're at
it, refactor it slightly to return the vector instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-21 12:00:23 +09:00
Luca Santini 347cd34f4b sh: edosk7760: Correct size of bootloader flash partition.
This is 256K instead of 1M.

[ Converted to use asm/sizes.h. -- PFM ]

Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-21 10:32:29 +09:00
Paul Mundt d3ea00a36d sh: Add a few more definitions to asm/sizes.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-21 10:31:57 +09:00
Paul Mundt 837c946aad sh: Copy in asm/sizes.h helper from ARM.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-21 10:24:18 +09:00
Paul Mundt c15c5f8c2b sh: Support kernel stacks smaller than a page.
This follows the powerpc commit f6a616800e
'[POWERPC] Fix kernel stack allocation alignment'.

SH has traditionally forced the thread order to be relative to the page
size, so there were never any situations where the same bug was
triggered by slub. Regardless, the usage of > 8kB stacks for the larger
page sizes is overkill, so we switch to using slab allocations there,
as per the powerpc change.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-20 20:21:33 +09:00
Paul Mundt b817f7e020 sh: Disable 4kB stacks when using PAGE_SIZE_64KB.
This combination triggers a divide by zero in kernel/fork.c when
calculating the initial max_threads value:

	max_threads = mempages / (8 * THREAD_SIZE / PAGE_SIZE);

Simply disable 4K stacks on 64kB PAGE_SIZE to work around this,
as it's not a terribly useful combination to begin with.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-20 20:16:35 +09:00
Paul Mundt 2194478157 sh: HAVE_IOREMAP_PROT depends on MMU.
HAVE_IOREMAP_PROT enables an unconditional reference to
generic_access_phys(), which remains undefined in the nommu case.
As there's no point in supporting this there anyways, simply fix
up the dependency.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-17 23:26:44 +09:00
Paul Mundt b406efefd5 sh: Fix up headers_check regression.
linux/mmzone.h isn't exported, kill it off from asm/setup.h and simply
deal with it in the places that have a dependency instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-17 23:24:59 +09:00
Paul Mundt 81b669952e sh: Consolidate struct sh_cpuinfo definitions across _32/_64 split.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-17 23:24:02 +09:00
Paul Mundt 8a80a5e9e8 sh: Fix up signal_64 conflicting handle_signal() definition.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-17 23:14:36 +09:00
Paul Mundt b85641bdde sh: Make memory hot-add and hot-remove depend on MMU.
Cleans up link numerous build issues with page migration and so on when
enabled on nommu builds.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-17 23:13:27 +09:00
Paul Mundt b3d765f5df sh: Fix up fpu emu build.
The addition of the kprobes code pushed down a variable declaration,
clean it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-17 23:12:11 +09:00
Paul Mundt 5a89f1adbc sh: latencytop support.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-13 01:44:03 +09:00
Paul Mundt 0e660d2d43 sh: Tidy up ELF core dumps.
These have been using overrides for ELF_CORE_COPY_TASK_REGS and
ELF_CORE_COPY_FPREGS while the generic versions can be used instead.
Presently the pt_regs are also duplicated across elf_core_copy_regs()
and elf_core_copy_task_regs(), this switches to simply copying out
through elf_core_copy_regs() instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 23:27:46 +09:00
Paul Mundt 72461997c3 sh: Check SR.DSP bit for DSP regset validity.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 22:56:35 +09:00
Paul Mundt f9540ececa sh: Add missing task_user_regset_view() definition.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 22:42:43 +09:00
Paul Mundt 5dadb34394 sh: Add DSP registers to regset interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 22:42:10 +09:00
Paul Mundt 6bff1592d8 sh: Fix up NUMA build error with se7722_defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 22:41:30 +09:00
Paul Mundt 3231739d97 sh: Enable HAVE_ARCH_TRACEHOOK.
Now that the rest of the support requirements are out of the way, finally
enable support for tracehook.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 22:13:36 +09:00
Paul Mundt fb4f87a2f0 sh: Provide the asm/syscall.h interface, needed by tracehook.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 22:13:13 +09:00
Paul Mundt 9996b42ac0 sh: provide user_stack_pointer(), needed for tracehook support.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 22:11:36 +09:00
Paul Mundt f8b890ab4c sh: Flag T-bit for syscall restart.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 22:08:20 +09:00
Paul Mundt cb700aa4f1 sh: ioremap_prot support.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 20:41:05 +09:00
Paul Mundt 934135c19d sh: ptrace: Introduce user_regset interface for gp regs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 19:52:36 +09:00
Paul Mundt 0955874846 sh: Provide a fixed UTS_MACHINE definition for sh64.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 18:58:28 +09:00
Luca Santini 1b582d19ce sh: update edosk7760 defconfig for physmap-flash.
Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 18:08:01 +09:00
Luca Santini 4018ffcfdf sh: edosk7760 physmap-flash support.
Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-12 18:07:16 +09:00
roel kluin b21a910435 sh: intc_prio_data() test before subtraction on unsigned
bit is unsigned, so test before subtraction

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-10 12:01:46 +09:00
Paul Mundt 6eb2139b3d sh: kprobes: kretprobe_trampoline needs to be global.
Needed by CONFIG_TRACING.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-09 08:13:28 +09:00
Paul Mundt 61098a0866 sh: Add R2D+ defconfig for qemu system emulator.
This adds a defconfig for the R2D+ target in the qemu system emulator.
Eventually it will be possible to simply use the r2d+ defconfig as it is.

Provided by Shin-ichiro KAWASAKI.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-09 06:15:47 +09:00
Manfred Spraul e545a6140b kernel/cpu.c: create a CPU_STARTING cpu_chain notifier
Right now, there is no notifier that is called on a new cpu, before the new
cpu begins processing interrupts/softirqs.
Various kernel function would need that notification, e.g. kvm works around
by calling smp_call_function_single(), rcu polls cpu_online_map.

The patch adds a CPU_STARTING notification. It also adds a helper function
that sends the message to all cpu_chain handlers.

Tested on x86-64.
All other archs are untested. Especially on sparc, I'm not sure if I got
it right.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-09-08 19:25:24 +02:00
Paul Mundt cf204fa797 sh: Derive calibrate_delay lpj from clk fwk.
All CPUs must have a sensible cpu_clk definition these days, which we can
safely use for deriving the preset loops_per_jiffy. The only odd one out
is SH-5, which hasn't been hammered in to the framework yet.

Based on the ST patch.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Carl Shaw <carl.shaw@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 20:47:42 +09:00
Paul Mundt 4eb5845d6c sh: kprobes: __kprobes annotations and formatting cleanups.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 18:22:47 +09:00
Paul Mundt 734db3770d sh: kprobes: Fix up race against probe point removal.
Handle a corner case where another CPU or debugger removes the probe
point from underneath us.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 18:15:55 +09:00
Paul Mundt 247bc6d2ae sh: kprobes: Fix up a preemption imbalance on jprobe return.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 18:14:50 +09:00
Paul Mundt ee386de774 sh: kprobes: Default to NOTIFY_DONE for unhandled debug traps.
Presently this is doing a force_sig() SIGTRAP, which is already taken
care of in the generic code if no one asserts NOTIFY_STOP. Switch the
default return to NOTIFY_DONE in the case of unhandled traps, so that
the same trap may pass through to other users on the same die chain.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 18:12:33 +09:00
Paul Mundt 174b5c9923 sh: kprobes: Use trapa #0x3a for breakpoint trap.
Not all parts support trapa #0xff, so use something within the debug trap
range that's accessible on all parts.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 18:10:10 +09:00
Paul Mundt 037c10a612 sh: kprobes: Hook up kprobe_fault_handler() in the page fault path.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 12:22:47 +09:00
Paul Mundt fc63562ac2 sh: Disable seccomp support by default.
This was initially checked in with a stupid default of y, while most
everyone is going to want to have this disabled anyways.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 12:10:35 +09:00
Paul Mundt e7cb016e5a sh: Mark kretprobe_trampoline_holder static and __used.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 12:02:17 +09:00
Paul Mundt 4ad06dd6f1 sh: Add EDOSK7760 mach type.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 12:01:55 +09:00
Luca Santini 3db9170880 sh: Add Renesas EDOSK7760 board support.
This adds support for the Renesas (RTE) EDOSK7760 board. Currently
supported devices are:

	 - ramdisk support
	 - ethernet support
	 - nfs support
	 - ext2/ext3 support
	 - i2c support
	 - fb support (M)

Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 12:01:15 +09:00
Luca Santini 53abf911fa sh: Enable IRLM mode for SH7760 IRQ_MODE_IRQ.
Follows the same setting as SH7750.

Signed-off-by: Luca Santini <luca.santini@spesonline.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 11:54:56 +09:00
Paul Mundt 205a3b4328 sh: uninline flush_icache_all().
This uses jump_to_uncached() which is now given the noinline attribute
due to the special section mapping. Kill off the inline attribute to
fix up compilation failure.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:06 +09:00
Paul Mundt 6907e6a601 sh: Add the rest of the boot targets to arch/sh/boot/.gitignore.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:05 +09:00
Chris Smith d39f545014 sh: Add kprobes support.
Initial support for kprobes/kretprobes for 32-bit SH platforms.

[ General cleanup and some rework for the kretprobe hash lock. -- PFM ]

Signed-off-by: Chris Smith <chris.smith@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:05 +09:00
Marek Skuczynski b6c20e4290 sh: remove unnecessary memset after alloc_bootmem_low_pages
Because alloc_bootmem functions return the allocated memory always
zeroed, an additional call of memset on allocated memory is
unnecessary.

Signed-off-by: Marek Skuczynski <M.Skuczynski@adbglobal.com>
Signed-off-by: Carl Shaw <carl.shaw@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:05 +09:00
Francesco Virlinzi 61c66387e6 sh: fix the TMU code to allow a fully running NO_HZ system
This patch fixes the TMU code to allow NO_HZ to work on sh

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:05 +09:00
Carl Shaw b6ad1e8c3f sh: Subnormal double to float conversion
This patch adds support for the SH4 to convert a subnormal double
into a float by catching the FPE and implementing the FCNVDS
instruction in software.

Signed-off-by: Carl Shaw <carl.shaw@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:05 +09:00
Stuart Menefy f040ddaf4c sh: Fix an unusual memory initialisation error.
This fixes a problems with the set up of Linux memory:

 - When reserving memory at boot time, the code previously reserved
   the bottom page of memory, and then from one page up to the end of
   the bootmap. This had the desired effect, but was strictly speaking
   wrong, as the one page was actually whatever CONFIG_ZERO_PAGE_OFFSET
   had been set to.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:05 +09:00
Chris Smith 664718a343 sh: Fix uImage load address in 32-bit mode.
Fix "make uImage" load and entry addresses in 32-bit mode.

Signed-off-by: Chris Smith <chris.smith@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:04 +09:00
Stuart Menefy 96e14e54a6 sh: vmalloc pgtable sync fix.
This fixes a problem in the code which copies the vmalloc portion of the
kernel's page table into the current user space page table. The addition
of the four level page table code breaks on folded page tables, because
the pud level is always present (although folded). This updates the code
to use the same style of updates for the pud as is used for the pgd
level.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:04 +09:00
Stuart Menefy 28d6e52cf7 sh: Fix up broken 32-bit initrd support.
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:04 +09:00
Stuart Menefy c6feb6142c sh: early cached_to_uncached initialization.
statically initialise the cached_to_uncached offset, so that we can use
it immediatly.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:04 +09:00
Paul Mundt 3159e7d62a sh: Add support for memory hot-remove.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:04 +09:00
Paul Mundt 5840263ecb sh: Don't enable clockevents broadcasting on UP SH-X3 builds.
Fixes up compile errors with missing timer definitions. It's pointless to
have this enabled anyways if CONFIG_SMP=n.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:04 +09:00
Paul Mundt fa43972fab sh: fixup many sparse errors.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:04 +09:00
Paul Mundt 7d96169cb7 sh: Display CPU information in show_regs().
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:03 +09:00
Paul Mundt 53c01d2dc3 sh: Early dummy clockevent registration on boot CPU.
The dummy timer needs to be registered on the boot CPU before the
system timer clockevent is registered, or broadcasting doesn't work
as advertized.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:03 +09:00
Paul Mundt 71f0bdcab6 sh: smp: shove a cpu_relax() in the plat_start_cpu() busy loop.
Without this, certain versions of GCC will happily optimize the entire
loop out.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:03 +09:00
Paul Mundt 8c24594dea sh: generic clockevent broadcast support.
This hooks up GENERIC_CLOCKEVENTS_BROADCAST and a dummy local timer,
which we call in to from the timer IPI when no other local timer is
provided.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:03 +09:00
Paul Mundt 6f52707e68 sh: smp: Hook up a timer IPI stub.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:03 +09:00
Paul Mundt c7936b9abc sh: smp: Hook in to the generic IPI handler for SH-X3 SMP.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:03 +09:00
Paul Mundt 173a44dd1f sh: smp: Provide a generic IPI handler.
This provides a generic smp_message_recv() routine (based on the PPC
one), that IPI IRQs can wrap in to.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:02 +09:00
Paul Mundt 04ec080dca sh: Kill off unused defines from asm/smp.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:02 +09:00
Paul Mundt ee43a8442b sh: Provide movli.l/movco.l-based cmpxchg.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:02 +09:00
Paul Mundt 742fd1bcfb sh: Provide movli.l/movco.l-based bitops.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:02 +09:00
Paul Mundt dbce1f649e sh64: resume_kernel fix for kernel oops built with CONFIG_BKL_PREEMPT=y.
Follows the SH change.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-05 14:51:28 +09:00
Carmelo Amoroso 323b8c410a sh: resume_kernel fix for kernel oops built with CONFIG_BKL_PREEMPT=y.
This patch fixes a problem within the SH implementation of resume_kernel code,
that implements in assembly the bulk of preempt_schedule_irq function without
taking care of the extra code needed to handle the BKL preemptible.

The patch basically consists of removing this asm code and calling the common
C implementation (see kernel/sched.c) as other archs do.

Another change is the missing 'cli' macro invocation at the beginning of
the resume_kernel.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-05 14:42:16 +09:00
Yoshihiro Shimoda 3c31bf7313 sh: fix semtimedop syscall
fix the problem that cannot work semtimedop system call.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-28 14:53:22 +09:00
Magnus Damm f9bed3f204 sh: update AP325RXA defconfig
This patch updates the AP325RXA defconfig to include the recently merged
uio_pdrv_genirq driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-28 14:53:15 +09:00
Magnus Damm be8c129f1a sh: update Migo-R defconfig
This patch updates the MigoR defconfig to include the recently merged
uio_pdrv_genirq driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-28 14:53:12 +09:00
Magnus Damm c773d8af8e sh: fix platform_resource_setup_memory() section mismatch
This patch kills a section mismatch for platform_resource_setup_memory().

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-28 14:53:08 +09:00
Magnus Damm 5734493bac sh: fix kexec entry point for crash kernels
The crash kernel entry point is currently checked by the kexec kernel
code and only physical addresses in the reserved memory window are
accepted. This means that we can't pass P2 or P1 addresses as entry
points in the case of crash kernels. This patch makes sure we can start
crash kernels by adding support for physical address entry points.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-28 14:53:03 +09:00
Magnus Damm 34894c7843 sh: crash kernel resource fix
The reserved crash kernel memory range is currently missing from
/proc/iomem. crashk_res is mistakenly setup after __add_active_range().
Reorder things to make sure the resource shows up in /proc/iomem.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-28 14:52:58 +09:00
Adrian Bunk e311be521f sh: fix ptrace_64.c:user_disable_single_step()
This patch fixes the following compile error caused by
commit c459dbf294
(sh: ptrace single stepping cleanups.):

<--  snip  -->

...
  CC      arch/sh/kernel/ptrace_64.o
arch/sh/kernel/ptrace_64.c: In function 'user_disable_single_step':
arch/sh/kernel/ptrace_64.c:134: error: 'regs' undeclared (first use in this function)
arch/sh/kernel/ptrace_64.c:134: error: (Each undeclared identifier is reported only once
arch/sh/kernel/ptrace_64.c:134: error: for each function it appears in.)
...
make[2]: *** [arch/sh/kernel/ptrace_64.o] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-25 14:08:02 +09:00
Adrian Bunk a106826452 sh64: re-add the __strnlen_user() prototype
Commit 42fd3b142d
(sh: Initial consolidation of the _32/_64 uaccess split.)
mistakenly removed the sh64 __strnlen_user() prototype,
resulting in the following compile error:

<--  snip  -->

...
  CC      init/main.o
In file included from include/linux/poll.h:13,
                 from include/linux/rtc.h:113,
                 from include/linux/efi.h:19,
                 from init/main.c:43:
arch/sh/include/asm/uaccess.h: In function 'strnlen_user':
arch/sh/include/asm/uaccess.h:213: error: implicit declaration of function '__strnlen_user'
...
make[2]: *** [init/main.o] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-25 14:07:58 +09:00
Linus Torvalds 1bbe44f69d Merge branch 'sh/for-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'sh/for-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Provide a FLAT_PLAT_INIT() definition.
  binfmt_flat: Stub in a FLAT_PLAT_INIT().
  video: export sh_mobile_lcdc panel size
  sh: select memchunk size using kernel cmdline
  sh: export sh7723 VEU as VEU2H
  input: migor_ts compile and detection fix
  sh: remove MSTPCR defines from Migo-R header file
  sh: Update sh7763rdp defconfig
  sh: Add support sh7760fb to sh7763rdp board
  sh: Add support sh_eth to sh7763rdp board
  sh: Disable 64kB hugetlbpage size when using 64kB PAGE_SIZE.
  sh: Don't export __{s,u}divsi3_i4i from SH-2 libgcc.
  fix SH7705_CACHE_32KB compilation
  sh: mach-x3proto: Fix up smc91x platform data.
2008-08-20 08:46:11 -07:00
Huang Ying 163f6876f5 kexec jump: rename KEXEC_CONTROL_CODE_SIZE to KEXEC_CONTROL_PAGE_SIZE
Rename KEXEC_CONTROL_CODE_SIZE to KEXEC_CONTROL_PAGE_SIZE, because control
page is used for not only code on some platform.  For example in kexec
jump, it is used for data and stack too.

[akpm@linux-foundation.org: unbreak powerpc and arm, finish conversion]
Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-15 08:35:42 -07:00
Takashi YOSHII 9b9d6b2a4f sh: Provide a FLAT_PLAT_INIT() definition.
SH needs this in order to make sure that r4 has a sane value at process
entry time, which the libc expects has already been taken care of.

Fixes random crashes in flat binaries.

Signed-off-by: Takashi YOSHII <yoshii.takashi@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:55 +09:00
Magnus Damm ce9c008c8b video: export sh_mobile_lcdc panel size
Export the LCD panel size for sh_mobile_lcdc boards. This allows us
to perform dpi and screen aspect ratio calculations in user space.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:55 +09:00
Magnus Damm 0c13bf1e7c sh: select memchunk size using kernel cmdline
Allow user to pass parameters on kernel command line to override
default size for physically contiguous memory buffers. The default
VPU buffer size is too small for VGA harware encoding, but instead
of just bumping up the number we allow the user to override the
default size using the command line. Supports SuperH Mobile hardware
blocks such as VEU, VPU and CEU.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:55 +09:00
Magnus Damm 2a5323cd69 sh: export sh7723 VEU as VEU2H
Export sh7723 VEU hardware blocks as VEU2H. The sh7723 VEU2H differs
a bit from the sh7722 VEU so use different names for our UIO devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:55 +09:00
Magnus Damm 2fc91882c2 sh: remove MSTPCR defines from Migo-R header file
Remove MSTPCR register definitions from Migo-R header file. The clock
frame work should be used instead of direct register access.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:53 +09:00
Nobuhiro Iwamatsu a66b44b103 sh: Update sh7763rdp defconfig
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:51 +09:00
Nobuhiro Iwamatsu 674063c5a5 sh: Add support sh7760fb to sh7763rdp board
Add sh7760fb platform device to sh7763rdp's setup.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:50 +09:00
Nobuhiro Iwamatsu 0a766a6b7d sh: Add support sh_eth to sh7763rdp board
SH7763 has sh_eth device. This patch add sh_eth platform device
to this board.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:50 +09:00
Paul Mundt 68b7c24cf9 sh: Disable 64kB hugetlbpage size when using 64kB PAGE_SIZE.
Presently we oops in mm/hugetlb.c:1325, which is the order == 0 test in
hugetlb_add_hstate() called at initialization time. So, disable 64kB
huge pages when we're using a 64kB PAGE_SIZE. On most parts this will
force the default to be 1MB huge pages.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:49 +09:00
Yoshinori Sato d09d328c11 sh: Don't export __{s,u}divsi3_i4i from SH-2 libgcc.
rsk7203_defconfig fails to build with the following error:

<--  snip  -->

...
  LD      .tmp_vmlinux1
arch/sh/kernel/built-in.o:(__ksymtab+0xb8): undefined reference to `__udivsi3_i4i'
arch/sh/kernel/built-in.o:(__ksymtab+0xc8): undefined reference to `__sdivsi3_i4i'
make[1]: *** [.tmp_vmlinux1] Error 1

<--  snip  -->

That worked with 2.6.26, and these are far less undefined references
than in the cases where libgcc was missing.

[ These symbols are not defined on SH-2 versions of libgcc, so we have to
  special case the export there. - Paul ]

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:49 +09:00
Adrian Bunk 7265706c8f fix SH7705_CACHE_32KB compilation
This patches compile errors like the following caused by
commit 51f3547d61
(sh: Allow SH-3 and SH-5 to use common headers):

<--  snip  -->

...
  CC      arch/sh/mm/init.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/mm/init.c: In function 'mem_init':
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/mm/init.c:232: error: implicit declaration of function 'p3_cache_init'
make[2]: *** [arch/sh/mm/init.o] Error 1
make[1]: *** [arch/sh/mm] Error 2
...
  CC      kernel/fork.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/fork.c: In function 'dup_mmap':
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/fork.c:323: error: implicit declaration of function 'flush_dcache_mmap_lock'
/home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/fork.c:325: error: implicit declaration of function 'flush_dcache_mmap_unlock'
make[2]: *** [kernel/fork.o] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:49 +09:00
Paul Mundt e77eb36472 sh: mach-x3proto: Fix up smc91x platform data.
smc91x on x3proto needs 16-bit access and nowait, which we can now do
through the platform data.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:48 +09:00
Yoshinori Sato 71557a37ad [netdrvr] sh_eth: Add SH7619 support
Add support SH7619 Internal ethernet controler.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-07 02:20:57 -04:00
Adrian Bunk 0e25f71061 remove unneeded #include <linux/ide.h>'s
This patch remove unneeded #include <linux/ide.h>'s.

It also adds a required #include <linux/interrupt.h> that was previously 
implicitely pulled by ide.h

Signed-off-by: Adrian Bunk <bunk@kernel.org>
[bart: revert change to tests/lkdtm.c (spotted by Stephen Rothwell)]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-08-05 18:17:00 +02:00
Bartlomiej Zolnierkiewicz b5b9309d34 remove unnecessary <linux/hdreg.h> includes
Following files don't need <linux/hdreg.h> at all:

- arch/mips/jazz/setup.c
- arch/sh/boards/mach-systemh/irq.c
- drivers/macintosh/mediabay.c
- drivers/scsi/hptiop.c
- drivers/usb/storage/freecom.c
- arch/powerpc/include/asm/ide.h
- init/main.c

Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-08-05 18:16:58 +02:00
Paul Mundt f5663f5bde sh: enable maple_keyb in dreamcast_defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 16:52:34 +09:00
Yoshinori Sato cce2d453e4 SH2(A) cache update
Includes:
- SH2 (7619) Writeback support.
- SH2A cache handling fix.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 16:33:47 +09:00
Takashi Yoshii d8eb2fab18 add addrespace definition for sh2a.
Newfile: arch/sh/include/cpu-sh2a/cpu/addrspace.h

This file seems had be removed to use fallback (cpu-common/cpu/addrspace.h),
but, I'd like to add sh2a specific file here, because
1. the values defined there are not suitable for sh2a.
2. I don't think there is "common" definition for these values.

Values are chosen by consideration of followings...
 P1 is 0. perhaps no question.
 P2 is from hardware manual, which says no-cache area starts at 20000000.
 It means that P? space size=20000000.
 P3 is P2+size since asm/ptrace.h uses P3 as a end of P2.
 P4 is P3+size since asm/fixup.h uses P4 as a end of P3.

Signed-off-by: Takashi YOSHII <yoshii.takashi@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 14:39:19 +09:00
Paul Mundt 42ced5561a sh: Kill off ARCH_SUPPORTS_AOUT and remnants of a.out support.
SH never really supported a.out, so this was all just copied over blindly
from x86 way back when. As we don't reference linux/a.out.h anywhere in
the tree, these can now safely be killed off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 14:18:53 +09:00
Paul Mundt 5093c9a4e4 sh: define GENERIC_HARDIRQS_NO__DO_IRQ.
We haven't called in to __do_IRQ() in a long time, so it seems like a
reasonable time to switch this on by default.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 14:17:13 +09:00
Paul Mundt bdcab87b1c sh: define GENERIC_LOCKBREAK.
Needed for fixing up the __raw_spin_is_contended() reference which
results in a build error.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 14:09:15 +09:00
Paul Mundt c3b4adfa65 sh: Save NUMA node data in vmcore for crash dumps.
Presently the NUMA node data isn't saved on kexec. This implements a
simple arch_crash_save_vmcoreinfo() for saving off the relevant data.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 13:42:49 +09:00
Paul Mundt 4b59c97325 sh: module_alloc() should be using vmalloc_exec().
SH-X2 extended mode TLB allows for toggling of the exec bit, so make
sure we are using the right protection bits for module space there
also.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 13:34:29 +09:00
Paul Mundt 3108cf0612 sh: Fix up __bug_table handling in module loader.
We should be calling in to the lib/bug.c module helpers, fix that up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 13:32:04 +09:00
Paul Mundt 6a9545bd95 sh: Fix up broken kerneldoc comments.
These were completely unparseable, so fix them up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 12:51:06 +09:00
Paul Mundt c07abb6dbe sh: /proc/asids depends on MMU.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 08:11:03 +09:00
Huang Weiyi c48e64ae57 arch/sh/boards/mach-se/7343/irq.c: removed duplicated #include
Removed duplicated include <linux/irq.h> in
arch/sh/boards/mach-se/7343/irq.c.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-03 23:29:24 +09:00
Huang Weiyi 8edd744202 arch/sh/boards/board-ap325rxa.c: removed duplicated #include
Removed duplicated include <linux/delay.h> in
arch/sh/boards/board-ap325rxa.c.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-03 23:29:18 +09:00
Adrian Bunk 596400f0f3 sh/boards/Makefile typo fix
The following build error was caused by an obvious typo:

<--  snip  -->

...
  LD      arch/sh/mm/built-in.o
make[2]: *** No rule to make target `arch/sh/boards/board-shmin..o', needed by `arch/sh/boards/built-in.o'.  Stop.

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-03 09:31:07 +09:00
Adrian Bunk 49de935c10 sh: fix LIBGCC
Commit f15cbe6f1a
(sh: migrate to arch/sh/include/) moved KBUILD_CFLAGS
(which is used by LIBGCC) below LIBGCC, causing build
errors like the following:

<--  snip  -->

...
  LD      .tmp_vmlinux1
arch/sh/kernel/built-in.o: In function `module_clk_recalc':
clock-sh4.c:(.text+0x80f0): undefined reference to `__udivsi3_i4i'
...
make[1]: *** [.tmp_vmlinux1] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 07:23:31 +09:00
Paul Mundt 4385e12b29 sh: Revert the location change of auto-generated asm/machtypes.h
This ended up causing build breakage on O= builds, as reported by Adrian:

<--  snip  -->

...
  CC      init/main.o
In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/include/asm/irq.h:4,
                 from /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/irq.h:23,
                 from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/include/asm/hardirq.h:5,
                 from /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/hardirq.h:7,
                 from /home/bunk/linux/kernel-2.6/git/linux-2.6/include/asm-generic/local.h:5,
                 from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/include/asm/local.h:4,
                 from /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/module.h:19,
                 from /home/bunk/linux/kernel-2.6/git/linux-2.6/init/main.c:13:
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/include/asm/machvec.h:15:27:
error: asm/machtypes.h: No such file or directory
make[2]: *** [init/main.o] Error 1

<--  snip  -->

So we simply move machtypes.h back to its original place. asm-offsets.h is
still generated there regardless, until such a time that we find a better place
to stash auto-generated files.

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 07:14:09 +09:00
Paul Mundt 9e5e21170e sh: Fix up the audit arch endian specification.
Presently this was always being set to AUDIT_ARCH_SH, which assumes
big endian. Fix this up so that the architecture actually reflects
what we're running on.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:33 +09:00
Paul Mundt ab99c733ae sh: Make syscall tracer use tracehook notifiers, add TIF_NOTIFY_RESUME.
This follows the changes in commits:

7d6d637dac
4f72c4279e

on powerpc. Adding in TIF_NOTIFY_RESUME, and cleaning up the syscall
tracing to be more generic. This is an incremental step to turning
on tracehook, as well as unifying more of the ptrace and signal code
across the 32/64 split.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:33 +09:00
Paul Mundt c459dbf294 sh: ptrace single stepping cleanups.
This converts the single stepping done by sh/sh64 ptrace implementations
to use the generic user_enable/disable_single_step(), and subsequently
rips out a lot of ptrace request cases that are now handled generically.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:33 +09:00
Paul Mundt c4637d4751 sh: seccomp support.
This hooks up the seccomp thread flag and associated callback from the
syscall tracer.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:32 +09:00
Paul Mundt cec3fd3e2a sh: Tidy up the _TIF work masks, and fix syscall trace bug on singlestep.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:32 +09:00
Simon Horman daf423db3b kdump: sh: parse elfcorehdr command line argument
A quick cut and paste from other architectures to allow SH
to parse the elfcorehdr command line argument which is required
for both is_kdump_kernel() and vmcore to function.
(the former is as yet unused on SH).

Tested compilation only

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-02 04:39:32 +09:00
Linus Torvalds 00e9028a95 Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (28 commits)
  mm/hugetlb.c must #include <asm/io.h>
  video: Fix up hp6xx driver build regressions.
  sh: defconfig updates.
  sh: Kill off stray mach-rsk7203 reference.
  serial: sh-sci: Fix up SH7760/SH7780/SH7785 early printk regression.
  sh: Move out individual boards without mach groups.
  sh: Make sure AT_SYSINFO_EHDR is exposed to userspace in asm/auxvec.h.
  sh: Allow SH-3 and SH-5 to use common headers.
  sh: Provide common CPU headers, prune the SH-2 and SH-2A directories.
  sh/maple: clean maple bus code
  sh: More header path fixups for mach dir refactoring.
  sh: Move out the solution engine headers to arch/sh/include/mach-se/
  sh: I2C fix for AP325RXA and Migo-R
  sh: Shuffle the board directories in to mach groups.
  sh: dma-sh: Fix up dreamcast dma.h mach path.
  sh: Switch KBUILD_DEFCONFIG to shx3_defconfig.
  sh: Add ARCH_DEFCONFIG entries for sh and sh64.
  sh: Fix compile error of Solution Engine
  sh: Proper __put_user_asm() size mismatch fix.
  sh: Stub in a dummy ENTRY_OFFSET for uImage offset calculation.
  ...
2008-08-01 10:53:43 -07:00
Paul Mundt cc8dccdc74 sh: defconfig updates.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-30 02:15:20 +09:00
Paul Mundt 9b4d10ff24 sh: Kill off stray mach-rsk7203 reference.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-30 01:01:08 +09:00
Paul Mundt c8b5d9dcbc sh: Move out individual boards without mach groups.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-30 00:13:39 +09:00
Paul Mundt c170f86e31 sh: Make sure AT_SYSINFO_EHDR is exposed to userspace in asm/auxvec.h.
Presently this is protected by a CONFIG_VSYSCALL ifdef so we don't
inadvertently trigger the creation of the gate VMA on CPUs where we don't
enable the vDSO, which is obviously not visible to userspace. Fix this up
by adding in an ifndef __KERNEL__ check at the same time.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 23:12:25 +09:00
Paul Mundt 51f3547d61 sh: Allow SH-3 and SH-5 to use common headers.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 22:52:49 +09:00
Paul Mundt 93dc544cf4 sh: Provide common CPU headers, prune the SH-2 and SH-2A directories.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 22:46:55 +09:00
Paul Mundt 0764bff445 sh: More header path fixups for mach dir refactoring.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 22:10:01 +09:00
Paul Mundt 939a24a6df sh: Move out the solution engine headers to arch/sh/include/mach-se/
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 21:41:37 +09:00
Magnus Damm e565b518ec sh: I2C fix for AP325RXA and Migo-R
Fix recently introduced I2C build breakage on AP325RXA and Migo-R.

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 21:05:04 +09:00
Paul Mundt da2014a2b0 sh: Shuffle the board directories in to mach groups.
This flattens out the board directories in to individual mach groups,
we will use this for getting rid of unneeded directories, simplifying
the build system, and becoming more coherent with the refactored
arch/sh/include topology.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 21:01:19 +09:00
Paul Mundt 71b8064e7d sh: dma-sh: Fix up dreamcast dma.h mach path.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 20:20:36 +09:00
Paul Mundt cfb81f361a sh: Switch KBUILD_DEFCONFIG to shx3_defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 20:19:43 +09:00
Paul Mundt f42b7e3dbe sh: Add ARCH_DEFCONFIG entries for sh and sh64.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 20:12:51 +09:00
Nobuhiro Iwamatsu 4864841a34 sh: Fix compile error of Solution Engine
When I compiled Solution Engine, this become compile error
because plaform device of sh_eth device becomes enable.
When sh7710/sh7712 which could use sh_eth was chosen,
revised it so that platform device of sh_eth device became enable.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 17:39:58 +09:00
OGAWA Hirofumi 6de9c6481d sh: Proper __put_user_asm() size mismatch fix.
This fixes up the workaround in 2b4b2bb421
and cleans up __put_user_asm() to get the sizing right from the onset.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 09:16:33 +09:00
Paul Mundt d27e0854d5 sh: Stub in a dummy ENTRY_OFFSET for uImage offset calculation.
If none is defined, provide a sane default, as we do for the other
options.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 09:15:01 +09:00
Paul Mundt b9edb17cc2 sh: Add an arch/sh/kernel/.gitignore
Ignore vmlinux.lds.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 08:29:32 +09:00
Paul Mundt cc64f7f700 sh: dreamcast: fix build failure from header reorg.
Oops, machvec.h is in asm/, it was previously removed due to overzealous
trimming. Fix up the path again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 08:24:50 +09:00
Paul Mundt f15cbe6f1a sh: migrate to arch/sh/include/
This follows the sparc changes a439fe51a1.

Most of the moving about was done with Sam's directions at:

http://marc.info/?l=linux-sh&m=121724823706062&w=2

with subsequent hacking and fixups entirely my fault.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 08:09:44 +09:00
Ingo Molnar cb28a1bbdb Merge branch 'linus' into core/generic-dma-coherent
Conflicts:

	arch/x86/Kconfig

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-29 00:07:55 +02:00
Paul Mundt 11325f035e sh: rsk7203: update defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 06:32:05 +09:00
Paul Mundt 6d0b365731 sh: rsk7203: Add smc911x platform data.
This hooks up platform data for the SMC9118 on the RSK+7203.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29 06:32:05 +09:00
Magnus Damm 8b2224dc6a sh: SuperH Mobile CEU and camera platform data for AP325RXA
Add AP325RXA specific platform data for on-chip sh7723 CEU and ncm03j camera.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 19:15:39 +09:00
Magnus Damm 4875ea224a sh: Update smc911x platform data for AP325RXA
Pass board specific smc911x parameters using struct smc911x_platdata.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 19:14:27 +09:00
Magnus Damm 6968980a1b sh: SuperH Mobile LCDC platform data for AP325RXA
Add LCD panel platform data for the AP325RXA board.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 19:08:19 +09:00
Magnus Damm 1765534c23 sh: Add SuperH Mobile CEU platform data for Migo-R
Add Migo-R specific platform data for on-chip sh7722 CEU and ov772x camera.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:51:07 +09:00
Magnus Damm 8b1285f1c1 sh: Add SuperH Mobile LCDC platform data for Migo-R
Add WVGA and QVGA LCD panel support to Migo-R.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:48:06 +09:00
Paul Mundt 44f9598952 sh: Wire up new syscalls.
This wires up the signalfd4, eventfd2, epoll_create1, dup3, pipe2, and
inotify_init1 syscalls.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:34:45 +09:00
Yoshihiro Shimoda 82cb1f6fb3 sh: fix uImage Entry Point
fix the problem that cannot boot using uImage when PAGE_SIZE is
8kbyte or 64kbyte.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:16:41 +09:00
Stuart MENEFY 0b1689cfbb sh: Don't miss pending signals returning to user mode after signal processing
Without this patch, signals sent during architecture specific signal
handling (typically as a result of the user's stack being inaccessible)
are ignored.

This is the SH version of commit c3ff8ec31c
which was for the i386.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:37 +09:00
Magnus Damm d7f1a9adc0 sh: Use clk_always_enable() on sh7366
Use clk_always_enable() in the sh7366 processor code.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:37 +09:00
Magnus Damm 8fa509ab91 sh: Use clk_always_enable() on sh7343 / SE77343
Use clk_always_enable() on the sh7343 processor and in the board code
for Solution Engine 7343. Remove duplicate MSTPCR register definitions.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:37 +09:00
Magnus Damm 6c7d826cf6 sh: Use clk_always_enable() on sh7722 / Migo-R / SE7722
Use clk_always_enable() on the sh7722 processor and in the board code
for Migo-R and Solution Engine 7722. Remove duplicate MSTPCR register
definitions.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:37 +09:00
Magnus Damm 9ca6ecac50 sh: Use clk_always_enable() on sh7723 / ap325rxa
Use clk_always_enable() on the sh7723 processor and in the ap325rxa
board code. Remove duplicate MSTPCR register definitions.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:37 +09:00
Magnus Damm 152fe36ebe sh: Show all clocks and their state in /proc/clocks
Show all clocks in /proc/clocks, and also show if they are enabled or
disabled. This is useful to show MSTPCR bits on SuperH Mobile processors.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:36 +09:00
Magnus Damm 1312994c80 sh: Merge sh7343 and sh7722 clock code
This code makes sh7343 share the sh7722 clock code. Instead of just using
the good and very old sh7343 clock implmentation, switch to the new MSTPCR
enabled clock code. SIU clocks are disabled on sh7343 for now.

With this change all SuperH Mobile devices now use the same clock code.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:36 +09:00
Magnus Damm aea167cbb5 sh: Add SuperH Mobile MSTPCR bits to clock framework
Handle module stop clock bits in MSTPCRn through the clock framework.
The clocks are named after the bits in the data sheet. The association
between bit number and hardware block is processor specific.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:36 +09:00
Magnus Damm 3fec18bd60 sh: Use arch_flags to simplify sh7722 siu clock code
Make use of arch_flags to simplify the SIU clock code.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:36 +09:00
Adrian Bunk c46acb8e20 fix sh ptep_get_and_clear breakage
Commit 1ea0704e0d
(mm: add a ptep_modify_prot transaction abstraction)
triggered on sh build errors like the following:

<--  snip  -->

...
  CC      arch/sh/mm/pg-sh4.o
cc1: warnings being treated as errors
include2/asm/pgtable.h:139: error: 'ptep_get_and_clear' declared inline after being called
include2/asm/pgtable.h:139: error: previous declaration of 'ptep_get_and_clear' was here
make[2]: *** [arch/sh/mm/pg-sh4.o] Error 1

<--  snip  -->

Since there's no good reason for marking these global functions as
"inline" this patch therefore removes the inline's.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:35 +09:00
Yoshihiro Shimoda cbe9da029d sh: Renesas R0P7785LC0011RL board support
This adds initial support for the Renesas R0P7785LC0011RL board.
This patch supports 29bit address mode only.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:35 +09:00
Magnus Damm 1eca5c9272 sh: Add memory chunks to SH-Mobile UIO devices
This patch adds physically contiguous memory chunks to the UIO devices.
The same strategy can be used in the future for the CEU as well.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:35 +09:00
Magnus Damm 714750dd5c sh: Export sh7366 VPU, VEU(1), VEU(2) using uio_pdrv_genirq
This patch exports the VPU, VEU(1) and VEU(2) blocks of the sh7366
to user space using the uio_pdrv_genirq platform driver.

While at it, fix up the VEU(2) interrupt vector.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:34 +09:00
Magnus Damm 6874548c69 sh: Export sh7723 VPU, VEU2H0, VEU2H1 using uio_pdrv_genirq
This patch exports the VPU, VEU2H0 and VEU2H1 blocks of the sh7723
to user space using the uio_pdrv_genirq platform driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:34 +09:00
Magnus Damm a55f6d2567 sh: Export sh7722 VPU and VEU using uio_pdrv_genirq
This patch exports the VPU and VEU blocks of the sh7722 to user space
using the uio_pdrv_genirq platform driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:34 +09:00
Magnus Damm c901c96cc2 sh: Export sh7343 VPU and VEU using uio_pdrv_genirq
This patch exports the VPU and VEU blocks of the sh7343 to user space
using the uio_pdrv_genirq platform driver.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:34 +09:00
Yoshinori Sato 6e80f5e8c4 sh2(A) exception handler update
This patch is

By sh2
- Remove duplicate code
- Reduce stack usage
- Cleanup and little optimize

By sh2a
- Add missing handler(256 to 511)
- Use sh2a instructions handler

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:34 +09:00
Yoshihiro Shimoda cafd63b007 sh: update Solution Engine 7343
updated the following codes for Solution Endine 7343:
 - fix compile error in arch/sh/boards/se/7343/irq.c
 - add nor flash physmaps
 - update defconfig

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:34 +09:00
Yoshihiro Shimoda a4e1d08491 sh: update sh7343 code
updated the following codes for SH7343:
 - add register_intc_controller()
 - add EARLY_SCIF_CONSOLE_PORT
 - add define of CPG register

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:34 +09:00
Magnus Damm 73382f710b sh: fix pg-sh4.c build breakage in linux-next
Remove inline from ptep_get_and_clean() to match with header file prototype.
Makes linux-next build.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:34 +09:00
Magnus Damm 026953db56 sh: enable I2C on the ap325rxa board
This patch enables I2C on the sh7723-based ap325rxa board.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:33 +09:00
Magnus Damm 0fff76f2da sh: add SuperH Mobile I2C platform data to sh7366
This patch adds platform data for the single I2C channel on sh7366.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:33 +09:00
Magnus Damm da7d3029d1 sh: add SuperH Mobile I2C platform data to sh7723
This patch adds platform data for the single I2C channel on sh7723.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:33 +09:00
Magnus Damm 7549079d84 sh: add SuperH Mobile I2C platform data to sh7343
This patch adds platform data for two I2C channels to the sh7343.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:33 +09:00
Yoshihiro Shimoda 6bdfb22a8e sh: add interrupt ack code to sh4a
This patch is based on interrupt acknowledge code for external
interrupt sources on sh3 processors and adds on sh4a processors.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:33 +09:00
Yoshinori Sato f12ae6bc4a sh: Fix up link error on SH-2 zImage with older binutils.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:33 +09:00
Stuart Menefy f2fb4e4f64 sh: Conditionally re-enable IRQs in fault path.
The current kernel behaviour is to reenable interrupts unconditionally
when taking a page fault. This patch changes this to only enable them
if interrupts were previously enabled.

It also fixes a problem seen with this fix in place: the kernel previously
flushed the vsyscall page when handling a signal, which is not only
unncessary, but caused a possible sleep with interrupts disabled.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:33 +09:00
Paul Mundt 068f59143d sh: Record the major cut revision for probed SH-4A parts.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:32 +09:00
Chris Smith 09b5a10c19 sh: Optimized flush_icache_range() implementation.
Add implementation of flush_icache_range() suitable for signal handler
and kprobes. Remove flush_cache_sigtramp() and change signal.c to use
flush_icache_range().

Signed-off-by: Chris Smith <chris.smith@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:32 +09:00
Stuart Menefy 3611ee7acc sh: Stub in silicon cut in CPU info.
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:32 +09:00
Paul Mundt ef9247ef89 sh: Tidy up the SH-3 exception vector table.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:32 +09:00
Yoshinori Sato d88a3ea6fa SH7619 add ethernet controler support
- Add EtherC + PHY resource define.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:32 +09:00
Nobuhiro Iwamatsu fafb7a97de sh: Remove sh_pcic_io_xxx function from Solution Engine IO code
sh_pcic_io_xxx function are very old.
In linux-2.4, mrshpc_ss socket driver used this function.
But there is not this driver to the present kernel.
I deleted these cords and checked operation.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:32 +09:00
Nobuhiro Iwamatsu 7c93d87d09 sh: Fix Kconfig of AP-325RXA
The CPU of AP-325RXA is SH7723, but a CPU becomes selectable.
This patch fixes this problem.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:31 +09:00
Nobuhiro Iwamatsu 787d9d7e89 sh: Clean up code of Solution Engine 770x
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:31 +09:00
Nobuhiro Iwamatsu b2e4c109a8 sh: Update Solution Enginge 7712 defconfig
Enable SH-Ether support and NFS userland support.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:31 +09:00
Nobuhiro Iwamatsu ffb91ad275 sh: Solution Enginge 7710/7712 SH-Ether support
Add support SH-Ether for Hitachi Solution Engine.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:30 +09:00
Adrian Bunk 4c1cfab1e0 sh/kernel/ cleanups
This patch contains the following cleanups:
- make the following needlessly global code static:
  - cf-enabler.c: cf_init()
  - cpu/clock.c: __clk_enable()
  - cpu/clock.c: __clk_disable()
  - process_32.c: default_idle()
  - time_32.c: struct clocksource_sh
  - timers/timer-tmu.c: struct tmu_timer_ops
- remove the following unused functions (no CONFIG_BLK_DEV_FD on sh):
  - process_{32,64}.c: disable_hlt()
  - process_{32,64}.c: enable_hlt()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:30 +09:00
Adrian Bunk 62410034e7 sh: make pcibios_max_latency static
This patch makes the needlessly global pcibios_max_latency static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:30 +09:00
Adrian Bunk 175fb09f4a sh: make EARLY_PCI_OP's static
This patch makes the needlessly global EARLY_PCI_OP's static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:30 +09:00
Adrian Bunk 2b7bf930ae sh/boards/dreamcast/rtc.c: make 2 functions static
This patch makes the needlessly global aica_rtc_{get,set}timeofday()
static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:30 +09:00
Nobuhiro Iwamatsu 4cec1a37ba sh: Renesas Solutions SH7763RDP board support
This patch adds basic support for the SH7763RDP board.
This supports a basic stuff provided in SH7763, like SCIF,
NOR Flash and USB host.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:30 +09:00
Nobuhiro Iwamatsu c63847a362 sh: Add SCIF2 support for SH7763.
SH7763 has 3 SCIF device. Current code supports SCIF0 and 1.
SCIF0 and 1 are same register constitution, but only SCIF2 is different.
I added support of SCIF2.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:29 +09:00
Yusuke Goda 04e917b606 sh: Add support Renesas Solutions AP-325RXA board
This board is SH7723 base board.

This has SCIF, LCDC, USB Host controler, NOR/NAND Flash, Sound,
Ether and other.

This patch supports SCIF, NOR Flash.

Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:29 +09:00
Paul Mundt 66dfe18114 sh: Add support for 16kB PAGE_SIZE.
16kB is a useful size on nommu, while 64kB still tends to be too big to
be useful. Newer MMUs are likely to support this as well, so plug it
in in anticipation of those, too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:29 +09:00
Paul Mundt 74fcc77982 sh: Support variable page sizes on nommu.
PAGE_SIZE doesn't need to be fixed at 4096 on nommu, so stub in a !MMU
case for the various PAGE_SIZE Kconfig options.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:28 +09:00
Paul Mundt 3787aa112c sh: RSK+ 7203 board support.
This adds initial support for the RTE RSK+ SH7203 board.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:28 +09:00
Paul Mundt 2cd1e31859 sh: Make dump_task dependent on ELF core.
Currently this is only linked in for CONFIG_BINFMT_ELF, make it dependent
on CONFIG_ELF_CORE, so it's both selectable there and also linked in for
CONFIG_BINFMT_ELF_FDPIC.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:28 +09:00
Paul Mundt 3bc24a1a54 sh: Initial ELF FDPIC support.
This adds initial support for ELF FDPIC on MMU-less SH, as per version
0.2 of the ABI definition at:

	http://www.codesourcery.com/public/docs/sh-fdpic/sh-fdpic-abi.txt

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:28 +09:00
Adrian Bunk e3b0860090 move arch/sh/lib/io.o to obj-y
EXPORT_SYMBOL's in lib-y considered harmful:

<--  snip  -->

...
  MODPOST 1837 modules
ERROR: "__raw_readsl" [drivers/ssb/ssb.ko] undefined!
ERROR: "__raw_writesl" [drivers/ssb/ssb.ko] undefined!
ERROR: "__raw_writesl" [drivers/net/smc91x.ko] undefined!
ERROR: "__raw_readsl" [drivers/net/smc91x.ko] undefined!
ERROR: "__raw_writesl" [drivers/net/3c59x.ko] undefined!
ERROR: "__raw_readsl" [drivers/net/3c59x.ko] undefined!
...
make[2]: *** [__modpost] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:28 +09:00
Adrian Bunk 7223ce29e8 sh dreamcast: export board_pci_channels
This patch fixes the following build error:

<--  snip  -->

...
  MODPOST 1837 modules
ERROR: "board_pci_channels" [drivers/pcmcia/yenta_socket.ko] undefined!
...
make[2]: *** [__modpost] Error 1

<--  snip  -->

I freely admit that it's a pathological configuration, but as long as
it is allowed it should build.

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:27 +09:00
Adrian Bunk b19a33caba sh: export get_cpu_subtype
This patch fixes the following build error:

<--  snip  -->

...
  MODPOST 1837 modules
ERROR: "get_cpu_subtype" [arch/sh/oprofile/oprofile.ko] undefined!
...
make[2]: *** [__modpost] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:27 +09:00
Li Zefan 45dabf1427 sh: fix seq_file memory leak
When using single_open(), single_release() should be used instead
of seq_release(), otherwise there is a memory leak.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:27 +09:00
Johannes Weiner 03da6bfb5b sh: use generic show_mem()
Remove arch-specific show_mem() in favor of the generic version.

This also removes the following redundant information display:

	- free pages, printed by show_free_areas()
	- pages in slab, printed by show_free_areas()
	- free swap pages, printed by show_swap_cache_info()
	- pages in swapcache, printed by show_swap_cache_info()

where show_mem() calls show_free_areas(), which calls
show_swap_cache_info().

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-26 12:00:10 -07:00
Alexey Dobriyan 51cc50685a SL*B: drop kmem cache argument from constructor
Kmem cache passed to constructor is only needed for constructors that are
themselves multiplexeres.  Nobody uses this "feature", nor does anybody uses
passed kmem cache in non-trivial way, so pass only pointer to object.

Non-trivial places are:
	arch/powerpc/mm/init_64.c
	arch/powerpc/mm/hugetlbpage.c

This is flag day, yes.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Jon Tollefson <kniht@linux.vnet.ibm.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Matt Mackall <mpm@selenic.com>
[akpm@linux-foundation.org: fix arch/powerpc/mm/hugetlbpage.c]
[akpm@linux-foundation.org: fix mm/slab.c]
[akpm@linux-foundation.org: fix ubifs]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-26 12:00:07 -07:00
Huang Ying 3ab8352137 kexec jump
This patch provides an enhancement to kexec/kdump.  It implements the
following features:

- Backup/restore memory used by the original kernel before/after
  kexec.

- Save/restore CPU state before/after kexec.

The features of this patch can be used as a general method to call program in
physical mode (paging turning off).  This can be used to call BIOS code under
Linux.

kexec-tools needs to be patched to support kexec jump. The patches and
the precompiled kexec can be download from the following URL:

       source: http://khibernation.sourceforge.net/download/release_v10/kexec-tools/kexec-tools-src_git_kh10.tar.bz2
       patches: http://khibernation.sourceforge.net/download/release_v10/kexec-tools/kexec-tools-patches_git_kh10.tar.bz2
       binary: http://khibernation.sourceforge.net/download/release_v10/kexec-tools/kexec_git_kh10

Usage example of calling some physical mode code and return:

1. Compile and install patched kernel with following options selected:

CONFIG_X86_32=y
CONFIG_KEXEC=y
CONFIG_PM=y
CONFIG_KEXEC_JUMP=y

2. Build patched kexec-tool or download the pre-built one.

3. Build some physical mode executable named such as "phy_mode"

4. Boot kernel compiled in step 1.

5. Load physical mode executable with /sbin/kexec. The shell command
   line can be as follow:

   /sbin/kexec --load-preserve-context --args-none phy_mode

6. Call physical mode executable with following shell command line:

   /sbin/kexec -e

Implementation point:

To support jumping without reserving memory.  One shadow backup page (source
page) is allocated for each page used by kexeced code image (destination
page).  When do kexec_load, the image of kexeced code is loaded into source
pages, and before executing, the destination pages and the source pages are
swapped, so the contents of destination pages are backupped.  Before jumping
to the kexeced code image and after jumping back to the original kernel, the
destination pages and the source pages are swapped too.

C ABI (calling convention) is used as communication protocol between
kernel and called code.

A flag named KEXEC_PRESERVE_CONTEXT for sys_kexec_load is added to
indicate that the loaded kernel image is used for jumping back.

Now, only the i386 architecture is supported.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Nigel Cunningham <nigel@nigel.suspend2.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-26 12:00:04 -07:00
Thomas Petazzoni 2d6ffcca62 inflate: refactor inflate malloc code
Inflate requires some dynamic memory allocation very early in the boot
process and this is provided with a set of four functions:
malloc/free/gzip_mark/gzip_release.

The old inflate code used a mark/release strategy rather than implement
free.  This new version instead keeps a count on the number of outstanding
allocations and when it hits zero, it resets the malloc arena.

This allows removing all the mark and release implementations and unifying
all the malloc/free implementations.

The architecture-dependent code must define two addresses:
 - free_mem_ptr, the address of the beginning of the area in which
   allocations should be made
 - free_mem_end_ptr, the address of the end of the area in which
   allocations should be made. If set to 0, then no check is made on
   the number of allocations, it just grows as much as needed

The architecture-dependent code can also provide an arch_decomp_wdog()
function call.  This function will be called several times during the
decompression process, and allow to notify the watchdog that the system is
still running.  If an architecture provides such a call, then it must
define ARCH_HAS_DECOMP_WDOG so that the generic inflate code calls
arch_decomp_wdog().

Work initially done by Matt Mackall, updated to a recent version of the
kernel and improved by me.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-25 10:53:28 -07:00
Linus Torvalds ecc8b655b3 Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  nohz: adjust tick_nohz_stop_sched_tick() call of s390 as well
  nohz: prevent tick stop outside of the idle loop
2008-07-24 12:55:01 -07:00
Linus Torvalds 2528ce3237 Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  arch/mips/kernel/stacktrace.c: Heiko can't type
  kthread: reduce stack pressure in create_kthread and kthreadd
  fix core/stacktrace changes on avr32, mips, sh
2008-07-24 12:54:26 -07:00
Ulrich Drepper ed8cae8ba0 flag parameters: pipe
This patch introduces the new syscall pipe2 which is like pipe but it also
takes an additional parameter which takes a flag value.  This patch implements
the handling of O_CLOEXEC for the flag.  I did not add support for the new
syscall for the architectures which have a special sys_pipe implementation.  I
think the maintainers of those archs have the chance to go with the unified
implementation but that's up to them.

The implementation introduces do_pipe_flags.  I did that instead of changing
all callers of do_pipe because some of the callers are written in assembler.
I would probably screw up changing the assembly code.  To avoid breaking code
do_pipe is now a small wrapper around do_pipe_flags.  Once all callers are
changed over to do_pipe_flags the old do_pipe function can be removed.

The following test must be adjusted for architectures other than x86 and
x86-64 and in case the syscall numbers changed.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/syscall.h>

#ifndef __NR_pipe2
# ifdef __x86_64__
#  define __NR_pipe2 293
# elif defined __i386__
#  define __NR_pipe2 331
# else
#  error "need __NR_pipe2"
# endif
#endif

int
main (void)
{
  int fd[2];
  if (syscall (__NR_pipe2, fd, 0) != 0)
    {
      puts ("pipe2(0) failed");
      return 1;
    }
  for (int i = 0; i < 2; ++i)
    {
      int coe = fcntl (fd[i], F_GETFD);
      if (coe == -1)
        {
          puts ("fcntl failed");
          return 1;
        }
      if (coe & FD_CLOEXEC)
        {
          printf ("pipe2(0) set close-on-exit for fd[%d]\n", i);
          return 1;
        }
    }
  close (fd[0]);
  close (fd[1]);

  if (syscall (__NR_pipe2, fd, O_CLOEXEC) != 0)
    {
      puts ("pipe2(O_CLOEXEC) failed");
      return 1;
    }
  for (int i = 0; i < 2; ++i)
    {
      int coe = fcntl (fd[i], F_GETFD);
      if (coe == -1)
        {
          puts ("fcntl failed");
          return 1;
        }
      if ((coe & FD_CLOEXEC) == 0)
        {
          printf ("pipe2(O_CLOEXEC) does not set close-on-exit for fd[%d]\n", i);
          return 1;
        }
    }
  close (fd[0]);
  close (fd[1]);

  puts ("OK");

  return 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Ulrich Drepper <drepper@redhat.com>
Acked-by: Davide Libenzi <davidel@xmailserver.org>
Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:28 -07:00
Johannes Weiner 3560e249ab bootmem: replace node_boot_start in struct bootmem_data
Almost all users of this field need a PFN instead of a physical address,
so replace node_boot_start with node_min_pfn.

[Lee.Schermerhorn@hp.com: fix spurious BUG_ON() in mark_bootmem()]
Signed-off-by: Johannes Weiner <hannes@saeureba.de>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:20 -07:00
Andi Kleen ceb8687961 hugetlb: introduce pud_huge
Straight forward extensions for huge pages located in the PUD instead of
PMDs.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: 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>
2008-07-24 10:47:18 -07:00
Andi Kleen a551643895 hugetlb: modular state for hugetlb page size
The goal of this patchset is to support multiple hugetlb page sizes.  This
is achieved by introducing a new struct hstate structure, which
encapsulates the important hugetlb state and constants (eg.  huge page
size, number of huge pages currently allocated, etc).

The hstate structure is then passed around the code which requires these
fields, they will do the right thing regardless of the exact hstate they
are operating on.

This patch adds the hstate structure, with a single global instance of it
(default_hstate), and does the basic work of converting hugetlb to use the
hstate.

Future patches will add more hstate structures to allow for different
hugetlbfs mounts to have different page sizes.

[akpm@linux-foundation.org: coding-style fixes]
Acked-by: Adam Litke <agl@us.ibm.com>
Acked-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:17 -07:00
Johannes Weiner b61bfa3c46 mm: move bootmem descriptors definition to a single place
There are a lot of places that define either a single bootmem descriptor or an
array of them.  Use only one central array with MAX_NUMNODES items instead.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Kyle McMartin <kyle@parisc-linux.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:14 -07:00
David Brownell 9483a578df add HAVE_CLK to Kconfig, for driver dependencies
Flag platforms as HAVE_CLK (or not) in Kconfig, based on whether they
support <linux/clk.h> calls, so that otherwise portable drivers which need
those calls can list that dependency.

Something like this is a prerequisite for merging the musb_hdrc driver,
currently used on platforms including Davinci, OMAP2430, OMAP3xx ...  and
the discrete TUSB6010 chip, which doesn't have a natural platform
dependency.  (Used with OMAP 2420 in current Nokia N8x0 tablets.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:13 -07:00
Linus Torvalds 30d38542ec Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (85 commits)
  [ARM] pxa: add base support for PXA930 Handheld Platform (aka SAAR)
  [ARM] pxa: add base support for PXA930 Evaluation Board (aka TavorEVB)
  [ARM] pxa: add base support for PXA930 (aka Tavor-P)
  [ARM] Update mach-types
  [ARM] pxa: make littleton to use the new smc91x platform data
  [ARM] pxa: make zylonite to use the new smc91x platform data
  [ARM] pxa: make mainstone to use the new smc91x platform data
  [ARM] pxa: make lubbock to use new smc91x platform data
  [NET] smc91x: prepare SMC_USE_PXA_DMA to be specified in platform data
  [NET] smc91x: prepare for SMC_IO_SHIFT to be a platform configurable variable
  [NET] smc91x: add SMC91X_NOWAIT flag to platform data
  [NET] smc91x: favor the use of SMC91X_USE_* instead of SMC_CAN_USE_*
  [NET] smc91x: remove "irq_flags" from "struct smc91x_platdata"
  [ARM] 5146/1: pxa2xx: convert all boards to call pxa2xx_transceiver_mode helper
  Support for LCD on e740 e750 e400 and e800 e-series PDAs
  E-series UDC support
  PXA UDC - allow use of inverted GPIO for pullup
  Add e350 support
  Fix broken e-series build
  E-series GPIO / IRQ definitions.
  ...
2008-07-23 18:24:08 -07:00
Andi Kleen 4a0b2b4dbe sysdev: Pass the attribute to the low level sysdev show/store function
This allow to dynamically generate attributes and share show/store
functions between attributes. Right now most attributes are generated
by special macros and lots of duplicated code. With the attribute
passed it's instead possible to attach some data to the attribute
and then use that in shared low level functions to do different things.

I need this for the dynamically generated bank attributes in the x86
machine check code, but it'll allow some further cleanups.

I converted all users in tree to the new show/store prototype. It's a single
huge patch to avoid unbisectable sections.

Runtime tested: x86-32, x86-64
Compiled only: ia64, powerpc
Not compile tested/only grep converted: sh, arm, avr32

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-07-21 21:55:02 -07:00
Dmitry Baryshkov 9de90ac27d Sh: use generic per-device coherent dma allocator
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-18 21:14:02 +02:00
Ingo Molnar 9b610fda0d Merge branch 'linus' into timers/nohz 2008-07-18 19:53:16 +02:00
Thomas Gleixner b8f8c3cf0a nohz: prevent tick stop outside of the idle loop
Jack Ren and Eric Miao tracked down the following long standing
problem in the NOHZ code:

	scheduler switch to idle task
	enable interrupts

Window starts here

	----> interrupt happens (does not set NEED_RESCHED)
	      	irq_exit() stops the tick

	----> interrupt happens (does set NEED_RESCHED)

	return from schedule()
	
	cpu_idle(): preempt_disable();

Window ends here

The interrupts can happen at any point inside the race window. The
first interrupt stops the tick, the second one causes the scheduler to
rerun and switch away from idle again and we end up with the tick
disabled.

The fact that it needs two interrupts where the first one does not set
NEED_RESCHED and the second one does made the bug obscure and extremly
hard to reproduce and analyse. Kudos to Jack and Eric.

Solution: Limit the NOHZ functionality to the idle loop to make sure
that we can not run into such a situation ever again.

cpu_idle()
{
	preempt_disable();

	while(1) {
		 tick_nohz_stop_sched_tick(1); <- tell NOHZ code that we
		 			          are in the idle loop

		 while (!need_resched())
		       halt();

		 tick_nohz_restart_sched_tick(); <- disables NOHZ mode
		 preempt_enable_no_resched();
		 schedule();
		 preempt_disable();
	}
}

In hindsight we should have done this forever, but ... 

/me grabs a large brown paperbag.

Debugged-by: Jack Ren <jack.ren@marvell.com>, 
Debugged-by: eric miao <eric.y.miao@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-07-18 18:10:28 +02:00
Heiko Carstens 8b95d9172b fix core/stacktrace changes on avr32, mips, sh
Fixes this type of problem:

  CC      arch/s390/kernel/stacktrace.o
arch/s390/kernel/stacktrace.c:84: warning: data definition has no type or storage class
arch/s390/kernel/stacktrace.c:84: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
arch/s390/kernel/stacktrace.c:84: warning: parameter names (without types) in function declaration
arch/s390/kernel/stacktrace.c:97: warning: data definition has no type or storage class
arch/s390/kernel/stacktrace.c:97: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_GPL'
arch/s390/kernel/stacktrace.c:97: warning: parameter names (without types) in function declaration

caused by "stacktrace: export save_stack_trace[_tsk]"

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-18 14:42:35 +02:00
Linus Torvalds dc7c65db28 Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (72 commits)
  Revert "x86/PCI: ACPI based PCI gap calculation"
  PCI: remove unnecessary volatile in PCIe hotplug struct controller
  x86/PCI: ACPI based PCI gap calculation
  PCI: include linux/pm_wakeup.h for device_set_wakeup_capable
  PCI PM: Fix pci_prepare_to_sleep
  x86/PCI: Fix PCI config space for domains > 0
  Fix acpi_pm_device_sleep_wake() by providing a stub for CONFIG_PM_SLEEP=n
  PCI: Simplify PCI device PM code
  PCI PM: Introduce pci_prepare_to_sleep and pci_back_from_sleep
  PCI ACPI: Rework PCI handling of wake-up
  ACPI: Introduce new device wakeup flag 'prepared'
  ACPI: Introduce acpi_device_sleep_wake function
  PCI: rework pci_set_power_state function to call platform first
  PCI: Introduce platform_pci_power_manageable function
  ACPI: Introduce acpi_bus_power_manageable function
  PCI: make pci_name use dev_name
  PCI: handle pci_name() being const
  PCI: add stub for pci_set_consistent_dma_mask()
  PCI: remove unused arch pcibios_update_resource() functions
  PCI: fix pci_setup_device()'s sprinting into a const buffer
  ...

Fixed up conflicts in various files (arch/x86/kernel/setup_64.c,
arch/x86/pci/irq.c, arch/x86/pci/pci.h, drivers/acpi/sleep/main.c,
drivers/pci/pci.c, drivers/pci/pci.h, include/acpi/acpi_bus.h) from x86
and ACPI updates manually.
2008-07-16 17:25:46 -07:00
Ingo Molnar 1a781a777b Merge branch 'generic-ipi' into generic-ipi-for-linus
Conflicts:

	arch/powerpc/Kconfig
	arch/s390/kernel/time.c
	arch/x86/kernel/apic_32.c
	arch/x86/kernel/cpu/perfctr-watchdog.c
	arch/x86/kernel/i8259_64.c
	arch/x86/kernel/ldt.c
	arch/x86/kernel/nmi_64.c
	arch/x86/kernel/smpboot.c
	arch/x86/xen/smp.c
	include/asm-x86/hw_irq_32.h
	include/asm-x86/hw_irq_64.h
	include/asm-x86/mach-default/irq_vectors.h
	include/asm-x86/mach-voyager/irq_vectors.h
	include/asm-x86/smp.h
	kernel/Makefile

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-15 21:55:59 +02:00
Linus Torvalds af5329cdf5 Merge branch 'core/stacktrace' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core/stacktrace' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  generic-ipi: powerpc/generic-ipi tree build failure
  stacktrace: fix build failure on sparc64
  stacktrace: export save_stack_trace[_tsk]
  stacktrace: fix modular build, export print_stack_trace and save_stack_trace
  backtrace: replace timer with tasklet + completions
  stacktrace: add saved stack traces to backtrace self-test
  stacktrace: print_stack_trace() cleanup
  debugging: make stacktrace independent from DEBUG_KERNEL
  stacktrace: don't crash on invalid stack trace structs
2008-07-15 10:31:35 -07:00
Linus Torvalds 85082fd7cb Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (241 commits)
  [ARM] 5171/1: ep93xx: fix compilation of modules using clocks
  [ARM] 5133/2: at91sam9g20 defconfig file
  [ARM] 5130/4: Support for the at91sam9g20
  [ARM] 5160/1: IOP3XX: gpio/gpiolib support
  [ARM] at91: Fix NAND FLASH timings for at91sam9x evaluation kits.
  [ARM] 5084/1: zylonite: Register AC97 device
  [ARM] 5085/2: PXA: Move AC97 over to the new central device declaration model
  [ARM] 5120/1: pxa: correct platform driver names for PXA25x and PXA27x UDC drivers
  [ARM] 5147/1: pxaficp_ir: drop pxa_gpio_mode calls, as pin setting
  [ARM] 5145/1: PXA2xx: provide api to control IrDA pins state
  [ARM] 5144/1: pxaficp_ir: cleanup includes
  [ARM] pxa: remove pxa_set_cken()
  [ARM] pxa: allow clk aliases
  [ARM] Feroceon: don't disable BPU on boot
  [ARM] Orion: LED support for HP mv2120
  [ARM] Orion: add RD88F5181L-FXO support
  [ARM] Orion: add RD88F5181L-GE support
  [ARM] Orion: add Netgear WNR854T support
  [ARM] s3c2410_defconfig: update for current build
  [ARM] Acer n30: Minor style and indentation fixes.
  ...
2008-07-14 16:06:58 -07:00
Linus Torvalds d18bb9a548 Merge branch 'core/rodata' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core/rodata' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  move BUG_TABLE into RODATA
2008-07-14 15:28:10 -07:00
Jonathan Corbet 2fceef397f Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
Russell King 044e5f45e4 Merge branch 'pxa' into devel
Conflicts:

	arch/arm/configs/em_x270_defconfig
	arch/arm/configs/xm_x270_defconfig
2008-07-13 12:05:49 +01:00
Eric Miao d280eadc4f [NET] smc91x: remove "irq_flags" from "struct smc91x_platdata"
IRQ trigger type can be specified in the IRQ resource definition by
IORESOURCE_IRQ_*, we need only one way to specify this.

This also fixes the following small issue:

To allow dynamic support for multiple platforms, when those relevant
macros are not defined for one specific platform, the default case
will be:

	- SMC_DYNAMIC_BUS_CONFIG defined
	- and SMC_IRQ_FLAGS = IRQF_TRIGGER_RISING

While if "irq_flags" is missing when defining the smc91x_platdata,
usually as follows:

  static struct smc91x_platdata xxxx_smc91x_data = {
	.flags	= SMC91X_USE_XXBIT,
  };

The lp->cfg.irq_flags will always be overriden by the above structure
(due to a memcpy), thus rendering lp->cfg.irq_flags to be "0" always.
(regardless of the default SMC_IRQ_FLAGS or IORESOURCE_IRQ_* flags)

Fixes this by forcing to use IORESOURCE_IRQ_* flags if present, and
make the only user of smc91x_platdata.irq_flags (renesas/migor) to
use IORESOURCE_IRQ_*.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-07-12 21:52:40 +01:00
Russell King a177ba3b7a Merge branches 'at91', 'dyntick', 'ep93xx', 'iop', 'ixp', 'misc', 'orion', 'omap-reviewed', 'rpc', 'rtc' and 's3c' into devel 2008-07-10 16:38:50 +01:00
Ingo Molnar 7b4c9505f2 stacktrace: export save_stack_trace[_tsk]
Andrew Morton reported this against linux-next:

ERROR: ".save_stack_trace" [tests/backtracetest.ko] undefined!

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-03 09:17:55 +02:00
Adrian Bunk 0aea531326 PCI: remove unused arch pcibios_update_resource() functions
Russell King did the following back in 2003:

<--  snip  -->

    [PCI] pci-9: Kill per-architecture pcibios_update_resource()

    Kill pcibios_update_resource(), replacing it with pci_update_resource().
    pci_update_resource() uses pcibios_resource_to_bus() to convert a
    resource to a device BAR - the transformation should be exactly the
    same as the transformation used for the PCI bridges.

    pci_update_resource "knows" about 64-bit BARs, but doesn't attempt to
    set the high 32-bits to anything non-zero - currently no architecture
    attempts to do something different.  If anyone cares, please fix; I'm
    going to reflect current behaviour for the time being.

    Ivan pointed out the following architectures need to examine their
    pcibios_update_resource() implementation - they should make sure that
    this new implementation does the right thing.  #warning's have been
    added where appropriate.

        ia64
        mips
        mips64

    This cset also includes a fix for the problem reported by AKPM where
    64-bit arch compilers complain about the resource mask being placed
    in a u32.

<--  snip  -->

This patch removes the unused pcibios_update_resource() functions the
kernel gained since, from FRV, m68k, mips & sh architectures.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2008-06-27 13:14:01 -07:00
Jens Axboe 15c8b6c1aa on_each_cpu(): kill unused 'retry' parameter
It's not even passed on to smp_call_function() anymore, since that
was removed. So kill it.

Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-06-26 11:24:38 +02:00
Jens Axboe 8691e5a8f6 smp_call_function: get rid of the unused nonatomic/retry argument
It's never used and the comments refer to nonatomic and retry
interchangably. So get rid of it.

Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-06-26 11:24:35 +02:00
Jens Axboe 490f5de52a sh: convert to generic helpers for IPI function calls
This converts sh to use the new helpers for smp_call_function() and
friends, and adds support for smp_call_function_single(). Not tested,
but it compiles.

Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-06-26 11:22:58 +02:00
Ingo Molnar 6d72b7952f Merge branch 'linus' into core/rodata 2008-06-16 11:24:00 +02:00
Paul Mundt e50901338b sh: Add -mno-fdpic to default flags.
Presently the --fdpic specifier and the --isa matching clash when
building with FDPIC toolchains. As we have no interest in building the
kernel with --fdpic in the first place, always try to add in -mno-fdpic
to the default flags.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-06-09 16:49:43 +09:00
Yoshihiro Shimoda b8858eed87 sh: add resource of USB host for SH7723
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-06-09 16:04:13 +09:00
Nobuhiro Iwamatsu 5bde47bc63 sh: Fix compile error SH7763 setup code
SH7763's setup code use old DECLARE_INTC_DESC.
There was a compile error because of this.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-06-09 16:04:12 +09:00
Yusuke.Goda 576b91873f sh: Add SH7723 SCIF support
Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-06-09 16:04:12 +09:00
Paul Mundt 39eb41ef07 sh: Add defconfig for RSK7203.
RSK7203 is supportable through the generic machvec, so we add a defconfig
for those bits. This gets updated with more complete board support later.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-06-03 20:30:10 +09:00
Paul Mundt f8cc3566d2 sh: Update SE7206 defconfig.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-06-03 20:29:55 +09:00
Paul Mundt 1f8404ea5f sh: Disable 4KSTACKS on nommu.
4k stacks on nommu ends up blowing up with all sorts of interesting
slab corruption. Disable this by default unless BROKEN is also
enabled.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-06-02 13:48:59 +09:00
Harvey Harrison 1f9d294939 sh: module.c use kernel unaligned helpers
Replace the COPY_UNALIGNED_WORD helper.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-06-02 12:30:00 +09:00
Adrian Bunk 2beb0e2893 sh/kernel/cpu/irq/intc-sh5.c build fix
This patch fixes the following build error caused by
commit a1dc4b59fa
(sh: intc_sh5 depends on cayman board for IRQ priority table.):

<--  snip  -->

...
  CC      arch/sh/kernel/cpu/irq/intc-sh5.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/kernel/cpu/irq/intc-sh5.c: In function 'plat_irq_setup':
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/kernel/cpu/irq/intc-sh5.c:257: error: expected declaration or statement at end of input
make[4]: *** [arch/sh/kernel/cpu/irq/intc-sh5.o] Error 1

<--  snip  -->

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-06-02 12:29:07 +09:00
Paul Mundt 9c28faaab1 sh: Drop broken URAM support on SH7723.
This was copied over from the previous MobileR bits, which doesn't
apply to R2. The URAM block on R2 is recycled for the L2 instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-26 11:45:45 +09:00
Jan Beulich 6360b1fbb4 move BUG_TABLE into RODATA
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-05-25 07:06:08 +02:00
Magnus Damm c511afb41f sh: update Migo-R defconfig
Update the Migo-R defconfig to include support for KEYSC, I2C, RTC and
NAND and NOR MTD devices.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-23 11:53:27 +09:00
Magnus Damm fa7ff08600 sh: use sm501 8250 mfd support on r2d boards
Make use of recently added sm501 8250 uart support, commit
61711f8fd8 makes the mfd code
handle 8250 uarts so there is no longer need to do it from
the r2d board code.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-23 11:53:24 +09:00
Magnus Damm b76baf4cf5 sh: add probe support for new sh7723 cut
This patch adds support for sh7723 silicon with a prr value of 0x51.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-23 11:53:20 +09:00
Magnus Damm 7601304472 sh: fix VPU interrupt vector for sh7723
This patch fixes a VPU vector typo for sh7723. The correct value is 0x980,
the same as for sh7722.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-23 11:53:16 +09:00
Magnus Damm 526c1c23a2 sh: fix USBF resource for sh7722
The USBF function on sh7722 is currently not working with the m66592_udc
driver. The driver is using platform_get_resource_byname() so my commit
a0d29798e5 broke sh7722 support.

The long term fix is to replace platform_get_resource_byname() in the
driver with platform_get_resource(), but this helps until that happens.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-23 11:53:12 +09:00
Al Viro 839cd31050 MODULE_LICENSE expects "GPL v2", not "GPLv2"
... and we have few enough places using the latter to make it
simpler to do search and replace...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-05-21 16:56:00 -07:00
Linus Torvalds e23a5f6687 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  [PATCH] return to old errno choice in mkdir() et.al.
  [Patch] fs/binfmt_elf.c: fix wrong return values
  [PATCH] get rid of leak in compat_execve()
  [Patch] fs/binfmt_elf.c: fix a wrong free
  [PATCH] avoid multiplication overflows and signedness issues for max_fds
  [PATCH] dup_fd() part 4 - race fix
  [PATCH] dup_fd() - part 3
  [PATCH] dup_fd() part 2
  [PATCH] dup_fd() fixes, part 1
  [PATCH] take init_files to fs/file.c
2008-05-19 16:37:45 -07:00
Paul Mundt 336f1d3268 sh: Fix up restorer in debug_trap exception return path.
There are a few different types of debug trap exceptions, though now
that they are all going through a special jump table, the restorer needs
to be unified as well.

Presently this is falling through the ret_from_fork path, which more or
less does the right thing on SH-3/4 whilst being completely unsuitable on
MMU-less targets.

Ultimately what we want here is a branch through the platform's
restore_all directly, without worrying about the retval being clobbered.
We can accomplish that through a branch to __restore_all directly, so
switch it so we come back from the jump table and branch to the restorer.

This fixes up a recursion in the nommu WARN_ON() path, as well as some
other userspace nastiness where said recursion caused serious stack
corruption.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-19 19:39:33 +09:00
Paul Mundt 9a33fc217d sh: Make is_valid_bugaddr() more intelligent on nommu.
Currently is_valid_bugaddr() is true for anything >= PAGE_OFFSET, which
happens to be 0 on nommu configurations. Make this a bit smarter by just
reading in the opcode and comparing it against the trap type that we
already know. Follows the logic from avr32.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-19 19:32:07 +09:00
Jonathan Corbet 1fa984b583 sh: cdev lock_kernel() pushdown
Push the cdev lock_kernel() call down into the sh gio driver.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2008-05-18 15:43:40 -06:00
Al Viro f52111b154 [PATCH] take init_files to fs/file.c
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-05-16 17:22:20 -04:00
Harvey Harrison bfd3c7a728 sh: use the common ascii hex helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-16 15:09:08 +09:00
Yoshihiro Shimoda 65b83427c6 sh: fix sh7785 master clock value
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-16 14:55:07 +09:00
Hideo Saito 561c2bccc7 sh: Fix up thread info pointer in syscall_badsys resume path.
Entry to resume_userspace expects r8 to contain current_thread_info,
which happens in all paths except for syscall_badsys, where r8 was
being inadvertently trampled. Reload it before the branch.

Signed-off-by: Hideo Saito <saito@densan.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-16 14:55:07 +09:00
Hideo Saito e08b954c9a sh: Fix up optimized SH-4 memcpy on big endian.
Signed-off-by: Hideo Saito <saito@densan.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-16 14:55:07 +09:00
Paul Mundt 972ad0e0d5 sh: disable initrd defaults in .empty_zero_page.
When using initramfs on systems that don't explicitly clear LOADER_TYPE,
unpack_to_rootfs() tramples tramples the range with the defaults taken
out of .empty_zero_page. This causes kernels with valid initramfs images
to bail out with crc or gzip magic mismatch errors after the second
unpack takes place on certain platform configurations.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-16 14:55:07 +09:00
Paul Mundt 0105346cc7 sh: display boot params by default on entry.
Some kernel and boot loader configurations tweak the .empty_zero_page
settings, while others do not. Print the values out on entry as a
debugging aid.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-16 14:55:06 +09:00
Harvey Harrison 3fc957721d lib: create common ascii hex array
Add a common hex array in hexdump.c so everyone can use it.

Add a common hi/lo helper to avoid the shifting masking that is
done to get the upper and lower nibbles of a byte value.

Pull the pack_hex_byte helper from kgdb as it is opencoded many
places in the tree that will be consolidated.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-05-14 19:11:14 -07:00
Russell King 150c917303 dyntick: remove deferences from SH
SH does not have a configuration option for NO_IDLE_HZ their Kconfig
files, yet their defconfig files lists them. Remove those references.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-05-12 17:39:16 +01:00
Roel Kluin 9731e287e0 SH: catch negative denormal_subf1() retval in denormal_add()
'ix' is unsigned but denormal_subf1() may return a negative int.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-09 20:05:10 +09:00
Paul Mundt f11c9c2fd9 sh: update smc91x platform data for se7206.
Follows the se7722 change.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-09 14:13:17 +09:00
Magnus Damm 4370fe1c06 sh: intc register modify fix
Make sure register modifications stay atomic. Fixes processors with
shared priority register masking. Dual bitmap masking is unaffected.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:52:07 +09:00
Magnus Damm 720be99006 sh: no high level trigger on some sh3 cpus
The processor models sh7706, sh7707 and sh7709 don't support high
level trigger sense configuration. And the intc code looks like
crap these days so what's the difference.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:52:06 +09:00
Magnus Damm 995d538a5b sh: clean up sh7710 and sh7720 intc tables
Clean up the intc tables by removing unneeded #ifdefs. The vector
list is what selects which interrupt sources that should be added,
having unsupported bitfields listed is ok as long as the vector
is excluded from the list.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:52:04 +09:00
Magnus Damm d58876e289 sh: add interrupt ack code to sh3
This patch adds interrupt acknowledge code for external interrupt
sources on sh3 processors. Only really required for edge triggered
interrupts, but we ack regardless of sense configuration.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:52:03 +09:00
Magnus Damm a276e588a9 sh: unify external irq pin code for sh3
This patch unifies the sh3 external irq pin code. It buys us some
savings with reduced code redundancy, but the main feature with
this change is irq sense selection support for all sh3 processors.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:52:00 +09:00
Magnus Damm 191d4437b9 sh: reset hardware from early printk
Reset the transmitter and receiver when setting up early printk.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:54 +09:00
Magnus Damm 4a65e3827b sh: drain and wait for early printk
Drain by waiting for all characters to be sent, and make sure to
wait a little bit after setting up the baud rate.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:53 +09:00
Magnus Damm 0fba321365 sh: use sci_out() for early printk
Use sci_out() instead of ctrl_outw() for early printk setup code.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:52 +09:00
Magnus Damm 0146ba78b9 sh: add memory resources to /proc/iomem
Add physical memory resources such as System RAM, Kernel code/data/bss
and reserved crash dump area to /proc/iomem. Same strategy as on x86.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:51 +09:00
Magnus Damm 3d83984e99 sh: add kernel bss resource
Do like everyone else and have a struct resource for kernel bss.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:49 +09:00
Magnus Damm 65c07d4b3d sh: fix sh7705 interrupt vector typo
Fix sh7705 interrupt sources for vectors 0xc80 and 0xca0.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:48 +09:00
Magnus Damm 57b84f2b67 sh: update smc91x platform data for se7722
Select smc91x bus width using platform data for se7722 now when the
smc91x header file is in place.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:48 +09:00
Magnus Damm 8a3ee0fc8f sh: update smc91x platform data for MigoR
Select smc91x bus width and irg flags using platform data for MigoR
now when the smc91x header file is in place.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:47 +09:00
Mathieu Desnoyers 8cd9612e9b sh: remove -traditional.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: Sam Ravnborg <sam@ravnborg.org>
CC: linux-sh@vger.kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:46 +09:00
Paul Mundt ae8a5348ac sh: r7780rp: Kill off unneded ifdefs for irq setup.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:44 +09:00
Paul Mundt e305ec80ea sh: rts7751r2d: Kill off unneeded ifdefs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:43 +09:00
Paul Mundt a1dc4b59fa sh: intc_sh5 depends on cayman board for IRQ priority table.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:43 +09:00
Paul Mundt 5e2c2872bd sh64: export onchip_remap/unmap() too.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:41 +09:00
Paul Mundt 971ac16d56 sh64: Some symbol exports to make the allmodconfig happier.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:41 +09:00
Adrian Bunk f5f826c685 sh: remove the broken SH_MPC1211 support
SH_MPC1211 has been marked as BROKEN for some time.

Unless someone is working on reviving it now, I'd therefore suggest this
patch to remove it.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:39 +09:00
Paul Mundt 2a6b8148c0 sh64: Setup I/D-TLB defaults in SH-5 probe path.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:38 +09:00
Paul Mundt 640f7487a9 sh: kexec and kdump depend on SUPERH32.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:37 +09:00
Paul Mundt 824fcdded0 sh64: Fix up compile warning in event tracer.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:37 +09:00
Paul Mundt ccd8058741 sh64: Fixup the nommu build.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:37 +09:00
Paul Mundt 9141d30a48 sh64: fixups for xtime_lock seqlock conversion.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:36 +09:00
Paul Mundt 1a013e2ffc sh: sh-bios depends on SUPERH32.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-08 19:51:35 +09:00
Ulrich Drepper d35c7b0e54 unified (weak) sys_pipe implementation
This replaces the duplicated arch-specific versions of "sys_pipe()" with
one unified implementation.  This removes almost 250 lines of duplicated
code.

It's marked __weak, so that *if* an architecture wants to override the
default implementation it can do so by simply having its own replacement
version, since many architectures use alternate calling conventions for
the 'pipe()' system call for legacy reasons (ie traditional UNIX
implementations often return the two file descriptors in registers)

I still haven't changed the cris version even though Linus says the BKL
isn't needed.  The arch maintainer can easily do it if there are really
no obstacles.

Signed-off-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-05-03 13:50:33 -07:00
Jean Delvare 3760f73671 i2c: Convert most new-style drivers to use module aliasing
Based on earlier work by Jon Smirl and Jochen Friedrich.

Update most new-style i2c drivers to use standard module aliasing
instead of the old driver_name/type driver matching scheme. I've
left the video drivers apart (except for SoC camera drivers) as
they're a bit more diffcult to deal with, they'll have their own
patch later.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Jon Smirl <jonsmirl@gmail.com>
Cc: Jochen Friedrich <jochen@scram.de>
2008-04-29 23:11:40 +02:00