Hi,
I'm tested the PCIe sample code provided by TI with two keystone C66 devices and it works perfectly.
But i found in the code, exactly in configuration part, that every time memset is used with the value 0 whitch overwrites the old value in the registers.
For example :
/* Configure the size of the translation regions */
memset (&setRegs, 0, sizeof(setRegs));
memset (&getRegs, 0, sizeof(getRegs));
obSize.size = pcie_OB_SIZE_8MB;
setRegs.obSize = &obSize;
if ((retVal = Pcie_writeRegs (handle, pcie_LOCATION_LOCAL, &setRegs)) != pcie_RET_OK)
{
System_printf ("SET OB_SIZE register failed!\n");
return retVal;
}
/* Setting PL_GEN2 */
memset (&setRegs, 0, sizeof(setRegs));
gen2.numFts = 0xF;
gen2.dirSpd = 0x0;
gen2.lnEn = 1;
setRegs.gen2 = &gen2;
if ((retVal = Pcie_writeRegs (handle, pcie_LOCATION_LOCAL, &setRegs)) != pcie_RET_OK)
{
System_printf ("SET GEN2 register failed!\n");
return retVal;
}
So in this case the value in OB_SIZE register will not be overwrited.
Sincerly
Youssef