How to obtain epf bar0 physical address

Hello,
In pci-epf-dma-test.c following lines is used to allocate BAR memory.
epfnv->bar0_virt = pci_epf_alloc_space(epf, BAR0_SIZE, BAR_0, SZ_64K);
dma_phy_addr is set as follows;
epf_bar0->ep_phy_addr = epf_bar->phys_addr;
How can I find physical address for epfnv->bar0_virt?
virt_to_phys(epfnv->bar0_virt) doesn’t give correct address.
dma_to_phys(epf_bar->phys_addr) doesn’t give correct address.
Best Regards

maybe this would help clarify

You could also refer to the 3 sample codes there.

pci-epf-dma-test.c
pci-epf-nv-test.c
pci-epf-tegra-vnet.c

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.