<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/include/lmb.h, branch v2025.01</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.01</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/include/lmb.h?h=v2025.01'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2024-11-11T15:11:55Z</updated>
<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>
<entry>
<title>lmb: Add basic io_lmb functionality</title>
<updated>2024-11-11T13:26:44Z</updated>
<author>
<name>Janne Grunau</name>
<email>j@jannau.net</email>
</author>
<published>2024-11-11T06:56:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f6999cb554954c9fde2070cd70919d2d714daf64'/>
<id>urn:sha1:f6999cb554954c9fde2070cd70919d2d714daf64</id>
<content type='text'>
These functions can be used with struct lmb pointers and will be used to
manage IOVA space in the apple_dart iommu driver. This restores part of
the pointer base struct lmb API from before commit ed17a33fed29 ("lmb:
make LMB memory map persistent and global").
io_lmb_add() and io_lmb_free() can trivially reuse exisiting lmb
functions. io_lmb_setup() is separate for unique error log messages.
io_lmb_alloc() is a simplified copy of _lmb_alloc_base() since the
later has unused features and internal use of the global LMB memory map.

Signed-off-by: Janne Grunau &lt;j@jannau.net&gt;
</content>
</entry>
<entry>
<title>lmb: Remove lmb_alloc_flags()</title>
<updated>2024-10-29T22:17:47Z</updated>
<author>
<name>Ilias Apalodimas</name>
<email>ilias.apalodimas@linaro.org</email>
</author>
<published>2024-10-23T15:26:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ede2361998e5e2e6d89abb08f1f0c816d63ed221'/>
<id>urn:sha1:ede2361998e5e2e6d89abb08f1f0c816d63ed221</id>
<content type='text'>
lmb_alloc_flags() &amp; lmb_alloc_base_flags() are just a wrappers for
_lmb_alloc_base(). Since the only difference is the max address of the
allowed allocation which _lmb_alloc_base() already supports with the
LMB_ALLOC_ANYWHERE flag, remove one of them.

Keep the lmb_alloc_base_flags() which also prints an error on failures
and adjust efi_allocate_pages() to only use one of them.

While at it clean up the duplicate function description from the header
file.

Signed-off-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: allow for boards to specify memory map</title>
<updated>2024-10-15T19:45:29Z</updated>
<author>
<name>Sughosh Ganu</name>
<email>sughosh.ganu@linaro.org</email>
</author>
<published>2024-10-15T15:37:11Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=497da0c5ce9084fed8166b18b4f1f9dbe1532034'/>
<id>urn:sha1:497da0c5ce9084fed8166b18b4f1f9dbe1532034</id>
<content type='text'>
Some architectures have special or unique aspects which need
consideration when adding memory ranges to the list of available
memory map. Enable this config in such scenarios which allow
architectures and boards to define their own memory map.

Signed-off-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: notify of any changes to the LMB memory map</title>
<updated>2024-10-15T19:45:29Z</updated>
<author>
<name>Sughosh Ganu</name>
<email>sughosh.ganu@linaro.org</email>
</author>
<published>2024-10-15T15:37:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=2f6191526a1325b6ddb59795a093eca69dbf8976'/>
<id>urn:sha1:2f6191526a1325b6ddb59795a093eca69dbf8976</id>
<content type='text'>
In U-Boot, LMB and EFI are two primary modules who provide memory
allocation and reservation API's. Both these modules operate with the
same regions of memory for allocations. Use the LMB memory map update
event to notify other interested listeners about a change in it's
memory map. This can then be used by the other module to keep track of
available and used memory.

There is no need to send these notifications when the LMB module is
being unit-tested. Add a flag to the lmb structure to indicate if the
memory map is being used for tests, and suppress sending any
notifications when running these unit tests.

Signed-off-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: add a flag to allow suppressing memory map change notification</title>
<updated>2024-10-15T19:45:29Z</updated>
<author>
<name>Sughosh Ganu</name>
<email>sughosh.ganu@linaro.org</email>
</author>
<published>2024-10-15T15:37:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3c6896ad2fb876b0a23202f62a83c0d44380c9ea'/>
<id>urn:sha1:3c6896ad2fb876b0a23202f62a83c0d44380c9ea</id>
<content type='text'>
Add a flag LMB_NONOTIFY that can be passed to the LMB API's for
reserving memory. This will then result in no notification being sent
from the LMB module for the changes to the LMB's memory map.

While here, also add a description of the memory attributes that the
flags signify.

Signed-off-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: add versions of the lmb API with flags</title>
<updated>2024-10-15T19:45:29Z</updated>
<author>
<name>Sughosh Ganu</name>
<email>sughosh.ganu@linaro.org</email>
</author>
<published>2024-10-15T15:37:03Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c8a8f0196bdb068f07a5565bf4ce5f43f5003f6e'/>
<id>urn:sha1:c8a8f0196bdb068f07a5565bf4ce5f43f5003f6e</id>
<content type='text'>
The LMB module is to be used as a backend for allocating and freeing
up memory requested from other modules like EFI. These memory requests
are different from the typical LMB reservations in that memory
required by the EFI module cannot be overwritten, or re-requested. Add
versions of the LMB API functions with flags for allocating and
freeing up memory. The caller can then use these API's for specifying
the type of memory that is required. For now, these functions will be
used by the EFI memory module.

Signed-off-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>cmd: sf: prevent overwriting the reserved memory</title>
<updated>2024-09-20T23:38:16Z</updated>
<author>
<name>Prasad Kummari</name>
<email>prasad.kummari@amd.com</email>
</author>
<published>2024-09-13T07:32:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=33a4dfc703b43f0e8d4da76411ee3f5aee0c8033'/>
<id>urn:sha1:33a4dfc703b43f0e8d4da76411ee3f5aee0c8033</id>
<content type='text'>
Added LMB API to prevent SF command from overwriting reserved
memory areas. The current SPI code does not use LMB APIs for
loading data into memory addresses. To resolve this, LMB APIs
were added to check the load address of an SF command and ensure it
does not overwrite reserved memory addresses. Similar checks are
used in TFTP, serial load, and boot code to prevent overwriting
reserved memory.

Signed-off-by: Prasad Kummari &lt;prasad.kummari@amd.com&gt;
Suggested-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&gt;
</content>
</entry>
<entry>
<title>lmb: remove the unused board_lmb_reserve() function</title>
<updated>2024-09-03T20:08:50Z</updated>
<author>
<name>Sughosh Ganu</name>
<email>sughosh.ganu@linaro.org</email>
</author>
<published>2024-08-26T11:59:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b58caada601b1929fab1e6c3a4fcfc016e1b9fbd'/>
<id>urn:sha1:b58caada601b1929fab1e6c3a4fcfc016e1b9fbd</id>
<content type='text'>
The board_lmb_reserve() function is not being used, and currently
there is only an empty weak function defined. Remove this unused
function.

Signed-off-by: Sughosh Ganu &lt;sughosh.ganu@linaro.org&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: do away with arch_lmb_reserve()</title>
<updated>2024-09-03T20:08:50Z</updated>
<author>
<name>Sughosh Ganu</name>
<email>sughosh.ganu@linaro.org</email>
</author>
<published>2024-08-26T11:59:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6534d26ee9a5217faaba8e49cbd95ce5ef107ee8'/>
<id>urn:sha1:6534d26ee9a5217faaba8e49cbd95ce5ef107ee8</id>
<content type='text'>
All of the current definitions of arch_lmb_reserve() are doing the
same thing -- reserve the region of memory occupied by U-Boot,
starting from the current stack address to the ram_top. Introduce a
function lmb_reserve_uboot_region() which does this, and do away with
the arch_lmb_reserve() function.

Instead of using the current value of stack pointer for starting the
reserved region, have a fixed value, considering the stack size config
value.

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