From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oMHmL0fhwmSh+gAASxT56A (envelope-from ) for ; Thu, 27 Jul 2023 23:27:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gEPuL0fhwmQnUQAAauVa8A (envelope-from ) for ; Thu, 27 Jul 2023 23:27:35 +0200 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 aspmx1.migadu.com (Postfix) with ESMTPS id 4593D4F218 for ; Thu, 27 Jul 2023 23:27:35 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=incana.org header.s=gm1 header.b=CBEVGCU+; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1690493255; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=MVEdPBRf5ec8//QdowTjNk2fxzuUQKtzL83kkqcCZp8=; b=MwS454LFYHULNanLPpeclfLeO+Se78ffMzZX6Bj6nqo7QYlsMtLl+CkEpHzbLJ2DU3UWC0 NNxB6mO510/lwAiwExP3Xw6vRbp2e+57TigubORPe7NYewdIGxEo86flmPwJza39pf54ds SN2XTBoHf05NESUbQjL5CSVF9m/MZdXXasaoliFNHeUMYafq+nFL+DPPVOoZEgmVd68EGv 98303ku5CzMv2msonQyiyFe6f9yJb/9tqNqdqrI/8oTzMuv5HmNZ6btYoKGc/uyZVGrwhc vgJVGNc/UmY5WQXhvogPIMTz63u8AS6nJyQzuDo8EpfqvB9AkAtlNHRPTh64vQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=incana.org header.s=gm1 header.b=CBEVGCU+; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1690493255; a=rsa-sha256; cv=none; b=O31YyQ+3GWkGBKFDJQuqE0jRM+05o7LGkiO759+w1Zqlr6Q5QLqyDZomaRXxxA2dEe7kG7 tKVBP0o3xu8xbhcxD9SBjy9mxGDZZVaLd9KRaMWIr4Aj75DF3R0ZBXOlpgJPExtfeMXgsJ gM8d8SDBdVpJyKJV0/99lr0DHYxD7wNODPC3gipTZjYtv63Ut/q7lQ0PCLQgiG3NAXk/z3 Xy6ERk8nO9YwLjlrKn8BXe0piuQmTInR/TxM9FVt5/dFV77Zm2Oi0BN/L+6MSmugqSalpg +A8zTBpI3htLeqfWHOYJWKA/o2kjdJuDKVFP1ULthrIMvo2BcapdFy7+HEypOg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qP8Oy-00065Z-Ql; Thu, 27 Jul 2023 17:20:04 -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 1qP8Ow-000653-95 for guix-patches@gnu.org; Thu, 27 Jul 2023 17:20:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qP8Ov-000351-S0; Thu, 27 Jul 2023 17:20:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qP8Ov-0000T0-MV; Thu, 27 Jul 2023 17:20:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64907] [PATCH 1/2] gnu: Add u-boot-rvvm. Resent-From: Juliana Sims Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, ludo@gnu.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 27 Jul 2023 21:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64907 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64907@debbugs.gnu.org Cc: Juliana Sims , Efraim Flashner , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Vagrant Cascadian X-Debbugs-Original-Xcc: Efraim Flashner , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Vagrant Cascadian Received: via spool by 64907-submit@debbugs.gnu.org id=B64907.16904927701738 (code B ref 64907); Thu, 27 Jul 2023 21:20:01 +0000 Received: (at 64907) by debbugs.gnu.org; 27 Jul 2023 21:19:30 +0000 Received: from localhost ([127.0.0.1]:43242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP8OQ-0000Ry-8v for submit@debbugs.gnu.org; Thu, 27 Jul 2023 17:19:30 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:39513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP8ON-0000Ri-BY for 64907@debbugs.gnu.org; Thu, 27 Jul 2023 17:19:29 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 16F7C1C0004; Thu, 27 Jul 2023 21:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=incana.org; s=gm1; t=1690492760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MVEdPBRf5ec8//QdowTjNk2fxzuUQKtzL83kkqcCZp8=; b=CBEVGCU+oJVgn4grIQxtv7be7gmOVSyYuCKPWjvDv0s4yJ0Fqe5FIudL+FdZ7OcCCayGvd 0MtFMOCt6Izz271wzrWhqIxHg0kRBR5DdocOcxtSfujHQT+t6bHi8//NpaLtL2PJ/dogRa GT/xUD8e1td2SpJvsJ8t/5dyK8oH/IXtAf9IbK5O1lRAnzChQ9lxBaoz8+AuL+e/q/mJ40 8Qr+0IhCFPAQhM2U13BztazxAhJwdvKKtmjsUkVMytz2iY4K6qr2ZB/WNPAnC7JZHEH4bc SFWlDTX9PqKTvPGpBStbdzcJQwQx+6QuxFVnR7wz23PgGrv2zP+x+3utVCOBPw== From: Juliana Sims Date: Thu, 27 Jul 2023 17:18:57 -0400 Message-ID: <62cefdc5d6a4b0e3d6e611a6b6541f00acc19d9f.1690488628.git.juli@incana.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: juli@incana.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: 0.25 X-Migadu-Queue-Id: 4593D4F218 X-Migadu-Spam-Score: 0.25 X-Migadu-Scanner: mx0.migadu.com X-TUID: mDHUnJ/gdpmi * gnu/packages/bootloaders.scm (%u-boot-rvvm-support-patch, u-boot-rvvm): New symbol. * gnu/packages/patches/u-boot-rvvm-support.patch: New patch. --- gnu/packages/bootloaders.scm | 23 +++++++ .../patches/u-boot-rvvm-support.patch | 67 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 gnu/packages/patches/u-boot-rvvm-support.patch diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 38eb1d104f..5f12d324e8 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2021 Stefan ;;; Copyright © 2022, 2023 Maxim Cournoyer +;;; Copyright © 2023 Juliana Sims ;;; ;;; This file is part of GNU Guix. ;;; @@ -645,6 +646,15 @@ (define %u-boot-rk3399-enable-emmc-phy-patch ;; https://lists.denx.de/pipermail/u-boot/2021-November/466329.html (search-patch "u-boot-rk3399-enable-emmc-phy.patch")) +(define %u-boot-rvvm-support-patch + ;; Patch to support NVMe and RVVM board properly in U-Boot + ;; - Enables NVMe PCI support & booting from it + ;; - Enables framebuffer driver, passes it as EFI FB + ;; - Enables Realtek RTL8169 driver + ;; - Get rid of DHCP boot, it is confusing and not helpful + ;; https://github.com/LekKit/patches-misc/blob/ef2bb2bc6e37f87f3af4f9d9c8b69f76408620a7/uboot/uboot_rvvm_support.patch + (search-patch "u-boot-rvvm-support.patch")) + (define u-boot (package (name "u-boot") @@ -1173,6 +1183,19 @@ (define-public u-boot-qemu-riscv64 (define-public u-boot-qemu-riscv64-smode (make-u-boot-package "qemu-riscv64_smode" "riscv64-linux-gnu")) +(define-public u-boot-rvvm + (let ((base (make-u-boot-package "qemu-riscv64_smode" "riscv64-linux-gnu" + #:append-description + "This U-Boot is built for @code{rvvm}. It is also compatible +with @code{qemu}, but adds patches from the @code{rvvm} authors."))) + (package + (inherit base) + (name "u-boot-rvvm") + (source (origin + (inherit (package-source base)) + (patches (cons %u-boot-rvvm-support-patch + (origin-patches (package-source base))))))))) + (define-public u-boot-sandbox (let ((base (make-u-boot-package "sandbox" #f ;build for the native system diff --git a/gnu/packages/patches/u-boot-rvvm-support.patch b/gnu/packages/patches/u-boot-rvvm-support.patch new file mode 100644 index 0000000000..1e62a2d61d --- /dev/null +++ b/gnu/packages/patches/u-boot-rvvm-support.patch @@ -0,0 +1,67 @@ +Patch to support NVMe and RVVM board properly in U-Boot + - Enables NVMe PCI support & booting from it + - Enables framebuffer driver, passes it as EFI FB + - Enables Realtek RTL8169 driver + - Get rid of DHCP boot, it is confusing and not helpful + +Applies cleanly over U-Boot 2023.4 +Reuses QEMU virt board config, build like this: + make qemu-riscv64_smode_defconfig + CROSS_COMPILE=riscv64-linux-gnu- make + +Resulting firmware works fine on both RVVM and QEMU + +diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig +index 48ca4ff4..faa17f33 100644 +--- a/arch/riscv/Kconfig ++++ b/arch/riscv/Kconfig +@@ -15,7 +15,7 @@ config TARGET_MICROCHIP_ICICLE + bool "Support Microchip PolarFire-SoC Icicle Board" + + config TARGET_QEMU_VIRT +- bool "Support QEMU Virt Board" ++ bool "Support QEMU/RVVM Virt Boards" + + config TARGET_SIFIVE_UNLEASHED + bool "Support SiFive Unleashed Board" +diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig +index 6114e1b8..7c25825a 100644 +--- a/board/emulation/qemu-riscv/Kconfig ++++ b/board/emulation/qemu-riscv/Kconfig +@@ -29,6 +29,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + select GENERIC_RISCV + select SUPPORT_SPL ++ imply OPTIMIZE_INLINING + imply AHCI + imply SMP + imply BOARD_LATE_INIT +@@ -50,7 +51,12 @@ config BOARD_SPECIFIC_OPTIONS # dummy + imply SCSI_AHCI + imply AHCI_PCI + imply E1000 ++ imply RTL8169 + imply NVME ++ imply NVME_PCI ++ imply VIDEO ++ imply VIDEO_SIMPLE ++ imply NO_FB_CLEAR + imply PCI + imply PCIE_ECAM_GENERIC + imply SCSI +diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h +index 20135f56..821251a3 100644 +--- a/include/configs/qemu-riscv.h ++++ b/include/configs/qemu-riscv.h +@@ -19,9 +19,9 @@ + + #define BOOT_TARGET_DEVICES(func) \ + func(QEMU, qemu, na) \ ++ func(NVME, nvme, 0) \ + func(VIRTIO, virtio, 0) \ +- func(SCSI, scsi, 0) \ +- func(DHCP, dhcp, na) ++ func(SCSI, scsi, 0) + + #include + -- 2.41.0