Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant find driver at /dev/axidma after insmod #19

Closed
xuchendev opened this issue Apr 5, 2017 · 35 comments
Closed

cant find driver at /dev/axidma after insmod #19

xuchendev opened this issue Apr 5, 2017 · 35 comments
Labels

Comments

@xuchendev
Copy link

xuchendev commented Apr 5, 2017

hey brandon, i didnt add your cma args into my bootargs, then i run the insmod and look up the dmesg, it shows that
[ 113.487763] random: nonblocking pool is initialized, i think if it was the bootargs problem ?

this is my boot args
console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=0

@bperez77
Copy link
Owner

bperez77 commented Apr 5, 2017

That message about the nonblocking pool is a standard boot message; that just deals with the pool used to generate pseudorandom numbers. If you don't specify cma=<size> on the command line, it will default to some size, I think it typically is around 10 MB, so that shouldn't be the issue either.

If you're looking for warnings/errors related to the driver, you should look for messages with "axidma" in them. I'm going to need more information to address this issue. Can you attach the full output from the dmesg command, the kernel log buffer?

@xuchendev
Copy link
Author

sure, this is my dmesg log

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.6.0-xilinx (xuchen@xuchen-dev) (gcc version 4.9.2 (Sourcery CodeBench Lite 2015.05-17) ) #1 SMP PREEMPT Wed Mar 29 11:05:39 CST 2017
[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: xlnx,zynq-7000
[ 0.000000] cma: Reserved 16 MiB at 0x0f000000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 65536
[ 0.000000] free_area_init_node: node 0, pgdat c0938dc0, node_mem_map cedf0000
[ 0.000000] Normal zone: 512 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 65536 pages, LIFO batch:15
[ 0.000000] percpu: Embedded 12 pages/cpu @cedcf000 s19776 r8192 d21184 u49152
[ 0.000000] pcpu-alloc: s19776 r8192 d21184 u49152 alloc=12*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
[ 0.000000] Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=0
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Memory: 234632K/262144K available (5303K kernel code, 230K rwdata, 1844K rodata, 1024K init, 222K bss, 11128K reserved, 16384K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xd0800000 - 0xff800000 ( 752 MB)
lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc07fafe4 (8140 kB)
.init : 0xc0800000 - 0xc0900000 (1024 kB)
.data : 0xc0900000 - 0xc0939b20 ( 231 kB)
.bss : 0xc0939b20 - 0xc09714a8 ( 223 kB)
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] efuse mapped to d0800000
[ 0.000000] slcr mapped to d0802000
[ 0.000000] L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
[ 0.000000] L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
[ 0.000000] L2C-310 erratum 769419 enabled
[ 0.000000] L2C-310 enabling early BRESP for Cortex-A9
[ 0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[ 0.000000] L2C-310 ID prefetch enabled, offset 1 lines
[ 0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[ 0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[ 0.000000] L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
[ 0.000000] zynq_clock_init: clkc starts at d0802100
[ 0.000000] Zynq clock init
[ 0.000010] sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
[ 0.000029] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns
[ 0.000052] Switching to timer-based delay loop, resolution 3ns
[ 0.000134] clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
[ 0.000160] timer #0 at d080a000, irq=17
[ 0.000482] Console: colour dummy device 80x30
[ 0.000497] Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)
[ 0.000511] pid_max: default: 32768 minimum: 301
[ 0.000644] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000653] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.001250] CPU: Testing write buffer coherency: ok
[ 0.001445] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.001502] Setting up static identity map for 0x100000 - 0x100058
[ 0.100640] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.100739] Brought up 2 CPUs
[ 0.100752] SMP: Total of 2 processors activated (1333.33 BogoMIPS).
[ 0.100758] CPU: All CPU(s) started in SVC mode.
[ 0.101579] devtmpfs: initialized
[ 0.104144] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[ 0.104550] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.105558] pinctrl core: initialized pinctrl subsystem
[ 0.106691] NET: Registered protocol family 16
[ 0.108649] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.140674] cpuidle: using governor menu
[ 0.147999] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[ 0.148010] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.148147] zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xd0880000
[ 0.148451] zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
[ 0.171704] vgaarb: loaded
[ 0.172117] SCSI subsystem initialized
[ 0.172707] usbcore: registered new interface driver usbfs
[ 0.172835] usbcore: registered new interface driver hub
[ 0.172931] usbcore: registered new device driver usb
[ 0.173350] media: Linux media interface: v0.10
[ 0.173433] Linux video capture interface: v2.00
[ 0.173513] pps_core: LinuxPPS API ver. 1 registered
[ 0.173521] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti [email protected]
[ 0.173563] PTP clock support registered
[ 0.173742] EDAC MC: Ver: 3.0.0
[ 0.174471] Advanced Linux Sound Architecture Driver Initialized.
[ 0.180602] clocksource: Switched to clocksource arm_global_timer
[ 0.192737] NET: Registered protocol family 2
[ 0.193449] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.193485] TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.193529] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.193577] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.193605] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.193804] NET: Registered protocol family 1
[ 0.194123] RPC: Registered named UNIX socket transport module.
[ 0.194130] RPC: Registered udp transport module.
[ 0.194135] RPC: Registered tcp transport module.
[ 0.194140] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.194164] PCI: CLS 0 bytes, default 64
[ 0.194692] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[ 0.195956] futex hash table entries: 512 (order: 3, 32768 bytes)
[ 0.196840] workingset: timestamp_bits=28 max_order=16 bucket_order=0
[ 0.197729] jffs2: version 2.2. (NAND) (SUMMARY) \xffffffc2\xffffffa9 2001-2006 Red Hat, Inc.
[ 0.198507] io scheduler noop registered
[ 0.198520] io scheduler deadline registered
[ 0.198546] io scheduler cfq registered (default)
[ 0.200162] dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
[ 0.200177] dma-pl330 f8003000.dmac: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
[ 0.201237] xilinx-vdma 43000000.dma: Xilinx AXI VDMA Engine Driver Probed!!
[ 0.201866] e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 143, base_baud = 6249999) is a xuartps
[ 0.700623] console [ttyPS0] enabled
[ 0.703452] xdevcfg f8007000.devcfg: ioremap 0xf8007000 to d086e000
[ 0.708783] [drm] Initialized drm 1.1.0 20060810
[ 0.722888] brd: module loaded
[ 0.730833] loop: module loaded
[ 0.735881] CAN device driver interface
[ 0.738786] gpiod_set_value: invalid GPIO
[ 0.742444] libphy: MACB_mii_bus: probed
[ 0.820699] macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 145 (00:0a:35:00:01:22)
[ 0.829229] Marvell 88E1510 e000b000.etherne:00: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
[ 0.840162] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[ 0.844625] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 0.850177] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.855358] ehci-pci: EHCI PCI platform driver
[ 0.858612] usbcore: registered new interface driver usb-storage
[ 0.864720] mousedev: PS/2 mouse device common for all mice
[ 0.869525] i2c /dev entries driver
[ 0.874232] EDAC MC: ECC not enabled
[ 0.876612] Xilinx Zynq CpuIdle Driver started
[ 0.880005] sdhci: Secure Digital Host Controller Interface driver
[ 0.884815] sdhci: Copyright(c) Pierre Ossman
[ 0.887836] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.930694] mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using DMA
[ 0.970657] mmc1: SDHCI controller on e0101000.sdhci [e0101000.sdhci] using DMA
[ 0.976904] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.983964] usbcore: registered new interface driver usbhid
[ 0.991200] usbhid: USB HID core driver
[ 0.995872] mmc0: new SDHC card at address 0001
[ 1.009827] mmcblk0: mmc0:0001 0000 7.44 GiB
[ 1.014649] NET: Registered protocol family 10
[ 1.017743] mmcblk0: p1 p2
[ 1.031682] sit: IPv6 over IPv4 tunneling driver
[ 1.035773] NET: Registered protocol family 17
[ 1.038844] can: controller area network core (rev 20120528 abi 9)
[ 1.043826] NET: Registered protocol family 29
[ 1.046893] can: raw protocol (rev 20120528)
[ 1.049838] can: broadcast manager protocol (rev 20120528 t)
[ 1.054213] can: netlink gateway (rev 20130117) max_hops=1
[ 1.058663] Registering SWP/SWPB emulation handler
[ 1.063174] hctosys: unable to open rtc device (rtc0)
[ 1.067151] ALSA device list:
[ 1.068727] No soundcards found.
[ 1.081541] mmc1: new high speed MMC card at address 0001
[ 1.096242] mmcblk1: mmc1:0001 P1XXXX 7.20 GiB
[ 1.109661] mmcblk1boot0: mmc1:0001 P1XXXX partition 1 2.00 MiB
[ 1.124608] mmcblk1boot1: mmc1:0001 P1XXXX partition 2 2.00 MiB
[ 1.139588] mmcblk1rpmb: mmc1:0001 P1XXXX partition 3 128 KiB
[ 1.236593] EXT4-fs (mmcblk0p2): recovery complete
[ 1.241897] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.248631] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.254707] Freeing unused kernel memory: 1024K (c0800000 - c0900000)
[ 1.661876] systemd[1]: System time before build time, advancing clock.
[ 1.697692] systemd[1]: Failed to insert module 'autofs4': No such file or directory
[ 1.766686] random: systemd urandom read with 11 bits of entropy available
[ 1.775127] systemd[1]: systemd 229 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN)
[ 1.792234] systemd[1]: Detected architecture arm.
[ 1.798276] systemd[1]: Set hostname to .
[ 2.267237] systemd[1]: Listening on Journal Socket.
[ 2.271471] systemd[1]: Listening on Journal Socket (/dev/log).
[ 2.280390] systemd[1]: Listening on udev Control Socket.
[ 2.289651] systemd[1]: Reached target Encrypted Volumes.
[ 2.298667] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[ 2.309173] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ 2.320887] systemd[1]: Reached target Remote File Systems (Pre).
[ 2.331275] systemd[1]: Reached target Remote File Systems.
[ 2.341255] systemd[1]: Reached target Swap.
[ 2.349816] systemd[1]: Listening on udev Kernel Socket.
[ 2.375831] systemd[1]: Created slice User and Session Slice.
[ 2.380584] systemd[1]: Created slice System Slice.
[ 2.421217] systemd[1]: Starting Remount Root and Kernel File Systems...
[ 2.430449] systemd[1]: Created slice system-serial\x2dgetty.slice.
[ 2.439032] systemd[1]: Starting Journal Service...
[ 2.470211] systemd[1]: Starting Load Kernel Modules...
[ 2.475444] systemd[1]: Reached target Slices.
[ 2.483536] systemd[1]: Starting Create Static Device Nodes in /dev...
[ 2.490852] systemd[1]: Created slice system-getty.slice.
[ 2.500757] systemd[1]: Started Remount Root and Kernel File Systems.
[ 2.514838] systemd[1]: Started Load Kernel Modules.
[ 2.591659] systemd[1]: Starting Apply Kernel Variables...
[ 2.611227] systemd[1]: Starting udev Coldplug all Devices...
[ 2.618894] systemd[1]: Starting Load/Save Random Seed...
[ 2.653703] systemd[1]: Started Journal Service.
[ 2.901228] systemd-journald[686]: Received request to flush runtime journal from PID 1
[ 4.299087] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 7.820897] macb e000b000.ethernet eth0: link up (1000/Full)
[ 7.820925] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

