--- zzzz-none-000/linux-4.1.38/arch/arm64/mm/dma-mapping.c 2017-01-18 18:48:06.000000000 +0000 +++ bcm63-7582-715/linux-4.1.38/arch/arm64/mm/dma-mapping.c 2020-11-25 10:06:48.000000000 +0000 @@ -161,6 +161,19 @@ if (!ptr) goto no_mem; +#if defined(CONFIG_BCM_KF_COHERENT_OUTER_SHARED) && defined(CONFIG_BCM_COHERENT_OUTER_SHARED) + if (coherent) + { + /* remove any dirty cache lines on the kernel alias */ + __dma_flush_range(ptr, ptr + size); + + /*Yoni Itah: in case of coherent Need to remap to normal memory, cacheable outer sharable*/ + ptr = dma_common_contiguous_remap(virt_to_page((void*)ptr), size, VM_USERMAP, + __pgprot(PROT_OUTER_SHARABLE), + NULL); + return ptr; + } +#endif /* no need for non-cacheable mapping if coherent */ if (coherent) return ptr;