aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2015-07-01 05:02:39 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-07-03 10:00:23 -0400
commitac5e2f170f033e48cfcdc2c4f74b27083eabffa5 (patch)
treed8694bf6255e43bb9d3b2918b7be651fc51d5f53
parent05a8256c586ab75bcd6b793737b2022a1a98cb1e (diff)
ARM: io: document ARM specific behaviour of ioremap*() implementations
Add documentation of the ARM specific behaviour of the mappings setup by the ioremap() series of macros. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/include/asm/io.h42
1 files changed, 39 insertions, 3 deletions
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 1c3938f26beb..ae10717f61d4 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -348,11 +348,47 @@ static inline void memcpy_toio(volatile void __iomem *to, const void *from,
348#endif /* readl */ 348#endif /* readl */
349 349
350/* 350/*
351 * ioremap and friends. 351 * ioremap() and friends.
352 * 352 *
353 * ioremap takes a PCI memory address, as specified in 353 * ioremap() takes a resource address, and size. Due to the ARM memory
354 * Documentation/io-mapping.txt. 354 * types, it is important to use the correct ioremap() function as each
355 * mapping has specific properties.
355 * 356 *
357 * Function Memory type Cacheability Cache hint
358 * ioremap() Device n/a n/a
359 * ioremap_nocache() Device n/a n/a
360 * ioremap_cache() Normal Writeback Read allocate
361 * ioremap_wc() Normal Non-cacheable n/a
362 * ioremap_wt() Normal Non-cacheable n/a
363 *
364 * All device mappings have the following properties:
365 * - no access speculation
366 * - no repetition (eg, on return from an exception)
367 * - number, order and size of accesses are maintained
368 * - unaligned accesses are "unpredictable"
369 * - writes may be delayed before they hit the endpoint device
370 *
371 * ioremap_nocache() is the same as ioremap() as there are too many device
372 * drivers using this for device registers, and documentation which tells
373 * people to use it for such for this to be any different. This is not a
374 * safe fallback for memory-like mappings, or memory regions where the
375 * compiler may generate unaligned accesses - eg, via inlining its own
376 * memcpy.
377 *
378 * All normal memory mappings have the following properties:
379 * - reads can be repeated with no side effects
380 * - repeated reads return the last value written
381 * - reads can fetch additional locations without side effects
382 * - writes can be repeated (in certain cases) with no side effects
383 * - writes can be merged before accessing the target
384 * - unaligned accesses can be supported
385 * - ordering is not guaranteed without explicit dependencies or barrier
386 * instructions
387 * - writes may be delayed before they hit the endpoint memory
388 *
389 * The cache hint is only a performance hint: CPUs may alias these hints.
390 * Eg, a CPU not implementing read allocate but implementing write allocate
391 * will provide a write allocate mapping instead.
356 */ 392 */
357#define ioremap(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE) 393#define ioremap(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE)
358#define ioremap_nocache(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE) 394#define ioremap_nocache(cookie,size) __arm_ioremap((cookie), (size), MT_DEVICE)