summaryrefslogtreecommitdiff
path: root/arch/xtensa/include/asm/platform.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2018-07-12 00:33:41 +0300
committerMax Filippov <jcmvbkbc@gmail.com>2018-07-12 01:59:41 +0300
commit2cc15e802b250a11ece57ea54f82993cf3430867 (patch)
treed67e3892c92e077bebeac05db22765376e8de5c1 /arch/xtensa/include/asm/platform.h
parentadbfa4e6f99689511f1079452508d9d22417544c (diff)
downloadlinux-2cc15e802b250a11ece57ea54f82993cf3430867.tar.xz
xtensa: platform-specific handling of coherent memory
Memory layout is not fixed for noMMU xtensa configurations. Platforms that need to use coherent DMA should implement platform_vaddr_* helpers that check address type (cached/uncached) and convert addresses between these types. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/include/asm/platform.h')
-rw-r--r--arch/xtensa/include/asm/platform.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/xtensa/include/asm/platform.h b/arch/xtensa/include/asm/platform.h
index f8fbef67bc5f..560483356a06 100644
--- a/arch/xtensa/include/asm/platform.h
+++ b/arch/xtensa/include/asm/platform.h
@@ -75,4 +75,31 @@ extern void platform_calibrate_ccount (void);
*/
void cpu_reset(void) __attribute__((noreturn));
+/*
+ * Memory caching is platform-dependent in noMMU xtensa configurations.
+ * The following set of functions should be implemented in platform code
+ * in order to enable coherent DMA memory operations when CONFIG_MMU is not
+ * enabled. Default implementations do nothing and issue a warning.
+ */
+
+/*
+ * Check whether p points to a cached memory.
+ */
+bool platform_vaddr_cached(const void *p);
+
+/*
+ * Check whether p points to an uncached memory.
+ */
+bool platform_vaddr_uncached(const void *p);
+
+/*
+ * Return pointer to an uncached view of the cached sddress p.
+ */
+void *platform_vaddr_to_uncached(void *p);
+
+/*
+ * Return pointer to a cached view of the uncached sddress p.
+ */
+void *platform_vaddr_to_cached(void *p);
+
#endif /* _XTENSA_PLATFORM_H */