- 积分
- 5
贡献36
飞刀4 FD
注册时间2025-11-24
在线时间0 小时

 
扫一扫,手机访问本帖 
|
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
[ 303.956676] rk3568 rc inbound dump
[ 303.956795] outbound index: 0, type: 4, enabled: 0x80000000
[ 303.956812] outbound target upper:lower 0x0:0x21000000
[ 303.956824] outbound base upper:lower 0x0:0xf0000000
[ 303.956837] outbound limit upper:lower 0x0:0xf00fffff
[ 303.956851] outbound index: 1, type: 0, enabled: 0x80000000
[ 303.956863] outbound target upper:lower 0x0:0xf0200000
root@lubancat:~# [ 303.956875] outbound base upper:lower 0x0:0xf0200000
[ 303.956886] outbound limit upper:lower 0x0:0xf1ffffff
[ 303.956900] outbound index: 2, type: 0, enabled: 0x80000000
[ 303.956911] outbound target upper:lower 0x3:0x80000000
[ 303.956921] outbound base upper:lower 0x3:0x80000000
[ 303.956931] outbound limit upper:lower 0x1:0xbfffffff
[ 303.956946] outbound index: 3, type: 2, enabled: 0x80000000
[ 303.956957] outbound target upper:lower 0x0:0xf0100000
[ 303.956967] outbound base upper:lower 0x0:0xf0100000
[ 303.956977] outbound limit upper:lower 0x0:0xf01fffff
[ 303.956990] outbound index: 4, type: 0, enabled: 0x0
[ 303.957001] outbound target upper:lower 0x0:0x11110000
[ 303.957011] outbound base upper:lower 0x0:0x0
[ 303.957021] outbound limit upper:lower 0x0:0xffff
[ 303.957035] outbound index: 5, type: 0, enabled: 0x0
[ 303.957046] outbound target upper:lower 0x0:0x11110000
[ 303.957056] outbound base upper:lower 0x0:0x0
[ 303.957066] outbound limit upper:lower 0x0:0xffff
[ 303.957078] outbound index: 6, type: 0, enabled: 0x0
[ 303.957088] outbound target upper:lower 0x0:0x11110000
[ 303.957098] outbound base upper:lower 0x0:0x0
[ 303.957107] outbound limit upper:lower 0x0:0xffff
[ 303.957120] outbound index: 7, type: 0, enabled: 0x0
[ 303.957130] outbound target upper:lower 0x0:0x11110000
[ 303.957140] outbound base upper:lower 0x0:0x0
[ 303.957149] outbound limit upper:lower 0x0:0xffff
[ 303.957163] outbound index: 8, type: 0, enabled: 0x0
[ 303.957173] outbound target upper:lower 0x0:0x0
[ 303.957182] outbound base upper:lower 0x0:0x0
[ 303.957192] outbound limit upper:lower 0x0:0xffff
[ 303.957205] outbound index: 9, type: 0, enabled: 0x0
[ 303.957215] outbound target upper:lower 0x0:0x0
[ 303.957225] outbound base upper:lower 0x0:0x0
[ 303.957234] outbound limit upper:lower 0x0:0xffff
[ 303.957248] outbound index: 10, type: 0, enabled: 0x0
[ 303.957258] outbound target upper:lower 0x0:0x0
[ 303.957268] outbound base upper:lower 0x0:0x0
[ 303.957278] outbound limit upper:lower 0x0:0xffff
[ 303.957291] outbound index: 11, type: 0, enabled: 0x0
[ 303.957301] outbound target upper:lower 0x0:0x0
[ 303.957310] outbound base upper:lower 0x0:0x0
[ 303.957320] outbound limit upper:lower 0x0:0xffff
[ 303.957332] outbound index: 12, type: 0, enabled: 0x0
[ 303.957342] outbound target upper:lower 0x0:0x0
[ 303.957352] outbound base upper:lower 0x0:0x0
[ 303.957362] outbound limit upper:lower 0x0:0xffff
[ 303.957376] outbound index: 13, type: 0, enabled: 0x0
[ 303.957386] outbound target upper:lower 0x0:0x0
[ 303.957396] outbound base upper:lower 0x0:0x0
[ 303.957405] outbound limit upper:lower 0x0:0xffff
[ 303.957418] outbound index: 14, type: 0, enabled: 0x0
[ 303.957428] outbound target upper:lower 0x0:0x0
[ 303.957437] outbound base upper:lower 0x0:0x0
[ 303.957447] outbound limit upper:lower 0x0:0xffff
[ 303.957460] outbound index: 15, type: 0, enabled: 0x0
[ 303.957470] outbound target upper:lower 0x0:0x0
[ 303.957479] outbound base upper:lower 0x0:0x0
[ 303.957489] 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
[ 448.415846] rk3588 ep ib, target upper:lower 0x0: 0x40000000
root@ok3588:~# [ 448.415861] rk3588 ep ib, base upper:lower 0x0: 0xf0800000
[ 448.415867] rk3588 ep ib, limit upper:lower 0x0: 0xf08fffff
[ 448.415873] rk3588 ep ib, type :0, enabled: 1
有谁知道是还需要配置什么东西吗?我现在都看不见出什么问题了,我觉得rc应该是没问题的,因为插网卡都是能跑的,而且配置空间也能读。但ep侧我连tlp报文都看不见,和黑盒一样
|
|