Xilinx xdma axi pcie host linux驱动

版权声明:转载请关注我的公众号-青儿创客基地 https://blog.csdn.net/Zhu_Zhu_2009/article/details/81572078

由于项目调试需要,需要移植新版本的驱动到旧版内核。

移植20180806到20171213

移植linux-xlnx-20180806内核pci文件夹、linux/include/pci.h到linux-xlnx-20171213内核,编译错误,

net/core/rtnetlink.c:842:17: error: implicit declaration of functiondev_num_vf’ [-Werror=implicit-function-declaration]
   int num_vfs = dev_num_vf(dev->dev.parent);
drivers/nvme/host/pci.c:2124:2: error: unknown field ‘reset_notify’ specified in initializer
  .reset_notify = nvme_reset_notify,

在pci-20180806.h文件line934添加#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)),然后注释line2124,再次编译出现错误,

drivers/pci/access.c:4:32: fatal error: linux/sched/signal.h: No such file or directory
 #include <linux/sched/signal.h>

又产生新错误,放弃。。。
内核代码牵一发而动全身,花式作死

移植host驱动

换一种思路,只移植host的驱动,报错,

drivers/pci/host/pcie-xdma-pl.c:266:11: error: ‘pci_irqd_intx_xlate’ undeclared here (not in a function)
  .xlate = pci_irqd_intx_xlate,
           ^~~~~~~~~~~~~~~~~~~
drivers/pci/host/pcie-xdma-pl.c: In function ‘xilinx_pcie_probe’:
drivers/pci/host/pcie-xdma-pl.c:738:11: error: implicit declaration of function ‘devm_pci_alloc_host_bridge’ [-Werror=implicit-function-declaration]
  bridge = devm_pci_alloc_host_bridge(dev, sizeof(*port));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/pci/host/pcie-xdma-pl.c:738:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  bridge = devm_pci_alloc_host_bridge(dev, sizeof(*port));
         ^
drivers/pci/host/pcie-xdma-pl.c:742:9: error: implicit declaration of function ‘pci_host_bridge_priv’ [-Werror=implicit-function-declaration]
  port = pci_host_bridge_priv(bridge);
         ^~~~~~~~~~~~~~~~~~~~
drivers/pci/host/pcie-xdma-pl.c:742:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  port = pci_host_bridge_priv(bridge);
       ^
drivers/pci/host/pcie-xdma-pl.c:773:8: error: ‘struct pci_host_bridge’ has no member named ‘sysdata’
  bridge->sysdata = port;
        ^~
drivers/pci/host/pcie-xdma-pl.c:774:8: error: ‘struct pci_host_bridge’ has no member named ‘busnr’; did you mean ‘bus’?
  bridge->busnr = port->root_busno;
        ^~
drivers/pci/host/pcie-xdma-pl.c:775:8: error: ‘struct pci_host_bridge’ has no member named ‘ops’
  bridge->ops = &xilinx_pcie_ops;
        ^~
drivers/pci/host/pcie-xdma-pl.c:776:8: error: ‘struct pci_host_bridge’ has no member named ‘map_irq’
  bridge->map_irq = of_irq_parse_and_map_pci;
        ^~
drivers/pci/host/pcie-xdma-pl.c:777:8: error: ‘struct pci_host_bridge’ has no member named ‘swizzle_irq’
  bridge->swizzle_irq = pci_common_swizzle;
        ^~
drivers/pci/host/pcie-xdma-pl.c:779:8: error: implicit declaration of function ‘pci_scan_root_bus_bridge’ [-Werror=implicit-function-declaration]
  err = pci_scan_root_bus_bridge(bridge);
        ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

line266复制20180806的pci_irqd_intx_xlate函数进来,
移植devm_pci_alloc_host_bridge函数时发现,pci host bridge的结构体变化太大,移植成功的概率太小,感觉不可行了。

IP

新版ip大变化,切换过去,
这里写图片描述

猜你喜欢

转载自blog.csdn.net/Zhu_Zhu_2009/article/details/81572078