@xuchendev
Copy link
Author

this is my memory distribution

memory{
device_type = "memory"
reg = <0x0 0x10000000>
}

i distribute 256MB memory to PS, 256 MB memory to PL

@bperez77
Copy link
Owner

bperez77 commented Apr 5, 2017

Can you show the dmesg output after you run insmod? The driver should produce some error messages. Also, can you show the output from when you run the program (I assume it's axidma_benchmark)?

@xuchendev
Copy link
Author

i got nothing changed in dmesg command after i run the insmod axidma.ko = = ,
run axidma_benchmark
-bash: ./axidma_benchmark: No such file or directory

lsmod got the following output
Module Size Used by
axidma 19157 0

but i cat the /dev/devices not found the axidma device

@bperez77
Copy link
Owner

bperez77 commented Apr 5, 2017

Can you show me your device tree? I suspect that you're missing the device tree node for the driver.

@xuchendev
Copy link
Author

sorry to reply u late, i find some problems in my project and fixing it ,

this is my pl devicetree

/ {
amba_pl: amba_pl {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
ranges ;
FullConvNetTop_0: FullConvNetTop@43c00000 {
compatible = "xlnx,FullConvNetTop-1.0";
interrupt-parent = <&intc>;
interrupts = <0 30 4>;
reg = <0x43c00000 0x10000>;
xlnx,s-axi-axilites-addr-width = <0x6>;
xlnx,s-axi-axilites-data-width = <0x20>;
};
axi_vdma_0: dma@43000000 {
#dma-cells = <1>;
clock-names = "s_axi_lite_aclk", "m_axi_mm2s_aclk", "m_axi_mm2s_aclk";
clocks = <&clkc 15>, <&clkc 15>, <&clkc 15>;
compatible = "xlnx,axi-vdma-1.00.a";
interrupt-parent = <&intc>;
interrupts = <0 29 4>;
reg = <0x43000000 0x10000>;
xlnx,addrwidth = <0x20>;
xlnx,flush-fsync = <0x1>;
xlnx,num-fstores = <0x3>;
dma-channel@43000000 {
compatible = "xlnx,axi-vdma-mm2s-channel";
interrupts = <0 29 4>;
xlnx,datawidth = <0x20>;
xlnx,device-id = <0x0>;
};
};
};
};

@bperez77
Copy link
Owner

bperez77 commented Apr 5, 2017

Yep, that's the problem. So, you also need a device tree node for my driver that tells it which DMA channels it is allowed to use. See the README for the information on the format for that node.

@xuchendev
Copy link
Author

OK, thank u brandon , i'll look up the doc : ]

@bperez77 bperez77 closed this as completed Apr 5, 2017
@xuchendev
Copy link
Author

hey brandon , i add the axi_dma and char_device node to device tree, but unfortunately i cant start the kernel ....my linux version is 4.6.0-xilinx which is the xilinx-v2016.4 branch of linux-xilinx

@xuchendev
Copy link
Author

my question is , i didnt add DMA ip into my vivado project ,if i should add the device tree node which u described in the README.md ?

@bperez77
Copy link
Owner

bperez77 commented Apr 5, 2017

You shouldn't need to add the 'axi_dma' node, you already had that in the device tree before. You only needed to add the 'char_device' node.

You don't have the DMA in your Vivado project? As in there's no AXI DMA instantiated in your block design? If you don't have an AXI DMA IP in your design, then the driver is useless, because it will only interact with an AXI DMA IP that is on the PL fabric.

The kernel not starting usually means that you have the reg property incorrect. Make sure the address matches the one in the 'Address Editor' in your block design.

@xuchendev
Copy link
Author

yes , currently i only use the VDMA IP in my IP Desgin which address is 0x43000000, now i use the linux system call mmap to use the VDMA, how can i use your driver : ]

