Skip to contentSkip to conversation

sandbox: swap bloblist and fdt loading address sequence

PATCH Superseded Svyatoslav Ryhel 2 participants 5 messages Mar 7, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover sandbox: swap bloblist and fdt loading address sequence

The existing memory layout places the bloblist at 0xb000 and the fdt at 0x100, resulting in a 0xaf00 size constraint for the fdt. This constraint has been reached. Lets modify the layout by moving the bloblist to 0x100. With a bloblist size limit of 0x400, this allows the fdt to be positioned at 0x500, thus expanding its permissible size.

Tests passed: https://source.denx.de/u-boot/custodians/u-boot-tegra/-/pipelines/25021

Svyatoslav Ryhel (1):
sandbox: swap bloblist and fdt loading address sequence

 arch/sandbox/Kconfig         | 2 +-
 common/Kconfig               | 2 +-
 doc/arch/sandbox/sandbox.rst | 4 ++--
 test/lib/kconfig.c           | 8 ++++----
 4 files changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/1 sandbox: swap bloblist and fdt loading address sequence

The existing memory layout places the bloblist at 0xb000 and the fdt at 0x100, resulting in a 0xaf00 size constraint for the fdt. This constraint has been reached. Lets modify the layout by moving the bloblist to 0x100. With a bloblist size limit of 0x400, this allows the fdt to be positioned at 0x500, thus expanding its permissible size.

---
 arch/sandbox/Kconfig         | 2 +-
 common/Kconfig               | 2 +-
 doc/arch/sandbox/sandbox.rst | 4 ++--
 test/lib/kconfig.c           | 8 ++++----
 4 files changed, 8 insertions(+), 8 deletions(-)
arch/sandbox/Kconfig +1 -1
index 4c169034d9a..da7a19264b9 100644
@@ -77,7 +77,7 @@ config SANDBOX_BITS_PER_LONG
 
 config SYS_FDT_LOAD_ADDR
 	hex "Address at which to load devicetree"
-	default 0x100
+	default 0x500
 	help
 	  With sandbox the devicetree is loaded into the emulated RAM. This sets
 	  the address that is used. There must be enough space at this address
common/Kconfig +1 -1
index 7685914fa6f..cf4bee063ae 100644
@@ -1070,7 +1070,7 @@ endchoice
 
 config BLOBLIST_ADDR
 	hex "Address of bloblist"
-	default 0xb000 if SANDBOX
+	default 0x100 if SANDBOX
 	depends on BLOBLIST_FIXED
 	help
 	  Sets the address of the bloblist, set up by the first part of U-Boot
doc/arch/sandbox/sandbox.rst +2 -2
index a8b0d7f0395..99459815c25 100644
@@ -658,8 +658,8 @@ that are mapped into that memory:
 ========   ========================   ===============================
 Addr       Config                     Usage
 ========   ========================   ===============================
-     100   CONFIG_SYS_FDT_LOAD_ADDR   Device tree
-    b000   CONFIG_BLOBLIST_ADDR       Blob list
+     100   CONFIG_BLOBLIST_ADDR       Blob list
+     500   CONFIG_SYS_FDT_LOAD_ADDR   Device tree
    10000   CFG_MALLOC_F_ADDR          Early memory allocation
    f0000   CONFIG_PRE_CON_BUF_ADDR    Pre-console buffer
   100000   TCG Event log              TCG Event Log
