Re: [RFC PATCH 2/4] lmb: Tighten up the code in lmb_add_region_flags()

2024-08-01 Thread Sughosh Ganu
On Thu, 1 Aug 2024 at 21:42, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 1 Aug 2024 at 08:58, Sughosh Ganu wrote: > > > > On Tue, 30 Jul 2024 at 20:10, Simon Glass wrote: > > > > > > This function has more special cases than it needs. Simplify i

Re: [RFC PATCH 2/4] lmb: Tighten up the code in lmb_add_region_flags()

2024-08-01 Thread Sughosh Ganu
On Thu, 1 Aug 2024 at 20:28, Sughosh Ganu wrote: > > On Tue, 30 Jul 2024 at 20:10, Simon Glass wrote: > > > > This function has more special cases than it needs. Simplify it to > > reduce code size and complexity. > > > > Signed-off-by: Simon Gl

Re: [RFC PATCH 2/4] lmb: Tighten up the code in lmb_add_region_flags()

2024-08-01 Thread Sughosh Ganu
On Tue, 30 Jul 2024 at 20:10, Simon Glass wrote: > > This function has more special cases than it needs. Simplify it to > reduce code size and complexity. > > Signed-off-by: Simon Glass > --- > > lib/lmb.c | 57 +++ > 1 file changed, 19

Re: [PATCH 33/40] test: cedit: use allocated address for reading file

2024-07-31 Thread Sughosh Ganu
On Wed, 31 Jul 2024 at 20:08, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 31 Jul 2024 at 01:26, Sughosh Ganu wrote: > > > > On Mon, 29 Jul 2024 at 20:58, Simon Glass wrote: > > > > > > Hi Sughosh, > > > > > > On Mon, 29 Jul 2024

[PATCH] list: use list_count_nodes() to count list entries

2024-07-31 Thread Sughosh Ganu
Use the API function list_count_nodes() to count the number of list entries. Signed-off-by: Sughosh Ganu --- Note: To be applied on top of efi-2024-10-rc2 boot/scene.c | 8 +--- drivers/mtd/ubi/fastmap.c | 8 +++- fs/yaffs2/yaffs_guts.c| 5 ++--- lib

Re: [PATCH 1/1] efi_loader: use list_count_nodes() in efi_protocols_per_handle()

2024-07-31 Thread Sughosh Ganu
On Wed, 31 Jul 2024 at 13:43, Heinrich Schuchardt wrote: > > Simplify the code by using the list_count_nodes() function. > > Signed-off-by: Heinrich Schuchardt > --- I have made changes to the files that you mentioned in your review, and plan to come up with a v2 once the CI goes through.

Re: [PATCH 33/40] test: cedit: use allocated address for reading file

2024-07-31 Thread Sughosh Ganu
On Mon, 29 Jul 2024 at 20:58, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 29 Jul 2024 at 02:53, Sughosh Ganu wrote: > > > > On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > > > > > Hi Sughosh, > > > > > > On Wed, 24 Jul 2024 a

Re: [PATCH 11/40] lmb: make LMB memory map persistent and global

2024-07-31 Thread Sughosh Ganu
On Wed, 31 Jul 2024 at 01:17, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:03, Sughosh Ganu wrote: > > > > The current LMB API's for allocating and reserving memory use a > > per-caller based memory view. Memory allocated by a caller can then

[PATCH 5/5] dm: use list_count_nodes() for counting list nodes

2024-07-30 Thread Sughosh Ganu
The linux kernel has the list_count_nodes() API functions which is used for counting nodes of a list. This has now been imported in U-Boot as part of an earlier commit. Use this function and drop the list_count_items(). Signed-off-by: Sughosh Ganu --- drivers/core/util.c | 14

[PATCH 4/5] efi_memory: get the efi_mem_list node directly

2024-07-30 Thread Sughosh Ganu
Use the list_for_each_entry() API to get the efi_mem_list node directly, instead of making an additional call to list_entry(). Signed-off-by: Sughosh Ganu --- lib/efi_loader/efi_memory.c | 25 - 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/lib

[PATCH 3/5] efi_memory: avoid possible null pointer dereference

