XU8
Jump to navigation
Jump to search
Enclustra Xilinx FPGA SoM
SD card
root@daq13:~# fdisk -l /dev/sdd Disk /dev/sdd: 29.28 GiB, 31439454208 bytes, 61405184 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes Disklabel type: dos Device Boot Start End Sectors Size Id Type /dev/sdd1 8192 2097151 2088960 1020M c W95 FAT32 (LBA) /dev/sdd2 2097152 6291455 4194304 2G 83 Linux /dev/sdd3 6291456 8388607 2097152 1G 83 Linux root@daq13:~# root@daq13:~# mount /dev/sdd1 /mnt root@daq13:~# ls -l /mnt total 18060 -rw-r--r-- 1 olchansk users 9455980 Aug 15 15:00 BOOT.BIN -rw-r--r-- 1 olchansk users 2007 Dec 2 2022 boot.scr -rw-r--r-- 1 olchansk users 8506496 Dec 2 2022 image.ub -rw-r--r-- 1 olchansk users 262144 Dec 31 1979 uboot.env -rw-r--r-- 1 olchansk users 262144 Dec 31 1979 uboot-redund.env root@daq13:~#
Make new card
- use 8GB, 16GB or 32GB SD card
- fdisk /dev/sdX ### as above, only VFAT partition 1 is used
- mkfs.vfat /dev/sdX1
- fatlabel /dev/sdX1 BOOT
- mount /dev/sdX1 /mnt
- rsync boot files
- unmount, eject
Linux benchmarks
- memory benchmark:
daq13$ arm-linux-gnueabi-gcc -o memcpy.armv7 memcpy.cc -march=armv7 -static -O2 scp memcpy.armv7 to ... root@gdm-cdm:~# ./memcpy.armv7 memcpy 1 KiBytes: 1288 MB/sec memcpy 2 KiBytes: 1924 MB/sec memcpy 4 KiBytes: 2554 MB/sec memcpy 8 KiBytes: 3054 MB/sec memcpy 16 KiBytes: 3262 MB/sec memcpy 32 KiBytes: 3250 MB/sec memcpy 64 KiBytes: 3456 MB/sec memcpy 128 KiBytes: 3556 MB/sec memcpy 256 KiBytes: 3780 MB/sec memcpy 512 KiBytes: 3795 MB/sec memcpy 1024 KiBytes: 3789 MB/sec memcpy 2048 KiBytes: 3729 MB/sec memcpy 4096 KiBytes: 3717 MB/sec memcpy 8192 KiBytes: 3687 MB/sec memcpy 16384 KiBytes: 3632 MB/sec memcpy 32768 KiBytes: 3529 MB/sec memcpy 65536 KiBytes: 3318 MB/sec memcpy 131072 KiBytes: 2893 MB/sec root@gdm-cdm:~#
root@gdm00:~# g++ -O2 -static -Wall -Wuninitialized memcpy.cc -o memcpy.aarch64 root@gdm00:~# ./memcpy.aarch64 memcpy 1 KiBytes: 3937 MB/sec memcpy 2 KiBytes: 4866 MB/sec memcpy 4 KiBytes: 5528 MB/sec memcpy 8 KiBytes: 5923 MB/sec memcpy 16 KiBytes: 5869 MB/sec memcpy 32 KiBytes: 5521 MB/sec memcpy 64 KiBytes: 5217 MB/sec memcpy 128 KiBytes: 5250 MB/sec memcpy 256 KiBytes: 6288 MB/sec memcpy 512 KiBytes: 6299 MB/sec memcpy 1024 KiBytes: 6291 MB/sec memcpy 2048 KiBytes: 6113 MB/sec memcpy 4096 KiBytes: 6085 MB/sec memcpy 8192 KiBytes: 6011 MB/sec memcpy 16384 KiBytes: 5920 MB/sec memcpy 32768 KiBytes: 5743 MB/sec memcpy 65536 KiBytes: 5397 MB/sec memcpy 131072 KiBytes: 4661 MB/sec root@gdm00:~#
- ethernet receive:
daq13:bin$ ./ttcp -t -s -n 100000 10.0.0.24 ttcp-t: buflen=8192, nbuf=100000, align=16384/0, port=5001 tcp -> 10.0.0.24 ttcp-t: socket ttcp-t: connect ttcp-t: 819200000 bytes in 7.25 real seconds = 110358.39 KB/sec +++ ttcp-t: 100000 I/O calls, msec/call = 0.07, calls/sec = 13794.80 ttcp-t: 0.0user 0.2sys 0:07real 3% 0i+0d 760maxrss 0+2pf 1461+31csw daq13:bin$ root@gdm-cdm:~# ./ttcp.armv7 -r -s ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001 tcp ttcp-r: socket ttcp-r: accept from 10.0.0.25 ttcp-r: 819200000 bytes in 7.27 real seconds = 110098.22 KB/sec +++ ttcp-r: 212040 I/O calls, msec/call = 0.04, calls/sec = 29181.53 ttcp-r: 0.1user 5.7sys 0:07real 81% 0i+0d 584maxrss 0+2pf 125601+2699csw root@gdm-cdm:~#
- ethernet transmit:
root@gdm-cdm:~# ./ttcp.armv7 -t -s -n 100000 10.0.0.25 ttcp-t: buflen=8192, nbuf=100000, align=16384/0, port=5001 tcp -> 10.0.0.25 ttcp-t: socket ttcp-t: connect ttcp-t: 819200000 bytes in 6.95 real seconds = 115078.69 KB/sec +++ ttcp-t: 100000 I/O calls, msec/call = 0.07, calls/sec = 14384.84 ttcp-t: 0.0user 0.7sys 0:06real 11% 0i+0d 584maxrss 0+2pf 1162+1017csw root@gdm-cdm:~# daq13:bin$ ./ttcp -r -s ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001 tcp ttcp-r: socket ttcp-r: accept from 10.0.0.24 ttcp-r: 819200000 bytes in 6.97 real seconds = 114841.84 KB/sec +++ ttcp-r: 161335 I/O calls, msec/call = 0.04, calls/sec = 23160.01 ttcp-r: 0.0user 1.9sys 0:06real 28% 0i+0d 760maxrss 0+2pf 80646+51csw daq13:bin$
- iperf: iperf -s, iperf -c 192.168.0.1
XU8<->Linux 0.0000-10.0175 sec 1.10 GBytes 941 Mbits/sec
yocto
Setup as root
apt-get install build-essential chrpath cpio debianutils diffstat file gawk gcc git iputils-ping libacl1 locales python3 python3-git python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd apt install libstdc++-14-dev echo 0 > /proc/sys/kernel/apparmor_restrict_unprivileged_userns
wrynose
- Follow instructions here: https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html
- DEAD END!!! not supported by enclustra and xilinx layers
ssh dsdmdev@dsdaqgw mkdir yocto-test2 git clone https://git.openembedded.org/bitbake ./bitbake/bin/bitbake-setup init . /home1/dsdmdev/yocto-test2/bitbake-builds/poky-wrynose-poky-distro_poky-tiny-machine_genericarm64/build/init-build-env bitbake-config-build enable-fragment core/yocto/root-login-with-empty-password bitbake core-image-sato ### bombs, wants to build full graphical system, incompatible with "tiny" bitbake core-image-minimal bombs with errors about kernel/virtual edit conf/local.conf ineffective bitbake -e ### to identify who sets PREFERRED_PROVIDER_virtual/kernel edit /home1/dsdmdev/yocto-test2/bitbake-builds/poky-wrynose-poky-distro_poky-tiny-machine_genericarm64/layers/meta-yocto/meta-poky/conf/distro/poky-tiny.conf set PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" bitbake core-image-minimal grinds for a long time, finishes successfully, but where did it put it's results?
- Now need to add xilinx and enclustra xu8 layers
cd ~/yocto-test2/layers git clone https://git.yoctoproject.org/meta-xilinx git clone https://github.com/enclustra/meta-enclustra-amd.git
- add them bombs out, "wrynose" not supported, "scarthgap" is supported
bitbake-layers add-layer ~/yocto-test2/layers/meta-enclustra-amd/meta-enclustra-module bitbake-layers add-layer ~/yocto-test2/layers/meta-xilinx/meta-xilinx-core
- try older versions of bitbake-setup, no go, they do not know about "scarthgap", see https://lists.yoctoproject.org/g/yocto/topic/bitbake_setup_configurations/115191936
scarthgap
- follow instructions here: https://github.com/enclustra/meta-enclustra-amd
- instead of using the obsolete "repo" tool, git clone things manually
- run clone.sh
#!/bin/sh git clone https://github.com/enclustra/meta-enclustra-amd.git -b "xlnx-2024.2" mkdir -p sources cd sources # needed for setupsdk git clone https://github.com/Xilinx/yocto-manifests.git -b "rel-v2024.2" manifest git clone https://github.com/Xilinx/yocto-scripts.git -b "rel-v2024.2" git clone https://github.com/Xilinx/meta-petalinux.git -b "rel-v2024.2" # not needed git clone https://github.com/Xilinx/meta-xilinx-internal.git -b "rel-v2024.2" git clone https://github.com/Xilinx/meta-xilinx.git -b "rel-v2024.2" git clone https://github.com/Xilinx/poky.git -b "rel-v2024.2" /bin/cp -pv yocto-scripts/setupsdk ../setupsdk # needed for bitbake petalinux-image-minimal git clone https://github.com/Xilinx/meta-xilinx-tools.git -b "rel-v2024.2" git clone https://github.com/Xilinx/meta-arm.git -b "rel-v2024.2" git clone https://github.com/Xilinx/meta-openembedded.git -b "rel-v2024.2" #git clone https://github.com/Xilinx/meta-embedded-plus.git -b "rel-v2024.2" git clone https://github.com/Xilinx/meta-xilinx-tsn.git -b "rel-v2024.2" git clone https://github.com/Xilinx/meta-qt5.git -b "rel-v2024.2" git clone https://github.com/Xilinx/meta-virtualization.git -b "rel-v2024.2" #git clone https://github.com/Xilinx/meta-amd-adaptive-socs.git -b "rel-v2024.2" cd meta-xilinx/meta-xilinx-core git submodule update git submodule status #end
- source ./setupsdk"
- bitbake petalinux-image-minimal ### bombs, we need to configure the layers
bitbake-layers add-layer ../meta-enclustra-amd/meta-enclustra-module bitbake-layers add-layer ../meta-enclustra-amd/meta-enclustra-baseboard bitbake-layers add-layer ../meta-enclustra-amd/meta-enclustra-refdes
- not good enough, edit conf/bblayers.conf
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/home1/dsdmdev/yocto-test3/sources/poky/meta \
/home1/dsdmdev/yocto-test3/sources/poky/meta-poky \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-xilinx/meta-xilinx-core \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-xilinx/meta-xilinx-standalone \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-xilinx/meta-xilinx-bsp \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-xilinx/meta-xilinx-vendor \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-xilinx-tools \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-arm/meta-arm \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-arm/meta-arm-toolchain \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-openembedded/meta-perl \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-openembedded/meta-python \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-openembedded/meta-filesystems \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-openembedded/meta-networking \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-openembedded/meta-initramfs \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-openembedded/meta-oe \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-xilinx/meta-xilinx-contrib \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-xilinx-tsn \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-qt5 \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-virtualization \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-openembedded/meta-multimedia \
/home1/dsdmdev/yocto-test3/sources/poky/../meta-petalinux \
/home1/dsdmdev/yocto-test3/meta-enclustra-amd/meta-enclustra-module \
/home1/dsdmdev/yocto-test3/meta-enclustra-amd/meta-enclustra-baseboard \
/home1/dsdmdev/yocto-test3/meta-enclustra-amd/meta-enclustra-refdes \
"
- cp ~olchansk/git/ds-dm-gcdm/Vivado_CDM_XU8/Vivado_CDM_XU8.xsa ../
- ../sources/meta-xilinx/meta-xilinx-core/gen-machine-conf/gen-machineconf parse-xsa --hw-description ../Vivado_CDM_XU8.xsa --require-machine refdes-xu8-pe1 --machine-overrides enclustra-sd --machine-name refdes-xu8-pe1
- grinds for a while, bombs out with error about mconf
- rubber chicken dance to fix the mconf error:
- bitbake kconfig-frontends-native ### mconf is in this package
- find . -name mconf ### should find it in several places
- ../sources/meta-xilinx/meta-xilinx-core/gen-machine-conf/gen-machineconf parse-xsa --hw-description ../Vivado_CDM_XU8.xsa --require-machine refdes-xu8-pe1 --machine-overrides enclustra-sd --machine-name refdes-xu8-pe1 --native-sysroot ./tmp/sysroots-components/x86_64/kconfig-frontends-native
- will bomb out with error ??? because of incomplete git checkout:
cd ../sources/meta-xilinx/meta-xilinx-core git submodule update ### should checkout the missing gen-machineconf pieces
- will grind for some time, then print the MACHINE name we will be using
- add to conf/local.conf - MACHINE = "refdes-xu8-pe1-xczu4cg"
- bitbake petalinux-image-minimal
- observe it printed correct MACHINE name, etc. it will grind for a long time 1-2 hours
- will build everything, the kitchen sink and the garage (systemd, wayland, etc)
- will create stuff in ./tmp/deploy/images/refdes-xu8-pe1-xczu4cg
- but will it boot?
dsdmdev@dsdaqgw:/home1/dsdmdev/yocto-test3/build$ ls -l ./tmp/deploy/images/refdes-xu8-pe1-xczu4cg/boot.bin lrwxrwxrwx 2 dsdmdev users 46 May 13 17:34 ./tmp/deploy/images/refdes-xu8-pe1-xczu4cg/boot.bin -> BOOT-refdes-xu8-pe1-xczu4cg-20260514000135.bin