Commit Graph

2991 Commits

Author SHA1 Message Date
Magnus Damm 6b3b55750b sh: ecovec build fix for CONFIG_I2C=n
Allow building the ecovec board support code
even though I2C support is disabled.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-26 15:30:08 +09:00
Magnus Damm 2839bd61f6 sh: ecovec r-standby support
This patch adds board specific r-standby resume code
for ecovec.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-26 15:29:28 +09:00
Magnus Damm b67cf2848a sh: ms7724se r-standby support
This patch adds board specific r-standby resume code
for ms7724se.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-26 15:29:27 +09:00
Magnus Damm 41bfb7d7a6 sh: SH-Mobile R-standby register save/restore
Add code to save/restore registers during
R-standby sleep on SH-Mobile processors.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-26 15:29:26 +09:00
Russell King 9f33be2c3a Merge branches 'clks' and 'pnx' into devel 2010-02-25 22:10:38 +00:00
Kuninori Morimoto 29463c28a5 sh: ms7724: modify scan_timing for KEYSC
KEYSC::SCN register of SH7724 is 3bit.
Thus, scan_timing should be 0 - 7 here.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-25 16:31:29 +09:00
Kuninori Morimoto bbb892aac4 sh: ms7724: Add sh_sir support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-25 16:31:28 +09:00
Kuninori Morimoto 2636571685 sh: mach-ecovec24: Add sh_sir support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-25 16:31:28 +09:00
Paul Mundt 94ea5e449a sh: wire up SET/GET_UNALIGN_CTL.
This hooks up the SET/GET_UNALIGN_CTL knobs cribbing the bulk of it from
the PPC and ia64 implementations. The thread flags happen to be the
logical inverse of what the global fault mode is set to, so this works
out pretty cleanly. By default the global fault mode is used, with tasks
now being able to override their own settings via prctl().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-23 12:56:30 +09:00
Paul Mundt 7c1b2c6890 sh: allow alignment fault mode to be configured at kernel boot.
Follow the ARM change, which is what our alignment helpers are based on
in the first place.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-23 11:48:50 +09:00
Dominik Brodowski 3b7a17fcda resource/PCI: mark struct resource as const
Now that we return the new resource start position, there is no
need to update "struct resource" inside the align function.
Therefore, mark the struct resource as const.

Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:16:57 -08:00
Dominik Brodowski b26b2d494b resource/PCI: align functions now return start of resource
As suggested by Linus, align functions should return the start
of a resource, not void. An update of "res->start" is no longer
necessary.

Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-22 16:16:56 -08:00
Kuninori Morimoto 16afc9fb02 sh: sh7724: Update FSI/SPU2 clock
When FSI and Network (= NFS file system) were used at the same time,
the I/O of FSI was unstable.  This patch updates the SPU2 clock (which
is used for FSI) to solve this issue.  Special thanks to Jeremy.

Signed-off-by: Jeremy Baker <Jeremy.Baker@renesas.com>
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-22 19:14:18 +09:00
Magnus Damm 6f26d19fce sh: always enable sh7724 vpu_clk and set to 166MHz on Ecovec
Update the sh7724 processor code to always enable vpu_clk.

On the Ecovec board, set the vpu_clk to 166 Mhz.

The 166MHz setting results in a divide-by-6 setup for
vpu_clk and improves the VPU performance compared to the
power-on-reset/bootloader configuration.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-22 19:11:23 +09:00
Magnus Damm 7be85c6eb4 sh: add sh7724 kick callback to clk_div4_table
This patch adds a ->kick() callback to clk_div4_table
and ties it into sh_clk_div4_set_rate(). A sh7724
specific kick function is also added that updates the
KICK bit whenever div4 clocks in FRQCRA and FRQCRB
have been set. Allows us to set the VPU clock.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-22 19:11:22 +09:00
Magnus Damm 0a5f337ecd sh: introduce struct clk_div4_table
This patch introduces struct clk_div4_table. The structure
will be used to keep div4 specific data, and is with this
patch replacing the struct clk_div_mult_table pointer arg
used by the sh_clk_div4_register() functions.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-22 19:11:20 +09:00
Magnus Damm de7ca2144c sh: clock-cpg div4 set_rate() shift fix
Make sure the div4 bitfield is shifted according
to the enable_bit value in sh_clk_div4_set_rate().

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-22 19:11:19 +09:00
Russell King 4b3073e1c5 MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself
On VIVT ARM, when we have multiple shared mappings of the same file
in the same MM, we need to ensure that we have coherency across all
copies.  We do this via make_coherent() by making the pages
uncacheable.

This used to work fine, until we allowed highmem with highpte - we
now have a page table which is mapped as required, and is not available
for modification via update_mmu_cache().

Ralf Beache suggested getting rid of the PTE value passed to
update_mmu_cache():

  On MIPS update_mmu_cache() calls __update_tlb() which walks pagetables
  to construct a pointer to the pte again.  Passing a pte_t * is much
  more elegant.  Maybe we might even replace the pte argument with the
  pte_t?

Ben Herrenschmidt would also like the pte pointer for PowerPC:

  Passing the ptep in there is exactly what I want.  I want that
  -instead- of the PTE value, because I have issue on some ppc cases,
  for I$/D$ coherency, where set_pte_at() may decide to mask out the
  _PAGE_EXEC.

So, pass in the mapped page table pointer into update_mmu_cache(), and
remove the PTE value, updating all implementations and call sites to
suit.

Includes a fix from Stephen Rothwell:

  sparc: fix fallout from update_mmu_cache API change

  Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-02-20 16:41:46 +00:00
Matt Fleming 8c563a30cd sh: Turn on speculative return for SH7785 and SH7786
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-18 18:54:18 +09:00
Paul Mundt 77f36fcc03 Merge branch 'sh/pmb-dynamic' 2010-02-18 18:35:20 +09:00
Paul Mundt d01447b319 sh: Merge legacy and dynamic PMB modes.
This implements a bit of rework for the PMB code, which permits us to
kill off the legacy PMB mode completely. Rather than trusting the boot
loader to do the right thing, we do a quick verification of the PMB
contents to determine whether to have the kernel setup the initial
mappings or whether it needs to mangle them later on instead.

If we're booting from legacy mappings, the kernel will now take control
of them and make them match the kernel's initial mapping configuration.
This is accomplished by breaking the initialization phase out in to
multiple steps: synchronization, merging, and resizing. With the recent
rework, the synchronization code establishes page links for compound
mappings already, so we build on top of this for promoting mappings and
reclaiming unused slots.

At the same time, the changes introduced for the uncached helpers also
permit us to dynamically resize the uncached mapping without any
particular headaches. The smallest page size is more than sufficient for
mapping all of kernel text, and as we're careful not to jump to any far
off locations in the setup code the mapping can safely be resized
regardless of whether we are executing from it or not.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-18 18:13:51 +09:00
Paul Mundt 2e450643d7 sh: Use uncached I/O helpers in PMB setup.
The PMB code is an example of something that spends an absurd amount of
time running uncached when only a couple of operations really need to be.
This switches over to the shiny new uncached helpers, permitting us to
spend far more time running cached.

Additionally, MMUCR twiddling is perfectly safe from cached space given
that it's paired with a control register barrier, so fix that up, too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-18 13:26:05 +09:00
Paul Mundt b8f7918f33 sh: Provide uncached I/O helpers.
There are lots of registers that can only be updated from the uncached
mapping, so we add some helpers for those cases in order to make it
easier to ensure that we only make the jump when it's absolutely
necessary.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-18 13:23:30 +09:00
Paul Mundt d53a0d33bc sh: PMB locking overhaul.
This implements some locking for the PMB code. A high level rwlock is
added for dealing with rw accesses on the entry map while a per-entry
data structure spinlock is added to deal with the PMB entry changing out
from underneath us.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-17 21:17:02 +09:00
Mike Frysinger e7b8e675d9 tracing: Unify arch_syscall_addr() implementations
Most implementations of arch_syscall_addr() are the same, so create a
default version in common code and move the one piece that differs (the
syscall table) to asm/syscall.h.  New arch ports don't have to waste
time copying & pasting this simple function.

The s390/sparc versions need to be different, so document why.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1264498803-17278-1-git-send-email-vapier@gentoo.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2010-02-17 13:07:21 +01:00
Paul Mundt 0065b96775 sh: Fix up dynamically created write-through PMB mappings.
Write-through PMB mappings still require the cache bit to be set, even if
they're to be flagged with a different cache policy and bufferability
bit. To reduce some of the confusion surrounding the flag encoding we
centralize the cache mask based on the system cache policy while we're at
it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-17 18:05:23 +09:00
Paul Mundt d7813bc9e8 sh: Build PMB entry links for existing contiguous multi-page mappings.
This plugs in entry sizing support for existing mappings and then builds
on top of that for linking together entries that are mapping contiguous
areas. This will ultimately permit us to coalesce mappings and promote
head pages while reclaiming PMB slots for dynamic remapping.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-17 17:56:38 +09:00
Paul Mundt 9edef28653 sh: uncached mapping helpers.
This adds some helper routines for uncached mapping support. This
simplifies some of the cases where we need to check the uncached mapping
boundaries in addition to giving us a centralized location for building
more complex manipulation on top of.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-17 16:28:00 +09:00
Paul Mundt 51becfd962 sh: PMB tidying.
Some overdue cleanup of the PMB code, killing off unused functionality
and duplication sprinkled about the tree.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-17 15:33:30 +09:00
Paul Mundt 7bdda6209f sh: Fix up more 64-bit pgprot truncation on SH-X2 TLB.
Both the store queue API and the PMB remapping take unsigned long for
their pgprot flags, which cuts off the extended protection bits. In the
case of the PMB this isn't really a problem since the cache attribute
bits that we care about are all in the lower 32-bits, but we do it just
to be safe. The store queue remapping on the other hand depends on the
extended prot bits for enabling userspace access to the mappings.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-17 13:23:00 +09:00
Magnus Damm 838a4a9dce sh: fix sh7723 SDHI support using INTC force_disable
Update the sh7723 INTC tables with force_enable support
to mask out pending unsupported SDHI interrupt sources.

Without this patch the kernel locks up due to a pending
SDHI interrupt that the tmio_mmc driver cannot handle.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-17 12:45:44 +09:00
Magnus Damm e9125ac0bf sh: fix sh7722 SDHI support using INTC force_disable
Update the sh7722 INTC tables with force_enable support
to mask out pending unsupported SDHI interrupt sources.

