FPGAの部屋

FPGAやCPLDの話題やFPGA用のツールの話題などです。 マニアックです。 日記も書きます。

FPGAの部屋の有用と思われるコンテンツのまとめサイトを作りました。ご利用ください。 http://marsee101.web.fc2.com/index.html

2019年04月

”Docker 上のUbuntu 16.04 のPetaLinux 2018.2でuioとudmabufの動作をテストする(DMA_pow2_testを使用)”のRootFSをUbuntu 18.04に変更した”の続き。

前回は、PetaLinux 2018.2 のプロジェクトを作成して、ビルドを行い、BOOT.BIN の作成したものに、PL のIP(DMA_pow2)のUIO を追加し、さらに udmabuf.ko をビルドした。そして、DMApow2Test2.c を作成し、ビルドして、Ultra96 のPetaLinux 上でテストしたところ成功した。そしてそのPetaLinux のRootFS をUbuntu 18.04.2 に変更したところうまく起動した。今回は、Ubuntu 18.04.2 のUIOの状況を見ていこう。

/sys/class を見ると uio ディレクトリがある。
しかし、uio ディレクトリの下には、uio0 のみだった。 uio1 がない。
fbe5eb6c.png


/sys/devices/platform/amba_pl@0/80000000.DMA_pow2 はあったので、デバイスツリーは認識されているが、UIO には入っていないようだ。
961c8782.png


aster_ism さんのように devmem2 やスーパーバイザのコードでやる方法もあるが、できればUIO でやりたい。

デバイスツリーを使わずにUIOを使用する方法もあるようだが、PetaLinux から外れてきてしまっているので、もし使うならば ikwzm さんの実装のほうが良さそうだ。

昨日から、お袋が干している洗濯干場が草が生えてきて、濡れるということで、防腐剤入り2x4 材ですのこを作りました。
2x4 6フィート(1820mm)を5本横に並べて、縦に 65mm のコーススレッドで止めました。板の隙間が開くと光が入って草が生えちゃうので、クランプで締め上げて、隙間なしに作りました。裏からコーススレッドで止めたのですが、直接コーススレッドが土につかないように、ざぐりを入れるドリルビットを使って下穴を開けています。
昨日、2つ、今日は1つ作って並べました。
60e45205.jpg


adf9ac7e.jpg


今日はもう1つ作りました。これは、床の間の段差解消用の台です。この台は、床の間の段差を解消して、床の間に自転車を飾っておくために使います。
80ba325d.jpg


こっちのほうが難しかったです。幅は 310mm だったので、1x4 3 フィートの板を4つ並べて仮止めしてから、両側を 20 mm ずつカットしました。また、高さは 105 mm なので、 2x4 材を縦にして 1x4 3 フィートの板に付けたのですが、そのままだと高すぎるので、手押しカンナ盤を使って、 0.5 mm 単位でその高さになるように削っていきました。
足を付ける時に位置を間違ってしまったので、もう1つ足を付けてしまいました。失敗。。。

昨日、朝日トンネルまでこの前買ったロードレーサー(Cannondale CAAD12 105)に乗ってサイクリングに行ってきました。本当は朝日トンネルを通って、朝日里山学校に行こうと思っていました。朝日里山学校では、奥さんのトレラン大会のゴールなので、応援に行こうと思ったのでした。
ですが、初めての一般道で転倒しかけてビビっていたのでトンネルが見えるところまで行ったのですが、、とてもトンネル通る気にならずに、引き返しました。
67e0c2f7.jpg


db844163.jpg


家まで帰ってきたのですが、40km くらいロードレーサーに乗ってみようと思って、小貝川河川敷を南に行きました。いや〜。菜の花が花盛りでしたね。とても良かったです。
7b2e88e6.jpg


e975a656.jpg


総走行距離は 42.74 km, 2:23:38、平均速度 17.9 kph, 平均移動速度 21.4 kph でした。風が強かったけど、楽しかったです。

”Docker 上のUbuntu 16.04 のPetaLinux 2018.2でuioとudmabufの動作をテストする(DMA_pow2_testを使用)”で2乗IPを動作させることができた”の続き。

前回は、PetaLinux 2018.2 のプロジェクトを作成して、ビルドを行い、BOOT.BIN の作成したものに、PL のIP(DMA_pow2)のUIO を追加し、さらに udmabuf.ko をビルドした。そして、DMApow2Test2.c を作成し、ビルドして、Ultra96 のPetaLinux 上でテストしたところ成功した。今回は、そのPetaLinux のRootFS をUbuntu 18.04.2 に変更する。

aster_ismの工作室の”ZYBO-Z7を用いたLチカ(Ubuntu16.04編)”を参考にさせていただいた。

Ubuntu 18.04 をダウンロードする。
https://rcn-ee.com/rootfs/eewiki/minfs/ をWeb ブラウザで表示させると、Debian やUbuntu のRootFS がたくさんあった。そのうちの ubuntu-18.04.2-minimal-armhf-2019-04-27.tar.xz をダウンロードした。
5ac49c43.png


ubuntu-18.04.2-minimal-armhf-2019-04-27.tar.xz を解凍したところ、ubuntu-18.04.2-minimal-armhf-2019-04-27 ディレクトリの下に armhf-rootfs-ubuntu-bionic.tar が入っていた。
9dc5c66a.png


MicroSD カードの rootfs ディレクトリの下をすべて削除して、 armhf-rootfs-ubuntu-bionic.tar 内のディレクトリやファイルを書き込む。
cd /media/masaaki/rootfs/
sudo rm -rf *
sync
cd ~/Docker/vivado182ub16/masaaki/PetaLProj/ubuntu-18.04.2-minimal-armhf-2019-04-27
sudo tar xvfp armhf-rootfs-ubuntu-bionic.tar -C /media/masaaki/rootfs/
sync

