Mapping unchached memory with UDD

Philippe Gerum rpm at xenomai.org
Sat Mar 16 14:39:21 CET 2019


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?


-- 
Philippe.



More information about the Xenomai mailing list