Re: [PATCH 0/2] lmb: rework logic to validate load address for network commands

2024-10-01 Thread Sughosh Ganu
On Tue, 1 Oct 2024 at 11:37, Vaishnav Achath wrote: > > Hi Tom, > > On 21/09/24 08:09, Tom Rini wrote: > > On Mon, 16 Sep 2024 20:50:23 +0530, Sughosh Ganu wrote: > > > >> Rework the logic to verify the load address so that address re-use is > >> not an

Re: [PATCH 04/16] event: add event to notify lmb memory map changes

2024-09-27 Thread Sughosh Ganu
On Fri, 27 Sept 2024 at 16:12, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 26 Sept 2024 at 14:29, Sughosh Ganu wrote: > > > > On Thu, 26 Sept 2024 at 16:38, Simon Glass wrote: > > > > > > Hi Sughosh, > > > > > > On Thu, 26 Sept 2

Re: [PATCH 04/16] event: add event to notify lmb memory map changes

2024-09-26 Thread Sughosh Ganu
On Thu, 26 Sept 2024 at 16:38, Simon Glass wrote: > > Hi Sughosh, > > On Thu, 26 Sept 2024 at 09:12, Sughosh Ganu wrote: > > > > On Wed, 25 Sept 2024 at 18:23, Simon Glass wrote: > > > > > > Hi Sughosh, > > > > > > On Fri, 20 Sept 2

Re: [PATCH 04/16] event: add event to notify lmb memory map changes

2024-09-26 Thread Sughosh Ganu
On Wed, 25 Sept 2024 at 18:23, Simon Glass wrote: > > Hi Sughosh, > > On Fri, 20 Sept 2024 at 13:38, Sughosh Ganu wrote: > > > > On Fri, 20 Sept 2024 at 14:51, Ilias Apalodimas > > wrote: > > > > > > Hi Sughosh, > > > > &

Re: [PATCH 04/16] event: add event to notify lmb memory map changes

2024-09-20 Thread Sughosh Ganu
On Fri, 20 Sept 2024 at 14:51, Ilias Apalodimas wrote: > > Hi Sughosh, > > On Tue, 17 Sept 2024 at 15:33, Sughosh Ganu wrote: > > > > On Sat, 14 Sept 2024 at 20:38, Heinrich Schuchardt > > wrote: > > > > > > On 9/5/24 10:27, Sughosh Ganu wro

Re: [PATCH 02/16] lmb: add a flag to allow suppressing memory map change notification

2024-09-19 Thread Sughosh Ganu
On Thu, 19 Sept 2024 at 19:42, Simon Glass wrote: > > Hi, > > On Tue, 17 Sept 2024 at 13:55, Sughosh Ganu wrote: > > > > On Sat, 14 Sept 2024 at 20:14, Heinrich Schuchardt > > wrote: > > > > > > On 9/5/24 10:27, Sughosh Ganu wrote: > > >

Re: [PATCH 1/1] lmb: add missing LMB_NOOVERWRITE description