2024-07-30 Thread Sughosh Ganu
Populate the previous memory descriptor node pointer only after it's parent struct has been initialised. The compiler fixes this logic to do the right thing, but it is better to have correct code in place. Signed-off-by: Sughosh Ganu --- lib/efi_loader/efi_memory.c | 3 ++- 1 file changed, 2

[PATCH 2/5] efi_memory: use list_count_nodes() to count list entries

2024-07-30 Thread Sughosh Ganu
Use the API function list_count_nodes() to count the number of EFI memory map entries. Signed-off-by: Sughosh Ganu --- lib/efi_loader/efi_memory.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 12cf23fa3f

[PATCH 1/5] linux: list: add a function to count list nodes

2024-07-30 Thread Sughosh Ganu
Add a function to count the nodes of a list. Taken from linux 6.11-rc1 tag commit 8400291e289e. Signed-off-by: Sughosh Ganu --- include/linux/list.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/linux/list.h b/include/linux/list.h index 6910721c00..0f9d939b05

Re: [PATCH 04/40] lib: Convert str_to_list() to use alist

2024-07-29 Thread Sughosh Ganu
On Mon, 29 Jul 2024 at 23:46, Tom Rini wrote: > > On Mon, Jul 29, 2024 at 09:28:57AM -0600, Simon Glass wrote: > > Hi Sughosh, > > > > On Sun, 28 Jul 2024 at 12:07, Sughosh Ganu wrote: > > > > > > On Thu, 25 Jul 2024 at 18:24, Sughosh Ganu > > &g

Re: [PATCH 04/40] lib: Convert str_to_list() to use alist

2024-07-29 Thread Sughosh Ganu
On Mon, 29 Jul 2024 at 20:59, Simon Glass wrote: > > Hi Sughosh, > > On Sun, 28 Jul 2024 at 12:07, Sughosh Ganu wrote: > > > > On Thu, 25 Jul 2024 at 18:24, Sughosh Ganu wrote: > > > > > > On Thu, 25 Jul 2024 at 02:24, Tom Rini wrote: > > >

Re: [PATCH 06/40] alist: add a couple of helper functions

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:03, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:03, Sughosh Ganu wrote: > > > > Add a couple of helper functions to detect an empty and full alist. > > > > Signed-off-by: Sughosh Ganu > > --- > >

Re: [PATCH 40/40] lmb: ut: re-enable unit tests

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:03, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:06, Sughosh Ganu wrote: > > > > All the changes needed for making the LMB memory map persistent and > > global have been made, including making corresponding changes i

Re: [PATCH 36/40] test: lmb: add a separate class of unit tests for lmb

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:03, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:05, Sughosh Ganu wrote: > > > > Add the LMB unit tests under a separate class of tests. The LMB tests > > involve changing the LMB's memory map. With the memory map

Re: [PATCH 33/40] test: cedit: use allocated address for reading file

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:05, Sughosh Ganu wrote: > > > > Instead of a randomly selected address, use an LMB allocated one for > > reading the file into memory. With the LMB map now being persiste

Re: [PATCH 30/40] sandbox: iommu: remove lmb allocation in the driver

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:05, Sughosh Ganu wrote: > > > > The sandbox iommu driver uses the LMB module to allocate a particular > > range of memory for the device virtual address(DVA). This

Re: [PATCH 27/40] spl: sandbox: initialise the ram banksize in spl

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:05, Sughosh Ganu wrote: > > > > Initialise the ram bank information for sandbox in SPL. This is needed > > for initialising the LMB memory map as part of the platform ini

Re: [PATCH 25/40] sandbox: move the TCG event log to the start of ram memory

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu wrote: > > > > The TCG event log buffer is being set at the end of ram memory. This > > region of memory is to be reserved as LMB_NOMAP memory in the L

Re: [PATCH 24/40] lmb: add a common implementation of arch_lmb_reserve()

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu wrote: > > > > Almost all of the current definitions of arch_lmb_reserve() are doing > > the same thing. The only exception in a couple of cases

Re: [PATCH 23/40] lmb: add a flags parameter to the API's

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu wrote: > > > > Add a flags parameter to the LMB API functions. The parameter can then > > be used to pass any other type of reservations or allocat

Re: [PATCH 22/40] lmb: init: initialise the lmb data structures during board init

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu wrote: > > > > The memory map maintained by the LMB module is now persistent and > > global. This memory map is being maintained through the alloce

