Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a313e545 authored by Larry Bassel's avatar Larry Bassel Committed by Prasad Sodagudi
Browse files

arm64: provide dma cache routines with same API as 32 bit



The APIs __dma_inv_range() and __dma_clean_range() were
not exported by the third party patch. Since the functions
starting with underscores are not to be directly used by drivers,
related functions without the underscores are provided
which have the same name and functionality as the 32 bit APIs.

CRs-Fixed: 1053067
Change-Id: Ie0e681614307d9d9a19e58cacfb9b5dff4528977

arm64: add defines for dmac_*_range for compatibility with arm32

An earlier patch created defines for dma_*_range APIs to be
compatible with arm 32 bit, however it appears
these API names have not (at least yet) appeared there, so
revise the names to dmac_*_range, which is defined
for arm 32 bit so that there is one name defined
for both architectures.

CRs-Fixed: 1053067
Change-Id: I6456c02bad73fb54a874dc9925d3d43d9b8be2f2
Signed-off-by: default avatarLarry Bassel <lbassel@codeaurora.org>
(cherry picked from commit 0930bab0db67cc0d91e52e385e3e061871c6be05)
[psodagud: fixed up trivial merge conflicts and warnings]
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
parent 323a5f19
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -92,6 +92,15 @@ static inline void flush_cache_range(struct vm_area_struct *vma,
extern void __dma_map_area(const void *, size_t, int);
extern void __dma_unmap_area(const void *, size_t, int);
extern void __dma_flush_area(const void *, size_t);
extern void __dma_inv_area(const void *start, size_t size);
extern void __dma_clean_area(const void *start, size_t size);

#define dmac_flush_range(start, end) \
	_dma_flush_area(start, (void *)(end) - (void *)(start))
#define dmac_inv_range(start, end) \
	__dma_inv_area(start, (void *)(end) - (void *)(start))
#define dmac_clean_range(start, end) \
	__dma_clean_area(start, (void *)(end) - (void *)(start))

/*
 * Copy user data from/to a page which is mapped into a different
+2 −2
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ ENDPROC(__clean_dcache_area_pou)
 *	- start   - virtual start address of region
 *	- size    - size in question
 */
__dma_inv_area:
ENTRY(__dma_inv_area)
	add	x1, x1, x0
	/* FALLTHROUGH */

@@ -160,7 +160,7 @@ ENTRY(__clean_dcache_area_poc)
 *	- start   - virtual start address of region
 *	- size    - size in question
 */
__dma_clean_area:
ENTRY(__dma_clean_area)
	dcache_by_line_op cvac, sy, x0, x1, x2, x3
	ret
ENDPIPROC(__clean_dcache_area_poc)