RapidIO
RapidIO架构是一种高性能分组交换电连接技术。 它支持消息传递、读/写和缓存一致性语义。 基于以太网等行业标准电气规范,RapidIO 可用作芯片到芯片、板到板和机箱到机箱互连。
HXDSP2441 SRIO 自回环测试
SRIO自回环测试需要使能SC_Loopback0
、SC_Loopback1
、SC_Loopback2
和SC_Loopback3
寄存器,可以手动写入,也可取消BSP中rio_phy.c文件32857-32860行的注释。
#define CONFIGURE_INIT
#include "sys_cfg.h"
#include "xconfig.h"
static int dma_opt_test(void) {
int status, i, len = 16 * 1024;
for (i = 0; i < len; i++) {
*(uint32_t *)(0x70000000 + i) = 0;
*(uint32_t *)(0x1280000 + i) = 0;
*(uint32_t *)(0x12a0000 + i) = 0;
*(uint32_t *)(0x1260000 + i) = i;
}
/*
* 映射表配置: #define SRIO0_RPIO_LUT_UPADDR 0
*/
status = srio_driver_opt_write(SRIO3_DEVICE_ID, 0x4980000, 0x4A00000, 0x0, 0x0,
0x0, len * 4, SRIO1_NODEID);
if (status != 0)
return -1;
status = srio_driver_opt_read(SRIO3_DEVICE_ID, 0x4A00000, 0x4a80000, 0x0, 0x0,
0x0, len * 4, SRIO1_NODEID);
if (status != 0)
return -1;
int check_ok = 1;
for (i = 0; i < len; i++) {
if (*(uint32_t *)(0x1260000 + i) != i) {
printf("read error at 0x%x, expect 0x%x but get 0x%x\n", (uint32_t *)(0x4a80000 + i), i, *(uint32_t *)(0x4a80000 + i));
check_ok = 0;
}
}
printf("dma_opt_test %s\n", check_ok ? "ok" : "fail");
return status;
}
int main(int argc, char *argv[]) {
pll_init();
int status = 0;
status = srio_driver_initialize(SRIO3_DEVICE_ID, NULL);
if (status != 0)
return -1;
status = srio_driver_open(SRIO3_DEVICE_ID, NULL);
if (status != 0)
return -1;
status = dma_opt_test();
status = srio_driver_close(SRIO1_DEVICE_ID, NULL);
if (status != 0)
return -1;
return 0;
}