Skip to content

Conversation

@michalsimek
Copy link
Contributor

@michalsimek michalsimek commented Feb 6, 2025

Update Xilinx Qemu version based on 8.1.0 which is aligned with Xilinx v2024.2 (xilinx_v2024.2 tag) tools.

Also at the same time enable riscv32/64 targets and remove compilation flags which are not longer available.
--disable-vnc-png was removed in Xilinx 2023.1.
--disable-blobs was removed in Xilinx 2024.1.
--disable-sheepdog was removed in 2022.1.

@michalsimek michalsimek force-pushed the main branch 4 times, most recently from 01bb181 to 1d20944 Compare February 10, 2025 14:11
@michalsimek michalsimek marked this pull request as draft February 10, 2025 15:52
@michalsimek michalsimek force-pushed the main branch 5 times, most recently from 5885e26 to d2a5d26 Compare February 13, 2025 12:15
@michalsimek michalsimek marked this pull request as ready for review February 14, 2025 07:44
@michalsimek
Copy link
Contributor Author

I had to do some attempts to finally find the configuration which is working via your layers. Sorry about it.

@nashif
Copy link
Member

nashif commented Feb 18, 2025

Is this already upstream in qemu? We are planning to move the latest release and it would help alot if those targets are upstream so we do not need to maintain multiple versions of qemu

@michalsimek
Copy link
Contributor Author

Nope. Xilinx is using configuration based on DTB (HW DTB) which is hard to upstream. Some IP models are in upstream also some platform but a lot of features which we would like to use are not there yet.

@michalsimek michalsimek force-pushed the main branch 6 times, most recently from 6c3759d to 5e70673 Compare March 12, 2025 06:54
@nashif nashif added the ci-linux-x86_64 Run CI for x86-64 Linux host (for PR) label Mar 13, 2025
@michalsimek michalsimek marked this pull request as draft March 26, 2025 12:24
@nashif nashif removed the ci-linux-x86_64 Run CI for x86-64 Linux host (for PR) label Mar 27, 2025
Update Xilinx Qemu version based on 8.1.0 which is aligned with Xilinx
v2024.2 (xilinx_v2024.2 tag) tools.

Also at the same time enable riscv32/64 targets and remove compilation
flags which are not longer available.
--disable-vnc-png was removed in Xilinx 2023.1.
--disable-blobs was removed in Xilinx 2024.1.
--disable-sheepdog was removed in 2022.1.

There is also a need to cover new dependencies including libtasn1, bison
libcrypt and ninja. And also disabling meson when Qemu is configured and
enable gcrypt to emulate crypto models.

Signed-off-by: Michal Simek <[email protected]>
@michalsimek michalsimek marked this pull request as ready for review March 28, 2025 07:04
@nashif nashif merged commit 64dbdb4 into zephyrproject-rtos:main Mar 28, 2025
31 of 37 checks passed
kedareswararao pushed a commit to Xilinx/zephyr-amd that referenced this pull request May 23, 2025
Wire AMD QEMU via qemu-system-xilinx-aarch64 in SDK
The latest AMD QEMU version is not available in any official SDK.
But you can build it yourself and add it to existing Zephyr SDK.

Download the latest QEMU:
git clone https://github.com/Xilinx/qemu

Configure it (align your SDK location):
mkdir test && cd test && \
../qemu/configure --disable-docs --disable-sdl --disable-debug-info \
--disable-cap-ng --disable-libnfs --disable-libusb --disable-libiscsi \
--disable-usb-redir --disable-linux-aio --disable-guest-agent \
--disable-libssh --disable-seccomp --disable-tpm --disable-numa \
--disable-glusterfs --disable-virtfs --disable-xen --disable-curl \
--disable-attr --disable-curses --disable-iconv --disable-kvm \
--disable-parallels --disable-replication --disable-live-block-migration \
--target-list="aarch64-softmmu" --skip-meson \
--enable-gcrypt \
--prefix=XYZ/zephyr-sdk/zephyr-sdk-XYZ/sysroots/x86_64-pokysdk-linux/usr/xilinx/

There is an attempt to enable this configuration in official SDK
zephyrproject-rtos/sdk-ng#859
Difference in flags is calling with additional "--enable-gcrypt" to
properly model cryptographics devices.
Zephyr is not using them but it is easier for keeping configuration in sync
with official DTSes.

The patch is adding versalnet_rpu-qemu.dts which is export from DTB got via
https://github.com/Xilinx/qemu-devicetrees
(file LATEST/SINGLE_ARCH/board-versal-net-psx-vn-p-b2197-00-x-prc-09.dtb)
where only one change has been made in serial@0xf1920000
- chardev = "serial2";
+ chardev = "con";

The reason for this change is that Zephyr scripts are referencing to
chardev with name "con" as console.
"-chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline"
This is not a problem when you have system with only one serial but default
AMD DTSes are describing multiple consoles that's why it is necessary to
properly point to serial IP which is used as output device.

The second important change is adding CMakeLists.txt which is describing
building DTB out of ${BOARD}-qemu.dts to have full QEMU description in the
tree in text format instead of dealing with binaries as is done for QEMU
boards (./boards/qemu/cortex_a9/fdt-zynq7000s.dtb,
./boards/qemu/cortex_r5/fdt-single_arch-zcu102-arm.dtb).
The biggest advantage is that small changes (like chardev above) can be
easier review in text form and also anybody can do changes there.

DT description is terrible because it is DTB export and a lot of things
should be fixed (for example: node names) but there is no tool check
against dt binding because there is no binding for QEMU models yet. That's
why dtc is called with -q to suppress all the warnings coming from dts->dtb
conversion.

The main future is that west build -t run_qemu is wired which improves way
how to test this system.

Signed-off-by: Michal Simek <[email protected]>
Message-ID: <ee3633ef012aaf09bd50d07610cf738c28f9df28.1739959112.git.michal.simek@amd.com>
State: pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants