History log of /arch/sh/include/asm/io.h
Revision Date Author Comments
ce816fa88cca083c47ab9000b2138a83043a78be 08-Apr-2014 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Kconfig: rename HAS_IOPORT to HAS_IOPORT_MAP

If the renamed symbol is defined lib/iomap.c implements ioport_map and
ioport_unmap and currently (nearly) all platforms define the port
accessor functions outb/inb and friend unconditionally. So
HAS_IOPORT_MAP is the better name for this.

Consequently NO_IOPORT is renamed to NO_IOPORT_MAP.

The motivation for this change is to reintroduce a symbol HAS_IOPORT
that signals if outb/int et al are available. I will address that at
least one merge window later though to keep surprises to a minimum and
catch new introductions of (HAS|NO)_IOPORT.

The changes in this commit were done using:

$ git grep -l -E '(NO|HAS)_IOPORT' | xargs perl -p -i -e 's/\b((?:CONFIG_)?(?:NO|HAS)_IOPORT)\b/$1_MAP/'

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7e6735c3578e76c270a2797225a4214176ba13ef 12-Sep-2012 Cyril Chemparathy <cyril@ti.com> /dev/mem: use phys_addr_t for physical addresses

This patch fixes the /dev/mem driver to use phys_addr_t for physical
addresses. This is required on PAE systems, especially those that run
entirely out of >4G physical memory space.

Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
666e81fdca5486cad644ee3fb64bb7d83e2f3723 05-Oct-2012 Andi Kleen <ak@linux.intel.com> sections: fix section conflicts in arch/sh

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
c5e50fa90ce42b1689692f587d4881308881b73d 10-May-2012 Paul Mundt <lethal@linux-sh.org> sh: Provide stubbed I/O routines for NO_IOPORT case.

Too many drivers fail at IOPORT vs IOMEM checking before blindly calling
in to the API, so we may as well just provide basic stubs to get more
build coverage. Other platforms already do this, too (tile, parisc, etc.)

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
b7e68d6876dfbab087bc3859211a9efc74cbe30c 29-Mar-2012 Paul Mundt <lethal@linux-sh.org> sh: Support I/O space swapping where needed.

This adopts a trimmed down version of the MIPS port mangling interface
limited to the I/O swabbing for platforms that can't use little endian
accessors. For platforms with mixed I/O spaces involving PCI it will
still be necessary to enable byte swapping at the host controller level.
Attention needs to be paid to all of host controller endianness, CPU
endianness, and whether I/O accesses are explicitly swapped or not via
SWAP_IO_SPACE. Fortunately the platforms that need this are in the
minority.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e839ca528718e68cad32a307dc9aabf01ef3eb05 28-Mar-2012 David Howells <dhowells@redhat.com> Disintegrate asm/system.h for SH

Disintegrate asm/system.h for SH.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-sh@vger.kernel.org
efb3e34b6176d30c4fe8635fa8e1beb6280cc2cd 11-Jan-2011 Paul Mundt <lethal@linux-sh.org> sh: Fix up legacy PTEA space attribute mapping.

When p3_ioremap() was converted to ioremap_prot() there was some breakage
introduced where the 29-bit segmentation logic would trap the area range
and return an identity mapping without having allowed the area
specification to force mapping through page tables. This wires up a PCC
mask for pgprot verification to work out whether to short-circuit the
identity mapping on legacy parts, restoring the previous behaviour.

Reported-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: stable@kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
0d6ae8fa945aba732edadce1ead9929520d61b99 10-Jan-2011 Paul Mundt <lethal@linux-sh.org> sh: Kill off deprecated ctrl_in/out I/O routines.

Now that all of the in-tree drivers have been converted to portable I/O
accessors, we can kill off the legacy ones with extreme prejudice.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
37b7a97884ba64bf7d403351ac2a9476ab4f1bba 01-Nov-2010 Paul Mundt <lethal@linux-sh.org> sh: machvec IO death.

This takes a bit of a sledgehammer to the machvec I/O routines. The
iomem case requires no special casing and so can just be dropped
outright. This only leaves the ioport casing for PCI and SuperIO
mangling. With the SuperIO case going through the standard ioport
mapping, it's possible to replace everything with generic routines.

With this done the standard I/O routines are tidied up and NO_IOPORT
now gets default-enabled for the vast majority of boards.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
86e4dd5add77ab809f5427391dfabb8f78cbcb58 25-May-2010 Paul Mundt <lethal@linux-sh.org> sh: support for platforms without PIO.

This extends some of the existing special casing for HAS_IOPORT
platforms and gets it to the point where platforms can begin to
conditionally select it.

