From: Juliana Sims <juli@incana.org>
To: 64907@debbugs.gnu.org
Cc: "Juliana Sims" <juli@incana.org>,
"Efraim Flashner" <efraim@flashner.co.il>,
"Ludovic Courtès" <ludo@gnu.org>,
"Vagrant Cascadian" <vagrant@debian.org>
Subject: [bug#64907] [PATCH 2/2] gnu: Add opensbi-rvvm.
Date: Thu, 27 Jul 2023 17:18:58 -0400 [thread overview]
Message-ID: <2502f76902b6983a62cb81e36959982ae7cdfe47.1690488628.git.juli@incana.org> (raw)
In-Reply-To: <cover.1690488628.git.juli@incana.org>
* gnu/packages/firmware.scm (opensbi-rvvm): New symbol.
* gnu/packages/patches/opensbi-rvvm-lowram-fdt.patch: New patch.
---
gnu/packages/firmware.scm | 32 +++++++++++++++++++
.../patches/opensbi-rvvm-lowram-fdt.patch | 21 ++++++++++++
2 files changed, 53 insertions(+)
create mode 100644 gnu/packages/patches/opensbi-rvvm-lowram-fdt.patch
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index ff5afbcbe1..728050b43a 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -9,6 +9,7 @@
;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2023 Juliana Sims <juli@incana.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -43,6 +44,7 @@ (define-module (gnu packages firmware)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
+ #:use-module (gnu packages bootloaders)
#:use-module (gnu packages check)
#:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
@@ -567,6 +569,36 @@ (define-public opensbi-qemu
(description
"This package contains OpenSBI firmware files for use with QEMU.")))
+(define-public opensbi-rvvm
+ (let ((base opensbi-generic))
+ (package
+ (inherit base)
+ (name "opensbi-rvvm")
+ (source (origin
+ (inherit (package-source base))
+ (patches (cons
+ ;; Allows opensbi to work on systems with <32M of RAM
+ ;; https://github.com/LekKit/patches-misc/blob/cc40906fbf1de9ae466304157f2bf7b8cc909cbe/opensbi/opensbi_lowram_fdt.patch
+ (search-patch "opensbi-rvvm-lowram-fdt.patch")
+ (origin-patches (package-source base))))))
+
+ (arguments
+ (substitute-keyword-arguments (package-arguments base)
+ ((#:make-flags flags)
+ #~(cons (string-append "FW_PAYLOAD_PATH="
+ #$(file-append u-boot-rvvm
+ "/libexec/u-boot.bin"))
+ (delete "FW_PAYLOAD=n"
+ #$flags)))))
+ (inputs (cons u-boot-rvvm
+ (package-inputs base)))
+ (description (string-append (package-description base)
+ "
+
+This package contains OpenSBI firmware files for use with
+@code{rvvm}. In particular, it adds support for low-RAM systems and builds a
+@code{fw_payload.bin} file using @code{u-boot-rvvm-riscv64}.")))))
+
(define-public seabios
(package
(name "seabios")
diff --git a/gnu/packages/patches/opensbi-rvvm-lowram-fdt.patch b/gnu/packages/patches/opensbi-rvvm-lowram-fdt.patch
new file mode 100644
index 0000000000..c9e27020f0
--- /dev/null
+++ b/gnu/packages/patches/opensbi-rvvm-lowram-fdt.patch
@@ -0,0 +1,21 @@
+Authored-by: LekKit <github.com/LekKit>
+
+Allows OpenSBI to work on devices with <32M of RAM,
+by moving FDT into page alignment zone before the kernel.
+This also allows running kernels that are >32M in size.
+
+Applies cleanly onto OpenSBI 1.2
+
+diff --git a/platform/generic/objects.mk b/platform/generic/objects.mk
+index 136853e..104a063 100644
+--- a/platform/generic/objects.mk
++++ b/platform/generic/objects.mk
+@@ -32,7 +32,7 @@ else
+ # This needs to be 2MB aligned for 64-bit system
+ FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x200000)))
+ endif
+-FW_JUMP_FDT_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x2200000)))
++FW_JUMP_FDT_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x100000)))
+ FW_PAYLOAD=y
+ ifeq ($(PLATFORM_RISCV_XLEN), 32)
+ # This needs to be 4MB aligned for 32-bit system
--
2.41.0
next prev parent reply other threads:[~2023-07-27 21:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 20:13 [bug#64907] [PATCH 0/2] gnu: Add rvvm support packages Juliana Sims
2023-07-27 21:18 ` [bug#64907] [PATCH 1/2] gnu: Add u-boot-rvvm Juliana Sims
2023-09-03 2:17 ` Vagrant Cascadian
2023-07-27 21:18 ` Juliana Sims [this message]
2023-09-03 2:24 ` [bug#64907] [PATCH 2/2] gnu: Add opensbi-rvvm Vagrant Cascadian
2023-08-12 20:54 ` [bug#64907] [PATCH 0/2] gnu: Add rvvm support packages Ludovic Courtès
2023-08-29 23:07 ` Vagrant Cascadian
2023-08-29 23:24 ` Vagrant Cascadian
2023-09-03 1:42 ` Juliana Sims
2024-03-18 18:23 ` [bug#64907] [PATCH 2/2] gnu: Add opensbi-rvvm Eva Kurchatova
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2502f76902b6983a62cb81e36959982ae7cdfe47.1690488628.git.juli@incana.org \
--to=juli@incana.org \
--cc=64907@debbugs.gnu.org \
--cc=efraim@flashner.co.il \
--cc=ludo@gnu.org \
--cc=vagrant@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).