<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/lib/lmb.c, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/lib/lmb.c?h=main</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/lib/lmb.c?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2026-06-25T00:13:24Z</updated>
<entry>
<title>treewide: move bi_dram[] from bd to gd</title>
<updated>2026-06-25T00:13:24Z</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2026-06-17T07:48:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1174c99ab421168221be372bd83a4143bf5f167d'/>
<id>urn:sha1:1174c99ab421168221be372bd83a4143bf5f167d</id>
<content type='text'>
Currently, the bi_dram[] information is stored in the board info
structure (bd). Because bd is only valid after reserve_board(),
dram_init_banksize() must be called late in the initialization process.
This limitation is problematic, as it forces us to rely on a variety of
bespoke functions to determine board RAM, bank memory sizes, and other
early setup requirements.

By moving bi_dram[] into the global data (gd), we can run it earlier.
This is particularly convenient since boards define their own
dram_init_banksize() routines, which do not always rely on parsing
Device Tree (DT) memory nodes.

Additionally, U-Boot defaults to relocating to the top of the first memory
bank. While boards currently use custom functions to override this
behavior, having the DRAM bank information available earlier in gd makes
relocating to a different bank trivial and standardizes the process.

Reviewed-by: Anshul Dalal &lt;anshuld@ti.com&gt;
Tested-by: Michal Simek &lt;michal.simek@amd.com&gt; # Versal Gen 2 Vek385
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Tested-by: Christophe Leroy (CS GROUP) &lt;chleroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge patch series "various memory related fixups"</title>
<updated>2026-06-15T17:04:48Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2026-06-15T17:04:48Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a0a1e9f2f1dffed04ee52723ce957c07bb905c25'/>
<id>urn:sha1:a0a1e9f2f1dffed04ee52723ce957c07bb905c25</id>
<content type='text'>
rs@ti.com &lt;rs@ti.com&gt; says:

From: Randolph Sapp &lt;rs@ti.com&gt;

Nitpicks and fixes from the discovery thread on adding PocketBeagle2 support
[1]. This does a lot of general setup required for the device, but these
modifications themselves aren't device specific. For those specifically
interested in PocketBeagle2 support and don't care about these details, my
development branch is public [2].

That first patch may provoke some opinions, but honestly if that warning was
still present I wouldn't have spent a week poking holes in both the EFI and LMB
allocations systems. Please let me know if there is a specific usecase that it
breaks though.

[1] https://lore.kernel.org/all/DHHC66BBMD27.YHGIH43C6XBK@ti.com/
[2] https://github.com/StaticRocket/u-boot/tree/feature/pocketbeagle2

Link: https://lore.kernel.org/r/20260604155038.3182-1-rs@ti.com
</content>
</entry>
<entry>
<title>memory: reserve from start_addr_sp to initial_relocaddr</title>
<updated>2026-06-15T17:04:39Z</updated>
<author>
<name>Randolph Sapp</name>
<email>rs@ti.com</email>
</author>
<published>2026-06-04T15:50:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=48412f8f2962e27abe3b9a4a73221cebbfd73333'/>
<id>urn:sha1:48412f8f2962e27abe3b9a4a73221cebbfd73333</id>
<content type='text'>
Add a new global data struct member called initial_relocaddr. This
stores the original value of relocaddr, directly from setup_dest_addr.
This is specifically to avoid any adjustments made by other init
functions.

Reserve the memory from gd-&gt;start_addr_sp - CONFIG_STACK_SIZE to
gd-&gt;initial_relocaddr instead of gd-&gt;ram_top. This allows platform
specific relocation addresses to work without unnecessarily painting
over a large range.

Signed-off-by: Randolph Sapp &lt;rs@ti.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: Rename LMB_LIMIT_DMA_BELOW_4G to LMB_LIMIT_DMA_BELOW_RAM_TOP</title>
<updated>2026-06-08T19:28:49Z</updated>
<author>
<name>Marek Vasut</name>
<email>marek.vasut+renesas@mailbox.org</email>
</author>
<published>2026-06-04T17:33:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3dd149ba17cd34724bc535d6de290de6e74e177f'/>
<id>urn:sha1:3dd149ba17cd34724bc535d6de290de6e74e177f</id>
<content type='text'>
Rename LMB_LIMIT_DMA_BELOW_4G to LMB_LIMIT_DMA_BELOW_RAM_TOP
to make the Kconfig option more descriptive. No functional
change.

Suggested-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Marek Vasut &lt;marek.vasut+renesas@mailbox.org&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: Optionally limit available memory to 4 GiB on limited systems</title>
<updated>2026-06-04T14:26:41Z</updated>
<author>
<name>Marek Vasut</name>
<email>marek.vasut+renesas@mailbox.org</email>
</author>
<published>2026-06-03T14:17:55Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=af4aad1f0a0beba82d2015d79b450b59bf34d2bc'/>
<id>urn:sha1:af4aad1f0a0beba82d2015d79b450b59bf34d2bc</id>
<content type='text'>
Some architectures can not DMA above 4 GiB boundary,
limit available memory to memory below 4 GiB boundary.