The major changes here are that the PIO routines themselves go away
completely, including all of the machvec port mapping wrappers. With this
in place it's possible for any non-machvec abusing platform to disable
PIO completely. At present this is left as an opt-in until the abusers
are the odd ones out instead of the majority.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
90e7d649d86f21d478dc134f74c88e19dd472393 23-Feb-2010 Paul Mundt <lethal@linux-sh.org> sh: reworked dynamic PMB mapping.

This implements a fairly significant overhaul of the dynamic PMB mapping
code. The primary change here is that the PMB gets its own VMA that
follows the uncached mapping and we attempt to be a bit more intelligent
with dynamic sizing, multi-entry mapping, and so forth.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
b8f7918f332873a79e4c820e90e7a245ce4d3042 18-Feb-2010 Paul Mundt <lethal@linux-sh.org> 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>
d627a2ebd1a303aa4ac1962c553d1e8738735d01 28-Jan-2010 Paul Mundt <lethal@linux-sh.org> 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>
485773f3e401fca31c112c1ff24797e42ff87afd 26-Jan-2010 Paul Mundt <lethal@linux-sh.org> 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>
70911b861bfbba1851cbb3497635030f34703c7a 19-Jan-2010 Paul Mundt <lethal@linux-sh.org> 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>
6d63e73d520b690e4378cef3003eb5f01f7d128c 19-Jan-2010 Paul Mundt <lethal@linux-sh.org> 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>
f33609344acfdde1c1acedf6de3efe6b80af93a6 19-Jan-2010 Paul Mundt <lethal@linux-sh.org> 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>
acf2c9685fb8295cb62a623d7358a1cfde8b07ea 19-Jan-2010 Paul Mundt <lethal@linux-sh.org> 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>
d57d64080ddc0ff13fcffc898b6251074a482ba1 19-Jan-2010 Paul Mundt <lethal@linux-sh.org> 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>
4f744affc345f8b158615e0cdd01d1f4985837c3 18-Jan-2010 Paul Mundt <lethal@linux-sh.org> 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>
edf711b66f2a8a9629aa253ad8b3a5a03b5d7af5 18-Jan-2010 Paul Mundt <lethal@linux-sh.org> 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>
4d35b93a66e9b87df20784fcf130d2e8760be53f 05-Nov-2009 Matt Fleming <matt@console-pimps.org> 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>
a0ab36689a36e583b6e736f1c99ac8c9aebdad59 13-Jan-2010 Paul Mundt <lethal@linux-sh.org> 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>
0eb37e26ed332b2a96630cf7f7ebe9fddb41cc3c 14-Dec-2009 Paul Mundt <lethal@linux-sh.org> sh: Stub in P3 ioremap support for nommu parts.

p3_ioremap() references __ioremap() which is presently undefined on
nommu. This provides a trivial stub to fix the build up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
bf3cdeda901c7f42de3cddc8c5aa19f6b8d8f9df 14-Dec-2009 Paul Mundt <lethal@linux-sh.org> sh: wire up vmallocinfo support in ioremap() implementations.

This wires up the caller information for the ioremap VMA, which allows
for more helpful caller tracking via /proc/vmallocinfo. Follows the x86
and powerpc changes of the same nature.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e9c58fc57b17bfa75c256fb4f45ce22de6626858 12-Nov-2009 Paul Mundt <lethal@linux-sh.org> sh: Use the generic I/O port base for slowdown.

This fixes up the build and behaviour for various configurations. Namely
the CONFIG_32BIT cases where legacy mappings do not exist, as well as the
sh64 build.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
3105121949b609964f370d42d1b90fe7fc01d6b1 06-Oct-2009 Matt Fleming <matt@console-pimps.org> sh: Remap physical memory into P1 and P2 in pmb_init()

Eventually we'll have complete control over what physical memory gets
mapped where and we can probably do other interesting things. For now
though, when the MMU is in 32-bit mode, we map physical memory into the
P1 and P2 virtual address ranges with the same semantics as they have in
29-bit mode.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
7d9c035150897c2bebedae280505513dbdef2abc 24-Aug-2009 Stuart Menefy <stuart.menefy@st.com> sh: Read from CCN_PVR instead of ROM for delay.

Reading from the ROM is not a good idea as it could disturb some
flash operation that it is in progress.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
15444a8973dcfbd286b3e638cbadac2446a9271a 24-Aug-2009 David McKay <david.mckay@st.com> sh: Allow use of GENERIC_IOMAP

The synopsys PCI cell used in the later STMicro chips requires code to
be run in order to do IO cycles, rather than just memory mapping the IO
space. Rather than extending the existing SH infrastructure to allow
this, use the GENERIC_IOMAP implmentation to save re-inventing the
wheel.

This set of changes allows the SH to be built with GENERIC_IOMAP
enabled, it just ifdef's out the functions provided by the GENERIC_IOMAP
implementation, and provides a few required missing functions.

