天天看點

遠端計算機沒反映6678,6678 PCIe 與FPGA LINK UP 後 不能獲得FPGA的DEVICE_ID和VENDDR_ID

我用的代碼模闆是C:\ti\pdk_C6678_1_1_2_6\packages\ti\drv\pcie\example\sample 查相關PCIE協定在RC配置EP時是基于ID的跟位址沒有關系

6678 PCIe 與FPGA  LINK UP 後 不能獲得FPGA的DEVICE_ID和VENDDR_ID 求大神指導

1.配置DSP為RC ,FPGA為EP

2.本地配置寄存器配置如下:

barCfg.location = pcie_LOCATION_LOCAL; //配置本地的配置寄存器

barCfg.mode = pcie_RC_MODE;

barCfg.base = 0x70000000;//PCIE_IB_LO_ADDR_M;

barCfg.prefetch = pcie_BAR_NON_PREF;

barCfg.type = pcie_BAR_TYPE32;

barCfg.memSpace = pcie_BAR_MEM_MEM;

barCfg.idx = PCIE_BAR_IDX_M;//指定翻譯區域1

if ((retVal = Pcie_cfgBar(handle, &barCfg)) != pcie_RET_OK)

{

System_printf ("Failed to configure BAR (%d)\n", (int)retVal);

exit(1);

}

3.配置輸入位址轉換

ibCfg.ibBar = PCIE_BAR_IDX_M; //使用的是BAR1也可以使用 2,3,4,5 BAR0是給EP的配置空間

ibCfg.ibStartAddrLo = PCIE_IB_LO_ADDR_M;//0x90000000

ibCfg.ibStartAddrHi = PCIE_IB_HI_ADDR_M;//0x00000000

ibCfg.ibOffsetAddr = (uint32_t)pcieConvert_CoreLocal2GlobalAddr ((uint32_t)dstBuf.buf);

ibCfg.region = PCIE_IB_REGION_M; //指定翻譯區域0 也可以選擇 1、2、3

4 輸出位址轉換

if ((retVal = pcieObTransCfg (handle, PCIE_OB_LO_ADDR_M(0x70000000), PCIE_OB_HI_ADDR_M(0x00000000), PCIE_OB_REGION_M)) != pcie_RET_OK)

5.LINK UP之後的代碼如下

System_printf ("Link is up.\n");

priority.mstPrivID = 11;

setRegs.priority = &priority;

Pcie_writeRegs (handle, pcie_LOCATION_REMOTE, &setRegs);

remote_cfg_setup.type = 0;

remote_cfg_setup.bus = 0;

remote_cfg_setup.device = 0;

remote_cfg_setup.func = 0;

setRegs.cfgTrans = &remote_cfg_setup;

if ((retVal = Pcie_writeRegs (handle, pcie_LOCATION_REMOTE, &setRegs)) != pcie_RET_OK)

{

System_printf ("SET CMD STATUS register failed!\n");

}

if ((retVal = Pcie_getMemSpaceRange (handle, &pcieBase, NULL)) != pcie_RET_OK) {

System_printf ("getMemSpaceRange failed\n", (int)retVal);

exit(1);

}

volatile UInt32 *epCfg = (UInt32 *)0x21801000;

int n=0;

for(n = 0; n < 116; n+=4)

{

System_printf("offset: 0x%x : %08x %08x %08x %08x\n", n*4, epCfg[n+0], epCfg[n+1], epCfg[n+2], epCfg[n+3]);

System_flush();

}

volatile UInt32 *epCfg1 = (UInt32 *)0x21802000;

for(n = 0; n < 116; n+=4)

{

System_printf("offset: 0x%x : %08x %08x %08x %08x\n", n*4, epCfg1[n+0], epCfg1[n+1], epCfg1[n+2], epCfg1[n+3]);

System_flush();

}

6.列印資訊如下

Successfully configured Inbound Translation!

Successfully configured Outbound Translation!

