From nobody Sun Oct 19 03:36:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1747627707; cv=none; d=zohomail.com; s=zohoarc; b=Q17cYVa0cdg2MN0fRlF6u2o3FPDCKz3tmFu5cd/sLnRcb4UQjwZtjkHU2x86ghR7OID8frNyNiS9wRgr/C9wuV/MvlkXu9Hsu6uet3emy8vumUPppwjIHml7mq6g4BJJmoBKb/KePEjs7+48DR9LW/fdQ8gFQsghT92CLuaJw0I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747627707; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8AzDyKx6OgyWxTzZBTwniZzUexKQarca/x+PapVXPjc=; b=WqFQWjJAbJWl7hT+6xfW2B9CHwyr7xvo4kJ53NuCd7LIenKsg5MLs4tmGrDQbVdeJecVBLGG6AiYsec7/pai0QXL66sN+eFuyX9PkdoGXI4oyy5jTLDtA2wvWAlIxINmAY8pOpq0ASwamcDHyjzKogOheqvLmJt5PQr2W3v2mqE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1747627707892714.925324379258; Sun, 18 May 2025 21:08:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uGrnE-0004w7-DM; Mon, 19 May 2025 00:08:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uGrn5-0004pD-S1 for qemu-devel@nongnu.org; Mon, 19 May 2025 00:07:52 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uGrn3-0004Aj-Mu for qemu-devel@nongnu.org; Mon, 19 May 2025 00:07:51 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-b1fd59851baso2333322a12.0 for ; Sun, 18 May 2025 21:07:49 -0700 (PDT) Received: from toolbx.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231ecd5ea41sm41750035ad.228.2025.05.18.21.07.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 May 2025 21:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747627668; x=1748232468; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8AzDyKx6OgyWxTzZBTwniZzUexKQarca/x+PapVXPjc=; b=Ymi9hx60J1t14QaqdI7xWwT5JkdDSGEcY7f/Z+G9AFwFWkLZoNBc0mnzZb2DPxh0Xu HTAgLRL786Xmsn16MBiSNNBkHM8vEjMWJe84TomR8JCrJdq49xjvTXPHI+UC9axBDRDF tsMhJvhPaV3v523CE2xzyAcGzWVoVRpRxFop+acX9WTTGq8F5RhlEIhrYyNH6tmVu6Uk LZlBrqQhH0NfeW6/2/l82++XylYQKagJRp9S9P/BJ1h1xHtGH3enHA0R4tyNZsuT43Jk D3gxPpFalxdVW9QgZIqlmsNjRQZkfYF1/kViW+FfbmahFwkxw+exwZI54H9JJt6HU9on lWKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747627668; x=1748232468; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8AzDyKx6OgyWxTzZBTwniZzUexKQarca/x+PapVXPjc=; b=i2GKdTXVmQmiWvRRjsRf3BM0uAuj0rmAthlOkVcTpqO53WXhMaZalk2vYqTdummWux 8vDahGK7nCC5o6LJ0jvb5jD1lNovvZdGcSNpNaaFgXjKpoybK2TMVpYQZyDstJUfF0ec 6cKrlqfxaGqMeg13uHoVbxfrQtLeTOHquUaLbnM9e9xgbawBjE6lNfGoSk8NW8oJx6zS HVF2BTv6ReIXhRrGj7dkDYltTB5MnJyHxmEcFBkfN2ngXK2ykVVarXKPCrv/umu6k7l8 qfgQ+yr8o6ozP6FGl2XOXts1hquypFyBhVC7z3FQyIjJ2I8fKnHSpZCFBx0zxYYSoUFS l3bg== X-Gm-Message-State: AOJu0Ywe6KheHyCcNfhOxoxSrCM7giO4SXFyA0ga4q93wdCrhEmBZQpu ehbrzKm1stO5uIpfXmuKmuB4xaVLJ9eMr+ohSQ+dR07gLtlsFdVU0RUz2E9UFg== X-Gm-Gg: ASbGncuRy9B77790LSW+sIIQxPV6Y0DTlR/dCWsWM0alLHxeEl0GAl+OHJhzsPXksEN xhicDWrp6FNxEAqBfBI0yIZqc05FDSRzmN+4/cHjB/o4NfLsmloQSX9YtuhE0B7QQL3mwhf/IUC ikTS8UijMHAuH/Bmi0SFXFK1Lfsoi4kb5kHq4KurirDLDKWMPjBBAwM+TD1x1fcFiV4zdVGivZq 6aq+CwsYWKWyC7yhXDAolXaGEjZcg5gyXqlLcsNtcvhAqrg7js7nkthsXSguVClUqQ96ra7Lyne EiyyvSSSb5mnrHS/n1Ntdv8qXftJwCgqyyo3DsGmNtR+Gkuf/vRYkBudv2y5eSfVwVD2P3TI5/f 3ZobPdAbb80lIeNmjxEBM71A61Na6ow2kv+zj8iulPZ1/iYQUnQvsXIR8 X-Google-Smtp-Source: AGHT+IFnM5JL57he9gnOUOZWyRkUlh5VB8Q5b8OHNWGjqmZSXhO2mGZaPuVfK4Jyof5Vbe3NYQME+g== X-Received: by 2002:a17:902:f706:b0:21f:6a36:7bf3 with SMTP id d9443c01a7336-231de3001cemr183769335ad.12.1747627668034; Sun, 18 May 2025 21:07:48 -0700 (PDT) From: alistair23@gmail.com X-Google-Original-From: alistair.francis@wdc.com To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Sebastian Huber , Alistair Francis Subject: [PULL 14/56] hw/riscv: microchip_pfsoc: Rework documentation Date: Mon, 19 May 2025 14:05:11 +1000 Message-ID: <20250519040555.3797167-15-alistair.francis@wdc.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250519040555.3797167-1-alistair.francis@wdc.com> References: <20250519040555.3797167-1-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2607:f8b0:4864:20::535; envelope-from=alistair23@gmail.com; helo=mail-pg1-x535.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1747627710057116600 From: Sebastian Huber Mention that running the HSS no longer works. Document the changed boot options. Reorder documentation blocks. Update URLs. Signed-off-by: Sebastian Huber Reviewed-by: Alistair Francis Message-ID: <20250319061342.26435-7-sebastian.huber@embedded-brains.de> Signed-off-by: Alistair Francis --- docs/system/riscv/microchip-icicle-kit.rst | 124 +++++++-------------- 1 file changed, 43 insertions(+), 81 deletions(-) diff --git a/docs/system/riscv/microchip-icicle-kit.rst b/docs/system/riscv= /microchip-icicle-kit.rst index 40798b1aae..9809e94b84 100644 --- a/docs/system/riscv/microchip-icicle-kit.rst +++ b/docs/system/riscv/microchip-icicle-kit.rst @@ -5,10 +5,10 @@ Microchip PolarFire SoC Icicle Kit integrates a PolarFire= SoC, with one SiFive's E51 plus four U54 cores and many on-chip peripherals and an FPGA. =20 For more details about Microchip PolarFire SoC, please see: -https://www.microsemi.com/product-directory/soc-fpgas/5498-polarfire-soc-f= pga +https://www.microchip.com/en-us/products/fpgas-and-plds/system-on-chip-fpg= as/polarfire-soc-fpgas =20 The Icicle Kit board information can be found here: -https://www.microsemi.com/existing-parts/parts/152514 +https://www.microchip.com/en-us/development-tool/mpfs-icicle-kit-es =20 Supported devices ----------------- @@ -26,95 +26,48 @@ The ``microchip-icicle-kit`` machine supports the follo= wing devices: * 2 GEM Ethernet controllers * 1 SDHC storage controller =20 +The memory is set to 1537 MiB by default. A sanity check on RAM size is +performed in the machine init routine to prompt user to increase the RAM s= ize +to > 1537 MiB when less than 1537 MiB RAM is detected. + Boot options ------------ =20 -The ``microchip-icicle-kit`` machine can start using the standard -bios -functionality for loading its BIOS image, aka Hart Software Services (HSS_= ). -HSS loads the second stage bootloader U-Boot from an SD card. Then a kernel -can be loaded from U-Boot. It also supports direct kernel booting via the --kernel option along with the device tree blob via -dtb. When direct kernel -boot is used, the OpenSBI fw_dynamic BIOS image is used to boot a payload -like U-Boot or OS kernel directly. - -The user provided DTB should have the following requirements: - -* The /cpus node should contain at least one subnode for E51 and the number - of subnodes should match QEMU's ``-smp`` option -* The /memory reg size should match QEMU=E2=80=99s selected ram_size via `= `-m`` -* Should contain a node for the CLINT device with a compatible string - "riscv,clint0" - -QEMU follows below truth table to select which payload to execute: - -=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 --bios -kernel -dtb payload -=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 - N N don't care HSS - Y don't care don't care HSS - N Y Y kernel -=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 - -The memory is set to 1537 MiB by default which is the minimum required high -memory size by HSS. A sanity check on ram size is performed in the machine -init routine to prompt user to increase the RAM size to > 1537 MiB when le= ss -than 1537 MiB ram is detected. - -Running HSS ------------ - -HSS 2020.12 release is tested at the time of writing. To build an HSS image -that can be booted by the ``microchip-icicle-kit`` machine, type the follo= wing -in the HSS source tree: - -.. code-block:: bash - - $ export CROSS_COMPILE=3Driscv64-linux- - $ cp boards/mpfs-icicle-kit-es/def_config .config - $ make BOARD=3Dmpfs-icicle-kit-es - -Download the official SD card image released by Microchip and prepare it f= or -QEMU usage: - -.. code-block:: bash - - $ wget ftp://ftpsoc.microsemi.com/outgoing/core-image-minimal-dev-icicle= -kit-es-sd-20201009141623.rootfs.wic.gz - $ gunzip core-image-minimal-dev-icicle-kit-es-sd-20201009141623.rootfs.w= ic.gz - $ qemu-img resize core-image-minimal-dev-icicle-kit-es-sd-20201009141623= .rootfs.wic 4G - -Then we can boot the machine by: - -.. code-block:: bash - - $ qemu-system-riscv64 -M microchip-icicle-kit -smp 5 \ - -bios path/to/hss.bin -sd path/to/sdcard.img \ - -nic user,model=3Dcadence_gem \ - -nic tap,ifname=3Dtap,model=3Dcadence_gem,script=3Dno \ - -display none -serial stdio \ - -chardev socket,id=3Dserial1,path=3Dserial1.sock,server=3Don,wait=3D= on \ - -serial chardev:serial1 +The ``microchip-icicle-kit`` machine provides some options to run a firmwa= re +(BIOS) or a kernel image. QEMU follows below truth table to select the +firmware: =20 -With above command line, current terminal session will be used for the fir= st -serial port. Open another terminal window, and use ``minicom`` to connect = the -second serial port. +=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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +-bios -kernel firmware +=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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +none N this is an error +none Y the kernel image +NULL, default N hss.bin +NULL, default Y opensbi-riscv64-generic-fw_dynamic.bin +other don't care the BIOS image +=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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -.. code-block:: bash +Direct Kernel Boot +------------------ =20 - $ minicom -D unix\#serial1.sock +Use the ``-kernel`` option to directly run a kernel image. When a direct +kernel boot is requested, a device tree blob may be specified via the ``-d= tb`` +option. Unlike other QEMU machines, this machine does not generate a devi= ce +tree for the kernel. It shall be provided by the user. The user provided= DTB +should meet the following requirements: =20 -HSS output is on the first serial port (stdio) and U-Boot outputs on the -second serial port. U-Boot will automatically load the Linux kernel from -the SD card image. +* The ``/cpus`` node should contain at least one subnode for E51 and the n= umber + of subnodes should match QEMU's ``-smp`` option. =20 -Direct Kernel Boot ------------------- +* The ``/memory`` reg size should match QEMU=E2=80=99s selected RAM size v= ia the ``-m`` + option. =20 -Sometimes we just want to test booting a new kernel, and transforming the -kernel image to the format required by the HSS bootflow is tedious. We can -use '-kernel' for direct kernel booting just like other RISC-V machines do. +* It should contain a node for the CLINT device with a compatible string + "riscv,clint0". =20 -In this mode, the OpenSBI fw_dynamic BIOS image for 'generic' platform is -used to boot an S-mode payload like U-Boot or OS kernel directly. +When ``-bios`` is not specified or set to ``default``, the OpenSBI +``fw_dynamic`` BIOS image for the ``generic`` platform is used to boot an +S-mode payload like U-Boot or OS kernel directly. =20 For example, the following commands show building a U-Boot image from U-Bo= ot mainline v2021.07 for the Microchip Icicle Kit board: @@ -146,4 +99,13 @@ CAVEATS: ``u-boot.bin`` has to be used which does contain one. To use the ELF ima= ge, we need to change to CONFIG_OF_EMBED or CONFIG_OF_PRIOR_STAGE. =20 +Running HSS +----------- + +The machine ``microchip-icicle-kit`` used to run the Hart Software Services +(HSS_), however, the HSS development progressed and the QEMU machine +implementation lacks behind. Currently, running the HSS no longer works. +There is missing support in the clock and memory controller devices. In +particular, reading from the SD card does not work. + .. _HSS: https://github.com/polarfire-soc/hart-software-services --=20 2.49.0