Signed-off-by: David McKay <david.mckay@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
6dbe47a170f80159f23c856ad4e02f2685c6f6cb 09-May-2009 Paul Mundt <lethal@linux-sh.org> sh: Provide __read_{read,write}sl() definitions for sh64.

These are presently only defined for sh32, use the plain unoptimized
versions for sh64. Fixes up smsc911x build.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
0fb849b9d743a20056f2418cd955e5c650658663 07-May-2009 Paul Mundt <lethal@linux-sh.org> sh: Integrate the SH-5 onchip_remap() more coherently.

Presently this is special-cased for early initialization. While there are
situations where these static early initializations are still necessary,
with minor changes it is possible to use this for the regular ioremap
implementation as well. This allows us to kill off the special-casing for
the remap completely and to start tidying up all of the SH-5
special-casing in drivers.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e6be3a25861429166f945499c7ee616875bc3db9 29-Apr-2009 Magnus Damm <damm@igel.co.jp> sh: pass through ioremap() for non-mmu processors.

All 32-bit SuperH processors currently go through __ioremap_mode()
and check for IO_TRAPPED and directly mapped segments. With this
patch we simplify the MMU less case with a pass through version of
__ioremap_mode() which just returns the physical address.

The effects of this is change are:
- fix non-MMU ioremap() of high address hardware blocks (sh7203 CMT)
- make sure IO_TRAPPED is not selected

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2f47f44790a9c8fc43e515df3c6be19a35ee5de5 10-Mar-2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> sh: Support fixed 32-bit PMB mappings from bootloader.

This provides a method for supporting fixed PMB mappings inherited from
the bootloader, as an alternative to the dynamic PMB mapping currently
used by the kernel. In the future these methods will be combined.

P1/P2 area is handled like a regular 29-bit physical address, and local
bus device are assigned P3 area addresses.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
716777db7270255f1f7210fd87a7188b08c9a267 25-Nov-2008 Magnus Damm <damm@igel.co.jp> sh: P4 ioremap pass-through

This patch adds a pass-through case when ioremapping P4 addresses.

Addresses passed to ioremap() should be physical addresses, so the
best option is usually to convert the virtual address to a physical
address before calling ioremap. This will give you a virtual address
in P2 which matches the physical address and this works well for
most internal hardware blocks on the SuperH architecture.

However, some hardware blocks must be accessed through P4. Converting
the P4 address to a physical and then back to a P2 does not work. One
example of this is the sh7722 TMU block, it must be accessed through P4.

Without this patch P4 addresses will be mapped using PTEs which
requires the page allocator to be up and running.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
185aed75570fb4f78ef283dfa26cd9da5fa06a91 11-Nov-2008 Paul Mundt <lethal@linux-sh.org> sh: Provide a sane valid_phys_addr_range() to prevent TLB reset with PMB.

With the PMB enabled, only P1SEG and up are covered by the PMB mappings,
meaning that situations where out-of-bounds physical addresses are read
from will lead to TLB reset after the PMB miss, allowing for use cases
like dd if=/dev/mem to reset the TLB.

Fix this up to make sure the reference is between __MEMORY_START (phys)
and __pa(high_memory). This is coherent across all variants of sh/sh64
with and without MMU, though the PMB bug itself is only applicable to
SH-4A parts.

Reported-by: Hideo Saito <saito@densan.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14866543ad22014a0b12e10657a917eb6b487248 03-Oct-2008 Paul Mundt <lethal@linux-sh.org> sh: More I/O routine overhauling.

This tidies up a lot of the PIO/MMIO split. No in-tree platforms were
making use of the MMIO overloading through the machvec (nor have any of
them been in some time), so we just kill all of that off. The ISA I/O
routine wrapping remains unaffected, which remains the only special
casing outside of the iomap API that boards need to think about.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
64c9627c2628bc3bd3291710b8ee6f8335883f8b 01-Oct-2008 Paul Mundt <lethal@linux-sh.org> sh: Fix up the __raw_read/writeX() definitions.

These were doing largely bogus things and using the wrong typing for
the address. Bring these in line with the ARM definitions.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
cb700aa4f13d38726defab3060d3ebeaf67dc189 12-Sep-2008 Paul Mundt <lethal@linux-sh.org> sh: ioremap_prot support.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
fa43972fab24a3c050e880a7831f9378c6cebc0b 04-Sep-2008 Paul Mundt <lethal@linux-sh.org> sh: fixup many sparse errors.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
f15cbe6f1a4b4d9df59142fc8e4abb973302cf44 29-Jul-2008 Paul Mundt <lethal@linux-sh.org> sh: migrate to arch/sh/include/

This follows the sparc changes a439fe51a1f8eb087c22dd24d69cebae4a3addac.

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

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

with subsequent hacking and fixups entirely my fault.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>