<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/include/lmb.h, branch v2025.04</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/include/lmb.h?h=v2025.04</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/include/lmb.h?h=v2025.04'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2025-03-24T17:12:33Z</updated>
<entry>
<title>lmb: change the return code on lmb_alloc_addr()</title>
<updated>2025-03-24T17:12:33Z</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2025-03-14T10:57:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=67be24906feb6efecce70cd5bfdc2ba8f06d3d5b'/>
<id>urn:sha1:67be24906feb6efecce70cd5bfdc2ba8f06d3d5b</id>
<content type='text'>
Ben reports a failure to boot the kernel on hardware that starts its
physical memory from 0x0.
The reason is that lmb_alloc_addr(), which is supposed to reserve a
specific address, takes the address as the first argument, but then also
returns the address for success or failure and treats 0 as a failure.

Since we already know the address change the prototype to return an int.

Reported-by: Ben Schneider &lt;ben@bens.haus&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Tested-by: Ben Schneider &lt;ben@bens.haus&gt;
Reviewed-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: avoid superfluous value check in lmb_map_update_notify()</title>
<updated>2025-02-20T10:09:33Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2025-02-16T11:12:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=08573d7688a8c133bd4a7354cf928f96e778b42a'/>
<id>urn:sha1:08573d7688a8c133bd4a7354cf928f96e778b42a</id>
<content type='text'>
Instead of testing the value of parameter op at runtime use an enum to
ensure that only valid values are used.

Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</content>
</entry>
<entry>
<title>lmb: Rename _lmb_alloc_addr() to lmb_alloc_addr_flags()</title>
<updated>2024-12-30T19:21:55Z</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2024-12-18T07:02:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1a25191bc1381f320a359a5dc9c835dde4658175'/>
<id>urn:sha1:1a25191bc1381f320a359a5dc9c835dde4658175</id>
<content type='text'>
lmb_alloc_addr_flags() is a wrapper for _lmb_alloc_addr() and it's the
only function using it. Rename _lmb_alloc_addr() to lmb_alloc_addr_flags()
and remove the wrapper.

Reviewed-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Tested-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: Remove lmb_alloc_base_flags()</title>
<updated>2024-12-30T19:21:55Z</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2024-12-18T07:02:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3075708017dc2d1b735ed7c9556da6ff5070f14f'/>
<id>urn:sha1:3075708017dc2d1b735ed7c9556da6ff5070f14f</id>
<content type='text'>
lmb_alloc_base() is just calling lmb_alloc_base_flags() with LMB_NONE.
There's not much we gain from this abstraction, so let's remove the
former add the flags argument to lmb_alloc_base() and make the code
a bit easier to follow.

Reviewed-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Tested-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: Remove lmb_alloc_addr_flags()</title>
<updated>2024-12-30T19:21:55Z</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2024-12-18T07:02:35Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=15e0c5e390ffac7682193b7e1a615898b569deb1'/>
<id>urn:sha1:15e0c5e390ffac7682193b7e1a615898b569deb1</id>
<content type='text'>
lmb_alloc_addr() is just calling lmb_alloc_addr_flags() with LMB_NONE
There's not much we gain from this abstraction, so let's remove the
latter, add a flags argument to lmb_alloc_addr() and make the code a
bit easier to follow.

Reviewed-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Tested-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: Rename free_mem to available_mem</title>
<updated>2024-12-30T19:21:55Z</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2024-12-18T07:02:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=400c34db8957bbe49b15dcc0310697f829c63e01'/>
<id>urn:sha1:400c34db8957bbe49b15dcc0310697f829c63e01</id>
<content type='text'>
free_mem is a misnomer. We never update it with the free memory for
LMB. Instead, it describes all available memory and is checked against
used_mem to decide whether an area is free or not.

So let's rename this field to better match its usage.