@bperez77
Copy link
Owner

bperez77 commented Apr 6, 2017

Yeah, so the driver supports VDMA as well. You just need to create a device tree node for the character device that is like the one in the README. In your case, it would look like:

axidma_chrdev: axidma_chrdev@0 {
    compatible = "xlnx,axidma-chrdev";
    dmas = <&axi_vdma_0 0 &axi_vdma_0 1>;
    dma-names = "tx_channel", "rx_channel";
};

Once you have that, you should be able to insert the module correctly. To use the driver, I would start with the axidma_benchmark application. Run that, and make sure it works. Then, you can use that as a template to write your own application that uses the driver.

@xuchendev
Copy link
Author

xuchendev commented Apr 7, 2017

i am not familiar with the device tree syntax , this is my system.dtsi file, is that ok?

/dts-v1/;
/include/ "zynq-7000.dtsi"
/include/ "pl.dtsi"
/ {
cpus {
cpu@0 {
operating-points = <666666 1000000 333333 1000000>;
};
};
chosen {
bootargs = "console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=0";
};
aliases {
ethernet0 = &gem0;
serial0 = &uart1;
spi0 = &qspi;
};
memory {
device_type = "memory";
reg = <0x0 0x10000000>;
};
};

&gem0 {
status = "okay";
phy-mode = "rgmii-id";
phy-handle = <&ethernet_phy>;
ethernet_phy: ethernet-phy@0{
reg = <0>;
};
};

&intc {
num_cpus = <2>;
num_interrupts = <96>;
};

&qspi {
is-dual = <0>;
num-cs = <1>;
status = "okay";
};

&sdhci0 {
status = "okay";
xlnx,has-cd = <0x1>;
xlnx,has-power = <0x0>;
xlnx,has-wp = <0x1>;
};

&sdhci1 {
status = "okay";
xlnx,has-cd = <0x1>;
xlnx,has-power = <0x0>;
xlnx,has-wp = <0x1>;
};

&uart1 {
device_type = "serial";
port-number = <0>;
status = "okay";
};

&usb0 {
dr_mode = "host";
phy_type = "ulpi";
status = "okay";
};

&clkc {
fclk-enable = <0x3>;
ps-clk-frequency = <33333333>;
};

axidma_chrdev: axidma_chrdev@0 {
compatible = "xlnx,axidma-chrdev";
dmas = <&axi_vdma_0 0 &axi_vdma_0 1>;
dma-names = "tx_channel", "rx_channel";
};

@bperez77
Copy link
Owner

bperez77 commented Apr 7, 2017

Yeah that looks fine, except I don't see your AXI VDMA device tree nodes anywhere. Are they in a zynq-zed.dts?

@xuchendev
Copy link
Author

i find it was incorrect when use dtc to compile it....

@xuchendev
Copy link
Author

xuchendev commented Apr 7, 2017

/*

  • CAUTION: This file is automatically generated by Xilinx.
  • Version:
  • Today is: Mon Mar 13 16:00:14 2017
    */