2024-09-19 Thread Sughosh Ganu
On Thu, 19 Sept 2024 at 12:35, Ilias Apalodimas wrote: > > On Thu, 19 Sept 2024 at 00:39, Heinrich Schuchardt > wrote: > > > > Without a LMB_NOOVERWRITE building the HTML documentation leads to a > > warning which should be treated as an error. > > > > Fixes: 5e9553cc72b8 ("lmb: allow for resizin

Re: [PATCH 05/16] lib: Kconfig: add a config symbol for getting lmb memory map updates

2024-09-17 Thread Sughosh Ganu
On Sat, 14 Sept 2024 at 20:41, Heinrich Schuchardt wrote: > > On 9/5/24 10:28, Sughosh Ganu wrote: > > Add a Kconfig symbol to enable getting updates on any memory map > > changes that might be done by the LMB module. This notification > > mechanism can then be used to ha

Re: [PATCH 04/16] event: add event to notify lmb memory map changes

2024-09-17 Thread Sughosh Ganu
On Sat, 14 Sept 2024 at 20:38, Heinrich Schuchardt wrote: > > On 9/5/24 10:27, Sughosh Ganu wrote: > > Add an event which would be used for notifying changes in the > > LMB modules' memory map. This is to be used for having a > > synchronous view of the memory that

Re: [PATCH 03/16] efi: memory: use the lmb API's for allocating and freeing memory

2024-09-17 Thread Sughosh Ganu
On Sat, 14 Sept 2024 at 20:35, Heinrich Schuchardt wrote: > > On 9/5/24 10:27, Sughosh Ganu wrote: > > Use the LMB API's for allocating and freeing up memory. With this, the > > LMB module becomes the common backend for managing non U-Boot image > > memory that might

Re: [PATCH 02/16] lmb: add a flag to allow suppressing memory map change notification

2024-09-17 Thread Sughosh Ganu
On Sat, 14 Sept 2024 at 20:14, Heinrich Schuchardt wrote: > > On 9/5/24 10:27, Sughosh Ganu wrote: > > 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

Re: [PATCH 01/16] lmb: add versions of the lmb API with flags

2024-09-17 Thread Sughosh Ganu
On Sat, 14 Sept 2024 at 20:01, Heinrich Schuchardt wrote: > > On 9/5/24 10:27, Sughosh Ganu wrote: > > 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 differ

Re: [PATCH] efi_loader: Don't allocate from Special purpose memory

2024-09-17 Thread Sughosh Ganu
On Tue, 17 Sept 2024 at 17:11, Ilias Apalodimas wrote: > > On Tue, 17 Sept 2024 at 13:05, Sughosh Ganu wrote: > > > > On Tue, 17 Sept 2024 at 14:32, Ilias Apalodimas > > wrote: > > > > > > The EFI spec defines special-purpose memory in §7.2. That memory

Re: [PATCH] fs: Fix reserved memory alloaction in fs_read()

2024-09-17 Thread Sughosh Ganu
On Mon, 16 Sept 2024 at 11:10, Vaishnav Achath wrote: > > The reserved memory region in fs_read() is not being > freed after read, free that. The issue was uncovered by > commit ed17a33fed29 ("lmb: make LMB memory map persistent and global") > as now the region used to load from fs cannot be reuse

Re: [PATCH] efi_loader: Don't allocate from Special purpose memory

2024-09-17 Thread Sughosh Ganu
On Tue, 17 Sept 2024 at 14:32, Ilias Apalodimas wrote: > > The EFI spec defines special-purpose memory in §7.2. That memory > serves as a hint to the OS to avoid allocating this memory for core > OS data or code that can not be relocated. So let's ignore it when > allocating from conventional memo

Re: [PATCH v4 05/27] lmb: make LMB memory map persistent and global

2024-09-16 Thread Sughosh Ganu
On Mon, 16 Sept 2024 at 22:19, Vaishnav Achath wrote: > > Hi Sughosh, > > Requesting clarification for one more point, > > On 16/09/24 14:46, Sughosh Ganu wrote: > > On Mon, 16 Sept 2024 at 14:09, Vaishnav Achath wrote: > >> > >> Hi Sughosh, >

[PATCH 2/2] wget: rework the logic to validate the load address

2024-09-16 Thread Sughosh Ganu
is used to work earlier as the LMB memory map had a local scope and was not persistent. Fix this issue by using the lmb_read_check() call instead which only returns an error in case the memory region has been marked for not allowing re-use. Signed-off-by: Sughosh Ganu --- Note: To be applied on ne

[PATCH 1/2] tftp: rework the logic to validate the load address

2024-09-16 Thread Sughosh Ganu
is used to work earlier as the LMB memory map had a local scope and was not persistent. Fix this issue by using the lmb_read_check() call instead which only returns an error in case the memory region has been marked for not allowing re-use. Signed-off-by: Sughosh Ganu --- Note: To be applied on next,

[PATCH 0/2] lmb: rework logic to validate load address for network commands

2024-09-16 Thread Sughosh Ganu
Rework the logic to verify the load address so that address re-use is not an issue. Note: To be applied on next, on top of https://patchwork.ozlabs.org/project/uboot/patch/20240913073251.2286529-2-prasad.kumm...@amd.com/ Sughosh Ganu (2): tftp: rework the logic to validate the load address

Re: [PATCH v4] cmd: sf: prevent overwriting the reserved memory

2024-09-16 Thread Sughosh Ganu
On Mon, 16 Sept 2024 at 19:47, Vaishnav Achath wrote: > > Hi Sughosh, > > On 16/09/24 16:40, Sughosh Ganu wrote: > > On Mon, 16 Sept 2024 at 16:07, Vaishnav Achath wrote: > >> > >> Hi Sughosh, > >> > >> On 16/09/24 14:53, Sughosh Ganu wrote

Re: [PATCH v4 05/27] lmb: make LMB memory map persistent and global

2024-09-16 Thread Sughosh Ganu
On Mon, 16 Sept 2024 at 11:22, Vaishnav Achath wrote: > > Hi Sughosh, > > On 26/08/24 17:29, 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 be > >

Re: [PATCH v4] cmd: sf: prevent overwriting the reserved memory

2024-09-16 Thread Sughosh Ganu
On Mon, 16 Sept 2024 at 16:07, Vaishnav Achath wrote: > > Hi Sughosh, > > On 16/09/24 14:53, Sughosh Ganu wrote: > > On Mon, 16 Sept 2024 at 14:22, Vaishnav Achath wrote: > >> > >> Hi Sughosh, > >> > >> On 16/09/24 12:13, Sughosh Ganu wrote

Re: [PATCH v4 05/27] lmb: make LMB memory map persistent and global

2024-09-16 Thread Sughosh Ganu
On Mon, 16 Sept 2024 at 14:09, Vaishnav Achath wrote: > > Hi Sughosh, > > On 16/09/24 11:59, Sughosh Ganu wrote: > > On Mon, 16 Sept 2024 at 11:22, Vaishnav Achath wrote: > >> > >> Hi Sughosh, > >> > >> On 26/08/24 17:29, Sughosh Ganu

Re: [PATCH v4] cmd: sf: prevent overwriting the reserved memory

2024-09-16 Thread Sughosh Ganu
On Mon, 16 Sept 2024 at 14:22, Vaishnav Achath wrote: > > Hi Sughosh, > > On 16/09/24 12:13, Sughosh Ganu wrote: > > On Mon, 16 Sept 2024 at 11:47, Vaishnav Achath wrote: > >> > >> Hi Prasad, > >> > >> On 13/09/24 13:02, Prasad Kummari

Re: [PATCH v4] cmd: sf: prevent overwriting the reserved memory

2024-09-15 Thread Sughosh Ganu
On Mon, 16 Sept 2024 at 11:47, Vaishnav Achath wrote: > > Hi Prasad, > > On 13/09/24 13:02, Prasad Kummari wrote: > > 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 th

Re: [PATCH v4 05/27] lmb: make LMB memory map persistent and global

2024-09-15 Thread Sughosh Ganu
On Mon, 16 Sept 2024 at 11:34, Vaishnav Achath wrote: > > Hi Sughosh > > On 26/08/24 17:29, 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 be > >

Re: [PATCH v3] cmd: sf: prevent overwriting the reserved memory

2024-09-11 Thread Sughosh Ganu
On Wed, 11 Sept 2024 at 17:02, Michal Simek wrote: > > > > On 9/11/24 13:29, Sughosh Ganu wrote: > > On Wed, 11 Sept 2024 at 16:53, Michal Simek wrote: > >> > >> > >> > >> On 9/11/24 13:20, Sughosh Ganu wrote: > >>> On Tue, 10 Sep

Re: [PATCH v3] cmd: sf: prevent overwriting the reserved memory

2024-09-11 Thread Sughosh Ganu
On Wed, 11 Sept 2024 at 16:53, Michal Simek wrote: > > > > On 9/11/24 13:20, Sughosh Ganu wrote: > > On Tue, 10 Sept 2024 at 21:14, Prasad Kummari > > wrote: > >> > >> Added LMB API to prevent SF command from overwriting reserved > >> memory ar

Re: [PATCH v3] cmd: sf: prevent overwriting the reserved memory

2024-09-11 Thread Sughosh Ganu
On Tue, 10 Sept 2024 at 21:14, Prasad Kummari wrote: > > 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 comm

Re: [PATCH v3 2/3] efi: Allow use of malloc() for the EFI pool

2024-09-10 Thread Sughosh Ganu
On Wed, 11 Sept 2024 at 00:14, Simon Glass wrote: > > Hi Sughosh, > > On Mon, 9 Sept 2024 at 01:44, Sughosh Ganu wrote: > > > > On Fri, 6 Sept 2024 at 18:31, Simon Glass wrote: > > > > > > Hi Sughosh, > > > > > > On Fri, 6 Sept 2024

Re: [PATCH] board: rpi: Enable capsule updates

2024-09-10 Thread Sughosh Ganu
ypi/rpi/rpi.c | 22 ++ > configs/rpi_4_defconfig | 2 ++ > 2 files changed, 24 insertions(+) Tested-by: Sughosh Ganu A couple of nits below. > > diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c > index ab5ea85cf9f8..1f342eee12b2 100644 > --- a/board/raspberrypi

[PATCH v2 6/6] fwu: print a message if empty capsule checks fail

2024-09-09 Thread Sughosh Ganu
When dealing with processing of the empty capsule, the capsule gets applied only when the checks for the empty capsule pass. Print a message to highlight if empty capsule checks fail, and return an error value, similar to the normal capsules. Signed-off-by: Sughosh Ganu --- Changes since V1: New

[PATCH v2 5/6] fwu: do not allow capsule processing on exceeding Trial Counter threshold

2024-09-09 Thread Sughosh Ganu
updated images would be accepted or rejected while the platform is in Trial State. Put in checks so that it is not possible to apply an empty capsule once the max Trial Count exceeds. Signed-off-by: Sughosh Ganu Tested-by: Michal Simek --- Changes since V1: None lib/fwu_updates/fwu.c | 6

[PATCH v2 4/6] fwu: add dependency checks for selecting FWU metadata version

2024-09-09 Thread Sughosh Ganu
: Sughosh Ganu Reviewed-by: Michal Simek --- Changes since V1: None lib/fwu_updates/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/fwu_updates/Kconfig b/lib/fwu_updates/Kconfig index 51b7fbbefd..a722107c12 100644 --- a/lib/fwu_updates/Kconfig +++ b/lib/fwu_updates/Kconfig @@ -40,6

[PATCH v2 3/6] fwu: check all images for transitioning out of Trial State

2024-09-09 Thread Sughosh Ganu
The platform transitions out of Trial State into the Regular State only when all the images in the update bank have been accepted. Check for this condition before transitioning out of Trial State. Signed-off-by: Sughosh Ganu Tested-by: Michal Simek --- Changes since V1: None include/fwu.h

[PATCH v2 2/6] fwu: v1: do a version check for the metadata

2024-09-09 Thread Sughosh Ganu
Do a sanity check that the version of the FWU metadata that has been read aligns with the version enabled in the image. This allows to indicate an early failure as part of the FWU module initialisation. Signed-off-by: Sughosh Ganu --- Changes since V1: None lib/fwu_updates/fwu_v1.c | 9

[PATCH v2 1/6] fwu: v2: try reading both copies of metadata

2024-09-09 Thread Sughosh Ganu
the scenario where the primary metadata partition has been corrupted, but the secondary partition is intact. Signed-off-by: Sughosh Ganu --- Changes since V1: * Squash patch 1 and 2 in the earlier version into a single patch. * Have a single check for image descriptor offset, and have a log

[PATCH v2 0/6] Miscellaneous FWU fixes

2024-09-09 Thread Sughosh Ganu
mandatory. * Use a macro FWU_IMG_DESC_OFFSET for the image descriptor offset. * Use the enum names for primary and secondary partitions from fwu.h instead of defining new macros. Sughosh Ganu (6): fwu: v2: try reading both copies of metadata fwu: v1: do a version check for the metadata fwu

Re: [PATCH v2] cmd: sf: prevent overwriting the reserved memory

2024-09-09 Thread Sughosh Ganu
On Mon, 9 Sept 2024 at 15:15, Prasad Kummari wrote: > > 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 comma

Re: [PATCH v3 2/3] efi: Allow use of malloc() for the EFI pool

2024-09-09 Thread Sughosh Ganu
On Fri, 6 Sept 2024 at 18:31, Simon Glass wrote: > > Hi Sughosh, > > On Fri, 6 Sept 2024 at 00:23, Sughosh Ganu wrote: > > > > On Mon, 2 Sept 2024 at 03:53, Simon Glass wrote: > > > > > > This API call is intended for allocating small amounts of memo

Re: [PATCH 0/6] Miscellaneous FWU fixes

2024-09-06 Thread Sughosh Ganu
On Fri, 6 Sept 2024 at 12:05, Michal Simek wrote: > > > > On 9/5/24 11:17, Sughosh Ganu wrote: > > On Thu, 5 Sept 2024 at 14:07, Michal Simek wrote: > >> > >> > >> > >> On 9/5/24 10:12, Sughosh Ganu wrote: > >>> On Thu, 5 Sept 20

Re: [PATCH v3 2/3] efi: Allow use of malloc() for the EFI pool

2024-09-05 Thread Sughosh Ganu
On Mon, 2 Sept 2024 at 03:53, Simon Glass wrote: > > This API call is intended for allocating small amounts of memory, > similar to malloc(). The current implementation rounds up to whole pages > which can waste large amounts of memory. It also implements its own > malloc()-style header on each bl

Re: [PATCH 0/6] Miscellaneous FWU fixes

2024-09-05 Thread Sughosh Ganu
On Thu, 5 Sept 2024 at 14:07, Michal Simek wrote: > > > > On 9/5/24 10:12, Sughosh Ganu wrote: > > On Thu, 5 Sept 2024 at 13:20, Michal Simek wrote: > >> > >> > >> > >> On 9/5/24 09:43, Sughosh Ganu wrote: > >>> On Thu, 5 Sept 20

[PATCH 16/16] test: event: update the expected event dump output

2024-09-05 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 --- test/py/tests/test_event_dump.py | 1 + 1 file

[PATCH 15/16] lmb: remove call to efi_lmb_reserve()

2024-09-05 Thread Sughosh Ganu
The EFI memory allocations are now being done through the LMB module. With this change, there is no need to get the EFI memory map and set aside EFI allocated memory. Signed-off-by: Sughosh Ganu --- lib/lmb.c | 36 1 file changed, 36 deletions(-) diff --git

[PATCH 14/16] efi_memory: do not add RAM memory to the memory map

2024-09-05 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

[PATCH 13/16] x86: e820: use the lmb API for adding RAM memory

2024-09-05 Thread Sughosh Ganu
The EFI_CONVENTIONAL_MEMORY type is now being managed through the LMB module. Add a separate function, lmb_arch_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

[PATCH 12/16] layerscape: use the lmb API's to add RAM memory

2024-09-05 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_arch_add_memory() API function to add the usable RAM memory to the LMB's memory map. Signed-off-by: Sughosh Ganu --- arch/arm/cpu/armv8/fsl-layer

[PATCH 11/16] lmb: allow for boards to specify memory map

2024-09-05 Thread Sughosh Ganu
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 --- include/lmb.h | 2

[PATCH 10/16] stm32mp: remove efi_add_known_memory() function definition

2024-09-05 Thread Sughosh Ganu
. Signed-off-by: Sughosh Ganu --- arch/arm/mach-stm32mp/dram_init.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/arch/arm/mach-stm32mp/dram_init.c b/arch/arm/mach-stm32mp/dram_init.c index 198785353f..3698fc49bf 100644 --- a/arch/arm/mach-stm32mp/dram_init.c +++ b/arch/arm

[PATCH 08/16] efi_memory: add an event handler to update memory map

2024-09-05 Thread Sughosh Ganu
: Sughosh Ganu --- lib/efi_loader/Kconfig | 2 ++ lib/efi_loader/efi_memory.c | 35 +++ 2 files changed, 37 insertions(+) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 911d4c6bbe..41d51987c3 100644 --- a/lib/efi_loader/Kconfig +++ b/lib

[PATCH 09/16] ti: k3: remove efi_add_known_memory() function definition

2024-09-05 Thread Sughosh Ganu
. Signed-off-by: Sughosh Ganu --- 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 df48ec8d47..f2086cbdf5 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -310,14 +310,3

[PATCH 07/16] lmb: notify of any changes to the LMB memory map

2024-09-05 Thread Sughosh Ganu
en running these unit tests. Signed-off-by: Sughosh Ganu --- include/lmb.h | 2 ++ lib/lmb.c | 74 --- 2 files changed, 67 insertions(+), 9 deletions(-) diff --git a/include/lmb.h b/include/lmb.h index ffba7e2889..f711b8fac8 100644 --- a/inc

[PATCH 06/16] add a function to check if an address is in RAM memory

2024-09-05 Thread Sughosh Ganu
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 --- common/board_r.c | 5 + 1 file changed, 5

[PATCH 05/16] lib: Kconfig: add a config symbol for getting lmb memory map updates

2024-09-05 Thread Sughosh Ganu
Add a Kconfig symbol to enable getting updates on any memory map changes that might be done by the LMB 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 | 11 +++ 1 file changed, 11

[PATCH 04/16] event: add event to notify lmb memory map changes

2024-09-05 Thread Sughosh Ganu
Add an event which would be used for notifying changes in the LMB 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 | 2 ++ include/event.h

[PATCH 03/16] efi: memory: use the lmb API's for allocating and freeing memory

2024-09-05 Thread Sughosh Ganu
Use the LMB API's for allocating and freeing up memory. With this, the LMB module becomes the common backend for managing non U-Boot image memory that might be requested by other modules. Signed-off-by: Sughosh Ganu --- lib/efi_loader/Kconfig | 1 + lib/efi_loader/efi_memory.c

[PATCH 02/16] lmb: add a flag to allow suppressing memory map change notification

2024-09-05 Thread Sughosh Ganu
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. Signed-off-by: Sughosh Ganu --- include/lmb.h | 1 + lib/lmb.c | 2 +- 2 files

[PATCH 01/16] lmb: add versions of the lmb API with flags

2024-09-05 Thread Sughosh Ganu
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 --- include/lmb.h | 6 ++ lib/lmb.c

[PATCH 00/16] Make EFI memory allocations synchronous with LMB

2024-09-05 Thread Sughosh Ganu
. the EFI_CONVENTIONAL_MEMORY type. Any other memory type that is to be added to the EFI memory map, still gets handled by the EFI memory module. Note: To be applied on top of the next branch. Sughosh Ganu (16): lmb: add versions of the lmb API with flags lmb: add a flag to allow suppressing memory map c

Re: [PATCH 0/6] Miscellaneous FWU fixes

2024-09-05 Thread Sughosh Ganu
On Thu, 5 Sept 2024 at 13:20, Michal Simek wrote: > > > > On 9/5/24 09:43, Sughosh Ganu wrote: > > On Thu, 5 Sept 2024 at 13:09, Michal Simek wrote: > >> > >> > >> > >> On 9/5/24 09:38, Sughosh Ganu wrote: > >>> On Thu, 5 Sept 20

Re: [PATCH 0/6] Miscellaneous FWU fixes

2024-09-05 Thread Sughosh Ganu
On Thu, 5 Sept 2024 at 13:09, Michal Simek wrote: > > > > On 9/5/24 09:38, Sughosh Ganu wrote: > > On Thu, 5 Sept 2024 at 13:03, Michal Simek wrote: > >> > >> > >> > >> On 9/5/24 08:24, Sughosh Ganu wrote: > >>> On Wed, 4 Sept 20

Re: [PATCH 0/6] Miscellaneous FWU fixes

2024-09-05 Thread Sughosh Ganu
On Thu, 5 Sept 2024 at 13:03, Michal Simek wrote: > > > > On 9/5/24 08:24, Sughosh Ganu wrote: > > On Wed, 4 Sept 2024 at 17:30, Michal Simek wrote: > >> > >> > >> > >> On 8/30/24 13:40, Sughosh Ganu wrote: > >>> > >>>

Re: [PATCH 0/6] Miscellaneous FWU fixes

2024-09-04 Thread Sughosh Ganu
On Wed, 4 Sept 2024 at 17:30, Michal Simek wrote: > > > > On 8/30/24 13:40, Sughosh Ganu wrote: > > > > The following set of patches are miscellaneous fixes and some > > hardening of the FWU update logic. > > > > Sughosh Ganu (6): > >fwu:

Re: [PATCH 0/6] Miscellaneous FWU fixes

2024-09-04 Thread Sughosh Ganu
On Wed, 4 Sept 2024 at 13:45, Michal Simek wrote: > > > > On 8/30/24 13:40, Sughosh Ganu wrote: > > > > The following set of patches are miscellaneous fixes and some > > hardening of the FWU update logic. > > > > Sughosh Ganu (6): > >fwu:

Re: [PATCH 1/6] fwu: v2: perform some checks before reading metadata

2024-09-04 Thread Sughosh Ganu
On Tue, 3 Sept 2024 at 19:22, Michal Simek wrote: > > > > On 8/30/24 13:40, Sughosh Ganu wrote: > > The version 2 of the FWU metadata has a top level structure, followed > > by optional information on the updatable images. Perform some sanity > > checks on some

Re: [PATCH 2/6] fwu: v2: try reading both copies of metadata

2024-09-04 Thread Sughosh Ganu
On Tue, 3 Sept 2024 at 22:37, Michal Simek wrote: > > > > On 8/30/24 13:40, Sughosh Ganu wrote: > > In the version 2 of the FWU metadata, the metadata is broken into two > > parts, a top-level structure, which provides information on the total > > size of the str

[PATCH 6/6] fwu: do not allow capsule processing on exceeding Trial Counter threshold

2024-08-30 Thread Sughosh Ganu
updated images would be accepted or rejected while the platform is in Trial State. Put in checks so that it is not possible to apply an empty capsule once the max Trial Count exceeds. Signed-off-by: Sughosh Ganu --- lib/fwu_updates/fwu.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions

[PATCH 5/6] fwu: add dependency checks for selecting FWU metadata version

2024-08-30 Thread Sughosh Ganu
: Sughosh Ganu --- lib/fwu_updates/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/fwu_updates/Kconfig b/lib/fwu_updates/Kconfig index 51b7fbbefd..a722107c12 100644 --- a/lib/fwu_updates/Kconfig +++ b/lib/fwu_updates/Kconfig @@ -40,6 +40,7 @@ config FWU_MDATA_V1 config

[PATCH 4/6] fwu: check all images for transitioning out of Trial State

2024-08-30 Thread Sughosh Ganu
The platform transitions out of Trial State into the Regular State only when all the images in the update bank have been accepted. Check for this condition before transitioning out of Trial State. Signed-off-by: Sughosh Ganu --- include/fwu.h| 11 +++ lib/fwu_updates/fwu.c

[PATCH 3/6] fwu: v1: do a version check for the metadata

2024-08-30 Thread Sughosh Ganu
Do a sanity check that the version of the FWU metadata that has been read aligns with the version enabled in the image. This allows to indicate an early failure as part of the FWU module initialisation. Signed-off-by: Sughosh Ganu --- lib/fwu_updates/fwu_v1.c | 9 - 1 file changed, 8

[PATCH 2/6] fwu: v2: try reading both copies of metadata

2024-08-30 Thread Sughosh Ganu
the scenario where the primary metadata partition has been corrupted, but the secondary partition is intact. Signed-off-by: Sughosh Ganu --- lib/fwu_updates/fwu_v2.c | 77 +--- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/lib/fwu_updates

[PATCH 1/6] fwu: v2: perform some checks before reading metadata

2024-08-30 Thread Sughosh Ganu
The version 2 of the FWU metadata has a top level structure, followed by optional information on the updatable images. Perform some sanity checks on some of the fields in the top level structure to determine if the rest of the structure has to be read. Signed-off-by: Sughosh Ganu --- lib

[PATCH 0/6] Miscellaneous FWU fixes

2024-08-30 Thread Sughosh Ganu
The following set of patches are miscellaneous fixes and some hardening of the FWU update logic. Sughosh Ganu (6): fwu: v2: perform some checks before reading metadata fwu: v2: try reading both copies of metadata fwu: v1: do a version check for the metadata fwu: check all images for

Re: [PATCH 17/18] rockchip: mmc: Fix a missing colon

2024-08-28 Thread Sughosh Ganu
On Wed, 28 Aug 2024 at 07:18, Simon Glass wrote: > > Add a missing colon in rk3399_emmc_get_phy(). > > Signed-off-by: Simon Glass > --- The change seems to be adding a newline, and not a colon as the commit message is suggesting. -sughosh > > drivers/mmc/rockchip_sdhci.c | 2 +- > 1 file chan

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

2024-08-28 Thread Sughosh Ganu
Use the API function list_count_nodes() to count the number of list entries. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V1: Rebased on top of next boot/scene.c | 8 +--- drivers/mtd/ubi/fastmap.c | 8 +++- fs/yaffs2/yaffs_guts.c| 5

[PATCH v4 05/27] lmb: make LMB memory map persistent and global

2024-08-26 Thread Sughosh Ganu
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 Signed-off-by: Simon Glass [sjg: Optimise the logic to add a region in lmb_add_region_flags()] [sjg: Use a stack to store pointer of lmb struct when ru

[PATCH v4 27/27] lmb: add logic to print lmb flag strings

2024-08-26 Thread Sughosh Ganu
Instead of printing the LMB flags as numerical values, print them as strings. This makes it easier to understand what flags are associated with the lmb region. Also make corresponding changes to the bdinfo command's test code. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Ch

[PATCH v4 26/27] stm32mp: compute ram_top based on the optee base address

2024-08-26 Thread Sughosh Ganu
this value. Signed-off-by: Sughosh Ganu --- Changes since V3: None arch/arm/mach-stm32mp/dram_init.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-stm32mp/dram_init.c b/arch/arm/mach-stm32mp/dram_init.c index 286791be2e..198785353f 100644 --- a

[PATCH v4 25/27] stm32mp: allow calling optee_get_reserved_memory() from U-Boot

2024-08-26 Thread Sughosh Ganu
used to compute the ram_top address. Signed-off-by: Sughosh Ganu --- Changes since V3: * s/uint32_t/u32 in optee_get_reserved_memory() as suggested by checkpatch. arch/arm/mach-stm32mp/dram_init.c| 17 + arch/arm/mach-stm32mp/include/mach/stm32mp.h | 11

[PATCH v4 24/27] zynq: lmb: do not add to lmb map before relocation

2024-08-26 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 V3: None board/xilinx/common/board.c

[PATCH v4 23/27] sandbox: iommu: remove lmb allocation in the driver

2024-08-26 Thread Sughosh Ganu
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 Reviewed-by: Simon Glass --- Changes since

[PATCH v4 22/27] sandbox: spl: enable lmb config for SPL

2024-08-26 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 Reviewed-by: Simon Glass --- Changes since V3: None configs/sandbox_noinst_defconfig | 1 + configs/sandbox_spl_defconfig| 1 + 2 files changed, 2 insertions(+) diff --git a

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

2024-08-26 Thread Sughosh Ganu
Initialise the ram bank information for sandbox in SPL. The ram bank information gets initialised as part of the SPL initialisation sequence in board_init_r(), which is then used for adding available memory to the LMB memory map. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes

[PATCH v4 20/27] spl: call spl_board_init() at the end of the spl init sequence

2024-08-26 Thread Sughosh Ganu
LMB memory map. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V3: None 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 ad2dc6a908..c3a4424072 100644 --- a/common/spl/spl.c +++ b/common

[PATCH v4 19/27] sandbox: move the TCG event log to the start of ram memory

2024-08-26 Thread Sughosh Ganu
: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V3: None arch/sandbox/dts/test.dts | 2 +- configs/sandbox_spl_defconfig | 2 +- doc/arch/sandbox/sandbox.rst | 5 +++-- lib/Kconfig | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/sandbox

[PATCH v4 18/27] lmb: remove the unused board_lmb_reserve() function

2024-08-26 Thread Sughosh Ganu
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 Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- Changes since V3: None include/lmb.h | 2 -- lib/lmb.c | 6

[PATCH v4 17/27] lmb: do away with arch_lmb_reserve()

2024-08-26 Thread Sughosh Ganu
() 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 Reviewed-by: Simon Glass --- Changes since V3: * s/16384/SZ_16K in lmb_reserve_uboot_region(). * Fix the corresponding

[PATCH v4 16/27] ppc: lmb: move arch specific lmb reservations to arch_misc_init()

2024-08-26 Thread Sughosh Ganu
() function. This allows to move the U-Boot memory region reservation to a different function, and remove arch_lmb_reserve() in a subsequent commit. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V3: * Removed the additional blank line in arch/powerpc/lib/misc.c as suggested

[PATCH v4 15/27] lmb: init: initialise the lmb data structures during board init

2024-08-26 Thread Sughosh Ganu
the board init. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V3: None common/board_r.c | 10 ++ common/spl/spl.c | 3 +++ 2 files changed, 13 insertions(+) diff --git a/common/board_r.c b/common/board_r.c index f445803d7a..a60da39a29 100644 --- a/common

[PATCH v4 14/27] lmb: bootm: remove superfluous lmb stub functions

2024-08-26 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 Reviewed-by: Simon Glass --- Changes since V3: None boot/bootm.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/boot

[PATCH v4 13/27] lmb: remove lmb_init_and_reserve_range() function

2024-08-26 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 v4 12/27] lmb: remove the lmb_init_and_reserve() function

2024-08-26 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 --- Changes since V3: None arch/arm/mach-apple/board.c

[PATCH v4 11/27] lmb: reserve common areas during board init

2024-08-26 Thread Sughosh Ganu
ned-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V3: * Fix the alignment in arch_lmb_reserve_generic() as suggested by checkpatch. lib/lmb.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index

[PATCH v4 10/27] lmb: introduce a function to add memory to the lmb memory map

2024-08-26 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 Reviewed-by: Simon Glass --- Changes since V3: None include/lmb.h | 11 +++ lib

[PATCH v4 09/27] lmb: allow lmb module to be used in SPL

2024-08-26 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

[PATCH v4 08/27] lmb: config: add lmb config symbols for SPL

2024-08-26 Thread Sughosh Ganu
heap in SPL. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V3: 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

[PATCH v4 07/27] lmb: remove config symbols used for lmb region count

2024-08-26 Thread Sughosh Ganu
the earlier implementation of static arrays. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- Changes since V3: None configs/a3y17lte_defconfig | 1 - configs/a5y17lte_defconfig | 1 - configs/a7y17lte_defconfig | 1 - configs/apple_m1_defconfig

[PATCH v4 06/27] lmb: allow for resizing lmb regions

2024-08-26 Thread Sughosh Ganu
this attribute would indicate that the region cannot be resized. Signed-off-by: Sughosh Ganu --- Changes since V3: * Do away with multiple assignments in lmb_resize_regions() as suggested by checkpatch. include/lmb.h | 1 + lib/lmb.c | 99 ++---

[PATCH v4 04/27] lmb: use the BIT macro for lmb flags

2024-08-26 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 Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- Changes since V3: None include/lmb.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

  1   2   3   4   5   6   7   8   9   10   >