Commit Graph

18 Commits

Author SHA1 Message Date
Rohit Vaswani 857d4aadc3 lib: iomap: Add MSM RTB support
The ioread* and the iowrite* functions and not inlined and hence
the RTB logs end up containing the ioread and iowrite functions
themselves and not the ones invoking them.

Add RTB support to the ioread*and iowrite* functions so that we can
get meaningful RTB logs.

Note that to avoid multiple RTB logs for ioread* and iowrite*
functions, read*_no_log and write*_no_log macros are added.

Change-Id: I2315d44c4dfbeee6be4a52f21bf4a20dd9508597
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2014-09-04 19:40:43 -07:00
Mark Salter cbb4516dd9 arm64: add early_ioremap support
Add support for early IO or memory mappings which are needed before the
normal ioremap() is usable.  This also adds fixmap support for permanent
fixed mappings such as that used by the earlyprintk device register
region.

Signed-off-by: Mark Salter <msalter@redhat.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Borislav Petkov <borislav.petkov@amd.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: bf4b558eba920a38f91beb5ee62a8ce2628c92f7
[joonwoop@codeaurora.org: fixed trivial merge conflict.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2014-08-15 11:45:24 -07:00
Mark Salter 40c3e6bf24 arm64: allow ioremap_cache() to use existing RAM mappings
Some drivers (ACPI notably) use ioremap_cache() to map an area which could
either be outside of kernel RAM or in an already mapped reserved area of
RAM. To avoid aliases with different caching attributes, ioremap() does
not allow RAM to be remapped. But for ioremap_cache(), the existing kernel
mapping may be used.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: c04e8e2fe5e0163fd37ccec7f538be8fa63be40e
[joonwoop@codeaurora.org: fixed trivial merge conflict.]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2014-08-15 11:45:22 -07:00
Catalin Marinas 5a8aef99e7 arm64: Extend the PCI I/O space to 16MB
The patch moves the PCI I/O space (currently at 64K) before the
earlyprintk mapping and extends it to 16MB.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: 22bd1c91fe13d59cff734b69b6757adcfbd8dee9
[joonwoop@codeaurora.org: fixed trivial merge conflict.  arm64 pcie
 change merged first]
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2014-08-15 11:41:21 -07:00
Tanmay Inamdar 781130f719 arm64: PCI(e) arch support
This patch adds the arch support for PCI(e) for arm64. The files
added or modified in this patch are based on PCI(e) support in
32bit arm.

Change-Id: Ie274623b5bf053e63d8857d256cbf91fef80bcf4
Signed-off-by: Tanmay Inamdar <tinamdar@apm.com>
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Git-commit: 0dbd501893bc8b003be715b8320e520614bd8ae1
Git-repo: git://kernel.ubuntu.com/ubuntu/ubuntu-trusty.git
[yanhe@codeaurora.org: solve the minor compilation errors]
Signed-off-by: Yan He <yanhe@codeaurora.org>
2014-06-12 10:35:47 -07:00
Subbaraman Narayanamurthy d040a6820e arm64: io: Add {readl/writel}_relaxed_no_log variants for arm64
readl_relaxed and writel_relaxed logs into RTB which we don't want
to use for certain accesses. Hence adding the _no_log variants for
using in such places.

Change-Id: I4e3be21e4bf068f2ede0266e6e966d757b04449e
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2014-06-09 11:37:08 -07:00
Catalin Marinas 9c665264b3 Revert "arm64: Fix memory shareability attribute for ioremap_wc/cache"
This reverts commit 2f7dc6027522499582a520807cb9ffda589de47e.

The above commit breaks the mapping type for Device memory because
pgprot_default already contains a Normal memory type. pgprot_default is
also not initialised early enough for earlyprintk resulting in an
inconsistent memory mapping with 64K PAGE_SIZE configuration.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Will Deacon <will.deacon@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Git-commit: 4ce00dfcf19c473f3dbf23d5b1372639f0c334f6
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2014-02-07 15:55:58 -08:00
Catalin Marinas c67b1b4004 arm64: Fix memory shareability attribute for ioremap_wc/cache
Write-combine and cacheable mappings use Normal memory on arm64. On SMP
systems, the pte needs the shareability bit which is set in
pgprot_default. Use this for defining PROT_DEFAULT used by ioremap_wc
and ioremap_cache (Device memory is shareable by default, does not need
additional attributes).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Git-commit: 2f7dc6027522499582a520807cb9ffda589de47e
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2014-02-07 15:55:45 -08:00
Stefano Stabellini 9097bc2222 arm,arm64/include/asm/io.h: define struct bio_vec
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Git-commit: ffc555be09bd2603abdbc6f8b64c6a7477facc48
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2014-02-07 15:55:37 -08:00
Stefano Stabellini b964717b79 arm,arm64: do not always merge biovec if we are running on Xen
This is similar to what it is done on X86: biovecs are prevented from merging
otherwise every dma requests would be forced to bounce on the swiotlb buffer.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>

Changes in v7:
- remove the extra autotranslate check in biomerge.c.
Git-commit: 3d1975b57097820c131c692d2e0d075641370369
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[imaund@codeaurora.org: resolve merge conflicts]
Signed-off-by: Ian Maund <imaund@codeaurora.org>
2014-02-07 13:49:53 -08:00
Xiaogang Cui 368c7a72ca msm: redefine __raw_{read, write}v for RTB
Redefine __raw_readv and __raw_writev for
RTB support.

Change-Id: Iae7b8e920abc4f23846690d3d1b3d1d933454788
Signed-off-by: Xiaogang Cui <xiaogang@codeaurora.org>
2014-02-05 09:33:49 -08:00
Stefano Stabellini b0c4dec77a arm64/xen: implement ioremap_cached on arm64
Change-Id: I567349ba54959b45e817e8ebacbb8babca1ca453
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Git-Repo: git://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
Git-commit: 22d4102f778df9cab47e871b8de3400f6e685378
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2014-02-05 09:33:37 -08:00
Chen Gang 12f883989c arm64: Define readq and writeq for driver module using
when compiling with allmodconfig, CONFIG_64BIT=y the file
drivers/base/regmap/regmap-mmio.c will use readq and writeq so we need
implement these functions.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2013-04-19 13:57:46 +01:00
Catalin Marinas 2475ff9d2c arm64: Add simple earlyprintk support
This patch adds support for "earlyprintk=" parameter on the kernel
command line. The format is:

  earlyprintk=<name>[,<addr>][,<options>]

where <name> is the name of the (UART) device, e.g. "pl011", <addr> is
the I/O address. The <options> aren't currently used.

The mapping of the earlyprintk device is done very early during kernel
boot and there are restrictions on which functions it can call. A
special early_io_map() function is added which creates the mapping from
the pre-defined EARLY_IOBASE to the device I/O address passed via the
kernel parameter. The pgd entry corresponding to EARLY_IOBASE is
pre-populated in head.S during kernel boot.

Only PL011 is currently supported and it is assumed that the interface
is already initialised by the boot loader before the kernel is started.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
2013-01-22 17:51:01 +00:00
Catalin Marinas 8e620b0476 arm64: Distinguish between user and kernel XN bits
On AArch64, the meaning of the XN bit has changed to UXN (user). The PXN
(privileged) bit must be set to prevent kernel execution. Without the
PXN bit set, the CPU may speculatively access device memory. This patch
ensures that all the mappings that the kernel must not execute from
(including user mappings) have the PXN bit set.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2012-11-16 15:50:25 +00:00
Catalin Marinas e3978cded4 arm64: Move PCI_IOBASE closer to MODULES_VADDR
This is to reuse the same pmd table that is sparsely populated with
the modules space.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2012-10-23 15:30:51 +01:00
Catalin Marinas 489f781a59 arm64: Use pgprot_t as the last argument when invoking __ioremap()
Even if it works with since the types have the same size, the correct
type of the last __ioremap() argument is pgprot_t rather than pteval_t.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2012-10-23 15:30:47 +01:00
Catalin Marinas fc47897d2c arm64: Device specific operations
This patch adds several definitions for device communication, including
I/O accessors and ioremap(). The __raw_* accessors are implemented as
inline asm to avoid compiler generation of post-indexed accesses (less
efficient to emulate in a virtualised environment).

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2012-09-17 13:42:04 +01:00