/*
gcdENABLE_MEM_CACHE
- ÅäÖÃGPUËùʹÓõÄmemoryÊÇ·ñ±»ARM Cacheס
+ ÅäÖÃGPUËùʹÓõÄmemoryÊÇ·ñ±»ARM Cache»òWriteCombineס
+ 1: Cached
+ 2: WriteCombine
+
*/
-#define gcdENABLE_MEM_CACHE 1
+#define gcdENABLE_MEM_CACHE 2
#endif /* __gc_hal_options_h_ */
return -ENOTTY;
}
-#if !gcdENABLE_MEM_CACHE
+#if (2==gcdENABLE_MEM_CACHE)
+ vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
+#elif (1==gcdENABLE_MEM_CACHE)
+ // NULL
+#else
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
#endif
vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND;
}
#else
-#if !gcdENABLE_MEM_CACHE
+#if (2==gcdENABLE_MEM_CACHE)
+ mdlMap->vma->vm_page_prot = pgprot_writecombine(mdlMap->vma->vm_page_prot);
+#elif (1==gcdENABLE_MEM_CACHE)
+ // NULL
+#else
mdlMap->vma->vm_page_prot = pgprot_noncached(mdlMap->vma->vm_page_prot);
#endif
mdlMap->vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED;
}
#else
-#if !gcdENABLE_MEM_CACHE
+#if (2==gcdENABLE_MEM_CACHE)
+ mdlMap->vma->vm_page_prot = pgprot_writecombine(mdlMap->vma->vm_page_prot);
+#elif (1==gcdENABLE_MEM_CACHE)
+ // NULL
+#else
mdlMap->vma->vm_page_prot = pgprot_noncached(mdlMap->vma->vm_page_prot);
#endif
mdlMap->vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED;
mdlMap->vma->vm_flags |= VM_RESERVED;
/* Make this mapping non-cached. */
-#if !gcdENABLE_MEM_CACHE
+#if (2==gcdENABLE_MEM_CACHE)
+ mdlMap->vma->vm_page_prot = pgprot_writecombine(mdlMap->vma->vm_page_prot);
+#elif (1==gcdENABLE_MEM_CACHE)
+ // NULL
+#else
mdlMap->vma->vm_page_prot = pgprot_noncached(mdlMap->vma->vm_page_prot);
#endif
IN gctSIZE_T Bytes
)
{
-#if gcdENABLE_MEM_CACHE
+#if (1==gcdENABLE_MEM_CACHE)
dmac_clean_range(Logical, Logical+Bytes);
#endif
return gcvSTATUS_OK;
IN gctSIZE_T Bytes
)
{
-#if gcdENABLE_MEM_CACHE
+#if (1==gcdENABLE_MEM_CACHE)
dmac_flush_range(Logical, Logical+Bytes);
#endif
return gcvSTATUS_OK;