2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PetaLinux / MicroZed > AJ. Vivado > Address Editorを元にしたdtsの書き方例 / uioのapplication

Last updated at Posted at 2017-02-21
動作環境
PetaLinux 2014.4
Vivado v2014.2
MicroZed

2014年のメモより。

Zynq-7000 AP SoC Spectrum Analyzer part 5 - Accelerating Software - Accelerating an FFT with ACP Coprocessor Tech Tip 2014.3

fft_1: fft-axi-dma@40400000 {
compatible = “generic-uio”;
interrupt-parent = <&ps7_scugic_0>;
interrupts = <0, 52 4>;
reg = <0x40400000 0x10000>;
};
 
The fields of the description are:
- fft_1:
Just a label in the dts
fft-axi-dma:
The name that will show up in the PetaLinux/sys file system describing this device
@40400000:
The address on the bus in Hex for documentation purposes (Recall that we verified this address when the hardware was built in Vivado.)
compatible="generic-uio":
States that this is compatible with the driver named "generic-uio" - This is critical to link the DMA engine to user space I/O
interrupt-parent=<&ps7-scugic_0>:
States that interrupts from this device go to that controller described elsewhere in the dts
interrupts=<0, 52, 4>:
The 52 is the number assigned in IRQ_F2P minus 32. The numbers 0 and 4 are required for proper operation of IRQ_F2P interrupts.
reg=0x40400000 0x10000:
This specifies that this device has a 0x10000 (64K) address space starting at 0x40400000 (Recall that we verified this address when the hardware was built in Vivado.)

上記を参考にsystem-top.dtsファイルを以下のように編集したら、/dev/uio0が見えるようになった。
この例ではoutput(LED点灯など)の書き方をしている。 inputの場合は、別途interruptなどの指定が必要となるそう。

/dts-v1/;
/include/ "system-conf.dtsi"
/ {
axi_gpio@41200000 {
    compatible = "generic-uio";
    reg = < 0x41200000 0x10000>   ;
};
};

uioのapplicationは svenandのコード をPetaLinuxのアプリケーションとして作成すればいい。
アプリケーションの名前をledappとした場合

$ /bin/ledapp -d /dev/uio0 -o 1

とするとzedboardのLD0が点灯することを確認した。
同様に

$ /bin/ledapp -d /dev/uio0 -o 2
$ /bin/ledapp -d /dev/uio0 -o 3

などでLD1、LD0+LD1が点灯する。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?