From: Herman Rimm via Guix-patches via <guix-patches@gnu.org>
To: 72987@debbugs.gnu.org
Subject: [bug#72987] [PATCH] gnu: u-boot: Enlarge space available for kernel.
Date: Mon, 2 Sep 2024 21:04:59 +0200 [thread overview]
Message-ID: <20240902190459.13783-1-herman@rimm.ee> (raw)
* gnu/packages/bootloaders.scm (u-boot): Use patch.
* gnu/packages/patches/u-boot-50M-kernel.patch: Add file.
* gnu/local.mk (dist_patch_DATA): Register patch.
---
Based on [bug#70131].
gnu/local.mk | 1 +
gnu/packages/bootloaders.scm | 7 ++-
gnu/packages/patches/u-boot-50M-kernel.patch | 47 ++++++++++++++++++++
3 files changed, 54 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/u-boot-50M-kernel.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 2ce910ad28..d674acd7ca 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2165,6 +2165,7 @@ dist_patch_DATA = \
%D%/packages/patches/turbovnc-find-system-packages.patch \
%D%/packages/patches/tuxpaint-stamps-path.patch \
%D%/packages/patches/twinkle-bcg729.patch \
+ %D%/packages/patches/u-boot-50M-kernel.patch \
%D%/packages/patches/u-boot-allow-disabling-openssl.patch \
%D%/packages/patches/u-boot-nintendo-nes-serial.patch \
%D%/packages/patches/u-boot-rockchip-inno-usb.patch \
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 162eef6859..9980521a5f 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -841,6 +841,10 @@ (define %u-boot-nanopi-r4s-ddr3-patch
;; Use DDR3 instead of LPDDR4 for the Nano Pi R4S U-boot.
(search-patch "u-boot-nanopi-r4s-ddr3.patch"))
+(define %u-boot-50M-kernel-patch
+ ;; Make space for 6.9+ linux-libre kernel.
+ (search-patch "u-boot-50M-kernel.patch"))
+
(define u-boot
(package
(name "u-boot")
@@ -849,7 +853,8 @@ (define u-boot
(patches
(list %u-boot-rockchip-inno-usb-patch
%u-boot-allow-disabling-openssl-patch
- %u-boot-nanopi-r4s-ddr3-patch))
+ %u-boot-nanopi-r4s-ddr3-patch
+ %u-boot-50M-kernel-patch))
(method url-fetch)
(uri (string-append
"https://ftp.denx.de/pub/u-boot/"
diff --git a/gnu/packages/patches/u-boot-50M-kernel.patch b/gnu/packages/patches/u-boot-50M-kernel.patch
new file mode 100644
index 0000000000..d31501400e
--- /dev/null
+++ b/gnu/packages/patches/u-boot-50M-kernel.patch
@@ -0,0 +1,47 @@
+diff --git a/board/raspberrypi/rpi/rpi.env b/board/raspberrypi/rpi/rpi.env
+index 30228285ed..54a8e9e5ae 100644
+--- a/board/raspberrypi/rpi/rpi.env
++++ b/board/raspberrypi/rpi/rpi.env
+@@ -43,22 +43,22 @@ dfu_alt_info+=zImage fat 0 1
+ * text_offset bytes (specified in the header of the Image) into a 2MB
+ * boundary. The 'booti' command relocates the image if necessary. Linux uses
+ * a default text_offset of 0x80000. In summary, loading at 0x80000
+- * satisfies all these constraints and reserving memory up to 0x02400000
+- * permits fairly large (roughly 36M) kernels.
++ * satisfies all these constraints and reserving memory up to 0x03400000
++ * permits fairly large (roughly 50M) kernels.
+ *
+ * scriptaddr and pxefile_addr_r can be pretty much anywhere that doesn't
+ * conflict with something else. Reserving 1M for each of them at
+- * 0x02400000-0x02500000 and 0x02500000-0x02600000 should be plenty.
++ * 0x03200000-0x03300000 and 0x03300000-0x03400000 should be plenty.
+ *
+ * On ARM, both the DTB and any possible initrd must be loaded such that they
+ * fit inside the lowmem mapping in Linux. In practice, this usually means not
+ * more than ~700M away from the start of the kernel image but this number can
+ * be larger OR smaller depending on e.g. the 'vmalloc=xxxM' command line
+ * parameter given to the kernel. So reserving memory from low to high
+- * satisfies this constraint again. Reserving 1M at 0x02600000-0x02700000 for
+- * the DTB leaves rest of the free RAM to the initrd starting at 0x02700000.
++ * satisfies this constraint again. Reserving 1M at 0x03400000-0x03500000 for
++ * the DTB leaves rest of the free RAM to the initrd starting at 0x03500000.
+ * Even with the smallest possible CPU-GPU memory split of the CPU getting
+- * only 64M, the remaining 25M starting at 0x02700000 should allow quite
++ * only 64M, the remaining 11M starting at 0x03500000 should allow quite
+ * large initrds before they start colliding with U-Boot.
+ */
+ #ifdef CONFIG_ARM64
+@@ -69,9 +69,9 @@ fdt_high=ffffffff
+ initrd_high=ffffffff
+ #endif
+ kernel_addr_r=0x00080000
+-scriptaddr=0x02400000
+-pxefile_addr_r=0x02500000
+-fdt_addr_r=0x02600000
+-ramdisk_addr_r=0x02700000
++scriptaddr=0x03200000
++pxefile_addr_r=0x03300000
++fdt_addr_r=0x03400000
++ramdisk_addr_r=0x03500000
+
+ boot_targets=mmc usb pxe dhcp
--
2.45.2
next reply other threads:[~2024-09-02 19:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 19:04 Herman Rimm via Guix-patches via [this message]
2024-09-15 22:12 ` [bug#72987] [PATCH] gnu: u-boot: Enlarge space available for kernel Ludovic Courtès
2024-09-16 17:24 ` [bug#72987] [PATCH v2] " Herman Rimm via Guix-patches via
2024-09-16 21:05 ` [bug#72987] u-boot: rpi: " Vagrant Cascadian
2024-09-19 14:11 ` Simon Glass
2024-09-16 21:10 ` [bug#72987] [PATCH v2] gnu: u-boot: " Vagrant Cascadian
2024-09-19 10:50 ` [bug#70131] " Herman Rimm via Guix-patches via
2024-09-20 21:52 ` Vagrant Cascadian
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=20240902190459.13783-1-herman@rimm.ee \
--to=guix-patches@gnu.org \
--cc=72987@debbugs.gnu.org \
--cc=herman@rimm.ee \
/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).