From nobody Sun May 19 03:38:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1596473401; cv=none; d=zohomail.com; s=zohoarc; b=lQEMKQp9F1CINr/n5MPiVkaafYSyu73Uz7kmrDd4vWOtZu1ZPH3eIj4ud5U2D3ZdiqjeLQe951qaNZtPJwYZ0ByJwyb8mIzDkM/684JgTA/68KeTmdd9mZWd8eR7YFffF2A/lQdkhXXyDgKR1dTpdBxTfejY57xHQLD/O7e2IXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596473401; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+GaW+fNRmBSUhIsokeJX0HIcwVIfHoIyE+CQVdEFwtM=; b=Vq90O0sqqPYUvRlQqCpTwwmVthVxKDuRHhwZ+Dtr3bV4uBDAm/yv7KSfAIft2NwBCLuKoTht6Epmb5Exb2f6UNUPE6Ho70xvvyvLT3QA4bdsiwMSGCUr4wcqdEHgVwI8cro+ndyKpAms69KOWrt1GBmBu2VFxhklt6B61wLffeg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1596473401665745.4634229295356; Mon, 3 Aug 2020 09:50:01 -0700 (PDT) Received: from localhost ([::1]:40616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2dey-0003Q2-6C for importer@patchew.org; Mon, 03 Aug 2020 12:50:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2dd1-0001AN-3Z; Mon, 03 Aug 2020 12:47:59 -0400 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]:33570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k2dcz-00081G-7N; Mon, 03 Aug 2020 12:47:58 -0400 Received: by mail-lj1-x241.google.com with SMTP id v4so30716307ljd.0; Mon, 03 Aug 2020 09:47:54 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id n3sm4393482ljc.114.2020.08.03.09.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 09:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+GaW+fNRmBSUhIsokeJX0HIcwVIfHoIyE+CQVdEFwtM=; b=aD6uXced+4juhks4ZArh8hyZ4kUsvka8Dhn8zWxwqWrSeXKNJX9HDAm1m+MpsYWInF WfUyYIq5qGM7telEuY0PHJdNuQ/HcYTwGKYTHOkXjqNV+nuhlqJqR2f+PITQB/N7WxMM fDH2G+m935gesecYL5GcSw90kqTUSa4OPfHVCxZhOZFeAW22JFh9Nnx6YyEAWl7lA8g0 0icfh1RzfXFhPF/FZ9evNjdXxqBYYknmYLDpYKJfiktY22S96Kl5XrR75c4paqMvSbjW y9ThEFDjo73fgazId0GuXG9GVdDJJYlnUaxZr/f0z9EJRUMl+HZbdtO9rHtN8vfbiSYY Hqyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+GaW+fNRmBSUhIsokeJX0HIcwVIfHoIyE+CQVdEFwtM=; b=MYS3DbHdcls+Q/AiJpDMQvEeTmUjJglGe0M5THiP312ENygGn9hhHC6EDXzMRiQWZ2 D7ptRVUR1gmFe9hLW2PPaaKutT9eoGEPicm/yDzlLlcnaKjcXCEpgBFn8ZH4MhIRMeLf PAfo83ZGIGdgCx38ab/CTGhBDh86UTZ9BDuScTp5NIw0aS6rvy3qoxf9/DxvO90FOxmk G71PYAD36HEEijwGKCnWkVjAdrhfzwFcZvFk6b0IKnXf7Nriz1oAk7Nzz2XZiqaRNP4x oX+D8kDLkBlLmUU7bObQXZouyNXE346c9Yq8rywuUdI18QI5eakiF2ghCA5DyRGTVYm1 5NLQ== X-Gm-Message-State: AOAM533jenrgiVv6Sgf5+B0PkgOuX5ZMjWez520pWTuGEyCsPhzXS8aa Oaq4C2Ec5jp9d37F7OPBMijNGmqX X-Google-Smtp-Source: ABdhPJxgfYnjJ4VUcfG/CnG7wrIZsBRn4xWDc0cs8ZIBtTq4aP2qCsbhS5aVAvX2/4ugNJ4vkewkwQ== X-Received: by 2002:a05:651c:88:: with SMTP id 8mr4799339ljq.277.1596473272315; Mon, 03 Aug 2020 09:47:52 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 1/1] docs/system/arm: Document the Xilinx Versal Virt board Date: Mon, 3 Aug 2020 18:47:49 +0200 Message-Id: <20200803164749.301971-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200803164749.301971-1-edgar.iglesias@gmail.com> References: <20200803164749.301971-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::241; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x241.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FSL_HELO_FAKE=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, WEIRD_QUOTING=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Document the Xilinx Versal Virt board. Signed-off-by: Edgar E. Iglesias --- docs/system/arm/xlnx-versal-virt.rst | 176 +++++++++++++++++++++++++++ docs/system/target-arm.rst | 1 + MAINTAINERS | 3 +- 3 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 docs/system/arm/xlnx-versal-virt.rst diff --git a/docs/system/arm/xlnx-versal-virt.rst b/docs/system/arm/xlnx-ve= rsal-virt.rst new file mode 100644 index 0000000000..2602d0f995 --- /dev/null +++ b/docs/system/arm/xlnx-versal-virt.rst @@ -0,0 +1,176 @@ +Xilinx Versal Virt (``xlnx-versal-virt``) +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Xilinx Versal is a family of heterogeneous multi-core SoCs +(System on Chip) that combine traditional hardened CPUs and I/O +peripherals in a Processing System (PS) with runtime programmable +FPGA logic (PL) and an Artificial Intelligence Engine (AIE). + +More details here: +https://www.xilinx.com/products/silicon-devices/acap/versal.html + +The family of Versal SoCs share a single architecture but come in +different parts with different speed grades, amounts of PL and +other differences. + +The Xilinx Versal Virt board in QEMU is a model of a virtual board +(does not exist in reality) with a virtual Versal SoC without I/O +limitations. Currently, we support the following cores and devices: + +Implemented CPU cores: + +- 2 ACPUs (ARM Cortex-A72) + +Implemented devices: + +- Interrupt controller (ARM GICv3) +- 2 UARTs (ARM PL011) +- An RTC (Versal built-in) +- 2 GEMs (Cadence MACB Ethernet MACs) +- 8 ADMA (Xilinx zDMA) channels +- 2 SD Controllers +- OCM (256KB of On Chip Memory) +- DDR memory + +QEMU does not yet model any other devices, including the PL and the AI Eng= ine. + +Other differences between the hardware and the QEMU model: + +- QEMU allows the amount of DDR memory provided to be specified with the + ``-m`` argument. If a DTB is provided on the command line then QEMU will + edit it to include suitable entries describing the Versal DDR memory ran= ges. + +- QEMU provides 8 virtio-mmio virtio transports; these start at + address ``0xa0000000`` and have IRQs from 111 and upwards. + +Running +""""""" +If the user provides an Operating System to be loaded, we expect users +to use the ``-kernel`` command line option. + +Users can load firmware or boot-loaders with the ``-device loader`` option= s. + +When loading an OS, QEMU generates a DTB and selects an appropriate address +where it gets loaded. This DTB will be passed to the kernel in register x0. + +If there's no ``-kernel`` option, we generate a DTB and place it at 0x1000 +for boot-loaders or firmware to pick it up. + +If users want to provide their own DTB, they can use the ``-dtb`` option. +These DTBs will have their memory nodes modified to match QEMU's +selected ram_size option before they get passed to the kernel or FW. + +When loading an OS, we turn on QEMU's PSCI implementation with SMC +as the PSCI conduit. When there's no ``-kernel`` option, we assume the user +provides EL3 firmware to handle PSCI. + +A few examples: + +Direct Linux boot of a generic ARM64 upstream Linux kernel: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xlnx-versal-virt -m 2G \ + -serial mon:stdio -display none \ + -kernel arch/arm64/boot/Image \ + -nic user -nic user \ + -device virtio-rng-device,bus=3Dvirtio-mmio-bus.0 \ + -drive if=3Dnone,index=3D0,file=3Dhd0.qcow2,id=3Dhd0,snapshot \ + -drive file=3Dqemu_sd.qcow2,if=3Dsd,index=3D0,snapshot \ + -device virtio-blk-device,drive=3Dhd0 -append root=3D/dev/vda + +Direct Linux boot of PetaLinux 2019.2: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xlnx-versal-virt -m 2G \ + -serial mon:stdio -display none \ + -kernel petalinux-v2019.2/Image \ + -append "rdinit=3D/sbin/init console=3DttyAMA0,115200n8 earlycon=3Dp= l011,mmio,0xFF000000,115200n8" \ + -net nic,model=3Dcadence_gem,netdev=3Dnet0 -netdev user,id=3Dnet0 \ + -device virtio-rng-device,bus=3Dvirtio-mmio-bus.0,rng=3Drng0 \ + -object rng-random,filename=3D/dev/urandom,id=3Drng0 + +Boot PetaLinux 2019.2 via ARM Trusted Firmware (2018.3 because the 2019.2 +version of ATF tries to configure the CCI which we don't model) and U-boot: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xlnx-versal-virt -m 2G \ + -serial stdio -display none \ + -device loader,file=3Dpetalinux-v2018.3/bl31.elf,cpu-num=3D0 \ + -device loader,file=3Dpetalinux-v2019.2/u-boot.elf \ + -device loader,addr=3D0x20000000,file=3Dpetalinux-v2019.2/Image \ + -nic user -nic user \ + -device virtio-rng-device,bus=3Dvirtio-mmio-bus.0,rng=3Drng0 \ + -object rng-random,filename=3D/dev/urandom,id=3Drng0 + +Run the following at the U-Boot prompt: + +.. code-block:: bash + + Versal> + fdt addr $fdtcontroladdr + fdt move $fdtcontroladdr 0x40000000 + fdt set /timer clock-frequency <0x3dfd240> + setenv bootargs "rdinit=3D/sbin/init maxcpus=3D1 console=3DttyAMA0,11520= 0n8 earlycon=3Dpl011,mmio,0xFF000000,115200n8" + booti 20000000 - 40000000 + fdt addr $fdtcontroladdr + +Boot Linux as DOM0 on Xen via U-Boot: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xlnx-versal-virt -m 4G \ + -serial stdio -display none \ + -device loader,file=3Dpetalinux-v2019.2/u-boot.elf,cpu-num=3D0 \ + -device loader,addr=3D0x30000000,file=3Dlinux/2018-04-24/xen \ + -device loader,addr=3D0x40000000,file=3Dpetalinux-v2019.2/Image \ + -nic user -nic user \ + -device virtio-rng-device,bus=3Dvirtio-mmio-bus.0,rng=3Drng0 \ + -object rng-random,filename=3D/dev/urandom,id=3Drng0 + +Run the following at the U-Boot prompt: + +.. code-block:: bash + + Versal> + fdt addr $fdtcontroladdr + fdt move $fdtcontroladdr 0x20000000 + fdt set /timer clock-frequency <0x3dfd240> + fdt set /chosen xen,xen-bootargs "console=3Ddtuart dtuart=3D/uart@ff0000= 00 dom0_mem=3D640M bootscrub=3D0 maxcpus=3D1 timer_slop=3D0" + fdt set /chosen xen,dom0-bootargs "rdinit=3D/sbin/init clk_ignore_unused= console=3Dhvc0 maxcpus=3D1" + fdt mknode /chosen dom0 + fdt set /chosen/dom0 compatible "xen,multiboot-module" + fdt set /chosen/dom0 reg <0x00000000 0x40000000 0x0 0x03100000> + booti 30000000 - 20000000 + +Boot Linux as Dom0 on Xen via ARM Trusted Firmware and U-Boot: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xlnx-versal-virt -m 4G \ + -serial stdio -display none \ + -device loader,file=3Dpetalinux-v2018.3/bl31.elf,cpu-num=3D0 \ + -device loader,file=3Dpetalinux-v2019.2/u-boot.elf \ + -device loader,addr=3D0x30000000,file=3Dlinux/2018-04-24/xen \ + -device loader,addr=3D0x40000000,file=3Dpetalinux-v2019.2/Image \ + -nic user -nic user \ + -device virtio-rng-device,bus=3Dvirtio-mmio-bus.0,rng=3Drng0 \ + -object rng-random,filename=3D/dev/urandom,id=3Drng0 + +Run the following at the U-Boot prompt: + +.. code-block:: bash + + Versal> + fdt addr $fdtcontroladdr + fdt move $fdtcontroladdr 0x20000000 + fdt set /timer clock-frequency <0x3dfd240> + fdt set /chosen xen,xen-bootargs "console=3Ddtuart dtuart=3D/uart@ff0000= 00 dom0_mem=3D640M bootscrub=3D0 maxcpus=3D1 timer_slop=3D0" + fdt set /chosen xen,dom0-bootargs "rdinit=3D/sbin/init clk_ignore_unused= console=3Dhvc0 maxcpus=3D1" + fdt mknode /chosen dom0 + fdt set /chosen/dom0 compatible "xen,multiboot-module" + fdt set /chosen/dom0 reg <0x00000000 0x40000000 0x0 0x03100000> + booti 30000000 - 20000000 + diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst index 4c5b0e4aab..afdb37e738 100644 --- a/docs/system/target-arm.rst +++ b/docs/system/target-arm.rst @@ -93,6 +93,7 @@ undocumented; you can get a complete list by running arm/sx1 arm/stellaris arm/virt + arm/xlnx-versal-virt =20 Arm CPU features =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff --git a/MAINTAINERS b/MAINTAINERS index 0886eb3d2b..5a22c8be42 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -894,7 +894,7 @@ F: hw/misc/zynq* F: include/hw/misc/zynq* X: hw/ssi/xilinx_* =20 -Xilinx ZynqMP +Xilinx ZynqMP and Versal M: Alistair Francis M: Edgar E. Iglesias M: Peter Maydell @@ -905,6 +905,7 @@ F: include/hw/*/xlnx*.h F: include/hw/ssi/xilinx_spips.h F: hw/display/dpcd.c F: include/hw/display/dpcd.h +F: docs/system/arm/xlnx-versal-virt.rst =20 ARM ACPI Subsystem M: Shannon Zhao --=20 2.25.1