e9d8cb75.png


MicroSD カードをUltra96 に入れて電源ON。
Ubuntu 18.04 が立ち上がった。なおこのログイン画面は reboot した後の画面である。
928bcf2c.png


ID: ubuntu, パスワード: temppwd でログインできた。

起動ログを示す。

Xilinx Zynq MP First Stage Boot Loader 
Release 2018.2   Apr 25 2019  -  20:02:24
PMUFW: v1.0


U-Boot 2018.01 (Apr 25 2019 - 20:01:03 +0000) Xilinx ZynqMP ZCU100 RevC

I2C:   ready
DRAM:  2 GiB
EL Level: EL2
Chip ID: zu3eg
MMC:   sdhci@ff160000: 0 (SD), sdhci@ff170000: 1
*** Warning - bad CRC, using default environment

In:    serial@ff010000
Out:   serial@ff010000
Err:   serial@ff010000
Model: ZynqMP ZCU100 RevC
Board: Xilinx ZynqMP
Bootmode: SD_MODE
Net:   Net Initialization Skipped
No ethernet found.
U-BOOT for xilinx-ultra96-reva-2018_2

Hit any key to stop autoboot:  0 
Device: sdhci@ff160000
Manufacturer ID: 3
OEM: 5344
Name: SL08G 
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading image.ub
6999032 bytes read in 509 ms (13.1 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x10000108
     Data Size:    6960378 Bytes = 6.6 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x00080000
     Entry Point:  0x00080000
     Hash algo:    sha1
     Hash value:   bf72d1cfee04a80e2a5b2d9d17b6d9fefd92391e
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@system-top.dtb' configuration
   Trying 'fdt@system-top.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x106a3708
     Data Size:    36729 Bytes = 35.9 KiB
     Architecture: AArch64
     Hash algo:    sha1
     Hash value:   d2d33c2d7fe1be4facc9e56557a056ca154cd89c
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x106a3708
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 0000000007ff4000, end 0000000007ffff78 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.0-xilinx-v2018.2 (oe-user@oe-host) (gcc version 7.2.0 (GCC)) #3 SMP Thu Apr 25 20:00:38 UTC 2019
[    0.000000] Boot CPU: AArch64 Processor [410fd034]
[    0.000000] Machine model: ZynqMP ZCU100 RevC
[    0.000000] earlycon: cdns0 at MMIO 0x00000000ff010000 (options '115200n8')
[    0.000000] bootconsole [cdns0] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 256 MiB at 0x000000006fc00000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] random: fast init done
[    0.000000] percpu: Embedded 21 pages/cpu @ffffffc07fe70000 s46488 r8192 d31336 u86016
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 512771
[    0.000000] Kernel command line: console=ttyPS0,115200 earlyprintk earlycon clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait uio_pdrv_genirq.of_id=generic-uio cpuidle.off=1
[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Memory: 1768684K/2079744K available (9980K kernel code, 644K rwdata, 3128K rodata, 512K init, 2168K bss, 48916K reserved, 262144K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     modules : 0xffffff8000000000 - 0xffffff8008000000   (   128 MB)
[    0.000000]     vmalloc : 0xffffff8008000000 - 0xffffffbebfff0000   (   250 GB)
[    0.000000]       .text : 0xffffff8008080000 - 0xffffff8008a40000   (  9984 KB)
[    0.000000]     .rodata : 0xffffff8008a40000 - 0xffffff8008d60000   (  3200 KB)
[    0.000000]       .init : 0xffffff8008d60000 - 0xffffff8008de0000   (   512 KB)
[    0.000000]       .data : 0xffffff8008de0000 - 0xffffff8008e81200   (   645 KB)
[    0.000000]        .bss : 0xffffff8008e81200 - 0xffffff800909f2b0   (  2169 KB)
[    0.000000]     fixed   : 0xffffffbefe7fd000 - 0xffffffbefec00000   (  4108 KB)
[    0.000000]     PCI I/O : 0xffffffbefee00000 - 0xffffffbeffe00000   (    16 MB)
[    0.000000]     vmemmap : 0xffffffbf00000000 - 0xffffffc000000000   (     4 GB maximum)
[    0.000000]               0xffffffbf00000000 - 0xffffffbf01bfc800   (    27 MB actual)
[    0.000000]     memory  : 0xffffffc000000000 - 0xffffffc07ff00000   (  2047 MB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU event tracing is enabled.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] arch_timer: cp15 timer(s) running at 99.99MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x171024e3b8, max_idle_ns: 440795206484 ns
[    0.000004] sched_clock: 56 bits at 99MHz, resolution 10ns, wraps every 4398046511100ns
[    0.008319] Console: colour dummy device 80x25
[    0.012594] Calibrating delay loop (skipped), value calculated using timer frequency.. 199.99 BogoMIPS (lpj=399999)
[    0.022953] pid_max: default: 32768 minimum: 301
[    0.027649] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.034207] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.042027] ASID allocator initialised with 65536 entries
[    0.047285] Hierarchical SRCU implementation.
[    0.051884] EFI services will not be available.
[    0.056243] zynqmp_plat_init Platform Management API v1.0
[    0.061585] zynqmp_plat_init Trustzone version v1.0
[    0.066533] smp: Bringing up secondary CPUs ...
[    0.071208] Detected VIPT I-cache on CPU1
[    0.071249] CPU1: Booted secondary processor [410fd034]
[    0.071559] Detected VIPT I-cache on CPU2
[    0.071578] CPU2: Booted secondary processor [410fd034]
[    0.071868] Detected VIPT I-cache on CPU3
[    0.071886] CPU3: Booted secondary processor [410fd034]
[    0.071928] smp: Brought up 1 node, 4 CPUs
[    0.103345] SMP: Total of 4 processors activated.
[    0.108018] CPU features: detected feature: 32-bit EL0 Support
[    0.113816] CPU: All CPU(s) started at EL2
[    0.117890] alternatives: patching kernel code
[    0.123020] devtmpfs: initialized
[    0.130364] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.139906] futex hash table entries: 1024 (order: 5, 131072 bytes)
[    0.152307] xor: measuring software checksum speed
[    0.196987]    8regs     :  2303.000 MB/sec
[    0.237016]    8regs_prefetch:  2053.000 MB/sec
[    0.281386]    32regs    :  2830.000 MB/sec
[    0.321416]    32regs_prefetch:  2381.000 MB/sec
[    0.325840] xor: using function: 32regs (2830.000 MB/sec)
[    0.331290] pinctrl core: initialized pinctrl subsystem
[    0.337047] NET: Registered protocol family 16
[    0.342651] vdso: 2 pages (1 code @ ffffff8008a46000, 1 data @ ffffff8008de4000)
[    0.349859] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.357237] DMA: preallocated 256 KiB pool for atomic allocations
[    0.393716] reset_zynqmp reset-controller: Xilinx zynqmp reset driver probed
[    0.401078] ARM CCI_400_r1 PMU driver probed
[    0.405603] zynqmp-pinctrl ff180000.pinctrl: zynqmp pinctrl initialized
[    0.425598] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.496596] raid6: int64x1  gen()   401 MB/s
[    0.568648] raid6: int64x1  xor()   445 MB/s
[    0.640725] raid6: int64x2  gen()   688 MB/s
[    0.712774] raid6: int64x2  xor()   603 MB/s
[    0.784861] raid6: int64x4  gen()  1043 MB/s
[    0.856879] raid6: int64x4  xor()   742 MB/s
[    0.928960] raid6: int64x8  gen()   980 MB/s
[    1.000987] raid6: int64x8  xor()   745 MB/s
[    1.073092] raid6: neonx1   gen()   726 MB/s
[    1.145101] raid6: neonx1   xor()   852 MB/s
[    1.217192] raid6: neonx2   gen()  1169 MB/s
[    1.289213] raid6: neonx2   xor()  1207 MB/s
[    1.361292] raid6: neonx4   gen()  1506 MB/s
[    1.433340] raid6: neonx4   xor()  1442 MB/s
[    1.505385] raid6: neonx8   gen()  1652 MB/s
[    1.577454] raid6: neonx8   xor()  1534 MB/s
[    1.581534] raid6: using algorithm neonx8 gen() 1652 MB/s
[    1.586896] raid6: .... xor() 1534 MB/s, rmw enabled
[    1.591828] raid6: using neon recovery algorithm
[    1.597718] SCSI subsystem initialized
[    1.601497] usbcore: registered new interface driver usbfs
[    1.606824] usbcore: registered new interface driver hub
[    1.612113] usbcore: registered new device driver usb
[    1.617155] media: Linux media interface: v0.10
[    1.621605] Linux video capture interface: v2.00
[    1.626210] pps_core: LinuxPPS API ver. 1 registered
[    1.631099] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    1.640193] PTP clock support registered
[    1.644092] EDAC MC: Ver: 3.0.0
[    1.647554] zynqmp-ipi ff9905c0.mailbox: Probed ZynqMP IPI Mailbox driver.
[    1.654564] FPGA manager framework
[    1.657905] fpga-region fpga-full: FPGA Region probed
[    1.662915] Advanced Linux Sound Architecture Driver Initialized.
[    1.669155] Bluetooth: Core ver 2.22
[    1.672558] NET: Registered protocol family 31
[    1.676954] Bluetooth: HCI device and connection manager initialized
[    1.683272] Bluetooth: HCI socket layer initialized
[    1.688113] Bluetooth: L2CAP socket layer initialized
[    1.693148] Bluetooth: SCO socket layer initialized
[    1.698651] clocksource: Switched to clocksource arch_sys_counter
[    1.704639] VFS: Disk quotas dquot_6.6.0
[    1.708486] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.719525] NET: Registered protocol family 2
[    1.724057] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    1.731185] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[    1.737977] TCP: Hash tables configured (established 16384 bind 16384)
[    1.744402] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[    1.750307] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[    1.756805] NET: Registered protocol family 1
[    1.761221] RPC: Registered named UNIX socket transport module.
[    1.766955] RPC: Registered udp transport module.
[    1.771619] RPC: Registered tcp transport module.
[    1.776289] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.783292] hw perfevents: no interrupt-affinity property for /pmu, guessing.
[    1.790389] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[    1.798761] audit: initializing netlink subsys (disabled)
[    1.804043] audit: type=2000 audit(1.744:1): state=initialized audit_enabled=0 res=1
[    1.804403] workingset: timestamp_bits=62 max_order=19 bucket_order=0
[    1.818783] NFS: Registering the id_resolver key type
[    1.823662] Key type id_resolver registered
[    1.827794] Key type id_legacy registered
[    1.831778] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.838447] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    1.869095] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[    1.876313] io scheduler noop registered
[    1.880189] io scheduler deadline registered
[    1.884438] io scheduler cfq registered (default)
[    1.889096] io scheduler mq-deadline registered
[    1.893593] io scheduler kyber registered
[    1.899033] xilinx-dpdma fd4c0000.dma: Xilinx DPDMA engine is probed
[    1.905657] xilinx-zynqmp-dma fd500000.dma: ZynqMP DMA driver Probe success
[    1.912572] xilinx-zynqmp-dma fd510000.dma: ZynqMP DMA driver Probe success
[    1.919487] xilinx-zynqmp-dma fd520000.dma: ZynqMP DMA driver Probe success
[    1.926404] xilinx-zynqmp-dma fd530000.dma: ZynqMP DMA driver Probe success
[    1.933322] xilinx-zynqmp-dma fd540000.dma: ZynqMP DMA driver Probe success
[    1.940241] xilinx-zynqmp-dma fd550000.dma: ZynqMP DMA driver Probe success
[    1.947168] xilinx-zynqmp-dma fd560000.dma: ZynqMP DMA driver Probe success
[    1.954093] xilinx-zynqmp-dma fd570000.dma: ZynqMP DMA driver Probe success
[    1.961074] xilinx-zynqmp-dma ffa80000.dma: ZynqMP DMA driver Probe success
[    1.967983] xilinx-zynqmp-dma ffa90000.dma: ZynqMP DMA driver Probe success
[    1.974904] xilinx-zynqmp-dma ffaa0000.dma: ZynqMP DMA driver Probe success
[    1.981820] xilinx-zynqmp-dma ffab0000.dma: ZynqMP DMA driver Probe success
[    1.988742] xilinx-zynqmp-dma ffac0000.dma: ZynqMP DMA driver Probe success
[    1.995664] xilinx-zynqmp-dma ffad0000.dma: ZynqMP DMA driver Probe success
[    2.002582] xilinx-zynqmp-dma ffae0000.dma: ZynqMP DMA driver Probe success
[    2.009508] xilinx-zynqmp-dma ffaf0000.dma: ZynqMP DMA driver Probe success
[    2.043552] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    2.053642] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    2.064187] brd: module loaded
[    2.071280] loop: module loaded
[    2.075203] mtdoops: mtd device (mtddev=name/number) must be supplied
[    2.083855] libphy: Fixed MDIO Bus: probed
[    2.088870] tun: Universal TUN/TAP device driver, 1.6
[    2.093911] CAN device driver interface
[    2.098543] usbcore: registered new interface driver asix
[    2.103813] usbcore: registered new interface driver ax88179_178a
[    2.109825] usbcore: registered new interface driver cdc_ether
[    2.115618] usbcore: registered new interface driver net1080
[    2.121240] usbcore: registered new interface driver cdc_subset
[    2.127122] usbcore: registered new interface driver zaurus
[    2.132670] usbcore: registered new interface driver cdc_ncm
[    2.138633] xilinx-axipmon ffa00000.perf-monitor: Probed Xilinx APM
[    2.145216] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.151562] ehci-pci: EHCI PCI platform driver
[    2.156253] usbcore: registered new interface driver uas
[    2.161403] usbcore: registered new interface driver usb-storage
[    2.167952] rtc_zynqmp ffa60000.rtc: rtc core: registered ffa60000.rtc as rtc0
[    2.175037] i2c /dev entries driver
[    2.179248] IR NEC protocol handler initialized
[    2.183598] IR RC5(x/sz) protocol handler initialized
[    2.188610] IR RC6 protocol handler initialized
[    2.193107] IR JVC protocol handler initialized
[    2.197607] IR Sony protocol handler initialized
[    2.202189] IR SANYO protocol handler initialized
[    2.206860] IR Sharp protocol handler initialized
[    2.211531] IR MCE Keyboard/mouse protocol handler initialized
[    2.217327] IR XMP protocol handler initialized
[    2.222950] usbcore: registered new interface driver uvcvideo
[    2.228503] USB Video Class driver (1.1.1)
[    2.232640] ltc2952-poweroff ltc2954: pm_power_off already registered
[    2.238977] ltc2952-poweroff: probe of ltc2954 failed with error -16
[    2.246159] cdns-wdt fd4d0000.watchdog: Xilinx Watchdog Timer at ffffff800912d000 with timeout 10s
[    2.255111] Bluetooth: HCI UART driver ver 2.3
[    2.259372] Bluetooth: HCI UART protocol H4 registered
[    2.264470] Bluetooth: HCI UART protocol BCSP registered
[    2.269770] Bluetooth: HCI UART protocol LL registered
[    2.274850] Bluetooth: HCI UART protocol ATH3K registered
[    2.280212] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    2.286477] Bluetooth: HCI UART protocol Intel registered
[    2.291804] Bluetooth: HCI UART protocol QCA registered
[    2.297029] usbcore: registered new interface driver bcm203x
[    2.302649] usbcore: registered new interface driver bpa10x
[    2.308179] usbcore: registered new interface driver bfusb
[    2.313632] usbcore: registered new interface driver btusb
[    2.319052] Bluetooth: Generic Bluetooth SDIO driver ver 0.1
[    2.324721] usbcore: registered new interface driver ath3k
[    2.330254] EDAC MC: ECC not enabled
[    2.333922] EDAC DEVICE0: Giving out device to module zynqmp-ocm-edac controller zynqmp_ocm: DEV ff960000.memory-controller (INTERRUPT)
[    2.346532] CPUidle arm: Failed to register cpuidle driver
[    2.352025] sdhci: Secure Digital Host Controller Interface driver
[    2.358011] sdhci: Copyright(c) Pierre Ossman
[    2.362335] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.410663] mmc0: SDHCI controller on ff160000.sdhci [ff160000.sdhci] using ADMA 64-bit
[    2.424408] sdhci-arasan ff170000.sdhci: parsing dt failed (-517)
[    2.430701] ledtrig-cpu: registered to indicate activity on CPUs
[    2.436696] usbcore: registered new interface driver usbhid
[    2.442073] usbhid: USB HID core driver
[    2.447790] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
[    2.455910] pktgen: Packet Generator for packet performance testing. Version: 2.75
[    2.465513] Netfilter messages via NETLINK v0.30.
[    2.470167] ip_tables: (C) 2000-2006 Netfilter Core Team
[    2.475454] Initializing XFRM netlink socket
[    2.479627] NET: Registered protocol family 10
[    2.484392] Segment Routing with IPv6
[    2.487915] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    2.493361] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.499481] NET: Registered protocol family 17
[    2.503751] NET: Registered protocol family 15
[    2.508169] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    2.521040] Ebtables v2.0 registered
[    2.524689] can: controller area network core (rev 20170425 abi 9)
[    2.530813] NET: Registered protocol family 29
[    2.535145] can: raw protocol (rev 20170425)
[    2.539381] can: broadcast manager protocol (rev 20170425 t)
[    2.545006] can: netlink gateway (rev 20170425) max_hops=1
[    2.550728] Bluetooth: RFCOMM TTY layer initialized
[    2.555424] Bluetooth: RFCOMM socket layer initialized
[    2.560531] Bluetooth: RFCOMM ver 1.11
[    2.564240] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    2.569514] Bluetooth: BNEP filters: protocol multicast
[    2.574706] Bluetooth: BNEP socket layer initialized
[    2.579640] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    2.585517] Bluetooth: HIDP socket layer initialized
[    2.590591] 9pnet: Installing 9P2000 support
[    2.594701] Key type dns_resolver registered
[    2.599445] registered taskstats version 1
[    2.603735] Btrfs loaded, crc32c=crc32c-generic
[    2.614911] ff000000.serial: ttyPS1 at MMIO 0xff000000 (irq = 40, base_baud = 6249999) is a xuartps
[    2.623958] serial serial0: tty port ttyPS1 registered
��r��‚�����ͽ�������AM���*������5R��r��‚�����ͽ�������AM���*������5R��r����ʒ���э��ͽ���ڍ������"�ͅ����5R��r����ʒ���э��ͽ���ڍ������"�ͅ����5R�[    2.654525] xilinx-psgtr fd400000.zynqmp_phy: Lane:1 type:8 protocol:4 pll_locked:yes
[    2.662850] PLL: shutdown
[    2.665603] PLL: shutdown
[    2.665675] mmc0: new high speed SDHC card at address aaaa
[    2.665882] mmcblk0: mmc0:aaaa SL08G 7.40 GiB 
[    2.678518] PLL: enable
[    2.681007] PLL: shutdown
[    2.684449] PLL: enable
[    2.686924] xilinx-dp-snd-codec fd4a0000.zynqmp-display:zynqmp_dp_snd_codec0: Xilinx DisplayPort Sound Codec probed
[    2.697547] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort Sound PCM probed
[    2.705510] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort Sound PCM probed
[    2.713776]  mmcblk0: p1 p2
[    2.713867] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: xilinx-dp-snd-codec-dai <-> xilinx-dp-snd-codec-dai mapping ok
[    2.728982] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: xilinx-dp-snd-codec-dai <-> xilinx-dp-snd-codec-dai mapping ok
[    2.741583] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: Xilinx DisplayPort Sound Card probed
[    2.751702] OF: graph: no port node found in /amba/zynqmp-display@fd4a0000
[    2.758637] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    2.765168] [drm] No driver support for vblank timestamp query.
[    2.771144] xlnx-drm xlnx-drm.0: bound fd4a0000.zynqmp-display (ops 0xffffff8008af7228)
[    3.858660] [drm] Cannot find any crtc or sizes
[    3.863303] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.zynqmp-display on minor 0
[    3.871325] zynqmp-display fd4a0000.zynqmp-display: ZynqMP DisplayPort Subsystem driver probed
[    3.880995] xilinx-psgtr fd400000.zynqmp_phy: Lane:2 type:0 protocol:3 pll_locked:yes
[    3.890446] xilinx-psgtr fd400000.zynqmp_phy: Lane:3 type:1 protocol:3 pll_locked:yes
[    3.898462] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    3.903877] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[    3.911734] xhci-hcd xhci-hcd.0.auto: hcc params 0x0238f625 hci version 0x100 quirks 0x22010010
[    3.920387] xhci-hcd xhci-hcd.0.auto: irq 50, io mem 0xfe300000
[    3.926387] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    3.933093] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.940293] usb usb1: Product: xHCI Host Controller
[    3.945153] usb usb1: Manufacturer: Linux 4.14.0-xilinx-v2018.2 xhci-hcd
[    3.951837] usb usb1: SerialNumber: xhci-hcd.0.auto
[    3.957021] hub 1-0:1.0: USB hub found
[    3.960714] hub 1-0:1.0: 1 port detected
[    3.964781] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    3.970187] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[    3.977887] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    3.985972] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[    3.992679] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.999881] usb usb2: Product: xHCI Host Controller
[    4.004741] usb usb2: Manufacturer: Linux 4.14.0-xilinx-v2018.2 xhci-hcd
[    4.011425] usb usb2: SerialNumber: xhci-hcd.0.auto
[    4.016525] hub 2-0:1.0: USB hub found
[    4.020218] hub 2-0:1.0: 1 port detected
[    4.025672] i2c i2c-0: Added multiplexed i2c bus 2
[    4.030509] i2c i2c-0: Added multiplexed i2c bus 3
[    4.035345] i2c i2c-0: Added multiplexed i2c bus 4
[    4.040184] i2c i2c-0: Added multiplexed i2c bus 5
[    4.045424] tps65086 6-005e: Device: TPS650864, OTP: C, Rev: 0
[    4.054190] i2c i2c-0: Added multiplexed i2c bus 6
[    4.059508] ina2xx 7-0040: power monitor ina226 (Rshunt = 10000 uOhm)
[    4.065900] i2c i2c-0: Added multiplexed i2c bus 7
[    4.070785] i2c i2c-0: Added multiplexed i2c bus 8
[    4.075659] i2c i2c-0: Added multiplexed i2c bus 9
[    4.080365] pca954x 0-0075: registered 8 multiplexed busses for I2C switch pca9548
[    4.087955] cdns-i2c ff030000.i2c: 400 kHz mmio ff030000 irq 31
[    4.095459] sdhci-arasan ff170000.sdhci: allocated mmc-pwrseq
[    4.146662] mmc1: SDHCI controller on ff170000.sdhci [ff170000.sdhci] using ADMA 64-bit
[    4.162015] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[    4.168911] rtc_zynqmp ffa60000.rtc: setting system clock to 1970-01-01 00:15:07 UTC (907)
[    4.172972] sdhci-arasan ff170000.sdhci: card claims to support voltages below defined range
[    4.185625] clk: Not disabling unused clocks
[    4.189864] ALSA device list:
[    4.192758]   #0: DisplayPort monitor
[    4.197460] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    4.203206] mmc1: new high speed SDIO card at address 0001
[    4.203901] wl18xx_driver wl18xx.3.auto: Direct firmware load for ti-connectivity/wl1271-nvs.bin failed with error -2
[    4.203929] wl18xx_driver wl18xx.3.auto: Direct firmware load for ti-connectivity/wl18xx-conf.bin failed with error -2
[    4.203932] wlcore: ERROR could not get configuration binary ti-connectivity/wl18xx-conf.bin: -2
[    4.203934] wlcore: WARNING falling back to default config
[    4.262902] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    4.270927] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    4.284070] devtmpfs: mounted
[    4.287164] Freeing unused kernel memory: 512K
[    4.306670] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[    4.459191] usb 1-1: New USB device found, idVendor=0424, idProduct=2744
[    4.465830] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.472931] usb 1-1: Product: USB2744
[    4.476575] usb 1-1: Manufacturer: Microchip Tech
[    4.490000] hub 1-1:1.0: USB hub found
[    4.493730] hub 1-1:1.0: 4 ports detected
[    4.499093] wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
[    4.508368] wlcore: loaded
[    4.586714] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd
[    4.611053] usb 2-1: New USB device found, idVendor=0424, idProduct=5744
[    4.617681] usb 2-1: New USB device strings: Mfr=2, Product=3, SerialNumber=0
[    4.624796] usb 2-1: Product: USB5744
[    4.628436] usb 2-1: Manufacturer: Microchip Tech
[    4.633982] hub 2-1:1.0: USB hub found
[    4.637688] hub 2-1:1.0: 3 ports detected
[    4.698473] systemd[1]: System time before build time, advancing clock.
[    4.717217] hci-ti serial0-0: Direct firmware load for ti-connectivity/TIInit_11.8.32.bts failed with error -2
[    4.727146] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[    4.736336] Bluetooth: hci0: download firmware failed, retrying...
[    4.752352] systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    4.773872] systemd[1]: Detected architecture arm64.