/
{
amba_pl: amba_pl {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
ranges ;
FullConvNetTop_0: FullConvNetTop@43c00000 {
compatible = "xlnx,FullConvNetTop-1.0";
interrupt-parent = <&intc>;
interrupts = <0 30 4>;
reg = <0x43c00000 0x10000>;
xlnx,s-axi-axilites-addr-width = <0x6>;
xlnx,s-axi-axilites-data-width = <0x20>;
};
axi_vdma_0: dma@43000000 {
#dma-cells = <1>;
clock-names = "s_axi_lite_aclk", "m_axi_mm2s_aclk", "m_axi_mm2s_aclk";
clocks = <&clkc 15>, <&clkc 15>, <&clkc 15>;
compatible = "xlnx,axi-vdma-1.00.a";
interrupt-parent = <&intc>;
interrupts = <0 29 4>;
reg = <0x43000000 0x10000>;
xlnx,addrwidth = <0x20>;
xlnx,flush-fsync = <0x1>;
xlnx,num-fstores = <0x3>;
dma-channel@43000000 {
compatible = "xlnx,axi-vdma-mm2s-channel";
interrupts = <0 29 4>;
xlnx,datawidth = <0x20>;
xlnx,device-id = <0x0>;
};
};
};
};

@xuchendev
Copy link
Author

/*

  • CAUTION: This file is automatically generated by Xilinx.
  • Version:
  • Today is: Mon Mar 13 16:00:14 2017
    */

/dts-v1/;
/include/ "zynq-7000.dtsi"
/include/ "pl.dtsi"
/ {
cpus {
cpu@0 {
operating-points = <666666 1000000 333333 1000000>;
};
};
chosen {
bootargs = "console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=0";
};
aliases {
ethernet0 = &gem0;
serial0 = &uart1;
spi0 = &qspi;
};
memory {
device_type = "memory";
reg = <0x0 0x10000000>;
};
};
&gem0 {
status = "okay";
phy-mode = "rgmii-id";
phy-handle = <&ethernet_phy>;
ethernet_phy: ethernet-phy@0{
reg = <0>;
};
};
&intc {
num_cpus = <2>;
num_interrupts = <96>;
};
&qspi {
is-dual = <0>;
num-cs = <1>;
status = "okay";
};
&sdhci0 {
status = "okay";
xlnx,has-cd = <0x1>;
xlnx,has-power = <0x0>;
xlnx,has-wp = <0x1>;
};
&sdhci1 {
status = "okay";
xlnx,has-cd = <0x1>;
xlnx,has-power = <0x0>;
xlnx,has-wp = <0x1>;
};
&uart1 {
device_type = "serial";
port-number = <0>;
status = "okay";
};
&usb0 {
dr_mode = "host";
phy_type = "ulpi";
status = "okay";
};
&clkc {
fclk-enable = <0x3>;
ps-clk-frequency = <33333333>;
};

@xuchendev
Copy link
Author

/*

  • Copyright (C) 2011 - 2014 Xilinx
  • This software is licensed under the terms of the GNU General Public
  • License version 2, as published by the Free Software Foundation, and
  • may be copied, distributed, and modified under those terms.
  • This program is distributed in the hope that it will be useful,
  • but WITHOUT ANY WARRANTY; without even the implied warranty of
  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  • GNU General Public License for more details.
    */
    /include/ "skeleton.dtsi"

