To use PCIe to communication between xavier & rk3588. Xavier is configured as endpoint mode. Share mem isn't working

EP:

The defualt pci-epf-nv-test.c is work. I modified the name to pci-epf-nv.c, define BAR0_SIZE SZ_8M ,and epfnv->header.deviceid = 0x0007.

set:
cd /sys/kernel/config/pci_ep/
sudo mkdir functions/pci_epf_nv/func1
sudo su
echo 0x10de > functions/pci_epf_nv/func1/vendorid
echo 0x0007 > functions/pci_epf_nv/func1/deviceid
ln -s functions/pci_epf_nv/func1 controllers/141a0000.pcie_ep/
echo 1 > controllers/141a0000.pcie_ep/start

dmesg | grep pci_epf_nv
[ 302.819038] pci_epf_nv: loading out-of-tree module taints kernel.
[ 308.771739] pci_epf_nv_probe invoked!
[ 308.776440] pci_epf_nv_bind ------------
[ 308.776572] pci_epf_nv pci_epf_nv.0: BAR0 RAM phys: 0x43470e000
[ 308.777777] pci_epf_nv pci_epf_nv.0: BAR0 RAM IOVA: 0xff800000
[ 308.777830] pci_epf_nv pci_epf_nv.0: BAR0 RAM virt: 0x00000000905e420b
[ 352.490949] Error: Driver ‘pci_epf_nv_test’ is already registered, aborting…
root@yjj-desktop:/home/yjj/Proc/pcie#

root@yjj-desktop:/home/yjj/Proc/pcie# busybox devmem 0x43470e000 32 0xfa950000
root@yjj-desktop:/home/yjj/Proc/pcie# busybox devmem 0x43470e000 32
PCIe Endpoint Mode

Increasing size of BAR0 in Endpoint Mode

RP:
root@localhost:/home/utest/Proc/pcie# lspci -v -s 0000:01:00.0
0000:01:00.0 RAM memory: NVIDIA Corporation Device 0007
Flags: fast devsel, IRQ 255
Memory at f0800000 (32-bit, prefetchable) [size=8M]
Memory at 900000000 (64-bit, prefetchable) [size=128K]
Memory at f0400000 (64-bit, non-prefetchable) [size=1M]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit-
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [b0] MSI-X: Enable- Count=8 Masked-
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] Secondary PCI Express
Capabilities: [168] Physical Layer 16.0 GT/s <?> Capabilities: [190] Lane Margining at the Receiver <?>
Capabilities: [1b8] Latency Tolerance Reporting
Capabilities: [1c0] L1 PM Substates
Capabilities: [1d0] Vendor Specific Information: ID=0002 Rev=4 Len=100 <?> Capabilities: [2d0] Vendor Specific Information: ID=0001 Rev=1 Len=038 <?>
Capabilities: [308] Data Link Feature <?> Capabilities: [314] Precision Time Measurement Capabilities: [320] Vendor Specific Information: ID=0003 Rev=1 Len=054 <?>
lspci: Unable to load libkmod resources: error -12

sudo setpci -s 0000:01:00.0 COMMAND=0x02
pci-epf-nv&pci-epf-nv_test.zip (3.7 KB)

If I set the bar size to BAR0_SIZE SZ_16M or BAR0_SIZE SZ_32M:

0000:01:00.0 RAM memory: NVIDIA Corporation Device 0007
Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 255
Region 0: Memory at (32-bit, prefetchable) [disabled]
Region 2: Memory at 900000000 (64-bit, prefetchable) [disabled] [size=128K]
Region 4: Memory at (64-bit, non-prefetchable) [disabled]
Capabilities: