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.