On Sat, Jan 21, 2023 at 17:46, Vagrant Cascadian <vagr...@debian.org> wrote:
On 2023-01-21, Joost van Zwieten wrote:
 Booting a kernel with initrd using U-Boot from bullseye with default
environment results in a kernel panic, because U-Boot loads the initrd in highmem [1]. The problem has been fixed upstream [2]. Please consider
 including the fix in bullseye. I've tested the attached patch, which
 applies to v2021.01 and which is a backport of the fix (variable
 `CONFIG_SYS_BOOTMAPSZ` has been renamed to `CFG_SYS_BOOTMAPSZ` in
 v2023.01).

Thanks!

Could you please also test against the version in unstable? Generally we
need fixes to go to unstable before backporting them to stable... and
given that bookworm will likely release this year, I would like for the
version in bookworm (currently based on upstream v2023.01) to work as
well...

Unfortunately I can't. In v2021.10 and v2023.01 two separate problems
were introduced [1], [2]. A fix for one of them is pending. For the
other I don't have an idea how to fix this yet (reverting a commit works
for me, but might break other boards).

[1]: https://lists.denx.de/pipermail/u-boot/2023-January/504116.html
[2]: https://lists.denx.de/pipermail/u-boot/2023-January/504115.html

Looks like the patch got merged upstream:

https://source.denx.de/u-boot/u-boot/-/commit/ace75d642fa71034b248cde30709c79e06c52d61

Would be good to include a link to the upstream fix in the comments of
the patch, and also explain that it is backported with regards to
CFG_SYS_BOOTMAPSZ vs. CONFIG_SYS_BOOTMAPSZ in the patch itself... it was
a little confusing to see the text of patch use one and the patch
describe another...

I've attached an updated patch.


live well,
  vagrant

>From 9926ea7e2103ad4ce390797c170aaf6993f5cb81 Mon Sep 17 00:00:00 2001
From: Joost van Zwieten <jo...@diskos.nl>
Date: Sun, 15 Jan 2023 00:57:30 +0100
Subject: [PATCH] odroid: limit boot memory to lowmem

This patch prevents a kernel panic on the Odroid U2/U3 when booting a
kernel with initrd and default U-Boot environment (Debian bug #1029373,
discussion upstream: [1]). This patch is a backport of
ace75d642fa71034b248cde30709c79e06c52d61 [2] which has been merged into
upstream master *after* tagging v2023.01. Between v2022.10 and v2023.01
the variable `CONFIG_SYS_BOOTMAPSZ` has been renamed to
`CFG_SYS_BOOTMAPSZ`, which is accounted for in this backport.

[1]: https://lists.denx.de/pipermail/u-boot/2023-January/504469.html
[2]: https://source.denx.de/u-boot/u-boot/-/commit/ace75d642fa71034b248cde30709c79e06c52d61

The original (backported) commit message:

In commit 4963f63fe61f ("image: Use gd->ram_base/_size in
env_get_bootm_size()") the size of the available memory for U-Boot to
use when relocating images, and not otherwise constrained, was changed
to include all known memory banks. In the case of this platform however,
all of the memory known to U-Boot is not also part of the Linux kernel
"lowmem" and so we must use CONFIG_SYS_BOOTMAPSZ to limit where we
relocate images to. We set a conservative limit of 256MB here to mirror
the previous behavior.

Signed-off-by: Joost van Zwieten <jo...@diskos.nl>
[trini: Reword the commit messsage]
Signed-off-by: Tom Rini <tr...@konsulko.com>
---
 include/configs/odroid.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/odroid.h b/include/configs/odroid.h
index 1367d13891..dfb1eeb784 100644
--- a/include/configs/odroid.h
+++ b/include/configs/odroid.h
@@ -21,6 +21,7 @@
 
 #define CONFIG_MACH_TYPE	4289
 
+#define CONFIG_SYS_BOOTMAPSZ	0x10000000
 #define CONFIG_SYS_SDRAM_BASE	0x40000000
 #define SDRAM_BANK_SIZE		(256 << 20)	/* 256 MB */
 #define PHYS_SDRAM_1		CONFIG_SYS_SDRAM_BASE
-- 
2.30.2

Reply via email to