cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
stevedkc
Observer
Observer
1,119 Views
Registered: ‎12-07-2019

Petalinux XDMA PL PCIe Compilation error

 
I have Petalinux running, DMA installed and the two apps working in the referenced XDMA notes.
 
When enabling XDMA PL PCIe I get the following error. Is there a fix? It compiles in 2019.2, but our tool set has not moved up yet.
===========================================================================================================================================
|   CC      drivers/pci/controller/pcie-xdma-pl.o
| /home/kevinm/Desktop/PetaLinux/ZC108_DMA/build/tmp/work-shared/plnx-zynqmp/kernel-source/drivers/pci/controller/pcie-xdma-pl.c: In function 'xilinx_pcie_probe':
| /home/kevinm/Desktop/PetaLinux/ZC108_DMA/build/tmp/work-shared/plnx-zynqmp/kernel-source/drivers/pci/controller/pcie-xdma-pl.c:760:8: error: implicit declaration of function 'of_pci_get_host_bridge_resources'; did you mean 'pci_get_host_bridge_device'? [-Werror=implicit-function-declaration]
|   err = of_pci_get_host_bridge_resources(dev->of_node, 0, 0xff, &res,
|         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|         pci_get_host_bridge_device
===========================================================================================================================================
 
I tried changing it to devm_of_pci_get_host_bridge_resources as it is in 2019.2, no luck.
 
Found devm_of_pcd_get_bridge_resources defined in 2019.2 in components/plnx_workspace/sources/linux-xlnx/drivers/pci/pci.h
Couldn't find it in 2019.1
 
Any help would be appreciated.
 
Steve
0 Kudos
3 Replies
stevedkc
Observer
Observer
1,069 Views
Registered: ‎12-07-2019

it appears you also need to add a #include "../pci.h" trying that now.

0 Kudos
stevedkc
Observer
Observer
1,062 Views
Registered: ‎12-07-2019

Changes to source solved the compile problem, now it won't boot unless I remove the pcie-xdma-pl.c module from the build, then it boots fine. Bad Boot anyone know why?

[ 4.378911] io scheduler kyber registered
[ 25.390959] rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
[ 25.391235] rcu: 2-...0: (1 GPs behind) idle=a1a/1/0x4000000000000000 softirq=378/379 fqs=2610
[ 25.399966] rcu: (detected by 3, t=5254 jiffies, g=-551, q=43)
[ 25.405849] Task dump for CPU 2:
[ 25.409049] swapper/0 R running task 0 1 0 0x0000000a
[ 25.416056] Call trace:
[ 25.418485] __switch_to+0x94/0xe8
[ 25.421855] __devm_ioremap+0xa0/0x160

0 Kudos
KanoaG
Visitor
Visitor
457 Views
Registered: ‎09-23-2020

I ran into the same issue and I made two changes and it was able to build

1. Add #include "../pci.h"

2. Replace the 

err = of_pci_get_host_bridge_resources(dev->of_node, 0, 0xff, &res,&iobase);

with

err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res,&iobase);

It looks like you were close but maybe didn't remove the ->of_node after dev.  I found the pcie-xdma-pl.c file on Xilinx's github that has these changes.  Here is the link linux-xlnx/pcie-xdma-pl.c at master · Xilinx/linux-xlnx · GitHub.

0 Kudos