Re: [PATCH 17/40] lmb: introduce a function to add memory to the lmb memory map

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu wrote: > > > > Introduce a function lmb_add_memory() to add available memory to the > > LMB memory map. Call this function during board init once the LMB

Re: [PATCH 16/40] lmb: allow lmb module to be used in SPL

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu wrote: > > > > With the introduction of separate config symbols for the SPL phase of > > U-Boot, the condition checks need to be tweaked so that pla

Re: [PATCH 15/40] lmb: config: add lmb config symbols for SPL

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu wrote: > > > > Add separate config symbols for enabling the LMB module for the SPL > > phase. The LMB module implementation now relies on alloced list dat

Re: [PATCH 11/40] lmb: make LMB memory map persistent and global

2024-07-29 Thread Sughosh Ganu
On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:03, Sughosh Ganu wrote: > > > > The current LMB API's for allocating and reserving memory use a > > per-caller based memory view. Memory allocated by a caller can then

Re: [PATCH 05/40] spl: alloc: call full alloc functions if malloc pool is available

2024-07-29 Thread Sughosh Ganu
hi Simon, On Fri, 26 Jul 2024 at 05:02, Simon Glass wrote: > > Hi Sughosh, > > On Wed, 24 Jul 2024 at 00:03, Sughosh Ganu wrote: > > > > If the malloc simple functionality is enabled in SPL, it is not > > possible to call the full-implementation alloc functions eve

Re: [PATCH 04/40] lib: Convert str_to_list() to use alist

2024-07-28 Thread Sughosh Ganu
On Thu, 25 Jul 2024 at 18:24, Sughosh Ganu wrote: > > On Thu, 25 Jul 2024 at 02:24, Tom Rini wrote: > > > > On Wed, Jul 24, 2024 at 11:31:48AM +0530, Sughosh Ganu wrote: > > > > > From: Simon Glass > > > > > > Use this new data structure in the

Re: [PATCH 04/40] lib: Convert str_to_list() to use alist

2024-07-25 Thread Sughosh Ganu
On Thu, 25 Jul 2024 at 02:24, Tom Rini wrote: > > On Wed, Jul 24, 2024 at 11:31:48AM +0530, Sughosh Ganu wrote: > > > From: Simon Glass > > > > Use this new data structure in the utility function. > > > > Signed-off-by: Simon Glass > > Signed-off-by

[PATCH 40/40] lmb: ut: re-enable unit tests

2024-07-24 Thread Sughosh Ganu
All the changes needed for making the LMB memory map persistent and global have been made, including making corresponding changes in the test code. Re-enable the unit tests on the platforms. Signed-off-by: Sughosh Ganu --- Changes since rfc: New patch configs/sandbox64_defconfig| 4

[PATCH 38/40] test: bdinfo: dump the global LMB memory map

2024-07-24 Thread Sughosh Ganu
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 available and used memory. Signed-off-by: Sughosh Ganu --- Changes since rfc: None test/cmd/bdinfo.c | 28

[PATCH 39/40] sandbox: adjust load address of couple of tests

2024-07-24 Thread Sughosh Ganu
The TCG event log has now been moved to the start of the memory, and occupies 8KB of memory. Make a corresponding change to the load address in a couple of tests so that it does not overlap with the TCG event log. Signed-off-by: Sughosh Ganu --- Changes since rfc: New patch test/py/tests

[PATCH 36/40] test: lmb: add a separate class of unit tests for lmb

