Other Parts Discussed in Thread: TMDXEVMPCI
Hello,
We are using the EVMC6657L and TMDXEVMPCI adaptor on a linux PC. But the PC does not recognize the EVM card very well and the inbound ATU is not working.
I heard that the combination of EVM+TMDXEVMPCI can not be enumerated on every PC, especially thoes with SSC enabled in BIOS, so I hunted a Gigabyte GA-G41MT motherboard with is declared to be OK to work with the 'delicate' EVM+TMDXEVMPCI, and simply turn the SSC functionality off. However, it is not satisfying enough either:
(1) With EVM powered up firstly, when PC is powered on , the LTSSM_STATE turns to 0x11 quickly, which seems to be right, but the PC would not recognize the board ('lspci' is used here) except that I keep retrying link-training after link up for several times. Emphasize that I'm retrying after a sucessful link-up.
(2) With PC started up firstly (The evm loads slowly on SPI boot), the EVM never get linked up until I restart the PC with the RESET button on PC. And more unfortunately, C6657 on the EVM will hang after several link-training retrys (see(1)), even an on-board emulator would not help now.
So the question is why do I have to retry link-training after a sucessful link-up ? And if I have to do this to make the PC recognize the EVM correctly, how many times should I retry? Note that I'm using the PCIe LLD example provided with mcsdk (2.1.2.6) and the PC has ubuntu 12.04 installed.
And the problems did not end up here. After the linux PC recognizes the EVM successfully, I get this message with a 'lspci -vv' command:
01:00.0 Non-VGA unclassified device: Texas Instruments Device 8888 (rev 01)
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Step ping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR+ <PERR- INTx-
Latency: 0, Cache Line Size: 4 bytes
Interrupt: pin A routed to IRQ 12
Region 0: Memory at fddf8000 (32-bit, non-prefetchable) [size=16K]
Region 1: Memory at fddff000 (32-bit, non-prefetchable) [size=4K]
Region 2: Memory at fc000000 (32-bit, prefetchable) [size=16M]
Region 4: Memory at <unassigned> (32-bit, prefetchable)
Capabilities: <access denied>
Something is strange, I configured the BARs as follows:
{
#define PCIE_BAR0_MASK 0x00003FFF // 16KB
#define PCIE_BAR1_MASK 0x00000FFF // 4KB
#define PCIE_BAR2_MASK 0x00FFFFFF // 16MB
#define PCIE_BAR3_MASK 0x00000000 // DISABLE
#define PCIE_BAR4_MASK 0x00000000 // DISABLE
#define PCIE_BAR5_MASK 0x00000000 // DISABLE
static const uint32_t barMaskTab[6] =
{
PCIE_BAR0_MASK,
PCIE_BAR1_MASK,
PCIE_BAR2_MASK,
PCIE_BAR3_MASK,
PCIE_BAR4_MASK,
PCIE_BAR5_MASK,
};
uint32_t i = 0;
for (i = 0; i < sizeof(barMaskTab) / sizeof(barMaskTab[0]); i++)
{
type0Bar32bitIdx.reg.reg32 = barMaskTab[i];
type0Bar32bitIdx.idx = i;
memset (&setRegs, 0, sizeof(setRegs));
setRegs.type0Bar32bitIdx = &type0Bar32bitIdx;
if ((retVal = Pcie_writeRegs (handle, pcie_LOCATION_LOCAL, &setRegs)) != pcie_RET_OK)
{
DBG("SET BAR%d MASK register failed!\n", i);
return retVal;
}
}
}
As you can see, BAR4 is not behaving as I expected in the code. I'm ignoring this problem currently because it does not affect my work now. And I continued to configure the inbound ATU to redirect the 16kB BAR1 space to DDR with the following configuration:
CMD_STATUS = 0x0000000f
IB_BAR1 = 0x00000001
IB_START1_LO = 0xfddff000
IB_START1_HI = 0x00000000
IB_OFFSET1 = 0x80000000
CFG_STATUS_CMD = 0x40100146
DEBUG0 = 0x00008d11
SERDES_PLL_LOCK = 0x00000001
I am quite sure the above is configured successfully because I just copied the text from a COM-debug-terminal connected to the EVM and it is printed by my program. In fact, IB_BAR1 is configured by the linux PC via BAR0, just like what the linux_boot_loader example does. However, the inbound ATU is not working as I expected either. I tried to read the memory out:
root@ubuntu:/home/dsp# ./lookat -l 4 0xfddff000
ADDRESS | VALUE
-----------+-----------
0xfddff000 | 0xffffffff
0xfddff004 | 0xffffffff
0xfddff008 | 0xffffffff
0xfddff00c | 0xffffffff
Note that 'lookat' is a small util to read/write physical memory via shared memory in linux. I tried to write the BAR1 and read the data back but failed. To verify 'lookat' is working correctly, I 'looked at ' the BAR0 memory space:
root@ubuntu:/home/dsp# ./lookat -l 4 0xfddf8000
ADDRESS | VALUE
-----------+-----------
0xfddf8000 | 0x4e301101
0xfddf8004 | 0x0000000f
0xfddf8008 | 0x00000000
0xfddf800c | 0x00000000
You can see that I read out the data in BAR0 successfully, and you can see that I enabled the IB_XLT_EN bit in CMD_STATUS register(0xfddf8004 | 0x0000000f).
So the question is that, what else do I need to do to get the inbound ATU to work?
Any guidance, advices or even hints would be of great help to me. Thanks!
Best regards.