function.
Signed-off-by: Sughosh Ganu
Reviewed-by: Heinrich Schuchardt
Reviewed-by: Ilias Apalodimas
Reviewed-by: Simon Glass
---
Changes since V4: None
include/tpm_api.h | 4 ++--
lib/tpm_api.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/tpm_api.h b/include
The tpm_startup function returns negative values for error
conditions. Fix the return type of the function to a signed int
instead of a u32.
Signed-off-by: Sughosh Ganu
Reviewed-by: Ilias Apalodimas
Reviewed-by: Simon Glass
---
Changes since V4: None
include/tpm_api.h | 2 +-
lib/tpm_api.c
to comply with the driver model api.
Signed-off-by: Sughosh Ganu
---
Changes since V4:
* Call the existing tpm_get_random API function from the TPM RNG
driver, instead of the tpm{1,2}_get_random API's
* Introduce a new Kconfig symbol TPM_RNG and build the corresponding
driver if the s
randomisation through the
EFI_RNG_PROTOCOL interface.
Signed-off-by: Sughosh Ganu
---
Changes since V4:
* Put a check for CONFIG_TPM_RNG for binding the RNG device with it's
driver in the post_probe callback instead of putting
CONFIG_{SPL,TPL}_BUILD guards
drivers/tpm/tpm-uclass.c
-off-by: Sughosh Ganu
Tested-by: Heinrich Schuchardt
Reviewed-by: Ilias Apalodimas
Reviewed-by: Simon Glass
---
Changes since V4: None
board/emulation/qemu-arm/qemu-arm.c | 42 -
1 file changed, 42 deletions(-)
diff --git a/board/emulation/qemu-arm/qemu-arm.c
b
Use a statically allocated buffer on stack instead of using malloc for
reading the random bytes. Using a local array is faster than
allocating heap memory on every initiation of the command.
Signed-off-by: Sughosh Ganu
---
Changes since V4:
* New patch based on review comments from Simon to
udo device through the TPM chip.
Extend the 'rng' command so that the user can provide the RNG device
number from which the random bytes are to be read. This will be the
device index under the RNG uclass.
Signed-off-by: Sughosh Ganu
Tested-by: Heinrich Schuchardt
Reviewed-by: Ilias Apal
Add a usage document for the 'rng' u-boot command.
Signed-off-by: Sughosh Ganu
Reviewed-by: Ilias Apalodimas
Reviewed-by: Simon Glass
---
Changes since V4:
* Reflect the fact that a maximum of 64 bytes can be read on each
invocation of the 'rng' command
doc/usage/i
The 'rng' command dumps a number of random bytes on the console. Add a
set of tests for the 'rng' command. The test function performs basic
sanity testing of the command.
Since a unit test is being added for the command, enable it by default
in the sandbox platforms.
Signed-
hi Simon,
On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote:
>
> Hi Sughosh,
>
> On Sun, 13 Mar 2022 at 08:49, Sughosh Ganu wrote:
> >
> > Use a statically allocated buffer on stack instead of using malloc for
> > reading the random bytes. Using a local array is f
hi Simon,
On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote:
>
> Hi Sughosh,
>
> On Sun, 13 Mar 2022 at 08:48, Sughosh Ganu wrote:
> >
> > The TPM device has a builtin random number generator(RNG)
> > functionality. Expose the RNG functions of the TPM device to the
hi Simon,
On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote:
>
> Hi Sughosh,
>
> On Sun, 13 Mar 2022 at 08:48, Sughosh Ganu wrote:
> >
> > The TPM device comes with the random number generator(RNG)
> > functionality which is built into the TPM device. Add logic to a
hi Simon,
On Mon, 14 Mar 2022 at 23:54, Simon Glass wrote:
>
> Hi Sughosh,
>
> On Mon, 14 Mar 2022 at 05:43, Sughosh Ganu wrote:
> >
> > hi Simon,
> >
> > On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote:
> > >
> > > Hi Sughosh,
hi Simon,
On Mon, 14 Mar 2022 at 23:55, Simon Glass wrote:
>
> Hi Sughosh,
>
> On Mon, 14 Mar 2022 at 05:39, Sughosh Ganu wrote:
> >
> > hi Simon,
> >
> > On Mon, 14 Mar 2022 at 03:53, Simon Glass wrote:
> > >
> > > Hi Sughosh,
On Thu, 13 Apr 2023 at 19:43, Chris Morgan wrote:
>
> From: Chris Morgan
>
> Add a node for the trng found on RK3588 SoCs.
>
> Changes in V3:
> - Added Reviewed-By tag.
>
> Changes in V2:
> - None
>
> Signed-off-by: Chris Morgan
> Reviewed-by: Kever Yang
> ---
> arch/arm/dts/rk3588s-u-boot.d
On Tue, 18 Apr 2023 at 00:15, Chris Morgan wrote:
>
> On Mon, Apr 17, 2023 at 06:13:18PM +0530, Sughosh Ganu wrote:
> > On Thu, 13 Apr 2023 at 19:43, Chris Morgan wrote:
> > >
> > > From: Chris Morgan
> > >
> > > Add a node for the trng
hi Ilias,
On Thu, 4 May 2023 at 16:15, Ilias Apalodimas
wrote:
>
> Hi Rob,
>
> On Wed, May 03, 2023 at 12:24:39PM -0500, Rob Herring wrote:
> > On Wed, May 3, 2023 at 9:37 AM Ilias Apalodimas
> > wrote:
> > >
> > > Hi Krzysztof,
> > >
> > > On Tue, Apr 11, 2023 at 07:38:11AM +0200, Krzysztof Koz
ixes: 86794052418b ("FWU: Add support for the FWU Multi Bank Update feature")
> Fixes: 023d9c93932c ("efi_loader: remove CONFIG_EFI_SETUP_EARLY")
> Signed-off-by: Heinrich Schuchardt
> ---
> lib/fwu_updates/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 dele
hi Simon,
On Wed, 29 May 2024 at 22:00, Simon Glass wrote:
>
> +Sughosh Ganu for reference
>
>
> On Sun, 31 Dec 2023 at 09:16, Tom Rini wrote:
> >
> > On Sun, Dec 31, 2023 at 04:40:06PM +0100, Heinrich Schuchardt wrote:
> > >
> > >
> > &
ommon code, there is obviously an
increase in the size of the image, moreover since the LMB memory is
now persistent, and the variables do not reside on the stack. I want
to check if there can be ways of decreasing the size impact of the
changes.
Sughosh Ganu (31):
lmb: remove the unused lmb_is
The lmb_is_reserved() API is not used. There is another API,
lmb_is_reserved_flags() which can be used to check if a particular
memory region is reserved. Remove the unused API.
Signed-off-by: Sughosh Ganu
---
include/lmb.h | 11 ---
lib/lmb.c | 5 -
2 files changed, 16
The __lmb_alloc_base() function is only called from within the lmb
module. Moreover, the lmb_alloc() and lmb_alloc_base() API's are good
enough for the allocation API calls. Make the __lmb_alloc_base()
function static.
Signed-off-by: Sughosh Ganu
---
include/lmb.h | 2 --
lib/lmb.c
ff-by: Sughosh Ganu
---
Note: @Mark Kettenis, please review the changes made in the apple dart
driver. I have removed the driver-local LMB instance, but I am not
sure if the current logic makes sense. I would think that it would be
possible to simply use memory region allocated by the LMB module(
the region occupied by
the FDT blob is to be marked as reserved by the LMB module.
Signed-off-by: Sughosh Ganu
---
arch/mips/lib/bootm.c | 2 +-
boot/image-board.c| 2 +-
boot/image-fdt.c | 7 +++
cmd/elf.c | 2 +-
include/image.h
With the move of the LMB structure to a persistent state, there is no
need to declare the variable locally, and pass it as part of the LMB
API's. Remove all local variable instances and change the API's
correspondingly.
Signed-off-by: Sughosh Ganu
---
arch/arc/lib/cache.c
been relocated. Also add the rest of the memory that is
available for allocations to the LMB's memory map.
Signed-off-by: Sughosh Ganu
---
common/board_r.c | 15 +++
include/lmb.h| 14 ++
lib/lmb.c| 14 +-
3 files changed, 42 insertions(+), 1 deletio
With the move to make the LMB allocations persistent and the common
memory regions being reserved during board init, the
lmb_init_and_reserve_range() API can be replaced with a simple
lmb_add() call.
Signed-off-by: Sughosh Ganu
---
boot/bootm.c | 2 +-
include/lmb.h | 2 --
lib/lmb.c | 8
-off-by: Sughosh Ganu
---
arch/arm/mach-apple/board.c | 2 +-
arch/arm/mach-snapdragon/board.c | 2 +-
arch/arm/mach-stm32mp/stm32mp1/cpu.c | 2 +-
cmd/bdinfo.c | 2 +-
cmd/load.c | 2 +-
fs/fs.c | 2
this attribute would indicate that the region cannot be
resized.
Signed-off-by: Sughosh Ganu
---
include/lmb.h | 1 +
lib/lmb.c | 120 --
2 files changed, 107 insertions(+), 14 deletions(-)
diff --git a/include/lmb.h b/include/lmb.h
Add events which would be used for notifying changes in the respective
modules' memory map. This is to be used for having a synchronous view
of the memory that is currently in use, and that is available for
allocations.
Signed-off-by: Sughosh Ganu
---
common/event.c | 4
include/ev
Add a Kconfig symbol to enable getting updates on any memory map
changes that might be done by some other module. This notification
mechanism can then be used to have a synchronous view of allocated and
free memory.
Signed-off-by: Sughosh Ganu
---
lib/Kconfig | 9 +
1 file changed, 9
Add a function to check if a given address falls within the RAM
address used by U-Boot. This will be used to notify other modules if
the address gets allocated, so as to not get re-allocated by some
other module.
Signed-off-by: Sughosh Ganu
---
arch/sandbox/cpu/cpu.c | 5 +
common/board_r.c
s can then be used by the other module to allocate
memory only from available regions, instead of overwriting already
allocated memory.
Signed-off-by: Sughosh Ganu
---
lib/efi_loader/efi_memory.c | 25 +
1 file changed, 25 insertions(+)
diff --git a/lib/efi_loader/efi_memor
s can then be used by the other module to allocate
memory only from available regions, instead of overwriting already
allocated memory.
Signed-off-by: Sughosh Ganu
---
lib/lmb.c | 49 +++--
1 file changed, 47 insertions(+), 2 deletions(-)
diff --git a/l
: Sughosh Ganu
---
lib/efi_loader/efi_memory.c | 70 ++---
1 file changed, 58 insertions(+), 12 deletions(-)
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 435e580fb3..93244161b0 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib
ff-by: Sughosh Ganu
---
lib/Kconfig | 1 +
lib/lmb.c | 34 ++
2 files changed, 35 insertions(+)
diff --git a/lib/Kconfig b/lib/Kconfig
index 9ea02ae006..9e465a748b 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -,6 +,7 @@ config LMB
bool "Enable t
The changes in the EFI memory map are now notified to the LMB
module. There is therefore no need to explicitly get the efi memory
map and set aside the EFI allocated memory.
Signed-off-by: Sughosh Ganu
---
lib/lmb.c | 35 ---
1 file changed, 35 deletions(-)
diff
memory range has other side effects. On the
other hand, the sandbox iommu test expects to see this particular
value of the DVA. Use the DVA address directly, instead of mapping it
in the LMB memory map, and then have it allocated.
Signed-off-by: Sughosh Ganu
---
drivers/iommu/sandbox_iommu.c | 7
The LMB memory is typically not needed very early in the platform's
boot. Do not add memory to the LMB map before relocation. Reservation
of common areas and adding of memory is done after relocation.
Signed-off-by: Sughosh Ganu
---
board/xilinx/common/board.c
read the file to that address.
Signed-off-by: Sughosh Ganu
---
test/boot/cedit.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/test/boot/cedit.c b/test/boot/cedit.c
index aa41719048..1f4147da89 100644
--- a/test/boot/cedit.c
+++ b/test/boot/cedit.c
@@ -8,6 +8,7
With the addition of two events for notification of any changes to
memory that is occupied and is free, the output of the event_dump.py
script has changed. Update the expected event log to incorporate this
change.
Signed-off-by: Sughosh Ganu
---
test/py/tests/test_event_dump.py | 2 ++
1 file
tests.
Signed-off-by: Sughosh Ganu
---
test/lib/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/lib/Makefile b/test/lib/Makefile
index e75a263e6a..9154e07993 100644
--- a/test/lib/Makefile
+++ b/test/lib/Makefile
@@ -9,7 +9,7 @@ obj-$(CONFIG_EFI_LOADER
every test.
Signed-off-by: Sughosh Ganu
---
include/lmb.h | 4
lib/lmb.c | 17 +
test/lib/lmb.c | 18 ++
3 files changed, 39 insertions(+)
diff --git a/include/lmb.h b/include/lmb.h
index 1d4cd255d2..08ece0a90b 100644
--- a/include/lmb.h
+++ b/include
Memory managed by LMB is now persistent and global. With that, it
could be possible for multiple callers to try to add memory that has
already been added. Add a test case to check that the LMB module
handles it as expected.
Signed-off-by: Sughosh Ganu
---
test/lib/lmb.c | 16
1
The LMB code can now accept reserving and adding overlapping regions
of memory. Adjust the test for checking the reservation of overlapping
memory regions to work with this corresponding change in the LMB code.
Signed-off-by: Sughosh Ganu
---
test/lib/lmb.c | 8
1 file changed, 4
suite, and thus would not interfere with the running
of the rest of the tests.
Signed-off-by: Sughosh Ganu
---
test/lib/lmb.c | 49 -
1 file changed, 24 insertions(+), 25 deletions(-)
diff --git a/test/lib/lmb.c b/test/lib/lmb.c
index 67a6be5bc3..813f7
The LMB code has been changed to make the memory reservations
persistent and global. Make corresponding change the the
lmb_test_dump_all() function to print the global LMB added and
reserved memory.
Signed-off-by: Sughosh Ganu
---
test/cmd/bdinfo.c | 12 ++--
1 file changed, 6
The LMB memory map is now persistent and global. There is therefore no
need to add memory to the LMB memory map as part of the bdinfo
command. Only dump the current available and reserved memory as part
of the bdinfo command.
Signed-off-by: Sughosh Ganu
---
cmd/bdinfo.c | 1 -
1 file changed, 1
With the changes to add notifications for any changes to the LMB map,
the size of the image exceeds the limit set. Bump up the image size
limit for now to get the platform to build.
This is not for committing.
Signed-off-by: Sughosh Ganu
---
Note: @Fabio Estevam, please check if it would be
Not for committing.
Signed-off-by: Sughosh Ganu
---
cmd/Makefile | 1 +
cmd/efi_memory.c | 155 +++
2 files changed, 156 insertions(+)
create mode 100644 cmd/efi_memory.c
diff --git a/cmd/Makefile b/cmd/Makefile
index 87133cc27a..35fcc4af5a
Add a command to dump the EFI memory map.
Not for committing.
Signed-off-by: Sughosh Ganu
---
cmd/Makefile| 1 +
cmd/efi_map_dump.c | 28
include/efi_loader.h| 2 ++
lib/efi_loader/efi_memory.c | 32
On Sat, 8 Jun 2024 at 10:09, Heinrich Schuchardt wrote:
>
> On 6/7/24 20:52, Sughosh Ganu wrote:
> > The LMB code has been changed so that the memory reservations and
> > allocations are now persistent and global. With this change, the
> > design of the LMB tests needs t
On Sat, 8 Jun 2024 at 09:07, Heinrich Schuchardt wrote:
>
>
>
> Am 7. Juni 2024 20:52:39 MESZ schrieb Sughosh Ganu :
> >Not for committing.
>
> Best put "DON'T MERGE" into the title to avoid mishaps in future versions.
Will do.
>
> In the final
On Sat, 8 Jun 2024 at 09:03, Heinrich Schuchardt wrote:
>
>
>
> Am 7. Juni 2024 20:52:40 MESZ schrieb Sughosh Ganu :
> >Add a command to dump the EFI memory map.
>
> What are you missing in 'efidebug memmap'?
Nothing. I wasn't aware of this sub-command
hi Ilias,
On Mon, 10 Jun 2024 at 17:15, Ilias Apalodimas
wrote:
>
> On Fri, 7 Jun 2024 at 21:54, Sughosh Ganu wrote:
> >
> > Add a Kconfig symbol to enable getting updates on any memory map
> > changes that might be done by some other module. This notification
> >
hi Ilias,
On Mon, 10 Jun 2024 at 17:34, Ilias Apalodimas
wrote:
>
> Hi Sughosh
>
>
> On Fri, 7 Jun 2024 at 21:54, Sughosh Ganu wrote:
> >
> > Allow for resizing of LMB regions if the region attributes match. The
> > current code returns a failure status on det
On Mon, 10 Jun 2024 at 17:40, Ilias Apalodimas
wrote:
>
> On Fri, 7 Jun 2024 at 21:54, Sughosh Ganu wrote:
> >
> > There are events that would be used to notify other interested modules
> > of any changes in available and occupied memory. This would happen
> > when
On Mon, 10 Jun 2024 at 18:17, Ilias Apalodimas
wrote:
>
> On Mon, 10 Jun 2024 at 15:20, Sughosh Ganu wrote:
> >
> > hi Ilias,
> >
> > On Mon, 10 Jun 2024 at 17:34, Ilias Apalodimas
> > wrote:
> > >
> > > Hi Sughosh
> > &g
On Mon, 10 Jun 2024 at 18:29, Heinrich Schuchardt wrote:
>
> On 10.06.24 14:20, Sughosh Ganu wrote:
> > hi Ilias,
> >
> > On Mon, 10 Jun 2024 at 17:34, Ilias Apalodimas
> > wrote:
> >>
> >> Hi Sughosh
> >>
> >>
> >> On Fr
hi Ilias,
On Mon, 10 Jun 2024 at 19:52, Ilias Apalodimas
wrote:
>
> Hi Sughosh
>
> On Mon, 10 Jun 2024 at 15:57, Sughosh Ganu wrote:
> >
> > On Mon, 10 Jun 2024 at 18:17, Ilias Apalodimas
> > wrote:
> > >
> > > On Mon, 10 Jun 2024 at 15:20, Sugh
hi Simon,
On Mon, 10 Jun 2024 at 19:25, Simon Glass wrote:
>
> Hi Sughosh,
>
> On Thu, 6 Jun 2024 at 13:18, Sughosh Ganu wrote:
> >
> > hi Simon,
> >
> > On Wed, 29 May 2024 at 22:00, Simon Glass wrote:
> > >
> > > +Sughosh Ganu for referen
hi Ilias,
On Mon, 10 Jun 2024 at 19:48, Ilias Apalodimas
wrote:
>
> Hi Sughosh
>
> On Mon, 10 Jun 2024 at 15:25, Sughosh Ganu wrote:
> >
> > On Mon, 10 Jun 2024 at 17:40, Ilias Apalodimas
> > wrote:
> > >
> > > On Fri, 7 Jun 2024 at 21:54, Sugho
On Mon, 10 Jun 2024 at 20:22, Sughosh Ganu wrote:
>
> hi Ilias,
>
> On Mon, 10 Jun 2024 at 19:48, Ilias Apalodimas
> wrote:
> >
> > Hi Sughosh
> >
> > On Mon, 10 Jun 2024 at 15:25, Sughosh Ganu wrote:
> > >
> > > On Mon, 10 Jun 2024 at
hi Simon,
On Mon, 10 Jun 2024 at 20:33, Simon Glass wrote:
>
> Hi Sughosh,
>
> On Mon, 10 Jun 2024 at 08:40, Sughosh Ganu wrote:
> >
> > hi Simon,
> >
> > On Mon, 10 Jun 2024 at 19:25, Simon Glass wrote:
> > >
> > > Hi Sughosh,
> &
On Mon, 10 Jun 2024 at 20:47, Heinrich Schuchardt wrote:
>
> On 07.06.24 20:52, Sughosh Ganu wrote:
> > There are events that would be used to notify other interested modules
> > of any changes in available and occupied memory. This would happen
> > when a module allocate
On Mon, 10 Jun 2024 at 23:01, Tom Rini wrote:
>
> On Sat, Jun 08, 2024 at 12:22:17AM +0530, Sughosh Ganu wrote:
> > With the changes to make the Logical Memory Block(LMB) allocations
> > persistent and with the common memory regions being reserved during
> > board init,
On Mon, 10 Jun 2024 at 23:14, Tom Rini wrote:
>
> On Sat, Jun 08, 2024 at 12:22:31AM +0530, Sughosh Ganu wrote:
>
> > The LMB memory map is now persistent and global. Running the tests for
> > the LMB module will result in the memory map getting reset, and this
> > wi
On Tue, 11 Jun 2024 at 02:35, Tom Rini wrote:
>
> On Sat, Jun 08, 2024 at 12:22:09AM +0530, Sughosh Ganu wrote:
>
> > The aim of this patch series is to fix the current state of
> > incoherence between modules when it comes to memory usage. The primary
> > issue that t
On Tue, 11 Jun 2024 at 14:42, Heinrich Schuchardt wrote:
>
> On 07.06.24 20:52, Sughosh Ganu wrote:
> > The changes in the EFI memory map are now notified to the LMB
> > module. There is therefore no need to explicitly get the efi memory
> > map and set aside
On Tue, 11 Jun 2024 at 14:47, Heinrich Schuchardt wrote:
>
> On 07.06.24 20:52, Sughosh Ganu wrote:
> > Allow for resizing of LMB regions if the region attributes match. The
> > current code returns a failure status on detecting an overlapping
> > address. This worked up
On Tue, 11 Jun 2024 at 15:31, Heinrich Schuchardt wrote:
>
> On 11.06.24 10:55, Sughosh Ganu wrote:
> > On Mon, 10 Jun 2024 at 23:14, Tom Rini wrote:
> >>
> >> On Sat, Jun 08, 2024 at 12:22:31AM +0530, Sughosh Ganu wrote:
> >>
> >>> The LMB m
On Tue, 11 Jun 2024 at 15:47, Heinrich Schuchardt wrote:
>
> On 07.06.24 20:52, Sughosh Ganu wrote:
> > There are events that would be used to notify other interested modules
> > of any changes in available and occupied memory. This would happen
> > when a module allocate
hi Ilias,
On Wed, 12 Jun 2024 at 11:19, Ilias Apalodimas
wrote:
>
> [...]
>
> > > > > > > > > + struct event_lmb_map_update *lmb_map =
> > > > > > > > > &event->data.lmb_map;
> > > > > > > > > +
> > > > > > > > > + addr = (uintptr_t)map_sysmem(lmb_map->base, 0);
> > > > > > > > > + pages =
On Wed, 12 Jun 2024 at 12:16, Ilias Apalodimas
wrote:
>
> On Mon, 10 Jun 2024 at 18:54, Simon Glass wrote:
> >
> > Hi,
> >
> > On Mon, 10 Jun 2024 at 09:42, Sughosh Ganu wrote:
> > >
> > > On Mon, 10 Jun 2024 at 20:47, Heinrich Schuchardt
On Thu, 13 Jun 2024 at 22:57, Heinrich Schuchardt wrote:
>
> On 13.06.24 18:59, Simon Glass wrote:
> > Hi Tom,
> >
> > On Thu, 13 Jun 2024 at 09:42, Tom Rini wrote:
> >>
> >> On Thu, Jun 13, 2024 at 09:22:15AM -0600, Simon Glass wrote:
> >>> Hi Tom,
> >>>
> >>> On Wed, 12 Jun 2024 at 15:40, Tom R
11b27a ("binman: capsule: Add support for generating...")
> ---
Acked-by: Sughosh Ganu
Although I don't think this warrants a Fixes tag. It is not fixing any
issue as such.
-sughosh
>
> (no changes since v1)
>
> tools/binman/etype/efi_capsule.py | 1 -
> 1 file c
ial case with str_to_list()
alist: Add support for an allocated pointer list
lib: Convert str_to_list() to use alist
Sughosh Ganu (44):
alist: add a couple of helper functions
alist: add a function declaration for alist_expand_by()
lmb: remove the unused lmb_is_reserved() function
lmb: s
From: Simon Glass
At present in tests it is possible to cause an out-of-memory condition
with malloc() but not realloc(). Add support to realloc() too, so code
which uses that function can be tested.
Signed-off-by: Simon Glass
Signed-off-by: Sughosh Ganu
---
common/dlmalloc.c | 4
1
From: Simon Glass
The current implementation can return an extra result at the end when
the string ends with a space. Fix this by adding a special case.
Signed-off-by: Simon Glass
Signed-off-by: Sughosh Ganu
---
lib/strto.c | 4 +++-
test/str_ut.c | 4 +---
2 files changed, 4 insertions
the code.
Introduce a new data structure, which is a variable-sized list of structs
each of the same, pre-set size. It provides O(1) access and is reasonably
efficient at expanding linearly, since it doubles in size when it runs out
of space.
Signed-off-by: Simon Glass
Signed-off-by: Sughosh Ganu
From: Simon Glass
Use this new data structure in the utility function.
Signed-off-by: Simon Glass
Signed-off-by: Sughosh Ganu
---
lib/strto.c | 35 +++
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/lib/strto.c b/lib/strto.c
index f83ac67c66
Add a couple of helper functions to detect an empty and full alist.
Signed-off-by: Sughosh Ganu
---
Changes since V1: New patch
include/alist.h | 22 ++
1 file changed, 22 insertions(+)
diff --git a/include/alist.h b/include/alist.h
index a68afc9fff..bab146c35d 100644
The alist_expand_by() function is a global function. Add a declaration
for the function in the header.
Signed-off-by: Sughosh Ganu
---
Changes since V1: New patch
include/alist.h | 9 +
1 file changed, 9 insertions(+)
diff --git a/include/alist.h b/include/alist.h
index bab146c35d
The lmb_is_reserved() API is not used. There is another API,
lmb_is_reserved_flags() which can be used to check if a particular
memory region is reserved. Remove the unused API.
Signed-off-by: Sughosh Ganu
Reviewed-by: Ilias Apalodimas
---
Changes since V1: None
include/lmb.h | 11
The __lmb_alloc_base() function is only called from within the lmb
module. Moreover, the lmb_alloc() and lmb_alloc_base() API's are good
enough for the allocation API calls. Make the __lmb_alloc_base()
function static.
Signed-off-by: Sughosh Ganu
Reviewed-by: Ilias Apalodimas
---
Changes
The LMB module will be changed to have persistent and global memory
maps of available and used memory. With this change, there won't be
any need to explicitly initialise the LMB memory maps. Remove the call
to the lmb_init() function.
Signed-off-by: Sughosh Ganu
---
Changes since V1: New
With the move of the LMB structure to a persistent state, there is no
need to declare the variable locally, and pass it as part of the LMB
API's. Remove all local variable instances and change the API's
correspondingly.
Signed-off-by: Sughosh Ganu
---
Changes since V1: None
ar
the region occupied by
the FDT blob is to be marked as reserved by the LMB module.
Signed-off-by: Sughosh Ganu
---
Changes since V1:
* Use true/false identifiers for bool instead of 1/0
* Fix the argument passed to the function in arch/mips/lib/bootm.c
arch/mips/lib/bootm.c | 2 +-
boot
this attribute would indicate that the region cannot be
resized.
Signed-off-by: Sughosh Ganu
---
Changes since V1:
* Do the check for the region flags in lmb_resize_regions() and
lmb_merge_overlap_regions() to decide on merging the overlapping
regions.
include/lmb.h | 1 +
lib/lmb.c
e for the available(free) memory,
and one for the used memory. Once full, the list can then be extended
at runtime.
Signed-off-by: Sughosh Ganu
---
Changes since V1:
* Use alloced list structure for the available and reserved memory
lists instead of static arrays.
* Corresponding changes in the
the earlier implementation of static arrays.
Signed-off-by: Sughosh Ganu
---
Changes since V1: New patch
configs/a3y17lte_defconfig | 1 -
configs/a5y17lte_defconfig | 1 -
configs/a7y17lte_defconfig | 1 -
configs/apple_m1_defconfig | 1 -
configs
The LMB memory map is now persistent and global, and the
CONFIG_LMB_USE_MAX_REGIONS config symbol has now been removed. Remove
the corresponding lmb test case.
Signed-off-by: Sughosh Ganu
---
Changes since V1: New patch
test/lib/lmb.c | 67 --
1
heap in SPL.
Signed-off-by: Sughosh Ganu
---
Changes since V1: New patch
lib/Kconfig | 12 +++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/lib/Kconfig b/lib/Kconfig
index 072ed0ecfa..7eea517b3b 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -1103,7 +1103,17 @@ config
With the introduction of separate config symbols for the SPL phase of
U-Boot, the condition checks need to be tweaked so that platforms that
enable the LMB module in SPL are also able to call the LMB API's. Use
the appropriate condition checks to achieve this.
Signed-off-by: Sughosh
Introduce a function lmb_add_memory() to add available memory to the
LMB memory map. Call this function during board init once the LMB data
structures have been initialised.
Signed-off-by: Sughosh Ganu
---
Changes since V1:
* Add memory only till ram_top to the LMB memory map, instead of all
With the changes to make the LMB reservations persistent, the common
memory regions are being added during board init. Remove the
now superfluous lmb_init_and_reserve() function.
Signed-off-by: Sughosh Ganu
---
Changes since V1:
* Removed the replacement of lmb_init_and_reserve() with
n the board's DTB.
Mark these regions of memory with the LMB_NOOVERWRITE flag to indicate
that these regions cannot be re-requested or overwritten.
Signed-off-by: Sughosh Ganu
---
Changes since V1:
* Mark the reserved regions as LMB_NOOVERWRITE.
* Call the lmb_reserve_common() function in U-B
With the move to make the LMB allocations persistent and the common
memory regions being reserved during board init, there is no need for
an explicit reservation of a memory range. Remove the
lmb_init_and_reserve_range() function.
Signed-off-by: Sughosh Ganu
Reviewed-by: Ilias Apalodimas
the board init.
Signed-off-by: Sughosh Ganu
---
Changes since V1:
* Initialise the lmb structures as part of board init.
* Initialise the lmb structure durint SPL init when enabled.
common/board_r.c | 4
common/spl/spl.c | 4
include/lmb.h| 11 +++
lib/lmb.c| 20
Use the BIT macro for assigning values to the LMB flags instead of
assigning random values to them.
Signed-off-by: Sughosh Ganu
---
Changes since V1: New patch based on review comment from Heinrich
include/lmb.h | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include
1101 - 1200 of 1721 matches
Mail list logo