Without this patch the kernel locks up due to a pending
SDHI interrupt that the tmio_mmc driver cannot handle.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-17 12:45:43 +09:00
Paul Mundt 49f3bfe933 sh: Setup boot CPU VBR early to enable early page faults.
vmemmap and the vmsplit code amongst others need to be able to take page
faults much earlier than trap_init() time, so move this in to the early
CPU initialization. VBR setup for secondary CPUs is already handled
through start_secondary(), so we only need to do this for the boot CPU.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-17 12:33:22 +09:00
Paul Mundt 1d5cfcdff7 sh: Kill off some superfluous legacy PMB special casing.
The __va()/__pa() offsets and the boot memory offsets are consistent for
all PMB users, so there is no need to special case these for legacy PMB.
Kill the special casing off and depend on CONFIG_PMB across the board.
This also fixes up yet another addressing bug for sh64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-16 21:43:38 +09:00
Paul Mundt efd54ea315 sh: Merge the legacy PMB mapping and entry synchronization code.
This merges the code for iterating over the legacy PMB mappings and the
code for synchronizing software state with the hardware mappings. There's
really no reason to do the same iteration twice, and this also buys us
the legacy entry logging facility for the dynamic PMB case.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-16 18:39:30 +09:00
Paul Mundt 55cef91a5d sh: Prevent fixed slot PMB remapping from clobbering boot entries.
The PMB initialization code walks the entries and synchronizes the
software PMB state with the hardware mappings, preserving the slot index.
Unfortunately pmb_alloc() only tested the bit position in the entry map
and failed to set it, resulting in subsequent remaps being able to be
dynamically assigned a slot that trampled an existing boot mapping with
general badness ensuing.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-16 17:14:04 +09:00
Nobuhiro Iwamatsu 319c2cc761 sh: Fix zImage boot using fixed PMB.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-16 13:50:26 +09:00
Magnus Damm fb1e776050 sh: fix sh7724 SDHI support using INTC force_disable
Update the sh7724 INTC tables with force_enable support
to mask out pending unsupported SDHI interrupt sources.

Without this patch the kernel locks up due to a pending
SDHI interrupt that the tmio_mmc driver cannot handle.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-16 13:38:57 +09:00
Paul Mundt 04c8697355 sh: Fix up legacy PMB mode offset calculation.
The change for fixing up sh64 inadvertently inverted the logic for legacy
PMB, fix that back up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-15 16:10:57 +09:00
Paul Mundt 028c5d5d59 Merge branch 'sh/stable-updates' 2010-02-15 14:49:37 +09:00
Paul Mundt 4b505db9c4 sh64: fix tracing of signals.
This follows the parisc change to ensure that tracehook_signal_handler()
is aware of when we are single-stepping in order to ptrace_notify()
appropriately. While this was implemented for 32-bit SH, sh64 neglected
to make use of TIF_SINGLESTEP when it was folded in with the 32-bit code,
resulting in ptrace_notify() never being called.

As sh64 uses all of the other abstractions already, this simply plugs in
the thread flag in the appropriate enable/disable paths and fixes up the
tracehook notification accordingly. With this in place, sh64 is brought
in line with what 32-bit is already doing.

Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-15 14:17:45 +09:00
Paul Mundt 19f6b8b44e sh64: fix up memory offset calculation.
The linker script offsets were broken by the recent 29/32-bit
integration, so this fixes it up for sh64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-12 15:41:45 +09:00
Paul Mundt b0f3ae03ac sh: Isolate uncached mapping support.
This splits out the uncached mapping support under its own config option,
presently only used by 29-bit mode and 32-bit + PMB. This will make it
possible to optionally add an uncached mapping on sh64 as well as booting
without an uncached mapping for 32-bit.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-12 15:40:00 +09:00
Paul Mundt a4dad4c75c sh: update sdk7786 defconfig.
This plugs in USB and PCI and other bits for SDK7786.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-10 16:06:42 +09:00
Paul Mundt 7578a4c625 sh: Fix up multi-resource mapping for SH7786 PCIe.
This reworks some of the SH7786 PCIe initialization code to dynamically
setup and size the various resource windows, as opposed to the original
code that simply wired in a couple of them statically.

At the same time, we tidy up the initialization code a bit, kill off some
read-only register twiddling that was gleaned from the bus analyzer, and
also propagate the physical slot/channel mapping.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-10 16:00:58 +09:00
Magnus Damm 801cd56e3e sh: break out enable/reparent div4 clocks on sh7723
Break out sh7723 div4 clocks for SIU and IRDA as
reparent / enable clocks. Similar to the SIU clock
patch for sh7722 by Guennadi.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-09 18:24:31 +09:00
Magnus Damm 3844eadcfd sh: sh7724/Ecovec24/KFR2R09/MS7724SE SDHI vector merge
Merge the SDHI vectors in the sh7724 INTC table
and update the SDHI platform data for Ecovec24,
KFR2R09 and MS7724SE.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-09 18:24:30 +09:00
Magnus Damm e3e80046e0 sh: sh7723/AP325 SDHI vector merge
Merge the SDHI vectors in the sh7723 INTC table
and update the SDHI platform data for AP325.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-09 18:24:30 +09:00
Magnus Damm 8d9adabac3 sh: sh7722/Migo-R SDHI vector merge
Merge the SDHI vectors in the sh7722 INTC table
and update the SDHI platform data for Migo-R.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-09 18:24:29 +09:00
Paul Mundt 7561f2dd39 sh: Fix up SH7786 PCI resource definitions.
This adds in some of the missing memory resources for channels 1/2 and
gets the code building again for the recent changes.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-08 16:36:56 +09:00
Paul Mundt 13fd7aeb9a Merge branches 'sh/dwarf-unwinder', 'sh/g3-prep' and 'sh/stable-updates' 2010-02-08 11:48:10 +09:00
Paul Mundt 2e18e04798 Merge branch 'sh/dmaengine'
Conflicts:
	arch/sh/drivers/dma/dma-sh.c
2010-02-08 11:34:03 +09:00
Matt Fleming 858918b77b sh: Optimise FDE/CIE lookup by using red-black trees
Now that the DWARF unwinder is being used to provide perf callstacks
unwinding speed is an issue. It is no longer being used in exceptional
circumstances where we don't care about runtime performance, e.g. when
panicing, so it makes sense improve performance is possible.

With this patch I saw a 42% improvement in unwind time when calling
return_address(1). Greater improvements will be seen as the number of
levels unwound increases as each unwind is now cheaper.

Note that insertion time has doubled but that's just the price we pay
for keeping the trees balanced. However, this is a one-time cost for
kernel boot/module load and so the improvements in lookup time dominate
the extra time we spend keeping the trees balanced.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-08 11:29:15 +09:00
Matt Fleming 1af0b2fc67 sh: Remove superfluous setup_frame_reg call
There's no need to setup the frame pointer again in
call_handle_tlbmiss. The frame pointer will already have been setup in
handle_interrupt.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-08 10:47:11 +09:00
Matt Fleming 944a343861 sh: Don't continue unwinding across interrupts
Unfortunately, due to poor DWARF info in current toolchains, unwinding
through interrutps cannot be done reliably. The problem is that the
DWARF info for function epilogues is wrong.

Take this standard epilogue sequence,

80003cc4:       e3 6f           mov     r14,r15
80003cc6:       26 4f           lds.l   @r15+,pr
80003cc8:       f6 6e           mov.l   @r15+,r14
						<---- interrupt here
80003cca:       f6 6b           mov.l   @r15+,r11
80003ccc:       f6 6a           mov.l   @r15+,r10
80003cce:       f6 69           mov.l   @r15+,r9
80003cd0:       0b 00           rts

If we take an interrupt at the highlighted point, the DWARF info will
bogusly claim that the return address can be found at some offset from
the frame pointer, even though the frame pointer was just restored. The
worst part is if the unwinder finds a text address at the bogus stack
address - unwinding will continue, for a bit, until it finally comes
across an unexpected address on the stack and blows up.

The only solution is to stop unwinding once we've calculated the
function that was executing when the interrupt occurred. This PC can be
easily calculated from pt_regs->pc.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-08 10:47:04 +09:00
Matt Fleming 1dca56f138 sh: Setup frame pointer in handle_exception path
In order to allow the DWARF unwinder to unwind through exceptions we
need to setup the frame pointer register (r14).

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-08 10:46:53 +09:00
Matt Fleming 142698282c sh: Correct the offset of the return address in ret_from_exception
The address that ret_from_exception and ret_from_irq will return to is
found in the stack slot for SPC, not PR. This error was causing the
DWARF unwinder to pick up the wrong return address on the stack and then
unwind using the unwind tables for the wrong function.

While I'm here I might as well add CFI annotations for the other
registers since they could be useful when unwinding.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-08 10:46:46 +09:00
Guennadi Liakhovetski cfefe99795 sh: implement DMA_SLAVE capability in SH dmaengine driver
Tested to work with a SIU ASoC driver on sh7722 (migor).

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-08 09:40:26 +09:00
Guennadi Liakhovetski 623b4ac4bf sh: fix Transfer Size calculation in both DMA drivers
Both the original arch/sh/drivers/dma/dma-sh.c and the new SH dmaengine drivers
do not take into account bits 3:2 of the Transfer Size field in the CHCR
register, besides, bit-field defines set bit 2, but the mask only passes bits
1:0 through. TS_16BLK and TS_32BLK macros are bogus too. This patch fixes all
these issues for sh7722 and sh7724, other CPUs stay unchanged and might need to
be fixed too.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-08 09:40:24 +09:00
James Bottomley c9334f6067 sh: add mm API for DMA to vmalloc/vmap areas
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-05 12:32:34 -06:00
Uwe Kleine-König 659431fcaf fix typos "precidence" -> "precedence" in comments
This patch was generated by

	git grep -E -i -l 'precidence' | xargs -r perl -p -i -e 's/precidence/precedence/'

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-05 12:22:39 +01:00
Paul Mundt b06ede84dd sh: Fix up hp6xx build.
With the sparseirq conversion there was a stray irq_desc reference left
over, this tidies it up and brings the demuxer in line with what the
solution engine boards are doing.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-05 17:45:14 +09:00
Paul Mundt 3b0be1a4f2 sh: Fix an off-by-1 in SH7780 PCIC memory resource mapping.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-05 16:11:25 +09:00
Paul Mundt 9ad62ec4f7 sh: Fix up early PCI PERR/SERR IRQ handling.
This adds support for handling early PERR/SERR triggering in between
controller registration and the initial bus scan. Buggy cards end up
asserting these as soon as the M66EN scan is undertaken, resulting in
an early crash.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-03 16:46:20 +09:00
Paul Mundt 37feecb0ae sh: Disable generic IRQ probing.
IRQ autoprobing hasn't actually worked for us at all since very early in
2.6, but no one seems to have noticed given that none of the drivers
that use it see much testing.

