2020年1月26日日曜日

ultra96v2_oobをカスタムする話その3_device-treeとu-bootをカスタムするためのメモ

u-bootとhw-dtbを修正する方法を調べるためにyoctoの機能を確認中。

u-bootの設定はpetalinuxで指定したダウンロードしたソースの中のdefconfigを使用している模様。petalinux-configのu-boot config targetで指定したものを使用しているのか。

targetのdefconfig(avnet_ultra96_rev1_defconfig)にパッチ当てればOKかな。

適当なフォルダにgit clone u-boot-xlnxを行い、avnet_ultra96_rev1_defconfigのCONFIG_SYS_TEXT_BASEを0x10080000に変更する。
その後、git add . && git commit -m "test"などとして登録し、git format-patch -o <path> -1とすることで<path>にパッチを得る。
これを<petalinux>/project-spec/meta-user/recipes-bsp/u-boot/files配下に保存し、u-boot-xlnx_%.bbappendのSRC_URI+="<patch_name>"を追加してビルドすると適用された。作成したパッチは以下の通り。

From 809983f8a42eb8cc94e1e5a1e107d40508b8a1de Mon Sep 17 00:00:00 2001
From: Akira Nishiyama <xxxx@xxxx.xxx>
Date: Mon, 27 Jan 2020 09:44:12 +0000
Subject: [PATCH] test

---
 configs/avnet_ultra96_rev1_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/avnet_ultra96_rev1_defconfig b/configs/avnet_ultra96_rev1_defconfig
index f6d583083b..ef6ff271d9 100644
--- a/configs/avnet_ultra96_rev1_defconfig
+++ b/configs/avnet_ultra96_rev1_defconfig
@@ -1,6 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ZYNQMP=y
-CONFIG_SYS_TEXT_BASE=0x8000000
+CONFIG_SYS_TEXT_BASE=0x10080000
 CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BASE=0xff010000
-- 
2.18.1 

次はhw-dtbの対応。

2020年1月25日土曜日

ultra96v2_oobをカスタムする話その2_petalinuxプロジェクトの作成(sstate_cacheとpre-mirror設定)

これの続きでpetalinuxの設定を行います。
時間短縮のためsstate_cacheとpre-mirrorもダウンロードして有効にします。

まずは以下のスクリプトを実行

## copy vivado 
cp ultra96v2_oob/vivado/ultra96v2_oob.xsa ultra96v2_oob/petalinux

cd ultra96v2_oob/petalinux
make refresh_hw XSA_DIR=../vivado

cd project-spec/configs
mv config config.bak
mv rootfs_config rootfs_config.bak

cat config.bak | sed -e 's/PSU_UART_0_/PSU_UART_1_/g' -e 's/# CONFIG_SUBSYSTEM_SERIAL_PSU_UART_1_SELECT is not set/# CONFIG_SUBSYSTEM_SERIAL_PSU_UART_0_SELECT is not set/g' -e 's/psu_uart_0/psu_uart_1/g' -e 's/cadence/cadence1/g' > config1.bak
cat config1.bak | sed -e 's/zcu102-rev1.0/avnet-ultra96-rev1/g' -e 's/xilinx_zynqmp_zcu102_rev1_0_defconfig/avnet_ultra96_rev1_defconfig/g' -e 's/xilinx-zcu102/ultra96v2-oob/g' -e 's/zcu102-zynqmp/ultra96-zynqmp/g' -e 's/CONFIG_SUBSYSTEM_PRIMARY_SD_PSU_SD_1_SELECT=y/CONFIG_SUBSYSTEM_PRIMARY_SD_PSU_SD_0_SELECT=y/g' -e 's/# CONFIG_SUBSYSTEM_PRIMARY_SD_PSU_SD_0_SELECT is not set/# CONFIG_SUBSYSTEM_PRIMARY_SD_PSU_SD_1_SELECT is not set/g' > config2.bak
cat config2.bak | sed -e 's/CONFIG_SUBSYSTEM_ROOTFS_INITRAMFS=y/# CONFIG_SUBSYSTEM_ROOTFS_INITRAMFS is not set/g' -e 's/# CONFIG_SUBSYSTEM_ROOTFS_EXT is not set/CONFIG_SUBSYSTEM_ROOTFS_EXT=y/g' -e 's/115200 clk_ignore_unused/115200 clk_ignore_unused root=\/dev\/mmcblk0p2 rw rootwait/g' | sed -e '182i CONFIG_SUBSYSTEM_SDROOT_DEV="/dev/mmcblk0p2"' > config3.bak
cat rootfs_config.bak | sed -e 's/# CONFIG_bc is not set/CONFIG_bc=y/g' -e 's/# CONFIG_i2c-tools is not set/CONFIG_i2c-tools=y/g' -e 's/# CONFIG_usbutils is not set/CONFIG_usbutils=y/g' -e 's/# CONFIG_ethtool is not set/CONFIG_ethtool=y/g' -e  's/# CONFIG_git is not set/CONFIG_git=y/g' > rootfs_config1.bak
cat rootfs_config1.bak | sed -e 's/# CONFIG_coreutils is not set/CONFIG_coreutils=y/g' -e 's/# CONFIG_openamp-fw-echo-testd is not set/CONFIG_openamp-fw-echo-testd=y/g' -e 's/# CONFIG_openamp-fw-mat-muld is not set/CONFIG_openamp-fw-mat-muld=y/g' -e 's/# CONFIG_openamp-fw-rpc-demo is not set/CONFIG_openamp-fw-rpc-demo=y/g' > rootfs_config2.bak
cat rootfs_config2.bak | sed -e 's/# CONFIG_packagegroup-petalinux is not set/CONFIG_packagegroup-petalinux=y/g' -e 's/# CONFIG_packagegroup-petalinux-benchmarks is not set/CONFIG_packagegroup-petalinux-benchmarks=y/g' -e 's/# CONFIG_packagegroup-petalinux-matchbox is not set/CONFIG_packagegroup-petalinux-matchbox=y/g' > rootfs_config3.bak
cat rootfs_config3.bak | sed -e 's/# CONFIG_packagegroup-petalinux-openamp is not set/CONFIG_packagegroup-petalinux-openamp=y/g' -e 's/# CONFIG_packagegroup-petalinux-self-hosted is not set/CONFIG_packagegroup-petalinux-self-hosted=y/g' -e 's/# CONFIG_packagegroup-petalinux-utils is not set/CONFIG_packagegroup-petalinux-utils=y/g' -e 's/# CONFIG_packagegroup-petalinux-v4lutils is not set/CONFIG_packagegroup-petalinux-v4lutils=y/g' -e 's/# CONFIG_packagegroup-petalinux-x11 is not set/CONFIG_packagegroup-petalinux-x11=y/g' -e 's/# CONFIG_imagefeature-package-management is not set/CONFIG_imagefeature-package-management=y/g' > rootfs_config4.bak
cat rootfs_config4.bak | sed -e '$a CONFIG_wilc=y' -e '$a CONFIG_libftdi=y' -e '$a CONFIG_bonniePLUSPLUS=y' -e '$a CONFIG_cmake=y' -e '$a CONFIG_iperf3=y' -e '$a CONFIG_iw=y' -e '$a CONFIG_lmsensors-sensorsdetect=y' -e '$a CONFIG_nano=y' -e '$a CONFIG_packagegroup-base-extended=y' -e '$a CONFIG_packagegroup-petalinux-96boards-sensors=y' -e '$a CONFIG_packagegroup-petalinux-ultra96-webapp=y' -e '$a CONFIG_python-pyserial=y' -e '$a CONFIG_python3-pip=y' -e '$a CONFIG_ultra96-ap-setup=y' -e '$a CONFIG_ultra96-misc=y' -e '$a CONFIG_wilc-firmware-wilc3000=y' -e '$a CONFIG_ultra96-radio-leds=y' -e '$a CONFIG_ultra96-wpa=y' -e '$a CONFIG_sds-lib=y' -e '$a CONFIG_wilc3000-fw=y'  -e '$a CONFIG_ultra96-startup-pages=y'  > rootfs_config5.bak
mv config3.bak config
mv rootfs_config5.bak rootfs_config

rm *.bak

cd ..

cd meta-user/recipes-bsp/device-tree/
cp ../../../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-bsp/device-tree/device-tree.bbappend .
cd files
cp -rf ../../../../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-bsp/device-tree/files/multi-arch .
cat system-user.dtsi | sed -e '1,25d' > system-user.dtsi.bak
cat ../../../../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-bsp/device-tree/files/system-user.dtsi system-user.dtsi.bak > system-user.dtsi
cat openamp.dtsi | sed -e '1,42d' > openamp.dtsi.bak
cat ../../../../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-bsp/device-tree/files/openamp.dtsi | sed -e '56,57d' > openamp.dtsi1.bak
cat openamp.dtsi1.bak openamp.dtsi.bak > openamp.dtsi
cp ../../../../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-bsp/device-tree/files/xen.dtsi .
cp ../../../../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-bsp/device-tree/files/zynqmp-qemu-arm.dts .
rm *.bak

cd ../../..

