This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PCIE inbound memory access

Other Parts Discussed in Thread: TMS320C6678

Hi,

I am working on simple application, where industry standard PC talks to TMS320C6678 (actually TMDSEVM6678 with AMC) via PCIE. I wrote simple host PC driver which configures Keystone PCIE inbound translations (IB_* registers within BAR0 and IB_XLT_EN) and tests fragment of DSP memory (through BAR1). It works well with embedded PCIE bootloader. However when I tried to use demo application (MCSDK/PDK PCIe example), access to BAR0 works well, but any access to memory causes PCI bus error reported on PC machine. Could you please tell me if there are additional entities within C6678 which should be prepared / initialised to enable PCIe access to memories?

Paul

  • Paul,

    Please refer to working example code and document here:

    C:\ti\MCSDK_02_01_02_06\mcsdk_2_01_02_06\tools\boot_loader\examples\pcie

    C:\ti\MCSDK_02_01_02_06\mcsdk_2_01_02_06\tools\boot_loader\examples\pcie\docs\README.pdf

    regards,

    David

  • David,

    The examples you are referring to, shows how to use PCIe. However, it is assumed that PCIE is initialized already. And it is, when we are using PCIe boot scenario. In my case the application wil be stored in NOR flash and EMI boot procedurę will be there. That's why I have to set up PCIe from the scratch on my own. I know it looks weird, as thanks to PCIe boot I don't need parallel FLASH memory. So let me explain - that's for security reasons. DSP code must NOT be accessible from host machine. Only shared memory window will be visible to both parties. To do this, MPU will be used.

    Going back to the topic. I found promising initialization procedurę in PDK example - c:\ti\pdk_c6678_1_1_2_6\packages\ti\drv\pcie\example. Why promising? From the beginning it seems to be OK, as the board gets enumerated within PC and operating system properly reports PCI BARs exposed. However, upstairs begins when I am going to touch DSP memory from PC - problem described in my first post occurs.

    Paul

    UPDATE: I found another initialization example in C:\ti\mcsdk_2_01_02_06\tools\boot_loader\ibl\src\device\c66x\c66xinit.c. Will check if this one works better...

  • Paul,

    Basically the PCIe PDK/LLD example should be fine for the PCIe initialization. If you could get link up between Host PC and C6678 PCIe, the correct IB/BAR setup should allow Host to access DSP memory via PCIe link.

    Are you able to dump the PCIe configuration registers (from 0x21800000) in both cases (PCIe bootloader vs PCIe PDK/LLD example) please?

    We could take a look at the differences after your host PC driver configures the C6678 PCIe in both cases.

  • Hi,

    After more tests and experiments I found that complete TI examples and my code works well when launched just after POR. But after host machine (PC computer containing TMDSEVM320C6678 module) reboot, PCIe goes into weird state. It seems that PCIe recognises host reset properly (handler for LINK_RST_REQ is called), but further access to memory BARs (1..5) doesn't work. Could you please tell me if any special action except link training is required after LINK_RST_REQ takes place?

    Paul

  • UPDATE: I made simple workaround which seems to be working - after link reset is received, software shuts down PCIe power and turns back on a while later, before link training. However there is a garbage inside PCIe registers instead of default values, so I have to fill them manually.

  • One more UPDATE:

    The garbage mentioned concerns VID / PID values. According to errata document (usage note "PCIe Device ID Field Reset Value"), this is expected behavior.

  • Paul,

    I think your workaround is expected that after the reset request from host, the link training/link up needs to be re-established. So C66x PCIe module could be powered down and power up by programming the PLL. And "LTSSM_EN" needs to be set again to initiate the link training on C66x PCIe side.

    Most of the PCIe registers should be reset to default values after this soft reset, but the sticky bits will remain the values until cold/hard reset (as mentioned in the device data manual). So basically you can re-initialize the PCIe module again after the host reset.