yenta_socket is the odd one out, and that depends on PCI IRQs which are
fixed on all SH platforms anyways. Consequently, turning off autoprobing
fixes up crashes triggered by yenta_socket and at least gets it working
again on r7785rp.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-02 19:17:42 +09:00
Paul Mundt 4b842c8571 sh: enable sparseirq for highlander and r2d.
highlander and r2d are the only remaining ones that were blocking
sparseirq being turned on by default, but it turns out that they already
work fine with it by virtue of register_intc_controller(). As such, we
can kill off the dependencies and turn it on by default.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-02 19:15:17 +09:00
Paul Mundt deb9b22b89 sh: mach-dreamcast: Convert to sparseirq.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-02 18:01:55 +09:00
Paul Mundt 6eb6f98396 sh: hd6446x: Convert to sparseirq.
Follows the se7724 change and converts the hd64461 IRQ handling to
sparseirq.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-02 17:48:17 +09:00
Paul Mundt c7a967273a sh: mach-se: Convert SH7724 solution engine FPGA to sparseirq.
This uses the new create_irq_nr() to build up the FPGA's desired virtual
IRQ mapping and permits us to finally flip on sparseirq for this board.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-02 17:38:04 +09:00
Guennadi Liakhovetski b4f74767a0 sh: add high impedance mode management for SIUA pins on sh7722
This improves power management for the SIUA controller on sh7722. Similar
patches might be desired for other SIU-enabled SH platforms.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-02 13:02:30 +09:00
Paul Mundt 9d3f1881ab Merge branch 'sh/stable-updates' 2010-02-02 11:33:45 +09:00
Marek Skuczynski bc10e875d4 sh: Fix access to released memory in clk_debugfs_register_one()
Signed-off-by: Marek Skuczynski <mareksk7@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-02 11:32:23 +09:00
Marek Skuczynski 00b3e0a2e0 sh: Fix access to released memory in dwarf_unwinder_cleanup()
Signed-off-by: Marek Skuczynski <mareksk7@gmail.com>
Acked-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-02 11:32:22 +09:00
Paul Mundt b6c58b1d98 sh: Improved multi-resource handling for SH7780 PCI.
The SH7780 PCI controller supports 3 different ranges of PCI memory in
addition to its PCI I/O window. In the case of 29-bit mode, only 2 memory
windows are supported, while in 32-bit mode all 3 are visible. This
attempts to make the resource handling completely dynamic and to permit
platforms to map in as many apertures as they can handle.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-01 20:01:50 +09:00
Paul Mundt ef407beefb sh: Hook up ERR/PERR/SERR detection for SH7780 PCI host controllers.
These were never handled before, so implement some common infrastructure
to support them, then make use of that in the SH7780-specific code. In
practice there is little here that can not be generalized for SH4 parts,
which will be an incremental change as the 7780/7751 code is gradually
unified.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-01 16:39:46 +09:00
Paul Mundt bcf39352eb sh: Handle PCI controller resource conflicts.
register_pci_controller() can fail, but presently is a void function.
Change this over to an int so that we can bail early before continuing on
with post-registration initialization (such as throwing the controller in
to 66MHz mode in the case of the SH7780 host controller).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-01 13:11:25 +09:00
Paul Mundt 85b59f5bb2 sh: Enable PCI66 support for SH7780 host controller.
This adds some helper glue for scanning the bus and determining if all
of the devices are 66MHz capable or not before flipping on 66MHz mode.
This isn't quite to spec, but it's fairly consistent with what other
embedded controllers end up having to do.

Scanning code cribbed from the MIPS txx9 PCI code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-01 13:01:42 +09:00
Paul Mundt aee4467b5c sh: Fix up large system memory handling for SH7780 PCI.
For systems that have more than 512MB we need to set up an additional
mapping, this fixes up the rounding to the next power of two and splits
out the mapping accordingly between the two local bus mapping windows.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-01 11:33:22 +09:00
Paul Mundt 31a090ae06 sh: Fix up asm/hw_breakpoint.h header check.
Presently headers_check complains about linux/kdebug.h being unexported,
so just bump the __KERNEL__ ifdef up, as per the x86 change.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-30 11:29:56 +09:00
Paul Mundt 97b19778ee sh: mach-se: Fix up irq_desc reference.
The irq_desc needs to be accessed with irq_to_desc(), this fixes up a
build error with irq_desc being undefined.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-30 11:04:38 +09:00
Paul Mundt 396c56a9c6 sh: Kill off broken type 1 PCI config access checks.
The host controllers only support type 1, so there's not much else to
test for. Some of the older controllers also supported type 2 accesses,
but we've never supported those, and likely never will. Beyond that, the
P1SEG test is meaningless for 32-bit mode, so rather than refactoring it,
just kill the type 1 test off completely.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-30 01:41:21 +09:00
Linus Torvalds 221af7f87b Split 'flush_old_exec' into two functions
'flush_old_exec()' is the point of no return when doing an execve(), and
it is pretty badly misnamed.  It doesn't just flush the old executable
environment, it also starts up the new one.

Which is very inconvenient for things like setting up the new
personality, because we want the new personality to affect the starting
of the new environment, but at the same time we do _not_ want the new
personality to take effect if flushing the old one fails.

As a result, the x86-64 '32-bit' personality is actually done using this
insane "I'm going to change the ABI, but I haven't done it yet" bit
(TIF_ABI_PENDING), with SET_PERSONALITY() not actually setting the
personality, but just the "pending" bit, so that "flush_thread()" can do
the actual personality magic.

This patch in no way changes any of that insanity, but it does split the
'flush_old_exec()' function up into a preparatory part that can fail
(still called flush_old_exec()), and a new part that will actually set
up the new exec environment (setup_new_exec()).  All callers are changed
to trivially comply with the new world order.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-01-29 08:22:01 -08:00
Paul Mundt 320e68da59 sh: support PCI domains.
Newer SH parts are now commonly shipping with multiple controllers, so
we wire up PCI domain support to deal with them. Shamelessly cloned from
the MIPS implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-29 22:38:13 +09:00
Paul Mundt ac8ab54a8e sh: Bail out early on PCI resource conflicts.
Presently we just call in to request_resource() for the ioport and iomem
resources without checking for errors. This has already hidden a couple
of bugs, so add some error handling in for good measure.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-29 22:22:27 +09:00
Paul Mundt a45635dfb0 sh: Reworked SH7780 PCI initialization.
This consolidates the PCI initialization code for all of the pci-sh7780
users, and sets up the memory window dynamically as opposed to using
hardcoded window positions.

A number of bugs were fixed at the same time, including the PIO handling
and master abort timeout settings being incorrect.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-29 22:19:04 +09:00
Ingo Molnar ae7f6711d6 Merge branch 'perf/urgent' into perf/core
Merge reason: We want to queue up a dependent patch. Also update to
              later -rc's.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-01-29 10:36:22 +01:00
Paul Mundt 9762528f37 sh: Kill off deprecated fixed PCI memory window accessors.
This kills off the deprected fixed memory range accessors for
the cases of non-translatable ioremapping.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-29 16:14:29 +09:00
Anton Blanchard 339ce1a4dc perf: Fix inconsistency between IP and callchain sampling
When running perf across all cpus with backtracing (-a -g), sometimes we
get samples without associated backtraces:

    23.44%         init  [kernel]                     [k] restore
    11.46%         init                       eeba0c  [k] 0x00000000eeba0c
     6.77%      swapper  [kernel]                     [k] .perf_ctx_adjust_freq
     5.73%         init  [kernel]                     [k] .__trace_hcall_entry
     4.69%         perf  libc-2.9.so                  [.] 0x0000000006bb8c
                       |
                       |--11.11%-- 0xfffa941bbbc

It turns out the backtrace code has a check for the idle task and the IP
sampling does not. This creates problems when profiling an interrupt
heavy workload (in my case 10Gbit ethernet) since we get no backtraces
for interrupts received while idle (ie most of the workload).

Right now x86 and sh check that current is not NULL, which should never
happen so remove that too.

Idle task's exclusion must be performed from the core code, on top
of perf_event_attr:exclude_idle.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mundt <lethal@linux-sh.org>
LKML-Reference: <20100118054707.GT12666@kryten>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2010-01-28 14:31:20 +01:00
Paul Mundt abec86a802 sh: Kill off superfluous sh_bios references from compressed loader.
The VBR value needs to be initialized in order for any of the bios
trapping to work, and as we don't do that until slightly later in the
boot process, this has no real chance of working.

The only reason for using this in the past was due to the fact that early
serial initialization wasn't possible, but now that early sh-sci is
supported by everyone, there's no longer any reason to support the
sh_bios hacks in the first place. Given that, we just kill off the
references completely.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-28 18:26:37 +09:00
Paul Mundt d627a2ebd1 sh: Fix up the ioremap_fixed() build for nommu.
arch/sh/kernel/setup.c:455: error: implicit declaration of function 'ioremap_fixed_init'

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-28 18:17:29 +09:00
Paul Mundt 849593591c sh: Fix up read-only variable assignment in pcibios_align_resource().
arch/sh/drivers/pci/pci.c:167: error: assignment of read-only location '*res'

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-28 18:15:05 +09:00
Paul Mundt 621266bdf4 sh: Quiet noisy coherent DMA unmapping on R2D.
IRQs are re-enabled at a later stage when doing the unmapping on R2D via
the sm501 USB coherent DMA, resulting in the irqs_disabled() check
producing considerable noise for this configuration. Just kill off the
check, which was blindly copied from x86 anyways.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-28 15:55:37 +09:00
Paul Mundt f655f5e956 sh: mach-titan: Kill off unused PIO port mangling.
Nothing is using this, kill it off. Fixing up access sizes can be done
with trapped I/O for anyone wanting to make use of this for devices that
need it, everything else is already pure MMIO.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-28 15:08:21 +09:00
Giuseppe CAVALLARO 7013109f52 sh: fixed cmpxchg gRB version
This patch fixes a bug within the cmpxchg GRB version.

