Re: [PATCH 3/6] lmb: Make const flag_str[] in lmb_print_region_flags() more const

2024-12-07 Thread Ilias Apalodimas
On Sun, 8 Dec 2024 at 02:21, Sam Protsenko wrote: > > flag_str[] is a pointer to const. Make it also a const pointer. Improve > a style a bit while a it, to make this line fit 80 characters limit. > > No functional change. > > Signed-off-by: Sam Protsenko > --- > lib/lmb.c | 3 ++- > 1 file chan

Re: [PATCH 4/6] lmb: Improve coding style

2024-12-07 Thread Ilias Apalodimas
On Sun, 8 Dec 2024 at 02:21, Sam Protsenko wrote: > > Fix checkpatch warnings. No functional change. > > Signed-off-by: Sam Protsenko > --- > lib/lmb.c | 29 + > 1 file changed, 17 insertions(+), 12 deletions(-) > > diff --git a/lib/lmb.c b/lib/lmb.c > index 1642ce48b

Re: [PATCH 0/6] lmb: Fix reserving the same region multiple times

2024-12-07 Thread Ilias Apalodimas
Hi Sam, On Sun, 8 Dec 2024 at 02:21, Sam Protsenko wrote: > > Since commit 1d9aa4a283da ("lmb: Fix the allocation of overlapping > memory areas with !LMB_NONE") the lmb_add_region_flags() returns -1 when > the caller tries to add the already existing region with !LMB_NONE > flags (it was returnin

Re: [PATCH 6/6] boot: fdt: Handle already reserved memory in boot_fdt_reserve_region()

2024-12-07 Thread Ilias Apalodimas
On Sun, 8 Dec 2024 at 02:21, Sam Protsenko wrote: > > The boot_fdt_add_mem_rsv_regions() function can be called twice, e.g. > first time during the board init (as a part of LMB init), and then when > booting the OS with 'booti' command: > > lmb_add_region_flags > lmb_reserve_flags > bo

Re: [PATCH 5/6] lmb: Improve kernel-doc comments

2024-12-07 Thread Ilias Apalodimas
There was a discussion recently on whether this should be in the .h or .c But I don't really mind as long as we have a common policy On Sun, 8 Dec 2024 at 02:21, Sam Protsenko wrote: > > Fix warnings from kernel-doc script. Improve and unify overall style of > kernel-doc comments in lmb source f

Re: [PATCH v4 2/2] doc: spacemit: bananapi_f3: document Banana Pi F3 board

2024-12-07 Thread Huan Zhou
On Wed, Dec 04, 2024 at 09:52:09AM +0100, Marcel Ziswiler wrote: > Hi Yixun Lan > > On Wed, 2024-12-04 at 08:58 +0800, Yixun Lan wrote: > > Hi Marcel, Huan > > > > On 18:52 Tue 03 Dec , Marcel Ziswiler wrote: > > > Hi Huan Zhou > > > > > > On Fri, 2024-11-29 at 13:37 +0800, Huan Zhou wrote:

Re: [PATCH 1/6] lmb: Fix flags data type in lmb_add_region_flags()

2024-12-07 Thread Ilias Apalodimas
On Sun, 8 Dec 2024 at 02:21, Sam Protsenko wrote: > > rgnflags variable in lmb_add_region_flags() has incorrect type: it's > declared as phys_size_t when it should be enum lmb_flags. That > copy-paste mistake was firstly introduced in commit 59c0ea5df33f ("lmb: > Add support of flags for no-map pr

Re: [PATCH 2/6] lmb: Return -EEXIST in lmb_add_region_flags() if region already added

2024-12-07 Thread Ilias Apalodimas
Hi Sam, On Sun, 8 Dec 2024 at 02:21, Sam Protsenko wrote: > > An attempt to add the already added LMB region (with exactly the same > start address, size and flags) using lmb_add_region_flags() ends up in > lmb_addrs_overlap() check, which eventually leads to either returning 0 > if 'flags' is LM

Re: [REGRESSION] lmb: add and reserve memory above ram_top

2024-12-07 Thread Sam Protsenko
On Thu, Dec 5, 2024 at 11:23 PM Sughosh Ganu wrote: > [snip] > > ERROR: reserving fdt memory region failed (addr=bab0 > > size=550 flags=2) > > ERROR: reserving fdt memory region failed (addr=f000 > > size=20 flags=4) > > > > It looks like all mentioned error messages are

[PATCH 6/6] boot: fdt: Handle already reserved memory in boot_fdt_reserve_region()

2024-12-07 Thread Sam Protsenko
The boot_fdt_add_mem_rsv_regions() function can be called twice, e.g. first time during the board init (as a part of LMB init), and then when booting the OS with 'booti' command: lmb_add_region_flags lmb_reserve_flags boot_fdt_reserve_region boot_fdt_add_mem_rsv_regions

[PATCH 5/6] lmb: Improve kernel-doc comments

2024-12-07 Thread Sam Protsenko
Fix warnings from kernel-doc script. Improve and unify overall style of kernel-doc comments in lmb source files. Move all kernel-doc comments for public functions into the header, as recommended in U-Boot documentation, which also takes care of existing duplication. While at it, do a bit of cosmeti

[PATCH 4/6] lmb: Improve coding style

2024-12-07 Thread Sam Protsenko
Fix checkpatch warnings. No functional change. Signed-off-by: Sam Protsenko --- lib/lmb.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index 1642ce48bbbd..8c1c9b0f67c8 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -57,7 +57

[PATCH 3/6] lmb: Make const flag_str[] in lmb_print_region_flags() more const

2024-12-07 Thread Sam Protsenko
flag_str[] is a pointer to const. Make it also a const pointer. Improve a style a bit while a it, to make this line fit 80 characters limit. No functional change. Signed-off-by: Sam Protsenko --- lib/lmb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/lmb.c b/lib/lmb

[PATCH 2/6] lmb: Return -EEXIST in lmb_add_region_flags() if region already added

2024-12-07 Thread Sam Protsenko
An attempt to add the already added LMB region (with exactly the same start address, size and flags) using lmb_add_region_flags() ends up in lmb_addrs_overlap() check, which eventually leads to either returning 0 if 'flags' is LMB_NONE, or -1 otherwise. It makes it impossible for the user of this f

[PATCH 1/6] lmb: Fix flags data type in lmb_add_region_flags()

2024-12-07 Thread Sam Protsenko
rgnflags variable in lmb_add_region_flags() has incorrect type: it's declared as phys_size_t when it should be enum lmb_flags. That copy-paste mistake was firstly introduced in commit 59c0ea5df33f ("lmb: Add support of flags for no-map properties"), and then copied further into commit ed17a33fed29

[PATCH 0/6] lmb: Fix reserving the same region multiple times

2024-12-07 Thread Sam Protsenko
Since commit 1d9aa4a283da ("lmb: Fix the allocation of overlapping memory areas with !LMB_NONE") the lmb_add_region_flags() returns -1 when the caller tries to add the already existing region with !LMB_NONE flags (it was returning 0 before that patch). That causes boot_fdt_reserve_region() function

Re: [PATCH 0/3] rpi: Tidy up booting

2024-12-07 Thread Simon Glass
Hi Tom, On Fri, 6 Dec 2024 at 17:52, Tom Rini wrote: > > On Fri, Dec 06, 2024 at 05:10:39PM -0700, Simon Glass wrote: > > Hi Tom, > > > > On Fri, 6 Dec 2024 at 17:00, Tom Rini wrote: > > > > > > On Fri, Dec 06, 2024 at 04:56:31PM -0700, Simon Glass wrote: > > > > Hi Tom, > > > > > > > > On Fri,

[PATCH v5 00/13] Add video damage tracking

2024-12-07 Thread Simon Glass
On Mon, Aug 21, 2023 at 01:50 PM Alper Nebi Yasak wrote: > > This is a rebase of Alexander Graf's video damage tracking series, with > some tests and other changes. The original cover letter is as follows: > > > > This patch set speeds up graphics output on ARM by a factor of 60x. > > > > On most

Re: [PATCH 01/18] scripts: Add a script for building and booting QEMU

2024-12-07 Thread Simon Glass
Hi Tom, On Fri, 15 Nov 2024 at 08:14, Tom Rini wrote: > > On Fri, Nov 15, 2024 at 07:21:47AM -0700, Simon Glass wrote: > > Hi Tom, > > > > On Tue, 12 Nov 2024 at 17:54, Tom Rini wrote: > > > > > > On Wed, Nov 13, 2024 at 01:49:30AM +0100, Heinrich Schuchardt wrote: > > > > Am 12. November 2024 1

Re: UEFI messages on startup

2024-12-07 Thread Simon Glass
Hi Heinrich, Tom, On Sat, 7 Dec 2024 at 15:03, Heinrich Schuchardt wrote: > > Am 7. Dezember 2024 22:27:49 MEZ schrieb Tom Rini : > >On Sat, Dec 07, 2024 at 01:48:41PM -0700, Simon Glass wrote: > > > >> Hi, > >> > >> I see these messages on startup with a rpi_4 - what can we do about > >> this? I

Re: UEFI messages on startup

2024-12-07 Thread Heinrich Schuchardt
Am 7. Dezember 2024 22:27:49 MEZ schrieb Tom Rini : >On Sat, Dec 07, 2024 at 01:48:41PM -0700, Simon Glass wrote: > >> Hi, >> >> I see these messages on startup with a rpi_4 - what can we do about >> this? It happens on every boot. >> >> ** File not found ubootefi.var ** >> Failed to load EFI var

Re: UEFI messages on startup

2024-12-07 Thread Tom Rini
On Sat, Dec 07, 2024 at 01:48:41PM -0700, Simon Glass wrote: > Hi, > > I see these messages on startup with a rpi_4 - what can we do about > this? It happens on every boot. > > ** File not found ubootefi.var ** > Failed to load EFI variables > ** Unable to write file ubootefi.var ** > Failed to

UEFI messages on startup

2024-12-07 Thread Simon Glass
Hi, I see these messages on startup with a rpi_4 - what can we do about this? It happens on every boot. ** File not found ubootefi.var ** Failed to load EFI variables ** Unable to write file ubootefi.var ** Failed to persist EFI variables ** Unable to write file ubootefi.var ** Failed to persist

[PATCH v3 09/19] spl: Report a loader failure

2024-12-07 Thread Simon Glass
If a loader returns an error code it is silently ignored. Show a message to at least provide some feedback to the user. Signed-off-by: Simon Glass --- (no changes since v1) common/spl/spl.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/spl/spl.c b/comm

[PATCH v3 00/19] vbe: Series part E

2024-12-07 Thread Simon Glass
This includes various patches towards implementing the VBE abrec bootmeth in U-Boot. It mostly focuses on SPL tweaks and adjusting what fatures are available in VPL. Changes in v3: - Add new patch to avoid size growth in spl_mmc_find_device() debug - Use strlcpy() instead of strncpy() - Rebase t

[PATCH v3 18/19] boot: Imply CRC8 with VBE

2024-12-07 Thread Simon Glass
VBE uses a crc8 checksum to verify that the nvdata is valid, so make sure it is available if VBE is enabled. Signed-off-by: Simon Glass --- (no changes since v2) Changes in v2: - Depend on TPL/VPL as well boot/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/Kconfig b/boot/K

[PATCH v3 19/19] hash: Plumb crc8 into the hash functions

2024-12-07 Thread Simon Glass
Add an entry for crc8, with watchdog handling. Signed-off-by: Simon Glass --- Changes in v3: - Rebase to master Changes in v2: - Drop patch 'serial: ns16550: Allow clocks to be missing' common/hash.c| 8 include/u-boot/crc.h | 3 +++ lib/crc8.c | 6 ++ 3 files c

[PATCH v3 15/19] spl: lib: Allow for decompression in any SPL build

2024-12-07 Thread Simon Glass
Add Kconfig symbols and update the Makefile rules so that decompression can be used in TPL and VPL Signed-off-by: Simon Glass --- (no changes since v1) lib/Kconfig | 35 +++ lib/Makefile | 12 ++-- 2 files changed, 41 insertions(+), 6 deletions(-) diff

[PATCH v3 17/19] lib: Allow crc8 in TPL and VPL

2024-12-07 Thread Simon Glass
Provide options to enable the CRC8 feature in TPL and VPL builds. Signed-off-by: Simon Glass --- (no changes since v2) Changes in v2: - Fix 'depends on SPL' to depend on TPL lib/Kconfig | 18 ++ 1 file changed, 18 insertions(+) diff --git a/lib/Kconfig b/lib/Kconfig index 3fa

[PATCH v3 16/19] boot: Allow use of FIT in TPL and VPL

2024-12-07 Thread Simon Glass
With VBE we want to use FIT in all phases of the boot. Add Kconfig options to support this. Disable the options for sandbox_vpl for now. Signed-off-by: Simon Glass --- (no changes since v1) boot/Kconfig | 69 ++- configs/sandbox_vpl_defconfig |

[PATCH v3 13/19] spl: Drop a duplicate variable in boot_from_devices()

2024-12-07 Thread Simon Glass
The variable 'ret' is defined twice, which is not intended. This may have been a local merge error. Signed-off-by: Simon Glass Fixes: 2eefeb6d893 ("spl: Report a loader failure") --- (no changes since v1) common/spl/spl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/common/spl/spl.c b/co

[PATCH v3 14/19] spl: Add some more debugging to load_simple_fit()

2024-12-07 Thread Simon Glass
Add debugging of image-loading progress. Fix a stale comment in the function comment while we are here. Signed-off-by: Simon Glass --- (no changes since v1) common/spl/spl_fit.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_

[PATCH v3 11/19] spl: Support a relocated stack in any XPL phase

2024-12-07 Thread Simon Glass
The current check looks only at SPL, but TPL or VPL might have a different setting. Update the condition. Signed-off-by: Simon Glass --- (no changes since v1) common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 91ee07f7

[PATCH v3 12/19] spl: Drop use of uintptr_t

2024-12-07 Thread Simon Glass
U-Boot uses ulong for addresses. It is confusing to use uintptr_t in a few places, since it makes people wonder if the types are compatible. Change the few occurences in SPL to use ulong Signed-off-by: Simon Glass --- (no changes since v1) common/spl/spl_atf.c| 36 ++---

[PATCH v3 10/19] spl: Allow serial to be disabled in any XPL phase

2024-12-07 Thread Simon Glass
The current check looks only at SPL, but TPL or VPL might have a different setting. Update the condition. Signed-off-by: Simon Glass --- (no changes since v1) common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 7c57eb85

[PATCH v3 06/19] malloc: Show amount of used space when memory runs out

2024-12-07 Thread Simon Glass
Show a bit more information when malloc() space is exhausted and debugging is enabled. Signed-off-by: Simon Glass --- (no changes since v2) Changes in v2: - Add field names into the message common/malloc_simple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/mal

[PATCH v3 08/19] Support setting a maximum size for the VPL image

2024-12-07 Thread Simon Glass
Add a size limit for VPL, to match those for SPL and TPL Signed-off-by: Simon Glass --- (no changes since v1) common/spl/Kconfig.vpl | 8 1 file changed, 8 insertions(+) diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl index 3dc0e95e09f..eb57dfabea5 100644 --- a/common/sp

[PATCH v3 07/19] malloc: Provide a simple malloc for VPL

2024-12-07 Thread Simon Glass
The VPL phase may want to use the smaller malloc() implementation, so add an option for this. Signed-off-by: Simon Glass --- (no changes since v1) common/spl/Kconfig.vpl | 9 + 1 file changed, 9 insertions(+) diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl index d06f36d4e

[PATCH v3 05/19] boot: Respect the load_op in fit_image_load()

2024-12-07 Thread Simon Glass
Some code has crept in which ignores this parameter. Fix this and add a little debugging. Signed-off-by: Simon Glass --- (no changes since v1) boot/image-fit.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/boot/image-fit.c b/boot/image-fit.c index 439ff51edf6..

[PATCH v3 04/19] bootstd: Avoid sprintf() in SPL when creating bootdevs

2024-12-07 Thread Simon Glass
The name of the bootdev device is not that important, particular in SPL. Save a little code space by using a simpler name. Signed-off-by: Simon Glass --- Changes in v3: - Use strlcpy() instead of strncpy() boot/bootdev-uclass.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-)

