xdma 驱动编译(给arm用)

# 驱动

修改 dma_ip_drivers-master/XDMA/linux-kernel/xdma/Makefile

# ifneq ($(KERNELRELEASE),)
# 	$(TARGET_MODULE)-objs := libxdma.o xdma_cdev.o cdev_ctrl.o cdev_events.o cdev_sgdma.o cdev_xvc.o cdev_bypass.o xdma_mod.o xdma_thread.o
# 	obj-m := $(TARGET_MODULE).o
# else
# 	BUILDSYSTEM_DIR:=/lib/modules/$(shell uname -r)/build
# 	PWD:=$(shell pwd)

找到上面的并注释掉(最后一行还有一个 endif 也注释掉),紧挨着就添加下面的:

$(TARGET_MODULE)-objs := libxdma.o xdma_cdev.o cdev_ctrl.o cdev_events.o cdev_sgdma.o cdev_xvc.o cdev_bypass.o xdma_mod.o xdma_thread.o
obj-m := $(TARGET_MODULE).o
BUILDSYSTEM_DIR:=/home/debian/Desktop/xiaguangbo/project/rk3588/project/kernel # linux 源码目录
PWD:=$(shell pwd)

编译

export ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
make

# 工具

修改 dma_ip_drivers-master/XDMA/linux-kernel/tools/Makefile

# CC ?= gcc
CC = aarch64-linux-gnu-gcc

编译

make

编译之后用file xxx查看文件是否是属于aarch64架构的,如果不是查看Makefile对不对

将得到的 xdma.ko 放到 rootfs 里的 /lib/modules/xxx (linux内核版本号,uname -r 可得到)里就可以开机自动加载

一般制作的 rootfs 没有此目录,需要先运行一次depmod,会提示找不到/lib/modules/xxx,然后mkdir -p /lib/modules/xxx,再执行一次depmod,会生成一些.alies、.dep文件,然后将 xdma.ko 复制到该目录下,执行一遍 depmod 然后重启。如果不行就使用 insmod ./xxx/xdma.ko 来手动挂载一次,然后再重启,并使用 dmesg | grep xdma 来看驱动日志,或者 dmesg | grep pci 看 pci 的日志

fpga 工程与 rk3588 测试:<xdma axi-stream 回环测试_xdma stream read-CSDN博客>

  • 8
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 38
    评论
xilliix pcie dma 驱动 (基于 xilnx xdma ip核 4.0 的WDF驱动) --- # XDMA Windows Driver This project is Xilinx's sample Windows driver for 'DMA/Bridge Subsystem for PCI Express v4.0' (XDMA) IP. *Please note that this driver and associated software are supplied to give a basic generic reference implementation only. Customers may have specific use-cases and/or requirements for which this driver is not suitable.* ### Dependencies * Target machine running Windows 7 or Windows 10 * Development machine running Windows 7 (or later) * Visual Studio 2015 (or later) installed on development machine * Windows Driver Kit (WDK) version 1703 (or later) installed on development machine ## Directory Structure ``` / |__ build/ - Generated directory containing build output binaries. |__ exe/ - Contains sample client application source code. | |__ simple_dma/ - Sample code for AXI-MM configured XDMA IP. | |__ streaming_dma/ - Sample code for AXI-ST configured XDMA IP. | |__ user_events/ - Sample code for access to user event interrupts. | |__ xdma_info/ - Utility application which prints out the XDMA core ip | | configuration. | |__ xdma_rw/ - Utility for reading/writing to/from xdma device nodes such | | as control, user, bypass, h2c_0, c2h_0 etc. | |__ xdma_test/ - Basic test application which performs H2C/C2H transfers on | all present channels. |__ inc/ - Contains public API header file for XDMA driver. |__ libxdma/ - Static kernel library for XDMA IP. |__ sys/ - Reference driver source code which uses libxdma |__ README.md - This file. |__ XDMA.sln - Visual Studio Solution. ```
评论 38
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值