#meta-user copy
cp -rf ../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-core .
cp -rf ../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-graphics .
cp -rf ../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-modules .
mkdir recipes-utils 
cd recipes-utils 
cp -rf ../../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-utils/ultra96-radio-leds .
cp -rf ../../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-utils/ultra96-wpa .
cp -rf ../../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-utils/ultra96-ap-setup .
cd ..
cp -rf ../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-apps/sds-lib recipes-apps
cp -rf ../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-bsp/u-boot recipes-bsp
cp -rf ../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-bsp/pmu-firmware recipes-bsp
cp -rf ../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-bsp/ultra96-misc recipes-bsp
cp -rf ../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-bsp/wilc3000-fw recipes-bsp
cp -rf ../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-kernel .

cd conf
mv petalinuxbsp.conf petalinuxbsp.conf.bak
mv user-rootfsconfig user-rootfsconfig.bak 
mv ../../../../petalinux_oob/configs/meta-user/ultra96v2_oob/recipes-core/images/petalinux-image-full.bbappend petalinux-image-full.bbappend.bak
cat petalinuxbsp.conf.bak | sed -e '$a MACHINE_FEATURES_remove_ultra96-zynqmp = "mipi"' -e '$a DISTRO_FEATURES_append = " bluez5 dbus"' -e '$a PREFERRED_VERSION_wilc-firmware = "15.2" ' > petalinuxbsp.conf
cat petalinux-image-full.bbappend.bak | sed -e '3,4d' | sed -e '/#/d' | sed -e "/^[<space><tab>]*$/d" | sed -e 's/IMAGE_INSTALL_append = " /CONFIG_/g' -e 's/"//g' > user-rootfsconfig1.bak
cat user-rootfsconfig.bak user-rootfsconfig1.bak | sed  -e '$a CONFIG_ultra96-startup-pages'  > user-rootfsconfig
rm *.bak
cd ..

cd recipes-kernel/linux

mv linux-xlnx_%.bbappend linux-xlnx_%.bbappend.bak
cat  linux-xlnx_%.bbappend.bak | sed -e '3iSRC_URI += "file://user.cfg"' > linux-xlnx_%.bbappend
rm *.bak

cd ../../../..

petaliunux-configをして以下の通り設定。






 
 






make all XSA_DIR=../vivado PLATFORM=ultra96v2_oob && make sysrootすればとりあえずイメージの作成はできる状態になる。
実行時間は以下の通りだった。
設定前よりは早くなっているのだろうけど、比較データは取っていない。

petalinux
real    79m48.831s
user    1m59.516s
sys    0m16.439s

SYSROOT
real    179m14.348s
user    5m53.202s
sys    0m53.305s

スペックは
Intel® Core™ i7-6600U CPU @ 2.60GHz × 4,
メモリ 16G,
SSD 512G



次はu-bootのbbappend方法とdevice-treeのbbappend方法について調べる。

参考ページ
https://qiita.com/basaro_k/items/066edec6139bcb9d53e5

2020年1月24日金曜日

ultra96v2_oobをカスタムする話その1_vivadoプロジェクトの作成

こちらの内容を自分用にカスタムしたメモ。
以下のスクリプトを実行し、oobのプロジェクトを得ます。
GEM3を有効にするスクリプトを追加しています。

#!/bin/bash
mkdir ultra96v2_oob
cd ultra96v2_oob