test/lib/kconfig.c +4 -4
index a3645abf946..2f47af9acf1 100644
@@ -22,10 +22,10 @@ static int lib_test_is_enabled(struct unit_test_state *uts)
 	ut_asserteq(0, CONFIG_IS_ENABLED(_UNDEFINED));
 
 	if (IS_ENABLED(CONFIG_BLOBLIST)) {
-		ut_asserteq(0xb000, IF_ENABLED_INT(CONFIG_BLOBLIST_FIXED,
-						   CONFIG_BLOBLIST_ADDR));
-		ut_asserteq(0xb000, CONFIG_IF_ENABLED_INT(BLOBLIST_FIXED,
-							  BLOBLIST_ADDR));
+		ut_asserteq(0x100, IF_ENABLED_INT(CONFIG_BLOBLIST_FIXED,
+						  CONFIG_BLOBLIST_ADDR));
+		ut_asserteq(0x100, CONFIG_IF_ENABLED_INT(BLOBLIST_FIXED,
+							 BLOBLIST_ADDR));
 	}
 
 	/*
Signature · 1 line
2.43.0
#2 lore raw
Quoted 7 lines · Svyatoslav Ryhel

The existing memory layout places the bloblist at 0xb000 and the fdt at 0x100, resulting in a 0xaf00 size constraint for the fdt. This constraint has been reached. Lets modify the layout by moving the bloblist to 0x100. With a bloblist size limit of 0x400, this allows the fdt to be positioned at 0x500, thus expanding its permissible size.

[snip]

Quoted 5 lines
doc/arch/sandbox/sandbox.rst +0 -0
index a8b0d7f0395..99459815c25 100644

doc/arch/sandbox/sandbox.rst that are mapped into that memory: · line 665

Quoted 10 lines
doc/arch/sandbox/sandbox.rst +2 -2
@@ -658,8 +658,8 @@ that are mapped into that memory:
 ========   ========================   ===============================
 Addr       Config                     Usage
 ========   ========================   ===============================
-     100   CONFIG_SYS_FDT_LOAD_ADDR   Device tree
-    b000   CONFIG_BLOBLIST_ADDR       Blob list
+     100   CONFIG_BLOBLIST_ADDR       Blob list
+     500   CONFIG_SYS_FDT_LOAD_ADDR   Device tree
    10000   CFG_MALLOC_F_ADDR          Early memory allocation
    f0000   CONFIG_PRE_CON_BUF_ADDR    Pre-console buffer
   100000   TCG Event log              TCG Event Log

My question is do we have room or not to set aside 512KiB (as the "should never be this large" value) instead of not quite 64KiB which we can possibly hit again in the not too distant future? I think I checked earlier and CFG_MALLOC_F_ADDR + CONFIG_SYS_MALLOC_F_LEN should still fit below CONFIG_PRE_CON_BUF_ADDR if we do that (and also give the bloblist some room to expand).

Signature · 1 line
Tom
#3 lore raw

пт, 7 бер. 2025 р. о 21:05 Tom Rini <[email protected]> пише:

Quoted 25 lines · Svyatoslav Ryhel
Quoted 8 lines

The existing memory layout places the bloblist at 0xb000 and the fdt at 0x100, resulting in a 0xaf00 size constraint for the fdt. This constraint has been reached. Lets modify the layout by moving the bloblist to 0x100. With a bloblist size limit of 0x400, this allows the fdt to be positioned at 0x500, thus expanding its permissible size.

[snip]

Quoted 14 lines
doc/arch/sandbox/sandbox.rst +2 -2
index a8b0d7f0395..99459815c25 100644
@@ -658,8 +658,8 @@ that are mapped into that memory:
 ========   ========================   ===============================
 Addr       Config                     Usage
 ========   ========================   ===============================
-     100   CONFIG_SYS_FDT_LOAD_ADDR   Device tree
-    b000   CONFIG_BLOBLIST_ADDR       Blob list
+     100   CONFIG_BLOBLIST_ADDR       Blob list
+     500   CONFIG_SYS_FDT_LOAD_ADDR   Device tree
    10000   CFG_MALLOC_F_ADDR          Early memory allocation
    f0000   CONFIG_PRE_CON_BUF_ADDR    Pre-console buffer
Quoted 9 lines

doc/arch/sandbox/sandbox.rst that are mapped into that memory: · line 665

Quoted 1 line
doc/arch/sandbox/sandbox.rst +0 -0
   100000   TCG Event log              TCG Event Log

My question is do we have room or not to set aside 512KiB (as the "should never be this large" value) instead of not quite 64KiB which we can possibly hit again in the not too distant future? I think I checked earlier and CFG_MALLOC_F_ADDR + CONFIG_SYS_MALLOC_F_LEN should still fit below CONFIG_PRE_CON_BUF_ADDR if we do that (and also give the bloblist some room to expand).

I will configure and test everything but I cannot do anything without Simon agreement as the sandbox custodian and since he better knows this setup.

Quoted 2 lines

--
Tom

#4 lore raw
In reply to Tom Rini

пт, 7 бер. 2025 р. о 21:05 Tom Rini <[email protected]> пише:

Quoted 25 lines · Svyatoslav Ryhel
Quoted 8 lines

The existing memory layout places the bloblist at 0xb000 and the fdt at 0x100, resulting in a 0xaf00 size constraint for the fdt. This constraint has been reached. Lets modify the layout by moving the bloblist to 0x100. With a bloblist size limit of 0x400, this allows the fdt to be positioned at 0x500, thus expanding its permissible size.

[snip]

Quoted 14 lines
doc/arch/sandbox/sandbox.rst +2 -2
index a8b0d7f0395..99459815c25 100644
@@ -658,8 +658,8 @@ that are mapped into that memory:
 ========   ========================   ===============================
 Addr       Config                     Usage
 ========   ========================   ===============================
-     100   CONFIG_SYS_FDT_LOAD_ADDR   Device tree
-    b000   CONFIG_BLOBLIST_ADDR       Blob list
+     100   CONFIG_BLOBLIST_ADDR       Blob list
+     500   CONFIG_SYS_FDT_LOAD_ADDR   Device tree
    10000   CFG_MALLOC_F_ADDR          Early memory allocation
    f0000   CONFIG_PRE_CON_BUF_ADDR    Pre-console buffer
Quoted 9 lines

doc/arch/sandbox/sandbox.rst that are mapped into that memory: · line 665

Quoted 1 line
doc/arch/sandbox/sandbox.rst +0 -0
   100000   TCG Event log              TCG Event Log

My question is do we have room or not to set aside 512KiB (as the "should never be this large" value) instead of not quite 64KiB which we can possibly hit again in the not too distant future? I think I checked earlier and CFG_MALLOC_F_ADDR + CONFIG_SYS_MALLOC_F_LEN should still fit below CONFIG_PRE_CON_BUF_ADDR if we do that (and also give the bloblist some room to expand).

preliminary memory map:

0x100 CONFIG_BLOBLIST_ADDR

0x1000       CONFIG_SYS_FDT_LOAD_ADDR
0xf0000      CONFIG_PRE_CON_BUF_ADDR
0xf4000      CFG_MALLOC_F_ADDR

0x100000 TCG Event log

Quoted 2 lines

--
Tom