3588cpcie 发表于 6 天前

3588 pcie ep bar4无法读写

Hi forlinx,

我把ok3588c的pcie3x4配置成ep模式,连上3568的rc后, rc侧能识别到3588 ep,lspci也能显示,配置空间能访问,我自己写的设备驱动也能probe到,能enable memory,我的设备驱动什么都没做,只是enable了bar,但是我用busybox devmem命令从rc侧去写ep的bar有问题。

比如说ep配置bar4 1M,rc配置bar4为0xf0800000, rc处理好outbound后,我用devmem命令去写0xf0800000,写之前值是0x00000688,写32位也就是4字节写0xffffffff,但是只有低12位能写也就是再次读0xf0800000后值是0x00000fff,并且0xf0800004开始都不可写,写全f都是不生效的,写之前值是0,写之后还是0。

对应ep侧的配置我只是和ep pdf里一样配置了下reserverd_memory加上了bar0和bar4,其余bar全disable,我检查了下rc的outbound和ep的inbound,都是可行的,请问是有什么寄存器还需要配置的吗?

下面是一些log,显示了rc的outbound和ep的inbound
################RC
root@lubancat:~# cat /sys/kernel/3c0800000.pcie/rc_outbound
rk3568 rc inbound dump
outbound index: 0, type: 4, enabled: 0x80000000
outbound target upper:lower 0x0:0x21000000
outbound base upper:lower 0x0:0xf0000000
outbound limit upper:lower 0x0:0xf00fffff
outbound index: 1, type: 0, enabled: 0x80000000
outbound target upper:lower 0x0:0xf0200000
root@lubancat:~# outbound base upper:lower 0x0:0xf0200000
outbound limit upper:lower 0x0:0xf1ffffff
outbound index: 2, type: 0, enabled: 0x80000000
outbound target upper:lower 0x3:0x80000000
outbound base upper:lower 0x3:0x80000000
outbound limit upper:lower 0x1:0xbfffffff
outbound index: 3, type: 2, enabled: 0x80000000
outbound target upper:lower 0x0:0xf0100000
outbound base upper:lower 0x0:0xf0100000
outbound limit upper:lower 0x0:0xf01fffff
outbound index: 4, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x11110000
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 5, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x11110000
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 6, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x11110000
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 7, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x11110000
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 8, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x0
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 9, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x0
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 10, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x0
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 11, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x0
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 12, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x0
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 13, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x0
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 14, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x0
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff
outbound index: 15, type: 0, enabled: 0x0
outbound target upper:lower 0x0:0x0
outbound base upper:lower 0x0:0x0
outbound limit upper:lower 0x0:0xffff

root@lubancat:~#
root@lubancat:~# busybox devmem 0xf0800000 32
0x00000688
root@lubancat:~# busybox devmem 0xf0800000 32 0xffffffff
root@lubancat:~# busybox devmem 0xf0800000 32
0x00000FFF
root@lubancat:~# busybox devmem 0xf0800004 32 0xffffffff
root@lubancat:~# busybox devmem 0xf0800000 32
0x00000FFF
root@lubancat:~# busybox devmem 0xf0800004 32
0x00000000
root@lubancat:~# busybox devmem 0xf08f0004 32
0x00000000
root@lubancat:~# busybox devmem 0xf08f0004 32 0xffffffff
root@lubancat:~# busybox devmem 0xf08f0004 32
0x00000000
root@lubancat:~# busybox devmem 0xf08ffff 8
devmem: mmap: Operation not permitted
root@lubancat:~# busybox devmem 0xf08fffff 8
0x00
root@lubancat:~# busybox devmem 0xf08fffff 8 0xff
root@lubancat:~# busybox devmem 0xf08fffff 8
0x00

######################EP
root@ok3588:~# busybox devmem 0xa40000020 32
0xF0800000

root@ok3588:~# cat /sys/kernel/my_rk3588_pcie_ep/bar4_ep_atu                                       
rk3588 ep ib, target upper:lower 0x0: 0x40000000
root@ok3588:~# rk3588 ep ib, base upper:lower 0x0: 0xf0800000
rk3588 ep ib, limit upper:lower 0x0: 0xf08fffff
rk3588 ep ib, type :0, enabled: 1


有谁知道是还需要配置什么东西吗?我现在都看不见出什么问题了,我觉得rc应该是没问题的,因为插网卡都是能跑的,而且配置空间也能读。但ep侧我连tlp报文都看不见,和黑盒一样


页: [1]
查看完整版本: 3588 pcie ep bar4无法读写