A problem was notices while running some tests to stress
the priority inheritance, for example pi_stress
(http://rt.wiki.kernel.org/index.php/PI_Mutex_Test).

Also, without this patch, after applying the latest work to
consolidate atomic_cmpxchg() definitions (commit:
8c0b8139c8)
the Kernel doesn't boot at all.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-27 22:36:25 +09:00
Chris Smith 660e2acad8 sh: kmemleak support.
Enables support for kmemleak on sh.

Signed-off-by: Chris Smith <chris.smith@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-27 22:03:11 +09:00
Paul Mundt 08b36c4a02 sh: Optimize runtime disabling of trapped I/O.
Presently trapped I/O is only registered if it's not explicitly disabled
for the platforms that select it openly. From the fault path this runs
through an address lookup before figuring out that nothing matches and
falls back through the error path, but we can forego the lookup
completely by testing if it's been explicitly disabled. This provides a
measurable speedup for things like qemu that rely on runtime disabling.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-27 21:56:57 +09:00
Paul Mundt 485773f3e4 sh: flag ctrl_in/outX as __deprecated.
These routines are unsuitable for cross-platform use and no new code
should be using them, flag them as deprecated in order to give drivers
sufficient time to migrate over.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-26 13:02:10 +09:00
Paul Mundt 9d56dd3b08 sh: Mass ctrl_in/outX to __raw_read/writeX conversion.
The old ctrl in/out routines are non-portable and unsuitable for
cross-platform use. While drivers/sh has already been sanitized, there
is still quite a lot of code that is not. This converts the arch/sh/ bits
over, which permits us to flag the routines as deprecated whilst still
building with -Werror for the architecture code, and to ensure that
future users are not added.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-26 12:58:40 +09:00
Mark Brown f1487fcbe4 Merge branch 'for-2.6.33' into for-2.6.34 2010-01-25 14:52:48 +00:00
Guennadi Liakhovetski 895d4509d0 ASoC: add DAI and platform / DMA drivers for SH SIU
Several SuperH platforms, including sh7722, sh7343, sh7354, sh7367 include
a Sound Interface Unit (SIU). This patch adds DAI and platform / DMA
drivers for this interface.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-01-25 14:52:20 +00:00
Paul Mundt a077e91690 sh: Conserve fixmap slots when IOREMAP_FIXED=n.
Presently the IOREMAP_FIXED fixmaps are always defined, even if the
platform isn't capable of supporting it. Since we already have an ifdef
for it, ifdef the entries, too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-21 16:16:36 +09:00
Paul Mundt 2dc2f8e0c4 sh: Kill off the special uncached section and fixmap.
Now that cached_to_uncached works as advertized in 32-bit mode and we're
never going to be able to map < 16MB anyways, there's no need for the
special uncached section. Kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-21 16:05:25 +09:00
Paul Mundt 3125ee72dc sh: Track the uncached mapping size.
This provides a variable for tracking the uncached mapping size, and uses
it for pretty printing the uncached lowmem range. Beyond this, we'll also
be building on top of this for figuring out from where the remainder of
P2 becomes usable when constructing unrelated mappings.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-21 15:54:31 +09:00
Paul Mundt 2023b843d7 sh: Rework P2 to only include kernel text.
This effectively neutralizes P2 by getting rid of P1 identity mapping
for all available memory and instead only establishes a single unbuffered
PMB entry (16MB -- the smallest available) that covers the kernel.

As using segmentation for abusing caching attributes in drivers is no
longer supported (and there are no drivers that can be enabled in 32-bit
mode that do this), this provides us with all of the uncached access
needs by the kernel itself.

Drivers and their ilk need to specify their caching attributes when
remapping through page tables, as usual.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-21 15:42:58 +09:00
Paul Mundt 77c2019fc1 sh: initial PMB mapping iteration by helper macro.
All of the cached/uncached mapping setup is duplicated for each size, and
also misses out on the 16MB case. Rather than duplicating the same iter
code for that we just consolidate it in to a helper macro that builds an
iter for each size. The 16MB case is then trivially bolted on at the end.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-21 14:19:41 +09:00
Paul Mundt 35f99c0da1 sh: pretty print virtual memory map on boot.
This cribs the pretty printing from arch/x86/mm/init_32.c to dump the
virtual memory layout on boot. This is primarily intended as a debugging
aid, given that the newer CPUs have full control over their address space
and as such have little to nothing in common with the legacy layout.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 18:48:17 +09:00
Paul Mundt d9116d07f6 sh: mach-sdk7786: Probe system FPGA area mapping.
This implements dynamic probing for the system FPGA. The system reset
controller contains a fixed magic read word in order to identify the
FPGA. This just utilizes a simple loop that scans across all of the fixed
physical areas (area 0 through area 6) to locate the FPGA.

The FPGA also contains register information detailing the area mappings
and chip select settings for all of the other blocks, so this needs to be
done before we can set up anything else.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 18:25:19 +09:00
Paul Mundt 920efaabcb sh: Correct iounmap fixmap teardown.
iounmap_fixed() had a couple of bugs in it that caused it to effectively
fail at life. The total number of pages to unmap factored in the mapping
offset and aligned up to the next page boundary, which doesn't match the
ioremap_fixed() behaviour.

When ioremap_fixed() pegs a slot, the address in the mapping data already
contains the offset displacement, and the size is recorded verbatim given
that we're only interested in total number of pages required. As such, we
need to calculate the total number from the original size in the unmap
path as well.

At the same time, there was also an off-by-1 problem in the fixmap index
calculation which has also been corrected.

Previously subsequent remaps of an identical fixmap index would trigger
the pte_ERROR() in set_pte_phys():

	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).

With this patch in place, the iounmap-driven fixmap teardown actually
does what it's supposed to do.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 18:10:30 +09:00
Paul Mundt b51989b8af sh: mach-sdk7786: reset controller reboot support.
This wires up the machine_ops reboot call to use the system reset
controller.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 16:53:11 +09:00
Paul Mundt fbb82b0365 sh: machine_ops based reboot support.
This provides a machine_ops-based reboot interface loosely cloned from
x86, and converts the native sh32 and sh64 cases over to it.

Necessary both for tying in SMP support and also enabling platforms like
SDK7786 to add support for their microcontroller-based power managers.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 16:42:52 +09:00
Paul Mundt 2efa53b269 sh: Make 29/32-bit mode check helper generally available.
Presently __in_29bit_mode() is only defined for the PMB case, but
it's also easily derived from the CONFIG_29BIT and CONFIG_32BIT &&
CONFIG_PMB=n cases.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 16:40:48 +09:00
Paul Mundt 5f240718b4 sh: mach-sdk7786: Split out FPGA IRQ controller setup.
This moves out the FPGA IRQ controller setup code to its own file, in
preparation for switching off of IRL mode and having it provide its own
irq_chip.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 15:23:54 +09:00
Paul Mundt efd590d57a sh: mach-sdk7786: FPGA updates.
This does a bit of refactoring of the FPGA management code. The primary
FPGA initialization is moved out to its own file in preparation for
implementing some of the more complex capabilities, a complete set of
register definitions is provided, and all of the existing users in the
board code are moved over to use the new interface instead of setting up
overlapping mappings. This also corrects the FPGA size, which previously
was chomped off at the SDIF control register.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 15:08:36 +09:00
Paul Mundt bdc27300f5 sh: Handle SH-4 FPU variants with broken CVR values.
Usually we can look to the CVR to work out whether we have an FPU or not.
Unfortunately not all parts comply with this, so just set the flag
manually for all SH-4 parts and clear it on the only SH-4 that doesn't
have one (SH4-501).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 03:38:56 +09:00
Paul Mundt 70911b861b sh: Shut up noisy IOREMAP_FIXED=n build.
The ioremap_fixed() stub neglected to provide a return value, resulting
in a fairly noisy build.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 02:45:05 +09:00
Guennadi Liakhovetski 31c3af503e sh: support SIU sourcing from external clock on sh7722
Implement .set_rate() for all SH "div4 clocks," .enable(), .disable(), and
.set_parent() for those, that support them. This allows, among other uses,
reparenting of SIU clocks to the external source, and enabling and
disabling of the IrDA clock on sh7722.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 20:23:00 +09:00
Paul Mundt 14965f16b4 sh: Fix up sdk7780 and urquell builds.
These two got broken in the heartbeat private data conversion,
fix them up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 20:10:33 +09:00
Paul Mundt dea3cf1c39 sh: urquell: Handle EXTAL configuration here, too.
urquell happens to use the same mode pins and EXTAL configuration as
SDK7786, so just copy it over.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 20:09:28 +09:00
Paul Mundt c809821827 sh: mach-sdk7786: Detect/configure/propagate EXTAL.
This uses the mode pins exposed through the FPGA to work out whether
we're driven from EXTAL or not and does the appropriate setup and
propagation through the clock framework.

This will also -EINVAL out for anyone adding in their own oscillators,
forcing proper configuration with the clock framework instead of
proceeding on with bogus clock values.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 19:38:36 +09:00
Paul Mundt 43a1839cb1 sh: SH7786 clock framework rewrite.
This rewrites the SH7786 clock framework support completely. It's
reworked to provide all of the DIV4 and MSTP function clocks. This brings
it in line with the current clock framework code and lets us drop SH7786
from the list of CPUs that require legacy CPG handling.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 19:37:14 +09:00
Paul Mundt 79f211b8e1 sh64: wire up sys_accept4.
sh64 on the other hand provides both direct broken out syscalls as well
as socketcall access. As there are binaries that use both socketcall has
to stay around. The current ABI prefers direct syscalls.

It was pointed out that when sys_recvmmsg was added in, sys_accept4 was
overlooked. This takes care of wiring it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 17:00:31 +09:00
Paul Mundt 6eacb2c4cb sh: unwire sys_recvmmsg.
sh32 at the moment only uses sys_socketcall to reach these, so unwire
recvmmsg for now. While we're at it, add it to the ignore list, as per
the s390 change.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 17:00:06 +09:00
Paul Mundt a4ae2b2b18 sh64: Fixup build breakage from breakpoint handler rename.
The breakpoint handler was renamed on sh32, but sh64 was overlooked in
the conversion. Fix it up now.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 15:58:27 +09:00
Paul Mundt d6db8888c8 sh64: Use the shared FPU state restorer.
This kills off the sh64-specific state restorer and switches over to
the generic one.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 15:55:27 +09:00
Paul Mundt 88ea1a445a sh64: Fix up PC casting in unaligned fixup notifier with 32bit ABI.
Presently the build bails with the following:

  CC      arch/sh/mm/alignment.o
cc1: warnings being treated as errors
arch/sh/mm/alignment.c: In function 'unaligned_fixups_notify':
arch/sh/mm/alignment.c:69: warning: cast to pointer from integer of different size
arch/sh/mm/alignment.c:74: warning: cast to pointer from integer of different size
make[2]: *** [arch/sh/mm/alignment.o] Error 1