git clone -b 2019.2 https://github.com/Xilinx/Vitis_Embedded_Platform_Source.git
cp -rf ./Vitis_Embedded_Platform_Source/Xilinx_Official_Platforms/zcu102_base/* .
mkdir hdl
mkdir petalinux_oob
mkdir bdf
mkdir download
cd download
#download Git
git clone -b 2019.1 https://github.com/Avnet/petalinux.git
git clone -b 2019.1 https://github.com/Avnet/hdl.git
#git clone  https://github.com/Avnet/bdf.git
#make work directory
mkdir ../hdl/Boards
mkdir ../hdl/IP
mkdir ../hdl/Projects
mkdir ../hdl/Scripts
mkdir ../hdl/Scripts/ProjectScripts
mkdir ../petalinux_oob/scripts
mkdir ../petalinux_oob/configs
mkdir ../petalinux_oob/configs/device-tree
mkdir ../petalinux_oob/configs/kernel
mkdir ../petalinux_oob/configs/meta-user
mkdir ../petalinux_oob/configs/project
mkdir ../petalinux_oob/configs/rootfs
mkdir ../petalinux_oob/configs/u-boot

#copu firles
cp -rf hdl/Boards/ULTRA96V2 ../hdl/Boards
cp -rf hdl/IP/PWM_w_Int ../hdl/IP
cp -rf hdl/Projects/ultra96v2_oob ../hdl/Projects
cp hdl/Scripts/make_ultra96v2_oob.tcl ../hdl/Scripts
cp hdl/Scripts/make.tcl ../hdl/Scripts
cp hdl/Scripts/bin_helper.tcl ../hdl/Scripts
cp hdl/Scripts/ProjectScripts/ultra96v2_oob.tcl ../hdl/Scripts/ProjectScripts
cp hdl/Scripts/tag.tcl ../hdl/Scripts

cp petalinux/scripts/make_ultra96v2_oob_bsp.sh ../petalinux_oob/scripts
cp petalinux/configs/device-tree/system-user.dtsi.ULTRA96V2 ../petalinux_oob/configs/device-tree
cp petalinux/configs/kernel/user.cfg.ULTRA96V2 ../petalinux_oob/configs/kernel
cp -rf petalinux/configs/meta-user/ultra96v2_oob ../petalinux_oob/configs/meta-user
cp petalinux/configs/project/config.ultra96v2_oob.patch ../petalinux_oob/configs/project
cp petalinux/configs/project/config.sd_ext4_boot.patch ../petalinux_oob/configs/project
cp petalinux/configs/rootfs/config.ultra96v2_oob ../petalinux_oob/configs/rootfs
cp petalinux/configs/u-boot/platform-top.h.ultra96v2_sd_boot ../petalinux_oob/configs/u-boot
cp petalinux/configs/u-boot/bsp.cfg ../petalinux_oob/configs/u-boot

cd ..

#change vivado 
cd vivado
mv zcu102_base_xsa.tcl ultra96v2_oob_xsa.tcl.bak

cat ultra96v2_oob_xsa.tcl.bak | sed -e 's/zcu102_base/ultra96v2_oob/g' -e 's/zcu102/ultra96/g' > ultra96v2_oob_xsa.tcl1.bak
cat ultra96v2_oob_xsa.tcl1.bak | sed -e '43i   source ../hdl/Boards/ULTRA96V2/ultra96v2_oob.tcl -notrace' | sed -e '44i avnet_create_project ultra96v2_oob ultra96v2_oob Project' | sed -e '45i set_property board_part em.avnet.com:ultra96v2:part0:1.0 [current_project]' | sed -e '47,51d' > ultra96v2_oob_xsa.tcl2.bak
cat ultra96v2_oob_xsa.tcl2.bak | sed -e '47i set_property ip_repo_paths  ../hdl/IP [current_fileset]' | sed -e '48i update_ip_catalog' | sed -e '388,1890d' | sed -e '388i  avnet_add_ps_preset ultra96v2_oob ultra96v2_oob ultra96v2_oob' |  sed -e '389i set_property name ps_e [get_bd_cells zynq_ultra_ps_e_0]' |  sed -e '431i avnet_add_user_io_preset ultra96v2_oob ultra96v2_oob ultra96v2_oob' > ultra96v2_oob_xsa.tcl3.bak
cat ultra96v2_oob_xsa.tcl3.bak | sed -e '439s/set i 1/set i 10/g' | sed -e '469i add_files -fileset constrs_1 -norecurse ../hdl/Projects/ultra96v2_oob/ultra96v2_oob.xdc'| sed -e '470i import_files -fileset constrs_1 ../hdl/Projects/ultra96v2_oob/ultra96v2_oob.xdc' > ultra96v2_oob_xsa.tcl4.bak

cat ultra96v2_oob_xsa.tcl4.bak | sed -e 's/-jobs 16/-jobs 6/g' > ultra96v2_oob_xsa.tcl5.bak
cat ultra96v2_oob_xsa.tcl5.bak | sed -e '390i set_property -dict [list CONFIG.PSU__ENET3__PERIPHERAL__ENABLE {1} CONFIG.PSU__ENET3__PERIPHERAL__IO {EMIO} CONFIG.PSU__ENET3__GRP_MDIO__ENABLE {1} CONFIG.PSU__ENET3__GRP_MDIO__IO {EMIO}] [get_bd_cells ps_e]' > ultra96v2_oob_xsa.tcl

rm *.bak

#Chang directory for script
cd ..
cd hdl/Boards/ULTRA96V2
mv ultra96v2_oob.tcl ultra96v2_oob.tcl.bak
cat ultra96v2_oob.tcl.bak | sed -e '68,71d' | sed -e '442,444d' | sed -e '479i startgroup' | sed  -e '480i set_property -dict [list CONFIG.PSU__USE__M_AXI_GP1 {0}] [get_bd_cells zynq_ultra_ps_e_0]' | sed   -e '481i set_property -dict [list CONFIG.PSU__USE__M_AXI_GP2 {1}] [get_bd_cells zynq_ultra_ps_e_0]' | sed -e '482i set_property -dict [list CONFIG.PSU__USE__S_AXI_GP5 {1}] [get_bd_cells zynq_ultra_ps_e_0]' | sed -e  '483i endgroup' > ultra96v2_oob.tcl1.bak
cat ultra96v2_oob.tcl1.bak | sed -e  '462,464d' | sed -e '61,77d' | sed -e '61i delete_bd_objs [get_bd_nets axi_intc_0_irq]' | sed -e '62i startgroup' | sed -e '63i create_bd_cell -type ip -vlnv xilinx.com:ip:xlconcat:2.1 xlconcat_0' | sed -e '64i endgroup' | sed -e '65i set_property -dict [list CONFIG.NUM_PORTS {1}] [get_bd_cells xlconcat_0]' | sed -e '66i connect_bd_net [get_bd_pins xlconcat_0/dout] [get_bd_pins ps_e/pl_ps_irq0]' | sed -e '67i connect_bd_net [get_bd_pins axi_intc_0/irq] [get_bd_pins xlconcat_0/In0]' > ultra96v2_oob.tcl2.bak
cat ultra96v2_oob.tcl2.bak | sed -e  's/zynq_ultra_ps_e_0\/pl_clk0 (100 MHz)/clk_wiz_0\/clk_out3 (75 MHz)/g' -e  's/zynq_ultra_ps_e_0\/M_AXI_HPM0_FPD/ps_e\/M_AXI_HPM0_LPD/g' -e 's/ps8_0_axi_periph/interconnect_axilite/g' > ultra96v2_oob.tcl3.bak
cat ultra96v2_oob.tcl3.bak | sed -e '243,249d' | sed -e '244d' | sed -e 's/CONFIG.NUM_PORTS {5}/CONFIG.NUM_PORTS {6}/g' -e 's/xlconcat_0\/In4/xlconcat_0\/In5/g' -e 's/xlconcat_0\/In3/xlconcat_0\/In4/g' -e 's/xlconcat_0\/In2/xlconcat_0\/In3/g' -e 's/xlconcat_0\/In1/xlconcat_0\/In2/g' -e '240,250s/xlconcat_0\/In0/xlconcat_0\/In1/g' | sed -e '243,424s/zynq_ultra_ps_e_0/ps_e/g' > ultra96v2_oob.tcl4.bak
mv ultra96v2_oob.tcl4.bak ultra96v2_oob.tcl
rm *.bak

cd ../../../..

cd ultra96v2_oob/vivado
make PLATFORM=ultra96v2_oob
cd ../..


2020年1月19日日曜日

Vitis 2019.2でUltra96v2_oobを使ったAcceleration PlatformのEmulation-SW(QEMU)を動かすまでのメモ


このページに記載の方法で環境は作成可能。Makeで動く環境なのが地味にありがたい。

2020/1/18時点ではu-bootのCONFIG_SYS_TEXT_BASEをCONFIG_SUBSYSTEM_PRELOADED_BL33_BASEと同じ0x10080000に設定し直す必要がある。petalinuxフォルダでpetalinux -c u-bootで/SYS_TEXTを探して0x8000000を0x10080000とすればOK。fix_u96v2_pwrseq_simple.patchが足りないと怒られたのでproject-spec/meta-user/recipes-kernel/linux-xlnx/に置いておいた。

また、project-spec/meta-user/recipes-kernel/linux-xlnx_%.bbappendからSRC_URI += "file://user.cfg"をコメントアウトしないとうまく動作しないよう。理由は不明。
あとはpetalinux-buildとpetalinux-build --sdk, petalinux-package --sysroot -d {SYSROOT}を実行してsysrootを得る。

Emulation-SWのLaunch on EmulatorはどうもLaunch_Emulator.tclを アプリケーションフォルダ配下のEmulation-SWで実行しているみたい。

 <Platform_PATH>/wksp1/vecadd/Emulation-SW
オプションはIDEからは
-device-family ultrascale -pid-file emulation.pid -t sw_emu -no-reboot -forward-port 1440 1534 -runtime ocl
 なので、フォルダに移動してコマンド実行すれば良さそう。

 SDブートの場合は自分でSDイメージ作成して-sd-card-imageオプションでパスを指定すれば大丈夫そう。
=>IDEで動作させるためにLaunch_Emulator.tclを変更させる。いかなるオプションでもQEMUの起動パラメータとしてSDイメージ指定をしないようにし、qemu_args.txtで必要データ含んだドライブを指定する。SD0はLinux動作時に認識しないので苦肉の策としてSD0とSD1に同じsdイメージを指定することで回避する。

用意するSDイメージはvecadd/Emulation-SW/_vimage/emulation/sd_cardにデータを集めてまとめてイメージ化しているので、これと同じ手順でデータ生成すれば大丈夫だろう。

保存しているのは
  • bootフォルダのデータ
  • vecadd/Emulation-SW/binary_container_1.xclbin
  • platform/boot/generic.readme
  • <Platform_PATH>/wksp1/vecadd/Emulation-SW/_vimage/emulation/init.sh
  • <VITIS_PATH>/data/emulation/unified => sd_card/data/emulation/unified
なので以下のようにSDイメージを作成し、これを指定する。
p1:
  上記データ
p2:
 SYSROOTフォルダ


上記状態で動かしてもVitisからEmulation-SWを実行するとTCF Agentを待ち続けてしまうのでやはりGEMのリンクは必要そうなので追加して試す。

2020/1/20追記
単純にGEM3をVivadoでイネーブルにしても動作しなかった。問題はhw-dtbで指定しているzynqmp-qemu-multiarch-arm.dtbがzcu100ベースとなっており、PHYが存在しない環境がQEMUで構築されていたことであった。とりあえずzcu102に揃える形でgem3のmdioに対して未使用のphandle値を当てて、mdioも宣言し、compatibleに"cdns,gem"を指定したdtsをdtcでdtbに生成しなおしたものを動かすようにしたら問題は解消した。
ただ、petalinux的にはどうやって設定するのが正解かは未調査。

確証は持てないけど動かすだけならzcu102ベースのzynqmp-qemu-multiarch-arm.dtbを持ってきても大丈夫と思う。

ここまでくればEmulation-SWも行けるはず。
=>2020/1/21動作確認。




とりあえずpetlainux-boot --qemuの起動ログ

$ petalinux-boot --qemu --u-boot --qemu-args "-drive file=myfile/sd.img,if=sd,id=sd0,index=0,format=raw -drive file=myfile/sd.img,if=sd,id=sd1,index=1,format=raw"
INFO: sourcing build tools
INFO: Starting microblaze QEMU
INFO: Starting the above QEMU command in the background
INFO:  qemu-system-microblazeel -M microblaze-fdt   -serial mon:stdio -serial /dev/null -display none -kernel ultra96v2_oob/petalinux/pre-built/linux/images/pmu_rom_qemu_sha3.elf -device loader,file=ultra96v2_oob/petalinux/images/linux/pmufw.elf      -hw-dtb ultra96v2_oob/petalinux/images/linux/zynqmp-qemu-multiarch-pmu.dtb -machine-path /tmp/tmp.4F0B7WFsvD -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 
qemu-system-microblazeel: Failed to connect socket /tmp/tmp.4F0B7WFsvD/qemu-rport-_pmu@0: No such file or directory
qemu-system-microblazeel: info: QEMU waiting for connection on: disconnected:unix:/tmp/tmp.4F0B7WFsvD/qemu-rport-_pmu@0,server
INFO: Set QEMU tftp to ultra96v2_oob/petalinux/images/linux 
INFO: TCP PORT is free 
INFO: Starting aarch64 QEMU
INFO:  qemu-system-aarch64 -M arm-generic-fdt   -serial /dev/null -serial mon:stdio -serial /dev/null -serial /dev/null -display none -device loader,file=ultra96v2_oob/petalinux/images/linux/bl31.elf,cpu-num=0 -device loader,file=ultra96v2_oob/petalinux/images/linux/u-boot.elf -gdb tcp::9000 -dtb ultra96v2_oob/petalinux/images/linux/system.dtb  -net nic -net nic -net nic -net nic,netdev=eth0 -netdev user,id=eth0,tftp=ultra96v2_oob/petalinux/images/linux   -hw-dtb ultra96v2_oob/petalinux/images/linux/zynqmp-qemu-multiarch-arm.dtb -machine-path /tmp/tmp.4F0B7WFsvD -global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true -drive file=myfile/sd.img,if=sd,id=sd0,index=0,format=raw -drive file=myfile/sd.img,if=sd,id=sd1,index=1,format=raw   -m 4G
QEMU 2.11.1 monitor - type 'help' for more information
(qemu) audio: Could not init `oss' audio driver
qemu-system-aarch64: warning: vlan 0 is not connected to host network
PMU Firmware 2019.2 Jan 20 2020   11:13:58
PMU_ROM Version: xpbr-v8.1.0-0
NOTICE:  ATF running on XCZUUNKN/QEMU v4/RTL0.0 at 0xfffea000
NOTICE:  BL31: Secure code at 0x60000000
NOTICE:  BL31: Non secure code at 0x10080000
NOTICE:  BL31: v2.0(release):xilinx-v2019.1-12-g713dace9
NOTICE:  BL31: Built : 10:58:47, Jan 20 2020
PMUFW: v1.1


U-Boot 2019.01 (Jan 20 2020 - 11:21:44 +0000)

Model: Avnet Ultra96 Rev1
Board: Xilinx ZynqMP
DRAM:  2 GiB
EL Level: EL2
Chip ID: unknown
MMC:   mmc@ff160000: 0, mmc@ff170000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial@ff010000
Out:   serial@ff010000
Err:   serial@ff010000
Model: Avnet Ultra96 Rev1
Board: Xilinx ZynqMP
Bootmode: JTAG_MODE
Reset reason: 
Net:   ZYNQ GEM: ff0e0000, phyaddr ffffffff, interface gmii
eth0: ethernet@ff0e0000
U-BOOT for ultra96v2-oob-2019_2

BOOTP broadcast 1
DHCP client bound to address 10.0.2.15 (2 ms)
Hit any key to stop autoboot:  0 
Device: mmc@ff160000
Manufacturer ID: aa
OEM: 5859
Name: QEMU! 
Bus Speed: 17361111
Mode : SD Legacy
Rd Block Len: 512
SD version 2.0
High Capacity: Yes
Capacity: 19.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
18479944 bytes read in 2672 ms (6.6 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:  uncompressed
     Data Start:   0x10000108
     Data Size:    18424320 Bytes = 17.6 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x00080000
     Entry Point:  0x00080000
     Hash algo:    sha1
     Hash value:   e38e956d66b739899c5385223172ae6b647eeffa
   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:   0x1119240c
     Data Size:    53701 Bytes = 52.4 KiB
     Architecture: AArch64
     Hash algo:    sha1
     Hash value:   872c49f826ce2a62b8241f52877c5b0c9cb06e00
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x1119240c
   Loading Kernel Image ... OK
   Loading Device Tree to 0000000007fef000, end 0000000007fff1c4 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 4.19.0-xilinx-v2019.2 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Mon Jan 20 09:32:29 UTC 2020
[    0.000000] Machine model: Avnet Ultra96 Rev1
[    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: Failed to reserve 1024 MiB
[    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] psci: SMC Calling Convention v1.1
[    0.000000] random: get_random_bytes called from start_kernel+0x94/0x3f8 with crng_init=0
[    0.000000] percpu: Embedded 22 pages/cpu @(____ptrval____) s52568 r8192 d29352 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: enabling workaround for ARM erratum 843419
[    0.000000] CPU features: enabling workaround for ARM erratum 845719
[    0.000000] Speculative Store Bypass Disable mitigation not required
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 512771
[    0.000000] Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait
[    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: 2027488K/2079744K available (10940K kernel code, 648K rwdata, 5504K rodata, 832K init, 514K bss, 52256K reserved, 0K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:  RCU event tracing is enabled.
[    0.000000] rcu:  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] irq-xilinx: mismatch in kind-of-intr param
[    0.000000] irq-xilinx: /amba_pl@0/interrupt-controller@80020000: num_irq=32, edge=0xffffffff
[    0.000000] arch_timer: cp15 timer(s) running at 65.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xefdb196da, max_idle_ns: 440795204367 ns
[    0.000160] sched_clock: 56 bits at 65MHz, resolution 15ns, wraps every 2199023255550ns
[    0.012522] Console: colour dummy device 80x25
[    0.014510] Calibrating delay loop (skipped), value calculated using timer frequency.. 130.00 BogoMIPS (lpj=260000)
[    0.016017] pid_max: default: 32768 minimum: 301
[    0.019764] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.020658] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes)
[    0.060145] ASID allocator initialised with 32768 entries
[    0.061385] rcu: Hierarchical SRCU implementation.
[    0.066015] EFI services will not be available.
[    0.069869] smp: Bringing up secondary CPUs ...
[    0.090527] Detected VIPT I-cache on CPU1
[    0.092424] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.118918] Detected VIPT I-cache on CPU2
[    0.119615] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.137869] Detected VIPT I-cache on CPU3
[    0.138645] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.139476] smp: Brought up 1 node, 4 CPUs
[    0.142027] SMP: Total of 4 processors activated.
[    0.142381] CPU features: detected: 32-bit EL0 Support
[    0.144805] CPU: All CPU(s) started at EL2
[    0.145635] alternatives: patching kernel code
[    0.176375] devtmpfs: initialized
[    0.248171] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.249103] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.258864] xor: measuring software checksum speed
[    0.305128]    8regs     :   966.000 MB/sec
[    0.348877]    8regs_prefetch:   958.000 MB/sec
[    0.390437]    32regs    :  1780.000 MB/sec
[    0.435454]    32regs_prefetch:  1091.000 MB/sec
[    0.436351] xor: using function: 32regs (1780.000 MB/sec)
[    0.438793] pinctrl core: initialized pinctrl subsystem
[    0.479206] NET: Registered protocol family 16
[    0.485836] audit: initializing netlink subsys (disabled)
[    0.495064] audit: type=2000 audit(0.412:1): state=initialized audit_enabled=0 res=1
[    0.516784] vdso: 2 pages (1 code @ (____ptrval____), 1 data @ (____ptrval____))
[    0.518968] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.524196] DMA: preallocated 256 KiB pool for atomic allocations
[    0.743423] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.826257] raid6: int64x1  gen()   469 MB/s
[    0.898181] raid6: int64x1  xor()   292 MB/s
[    0.971025] raid6: int64x2  gen()   642 MB/s
[    1.042454] raid6: int64x2  xor()   114 MB/s
[    1.119571] raid6: int64x4  gen()   723 MB/s
[    1.193526] raid6: int64x4  xor()   204 MB/s
[    1.269566] raid6: int64x8  gen()   590 MB/s
[    1.342334] raid6: int64x8  xor()   343 MB/s
[    1.413133] raid6: neonx1   gen()   116 MB/s
[    1.485865] raid6: neonx1   xor()   188 MB/s
[    1.563355] raid6: neonx2   gen()   422 MB/s
[    1.635816] raid6: neonx2   xor()   206 MB/s
[    1.708376] raid6: neonx4   gen()   374 MB/s
[    1.779532] raid6: neonx4   xor()   186 MB/s
[    1.853871] raid6: neonx8   gen()   389 MB/s
[    1.928653] raid6: neonx8   xor()   189 MB/s
[    1.929205] raid6: using algorithm int64x4 gen() 723 MB/s
[    1.930098] raid6: .... xor() 204 MB/s, rmw enabled
[    1.933420] raid6: using neon recovery algorithm
[    1.951234] GPIO IRQ not connected
[    1.951618] XGpio: gpio@80040000: registered, base is 510
[    1.952273] GPIO IRQ not connected
[    1.956832] XGpio: gpio@80040000: dual channel registered, base is 508
[    1.964512] GPIO IRQ not connected
[    1.965506] XGpio: gpio@80050000: registered, base is 507
[    1.970925] GPIO IRQ not connected
[    1.971526] XGpio: gpio@80060000: registered, base is 506
[    1.973478] GPIO IRQ not connected
[    1.978371] XGpio: gpio@80060000: dual channel registered, base is 505
[    1.997461] SCSI subsystem initialized
[    2.004613] usbcore: registered new interface driver usbfs
[    2.005689] usbcore: registered new interface driver hub
[    2.006830] usbcore: registered new device driver usb
[    2.008732] media: Linux media interface: v0.10
[    2.009452] videodev: Linux video capture interface: v2.00
[    2.010186] pps_core: LinuxPPS API ver. 1 registered
[    2.010614] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti 
[    2.011462] PTP clock support registered
[    2.012380] EDAC MC: Ver: 3.0.0
[    2.043657] zynqmp-ipi-mbox mailbox@ff990400: Probed ZynqMP IPI Mailbox driver.
[    2.049020] zynqmp-ipi-mbox mailbox@ff90000: Probed ZynqMP IPI Mailbox driver.
[    2.051587] FPGA manager framework
[    2.056578] Advanced Linux Sound Architecture Driver Initialized.
[    2.076398] Bluetooth: Core ver 2.22
[    2.077867] NET: Registered protocol family 31
[    2.079104] Bluetooth: HCI device and connection manager initialized
[    2.080118] Bluetooth: HCI socket layer initialized
[    2.080719] Bluetooth: L2CAP socket layer initialized
[    2.082179] Bluetooth: SCO socket layer initialized
[    2.098302] clocksource: Switched to clocksource arch_sys_counter
[    2.102887] VFS: Disk quotas dquot_6.6.0
[    2.103494] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    2.218820] NET: Registered protocol family 2
[    2.238589] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes)
[    2.239343] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    2.240297] TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
[    2.241852] TCP: Hash tables configured (established 16384 bind 16384)
[    2.253231] UDP hash table entries: 1024 (order: 3, 32768 bytes)
[    2.254789] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes)
[    2.259226] NET: Registered protocol family 1
[    2.273234] RPC: Registered named UNIX socket transport module.
[    2.273785] RPC: Registered udp transport module.
[    2.275159] RPC: Registered tcp transport module.
[    2.275625] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    2.299630] hw perfevents: no interrupt-affinity property for /pmu, guessing.
[    2.309761] hw perfevents: enabled with armv8_pmuv3 PMU driver, 1 counters available
[    2.328005] Initialise system trusted keyrings
[    2.331848] workingset: timestamp_bits=62 max_order=19 bucket_order=0
[    2.356452] NFS: Registering the id_resolver key type
[    2.358874] Key type id_resolver registered
[    2.359253] Key type id_legacy registered
[    2.359848] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    2.360897] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    4.512499] NET: Registered protocol family 38
[    4.720662] Key type asymmetric registered
[    4.721582] Asymmetric key parser 'x509' registered
[    4.722828] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    4.723896] io scheduler noop registered
[    4.724351] io scheduler deadline registered
[    4.724957] io scheduler cfq registered (default)
[    4.725360] io scheduler mq-deadline registered
[    4.725688] io scheduler kyber registered
[    5.230445] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    5.274800] 80010000.serial: ttyS3 at MMIO 0x80011000 (irq = 83, base_baud = 4687500) is a 16550A
[    5.285577] 80030000.serial: ttyS1 at MMIO 0x80031000 (irq = 84, base_baud = 4687500) is a 16550A
[    5.446398] brd: module loaded
[    5.511289] loop: module loaded
[    5.528049] mtdoops: mtd device (mtddev=name/number) must be supplied
[    5.554819] libphy: Fixed MDIO Bus: probed
[    5.576585] tun: Universal TUN/TAP device driver, 1.6
[    5.587569] CAN device driver interface
[    5.604589] usbcore: registered new interface driver asix
[    5.608543] usbcore: registered new interface driver ax88179_178a
[    5.609977] usbcore: registered new interface driver cdc_ether
[    5.612734] usbcore: registered new interface driver net1080
[    5.613611] usbcore: registered new interface driver cdc_subset
[    5.614978] usbcore: registered new interface driver zaurus
[    5.615918] usbcore: registered new interface driver cdc_ncm
[    5.626498] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.627103] ehci-pci: EHCI PCI platform driver
[    5.636288] usbcore: registered new interface driver uas
[    5.638220] usbcore: registered new interface driver usb-storage
[    5.647258] gadgetfs: USB Gadget filesystem, version 24 Aug 2004
[    5.666398] rtc_zynqmp ffa60000.rtc: rtc core: registered ffa60000.rtc as rtc0
[    5.668411] i2c /dev entries driver
[    5.712266] usbcore: registered new interface driver uvcvideo
[    5.712817] USB Video Class driver (1.1.1)
[    5.730988] Bluetooth: HCI UART driver ver 2.3
[    5.731573] Bluetooth: HCI UART protocol H4 registered
[    5.732121] Bluetooth: HCI UART protocol BCSP registered
[    5.733052] Bluetooth: HCI UART protocol LL registered
[    5.733466] Bluetooth: HCI UART protocol ATH3K registered
[    5.735794] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    5.737357] Bluetooth: HCI UART protocol Intel registered
[    5.738894] Bluetooth: HCI UART protocol QCA registered
[    5.740315] usbcore: registered new interface driver bcm203x
[    5.741308] usbcore: registered new interface driver bpa10x
[    5.742658] usbcore: registered new interface driver bfusb
[    5.743494] usbcore: registered new interface driver btusb
[    5.745436] Bluetooth: Generic Bluetooth SDIO driver ver 0.1
[    5.746868] usbcore: registered new interface driver ath3k
[    5.749608] EDAC MC: ECC not enabled
[    5.757597] EDAC DEVICE0: Giving out device to module edac controller cache_err: DEV edac (POLLED)
[    5.762859] EDAC ZynqMP-OCM: ECC not enabled - Disabling EDAC driver
[    5.765185] pwrseq_simple sdio_pwrseq: mmc failed to get default resetn GPIO
[    5.766244] pwrseq_simple sdio_pwrseq: mmc failed to get default chip_en GPIO
[    5.771930] sdhci: Secure Digital Host Controller Interface driver
[    5.773029] sdhci: Copyright(c) Pierre Ossman
[    5.773500] sdhci-pltfm: SDHCI platform and OF driver helper
[    5.783943] ledtrig-cpu: registered to indicate activity on CPUs
[    5.787615] zynqmp_firmware_probe Platform Management API v1.1
[    5.788581] zynqmp_firmware_probe Trustzone version v1.0
[    5.881087] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: zynqmp pinctrl initialized
[    6.452641] zynqmp_clk_mux_get_parent() getparent failed for clock: lpd_wdt, ret = -22
[    6.460304] alg: No test for xilinx-zynqmp-aes (zynqmp-aes)
[    6.461005] zynqmp_aes zynqmp_aes: AES Successfully Registered
[    6.461005] 
[    6.464803] alg: No test for xilinx-keccak-384 (zynqmp-keccak-384)
[    6.472280] alg: No test for xilinx-zynqmp-rsa (zynqmp-rsa)
[    6.478601] usbcore: registered new interface driver usbhid
[    6.478940] usbhid: USB HID core driver
[    6.486901] xlnk xlnk: Major 242
[    6.489828] xlnk xlnk: xlnk driver loaded
[    6.490707] xlnk xlnk: xlnk_pdev is not null
[    6.548653] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
[    6.558746] usbcore: registered new interface driver snd-usb-audio
[    6.579902] pktgen: Packet Generator for packet performance testing. Version: 2.75
[    6.599962] Initializing XFRM netlink socket
[    6.603168] NET: Registered protocol family 10
[    6.623147] Segment Routing with IPv6
[    6.625614] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    6.636225] NET: Registered protocol family 17
[    6.637091] NET: Registered protocol family 15
[    6.639957] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    6.645944] can: controller area network core (rev 20170425 abi 9)
[    6.648041] NET: Registered protocol family 29
[    6.649184] can: raw protocol (rev 20170425)
[    6.649683] can: broadcast manager protocol (rev 20170425 t)
[    6.650777] can: netlink gateway (rev 20170425) max_hops=1
[    6.652841] Bluetooth: RFCOMM TTY layer initialized
[    6.658801] Bluetooth: RFCOMM socket layer initialized
[    6.661217] Bluetooth: RFCOMM ver 1.11
[    6.665110] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    6.665705] Bluetooth: BNEP filters: protocol multicast
[    6.666637] Bluetooth: BNEP socket layer initialized
[    6.667597] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    6.668292] Bluetooth: HIDP socket layer initialized
[    6.672756] 9pnet: Installing 9P2000 support
[    6.674492] Key type dns_resolver registered
[    6.683302] registered taskstats version 1
[    6.683788] Loading compiled-in X.509 certificates
[    6.692318] Btrfs loaded, crc32c=crc32c-generic
[    6.768022] ff000000.serial: ttyPS2 at MMIO 0xff000000 (irq = 41, base_baud = 10416666) is a xuartps
[    6.778182] ff010000.serial: ttyPS0 at MMIO 0xff010000 (irq = 42, base_baud = 2480158) is a xuartps
[    6.781080] console [ttyPS0] enabled
[    6.781080] console [ttyPS0] enabled
[    6.782085] bootconsole [cdns0] disabled
[    6.782085] bootconsole [cdns0] disabled
[    6.803460] of-fpga-region fpga-full: FPGA Region probed
[    6.831924] xilinx-dpdma fd4c0000.dma: Xilinx DPDMA engine is probed
[    6.840920] xilinx-zynqmp-dma fd500000.dma: ZynqMP DMA driver Probe success
[    6.846506] xilinx-zynqmp-dma fd510000.dma: ZynqMP DMA driver Probe success
[    6.851837] xilinx-zynqmp-dma fd520000.dma: ZynqMP DMA driver Probe success
[    6.859324] xilinx-zynqmp-dma fd530000.dma: ZynqMP DMA driver Probe success
[    6.867312] xilinx-zynqmp-dma fd540000.dma: ZynqMP DMA driver Probe success
[    6.871566] xilinx-zynqmp-dma fd550000.dma: ZynqMP DMA driver Probe success
[    6.874555] xilinx-zynqmp-dma fd560000.dma: ZynqMP DMA driver Probe success
[    6.877468] xilinx-zynqmp-dma fd570000.dma: ZynqMP DMA driver Probe success
[    6.884132] xilinx-zynqmp-dma ffa80000.dma: ZynqMP DMA driver Probe success
[    6.892380] xilinx-zynqmp-dma ffa90000.dma: ZynqMP DMA driver Probe success
[    6.899735] xilinx-zynqmp-dma ffaa0000.dma: ZynqMP DMA driver Probe success
[    6.903678] xilinx-zynqmp-dma ffab0000.dma: ZynqMP DMA driver Probe success
[    6.907128] xilinx-zynqmp-dma ffac0000.dma: ZynqMP DMA driver Probe success
[    6.910344] xilinx-zynqmp-dma ffad0000.dma: ZynqMP DMA driver Probe success
[    6.913815] xilinx-zynqmp-dma ffae0000.dma: ZynqMP DMA driver Probe success
[    6.919872] xilinx-zynqmp-dma ffaf0000.dma: ZynqMP DMA driver Probe success
[    6.943320] xilinx-psgtr fd400000.zynqmp_phy: Lane:1 type:8 protocol:4 pll_locked:yes
[    7.015575] zynqmp_clk_divider_set_rate() set divider failed for ams_ref_div1, ret = -13
[    7.119624] xilinx-dp-snd-codec fd4a0000.zynqmp-display:zynqmp_dp_snd_codec0: Failed to get required clock freq
[    7.122985] xilinx-dp-snd-codec: probe of fd4a0000.zynqmp-display:zynqmp_dp_snd_codec0 failed with error -22
[    7.127692] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort Sound PCM probed
[    7.135379] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort Sound PCM probed
[    7.144218] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[    7.150937] OF: graph: no port node found in /amba/zynqmp-display@fd4a0000
[    7.161849] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    7.163062] [drm] No driver support for vblank timestamp query.
[    7.172734] xlnx-drm xlnx-drm.0: bound fd4a0000.zynqmp-display (ops 0xffffff8008bef538)
[    7.389614] Console: switching to colour frame buffer device 128x48
[    7.421749] zynqmp-display fd4a0000.zynqmp-display: fb0:  frame buffer device
[    7.428885] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.zynqmp-display on minor 0
[    7.430271] zynqmp-display fd4a0000.zynqmp-display: ZynqMP DisplayPort Subsystem driver probed
[    7.436494] zynqmp_gpd_attach_dev() domain6 request failed for node 35: -13
[    7.437332] cdns-spi ff040000.spi: failed to add to PM domain domain6: -13
[    7.438721] cdns-spi: probe of ff040000.spi failed with error -13
[    7.442709] zynqmp_gpd_attach_dev() domain7 request failed for node 36: -13
[    7.443355] cdns-spi ff050000.spi: failed to add to PM domain domain7: -13
[    7.443901] cdns-spi: probe of ff050000.spi failed with error -13
[    7.458474] macb ff0e0000.ethernet: Not enabling partial store and forward
[    7.459435] macb: GEM doesn't support hardware ptp.
[    7.473514] libphy: MACB_mii_bus: probed
[    7.631174] Marvell 88E1118 ff0e0000.ethernet-ffffffff:07: attached PHY driver [Marvell 88E1118] (mii_bus:phy_addr=ff0e0000.ethernet-ffffffff:07, irq=POLL)
[    7.633130] macb ff0e0000.ethernet eth0: Cadence GEM rev 0x40070106 at 0xff0e0000 irq 29 (00:0a:35:00:22:01)
[    7.639213] xilinx-axipmon ffa00000.perf-monitor: Probed Xilinx APM
[    7.646675] xilinx-axipmon fd0b0000.perf-monitor: Probed Xilinx APM
[    7.650998] xilinx-axipmon fd490000.perf-monitor: Probed Xilinx APM
[    7.655471] xilinx-axipmon ffa10000.perf-monitor: Probed Xilinx APM
[    7.690353] dwc3 fe200000.dwc3: Failed to get clk 'ref': -2
[    7.693191] WARNING: CPU: 3 PID: 484 at include/linux/dma-mapping.h:516 dwc3_alloc_event_buffers+0x138/0x1b8
[    7.694431] Modules linked in:
[    7.695455] CPU: 3 PID: 484 Comm: kworker/3:1 Not tainted 4.19.0-xilinx-v2019.2 #1
[    7.696207] Hardware name: Avnet Ultra96 Rev1 (DT)
[    7.698220] Workqueue: events deferred_probe_work_func
[    7.699947] pstate: 60000005 (nZCv daif -PAN -UAO)
[    7.704192] pc : dwc3_alloc_event_buffers+0x138/0x1b8
[    7.706215] lr : dwc3_alloc_event_buffers+0x6c/0x1b8
[    7.707159] sp : ffffff8009d836e0
[    7.707716] x29: ffffff8009d836e0 x28: 0000000000000000 
[    7.708339] x27: 0000000000000000 x26: 0000000000000000 
[    7.708602] x25: ffffffc07cfe1b38 x24: 0000000000001000 
[    7.708837] x23: ffffffc07cfd4810 x22: ffffff8008b37000 
[    7.709078] x21: ffffffc07c82f018 x20: ffffff8009178648 
[    7.709314] x19: ffffffc07cfe1b18 x18: 0000000000000010 
[    7.709538] x17: 0000000000000000 x16: 0000000000000000 
[    7.709771] x15: ffffffffffffffff x14: ffffff8009178648 
[    7.712130] x13: ffffff808921af0f x12: ffffff800921af17 
[    7.713879] x11: 0000000000000001 x10: ffffff80091f8040 
[    7.714442] x9 : 0000000000000000 x8 : ffffffc07c738000 
[    7.714867] x7 : 0000000000000000 x6 : 000000000000003f 
[    7.715283] x5 : 0000000000000040 x4 : ffffffc07cfd4aa0 
[    7.715682] x3 : 0000000000000000 x2 : 0000000000000001 
[    7.716071] x1 : ffffffc07cfe1b00 x0 : 0000000000000000 
[    7.717158] Call trace:
[    7.718017]  dwc3_alloc_event_buffers+0x138/0x1b8
[    7.719802]  dwc3_probe+0x7b4/0xbb0
[    7.720955]  platform_drv_probe+0x50/0xa0
[    7.724174]  really_probe+0x1c8/0x280
[    7.724885]  driver_probe_device+0x54/0xe8
[    7.725261]  __device_attach_driver+0xb8/0xe8
[    7.725633]  bus_for_each_drv+0x78/0xc8
[    7.726146]  __device_attach+0xd4/0x130
[    7.727025]  device_initial_probe+0x10/0x18
[    7.728044]  bus_probe_device+0x90/0x98
[    7.728699]  device_add+0x334/0x608
[    7.728990]  of_device_add+0x58/0x68
[    7.729270]  of_platform_device_create_pdata+0xac/0x108
[    7.729650]  of_platform_bus_create+0x294/0x390
[    7.730358]  of_platform_populate+0x74/0xd8
[    7.730928]  dwc3_of_simple_probe+0x3fc/0x528
[    7.731313]  platform_drv_probe+0x50/0xa0
[    7.731621]  really_probe+0x1c8/0x280
[    7.731911]  driver_probe_device+0x54/0xe8
[    7.732214]  __device_attach_driver+0xb8/0xe8
[    7.733643]  bus_for_each_drv+0x78/0xc8
[    7.734061]  __device_attach+0xd4/0x130
[    7.734322]  device_initial_probe+0x10/0x18
[    7.736981]  bus_probe_device+0x90/0x98
[    7.738007]  deferred_probe_work_func+0x6c/0xa0
[    7.740200]  process_one_work+0x1e4/0x340
[    7.740605]  worker_thread+0x248/0x488
[    7.740920]  kthread+0x124/0x128
[    7.741190]  ret_from_fork+0x10/0x18
[    7.741755] ---[ end trace c448154a8f7576be ]---
[    7.743080] dwc3 fe200000.dwc3: swiotlb: coherent allocation failed, size=4096
[    7.743771] CPU: 3 PID: 484 Comm: kworker/3:1 Tainted: G        W         4.19.0-xilinx-v2019.2 #1
[    7.744436] Hardware name: Avnet Ultra96 Rev1 (DT)
[    7.744890] Workqueue: events deferred_probe_work_func
[    7.745333] Call trace:
[    7.745504]  dump_backtrace+0x0/0x148
[    7.745765]  show_stack+0x14/0x20
[    7.746079]  dump_stack+0x90/0xb4
[    7.746284]  swiotlb_alloc+0x160/0x168
[    7.746501]  __dma_alloc+0xa8/0x1e0
[    7.746705]  dwc3_alloc_event_buffers+0xd0/0x1b8
[    7.746966]  dwc3_probe+0x7b4/0xbb0
[    7.747166]  platform_drv_probe+0x50/0xa0
[    7.747393]  really_probe+0x1c8/0x280
[    7.747585]  driver_probe_device+0x54/0xe8
[    7.747792]  __device_attach_driver+0xb8/0xe8
[    7.748014]  bus_for_each_drv+0x78/0xc8
[    7.748212]  __device_attach+0xd4/0x130
[    7.748406]  device_initial_probe+0x10/0x18
[    7.748629]  bus_probe_device+0x90/0x98
[    7.748845]  device_add+0x334/0x608
[    7.751613]  of_device_add+0x58/0x68
[    7.753648]  of_platform_device_create_pdata+0xac/0x108
[    7.754502]  of_platform_bus_create+0x294/0x390
[    7.754911]  of_platform_populate+0x74/0xd8
[    7.755688]  dwc3_of_simple_probe+0x3fc/0x528
[    7.756541]  platform_drv_probe+0x50/0xa0
[    7.758254]  really_probe+0x1c8/0x280
[    7.758597]  driver_probe_device+0x54/0xe8
[    7.759205]  __device_attach_driver+0xb8/0xe8
[    7.759647]  bus_for_each_drv+0x78/0xc8
[    7.760072]  __device_attach+0xd4/0x130
[    7.760399]  device_initial_probe+0x10/0x18
[    7.760779]  bus_probe_device+0x90/0x98
[    7.761054]  deferred_probe_work_func+0x6c/0xa0
[    7.761383]  process_one_work+0x1e4/0x340
[    7.761669]  worker_thread+0x248/0x488
[    7.762077]  kthread+0x124/0x128
[    7.762541]  ret_from_fork+0x10/0x18
[    7.763629] dwc3 fe200000.dwc3: can't allocate event buffer
[    7.764128] dwc3 fe200000.dwc3: failed to allocate event buffers
[    7.765396] dwc3: probe of fe200000.dwc3 failed with error -12
[    7.771536] zynqmp_gpd_attach_dev() domain10 request failed for node 23: -13
[    7.772502] dwc3-of-simple ff9e0000.usb1: failed to add to PM domain domain10: -13
[    7.773189] dwc3-of-simple: probe of ff9e0000.usb1 failed with error -13
[    7.816993] pca954x 0-0075: probe failed
[    7.818683] i2c i2c-0: Failed to register i2c client pca9548 at 0x75 (-16)
[    7.819242] i2c i2c-0: of_i2c: Failure registering /amba/i2c@ff030000/i2cswitch@75
[    7.819833] i2c i2c-0: Failed to create I2C device for /amba/i2c@ff030000/i2cswitch@75
[    7.820588] cdns-i2c ff030000.i2c: 100 kHz mmio ff030000 irq 31
[    7.835336] cdns-wdt fd4d0000.watchdog: Xilinx Watchdog Timer with timeout 60s
[    7.840589] cdns-wdt ff150000.watchdog: Xilinx Watchdog Timer with timeout 10s
[    7.851437] pwrseq_simple sdio_pwrseq: mmc succesfully got gpio_resetn
[    7.854250] pwrseq_simple sdio_pwrseq: mmc succesfully got gpio_chip_en
[    7.869974] zynqmp_gpd_attach_dev() domain12 request failed for node 39: -13
[    7.871047] sdhci-arasan ff160000.mmc: failed to add to PM domain domain12: -13
[    7.871819] sdhci-arasan: probe of ff160000.mmc failed with error -13
[    7.885536] sdhci-arasan ff170000.mmc: allocated mmc-pwrseq
[    7.890156] sdhci-arasan ff170000.mmc: Linked as a consumer to regulator.1
[    7.938481] mmc0: SDHCI controller on ff170000.mmc [ff170000.mmc] using ADMA 64-bit
[    7.968830] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[    7.980722] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[    8.015071] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[    8.029080] rtc_zynqmp ffa60000.rtc: setting system clock to 2020-01-20 11:49:06 UTC (1579520946)
[    8.030704] of_cfs_init
[    8.031683] of_cfs_init: OK
[    8.033293] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    8.046621] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[    8.066934] mmc0: Problem switching card into high-speed mode!
[    8.069720] mmc0: new SDHC card at address 4567
[    8.080098] mmcblk0: mmc0:4567 QEMU! 19.5 GiB 
[    8.109282]  mmcblk0: p1 p2
[    8.119426] xilinx-dp-snd-card fd4a0000.zynqmp-display:zynqmp_dp_snd_card: ASoC: CPU DAI (null) not registered
[    8.348452] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    8.349371] clk: Not disabling unused clocks
[    8.350441] ALSA device list:
[    8.350714]   No soundcards found.
[    8.360015] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    8.364243] cfg80211: failed to load regulatory.db
[    8.548872] EXT4-fs (mmcblk0p2): warning: mounting fs with errors, running e2fsck is recommended
[    8.558980] EXT4-fs (mmcblk0p2): recovery complete
[    8.563100] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    8.564879] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    8.587379] devtmpfs: mounted
[    8.691692] Freeing unused kernel memory: 832K
[    8.735400] Run /sbin/init as init process
INIT: version 2.88 booting
[    9.823427] random: fast init done
Starting udev
[   12.245782] udevd[1836]: starting version 3.2.5
[   12.314587] random: udevd: uninitialized urandom read (16 bytes read)
[   12.321691] random: udevd: uninitialized urandom read (16 bytes read)
[   12.326981] random: udevd: uninitialized urandom read (16 bytes read)
[   12.687952] udevd[1837]: starting eudev-3.2.5
[   13.708127] urandom_read: 5 callbacks suppressed
[   13.708544] random: udevd: uninitialized urandom read (16 bytes read)
[   14.879647] random: udevd: uninitialized urandom read (16 bytes read)
[   27.124257] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[   27.724386] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Starting Ultra96 AP setup daemon.
Turning Ultra96 WiFi & Bluetooth LEDs ON...done.
 
Starting Flask server deamon to serve Ultra96 startup page.
INIT: Entering runlevel: 5
Configuring network interfaces... Successfully initialized wpa_supplicant
rfkill: Cannot get wiphy information
Could not read interface wlan0 flags: No such device
WEXT: Could not set interface 'wlan0' UP
wlan0: Failed to initialize driver interface
Cannot find device "wlan0"
[   41.309387] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   42.412203] macb ff0e0000.ethernet eth0: link up (100/Full)
[   42.413720] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Starting system message bus: dbus.
Starting Connection Manager
Starting haveged: haveged: listening socket at 3
haveged: haveged starting up


attempting to run /mnt/init.sh
/mnt
cp: cannot stat '/mnt/platform_desc.txt': No such file or directory
Starting Xserver
mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
attempting to run /mnt/init.sh
/mnt
cp: cannot stat '/mnt/platform_desc.txt': No such file or directory
haveged: haveged: ver: 1.9.4; arch: generic; vend: ; build: (gcc 8.2.0 CTV); collect: 128K

haveged: haveged: cpu: (VC); data: 16K (D V); inst: 16K (D V); idx: 11/40; sz: 15528/64688

haveged: haveged: tot tests(BA8): A:1/1 B:1/1 continuous tests(B):  last entropy estimate 7.99692

haveged: haveged: fills: 0, generated: 0 

Starting Dropbear SSH server: [   48.229711] random: crng init done
mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
dropbear.
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
attempting to run /mnt/init.sh
Starting rpcbind daemon.../mnt
cp: cannot stat '/mnt/platform_desc.txt': No such file or directory

done.

X.Org X Server 1.20.1
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.10.0-327.el7.x86_64 x86_64 
Current Operating System: Linux ultra96v2-oob-2019_2 4.19.0-xilinx-v2019.2 #1 SMP Mon Jan 20 09:32:29 UTC 2020 aarch64
Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait
Build Date: 24 October 2019  07:22:49AM
 
Current version of pixman: 0.34.0
 Before reporting problems, check http://wiki.x.org
 to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
 (++) from command line, (!!) notice, (II) informational,
 (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Jan 20 11:49:48 2020
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
starting statd: done
Starting bluetooth: bluetoothd.
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name  ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
Errors from xkbcomp are not fatal to the X server
Starting Distributed Compiler Daemon: distcc/etc/rc5.d/S20distcc: start failed with error code 110
Starting internet superserver: inetd.
exportfs: can't open /etc/exports for reading
NFS daemon support not enabled in kernel
Starting ntpd: done
Starting syslogd/klogd: done
D-BUS per-session daemon address is: unix:abstract=/tmp/dbus-xjer3cfTNI,guid=c2f32701c1bab7b4db0c45ac5e2593e3
Starting internet superserver: xinetd.
mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
attempting to run /mnt/init.sh
/mnt
cp: cannot stat '/mnt/platform_desc.txt': No such file or directory
Starting Telephony daemon
Starting watchdog daemon...done
Opening webpage
GLib-GIO-Message: 11:50:01.545: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
Starting Linux NFC daemon
Failed to launch bus: Failed to execute child process ?/usr/bin? (Permission denied)Connection failure: Connection refused
pa_context_connect() failed: Connection refused
Starting network management services:matchbox: Cant find a keycode for keysym 269025056
matchbox: ignoring key shortcut XF86Calendar=!$contacts

matchbox: Cant find a keycode for keysym 2809
matchbox: ignoring key shortcut telephone=!$dates

matchbox: Cant find a keycode for keysym 269025050
matchbox: ignoring key shortcut XF86Start=!matchbox-remote -desktop

[settings daemon] Forking. run with -n to prevent fork
 snmpd.
[2422:2422:0120/115009:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /usr/lib/chromium/chrome-sandbox is owned by root and has mode 4755.
#0 0x0055646d32b8 
#1 0x0055646e870c 
#2 0x005567681fec 
#3 0x00556741c428 
#4 0x00556741b4bc 
#5 0x00556741b964 
#6 0x0055674ae388 
#7 0x005567289e2c 
#8 0x00556728980c 
#9 0x0055646a7d68 
#10 0x0055646a63a0 
#11 0x00556429b470 
#12 0x007f979c4ce4 __libc_start_main
#13 0x00556429b368 

/sbin/launch-ultra96-startup-page.sh: line 9:  2422 Aborted                 chromium --use-egl --user-data-dir "http://localhost:80"
Starting tcf-agent: 
(matchbox-panel:2461): dbind-WARNING **: 11:50:10.489: Error retrieving accessibility bus address: org.a11y.Bus.Error: Failed to execute child process ?/usr/bin? (Permission denied)

(matchbox-desktop:2460): dbind-WARNING **: 11:50:10.488: Error retrieving accessibility bus address: org.a11y.Bus.Error: Failed to execute child process ?/usr/bin? (Permission denied)
OK

PetaLinux 2019.2 ultra96v2-oob-2019_2 /dev/ttyPS0

ultra96v2-oob-2019_2 login: root
mount: /mnt: /dev/mmcblk0p1 already mounted on /run/media/mmcblk0p1.
mount: /mnt: /dev/mmcblk0 already mounted or mount point busy.
attempting to run /mnt/init.sh
/mnt
cp: cannot stat '/mnt/platform_desc.txt': No such file or directory
root@ultra96v2-oob-2019_2:/mnt# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:22:01  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::20a:35ff:fe00:2201/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:220 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:17726 (17.3 KiB)  TX bytes:26168 (25.5 KiB)
          Interrupt:29 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:402 errors:0 dropped:0 overruns:0 frame:0
          TX packets:402 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:30924 (30.1 KiB)  TX bytes:30924 (30.1 KiB)

root@ultra96v2-oob-2019_2:/mnt# 




2020年1月13日月曜日

Vitis 2019.2でUltra96v2を使ったAcceleration PlatformのEmulation-SW(QEMU)を動かす方法


Vitis 2019.2でUltra96v2のAcceleration PlatforのEmulation-SWをQEMUで実行する方法について記載します。

前回の記事はメモ書きだったので整理する意味でもう一度手順を通し、その結果をここに記載します。

動作確認などの際に参考にさせてもらっていたのはFixstarsさんのこちらの記事です。フォルダ構成などはこちらに準じています。注意点はほぼ共通で、zynqで動作させる場合にも参考となります。以下ではultra96v2対応の際の特有の注意事項について記載しています。

また、実機での動作にはpetalinuxプロジェクト作成の際にBSPからdevice-tree情報などを取得する必要があるかと思いますので今後調べることとします。

・環境

実行環境は次の通りです。
 OS:Ubuntu 18.04.03 LTS
 メモリ:16GB
 ツール:Vitis 2019.2, Vivado 2019.2, petalinux 2019.2, xrt-2019.2
 対象:Ultra96v2
まずは以下のようにして環境変数を設定します。

$ source <VIVADO_ROOT>/settings64.sh
$ source <VITIS_ROOT>/settings64.sh
$ source <PETALINUX_ROOT>/settings.sh
$ source <XRT_ROOT>/setup.sh

・HWコンポーネントの作成

基本はVitis Application Acceleration Development (UG1393)のSection IXの通りに進めます。ただし、board fileはultra96v2を使用し、GEM3をEMIOで出力する設定を追加します。注意点などは前述のFixstarsさんの記事同様なのでそちらをご覧ください。


最後に以下のスクリプト動作させてHWコンポーネントの作成は終了です。

cd &ltVIVADO_PROJECT_TOP>
write_hw_platform -include_bit ultra96v2_min.xsa
validate_hw_platform ultra96v2_min.xsa

・SWコンポーネントの作成

以下の通りpetalinuxプロジェクトを作成します。
$ cd &ltVIVADO_PROJECT_TOP>
$ petalinux-create -t project --template zynqMP -n petalinux 
$ cd petalinux
$ petalinux-config --get-hw-description=../vivado

作成後の設定ではuartとしてpsu_uart_1を選択します。
他の設定はデフォルトのままで大丈夫でした。



MACHINE_NAMEはtemplateのままとしておきます。
Exit -> Saveした後はUG1393の通り、petalinux/project-spec/meta-user/conf/user-rootfsconfigに以下の設定を追加します。

CONFIG_xrt
CONFIG_xrt-dev
CONFIG_zocl
CONFIG_opencl-clhpp-dev
CONFIG_opencl-headers-dev
CONFIG_packagegroup-petalinux-opencv

同様にproject-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsiの末尾にも以下のコードを追加します。

&amba {
    zyxclmm_drm {
        compatible = "xlnx,zocl";
        status = "okay";
    };
};

その後はpetalinux-config -c rootfsで追加したCONFIG_xxxを有効にします。


Vitis上でSDのマウントが適切な位置に行われるようにfstabを編集しておきます。
Vitis側の設定変更でもいいかもしれませんが、下手に変更してうまくいかないのは嫌なので、fstab側を編集しています。

$ mkdir -p project-spec/meta-user/recipes-core/base-files
$ vi project-spec/meta-user/recipes-core/base-files/base-files_%.bbappend

===== base-ffiles_%.bbappend =====
dirs755 += "/mnt"

do_install_append() {
    cat >> ${D}${sysconfdir}/fstab <<EOF

# Generated from my_bbappend
/dev/mmcblk0p1       /mnt          auto       defaults,sync,noauto  0  0
EOF
}

後はpetalinux-buildとしてください。
build終了後は続けて念の為の動作確認をします。
sdイメージとpmu_rom_qemu_sha3.elfが必要です。

sdイメージは好きな方法で用意すれば大丈夫です。
ug1169 のCh.6 Using Boot Image on QEMUを参考にすれば用意できるはずです。
私はdd/losetup/fdisk/mkfs/mount/cpコマンドを用いて作成しました。


pmu_rom_qemu_sha3.elfはQEMU起動時のオプションで直接パスを指定しても問題ないと思いますが、
VitisのEmulation用のデータをpre-builtフォルダに配置しておきます。

$ mkdir -p pre-built/linux/images
$ cp &ltVITIS_INSTALL_PATH>/data/emulation/dtbs/zynqmp/pmu_rom_qemu_sha3.elf ./pre-built/linux/images/

petalinux-bootで動作を確認しておきます。

$ petalinux-boot --qemu --u-boot --qemu-args "-drive file=myfile/sd.img,if=sd,id=sd0,index=0"

〜中略〜

petalinux login: 

root/rootでログインできるので、ログインしてfstabの変更が反映されているかチェックしておきます。
その後はcd images/linuxとpetalinux-build --sdkを行い、./sdk.sh でpfmフォルダにデータ展開します。
ここまででSWコンポーネントの作成は完了です。

 余談ですが、SDブートの場合はSD1にSD0と同じイメージをid,indexを変更して起動すればとりあえずQEMUで起動することは可能です。
(Wifiとの兼ね合いはどうなるかよくわかりませんが)
これで準備は完了です。

Vitisプラットフォームの作成

ここもチュートリアル通り進めれば大丈夫です。
QEMUを使用する場合はbootフォルダに次のファイルをコピーしてください。
  • image.ub
  • zynqmp_fsbl.elf
  • pmufw.elf
  • bl31.elf
  • u-boot.elf 
  • system.dtb
  • zynqmp_qemu-arm.dtb
  • zynqmp-qemu-multiarch-arm.dtb
  • zynqmp-qemu-multiarch-pmu.dtb
またbootフォルダに保存するlinux.bifは以下のとおりです。こちらもチュートリアルどおりです。

/* linux */
the_ROM_image:
{
  [fsbl_config] a53_x64
  [bootloader] <zynqmp_fsbl.elf>
  [pmufw_image] <pmufw.elf>
  [destination_device=pl] <bitstream>
  [destination_cpu=a53-0, exception_level=el-3, trustzone] <bl31.elf>
  [destination_cpu=a53-0, exception_level=el-2] <u-boot.elf>
}