Welcome to Ubuntu 18.04.2 LTS!

[    4.791448] systemd[1]: Set hostname to <arm>.
[    4.822767] usb 1-1.4: new high-speed USB device number 3 using xhci-hcd
[    4.931439] usb 1-1.4: New USB device found, idVendor=0424, idProduct=2740
[    4.938257] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.945542] usb 1-1.4: Product: Hub Controller
[    4.949958] usb 1-1.4: Manufacturer: Microchip Tech
[    4.966674] [drm] Cannot find any crtc or sizes
[    5.122341] systemd[1]: File /lib/systemd/system/systemd-udevd.service:34 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[    5.139061] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[    5.241113] systemd[1]: Reached target Swap.
[  OK  ] Reached target Swap.
[    5.254764] systemd[1]: Reached target Remote File Systems.
[  OK  ] Reached target Remote File Systems.
[    5.271059] systemd[1]: Created slice User and Session Slice.
[  OK  ] Created slice User and Session Slice.
[    5.286885] systemd[1]: Created slice System Slice.
[  OK  ] Created slice System Slice.
[    5.302965] systemd[1]: Listening on Syslog Socket.
[    5.307802] hci-ti serial0-0: Direct firmware load for ti-connectivity/TIInit_11.8.32.bts failed with error -2
[    5.317747] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[    5.326940] Bluetooth: hci0: download firmware failed, retrying...
[  OK  ] Listening on Syslog Socket.
[  OK  ] Reached target Slices.
[  OK  ] Listening on Journal Audit Socket.
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Listening on udev Kernel Socket.
[  OK  ] Listening on udev Control Socket.
[  OK  ] Created slice system-serial\x2dgetty.slice.
[  OK  ] Listening on Journal Socket.
         Starting Remount Root and Kernel File Systems...
         Mounting Kernel Debug File System...
         Starting udev Coldplug all Devices...
         Starting Set the console keyboard layout...
         Mounting POSIX Message Queue File System...
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Local Encrypted Volumes.
         Starting Load Kernel Modules...
         Mounting Huge Pages File System...