2024-07-24 Thread Sughosh Ganu
on completion of these tests. Signed-off-by: Sughosh Ganu --- Changes since rfc: None include/test/suites.h| 1 + test/Kconfig | 9 ++ test/Makefile| 1 + test/cmd_ut.c| 7 + test/lib/Makefile| 1 - test/{lib/lmb.c => lmb_u

[PATCH 37/40] test: lmb: invoke the LMB unit tests from a separate script

2024-07-24 Thread Sughosh Ganu
With the LMB tests moved under a separate class of unit tests, invoke these from a separate script which would allow for a system reset once the tests have been run. This enables clearing up the LMB memory map after having run the tests. Signed-off-by: Sughosh Ganu --- Changes since rfc: None

[PATCH 35/40] test: lmb: run lmb tests only manually

2024-07-24 Thread Sughosh Ganu
be invoked through a separate test, and thus would not interfere with the running of the rest of the tests. Signed-off-by: Sughosh Ganu --- Changes since rfc: None test/lib/lmb.c | 41 - 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/test

[PATCH 33/40] test: cedit: use allocated address for reading file

2024-07-24 Thread Sughosh Ganu
and then read the file to that address. Signed-off-by: Sughosh Ganu --- Changes since rfc: None test/boot/cedit.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/boot/cedit.c b/test/boot/cedit.c index fd19da0a0c..6078b7cc0f 100644 --- a/test/boot/cedit.c +++ b/test/boot

[PATCH 34/40] test: lmb: tweak the tests for the persistent lmb memory map

2024-07-24 Thread Sughosh Ganu
to initialise and cleanup the lists. These functions will be invoked from every test to start the memory map from a clean slate. Signed-off-by: Sughosh Ganu --- Changes since rfc: * Change the lmb_mem_regions_init() function to have it called from the lmb tests as well. include/lmb.h | 24 +++- lib

[PATCH 31/40] zynq: lmb: do not add to lmb map before relocation

2024-07-24 Thread Sughosh Ganu
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 --- Changes since rfc: None board/xilinx/common/board.c | 31

[PATCH 32/40] stm32mp: do not add lmb memory before relocation

2024-07-24 Thread Sughosh Ganu
platforms. Signed-off-by: Sughosh Ganu --- Changes since rfc: New patch arch/arm/mach-stm32mp/dram_init.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-stm32mp/dram_init.c b/arch/arm/mach-stm32mp/dram_init.c index 97d894d05f..32f2a95ed8 100644

[PATCH 30/40] sandbox: iommu: remove lmb allocation in the driver

2024-07-24 Thread Sughosh Ganu
this 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 --- Changes since rfc: None drivers/iommu

[PATCH 28/40] lmb: config: make lmb config symbol def_bool

2024-07-24 Thread Sughosh Ganu
The LMB module provides allocation/reservation API's, primarily for loading images to memory. This is functionality which is used by all boards. Make the config symbol used for the main U-Boot image as def_bool and enable it by default. Signed-off-by: Sughosh Ganu --- Changes since rfc: New

[PATCH 29/40] sandbox: spl: enable lmb config for SPL

2024-07-24 Thread Sughosh Ganu
Enable the LMB config in SPL. This helps in testing the LMB code in SPL on sandbox. Signed-off-by: Sughosh Ganu --- Changes since rfc: * Enable config for sandbox_noinst configs/sandbox_noinst_defconfig | 1 + configs/sandbox_spl_defconfig| 1 + 2 files changed, 2 insertions(+) diff --git

[PATCH 26/40] spl: call spl_board_init() at the end of the spl init sequence

2024-07-24 Thread Sughosh Ganu
of the LMB memory map. Signed-off-by: Sughosh Ganu --- Changes since rfc: New patch common/spl/spl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 38ac0608bb..891edde156 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -713,9

[PATCH 27/40] spl: sandbox: initialise the ram banksize in spl

2024-07-24 Thread Sughosh Ganu
Initialise the ram bank information for sandbox in SPL. This is needed for initialising the LMB memory map as part of the platform init. Signed-off-by: Sughosh Ganu --- Changes since rfc: New patch arch/sandbox/cpu/spl.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff

[PATCH 24/40] lmb: add a common implementation of arch_lmb_reserve()

2024-07-24 Thread Sughosh Ganu
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 --- Changes since rfc: None arch/arc/lib/cache.c| 14 -- arch/arm/lib/stack.c| 14

[PATCH 25/40] sandbox: move the TCG event log to the start of ram memory

2024-07-24 Thread Sughosh Ganu
. This worked earlier as the LMB memory map was not global but caller specific, but fails now because of the overlap. Move the TCG event log buffer to the start of the ram memory region instead. Signed-off-by: Sughosh Ganu --- Changes since rfc: New patch arch/sandbox/dts/test.dts | 2 +- 1 file changed, 1

[PATCH 23/40] lmb: add a flags parameter to the API's

2024-07-24 Thread Sughosh Ganu
Add a flags parameter to the LMB API functions. The parameter can then be used to pass any other type of reservations or allocations needed by the callers. These will be used in a subsequent set of changes for allocation requests coming from the EFI subsystem. Signed-off-by: Sughosh Ganu

[PATCH 22/40] lmb: init: initialise the lmb data structures during board init

2024-07-24 Thread Sughosh Ganu
the board init. Signed-off-by: Sughosh Ganu --- Changes since rfc: None common/board_r.c | 4 common/spl/spl.c | 3 +++ include/lmb.h| 11 +++ lib/lmb.c| 20 4 files changed, 38 insertions(+) diff --git a/common/board_r.c b/common/board_r.c index

[PATCH 21/40] lmb: bootm: remove superfluous lmb stub functions

2024-07-24 Thread Sughosh Ganu
Remove a couple of superfluous LMB stub functions, and instead put a check for calling the lmb_reserve() function. Signed-off-by: Sughosh Ganu --- Changes since rfc: New patch boot/bootm.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/boot/bootm.c b/boot/bootm.c

[PATCH 20/40] lmb: remove lmb_init_and_reserve_range() function

2024-07-24 Thread Sughosh Ganu
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

[PATCH 19/40] lmb: reserve common areas during board init

2024-07-24 Thread Sughosh Ganu
-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since rfc: * Add a function for reserving common areas in SPL, lmb_reserve_common_spl() lib/lmb.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index f1142033ef

[PATCH 18/40] lmb: remove the lmb_init_and_reserve() function

2024-07-24 Thread Sughosh Ganu
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 Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- Changes since rfc: None

[PATCH 16/40] lmb: allow lmb module to be used in SPL

2024-07-24 Thread Sughosh Ganu
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 Ganu

[PATCH 17/40] lmb: introduce a function to add memory to the lmb memory map

2024-07-24 Thread Sughosh Ganu
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 rfc: None include/lmb.h | 12 lib/lmb.c | 42

[PATCH 15/40] lmb: config: add lmb config symbols for SPL

2024-07-24 Thread Sughosh Ganu
a heap in SPL. Signed-off-by: Sughosh Ganu --- Changes since rfc: None lib/Kconfig | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/Kconfig b/lib/Kconfig index f8ac8daad3..6a9338390a 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -1103,7 +1103,17 @@ config LMB

[PATCH 13/40] lmb: remove config symbols used for lmb region count

2024-07-24 Thread Sughosh Ganu
with the earlier implementation of static arrays. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- Changes since rfc: None configs/a3y17lte_defconfig | 1 - configs/a5y17lte_defconfig | 1 - configs/a7y17lte_defconfig | 1

[PATCH 14/40] test: lmb: remove the test for max regions

2024-07-24 Thread Sughosh Ganu
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 Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- Changes since rfc: None test/lib/lmb.c | 67

[PATCH 11/40] lmb: make LMB memory map persistent and global

2024-07-24 Thread Sughosh Ganu
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 rfc: * Squash patches 9 - 11, 13 from the rfc v2 series into a single patch to make it bisectable. arch/arc/lib/cache.c

[PATCH 12/40] lmb: allow for resizing lmb regions

2024-07-24 Thread Sughosh Ganu
with this attribute would indicate that the region cannot be resized. Signed-off-by: Sughosh Ganu --- Changes since rfc: * Add a function comment for lmb_add_region_flags(). * Change the wording of a comment in lmb_merge_overlap_regions() as per review comment from Simon Glass. include/lmb.h | 1 + lib

[PATCH 10/40] lmb: use the BIT macro for lmb flags

2024-07-24 Thread Sughosh Ganu
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 rfc: None include/lmb.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/lmb.h b/include/lmb.h index 7b87181b9e

[PATCH 09/40] lmb: staticize __lmb_alloc_base()

2024-07-24 Thread Sughosh Ganu
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 Reviewed-by: Simon

[PATCH 08/40] lmb: remove the unused lmb_is_reserved() function

2024-07-24 Thread Sughosh Ganu
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 Reviewed-by: Simon Glass --- Changes since rfc: None

[PATCH 07/40] lmb: ut: disable unit tests for lmb changes

2024-07-24 Thread Sughosh Ganu
and the corresponding test code changes have been made. Signed-off-by: Sughosh Ganu --- Changes since rfc: New patch configs/sandbox64_defconfig| 4 +--- configs/sandbox_defconfig | 7 --- configs/sandbox_flattree_defconfig | 4 +--- configs/sandbox_noinst_defconfig | 8 configs

[PATCH 06/40] alist: add a couple of helper functions

2024-07-24 Thread Sughosh Ganu
Add a couple of helper functions to detect an empty and full alist. Signed-off-by: Sughosh Ganu --- Changes since rfc: None include/alist.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/include/alist.h b/include/alist.h index 6cc3161dcd..06ae137102 100644

[PATCH 05/40] spl: alloc: call full alloc functions if malloc pool is available

2024-07-24 Thread Sughosh Ganu
If the malloc simple functionality is enabled in SPL, it is not possible to call the full-implementation alloc functions even after the heap is set-up in ram memory. Check for this condition and call the functions when enabled. Signed-off-by: Sughosh Ganu --- Changes since rfc: New patch

[PATCH 04/40] lib: Convert str_to_list() to use alist

2024-07-24 Thread 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

[PATCH 03/40] alist: Add support for an allocated pointer list

2024-07-24 Thread Sughosh Ganu
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

[PATCH 02/40] lib: Handle a special case with str_to_list()

2024-07-24 Thread Sughosh Ganu
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

[PATCH 00/40] Make LMB memory map global and persistent

2024-07-24 Thread Sughosh Ganu
str_to_list() to use alist Sughosh Ganu (36): spl: alloc: call full alloc functions if malloc pool is available alist: add a couple of helper functions lmb: ut: disable unit tests for lmb changes lmb: remove the unused lmb_is_reserved() function lmb: staticize __lmb_alloc_base() lmb: use the BIT

[PATCH 01/40] malloc: Support testing with realloc()

2024-07-24 Thread Sughosh Ganu
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

Re: [RFC PATCH v2 00/48] Make U-Boot memory reservations coherent

2024-07-23 Thread Sughosh Ganu
On Tue, 23 Jul 2024 at 20:18, Tom Rini wrote: > > On Mon, Jul 22, 2024 at 11:07:45PM +0530, Sughosh Ganu wrote: > > On Mon, 22 Jul 2024 at 23:03, Tom Rini wrote: > > > > > > On Mon, Jul 22, 2024 at 11:58:18AM +0530, Sughosh Ganu wrote: > > > > On

Re: [RFC PATCH v2 00/48] Make U-Boot memory reservations coherent

2024-07-22 Thread Sughosh Ganu
On Mon, 22 Jul 2024 at 23:03, Tom Rini wrote: > > On Mon, Jul 22, 2024 at 11:58:18AM +0530, Sughosh Ganu wrote: > > On Mon, 8 Jul 2024 at 19:32, Tom Rini wrote: > > > > > > On Thu, Jul 04, 2024 at 01:04:56PM +0530, Sughosh Ganu wrote: > > > > &g

Re: [PATCH v5 04/11] doc: uefi: document dynamic UUID generation

2024-07-22 Thread Sughosh Ganu
hi Caleb, On Fri, 19 Jul 2024 at 18:14, Caleb Connolly wrote: > > Document how platforms can generate GUIDs at runtime rather than > maintaining a list of UUIDs per-board. > > Reviewed-by: Ilias Apalodimas > Signed-off-by: Caleb Connolly > --- > doc/develop/uefi/uefi.rst | 27

Re: [RFC PATCH v2 38/48] lib: Kconfig: add a config symbol for getting lmb memory map updates

2024-07-22 Thread Sughosh Ganu
On Mon, 22 Jul 2024 at 18:00, Ilias Apalodimas wrote: > > On Fri, 5 Jul 2024 at 22:51, Tom Rini wrote: > > > > On Thu, Jul 04, 2024 at 01:05:34PM +0530, Sughosh Ganu wrote: > > > > > Add a Kconfig symbol to enable getting updates on any memory map > >

Re: [RFC PATCH v2 00/48] Make U-Boot memory reservations coherent

2024-07-22 Thread Sughosh Ganu
On Mon, 8 Jul 2024 at 19:32, Tom Rini wrote: > > On Thu, Jul 04, 2024 at 01:04:56PM +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

Re: [RFC PATCH v2 41/48] efi_memory: add an event handler to update memory map

2024-07-17 Thread Sughosh Ganu
On Tue, 16 Jul 2024 at 22:30, Tom Rini wrote: > > On Tue, Jul 16, 2024 at 11:55:10AM +0530, Sughosh Ganu wrote: > > On Tue, 16 Jul 2024 at 00:35, Tom Rini wrote: > > > > > > On Mon, Jul 15, 2024 at 12:39:32PM +0100, Simon Glass wrote: > > > > Hi Sughosh,

Re: [RFC PATCH v2 41/48] efi_memory: add an event handler to update memory map

2024-07-16 Thread Sughosh Ganu
hi Simon, On Tue, 16 Jul 2024 at 12:40, Simon Glass wrote: > > Hi Sughosh, > > On Tue, 16 Jul 2024 at 07:25, Sughosh Ganu wrote: > > > > On Tue, 16 Jul 2024 at 00:35, Tom Rini wrote: > > > > > > On Mon, Jul 15, 2024 at 12:39:32PM +0

Re: [RFC PATCH v2 46/48] lmb: mark the EFI runtime memory regions as reserved

2024-07-16 Thread Sughosh Ganu
hi Simon, On Mon, 15 Jul 2024 at 17:09, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 15 Jul 2024 at 10:42, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Sat, 13 Jul 2024 at 20:46, Simon Glass wrote: > > > > > > Hi Sughosh, > &

Re: [RFC PATCH v2 09/48] lmb: remove call to lmb_init()

2024-07-16 Thread Sughosh Ganu
hi Simon, On Mon, 15 Jul 2024 at 17:09, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 15 Jul 2024 at 10:31, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Sat, 13 Jul 2024 at 20:45, Simon Glass wrote: > > > > > > kHi Sughosh, > &

Re: [RFC PATCH v2 12/48] lmb: allow for resizing lmb regions

2024-07-16 Thread Sughosh Ganu
hi Simon, On Mon, 15 Jul 2024 at 17:09, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 15 Jul 2024 at 10:27, Sughosh Ganu wrote: > > > > hi Simon, > > > > On Sat, 13 Jul 2024 at 20:45, Simon Glass wrote: > > > > > > Hi Sughosh, > &

Re: [RFC PATCH v2 41/48] efi_memory: add an event handler to update memory map

2024-07-16 Thread Sughosh Ganu
On Tue, 16 Jul 2024 at 00:35, Tom Rini wrote: > > On Mon, Jul 15, 2024 at 12:39:32PM +0100, Simon Glass wrote: > > Hi Sughosh, > > > > On Mon, 15 Jul 2024 at 10:39, Sughosh Ganu wrote: > > > > > > hi Simon, > > > > > > On Sat, 13 Jul 2

Re: [RFC PATCH v2 13/48] lmb: make LMB memory map persistent and global

2024-07-15 Thread Sughosh Ganu
hi Simon, On Sat, 13 Jul 2024 at 20:46, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 4 Jul 2024 at 08:36, Sughosh Ganu wrote: > > > > The current LMB API's for allocating and reserving memory use a > > per-caller based memory view. Memory allocated by a call

Re: [RFC PATCH v2 46/48] lmb: mark the EFI runtime memory regions as reserved

2024-07-15 Thread Sughosh Ganu
hi Simon, On Sat, 13 Jul 2024 at 20:46, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 4 Jul 2024 at 08:38, Sughosh Ganu wrote: > > > > Mark the EFI runtime memory region as reserved memory during board > > init so that it does not get allocated by the LMB m

Re: [RFC PATCH v2 41/48] efi_memory: add an event handler to update memory map

2024-07-15 Thread Sughosh Ganu
hi Simon, On Sat, 13 Jul 2024 at 20:46, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 4 Jul 2024 at 08:38, Sughosh Ganu wrote: > > > > There are events that would be used to notify other interested modules > > of any changes in available and occupied memory. This

Re: [RFC PATCH v2 09/48] lmb: remove call to lmb_init()

2024-07-15 Thread Sughosh Ganu
hi Simon, On Sat, 13 Jul 2024 at 20:45, Simon Glass wrote: > > kHi Sughosh, > > On Thu, 4 Jul 2024 at 08:36, Sughosh Ganu wrote: > > > > The LMB module will be changed to have persistent and global memory > > maps of available and used memory. With this chang

Re: [RFC PATCH v2 10/48] lmb: remove local instances of the lmb structure variable

2024-07-15 Thread Sughosh Ganu
hi Simon, On Sat, 13 Jul 2024 at 20:45, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 4 Jul 2024 at 08:36, Sughosh Ganu wrote: > > > > With the move of the LMB structure to a persistent state, there is no > > need to declare the variable locally, and pass i

Re: [RFC PATCH v2 12/48] lmb: allow for resizing lmb regions

2024-07-15 Thread Sughosh Ganu
hi Simon, On Sat, 13 Jul 2024 at 20:45, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 4 Jul 2024 at 08:36, Sughosh Ganu wrote: > > > > Allow for resizing of LMB regions if the region attributes match. The > > current code returns a failure status on detect

Re: [RFC PATCH v2 17/48] lmb: allow lmb module to be used in SPL

2024-07-15 Thread Sughosh Ganu
hi Simon, On Sat, 13 Jul 2024 at 20:45, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 4 Jul 2024 at 08:37, Sughosh Ganu wrote: > > > > With the introduction of separate config symbols for the SPL phase of > > U-Boot, the condition checks need to be tweaked so

Re: [RFC PATCH v2 16/48] lmb: config: add lmb config symbols for SPL

2024-07-08 Thread Sughosh Ganu
On Sat, 6 Jul 2024 at 01:18, Tom Rini wrote: > > On Thu, Jul 04, 2024 at 01:05:12PM +0530, Sughosh Ganu wrote: > > > Add separate config symbols for enabling the LMB module for the SPL > > phase. The LMB module implementation now relies on alloced list data > > structu

[RFC PATCH v2 48/48] temp: mx6sabresd: bump up the size limit of the board

2024-07-04 Thread Sughosh Ganu
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 --- Changes since V1: None configs/mx6sabresd_defconfig

[RFC PATCH v2 47/48] test: event: update the expected event dump output

2024-07-04 Thread Sughosh Ganu
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 --- Changes since V1: * Remove the line for EFI mem

[RFC PATCH v2 46/48] lmb: mark the EFI runtime memory regions as reserved

2024-07-04 Thread Sughosh Ganu
Mark the EFI runtime memory region as reserved memory during board init so that it does not get allocated by the LMB module on subsequent memory requests. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch lib/lmb.c | 41 - 1 file changed, 20

[RFC PATCH v2 45/48] efi_memory: do not add RAM memory to the memory map

2024-07-04 Thread Sughosh Ganu
The EFI_CONVENTIONAL_MEMORY type, which is the usable RAM memory is now being managed by the LMB module. Remove the addition of this memory type to the EFI memory map. This memory now gets added to the EFI memory map as part of the LMB memory map update event handler. Signed-off-by: Sughosh Ganu

[RFC PATCH v2 44/48] x86: e820: use the lmb API for adding RAM memory

2024-07-04 Thread Sughosh Ganu
The EFI_CONVENTIONAL_MEMORY type is now being managed through the LMB module. Add a separate function, lmb_add_memory() to add the RAM memory to the LMB memory map. The efi_add_known_memory() function is now used for adding any other memory type to the EFI memory map. Signed-off-by: Sughosh Ganu

[RFC PATCH v2 43/48] layerscape: use the lmb API's to add RAM memory

2024-07-04 Thread Sughosh Ganu
The EFI memory allocations are now being done through the LMB module, and hence the memory map is maintained by the LMB module. Use the lmb_add_memory() API function to add the usable RAM memory to the LMB's memory map. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch arch/arm/cpu

[RFC PATCH v2 42/48] ti: k3: remove efi_add_known_memory() function definition

2024-07-04 Thread Sughosh Ganu
. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch arch/arm/mach-k3/common.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index eaa7d36176..a5c0170cd2 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3

[RFC PATCH v2 41/48] efi_memory: add an event handler to update memory map

2024-07-04 Thread Sughosh Ganu
-by: Sughosh Ganu --- Changes since V1: * Handle the addition of memory to the LMB memory map. * Pass the overlap_only_ram parameter to the efi_add_memory_map_pg() based on the type of operation. lib/efi_loader/Kconfig | 1 + lib/efi_loader/efi_memory.c | 34 ++ 2

  1   2   3   4   5   6   7   8   9   10   >