/ {
compatible = "xlnx,zynq-7000";

cpus {
	#address-cells = <1>;
	#size-cells = <0>;

	cpu0: cpu@0 {
		compatible = "arm,cortex-a9";
		device_type = "cpu";
		reg = <0>;
		clocks = <&clkc 3>;
		clock-latency = <1000>;
		cpu0-supply = <&regulator_vccpint>;
		operating-points = <
			/* kHz    uV */
			666667  1000000
			333334  1000000
		>;
	};

	cpu1: cpu@1 {
		compatible = "arm,cortex-a9";
		device_type = "cpu";
		reg = <1>;
		clocks = <&clkc 3>;
	};
};

pmu {
	compatible = "arm,cortex-a9-pmu";
	interrupts = <0 5 4>, <0 6 4>;
	interrupt-parent = <&intc>;
	reg = < 0xf8891000 0x1000 0xf8893000 0x1000 >;
};

regulator_vccpint: fixedregulator@0 {
	compatible = "regulator-fixed";
	regulator-name = "VCCPINT";
	regulator-min-microvolt = <1000000>;
	regulator-max-microvolt = <1000000>;
	regulator-boot-on;
	regulator-always-on;
};

amba: amba {
	compatible = "simple-bus";
	#address-cells = <1>;
	#size-cells = <1>;
	interrupt-parent = <&intc>;
	ranges;

	adc: adc@f8007100 {
		compatible = "xlnx,zynq-xadc-1.00.a";
		reg = <0xf8007100 0x20>;
		interrupts = <0 7 4>;
		interrupt-parent = <&intc>;
		clocks = <&clkc 12>;
	};

	can0: can@e0008000 {
		compatible = "xlnx,zynq-can-1.0";
		status = "disabled";
		clocks = <&clkc 19>, <&clkc 36>;
		clock-names = "can_clk", "pclk";
		reg = <0xe0008000 0x1000>;
		interrupts = <0 28 4>;
		interrupt-parent = <&intc>;
		tx-fifo-depth = <0x40>;
		rx-fifo-depth = <0x40>;
	};

	can1: can@e0009000 {
		compatible = "xlnx,zynq-can-1.0";
		status = "disabled";
		clocks = <&clkc 20>, <&clkc 37>;
		clock-names = "can_clk", "pclk";
		reg = <0xe0009000 0x1000>;
		interrupts = <0 51 4>;
		interrupt-parent = <&intc>;
		tx-fifo-depth = <0x40>;
		rx-fifo-depth = <0x40>;
	};

	gpio0: gpio@e000a000 {
		compatible = "xlnx,zynq-gpio-1.0";
		#gpio-cells = <2>;
		clocks = <&clkc 42>;
		gpio-controller;
		interrupt-controller;
		#interrupt-cells = <2>;
		interrupt-parent = <&intc>;
		interrupts = <0 20 4>;
		reg = <0xe000a000 0x1000>;
	};

	i2c0: i2c@e0004000 {
		compatible = "cdns,i2c-r1p10";
		status = "disabled";
		clocks = <&clkc 38>;
		interrupt-parent = <&intc>;
		interrupts = <0 25 4>;
		reg = <0xe0004000 0x1000>;
		#address-cells = <1>;
		#size-cells = <0>;
	};

	i2c1: i2c@e0005000 {
		compatible = "cdns,i2c-r1p10";
		status = "disabled";
		clocks = <&clkc 39>;
		interrupt-parent = <&intc>;
		interrupts = <0 48 4>;
		reg = <0xe0005000 0x1000>;
		#address-cells = <1>;
		#size-cells = <0>;
	};

	intc: interrupt-controller@f8f01000 {
		compatible = "arm,cortex-a9-gic";
		#interrupt-cells = <3>;
		interrupt-controller;
		reg = <0xF8F01000 0x1000>,
		      <0xF8F00100 0x100>;
	};

	L2: cache-controller@f8f02000 {
		compatible = "arm,pl310-cache";
		reg = <0xF8F02000 0x1000>;
		interrupts = <0 2 4>;
		arm,data-latency = <3 2 2>;
		arm,tag-latency = <2 2 2>;
		cache-unified;
		cache-level = <2>;
	};

	mc: memory-controller@f8006000 {
		compatible = "xlnx,zynq-ddrc-a05";
		reg = <0xf8006000 0x1000>;
	};

	ocmc: ocmc@f800c000 {
		compatible = "xlnx,zynq-ocmc-1.0";
		interrupt-parent = <&intc>;
		interrupts = <0 3 4>;
		reg = <0xf800c000 0x1000>;
	};

	uart0: serial@e0000000 {
		compatible = "xlnx,xuartps", "cdns,uart-r1p8";
		status = "disabled";
		clocks = <&clkc 23>, <&clkc 40>;
		clock-names = "uart_clk", "pclk";
		reg = <0xE0000000 0x1000>;
		interrupts = <0 27 4>;
	};

	uart1: serial@e0001000 {
		compatible = "xlnx,xuartps", "cdns,uart-r1p8";
		status = "disabled";
		clocks = <&clkc 24>, <&clkc 41>;
		clock-names = "uart_clk", "pclk";
		reg = <0xE0001000 0x1000>;
		interrupts = <0 50 4>;
	};

	spi0: spi@e0006000 {
		compatible = "xlnx,zynq-spi-r1p6";
		reg = <0xe0006000 0x1000>;
		status = "disabled";
		interrupt-parent = <&intc>;
		interrupts = <0 26 4>;
		clocks = <&clkc 25>, <&clkc 34>;
		clock-names = "ref_clk", "pclk";
		#address-cells = <1>;
		#size-cells = <0>;
	};

	spi1: spi@e0007000 {
		compatible = "xlnx,zynq-spi-r1p6";
		reg = <0xe0007000 0x1000>;
		status = "disabled";
		interrupt-parent = <&intc>;
		interrupts = <0 49 4>;
		clocks = <&clkc 26>, <&clkc 35>;
		clock-names = "ref_clk", "pclk";
		#address-cells = <1>;
		#size-cells = <0>;
	};

	qspi: spi@e000d000 {
		clock-names = "ref_clk", "pclk";
		clocks = <&clkc 10>, <&clkc 43>;
		compatible = "xlnx,zynq-qspi-1.0";
		status = "disabled";
		interrupt-parent = <&intc>;
		interrupts = <0 19 4>;
		reg = <0xe000d000 0x1000>;
		#address-cells = <1>;
		#size-cells = <0>;
	};

	smcc: memory-controller@e000e000 {
		#address-cells = <1>;
		#size-cells = <1>;
		status = "disabled";
		clock-names = "memclk", "aclk";
		clocks = <&clkc 11>, <&clkc 44>;
		compatible = "arm,pl353-smc-r2p1";
		interrupt-parent = <&intc>;
		interrupts = <0 18 4>;
		ranges ;
		reg = <0xe000e000 0x1000>;
		nand0: flash@e1000000 {
			status = "disabled";
			compatible = "arm,pl353-nand-r2p1";
			reg = <0xe1000000 0x1000000>;
			#address-cells = <0x1>;
			#size-cells = <0x1>;
		};
		nor0: flash@e2000000 {
			status = "disabled";
			compatible = "cfi-flash";
			reg = <0xe2000000 0x2000000>;
			#address-cells = <1>;
			#size-cells = <1>;
		};
	};

	gem0: ethernet@e000b000 {
		compatible = "cdns,zynq-gem", "cdns,gem";
		reg = <0xe000b000 0x1000>;
		status = "disabled";
		interrupts = <0 22 4>;
		clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
		clock-names = "pclk", "hclk", "tx_clk";
		#address-cells = <1>;
		#size-cells = <0>;
	};

	gem1: ethernet@e000c000 {
		compatible = "cdns,zynq-gem", "cdns,gem";
		reg = <0xe000c000 0x1000>;
		status = "disabled";
		interrupts = <0 45 4>;
		clocks = <&clkc 31>, <&clkc 31>, <&clkc 14>;
		clock-names = "pclk", "hclk", "tx_clk";
		#address-cells = <1>;
		#size-cells = <0>;
	};

	sdhci0: sdhci@e0100000 {
		compatible = "arasan,sdhci-8.9a";
		status = "disabled";
		clock-names = "clk_xin", "clk_ahb";
		clocks = <&clkc 21>, <&clkc 32>;
		interrupt-parent = <&intc>;
		interrupts = <0 24 4>;
		reg = <0xe0100000 0x1000>;
		broken-adma2;
	};

	sdhci1: sdhci@e0101000 {
		compatible = "arasan,sdhci-8.9a";
		status = "disabled";
		clock-names = "clk_xin", "clk_ahb";
		clocks = <&clkc 22>, <&clkc 33>;
		interrupt-parent = <&intc>;
		interrupts = <0 47 4>;
		reg = <0xe0101000 0x1000>;
		broken-adma2;
	};

	slcr: slcr@f8000000 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "xlnx,zynq-slcr", "syscon", "simple-mfd";
		reg = <0xF8000000 0x1000>;
		ranges;
		clkc: clkc@100 {
			#clock-cells = <1>;
			compatible = "xlnx,ps7-clkc";
			fclk-enable = <0xf>;
			clock-output-names = "armpll", "ddrpll", "iopll", "cpu_6or4x",
					"cpu_3or2x", "cpu_2x", "cpu_1x", "ddr2x", "ddr3x",
					"dci", "lqspi", "smc", "pcap", "gem0", "gem1",
					"fclk0", "fclk1", "fclk2", "fclk3", "can0", "can1",
					"sdio0", "sdio1", "uart0", "uart1", "spi0", "spi1",
					"dma", "usb0_aper", "usb1_aper", "gem0_aper",
					"gem1_aper", "sdio0_aper", "sdio1_aper",
					"spi0_aper", "spi1_aper", "can0_aper", "can1_aper",
					"i2c0_aper", "i2c1_aper", "uart0_aper", "uart1_aper",
					"gpio_aper", "lqspi_aper", "smc_aper", "swdt",
					"dbg_trc", "dbg_apb";
			reg = <0x100 0x100>;
		};

		rstc: rstc@200 {
			compatible = "xlnx,zynq-reset";
			reg = <0x200 0x48>;
			#reset-cells = <1>;
			syscon = <&slcr>;
		};

		pinctrl0: pinctrl@700 {
			compatible = "xlnx,pinctrl-zynq";
			reg = <0x700 0x200>;
			syscon = <&slcr>;
		};
	};

	dmac_s: dmac@f8003000 {
		compatible = "arm,pl330", "arm,primecell";
		reg = <0xf8003000 0x1000>;
		interrupt-parent = <&intc>;
		interrupt-names = "abort", "dma0", "dma1", "dma2", "dma3",
			"dma4", "dma5", "dma6", "dma7";
		interrupts = <0 13 4>,
		             <0 14 4>, <0 15 4>,
		             <0 16 4>, <0 17 4>,
		             <0 40 4>, <0 41 4>,
		             <0 42 4>, <0 43 4>;
		#dma-cells = <1>;
		#dma-channels = <8>;
		#dma-requests = <4>;
		clocks = <&clkc 27>;
		clock-names = "apb_pclk";
	};

	devcfg: devcfg@f8007000 {
		compatible = "xlnx,zynq-devcfg-1.0";
		interrupt-parent = <&intc>;
		interrupts = <0 8 4>;
		reg = <0xf8007000 0x100>;
		clocks = <&clkc 12>, <&clkc 15>, <&clkc 16>, <&clkc 17>, <&clkc 18>;
		clock-names = "ref_clk", "fclk0", "fclk1", "fclk2", "fclk3";
		syscon = <&slcr>;
	};

	efuse: efuse@f800d000 {
		compatible = "xlnx,zynq-efuse";
		reg = <0xf800d000 0x20>;
	};

	global_timer: timer@f8f00200 {
		compatible = "arm,cortex-a9-global-timer";
		reg = <0xf8f00200 0x20>;
		interrupts = <1 11 0x301>;
		interrupt-parent = <&intc>;
		clocks = <&clkc 4>;
	};

	ttc0: timer@f8001000 {
		interrupt-parent = <&intc>;
		interrupts = <0 10 4>, <0 11 4>, <0 12 4>;
		compatible = "cdns,ttc";
		clocks = <&clkc 6>;
		reg = <0xF8001000 0x1000>;
	};

	ttc1: timer@f8002000 {
		interrupt-parent = <&intc>;
		interrupts = <0 37 4>, <0 38 4>, <0 39 4>;
		compatible = "cdns,ttc";
		clocks = <&clkc 6>;
		reg = <0xF8002000 0x1000>;
	};

	scutimer: timer@f8f00600 {
		interrupt-parent = <&intc>;
		interrupts = <1 13 0x301>;
		compatible = "arm,cortex-a9-twd-timer";
		reg = <0xf8f00600 0x20>;
		clocks = <&clkc 4>;
	};

	usb0: usb@e0002000 {
		compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
		status = "disabled";
		clocks = <&clkc 28>;
		interrupt-parent = <&intc>;
		interrupts = <0 21 4>;
		reg = <0xe0002000 0x1000>;
		phy_type = "ulpi";
	};

	usb1: usb@e0003000 {
		compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
		status = "disabled";
		clocks = <&clkc 29>;
		interrupt-parent = <&intc>;
		interrupts = <0 44 4>;
		reg = <0xe0003000 0x1000>;
		phy_type = "ulpi";
	};

	watchdog0: watchdog@f8005000 {
		clocks = <&clkc 45>;
		compatible = "cdns,wdt-r1p2";
		interrupt-parent = <&intc>;
		interrupts = <0 9 1>;
		reg = <0xf8005000 0x1000>;
		timeout-sec = <10>;
	};
};

};