This is due to the fact that regs->pc is always 64-bit, while the pointer size
depends on the ABI. Wrapping through instruction_pointer() takes care of the
appropriate casting for both configurations.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 15:41:50 +09:00
Paul Mundt 3ef2932b8c sh64: Fix up the build for the thread_xstate changes.
This updates the sh64 processor info with the sh32 changes in order to
tie in to the generic task_xstate management code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 15:40:03 +09:00
Paul Mundt cb6d04468d sh: Kill off now bogus fixmap/page wiring documentation.
The plans for _PAGE_WIRED were detailed in a comment with the fixmap
code, but as it's now all taken care of, we no longer have any reason for
keeping it around, particularly since it's no longer accurate. Kill it
off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 15:22:52 +09:00
Paul Mundt bb29c677b3 sh: Split out MMUCR.URB based entry wiring in to shared helper.
Presently this is duplicated between tlb-sh4 and tlb-pteaex. Split the
helpers out in to a generic tlb-urb that can be used by any parts
equipped with MMUCR.URB.

At the same time, move the SH-5 code out-of-line, as we require single
global state for DTLB entry wiring.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 15:20:35 +09:00
Paul Mundt 046581f962 sh: Provide a dummy _PAGE_WIRED flag for non-X2TLB parts.
This provides a dummy value for legacy parts which permits the entry
wiring to be open-coded. The compiler takes care of optimizing the entry
wiring away in these cases.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 14:23:39 +09:00
Paul Mundt 6d63e73d52 sh: Limit ioremap_prot() to 32bit pgprot parts.
Presently ioremap_prot() uses an unsigned long to pass the pgprot value
around. This results in the upper half of the pgprot being chomped when
using 64-bit pgprots on a 32-bit ABI (X2TLB and SH-5).

As the only users of ioremap_prot() are presently legacy parts, this
doesn't cause too much of an issue. In the future when the interface is
converted to use pgprot_t directly this can be re-enabled for the other
parts, too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 14:00:14 +09:00
Paul Mundt f33609344a sh: Convert p3_ioremap() users to ioremap_prot().
This kills off the ancient p3_ioremap(), converting over to the more
generic ioremap_prot() instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 13:55:41 +09:00
Paul Mundt acf2c9685f sh: Kill off duplicate address alignment in ioremap_fixed().
This is already taken care of in the top-level ioremap, and now that
no one should be calling ioremap_fixed() directly we can simply throw the
mapping displacement in as an additional argument.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 13:49:19 +09:00
Paul Mundt d57d64080d sh: Prevent 64-bit pgprot clobbering across ioremap implementations.
Presently 'flags' gets passed around a lot between the various ioremap
helpers and implementations, which is only 32-bits. In the X2TLB case
we use 64-bit pgprots which presently results in the upper 32bits being
chopped off (which handily include our read/write/exec permissions).

As such, we convert everything internally to using pgprot_t directly and
simply convert over with pgprot_val() where needed. With this in place,
transparent fixmap utilization for early ioremap works as expected.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-19 13:34:38 +09:00
Paul Mundt af1415314a sh: Flag __ioremap_caller() __init_refok.
The mem_init_done test makes sure that this path is only entered in
__init cases, so leaving ioremap_fixed() as __init and flagging the
caller __init_refok is sufficient.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-18 21:45:00 +09:00
Paul Mundt 12b6b01cb4 sh: Handle unmapping of fixed slots transparently in iounmap().
iounmap() should balance whatever is done by ioremap(). Presently
ioremap() can do any of fixed mappings, PMB mappings, or page table
mappings. Presently only the latter two are handled through the standard
unmap path, so tie in the fixed unmapping, too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-18 21:33:08 +09:00
Paul Mundt 4f744affc3 sh: Make iounmap_fixed() return success/failure for iounmap() path.
This converts iounmap_fixed() to return success/error if it handled the
unmap request or not. At the same time, drop the __init label, as this
can be called in to later.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-18 21:30:29 +09:00
Paul Mundt 0b59e38ffa sh: Merge _32/_64 ioremap implementations.
There is nothing of interest in the _64 version anymore, so the _32 one
can be renamed and used unconditionally.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-18 21:21:32 +09:00
Paul Mundt edf711b66f sh: Fixup the IOREMAP_FIXED=n build.
Presently the fixed ioremap API is only defined when CONFIG_IOREMAP_FIXED
is set. As we want to call in to it unconditionally, provide a stubbed
out interface.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-18 21:20:13 +09:00
Paul Mundt d9b9487af7 sh: Handle early ioremaps through fixed mappings.
This adds in a mem_init_done to work out when a standard ioremap() is
possible, falling back to the fixmap based ioremap otherwise.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-18 21:08:32 +09:00
Paul Mundt 0c54de146e Merge branch 'sh/stable-updates' 2010-01-18 20:47:37 +09:00
Kuninori Morimoto c718aff2e6 sh: ms7724: Correct sh-eth EEPROM polling timeout.
This converts the cpu_relax() to a udelay(1), which fixes up issues with
the EEPROM polling occasionally timing out.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-18 20:47:15 +09:00
Paul Mundt 8faba61215 Merge branch 'sh/ioremap-fixed' 2010-01-18 20:42:39 +09:00
Paul Mundt 4291b730cd sh: Need IRQs enabled for init_fpu().
This tosses in a local_irq_enable()/disable() pair around the init_fpu()
callsite in the FPU state restore exception handler. Fixes up a slab BUG
triggered by making a slab cache allocation that can sleep whilst
irqs_disabled(). This follows the behaviour undertaken by the x86
implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-18 20:39:49 +09:00
Matt Fleming 3d467676ab sh: Setup early PMB mappings.
More and more boards are going to start shipping that boot with the MMU
in 32BIT mode by default. Previously we relied on the bootloader to
setup PMB mappings for use by the kernel but we also need to cater for
boards whose bootloaders don't set them up.

If CONFIG_PMB_LEGACY is not enabled we have full control over our PMB
mappings and can compress our address space. Usually, the distance
between the the cached and uncached mappings of RAM is always 512MB,
however we can compress the distance to be the amount of RAM on the
board.

pmb_init() now becomes much simpler. It no longer has to calculate any
mappings, it just has to synchronise the software PMB table with the
hardware.

Tested on SDK7786 and SH7785LCR.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-18 19:33:10 +09:00
Paul Mundt 78bf04fc96 sh: Tidy up non-translatable checks in iounmap path.
This tidies up the iounmap path with consolidated checks for
nontranslatable mappings. This is in preparation of unifying
the implementations.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-17 01:45:26 +09:00
Matt Fleming 597fe76ec3 sh: Use ioremap_fixed() to implement SH-5 ioremap()
Use the fixmap-based memory mapping implementation for SH-5's ioremap()
functions and delete the old static allocator that was borrowed from
sparc.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-16 14:31:51 +00:00
Matt Fleming 6f82b6ebb1 sh: Use ioremap_fixmed to map the SM501 DRAM config register
We need to write to the DRAM config register very early and at such an
early stage ioremap() is not available. So use ioremap_fixed() to map
the register.

The reason that we are avoiding using the legacy P2 mapping is that
there will come a day when the legacy P2 mappings no longer exist.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-16 14:31:44 +00:00
Matt Fleming 4d35b93a66 sh: Add fixed ioremap support
Some devices need to be ioremap'd and accessed very early in the boot
process. It is not possible to use the standard ioremap() function in
this case because that requires kmalloc()'ing some virtual address space
and kmalloc() may not be available so early in boot.

This patch provides fixmap mappings that allow physical address ranges
to be remapped into the kernel address space during the early boot
stages.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-16 14:31:36 +00:00
Matt Fleming 07cad4dc1b sh: Generalise the pte handling code for the fixmap path
Generalise the code for setting and clearing pte's and allow TLB entries
to be pinned and unpinned if the _PAGE_WIRED flag is present.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-16 14:29:23 +00:00
Matt Fleming 24ef7fc4dc sh: Acquire some more page flags for SH-5.
We need some more page flags to hook up _PAGE_WIRED (and eventually
other things). So use the unused PTE bits above the PPN field as no
implementations use these for anything currently.

Now that we have _PAGE_WIRED let's provide the SH-5 functions for wiring
up TLB entries.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-16 14:29:06 +00:00
Matt Fleming 8eda551420 sh: New extended page flag to wire/unwire TLB entries
Provide a new extended page flag, _PAGE_WIRED and an SH4 implementation
for wiring TLB entries and use it in the fixmap code path so that we can
wire the fixmap TLB entry.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-16 14:28:57 +00:00
Paul Mundt 7dcaa8e8e6 sh: Generalize SH7786 PCIe support.
Previously this was only built in for Urquell boards, but the same
approach can be used on SDK7786 now that the mode pin reading is
supported, so make it generic to SH7786.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-15 19:13:56 +09:00
Paul Mundt 6f832e8aab sh: mach-sdk7786: mode pins support.
This wires up the mode pins support on the SDK7786. The pins are
standard SH7786 pins, and all are fixed in software. Needed for the
clock framework, PCIe, and so forth.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-15 16:31:04 +09:00
Paul Mundt f0cb77372c sh: Fix up the secondary CPU entry point for 32bit mode.
Presently the secondary CPU entry point is only aimed at 29bit phys mode,
causing it to point to a stray virtual address in 32bit mode. Fix it up
after consulting with our shiny new __in_29bit_mode().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-15 15:13:48 +09:00
Paul Mundt a6198a238b sh: Guard against early IPIs in flush_cache_all().
flush_cache_all() gets called in to when we do some early ioremapping.
Unfortunately on SDK7786 the interrupt controller itself requires
ioremapping, leading to a bit of a chicken and egg scenario. For now,
don't bother with IPI crosscalls if there aren't any other CPUs online.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-15 14:21:37 +09:00
Paul Mundt a09d2831b3 sh: heartbeat: Update boards for access size hinting.
This updates the existing boards that specify the register width through
platform data to use the resource flags instead. This eliminates platform
data completely in most cases, and permits further improvement in the
heartbeat driver as well as shrinking the overall private data size.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-15 12:24:34 +09:00
Paul Mundt 2267c7875b sh: mach-sdk7786: heartbeat support.
Hand off the user LEDs to the heartbeat driver.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-15 12:11:30 +09:00
Paul Mundt 10ab92d8c3 sh: heartbeat: Support access size specification via resource flags.
This permits the resource access size to be handed off through the
resource flags, which saves platforms from having to establish
platform data only to specify the register width.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-15 12:08:31 +09:00
NISHIMOTO Hiroki ea44078341 sh: mach-ecovec24: Add motion sensor driver support.
This patch adds support for the lis3lv02d motion sensor connected via
i2c on the Ecovec board. Tested with evtest.

Signed-off-by: NISHIMOTO Hiroki <nishimoto.hiroki@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-15 08:25:00 +09:00
Matt Fleming 46c4e5daea sh: Fix CONFIG_PMB=n build.
The last commit introduced the following breakage

arch/sh/include/asm/mmu.h: In function 'pmb_remap':
arch/sh/include/asm/mmu.h:79: error: expected ';' before '}' token

and...

