NXP

NXP(Freescale) QorIQ T2080 SRIO使用

2019-07-12 12:47发布

class="markdown_views prism-dracula">

参考

A problem of sending SRIO doorbell, message by T2080

SDK

SDK中没有T2080的例子,但是T2080 RapidIO类似于P3041DS/P4080DS/P5020DS/T4240QDS/B4860QDS开发板的RapidIO,代码是通用的。对于目前使用RMAN的处理器,SDK的SRIO驱动以用户态的形式提供在 USDPAA中,执行bitbake usdpaa/usdpaa-apps -c patch -f可以得到usdpaa的源代码,路径为tmp/work/t2080rdb_64b-fsl-linux/usdpaa/git-r4/git,可参考SDK的FRA/SRA程序。内核下打开驱动支持, --- Userspace I/O drivers <*> Freescale DMA support <*> Freescale Serial RapidIO support <*> Freescale RapidIO Message Unit support 设备树需要使用usdpaa的设备树,否则fra无法加载,单独使用SRIO时,并不需要网口,所以得修改程序,网络部分并不使用usdpaa。 root@t2080rdb:~# fra Found /fsl,dpaa/ethernet@0, Tx Channel = 802, FMAN = 0, Port ID = 1 Found /fsl,dpaa/ethernet@1, Tx Channel = 803, FMAN = 0, Port ID = 2 Found /fsl,dpaa/ethernet@2, Tx Channel = 804, FMAN = 0, Port ID = 3 Found /fsl,dpaa/ethernet@3, Tx Channel = 805, FMAN = 0, Port ID = 4 Found /fsl,dpaa/ethernet@8, Tx Channel = 800, FMAN = 0, Port ID = 9 Found /fsl,dpaa/ethernet@9, Tx Channel = 801, FMAN = 0, Port ID = a QMan: Allocated lookup table at 0x3fff9409f010, entry count 32769 Configuring for 2 network interfaces BPOOL: Release 8192 bufs to BPID 9 BPOOL: Release 256 bufs to BPID 10 BPOOL: Release 8192 bufs to BPID 11 BPOOL: Release 8192 bufs to BPID 12 Port 1 is not ready. Try to restart connection... fra: fsl_srio_connection(): Input/output error fra: SRIO port0 is not connected Port 1 is not ready. Try to restart connection... fra: fsl_srio_connection(): Input/output error fra: SRIO port0 is not connected Port 1 is not ready. Try to restart connection... fra: fsl_srio_connection(): Input/output error fra: SRIO port0 is not connected Port 1 is not ready. Try to restart connection... fra: fsl_srio_connection(): Input/output error fra: SRIO port0 is not connected Thread uid:0 alive (on cpu 1) fra> q Thread uid:0 killed (cpu 1) 修改设备树使用部分网口为usdpaa, <cfgdata> <config> <engine name="fm0"> <port type="MAC" number="1" policy="fm_policy_1"/> <port type="MAC" number="2" policy="fm_policy_2"/> engine> config> cfgdata> 测试fra, root@t2080rdb:~# fra -c config_srio.xml -p policy_ipv4.xml -f fra_config_mbox_processing1.xml Found /fsl,dpaa/ethernet@0, Tx Channel = 802, FMAN = 0, Port ID = 1 Found /fsl,dpaa/ethernet@1, Tx Channel = 803, FMAN = 0, Port ID = 2 QMan: Allocated lookup table at 0x3fffb244f010, entry count 32769 Configuring for 2 network interfaces warn: drained 8192 bufs from BPID 9 BPOOL: Release 8192 bufs to BPID 9 warn: drained 256 bufs from BPID 10 BPOOL: Release 256 bufs to BPID 10 warn: drained 8192 bufs from BPID 11 BPOOL: Release 8192 bufs to BPID 11 warn: drained 8192 bufs from BPID 12 BPOOL: Release 8192 bufs to BPID 12 Port 1 is not ready. Try to restart connection... fra: fsl_srio_connection(): Input/output error fra: SRIO port0 is not connected Port 1 is not ready. Try to restart connection... fra: fsl_srio_connection(): Input/output error fra: SRIO port0 is not connected Port 1 is not ready. Try to restart connection... fra: fsl_srio_connection(): Input/output error fra: SRIO port0 is not connected Port 1 is not ready. Try to restart connection... fra: fsl_srio_connection(): Input/output error fra: SRIO port0 is not connected Thread uid:0 alive (on cpu 1) fra>

doorbell收发

新建fra配置文件,rman_cfg为默认配置,trans_cfg的type字段为Doorbell,flowlvl表示flow level为5,dists_cfg定义rman处理的消息,RMAN_RX和RMAN_TX,sid定义源id,did 定义目的id <fra_cfg> <rman_cfg> <defcfg file="/usr/etc/rman_config.xml"/> rman_cfg> <trans_cfg> <transaction name="dbell-peer" type="Doorbell"> <flowlvl value="5" mask="1"/> transaction> trans_cfg> <dists_cfg> <distribution name="dbell_from_peer" type="RMAN_RX"> <rio_port number="0" mask="1"/> <sid value="0x11" mask="0xff"/> <queue base="0x4100" mode="direct" wq="0"/> <transactionref name="dbell-peer"/> distribution> <distribution name="dbell_to_peer" type="RMAN_TX"> <rio_port number="0"/> <did value="0x11"/> <queue base="0x4200" count="4" wq="0"/> <transactionref name="dbell-peer"/> distribution> dists_cfg> <policies_cfg> <policy name="peer-srio-peer" enable="yes"> <dist_order> <distributionref name="dbell_to_peer"/> <distributionref name="dbell_from_peer"/> dist_order> policy> policies_cfg> fra_cfg>