Subject: Re: Mapping unchached memory with UDD References: <09544b49-088d-e0e0-1dca-7f7df9ec12e0@xenomai.org> From: Wolfgang Grandegger Message-ID: Date: Sat, 16 Mar 2019 18:19:34 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Philippe Gerum , "Xenomai@xenomai.org" Am 16.03.19 um 14:39 schrieb Philippe Gerum: > On 3/16/19 12:48 PM, Wolfgang Grandegger wrote: >> Hello Philippe, >> >> Am 14.03.19 um 15:32 schrieb Philippe Gerum: >>> >>> Hi Wolfgang, >>> >>> On 3/14/19 11:38 AM, Wolfgang Grandegger via Xenomai wrote: >>>> Hello, >>>> >>>> I'm writing a little UDD driver to handling interrupts and shared memory >>>> to communicate with a co-processor. Is it possible to setup and map a >>>> "mem_region" for *uncahced* memory. Will it be automatically uncached if >>>> it's of type UDD_MEM_PHY? >>>> >>> >>> Yep. Such requests is routed to RTDM's iomem mapping helper, which does: >>> >>> static int mmap_iomem_helper(struct vm_area_struct *vma, phys_addr_t pa) >>> { >>> pgprot_t prot = PAGE_SHARED; >>> unsigned long len; >>> >>> len = vma->vm_end - vma->vm_start; >>> ... >>> vma->vm_page_prot = pgprot_noncached(prot); >>> >>> return remap_pfn_range(vma, vma->vm_start, pa >> PAGE_SHIFT, >>> len, vma->vm_page_prot); >>> } >> >> I was aware of that code! I suspected some other magic when mapping >> system memory with UDD_MEM_PHY. Maybe it's a barrier issue in the A9 or >> M4 code. >> > > Any DMA in between? No, just programmed I/O. Wolfgang.