[PATCH v3 03/19] boot: Allow FIT to fall back from best-match option

2024-12-07 Thread Simon Glass
When the best-match feature fails to find something, use the provided config name as a fallback. The allows SPL to select a suitable config when best-match is enabled. Signed-off-by: Simon Glass --- (no changes since v1) boot/image-fit.c | 19 ++- include/image.h | 4 +++- 2

[PATCH v3 01/19] spl: mmc: Avoid size growth in spl_mmc_find_device() debug

2024-12-07 Thread Simon Glass
The for() loop ends up being in the code even if the log_debug() does nothing. Add a condition to fix this. Signed-off-by: Simon Glass --- Changes in v3: - Add new patch to avoid size growth in spl_mmc_find_device() debug common/spl/spl_mmc.c | 6 -- 1 file changed, 4 insertions(+), 2 dele

[PATCH v3 02/19] image: Add a prototype for fit_image_get_phase()

2024-12-07 Thread Simon Glass
This function exists but is not exported. Add a prototype so it can be used elsewhere. Signed-off-by: Simon Glass --- (no changes since v1) include/image.h | 12 1 file changed, 12 insertions(+) diff --git a/include/image.h b/include/image.h index 9be5acd8158..bb15ef69871 100644

Re: [PATCH v2 13/18] mmc: Add more debugging for SPL