arch/sh/include/asm/mmu.h:78: error: 'EINVAL' undeclared (first use in this function)
arch/sh/include/asm/mmu.h:78: error: (Each undeclared identifier is reported only once
arch/sh/include/asm/mmu.h:78: error: for each function it appears in.)
arch/sh/include/asm/mmu.h: In function 'pmb_init':
arch/sh/include/asm/mmu.h:87: error: 'ENODEV' undeclared (first use in this function)

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-15 08:00:45 +09:00
Paul Mundt 02bf6cc72c sh: Preliminary SDK7786 board support.
This stubs in some preliminary board support for the RTE SDK7786.

This is quite stunted at the moment, and primarily builds on top of the
system FPGA. FPGA IRQs are handled via CPU IRL masking for simplicity,
with initial peripheral support restricted to the debug ethernet.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-14 20:58:58 +09:00
Michal Marek 07105202bd Makefile: do not override LC_CTYPE
Setting LC_CTYPE=C breaks localized messages in some setups. With only
LC_COLLATE=C and LC_NUMERIC=C, we get almost all we need, except for not
so defined character classes and tolower()/toupper(). The former is not
a big issue, because we can assume that e.g. [:alpha:] will always
include a-zA-Z and we only ever process ASCII input. The latter seems
only affect arch/sh/tools/gen-mach-types, which we can handle separately.

So after this patch the meaning of ranges like [a-z], the behavior of
sort and join, etc. should be the same everywhere and at the same time
gcc should be able to print localized waring and error messages.
LC_NUMERIC=C might not be necessary, but setting it doesn't hurt.

Reported-by: Simon Horman <horms@verge.net.au>
Reported-by: Sergei Trofimovich <slyfox@inbox.ru>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Tested-by: Simon Horman <horms@verge.net.au>
Tested-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-01-13 13:27:24 +01:00
Paul Mundt e44d6c4010 sh: Rename split-level pgtable headers.
These were originally named _nopmd and _pmd to follow their asm-generic
counterparts, but we rename them to -2level and -3level for general
consistency.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 19:18:39 +09:00
Paul Mundt 782bb5a532 sh: default to extended TLB support.
All SH-X2 and SH-X3 parts support an extended TLB mode, which has been
left as experimental since support was originally merged. Now that it's
had some time to stabilize and get some exposure to various platforms,
we can drop it as an option and default enable it across the board.

This is also good future proofing for newer parts that will drop support
for the legacy TLB mode completely.

This will also force 3-level page tables for all newer parts, which is
necessary both for the varying page sizes and larger memories.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 19:11:14 +09:00
Paul Mundt 206582c316 sh: Make all PxSEGADDR() calls fatal for non-legacy configs.
This stubs out all of the PxSEGADDR() wrappers for non-legacy code.
29-bit will continue to work with these, while 32-bit code will now blow
up on compile rather than at runtime.

The vast majority of the in-tree offenders are gone, with the only
remaining culprits being unable to support 32-bit mode.

Hopefully this will prevent anyone from ever using these again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 18:45:12 +09:00
Paul Mundt 88f73d2285 sh: Fix up L2 cache comment typo.
Valid sizes include 256kB, not 258kB.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 18:37:19 +09:00
Paul Mundt a0ab36689a sh: fixed PMB mode refactoring.
This introduces some much overdue chainsawing of the fixed PMB support.
fixed PMB was introduced initially to work around the fact that dynamic
PMB mode was relatively broken, though they were never intended to
converge. The main areas where there are differences are whether the
system is booted in 29-bit mode or 32-bit mode, and whether legacy
mappings are to be preserved. Any system booting in true 32-bit mode will
not care about legacy mappings, so these are roughly decoupled.

Regardless of the entry point, PMB and 32BIT are directly related as far
as the kernel is concerned, so we also switch back to having one select
the other.

With legacy mappings iterated through and applied in the initialization
path it's now possible to finally merge the two implementations and
permit dynamic remapping overtop of remaining entries regardless of
whether boot mappings are crafted by hand or inherited from the boot
loader.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 18:31:48 +09:00
Matt Fleming 7f33306ee5 sh: PVR detection for 2nd cut SH7786.
The mass produced cuts use an updated PVR value, add them to the list.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 16:35:58 +09:00
Paul Mundt eca50f14b8 sh: Add a vmlinux.bin target.
This makes vmlinux.bin generation an explicit make target, as opposed to
just a dependency for some of the other targets.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 16:28:47 +09:00
Paul Mundt c7b16efb7d sh: Add support for LZO-compressed kernels.
Plugs in LZO along with the others.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 13:29:19 +09:00
Paul Mundt 644755e786 Merge branches 'sh/xstate', 'sh/hw-breakpoints' and 'sh/stable-updates' 2010-01-13 13:02:55 +09:00
Matt Fleming 6430a5987f sh: Don't perform an icbi on a P2 address
The legacy P2 area may not always be mapped (for example when using
PMB). So perform an icbi on an address that we know will always be
mapped.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 12:59:24 +09:00
Paul Mundt 0ea820cf9b sh: Move over to dynamically allocated FPU context.
This follows the x86 xstate changes and implements a task_xstate slab
cache that is dynamically sized to match one of hard FP/soft FP/FPU-less.

This also tidies up and consolidates some of the SH-2A/SH-4 FPU
fragmentation. Now fpu state restorers are commonly defined, with the
init_fpu()/fpu_init() mess reworked to follow the x86 convention.
The fpu_init() register initialization has been replaced by xstate setup
followed by writing out to hardware via the standard restore path.

As init_fpu() now performs a slab allocation a secondary lighterweight
restorer is also introduced for the context switch.

In the future the DSP state will be rolled in here, too.

More work remains for math emulation and the SH-5 FPU, which presently
uses its own special (UP-only) interfaces.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 12:51:40 +09:00
Paul Mundt a3705799e2 sh: Use SLAB_PANIC for thread_info slab cache.
Presently this has a BUG_ON() for failure cases, as powerpc does. Switch
this over to a SLAB_PANIC instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 19:10:06 +09:00
Paul Mundt cbf6b1ba7a sh: Always provide thread_info allocators.
Presently the thread_info allocators are special cased, depending on
THREAD_SHIFT < PAGE_SHIFT. This provides a sensible definition for them
regardless of configuration, in preparation for extended CPU state.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 19:01:11 +09:00
Paul Mundt 70e068eef9 sh: Move start_thread() out of line.
start_thread() will become a bit heavier with the xstate freeing to be
added in, so move it out-of-line in preparation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 18:52:00 +09:00
Paul Mundt 94cd049522 sh: sh_bios detection.
This adds some VBR sanity checks in the sh_bios code to ensure that the
BIOS VBR is in range before blindly trapping in to it. This permits
boards with varying boot loader configurations to always leave support
for sh-bios enabled and it will just be disabled at run-time if not
found.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 18:42:52 +09:00
Paul Mundt a99eae5417 sh: Split out the unaligned counters and user bits.
This splits out the unaligned access counters and userspace bits in to
their own generic interface, which will allow them to be wired up on sh64
too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 16:12:25 +09:00
Paul Mundt 776258df92 sh: Consolidate the sh_bios earlyprintk code.
Now that the sh-sci earlyprintk is taken care of by the sh-sci driver
directly, there's no longer any reason for having a split-out
early_printk framework. sh_bios is the only other thing that uses it, so
we just migrate the leftovers in to there. As it's possible to have
multiple early_param()'s for the same string, there's not much point in
having this split out anymore anyways, particularly since the sh_bios
dependencies are still special-cased within sh-sci itself.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 15:31:20 +09:00
Paul Mundt b9303a7956 sh: Kill off more unused sh_bios callbacks.
sh_bios_char_out() is not used by anything in-tree these days, so just
get rid of it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 15:26:11 +09:00
Paul Mundt 65fedbbef8 sh64: Fix up early serial fixmap.
This was conditionalized on CONFIG_EARLY_PRINTK, which has subsequently
gone away. Now that the serial driver always supports the early console,
make sure we always establish the mapping.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 15:22:26 +09:00
Paul Mundt 191d0d24b6 sh: Tidy up the sh bios VBR handling.
This moves the VBR handling out of the main trap handling code and in to
the sh-bios helper code. A couple of accessors are added in order to
permit other kernel code to get at the VBR value for state save/restore
paths.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 14:50:43 +09:00
Paul Mundt ee2760ea58 sh: default to sparseirq.
As SH has a very sparse IRQ map by default, all new CPUs and boards
benefit from using sparseirq by default. Despite this, there are still a
few stragglers (mostly due to using a fixed IRQ range for their FPGA
IRQ mappings), and these still need to be converted over one by one. As
these are now in the minority, and we do not want to encourage this sort
of brain-damage in newer board ports, we force sparseirq on.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 13:48:27 +09:00
Paul Mundt 53e6d8e006 sh: mach-se: Convert SE7343 FPGA to dynamic IRQ allocation.
This gets rid of the arbitrary set of vectors used by the SE7722 FPGA
interrupt controller and switches over to a completely dynamic set.
No assumptions regarding a contiguous range are made, and the platform
resources themselves need to be filled in lazily.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-12 13:37:04 +09:00
Paul Mundt 8c0b8139c8 sh: consolidate atomic_cmpxchg()/atomic_add_unless() definitions.
The LL/SC and IRQ versions were using generic stubs while the GRB version
was just reimplementing what it already had for the standard cmpxchg()
code. As we have optimized cmpxchg() implementations that are decoupled
from the atomic code, simply falling back on the generic wrapper does the
right thing. With this in place the GRB case is unaffected while the
LL/SC case gets to use its optimized cmpxchg().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-08 17:02:17 +09:00
Paul Mundt fa94ddea2b Merge branch 'master' into sh/hw-breakpoints 2010-01-06 15:49:08 +09:00
Paul Mundt 6fbfe8d7cd sh: select HAVE_HW_BREAKPOINT for all SUPERH32 CPUs.
All SH CPUs (with the exception of sh64) support the UBC, so select
HW_BREAKPOINT support by default. This fixes up the build for non-SH4A
targets.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-06 15:46:53 +09:00
Paul Mundt 56d45b62ce sh: Fix up nommu build for out-of-line pgtable changes.
pgtable_cache_init() has been moved out-of-line, so we also need a dummy
definition for it on nommu to fix up the build.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-06 14:45:14 +09:00
Paul Mundt 9fae4fb3ce sh: Reclaim TIF_DEBUG.
This was used by the old hw-breakpoints API, but now there is nothing
is using it anymore, so just kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-05 19:30:18 +09:00
Paul Mundt 7025bec912 sh: Kill off dead UBC headers.
Nothing is using these now, so kill them all off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-05 19:16:35 +09:00
Paul Mundt 4352fc1b12 sh: Abstracted SH-4A UBC support on hw-breakpoint core.
This is the next big chunk of hw_breakpoint support. This decouples
the SH-4A support from the core and moves it out in to its own stub,
following many of the conventions established with the perf events
layering.

