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><enginename="fm0"><porttype="MAC"number="1"policy="fm_policy_1"/><porttype="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>