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.

Linux/TMS320C6678: PC(ARM architecture)didn't access C6678 by PCIE successfully

Part Number: TMS320C6678

Tool/software: Linux

In our application ,we connect PC to C6678 by PCIE. The PC we use is Jeston TX2 developed by NVIDIA(ARM + GPU), which run the Ubuntu 16.04.

We try to access the memory on DSP from PC. We have made PC detect the C6678 successfully after power on. We make sure it by input the cmd “lspci -vvv”,like this:

But when we use function “pci_resource_start”to read the bar information, we didn’t get the right value. It’s like this:

The code :

static int hello_probe(struct pci_dev *pdev, const struct pci_device_id *id)

{

for(i=0;i<5;i++)

    {

        barStart [i] = pci_resource_start (pdev, i);

        barLen   [i] = pci_resource_len   (pdev, i);

        barFlags [i] = pci_resource_flags (pdev, i);

 

        printk("barStart [%d]: 0x%x; barLen [%d]: 0x%x; barFlags [%d]: 0x%x\n",i,barStart [i],i,barLen[i],i,barFlags[i]);

    }

     ……

}

The result:

Then we check the struct point “pdev” ,and find the value of its member seems like to be in the wrone position,like this:


We guess that when linux scan the pci bus to create the pci device information, it didn’t put the value in the right place. But why? Since we can’t trace the operation during pci scan, so I have to ask for help.Thank you very much.

 

  • More Info:

              The linux kernel is 4.4.38; It is downloaded from NVIDIA official website.

              

  • Hello!

    I could offer just considerations rather than direct solution.

    If suspect is right data landed wrong location, I would traverse through source code of functions doing that data population to see when doe this happen. For instance, there is a function static void quirk_cypress(struct pci_dev *dev) used to fix Cypress chip misbehaviour. TI's config space differs from other devices in MSI capabilities, but not in very basic registers like VID/PID, BARs. So in your position I would first see, how that 'dev' structure with its resources properties gets populated.

  • Hi ,thank you for replying. The problem is that the operaton that setting the struct pci_dev is be done during the pci bus scan after the power on. So it can't be traced. Beyond that, I didn't find the code doing this in the kernel code. Could you tell me? Thank you.

  • Hello!

    I am out of help here. The only thing I could suggest is to use debug probe to look over C6678 PCIe registers and make sure they contain right values. Then you will know that's an issue with your linux code and you probably get closer to linux people rather than DSP.