In addition to extending SH-4A support to encapsulate the remainder
of the UBC channels, clock framework support for handling the UBC
interface clock is added as well, allowing for dynamic clock gating.

This also fixes up a regression introduced by the SIGTRAP handling that
broke the ksym_tracer, to the extent that the current support works well
with all of the ksym_tracer/ptrace/kgdb. The kprobes singlestep code will
follow in turn.

With this in place, the remaining UBC variants (SH-2A and SH-4) can now
be trivially plugged in.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-05 19:06:45 +09:00
Paul Mundt c4761815ab sh: Fix up breakpoint trap handler patching on SH-2A.
SH-2A was referencing the old handler that no longer exists, fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-05 12:44:02 +09:00
Paul Mundt 0176bd3dab sh: Drop down to a single quicklist.
We previously had 2 quicklists, one for the PGD case and one for PTEs.
Now that the PGD/PMD cases are handled through slab caches due to the
multi-level configurability, only the PTE quicklist remains. As such,
reduce NR_QUICK to its appropriate size and bump down the PTE quicklist
index.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-05 12:35:00 +09:00
Paul Mundt a7595fe7e8 Merge branch 'sh/pgtable' of git://github.com/mfleming/linux-2.6 2010-01-05 12:27:46 +09:00
Paul Mundt 921a220857 Merge branch 'sh/stable-updates' 2010-01-04 16:45:56 +09:00
Paul Mundt 7dbcd8c55f sh: update defconfigs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-04 15:38:50 +09:00
Paul Mundt 5e9daa0f26 sh: Don't default enable PMB support.
This has the adverse effect of converting many 29bit configs to 32bit
mode, while this is a change that needs to be done manually for each
platform. Turn it off by default in order to cut down on spurious bug
reports.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-04 11:16:33 +09:00
Paul Mundt b4e2a2a2f3 sh: Disable PMB for SH4AL-DSP CPUs.
While the PMB is available on SH-4A parts, SH4AL-DSP parts exclude it
altogether. As such, explicitly disable PMB support for these parts. If
this changes in the future for newer subtypes, this will have to be made
more fine-grained.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-04 11:13:54 +09:00
Matt Fleming 2a5eacca85 sh: Move page table allocation out of line
We also switched away from quicklists and instead moved to slab
caches. After benchmarking both implementations the difference is
negligible. The slab caches suit us better though because the size of a
pgd table is just 4 entries when we're using a 3-level page table layout
and quicklists always deal with pages.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-02 01:02:25 +00:00
Matt Fleming b4c8927623 sh: Optimise flush_dcache_page() on SH4
If the page is not mapped into any process's address space then aliases
cannot exist in the cache. So reduce the amount of flushing we perform.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-02 00:51:52 +00:00
Matt Fleming 3f5ab76816 sh: Correct the PTRS_PER_PMD and PMD_SHIFT values
The previous expressions were wrong which made free_pmd_range() explode
when using anything other than 4KB pages (which is why 8KB and 64KB
pages were disabled with the 3-level page table layout).

The problem was that pmd_offset() was returning an index of non-zero
when it should have been returning 0. This non-zero offset was used to
calculate the address of the pmd table to free in free_pmd_range(),
which ended up trying to free an object that was not aligned on a page
boundary.

Now 3-level page tables should work with 4KB, 8KB and 64KB pages.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-02 00:51:45 +00:00
Matt Fleming e591a51723 sh: Remove unused functions
Apply some TLC to the SH64 header files and remove some functions that
are not used anymore.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2009-12-31 13:44:54 +00:00
Paul Mundt 8152a74bc0 sh: Only provide a PCLK definition for legacy CPG CPUs.
As CPUs are migrated over to more fully-featured clock frameworks of
their own and off of the legacy CPG code, they no longer have any real
need for defining the PCLK value. The PCLK define in itself is already
fairly misleading, as many boards get their input clocks from different
sources, making this value fairly arbitrary anyways.

Outside of the legacy CPG clock framework, the only place where this
value is used is for deriving CLOCK_TICK_RATE, which we set back to the
legacy PIT value that it was before the PCLK definitions were added in
the first place.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-29 11:09:30 +09:00
Paul Mundt 34d0b5af50 sh: Convert ptrace to hw_breakpoint API.
This is the initial step for converting singlestep handling via ptrace
over to hw_breakpoints.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-28 17:53:47 +09:00
Paul Mundt 17eb9d6282 Merge branches 'sh/g3-prep' and 'sh/stable-updates' 2009-12-24 15:16:41 +09:00
Paul Mundt f34548cb73 Merge branch 'sh/g3-prep' into sh/for-2.6.33 2009-12-24 15:16:02 +09:00
Markus Pietrek 76382b5bdb sh: Ensure all PG_dcache_dirty pages are written back.
With some of the cache rework an address aliasing optimization was added,
but this managed to fail on certain mappings resulting in pages with
PG_dcache_dirty set never writing back their dcache lines. This patch
reverts to the earlier behaviour of simply always writing back when the
dirty bit is set.

Signed-off-by: Markus Pietrek <Markus.Pietrek@emtrion.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-24 15:12:02 +09:00
Kuninori Morimoto 9503e891d2 sh: mach-ecovec24: setup.c detailed correction
o remove unused define
o add device name comment

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-24 14:59:51 +09:00
Paul Mundt 2264873540 sh: kgdb: Rework breakpoint handling on top of notifier chain.
This kills off kgdb's breakpoint handler and ties in to the notifier
chain instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-22 12:44:14 +09:00
Paul Mundt b74ab703b1 sh: Don't NOTIFY_STOP for non-UBC breakpoint traps.
Presently the hw_breakpoint code is the primary notifier dispatch for
breakpoint traps, although it's only UBC traps that are of particular
interest there. This patches in a check to allow non-UBC generated
breakpoints to pass through down the remainder of the notifier chain,
giving things like kgdb a chance at getting notified.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-22 12:40:38 +09:00
Paul Mundt 6c0ee6a4bb sh: hw-breakpoint support requires perf events.
This follows the x86 change to select perf events when hw_breakpoint
support is enabled. This fixes up build issues where perf events can
otherwise be disabled on their own.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-21 17:35:00 +09:00
Paul Mundt a28b460ec7 sh: Fix up hw-breakpoints build for API changes.
The event callback handling has been removed in favour of going through a
generic event handler to handle overflows. Follows the x86 change.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-21 15:56:24 +09:00
Paul Mundt 4b4f887fb2 Merge branch 'master' into sh/hw-breakpoints 2009-12-21 15:44:34 +09:00
Paul Mundt 76e7461a21 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-12-21 11:59:55 +09:00
Paul Mundt d0b873fc73 Merge branch 'sh/stable-updates' 2009-12-21 11:58:17 +09:00
Paul Mundt 73a38b839b sh: Only use bl bit toggling for sleeping idle.
We don't actually require this in the cpu_relax() polling case, so just
cuddle these around the sleeping version.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-21 11:57:33 +09:00
Paul Mundt 3147093e1d sh: Restore bl bit toggling in idle loop.
This fixes up some crashes with IRQs racing the need_resched() test under
QEMU.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-21 11:57:29 +09:00
Linus Torvalds 5a865c0606 Merge branch 'for-33' of git://repo.or.cz/linux-kbuild
* 'for-33' of git://repo.or.cz/linux-kbuild: (29 commits)
  net: fix for utsrelease.h moving to generated
  gen_init_cpio: fixed fwrite warning
  kbuild: fix make clean after mismerge
  kbuild: generate modules.builtin
  genksyms: properly consider  EXPORT_UNUSED_SYMBOL{,_GPL}()
  score: add asm/asm-offsets.h wrapper
  unifdef: update to upstream revision 1.190
  kbuild: specify absolute paths for cscope
  kbuild: create include/generated in silentoldconfig
  scripts/package: deb-pkg: use fakeroot if available
  scripts/package: add KBUILD_PKG_ROOTCMD variable
  scripts/package: tar-pkg: use tar --owner=root
  Kbuild: clean up marker
  net: add net_tstamp.h to headers_install
  kbuild: move utsrelease.h to include/generated
  kbuild: move autoconf.h to include/generated
  drop explicit include of autoconf.h
  kbuild: move compile.h to include/generated
  kbuild: drop include/asm
  kbuild: do not check for include/asm-$ARCH
  ...

Fixed non-conflicting clean merge of modpost.c as per comments from
Stephen Rothwell (modpost.c had grown an include of linux/autoconf.h
that needed to be changed to generated/autoconf.h)
2009-12-17 07:23:42 -08:00
Matt Fleming 5d9b4b19f1 sh: Definitions for 3-level page table layout
If using 64-bit PTEs and 4K pages then each page table has 512 entries
(as opposed to 1024 entries with 32-bit PTEs). Unlike MIPS, SH follows
the convention that all structures in the page table (pgd_t, pmd_t,
pgprot_t, etc) must be the same size. Therefore, 64-bit PTEs require
64-bit PGD entries, etc. Using 2-levels of page tables and 64-bit PTEs
it is only possible to map 1GB of virtual address space.

In order to map all 4GB of virtual address space we need to adopt a
3-level page table layout. This actually works out better for
CONFIG_SUPERH32 because we only waste 2 PGD entries on the P1 and P2
areas (which are untranslated) instead of 256.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-17 14:31:20 +09:00
Matt Fleming b73c806341 sh: Abstract the number of page table levels
Keep the dimensions of the page tables in a separate header file in
preparation for allowing a three level page table structure.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-17 14:31:15 +09:00
Paul Mundt 2f7bb2dfed sh: Fix up MAX_DMA_CHANNELS definition when DMA is disabled.
MAX_DMA_CHANNELS is tested for the total number of channels in order to
populate an IRQ map. Stub this out completely when no DMA support is
enabled -- as used to be the default behaviour before this was
generalized for use by the dmaengine code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-17 14:25:10 +09:00
Nobuhiro Iwamatsu 4385af80bd sh: dmaengine support for SH7785
Add dmaengine platform device to SH7785.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-17 14:19:33 +09:00
Guennadi Liakhovetski 39b27f4cc3 sh: dmaengine support for sh7724.
Add a dmaengine platform device to sh7724, fix DMA channel interrupt numbers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-17 14:18:27 +09:00
Linus Torvalds 9b2831704e 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: (33 commits)
  sh: Fix test of unsigned in se7722_irq_demux()
  sh: mach-ecovec24: Add FSI sound support
  sh: mach-ecovec24: Add mt9t112 camera support
  sh: mach-ecovec24: Add tw9910 support
  sh: MSIOF/mmc_spi platform data for the Ecovec24 board
  sh: ms7724se: Add ak4642 support
  sh: Fix up FPU build for SH5
  sh: Remove old early serial console code V2
  sh: sh5 scif pdata (sh5-101/sh5-103)
  sh: sh4a scif pdata (sh7757/sh7763/sh7770/sh7780/sh7785/sh7786/x3)
  sh: sh4a scif pdata (sh7343/sh7366/sh7722/sh7723/sh7724)
  sh: sh4 scif pdata (sh7750/sh7760/sh4-202)
  sh: sh3 scif pdata (sh7705/sh770x/sh7710/sh7720)
  sh: sh2a scif pdata (sh7201/sh7203/sh7206/mxg)
  sh: sh2 scif pdata (sh7616)
  sh-sci: Extend sh-sci driver with early console V2
  sh: Stub in P3 ioremap support for nommu parts.
  sh: wire up vmallocinfo support in ioremap() implementations.
  sh: Make the unaligned trap handler always obey notification levels.
  sh: Couple kernel and user write page perm bits for CONFIG_X2TLB
  ...