Starting link training...

Link is up.

offset: 0x0 : 8888104c 00100146 00000001 00010000

offset: 0x10 : 00000000 70000000 00000000 00000000

offset: 0x20 : 00000000 00000000 00000000 00000000

offset: 0x30 : 00000000 00000040 00000000 000001ff

offset: 0x40 : 00035001 00000000 00000000 00000000

offset: 0x50 : 00807005 00000000 00000000 00000000

offset: 0x60 : 00000000 00000000 00000000 00000000

offset: 0x70 : 00420010 00008001 0005281f 00135422

offset: 0x80 : 10110008 00000040 004003c0 00000000

offset: 0x90 : 00000000 0000001f 00000000 00000006

offset: 0xa0 : 00010002 00000000 00000000 00000000

offset: 0xb0 : 00000000 00000000 00000000 00000000

offset: 0xc0 : 00000000 00000000 00000000 00000000

offset: 0xd0 : 00000000 00000000 00000000 00000000

offset: 0xe0 : 00000000 00000000 00000000 00000000

offset: 0xf0 : 00000000 00000000 00000000 00000000

offset: 0x100 : 00010001 00002000 00000000 00062030

offset: 0x110 : 00000001 00002000 000001ed 00000000

offset: 0x120 : 00000000 00000000 00000000 00000000

offset: 0x130 : 00000057 00000000 00000000 00000000

offset: 0x140 : 00000000 00000000 00000000 00000000

offset: 0x150 : 00000000 00000000 00000000 00000000

offset: 0x160 : 00000000 00000000 00000000 00000000

offset: 0x170 : 00000000 00000000 00000000 00000000

offset: 0x180 : 00000000 00000000 00000000 00000000

offset: 0x190 : 00000000 00000000 00000000 00000000

offset: 0x1a0 : 00000000 00000000 00000000 00000000

offset: 0x1b0 : 00000000 00000000 00000000 00000000

offset: 0x1c0 : 00000000 00000000 00000000 00000000

offset: 0x0 : 00000000 00000000 21802000 00000070

offset: 0x10 : 00000000 00000000 21802000 00000000

offset: 0x20 : 00000000 00000000 21802000 00000004

offset: 0x30 : 00000000 00000000 21802000 00000008

offset: 0x40 : 00000000 00000000 21802000 0000000c

offset: 0x50 : 00000000 00000000 21802000 00000010

offset: 0x60 : 00000000 00000000 21802000 00000014

offset: 0x70 : 00000000 00000000 21802000 00000018

offset: 0x80 : 00000000 00000000 21802000 0000001c

offset: 0x90 : 00000000 00000000 21802000 00000020

offset: 0xa0 : 00000000 00000000 21802000 00000024

offset: 0xb0 : 00000000 00000000 21802000 00000028

offset: 0xc0 : 00000000 00000000 21802000 0000002c

offset: 0xd0 : 00000000 00000000 21802000 00000030

offset: 0xe0 : 00000000 00000000 21802000 00000034

offset: 0xf0 : 00000000 00000000 21802000 00000038

offset: 0x100 : 00000000 00000000 21802000 0000003c

offset: 0x110 : 00000000 00000000 21802000 00000040

offset: 0x120 : 00000000 00000000 21802000 00000044

offset: 0x130 : 00000000 00000000 21802000 00000048

offset: 0x140 : 00000000 00000000 21802000 0000004c

offset: 0x150 : 00000000 00000000 21802000 00000050

offset: 0x160 : 00000000 00000000 21802000 00000054

offset: 0x170 : 00000000 00000000 21802000 00000058

offset: 0x180 : 00000000 00000000 21802000 0000005c

offset: 0x190 : 00000000 00000000 21802000 00000060

offset: 0x1a0 : 00000000 00000000 21802000 00000064

offset: 0x1b0 : 00000000 00000000 21802000 00000068

offset: 0x1c0 : 00000000 00000000 21802000 0000006c