Signed-off-by: Marek Vasut &lt;marek.vasut+renesas@mailbox.org&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Tested-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt; #rpi4 8GiB
</content>
</entry>
<entry>
<title>lmb: Reinstate access to memory above ram_top</title>
<updated>2026-03-13T19:20:11Z</updated>
<author>
<name>Marek Vasut</name>
<email>marek.vasut+renesas@mailbox.org</email>
</author>
<published>2026-01-27T23:48:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a3075db94d49f415658bf7e961e1eae90d9abc33'/>
<id>urn:sha1:a3075db94d49f415658bf7e961e1eae90d9abc33</id>
<content type='text'>
Revert commit eb052cbb896f ("lmb: add and reserve memory above ram_top")
and commit 1a48b0be93d4 ("lmb: prohibit allocations above ram_top even from
same bank"). These are based on incorrect premise of the first commit, that
"U-Boot does not use memory above ram_top". While U-Boot itself indeed does
not and should not use memory above ram_top, user can perfectly well use
that memory from the U-Boot shell, for example to load content in there.

Currently, attempt to use that memory to load large image using TFTP ends
with "TFTP error: trying to overwrite reserved memory...". With this change
in place, the memory can be used again.

Fixes: eb052cbb896f ("lmb: add and reserve memory above ram_top")
Fixes: 1a48b0be93d4 ("lmb: prohibit allocations above ram_top even from same bank")
Reported-by: Yuya Hamamachi &lt;yuya.hamamachi.sx@renesas.com&gt;
Signed-off-by: Marek Vasut &lt;marek.vasut+renesas@mailbox.org&gt;
</content>
</entry>
<entry>
<title>lmb: Remove unreachable code</title>
<updated>2025-07-22T17:29:33Z</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-07-14T16:40:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b9db211e3906c0a620ced344a2ebe5f87ccbf951'/>
<id>urn:sha1:b9db211e3906c0a620ced344a2ebe5f87ccbf951</id>
<content type='text'>
Code after a break is unreachable so remove it.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</content>
</entry>
<entry>
<title>arm: fix lmb region reservation when PRAM is defined</title>
<updated>2025-07-22T17:29:31Z</updated>
<author>
<name>Holger Brunck</name>
<email>holger.brunck@hitachienergy.com</email>
</author>
<published>2025-07-14T11:16:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=01548afc43770020cfebecc4a62cfa0d8b05517e'/>
<id>urn:sha1:01548afc43770020cfebecc4a62cfa0d8b05517e</id>
<content type='text'>
PRAM usage is not taken into account when reserving lmb for ARM
architecture, this means that predefined PRAM region is marked as
reserved by the architecture and cannot be used by other users.

Signed-off-by: Holger Brunck &lt;holger.brunck@hitachienergy.com&gt;
</content>
</entry>
<entry>
<title>lmb: add missing fallthrough in lmb_alloc_mem()</title>
<updated>2025-07-09T16:39:37Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2025-07-08T12:12:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=344e1798059ba65769272be3145736685bb25a7e'/>
<id>urn:sha1:344e1798059ba65769272be3145736685bb25a7e</id>
<content type='text'>
Add fallthrough to clarify the intent.

Addresses-Coverity-ID: CID 569481: Control flow issues (MISSING_BREAK)
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Acked-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: use a single function to check for allocation and reservation requests</title>
<updated>2025-06-25T15:50:37Z</updated>
<author>
<name>Sughosh Ganu</name>
<email>sughosh.ganu@linaro.org</email>
</author>
<published>2025-06-17T10:43:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7aa19c3667d1cd23417f4ec7f5cb5dab260cfbf3'/>
<id>urn:sha1:7aa19c3667d1cd23417f4ec7f5cb5dab260cfbf3</id>
<content type='text'>
The functions that handle allocation requests check if a region of
memory overlaps with a used region. This is done through
lmb_overlaps_region(). Similar checks are done for reservation
requests made to the LMB module, where the caller asks specifically
for a particular region of memory. These checks are being done through
lmb_can_reserve_region().

There are subtle differences in the checking needed for allocation
requests, as against reservation requests. In the former, it is only
needed to be checked if a region is overlapping with an existing
used region, and return as soon as an overlap is found. For
reservation request checks, because U-Boot allows for re-use of in-use
regions with a particular memory attribute, this check has to iterate
through all the regions that might overlap with the requested region,
and then check that the necessary conditions are met to allow for the
overlap.

Combine these two checks in a single function, lmb_overlap_checks() as
both lmb_overlaps_region() and lmb_can_reserve_region() are pretty
similar otherwise.

Signed-off-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
</feed>
