pcie bar memory map error

now i need use a pcie switch bar2 addr space. it map at 0x50400000 ,i just use remap_pfn_range to enable it write/read in user space and read it use mmap. But the data is always 0xff i read from the mmap addr.At the same time,i use the same code in x86 platform,it can work fine.
Need i modify something in the kernel or dtb?

I think the way you are mapping seems to have some issue as otherwise, this works with standards userspace tools like ‘busybox devmem’. Can you please check the method you are using to map once?