misc: rockchip: pcie-rkep: Using BAR2 as device memory

1.Usually BAR2 can be used to map endpoint registers;
2.Using the noncache attribute can effectively avoid problems
caused by improper use by users.

Change-Id: I99a11c00d59079c080f6bd53291d970c60311430
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2025-07-22 22:34:34 +08:00
committed by Tao Huang
parent 6542cc7762
commit 6d6a8fc3df

View File

@@ -610,8 +610,7 @@ static int pcie_rkep_mmap(struct file *file, struct vm_area_struct *vma)
return -EINVAL;
}
if (pcie_rkep->cur_mmap_res == PCIE_EP_MMAP_RESOURCE_BAR2 ||
pcie_rkep->cur_mmap_res == PCIE_EP_MMAP_RESOURCE_USER_MEM)
if (pcie_rkep->cur_mmap_res == PCIE_EP_MMAP_RESOURCE_USER_MEM)
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
else
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);