@xuchendev
Copy link
Author

xuchendev commented Apr 7, 2017

this is my three dts file ,where should i put your char_node = = ,thank u = =

@bperez77
Copy link
Owner

bperez77 commented Apr 7, 2017

The char node can go anywhere in the device tree. Typically it's placed at the top-level where the chosen node and others are located.

Are you getting a compilation error when running the device tree compiler? I'm going to need more information to debug that.

@xuchendev
Copy link
Author

i put the char node under the root node and parallel to the chosen node , it compiles successfully !

@xuchendev
Copy link
Author

xuchendev commented Apr 7, 2017

now the linux system start up successfully~
but i insmod get the error message segmentation fault,
this is the dmesg

[ 26.684890] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 26.691597] pgd = cd55c000
[ 26.693022] [00000000] *pgd=00000000
[ 26.695238] Internal error: Oops - BUG: 5 [#1] PREEMPT SMP ARM
[ 26.699748] Modules linked in: axidma(O+)
[ 26.702445] CPU: 1 PID: 1357 Comm: insmod Tainted: G O 4.6.0-xilinx #1
[ 26.708775] Hardware name: Xilinx Zynq Platform
[ 26.711989] task: ce73e7c0 ti: cd454000 task.ti: cd454000
[ 26.716094] PC is at axidma_of_parse_dma_nodes+0x1cc/0x48c [axidma]
[ 26.721023] LR is at of_find_property+0x40/0x4c
[ 26.724230] pc : [] lr : [] psr: 600e0013
sp : cd455cc0 ip : 00000000 fp : cedefa04
[ 26.733081] r10: cdf98c14 r9 : cdf98c00 r8 : cedefeb0
[ 26.736987] r7 : 00000014 r6 : 00000000 r5 : cd5669c0 r4 : 00000001
[ 26.742195] r3 : 00000000 r2 : 00000000 r1 : 600e0013 r0 : 00000000
[ 26.747404] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 26.753219] Control: 18c5387d Table: 0d55c04a DAC: 00000051
[ 26.757645] Process insmod (pid: 1357, stack limit = 0xcd454210)
[ 26.762332] Stack: (0xcd455cc0 to 0xcd456000)
[ 26.765376] 5cc0: cd455cd8 00000006 00000001 00000001 00000001 00000000 cedefa04 00000001
[ 26.772234] 5ce0: 00000001 c04b7f14 c0963fbc 00000001 00000010 00000001 cedefeb0 cedefeb0
[ 26.779090] 5d00: 00000002 bf004098 c0962060 ce550200 00000002 cd477064 cd477048 c04b8124
[ 26.785948] 5d20: ffffffff cd5669c0 00000014 bf004098 c0962060 ce550200 00000002 cd477064
[ 26.792805] 5d40: cd477048 bf001c10 ce550200 cd5669c0 cd5669c0 ce550200 bf004098 c0962060
[ 26.799662] 5d60: 00000000 bf000074 fffffdfb bf000028 ce550210 c0384718 ce550210 c0962058
[ 26.806519] 5d80: bf004098 c03830c4 00000000 ce550210 ce550244 bf004098 c0918480 c09063d0
[ 26.813376] 5da0: 00000001 c03832a8 00000000 bf004098 c0383228 c0381828 ce497f5c ce54d7b4
[ 26.820233] 5dc0: bf004098 00000000 ce607180 c03827c0 bf00288c bf00288d 00000000 bf004098
[ 26.827091] 5de0: bf006000 00000000 c09063d0 c03839d0 c03841f8 cdf98dc0 bf006000 c0101700
[ 26.833947] 5e00: c093aa58 cdf98e00 cefac700 00000000 00000001 cefac720 00000000 00000001
[ 26.840805] 5e20: c073fff3 c0190b14 c0906284 cefac700 00000000 00000001 cedf0000 cd477040
[ 26.847662] 5e40: 00000000 00000000 cd477048 c01929a8 00000000 bf004100 00000001 cdef9900
[ 26.854519] 5e60: bf004148 cd477040 00000001 c018afb4 bf004100 0000def9 cd455f54 00000001
[ 26.861376] 5e80: bf004100 c0175428 bf00410c 00007fff bf004100 c0172b3c 00000000 c0172a64
[ 26.868234] 5ea0: bf0042a4 000000ec 00000000 00000000 d09d294c 7f618c10 00000000 c01cbee4
[ 26.875090] 5ec0: 00007d79 00000000 7fffffff 00000000 00000000 00000000 00000000 00000000
[ 26.881947] 5ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 26.888805] 5f00: 00000000 00000000 7fffffff 00000000 7f618c10 00000003 0000017b c0106f84
[ 26.895662] 5f20: cd454000 00000000 00000000 c0175a78 7fffffff 00000000 00000002 00007d79
[ 26.902520] 5f40: 00000000 d09cd000 00007d79 00000000 00000000 d09cd000 00007d79 d09d2384
[ 26.909377] 5f60: d09d21f0 d09d4424 000042c8 000047c8 00000000 00000000 00000000 0000182c
[ 26.916234] 5f80: 00000025 00000026 0000001a 0000001e 00000010 00000000 1e8f8500 00000000
[ 26.923092] 5fa0: 7f62b000 c0106dc0 1e8f8500 00000000 00000003 7f618c10 00000000 bedb54f0
[ 26.929948] 5fc0: 1e8f8500 00000000 7f62b000 0000017b 00000000 00000000 7f62a9bc 00000000
[ 26.936806] 5fe0: bedb5498 bedb5488 7f60f4a3 b6edd7b2 800e0030 00000003 00000000 00000000
[ 26.943700] [] (axidma_of_parse_dma_nodes [axidma]) from [] (axidma_dma_init+0x98/0x1bc [axidma
])
[ 26.952979] [] (axidma_dma_init [axidma]) from [] (axidma_probe+0x4c/0xc4 [axidma])
[ 26.961041] [] (axidma_probe [axidma]) from [] (platform_drv_probe+0x50/0xa0)
[ 26.968588] [] (platform_drv_probe) from [] (driver_probe_device+0x118/0x27c)
[ 26.976133] [] (driver_probe_device) from [] (__driver_attach+0x80/0xa4)
[ 26.983248] [] (__driver_attach) from [] (bus_for_each_dev+0x6c/0x90)
[ 26.990105] [] (bus_for_each_dev) from [] (bus_add_driver+0xc8/0x1e4)
[ 26.996960] [] (bus_add_driver) from [] (driver_register+0x9c/0xe0)
[ 27.003646] [] (driver_register) from [] (do_one_initcall+0x100/0x184)
[ 27.010591] [] (do_one_initcall) from [] (do_init_module+0x54/0x1b4)
[ 27.017363] [] (do_init_module) from [] (load_module+0x1730/0x1bc4)
[ 27.024043] [] (load_module) from [] (SyS_finit_module+0x88/0x90)
[ 27.030555] [] (SyS_finit_module) from [] (ret_fast_syscall+0x0/0x3c)
[ 27.037408] Code: e3a02000 eb52d2db e3500000 1a000006 (e5963000)
[ 27.042495] ---[ end trace ea29b3f80d327928 ]---