qemu_args.txtを以下の通り作成し、qemuフォルダに保存します。 &ltyour_sd_image_path>/sd.imgでは先程petalinux-bootで動作確認した際に使用したsd.imgを指定してください。
-M arm-generic-fdt
-serial /dev/null -serial mon:stdio
-display none
-device loader,file=<bl31.elf>,cpu-num=0
-device loader,file=<u-boot.elf>
-dtb <system.dtb>
-net nic -net nic -net nic -net nic,netdev=eth0 -netdev user,id=eth0
-drive file=your_sd_image_path/sd.img,if=sd,id=sd0,format=raw,index=0
-boot mode=3
-global xlnx,zynqmp-boot.cpu-num=0
-global xlnx,zynqmp-boot.use-pmufw=true
-m 4G

pmu_args.txtも以下の通り作成し、qemu_args.txt同様にqemuフォルダに保存します。
-M microblaze-fdt
-serial /dev/null -serial mon:stdio
-display none
-device loader,file=<pmufw.elf>
-device loader,addr=0xfd1a0074,data=0x1011003,data-len=4
-device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4


 vitisを立ち上げてplatformの設定で以下の通り設定します。

  • BIF File: <PROJECT_TOP>/pfm/boot/linux.bif
  • BOOT Components Directory: <PROJECT_TOP>/pfm/boot
  • Linux Image Directory: <PROJECT_TOP>/pfm/boot
  • Sysroot Directory: <PROJECT_TOP>/pfm/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi
  • QEMU Data: <PROJECT_TOP>/pfm/boot
  • QEMU Arguments: <PROJECT_TOP>/pfm/qemu/qemu_args.txt
  • PMU QEMU Arguments: <PROJECT_TOP>/pfm/qemu/pmu_args.txt 