2009-12-16 10:29:52 -08:00
Linus Torvalds 6a5df38f5f Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (116 commits)
  V4L/DVB (13698): pms: replace asm/uaccess.h to linux/uaccess.h
  V4L/DVB (13690): radio/si470x: #include <sched.h>
  V4L/DVB (13688): au8522: modify the attributes of local filter coefficients
  V4L/DVB (13687): cx231xx: use NULL when pointer is needed
  V4L/DVB: Davinci VPFE Capture: remove unused #include <linux/version.h>
  V4L/DVB (13685): Correct code taking the size of a pointer
  V4L/DVB (13684): Fix some cut-and-paste noise in dib0090.h
  V4L/DVB (13683): sanio-ms: clean up init, exit and id_table
  V4L/DVB (13682): dib8000: make some constant static
  V4L/DVB: lgs8gxx: Use shifts rather than multiply/divide when possible
  V4L/DVB (13680b): DocBook/media: create links for included sources
  V4L/DVB (13680a): DocBook/media: copy images after building HTML
  V4L/DVB (13678): Add support for yet another DvbWorld, TeVii and Prof USB devices
  V4L/DVB (13676): configurable IRQ mode on NetUP Dual DVB-S2 CI; IRQ from CAM processing (CI interface works faster)
  V4L/DVB (13674): stv090x: Add DiSEqC envelope mode
  V4L/DVB (13673): lnbp21: Implement 22 kHz tone control
  V4L/DVB (13671): sh_mobile_ceu_camera: Remove frame size page alignment
  V4L/DVB (13670): soc-camera: Add mt9t112 camera driver
  V4L/DVB (13669): tw9910: Add sync polarity support
  V4L/DVB (13668): tw9910: remove cropping
  ...
2009-12-16 10:09:16 -08:00
Christoph Hellwig 698ba7b5a3 elf: kill USE_ELF_CORE_DUMP
Currently all architectures but microblaze unconditionally define
USE_ELF_CORE_DUMP.  The microblaze omission seems like an error to me, so
let's kill this ifdef and make sure we are the same everywhere.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: <linux-arch@vger.kernel.org>
Cc: Michal Simek <michal.simek@petalogix.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16 07:20:12 -08:00
Guennadi Liakhovetski a6b5f2008a V4L/DVB (13661): rj54n1cb0c: Add cropping, auto white balance, restrict sizes, add platform data
It has been experimentally found out, that the sensor only supports up to
512x384 video output and also has some restrictions on minimum scale. We
disable non-working size ranges until, maybe, someone finds out how to properly
set them up. Also add cropping support, an auto white balance control, platform
data to specify master clock frequency and polarity of the IOCTL pin.

 create mode 100644 include/media/rj54n1cb0c.h

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 09:27:30 -02:00
Guennadi Liakhovetski 760697beca V4L/DVB (13659): soc-camera: convert to the new mediabus API
Convert soc-camera core and all soc-camera drivers to the new mediabus
API. This also takes soc-camera client drivers one step closer to also be
usable with generic v4l2-subdev host drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 09:27:29 -02:00
Guennadi Liakhovetski 0f4482940a V4L/DVB (13650): soc-camera: switch drivers and platforms to use .priv in struct soc_camera_link
After this change drivers can be further extended to not fail, if they don't
get platform data, but to use defaults.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16 09:27:19 -02:00
Roel Kluin 204fc390d8 sh: Fix test of unsigned in se7722_irq_demux()
se7722_fpga_irq[] is unsigned so the test does not work.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-16 13:26:53 +09:00
Kuninori Morimoto 1980fdc4df sh: mach-ecovec24: Add FSI sound support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 22:03:08 +09:00
Kuninori Morimoto 9aa25d6449 sh: mach-ecovec24: Add mt9t112 camera support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 22:03:07 +09:00
Kuninori Morimoto 207efd07e8 sh: mach-ecovec24: Add tw9910 support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 22:02:46 +09:00
Magnus Damm 1ce4da7a50 sh: MSIOF/mmc_spi platform data for the Ecovec24 board
This patch adds MSIOF and mmc_spi platform data for
the CN11 port on the SuperH Ecovec24 board. No card
detect interrupt is available so the MMC code is
configured to poll. The WP signal is implemented
together with CD and power control. The board only
supports 3.3V power.

The platform data is wrapped in SDHI #ifdefs to
allow both the SDHI and the MSIOF to coexist. Only
one configuration is allowed at a time. The pin
routing is selected by a dip switch but we can
unfortunately not detect this setting at run time.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:10:44 +09:00
Paul Mundt e0aa51f54f Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-12-15 12:10:10 +09:00
Kuninori Morimoto 9f815a1765 sh: ms7724se: Add ak4642 support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:07:37 +09:00
Matt Fleming 61cc7b0a17 sh: Fix up FPU build for SH5
After the recent FPU optimisation commit the signature of save_fpu()
changed. "regs" wasn't used in the implementation of save_fpu() anyway.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:07:36 +09:00
Magnus Damm e76fe57447 sh: Remove old early serial console code V2
Now when the sh-sci driver can do early serial output,
get rid of the old duplicated code. This patch is V2 and
removes support for "earlyprintk=serial" together with
the following kconfig options:
CONFIG_EARLY_SCIF_CONSOLE
CONFIG_EARLY_SCIF_CONSOLE_PORT
CONFIG_EARLY_PRINTK

With this patch applied "earlyprintk=" support is always
built-in the SuperH kernel. For this to work the serial
driver must have early platform support and in the case
of sh-sci the serial console needs to be enabled:
CONFIG_SERIAL_SH_SCI_CONSOLE=y

So after enabling the SuperH SCI console kconfig option
you also need to point out port using the kernel command
line: "earlyprintk=sh-sci.N[,baudrate][,keep]"

Remember that clocks may be disabled by the boot loader
so you may have to do some board specific static clock
setup before earlyprintk will work on your platform.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:07:35 +09:00
Magnus Damm d8d3fbb024 sh: sh5 scif pdata (sh5-101/sh5-103)
This patch breaks out the sh5 scif serial port platform
data from a shared platform device to one platform
device per port. Also, move the serial port to the list
of early platform devices.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:06:37 +09:00
Magnus Damm a9571d7b04 sh: sh4a scif pdata (sh7757/sh7763/sh7770/sh7780/sh7785/sh7786/x3)
This patch breaks out the sh4a scif serial port platform
data from a shared platform device to one platform
device per port. Also, add serial ports to the list of
early platform devices.

All sh4a except SuperH Mobile processors are modified by
this patch.

While at it, sh7757 gets early platform device support.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:06:36 +09:00
Magnus Damm bcac24d053 sh: sh4a scif pdata (sh7343/sh7366/sh7722/sh7723/sh7724)
This patch breaks out the sh4a scif serial port platform
data from a shared platform device to one platform
device per port. Also, add serial ports to the list of
early platform devices.

Only sh4a SuperH Mobile processors are modified by this
patch.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:06:35 +09:00
Magnus Damm cd5f107628 sh: sh4 scif pdata (sh7750/sh7760/sh4-202)
This patch breaks out the sh4 scif serial port platform
data from a shared platform device to one platform
device per port. Also, add serial ports to the list of
early platform devices.

While at it, get rid of the R2D ifdef in the processor
code and adjust the defconfigs to use ttySC1.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:06:33 +09:00
Magnus Damm 44658dfb66 sh: sh3 scif pdata (sh7705/sh770x/sh7710/sh7720)
This patch breaks out the sh3 scif serial port platform
data from a shared platform device to one platform
device per port. Also, add serial ports to the list of
early platform devices.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:06:32 +09:00
Magnus Damm be091d20ef sh: sh2a scif pdata (sh7201/sh7203/sh7206/mxg)
This patch breaks out the sh2a scif serial port platform
data from a shared platform device to one platform
device per port. Also, add serial ports to the list of
early platform devices.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:06:31 +09:00
Magnus Damm 632fd800f5 sh: sh2 scif pdata (sh7616)
This patch breaks out the sh2 scif serial port platform
data from a shared platform device to one platform
device per port. Also, add serial ports to the list of
early platform devices.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:06:30 +09:00
Magnus Damm 7b6fd3bf82 sh-sci: Extend sh-sci driver with early console V2
This is V2 of early serial console support for the sh-sci
driver. The early serial console is using early platform
devices and "earlyprintk". To use this feature the early
platform devices must be broken out to one device per port
and the desired port should be selected on the kernel command
line like: "earlyprintk=sh-sci.N[,baudrate][,keep]"

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-15 12:06:29 +09:00
Thomas Gleixner 239007b844 genirq: Convert irq_desc.lock to raw_spinlock
Convert locks which cannot be sleeping locks in preempt-rt to
raw_spinlocks.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
2009-12-14 23:55:33 +01:00
Thomas Gleixner e5931943d0 locking: Convert raw_rwlock functions to arch_rwlock
Name space cleanup for rwlock functions. No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: linux-arch@vger.kernel.org
2009-12-14 23:55:32 +01:00
Thomas Gleixner fb3a6bbc91 locking: Convert raw_rwlock to arch_rwlock
Not strictly necessary for -rt as -rt does not have non sleeping
rwlocks, but it's odd to not have a consistent naming convention.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: linux-arch@vger.kernel.org
2009-12-14 23:55:32 +01:00
Thomas Gleixner 0199c4e68d locking: Convert __raw_spin* functions to arch_spin*
Name space cleanup. No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: linux-arch@vger.kernel.org
2009-12-14 23:55:32 +01:00