i didnt enable the read channel in VDMA, is that problem ?

@xuchendev
Copy link
Author

also you can provide us an example to let us run the test : ]

@bperez77
Copy link
Owner

bperez77 commented Apr 9, 2017

If you didn't enable the read channel, then you shouldn't have a device tree entry for it. For the examples, you can see axidma_benchmark under the examples directory. Just run ./axidma_benchmark -h to see how to run it.

@xuchendev
Copy link
Author

xuchendev commented Apr 10, 2017

thank u brandon ,finally i run the insmod successfully, the dmesg shows that

[46.715500] axidma: axidma_dma.c: axidma_dma_init: 705: DMA: Found 1 transmit channels and 1 receive channels.
[46.715517] axidma: axidma_dma.c: axidma_dma_init: 707: VDMA: Found 0 transmit channels and 0 receive channels.

and the /dev/ shows a axidma

but when i run the axidma_benchmark, the output shows
-bash: ./axidma_benchmark: No such file or directory

i was confused, the linux_xilinx kernerl is 4.6.0-xilinx

@xuchendev
Copy link
Author

xuchendev commented Apr 10, 2017

i also tried VDMA,
[18.324202] axidma: axidma_dma.c: axidma_dma_init: 705: DMA: Found 0 transmit channels and 0 receive channels.
[18.324217] axidma: axidma_dma.c: axidma_dma_init: 707: VDMA: Found 1 transmit channels and 0 receive channels.