Reviewed-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Tested-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: Remove lmb_reserve_flags()</title>
<updated>2024-12-30T19:21:55Z</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2024-12-18T07:02:32Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=900a8951c3b6035c25632438ebc7240cbc77883c'/>
<id>urn:sha1:900a8951c3b6035c25632438ebc7240cbc77883c</id>
<content type='text'>
lmb_reserve() is just calling lmb_reserve_flags() with LMB_NONE.
There's not much we gain from this abstraction.
So let's remove the latter, add the flags argument to lmb_reserve()
and make the code a bit easier to follow.

Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Tested-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: Move enum lmb_flags to a u32</title>
<updated>2024-12-30T19:21:55Z</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2024-12-18T07:02:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3d56c06551d7a54870cfdf8c639b3ff35521b87f'/>
<id>urn:sha1:3d56c06551d7a54870cfdf8c639b3ff35521b87f</id>
<content type='text'>
LMB flags is not an enum anymore. It's currently used as a bitmask
in various places of our code. So make it a u32 which is more
appropriate when dealing with masks.

Reviewed-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Tested-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: Improve kernel-doc comments</title>
<updated>2024-12-30T19:20:24Z</updated>
<author>
<name>Sam Protsenko</name>
<email>semen.protsenko@linaro.org</email>
</author>
<published>2024-12-11T02:25:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=22db5b213703e7ae17b8b2496393253b3664bdd5'/>
<id>urn:sha1:22db5b213703e7ae17b8b2496393253b3664bdd5</id>
<content type='text'>
Fix warnings from kernel-doc script. Improve and unify overall style of
kernel-doc comments in lmb source files. Move all kernel-doc comments
for public functions into the header, as recommended in U-Boot
documentation [1]:

    Non-trivial functions should have a comment which describes what
    they do. If it is an exported function, put the comment in the
    header file so the API is in one place. If it is a static function,
    put it in the C file.

This also takes care of existing duplication. While at it, do a bit of
cosmetic cleanups as well.

No functional change.

[1] doc/develop/codingstyle.rst

Signed-off-by: Sam Protsenko &lt;semen.protsenko@linaro.org&gt;
Acked-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>Merge patch series "Fix IOVA allocation in Apple dart iommu after global LMB mem map changes"</title>
<updated>2024-11-11T15:11:55Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2024-11-11T13:26:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=48fd7e9699f8799690196c76869d59c1e5b2e9a6'/>
<id>urn:sha1:48fd7e9699f8799690196c76869d59c1e5b2e9a6</id>
<content type='text'>
Janne Grunau &lt;j@jannau.net&gt; says:

The changes in "Make LMB memory map global and persistent" [1] break
mapping DMA memory in the USB xHCI driver when using the apple_dart
iommu present on Apple silicon systems.

The IOVA space used by the u-boot driver (low 4GB) and physical memory
do not overlap. The physical memory on this systems starts depending on
the SoC either at 0x10_0000_0000 or 0x100_0000_0000. It make no sense to
manage these distinct regions in a single LMB map. In addition every
device has its own iommu and IO address space so sharing a single memory
map between all iommu instances is not necessary.

To fix this issue restore the used subset (add, alloc and free) of the
previous pointer based LMB interface with "io_" as prefix.

To ensure that low level lmb functions do not use the global LMB
variable reorder lib/lmb.c so that the variable is not visible.

Tested with patches from my "Fix device removal order for Apple dart
iommu" series [2] to fix a separate issue.

The cosmetic commit has two checkpatch warnings in existing code which I
ignored.

[1] https://lore.kernel.org/u-boot/20240826115940.3233167-1-sughosh.ganu@linaro.org/
[2] https://lore.kernel.org/u-boot/20241031-iommu_apple_dart_ordering-v1-0-8a6877946d6b@jannau.net/

Link: https://lore.kernel.org/r/20241111-io_lmb_apple_dart_iommu-v3-0-32c05da51d72@jannau.net
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
</feed>