[  OK  ] Listening on Journal Socket (/dev/log).
         Starting Journal Service...
[  OK  ] Started Remount Root and Kernel File Systems.
[  OK  ] Mounted Kernel Debug File System.
[  OK  ] Mounted POSIX Message Queue File System.
[  OK  ] Started Create Static Device Nodes in /dev.
[  OK  ] Started Load Kernel Modules.
[  OK  ] Started Journal Service.
[  OK  ] Mounted Huge Pages File System.
         Starting Apply Kernel Variables...
         Mounting Kernel Configuration File System...
         Starting Load/Save Random Seed...
         Starting Flush Journal to Persistent Storage...
         Starting udev Kernel Device Manager...
[  OK  ] Started Set the console keyboard layout.
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Mounted Kernel Configuration File System.
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Local File Systems.
         Starting Set console font and keymap...
[    5.881706] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[    5.890922] Bluetooth: hci0: download firmware failed, retrying...
         Starting Raise network interfaces...
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Started Set console font and keymap.
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Started Flush Journal to Persistent Storage.
[  OK  ] Reached target Sound Card.
         Starting Create Volatile Files and Directories...
[  OK  ] Found device /dev/ttyPS0.
[  OK  ] Started Create Volatile Files and Directories.
[  OK  ] Listening on Load/Save RF Kill Switch Status [    6.425684] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
/dev/rfkill Watch.
[    6.439696] Bluetooth: hci0: download firmware failed, retrying...
         Starting Network Time Synchronization...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Started Raise network interfaces.
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started Network Time Synchronization.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Reached target System Initialization.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Started Discard unused blocks once a week.
[  OK  ] Started Message of the Day.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target Timers.
[  OK  ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
         Starting Avahi mDNS/DNS-SD Stack...
[  OK  ] Started Set the CPU Frequency Scaling governor.
[  OK  ] Started Regular background program processing daemon.
[  OK  ] Started D-Bus System Message Bus.
         Starting oFono Mobile telephony stack...
         Starting Connection service...
         Starting Login Service...
         Starting LSB: Load kernel modules needed to enable cpufreq scaling...
         Starting Generic Board Startup...
         Starting Bluetooth service...
         Starting LSB: Start busybox udhcpd at boot time...
         Starting WPA supplicant...
         Starting System Logging Service...
         Starting Dispatcher daemon for systemd-networkd...
         Starting Load/Save RF Kill Switch Status...
[  OK  ] Started Avahi mDNS/DNS-SD Stack.
[  OK  ] Started oFono Mobile telephony stack.
[  OK  ] Started Load/Save RF Kill Switch Status.
[  OK  ] Started Login Service.
[  OK  ] Started Bluetooth service.
[  OK  ] Started System Logging Service.
[  OK  ] Started LSB: Start busybox udhcpd at boot time.
[  OK  ] Started Connection service.
[  OK  ] Started Generic Board Startup.
[  OK  ] Started WPA supplicant.
[  OK  ] Reached target Network.
         Starting Permit User Sessions...
         Starting OpenBSD Secure Shell server...
         Starting A high performance web server and a reverse proxy server...
         Starting Hostname Service...
[  OK  ] Reached target Bluetooth.
[  OK  ] Started Permit User Sessions.
[  OK  ] Started LSB: Load kernel modules needed to enable cpufreq scaling.
         Starting LSB: set CPUFreq kernel parameters...
         Starting Set console scheme...
[  OK  ] Started Serial Getty on ttyPS0.
[  OK  ] Started LSB: set CPUFreq kernel parameters.
[  OK  ] Started Hostname Service.
[  OK  ] Started Set console scheme.
[  OK  ] Created slice system-getty.slice.
[  OK  ] Started Getty on tty1.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started OpenBSD Secure Shell server.
[  OK  ] Started A high performance web server and a reverse proxy server.
[  OK  ] Started Dispatcher daemon for systemd-networkd.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Started Update UTMP about System Runlevel Changes.

Ubuntu 18.04.2 LTS arm ttyPS0

default username:password is [ubuntu:temppwd]

arm login: ubuntu
Password: 
Last login: Sun Jan 28 15:59:20 UTC 2018 on ttyPS0
ubuntu@arm:~$ 


”Docker 上のUbuntu 16.04 のPetaLinux 2018.2でuioとudmabufの動作をテストする(DMA_pow2_testを使用)”にudmabufを追加する”の続き。

PetaLinux 2018.2 のプロジェクトを作成して、ビルドを行い、BOOT.BIN の作成したものに、PL のIP(DMA_pow2)のUIO を追加し、さらに udmabuf.ko をビルドした。今回は、DMApow2Test2.c を作成し、ビルドして、Ultra96 のPetaLinux 上でテストする。

DMA_pow2_test2.c は”Ultra96 ボードでデバイスツリー・オーバーレイをテストする5”に記述されている。それをほとんどまるごと使用するのだが、PetaLinux のアプリケーションでは、アンダーバーを使用することができないためDMApow2Test2.c とした。それに、udmabuf4 を udmabuf0 に変更した。別に udmabuf4 でも問題ないが、前のブログ記事で udmabuf0 を使用したので、変更を行った。

Ultra96 のPetaLinux2018.2 でhelloworld アプリケーションを作る(ただし、rootfs を使用)”を参考にした。

DMApow2Test2 カスタム・アプリケーションを追加する。
petalinux-create -t apps --template c --name DMApow2Test2 --enable
1ca87368.png


DMA_pow2_test/project-spec/meta-user/recipes-apps/DMApow2Test2 ディレクトリが作成されて、その下の files ディレクトリの下に DMApow2Test2.c ができた。
d3e1347e.png


DMApow2Test2.c をダブルクリックして起動し、”Ultra96 ボードでデバイスツリー・オーバーレイをテストする5”に記述されているDMA_pow2_test2.c を DMApow2Test2.c に変更して、記述をコピー・アンド・ペーストした。
a9603d38.png


DMApow2Test2.c を示す。

// DMApow2Test2.c
// 2019/04/28 by marsee
//

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>

int main(){
    volatile unsigned int *udmabuf0_buf;
    int udmabuf0_fd, fd_phys_addr;
    char  attr[1024];
    unsigned long  phys_addr;
    int fd1;
    volatile unsigned int *dma_pow2;
    int i;
    
    // udmabuf0
    udmabuf0_fd = open("/dev/udmabuf0", O_RDWR); // frame_buffer, The chache is enabled. 
    if (udmabuf0_fd == -1){
        fprintf(stderr, "/dev/udmabuf0 open error\n");
        exit(-1);
    }
    udmabuf0_buf = (volatile unsigned int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, udmabuf0_fd, 0);
    if (!udmabuf0_buf){
        fprintf(stderr, "udmabuf0_buf mmap error\n");
        exit(-1);
    }

    // phys_addr of udmabuf0
    fd_phys_addr = open("/sys/class/udmabuf/udmabuf0/phys_addr", O_RDONLY);
    if (fd_phys_addr == -1){
        fprintf(stderr, "/sys/class/udmabuf/udmabuf0/phys_addr open error\n");
        exit(-1);
    }
    read(fd_phys_addr, attr, 1024);
    sscanf(attr, "%lx", &phys_addr);  
    close(fd_phys_addr);
    printf("phys_addr = %x\n", (int)phys_addr);

    // data set
    for(i=0; i<20; i++){
        udmabuf0_buf[i] = i;
    }

    // uio initialize (uio1)
    fd1 = open("/dev/uio1", O_RDWR|O_SYNC); // dma_pow2 IP
    if (fd1 < 1){
        fprintf(stderr, "/dev/uio1 (dma_pow2) open error\n");
        exit(1);
    }
    dma_pow2 = (volatile unsigned *)mmap(NULL, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, fd1, 0);
    if (!dma_pow2){
        fprintf(stderr, "dma_pow2 mmap error\n");
        exit(1);
    }
    printf("Address of int size is %d\n", sizeof(int *));
    
    dma_pow2[6] = phys_addr; // Data signal of in_r
    dma_pow2[8] = phys_addr+10*sizeof(int); // Data signal of out_r
    
    dma_pow2[0] = 1; // ap_start
    
    while (!(dma_pow2[0] & 0x2)) ; // ap_done ?
    
    for(i=0; i<10; i++){
        printf("data[%d] = %d, result[%d] = %d\n", i, udmabuf0_buf[i], i, udmabuf0_buf[10+i]);
    }
    
    munmap((void *)dma_pow2, 0x10000);
    close(fd1);
    munmap((void *)udmabuf0_buf, 0x1000);
    close(udmabuf0_fd);
    
    return(0);
}


rootfs をビルドする。
LANG=en_US.UTF-8 petalinux-build -c rootfs
c2196a3e.png


ビルドが成功した。
rootfs.tar.gz が更新されている。
411b485f.png


rootfs.tar.gz を表すると、/usr/bin/ ディレクトリの下に DMApow2Test2 が生成されていた。
8d676343.png


DMApow2Test2 をホストパソコンのホーム上にコピーした。
c2501cc5.png


MicroSD カードをホストパソコンにマウントして、rootfs の /home/root/ ディレクトリにDMApow2Test2 を書き込む。
sudo mv DMApow2Test2 /media/masaaki/rootfs/home/root/
sudo ls /media/masaaki/rootfs/home/root/

472e7786.png


MicroSD カードをUltra96 に入れて電源ON。
ログインしてから、まずは udmabuf をロードしてから、DMApow2Test2 を起動した。
433072f0.png


入力値が 2 乗倍されて出力されていたので正しい。成功だ。

次に、rootfs を構築するに時間がかかるため、それをしなくてもビルドできるように探ってみよう。
LANG=en_US.UTF-8 petalinux-build
したがエラーになってしまった。
4fd41240.png

ERROR: DMApow2Test2-1.0-r0 do_package_qa: QA Issue: /usr/bin/DMApow2Test2 contained in package DMApow2Test2 requires libc.so.6()(64bit), but no providers found in RDEPENDS_DMApow2Test2? [file-rdeps]
ERROR: DMApow2Test2-1.0-r0 do_package_qa: QA Issue: /usr/bin/DMApow2Test2 contained in package DMApow2Test2 requires libc.so.6(GLIBC_2.17)(64bit), but no providers found in RDEPENDS_DMApow2Test2? [file-rdeps]
ERROR: DMApow2Test2-1.0-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
ERROR: DMApow2Test2-1.0-r0 do_package_qa: Function failed: do_package_qa
ERROR: Logfile of failure stored in: /home/masaaki/PetaLProj/DMA_pow2_test/build/tmp/work/aarch64-xilinx-linux/DMApow2Test2/1.0-r0/temp/log.do_package_qa.31858
ERROR: Task (/home/masaaki/PetaLProj/DMA_pow2_test/project-spec/meta-user/recipes-apps/DMApow2Test2/DMApow2Test2.bb:do_package_qa) failed with exit code '1'


ZYBO (Zynq) 初心者ガイド (11) LinuxユーザアプリケーションでLチカ”によると2回めにビルドするとエラーが発生するとあるが、私のところでも同様にエラーになった。

ZYBO (Zynq) 初心者ガイド (11) LinuxユーザアプリケーションでLチカ”に従って、
LANG=en_US.UTF-8 petalinux-build -c DMApow2Test2 -x do_clean
2303d642.png


してから
LANG=en_US.UTF-8 petalinux-build -c DMApow2Test2 -x do_install
3e47a2ec.png


するとビルドに成功した。
DMA_pow2_test/build/tmp/work/aarch64-xilinx-linux/ ディレクトリに DMApow2Test2 が生成されていた。
228bfe0a.png

↑このページのトップヘ