but still

-bash: ./axidma_benchmark: No such file or directory

@xuchendev
Copy link
Author

OK, i comiple it on the zynq device instead of CROSS_COMPILE on the pc ,it will run!

@bperez77
Copy link
Owner

You have to copy the axidma_benchmark binary to the root filesystem on the SD card (assuming you're doing an SD boot). Otherwise, you won't have that executable to run. It's not a built-in executable, it's compiled on the host side (or you can do it on the board like you did).

Did VDMA also work for you?

@xuchendev
Copy link
Author

xuchendev commented Apr 11, 2017

not yet, i meet the DMA receive transaction timed out issue which yaobaishen asked,

if i want to use the your axidma_display_image app, which image format should i put into the path ?
should i convert it as a opencv Mat?

@bperez77
Copy link
Owner

So just to clarify, the DMA works, but the VDMA does not? I haven't been able to get VDMA working either.

For the display app, the image should be in some 32-bit format. I used it with an RGBA image, but the code doesn't rely on that fact other than the 32-bit size. Also, be careful with that example, as I haven't updated it in a while, so I'm not sure how reliable it is.

@qudevin521314
Copy link

qudevin521314 commented Nov 10, 2018

Hello, guy, I'm running DMA in linux on zedboard,now i run the insmod axidma.ko successfully, the dmesg shows that

axidma:loading out-of-tree module taints kernel.
axidma: axidma_dma.c: axidma_dma_init: 718: DMA: Found 1 transmit channels and 1 receive channels.
axidma: axidma_dma.c: axidma_dma_init: 720: VDMA: Found 0 transmit channels and 0 receive channels.

but when i run ./axidma_benchmark, the output is

AXI DMA Benchmark Parameters:
Transmit Buffer Size: 7.91 MiB
Receive Buffer Size: 7.91 MiB
Number of DMA Transfers: 1000 transfers
Error opening AXI DMA device: No such file or directory
Expected the AXI DMA device at the path /dev/axidma
Failed to initialize the AXI DMA device.

i am looking forward to your answer!

@bperez77
Copy link
Owner

That's odd, it looks like the module is being loaded correctly. You're not removing the module or restarting the processor between those lines, correct?

Can you send the full output of dmesg after running the benchmark program. Please attach the output as a file to the thread.

@qudevin521314
Copy link

qudevin521314 commented Nov 10, 2018

Hello, guy, first I'm not removing the module or restarting the processor between those lines.
and this is the dmesg

zynq> dmesg
Booting Linux on physical CPU 0x0
Linux version 4.9.0-xilinx (root@devin-VirtualBox) (gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-50) ) #1 SMP PREEMPT Fri Nov 9 22:13:05 CST 2018
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: xlnx,zynq-7000
earlycon: cdns0 at MMIO 0xe0001000 (options '115200n8')
bootconsole [cdns0] enabled
cma: Reserved 28 MiB at 0x1c800000
Memory policy: Data cache writealloc
On node 0 totalpages: 131072
free_area_init_node: node 0, pgdat c0a316c0, node_mem_map dfbea000
Normal zone: 1024 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 131072 pages, LIFO batch:31
percpu: Embedded 14 pages/cpu @dfbc5000 s25984 r8192 d23168 u57344
pcpu-alloc: s25984 r8192 d23168 u57344 alloc=14*4096
pcpu-alloc: [0] 0 [0] 1
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootfstype=ext4 earlyprintk rootwait earlycon cma=25M
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 475536K/524288K available (6144K kernel code, 200K rwdata, 1472K rodata, 1024K init, 230K bss, 20080K reserved, 28672K cma-reserved, 0K highmem)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)
lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc0700000 (7136 kB)
.init : 0xc0900000 - 0xc0a00000 (1024 kB)
.data : 0xc0a00000 - 0xc0a322c0 ( 201 kB)
.bss : 0xc0a322c0 - 0xc0a6be5c ( 231 kB)
Preemptible hierarchical RCU implementation.
Build-time adjustment of leaf fanout to 32.
RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
efuse mapped to e0800000
slcr mapped to e0802000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at e0802100
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns
Switching to timer-based delay loop, resolution 3ns
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
timer #0 at e080a000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100058
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (1333.33 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xe0840000
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 25, base_baud = 3125000) is a xuartps
console [ttyPS0] enabled
bootconsole [cdns0] disabled
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti [email protected]
PTP clock support registered
EDAC MC: Ver: 3.0.0
FPGA manager framework
fpga-region fpga-full: FPGA Region probed
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PCI: CLS 0 bytes, default 64
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 5188K (de612000 - deb23000)
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
workingset: timestamp_bits=30 max_order=17 bucket_order=0
jffs2: version 2.2. (NAND) (SUMMARY) ?2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
xilinx-vdma 40400000.dma: Xilinx AXI DMA Engine Driver Probed!!
[drm] Initialized
brd: module loaded
loop: module loaded
libphy: Fixed MDIO Bus: probed
CAN device driver interface
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 27 (00:0a:35:00:01:22)
Marvell 88E1510 e000b000.etherne:00: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer at e08cd000 with timeout 10s
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
fpga_manager fpga0: Xilinx Zynq FPGA Manager registered
NET: Registered protocol family 10
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20161123 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
of_cfs_init
of_cfs_init: OK
ALSA device list:
No soundcards found.
RAMDISK: gzip image found at block 0
mmc0: new high speed SDHC card at address e624
mmcblk0: mmc0:e624 SC16G 14.8 GiB
mmcblk0: p1
EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 1:0.
random: sshd: uninitialized urandom read (32 bytes read)
random: fast init done
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
axidma: loading out-of-tree module taints kernel.
axidma: axidma_dma.c: axidma_dma_init: 718: DMA: Found 1 transmit channels and 1 receive channels.
axidma: axidma_dma.c: axidma_dma_init: 720: VDMA: Found 0 transmit channels and 0 receive channels.
zynq>

Thank you so much, i am looking forward to your reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants