From patchwork Thu Jul 15 07:16:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 12379159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4FCFC1B08C for ; Thu, 15 Jul 2021 07:22:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91B9F61362 for ; Thu, 15 Jul 2021 07:22:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91B9F61362 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3vhd-00013u-O1 for qemu-devel@archiver.kernel.org; Thu, 15 Jul 2021 03:22:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3vc6-0005Yg-MC for qemu-devel@nongnu.org; Thu, 15 Jul 2021 03:16:54 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:27200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3vc3-0003UP-NS for qemu-devel@nongnu.org; Thu, 15 Jul 2021 03:16:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1626333412; x=1657869412; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SbSzoMijwfPI2ZTclf3G3p+iRCTsIMjZDdCadjYDN2o=; b=o5BpKbFD9lu8NspFM+CBVEKLIBlvZIR6Ul7cJ39WSD2wmXvCapfxcs5L NrZADahzPw9lNoaeD2A+u/u+UNXJnbbzFQeRHoN7nc6G5j/yDnGXFCqTX yaGBp5GxvKofBRQ5nfP7nj+0cXUoEC+qRzpXZWhVWXmJqLKEjRDadT4T2 ZThX3+13G7mi9isrq1I2mT82AC2oLKkGUWMBmEQXD/5/nJohVhC1fcNLG Vnvfq0EVdfRCTaER4PBGkJmd9f0KIFpWckHXFf+ycYcWXpFcIyfYcMpUL +cPt6/Koe+FjPds8xd/HZRpgUNE2tZpmm6T0bzyjiXp3G8GuXig/iP4XC Q==; IronPort-SDR: vCBIWHEaS/ZTpxwhnTQ/dLNPpHM6veUGpJautCXK7XcqQeLEjkp1oCyHDLOCESkvpDgfXs0kOr vX1E03rns17wLa7LSqBNA5UM78DyzN9X4CVe0jtNF8XVVmmooT8W3b7+CJY/vb+HeWbaeDzDj8 n9AHoRXEpBCQF9OiT7cZQszl58jdHyHKxmWkFwqGgDAQOabfGSNHmV7AC3tMm35UiO1CzLva4J RQsZRW4l30AKG5rHHT4TMLQbeQt+Z0MeMfIlLcUw0ySy7ivBxYjeY9uUcAGRuUGsXhoiQYWMwY 3cI= X-IronPort-AV: E=Sophos;i="5.84,240,1620662400"; d="scan'208";a="175212305" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 15 Jul 2021 15:16:43 +0800 IronPort-SDR: KdPfCRV1r06iIMDuasQG92veX7gw7OXus68w5w7squXTTB2pOGBkiCWvMnheQrnIdqYfNlvoCL HQf8gBfoK03In0zinMr5sE5HHfGEy/rv3jr68NU0B2LgMVLxJEBFS+IM40f1P2HgzTkA4+xb24 JZvcsGDJEr+KzB15Y4YnCx8ehOYFGeKvD+XDaTg2pW6OU5GryxkDbCYrbiyB8NVpy4JPaE1s4j T9yJcDxcQGMOrw250T5cNNzSwLhz8UP2bjB/DrRHUz5qkIr0r9nufpwiGlmbs/NrVpybMxMbFv EDztVCOzEOGswoEHy8FZ0Mb8 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jul 2021 23:54:45 -0700 IronPort-SDR: B5WJIuf5kBvQBRaoQ3W2FvA/9LxgStzQZIUqgh4tqUY89WpCEJ98Z0Ji6yL71n2izjdJ7uYy/1 IoyzaapGLy9BQzdDwywYy+XgOZIp5d3G81W18DTc7zf2I8RXrOCWdY0ktofiYQF/fdsR+ti2El idSPxmtvR5VmP6zGv+lJD4/n/FvqKT8jGyMRSOMcil0l/fE/OI/eFtPS0MpUOEzsBI2BgBSt91 3A7OZh7Z3G0/6f1AVR75NJnN/gyTpH/88Hr5/3N55LC2YsEG6vZvsuoktvaLMCPYG9yKorVKWl duo= WDCIronportException: Internal Received: from risc6-mainframe.sdcorp.global.sandisk.com (HELO risc6-mainframe.int.fusionio.com) ([10.196.157.248]) by uls-op-cesaip02.wdc.com with ESMTP; 15 Jul 2021 00:16:43 -0700 From: Alistair Francis To: peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PULL v2 06/12] docs/system: riscv: Update Microchip Icicle Kit for direct kernel boot Date: Thu, 15 Jul 2021 00:16:34 -0700 Message-Id: <20210715071640.232070-7-alistair.francis@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715071640.232070-1-alistair.francis@wdc.com> References: <20210715071640.232070-1-alistair.francis@wdc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=216.71.154.45; envelope-from=prvs=8230c157d=alistair.francis@wdc.com; helo=esa6.hgst.iphmx.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bin Meng , Alistair Francis Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bin Meng This adds a new section in the documentation to demonstrate how to use the new direct kernel boot feature for Microchip Icicle Kit, other than the HSS bootflow, using an upstream U-Boot v2021.07 image as an example. It also updates the truth table to have a new '-dtb' column which is required by direct kernel boot. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Message-id: 20210706095045.1917913-1-bmeng.cn@gmail.com Signed-off-by: Alistair Francis --- docs/system/riscv/microchip-icicle-kit.rst | 54 +++++++++++++++++++--- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/docs/system/riscv/microchip-icicle-kit.rst b/docs/system/riscv/microchip-icicle-kit.rst index 54ced661e3..817d2aec9c 100644 --- a/docs/system/riscv/microchip-icicle-kit.rst +++ b/docs/system/riscv/microchip-icicle-kit.rst @@ -47,13 +47,13 @@ The user provided DTB should have the following requirements: QEMU follows below truth table to select which payload to execute: -===== ========== ======= --bios -kernel payload -===== ========== ======= - N N HSS - Y don't care HSS - N Y kernel -===== ========== ======= +===== ========== ========== ======= +-bios -kernel -dtb payload +===== ========== ========== ======= + N N don't care HSS + Y don't care don't care HSS + N Y Y kernel +===== ========== ========== ======= 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 @@ -106,4 +106,44 @@ 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. +Direct Kernel Boot +------------------ + +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. + +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. + +For example, the following commands show building a U-Boot image from U-Boot +mainline v2021.07 for the Microchip Icicle Kit board: + +.. code-block:: bash + + $ export CROSS_COMPILE=riscv64-linux- + $ make microchip_mpfs_icicle_defconfig + +Then we can boot the machine by: + +.. code-block:: bash + + $ qemu-system-riscv64 -M microchip-icicle-kit -smp 5 -m 2G \ + -sd path/to/sdcard.img \ + -nic user,model=cadence_gem \ + -nic tap,ifname=tap,model=cadence_gem,script=no \ + -display none -serial stdio \ + -kernel path/to/u-boot/build/dir/u-boot.bin \ + -dtb path/to/u-boot/build/dir/u-boot.dtb + +CAVEATS: + +* Check the "stdout-path" property in the /chosen node in the DTB to determine + which serial port is used for the serial console, e.g.: if the console is set + to the second serial port, change to use "-serial null -serial stdio". +* The default U-Boot configuration uses CONFIG_OF_SEPARATE hence the ELF image + ``u-boot`` cannot be passed to "-kernel" as it does not contain the DTB hence + ``u-boot.bin`` has to be used which does contain one. To use the ELF image, + we need to change to CONFIG_OF_EMBED or CONFIG_OF_PRIOR_STAGE. + .. _HSS: https://github.com/polarfire-soc/hart-software-services