2024-12-07 Thread Simon Glass
Hi Tom, On Thu, 3 Oct 2024 at 15:57, Tom Rini wrote: > > On Fri, Sep 20, 2024 at 09:24:37AM +0200, Simon Glass wrote: > > > When MMC booting fails it is sometimes hard to figure out what went > > wrong as there is no error code. It isn't even clear which MMC device > > was chosen, since SPL can h

Re: [PATCH] mbedtls: remove MBEDTLS_HAVE_TIME

2024-12-07 Thread Tom Rini
On Fri, 06 Dec 2024 12:56:45 +0200, Ilias Apalodimas wrote: > When MbedTLS TLS features were added MBEDTLS_HAVE_TIME was defined as part > of enabling https:// support. However that pointed to the wrong function > which could crash if it received a NULL pointer. > > Looking closer that function i

Re: [PATCH] arm: qemu: fix update_info declaration

2024-12-07 Thread Tom Rini
On Fri, 06 Dec 2024 08:58:53 +0100, Vincent Stehlé wrote: > Add a missing comma in the update_info structure declaration. > > This fixes the following build error when building with > EFI_RUNTIME_UPDATE_CAPSULE or EFI_CAPSULE_ON_DISK: > > board/emulation/qemu-arm/qemu-arm.c:52:9: error: reques