platformのビルドと、アプリケーションの作成(今回はvector addition)、ビルドを行います。



その後はEmulation-SW=>Run=>Launch ON Emulatorとして実行します。


最終結果はこちら。原因は不明ですがたまに途中で止まったままになったりします。

最後に

簡単なアプリケーションなら実はLaunch On Hardwareで十分確認できるので実はそこまで頑張らなくても良かったのかもと思いましたが、せっかくなので公開。
あと、SDブートの場合は現状コマンドラインから実行する必要ありそうなので、こちらも確認する予定。

おまけ、Emulation-HWの場合。(諦めた)

エラーメッセージは以下。
xsim.dir/design_1_wrapper_behav/xsimk: symbol lookup error: <PROJECT_TOP>/pfm/wksp1/vecadd/Emulation-HW/_vimage/rundir/behav_waveform/xsim/libdpi.so: undefined symbol: _ZTI14remoteport_tlm

ここと同じ問題が発生しているよう。
Zyboの場合も似たような状況なのでZynq系ではEmulatioo-HWのLaunch on Emulatorは何か不足していて動かないのかも。
Alveoを使ったVitisチュートリアルでは問題なく動作したので、Cosim環境やその他ツールの問題ではなさそう。
(VitisチュートリアルのPlatformに今回作成したUltra96v2のCustom Platformを指定すると同じエラーが発生した)
SystemCのライブラリ追加したりしたけど状況は変わらなかったので、ツールのバージョン上がるまでとりあえず保留にする。