Re: [PATCH 1/1] net: disable MBEDTLS in SPL

2024-12-07 Thread Tom Rini
On Fri, 06 Dec 2024 12:37:09 +0100, Heinrich Schuchardt wrote: > Building SPL fails with MBEDTLS enabled. > Currently we don't need it there. > > Applied to u-boot/master, thanks! -- Tom

Re: [PATCH] lmb: prohibit allocations above ram_top even from same bank

2024-12-07 Thread Tom Rini
On Mon, 02 Dec 2024 12:36:24 +0530, Sughosh Ganu wrote: > There are platforms which set the value of ram_top based on certain > restrictions that the platform might have in accessing memory above > ram_top, even when the memory region is in the same DRAM bank. So, > even though the LMB allocator w

[PATCH] boot: Use correct PHASE_ variable for expo

2024-12-07 Thread Simon Glass
This patch was written before the XPL change-over. Update the Makefile condition to the new way. Signed-off-by: Simon Glass Fixes: ae3b5928d61 ("x86: coreboot: Allow building an expo for...") --- boot/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/Makefile b/

Re: [PATCH v2 03/18] bootstd: Avoid sprintf() in SPL when creating bootdevs

2024-12-07 Thread Simon Glass
Hi Tom, On Fri, 4 Oct 2024 at 16:02, Tom Rini wrote: > > On Fri, Sep 20, 2024 at 10:12:42AM +0200, Simon Glass wrote: > > > The name of the bootdev device is not that important, particular in SPL. > > Save a little code space by using a simpler name. > > > > Signed-off-by: Simon Glass > > --- >

Re: [PATCH v2 1/4] board/qualcomm: introduce phone config

2024-12-07 Thread Alexey Minnekhanov
On 12/6/24 19:50, Julius Lehmann wrote: On 04.10.24 14:46, Caleb Connolly wrote: Phones don't have keyboards! Introduce a phone-specific config fragment and associated environment file to make U-Boot more useful on these devices. This allows for navigating via the buttons and enabling various US

Re: Applying patches to mainline (Was: Re: [PATCH v2 0/7] efi_loader: Add support for logging to a buffer)

2024-12-07 Thread Ilias Apalodimas
Hi Simon, On Fri, 6 Dec 2024 at 21:19, Simon Glass wrote: > > Hi Tom, > > On Wed, 4 Dec 2024 at 09:27, Tom Rini wrote: > > > > On Wed, Dec 04, 2024 at 08:13:04AM -0700, Simon Glass wrote: > > > Hi Tom, > > > > > > On Tue, 3 Dec 2024 at 18:29, Tom Rini wrote: > > > > > > > > On Mon, Dec 02, 2024