]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
16 months agoMerge tag 'dm-next-14aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm...
Tom Rini [Tue, 15 Aug 2023 01:39:08 +0000 (21:39 -0400)]
Merge tag 'dm-next-14aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm into next

Enhance bootmeth_cros

16 months agoMerge branch '2023-08-14-keep-fixed-gpio-regulator-count-in-balance' into next
Tom Rini [Mon, 14 Aug 2023 13:14:51 +0000 (09:14 -0400)]
Merge branch '2023-08-14-keep-fixed-gpio-regulator-count-in-balance' into next

To quote the author:

The commit 4fcba5d556b4 ("regulator: implement basic reference counter")
have made it more important to keep fixed/gpio regulators enable/disable
state in balance.

This series fixes an inbalance in the mmc_dw driver and changes to use
the more relaxed regulator_set_enable_if_allowed function for a few
other drivers.

The regulator_set_enable_if_allowed function is more relaxed and will
return ENOSYS if the provided regulator is NULL or when DM_REGULATOR
was disabled. Using the following call convention should be safe:

  ret = regulator_set_enable_if_allowed(<supply>, <true|false>);
  if (ret && ret != -ENOSYS)
          return ret;

16 months agommc: dw_mmc: Keep vqmmc-supply enable count in balance
Jonas Karlman [Wed, 19 Jul 2023 21:21:00 +0000 (21:21 +0000)]
mmc: dw_mmc: Keep vqmmc-supply enable count in balance

With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter"), keeping regulator enablement in balance become more important.

Disable vqmmc-supply before signal voltage is changed to keep regulator
enable counter in balance.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
16 months agommc: Use regulator_set_enable_if_allowed
Jonas Karlman [Wed, 19 Jul 2023 21:20:59 +0000 (21:20 +0000)]
mmc: Use regulator_set_enable_if_allowed

With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # P895 Tegra 3;
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # rockpro64-rk3399
16 months agousb: ehci-generic: Use regulator_set_enable_if_allowed
Jonas Karlman [Wed, 19 Jul 2023 21:20:57 +0000 (21:20 +0000)]
usb: ehci-generic: Use regulator_set_enable_if_allowed

With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Marek Vasut <marex@denx.de>
16 months agousb: dwc2: Use regulator_set_enable_if_allowed
Jonas Karlman [Wed, 19 Jul 2023 21:20:56 +0000 (21:20 +0000)]
usb: dwc2: Use regulator_set_enable_if_allowed

With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # rockpro64-rk3399
Reviewed-by: Marek Vasut <marex@denx.de>
16 months agoadc: Use regulator_set_enable_if_allowed
Jonas Karlman [Wed, 19 Jul 2023 21:20:55 +0000 (21:20 +0000)]
adc: Use regulator_set_enable_if_allowed

With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # rockpro64-rk3399
16 months agobootstd: cros: Add ARM support
Simon Glass [Sun, 30 Jul 2023 17:17:02 +0000 (11:17 -0600)]
bootstd: cros: Add ARM support

Support booting ChromiumOS on ARM devices using FIT. Add an entry into the
boot implementation which does not require a command line. This can be
expanded over time as the bootm code is refactored.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Add a command to read all files for a bootflow
Simon Glass [Fri, 11 Aug 2023 01:33:18 +0000 (19:33 -0600)]
bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Allow display of the x86 setup information
Simon Glass [Sun, 30 Jul 2023 17:17:00 +0000 (11:17 -0600)]
bootstd: Allow display of the x86 setup information

Provide an option to dump this information if available.

Move the funciion prototype to the common x86 header. Allow the command
line to be left out since 'bootflow info' show this itself and it is
not in the correct place in memory until the kernel is actually booted.

Fix a badly aligned heading while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Split up reading info and kernel
Simon Glass [Sun, 30 Jul 2023 17:16:59 +0000 (11:16 -0600)]
bootstd: cros: Split up reading info and kernel

Use the two new functions to separate reading of the ChromiumOS info from
the partition from actually reading the kernel and booting it.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Add a function to read a kernel
Simon Glass [Sun, 30 Jul 2023 17:16:58 +0000 (11:16 -0600)]
bootstd: cros: Add a function to read a kernel

The code to read the ChromiumOS information from the partition is
currently all in one function.

Create a new function which reads the kernel, assuming that the metadata
has been parsed.

For now this function is not used. Future work will plumb it in.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Add a function to read info from partition
Simon Glass [Sun, 30 Jul 2023 17:16:57 +0000 (11:16 -0600)]
bootstd: cros: Add a function to read info from partition

The code to read the ChromiumOS information from the partition is
currently all in one function. It reads the entire kernel, which is
unnecessary unless it is to be booted.

Create a new function which reads just the minimum required data from the
disk, then obtains what it needs from there.

For now this function is not used. Future work will plumb it in.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Add private bootmeth data to the bootflow
Simon Glass [Sun, 30 Jul 2023 17:16:56 +0000 (11:16 -0600)]
bootstd: Add private bootmeth data to the bootflow

Some bootmeths need to store their own information related to the
bootflow, in addition to the generic information in struct bootflow.
Add a pointer for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Add private info for ChromiumOS
Simon Glass [Sun, 30 Jul 2023 17:16:55 +0000 (11:16 -0600)]
bootstd: cros: Add private info for ChromiumOS

Create a new private structure to hold information gleaned from the disk.
This will allow separation between reading of the bootflow information and
(later) reading the whole kernel.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Add docs for the kernel layout
Simon Glass [Sun, 30 Jul 2023 17:16:54 +0000 (11:16 -0600)]
bootstd: cros: Add docs for the kernel layout

Provide brief documentation about the ChromiumOS kernel layout.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Move common zimage functions to bootm.h
Simon Glass [Sun, 30 Jul 2023 17:16:53 +0000 (11:16 -0600)]
bootstd: Move common zimage functions to bootm.h

We want to avoid using #ifdefs around header files and in the code. It
makes sense to collect the various functions used for loading images into
a single header which can be included by all architectures. The best place
for this is the arch-neutral bootm.h header, so use that.

Move some zimage functions into this bootm.h header.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Simplify setup and cmdline expressions
Simon Glass [Sun, 30 Jul 2023 17:16:52 +0000 (11:16 -0600)]
bootstd: cros: Simplify setup and cmdline expressions

Create a common base from which the other parts are offset and make all
of the offsets related to that. This makes the code a little easier to
read.

Use X86_ prefixes for the two values which are x86-specific.

Drop OFFSET_BASE since it is available in a header field.

Drop the unnecessary 'start' variable too.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Decode some kernel preamble fields
Simon Glass [Sun, 30 Jul 2023 17:16:51 +0000 (11:16 -0600)]
bootstd: cros: Decode some kernel preamble fields

Decode the kernel start and size using the structures provided. This
accesses the same data, just in a cleaner way.

Add some logging for some of the fields in the kernel preamble.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Support a kernel on either partition
Simon Glass [Sun, 30 Jul 2023 17:16:50 +0000 (11:16 -0600)]
bootstd: cros: Support a kernel on either partition

ChromiumOS allows a kernel to be on either partition 2 or 4. Add support
for scanning both and using the first one we find with a suitable
signature.

Record the partition which is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Bring in some ChromiumOS structures
Simon Glass [Sun, 30 Jul 2023 17:16:49 +0000 (11:16 -0600)]
bootstd: cros: Bring in some ChromiumOS structures

Add a header file with structures for booting ChromiumOS, taken from the
vboot tree. Using these makes it easier to understand the code.

Note that the code style has not been updated for U-Boot, with use of
uint64_t,  __attribute__((packed)) and one comment-style nit. This should
make it easier to keep the code in sync. It was taken from commit:

   5b8596ce ("2sha256_arm: Fix data abort issue")

Update the CHROMEOS string to use the defined values.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Move partition reading into a function
Simon Glass [Sun, 30 Jul 2023 17:16:48 +0000 (11:16 -0600)]
bootstd: cros: Move partition reading into a function

Move the code which reads a partition into its own function. Add a
constant for the number of bytes to 'probe' at the start of the partition.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Correct reporting of I/O errors
Simon Glass [Sun, 30 Jul 2023 17:16:47 +0000 (11:16 -0600)]
bootstd: cros: Correct reporting of I/O errors

Return -EIO when the read failed, rather than the number of blocks read.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoMerge branch '2023-08-09-misc-cleanups' into next
Tom Rini [Wed, 9 Aug 2023 17:15:51 +0000 (13:15 -0400)]
Merge branch '2023-08-09-misc-cleanups' into next

- Rework the arch linker scripts to be consistent for all, support
  Kconfig fragments in the board directory and fix some Kconfig options
  that were hex-type by default of 0 not 0x0.

16 months agoscripts: kconfig: Add config fragment support in board/../
Jason Kacines [Tue, 11 Jul 2023 21:20:46 +0000 (16:20 -0500)]
scripts: kconfig: Add config fragment support in board/../

Add support to config fragments (.config) located in the /board
directory. This will allow only base defconfigs to live in /configs and
all fragments to live in their respective device directory in /board/..

Signed-off-by: Jason Kacines <j-kacines@ti.com>
16 months agotreewide: unify the linker symbol reference format
Shiji Yang [Thu, 3 Aug 2023 01:47:17 +0000 (09:47 +0800)]
treewide: unify the linker symbol reference format

Now all linker symbols are declared as type char[]. Though we can
reference the address via both the array name 'var' and its address
'&var'. It's better to unify them to avoid confusing developers.
This patch converts all '&var' linker symbol refrences to the most
commonly used format 'var'.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agotreewide: rework linker symbol declarations in sections header
Shiji Yang [Thu, 3 Aug 2023 01:47:16 +0000 (09:47 +0800)]
treewide: rework linker symbol declarations in sections header

1. Convert all linker symbols to char[] type so that we can get the
   corresponding address by calling array name 'var' or its address
   '&var'. In this way, we can avoid some potential issues[1].
2. Remove unused symbol '_TEXT_BASE'. It has been abandoned and has
   not been referenced by any source code.
3. Move '__data_end' to the arch x86's own sections header as it's
   only used by x86 arch.
4. Remove some duplicate declared linker symbols. Now we use the
   standard header file to declare them.

[1] This patch fixes the boot failure on MIPS target. Error log:
SPL: Image overlaps SPL

Fixes: 1b8a1be1a1f1 ("spl: spl_legacy: Fix spl_end address")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agoKconfigs: Correct default of "0" on hex type entries
Tom Rini [Wed, 2 Aug 2023 15:09:43 +0000 (11:09 -0400)]
Kconfigs: Correct default of "0" on hex type entries

It is not a parse error to have a default value of "0" for a "hex" type
entry, instead of "0x0".  However, "0" and "0x0" are not treated the
same even by the tools themselves. Correct this by changing the default
value from "0" to "0x0" for all hex type questions that had the
incorrect default. Fix one instance (in two configs) of a default of "0"
being used on a hex question to be "0x0". Remove the cases where a
defconfig had set a value of "0x0" to be used as the default had been
"0".

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoMerge branch '2023-08-08-assorted-code-corrections' into next
Tom Rini [Wed, 9 Aug 2023 01:38:05 +0000 (21:38 -0400)]
Merge branch '2023-08-08-assorted-code-corrections' into next

- A number of code corrections caught by Smatch and a few others as
  well.

16 months agopci: correct function name in message
Heinrich Schuchardt [Thu, 27 Jul 2023 16:50:14 +0000 (18:50 +0200)]
pci: correct function name in message

If an error message contains a function name, it should match the name of
the function throwing the message.

Fixes: 7739d93d8288 ("pci: Match region flags using a mask")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoboard_f: Cosmetic style fix
Bin Meng [Fri, 21 Jul 2023 16:15:21 +0000 (00:15 +0800)]
board_f: Cosmetic style fix

Some coding convention fixes for print_resetinfo().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agocrc32: Drop duplicates crc header includes
Ilya Lukin [Fri, 14 Jul 2023 14:39:32 +0000 (17:39 +0300)]
crc32: Drop duplicates crc header includes

Fixes: 3db711085752 ("crc32: Use the crc.h header for crc functions")
Signed-off-by: Ilya Lukin <4.shket@gmail.com>
16 months agobtrfs: fix some error checking for btrfs_decompress()
Dan Carpenter [Thu, 3 Aug 2023 10:29:34 +0000 (13:29 +0300)]
btrfs: fix some error checking for btrfs_decompress()

The btrfs_decompress() function mostly (u32)-1 on error but it can
also return -EPERM or other kernel error codes from zstd_decompress().
The "ret" variable is an int, so we could just check for negatives.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Qu Wenruo <wqu@suse.com>
16 months agotest: fix a couple NULL vs IS_ERR() checks
Dan Carpenter [Mon, 31 Jul 2023 14:08:41 +0000 (17:08 +0300)]
test: fix a couple NULL vs IS_ERR() checks

The x509_cert_parse() and pkcs7_parse_message() functions return error
pointers.  They don't return NULL.  Update the checks accordingly.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoexpo: allocate correct amount of memory
Dan Carpenter [Mon, 31 Jul 2023 14:08:29 +0000 (17:08 +0300)]
expo: allocate correct amount of memory

This should be allocating the memory for "item" instead of "menu".
The item struct is 48 bytes instead of 96 (assuming a 64bit system)
so this saves a little memory.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agocmd: improve string matching for hex
Dan Carpenter [Mon, 31 Jul 2023 14:03:59 +0000 (17:03 +0300)]
cmd: improve string matching for hex

Match the "=0x" instead of just "=0".

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Heinrich.Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
16 months agocramfs: clean up some error messages
Dan Carpenter [Thu, 27 Jul 2023 07:16:03 +0000 (10:16 +0300)]
cramfs: clean up some error messages

This line break is not done correctly.  We don't want to have all those
tabs in the printed output.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agotest: unicode: fix a sizeof() vs ARRAY_SIZE() bug
Dan Carpenter [Thu, 27 Jul 2023 07:12:58 +0000 (10:12 +0300)]
test: unicode: fix a sizeof() vs ARRAY_SIZE() bug

The u16_strlcat() is in units of u16 not bytes.  So the limit needs to
be ARRAY_SIZE() instead of sizeof().

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
16 months agocmd: pxe_utils: add some missing tabs
Dan Carpenter [Thu, 27 Jul 2023 07:12:39 +0000 (10:12 +0300)]
cmd: pxe_utils: add some missing tabs

These lines are supposed to be indented one more tab.  Otherwise it's
confusing to read.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
16 months agoremoteproc: uclass: Clean up a return
Dan Carpenter [Wed, 26 Jul 2023 07:00:33 +0000 (10:00 +0300)]
remoteproc: uclass: Clean up a return

We know that "pa" is non-NULL so it's nicer to just return zero instead
of return !pa.  This has no effect on runtime behavior.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agofdt: off by one in ofnode_lookup_fdt()
Dan Carpenter [Wed, 26 Jul 2023 06:59:52 +0000 (09:59 +0300)]
fdt: off by one in ofnode_lookup_fdt()

The "oftree_count" is the number of entries which have been set in
the oftree_list[] array.  If all the entries have been initialized then
this off by one would result in reading one element beyond the end
of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agofs: btrfs: Prevent error pointer dereference in list_subvolums()
Dan Carpenter [Wed, 26 Jul 2023 06:59:04 +0000 (09:59 +0300)]
fs: btrfs: Prevent error pointer dereference in list_subvolums()

If btrfs_read_fs_root() fails with -ENOENT, then we go to the next
entry.  Fine.  But if it fails for a different reason then we need
to clean up and return an error code.  In the current code it
doesn't clean up but instead dereferences "root" and crashes.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Marek BehĂşn <kabel@kernel.org>
Reviewed-by: Qu Wenruo <wqu@suse.com>
16 months agocros_ec: Fix an error code is cros_ec_get_sku_id()
Dan Carpenter [Wed, 26 Jul 2023 06:58:34 +0000 (09:58 +0300)]
cros_ec: Fix an error code is cros_ec_get_sku_id()

The ec_command_inptr() function returns negative error codes or
the number of bytes that it was able to read.  The cros_ec_get_sku_id()
function should return negative error codes.  Right now it returns
positive error codes or negative byte counts.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agovideo: Add parentheses around VNBYTES() macro
Dan Carpenter [Wed, 26 Jul 2023 06:54:08 +0000 (09:54 +0300)]
video: Add parentheses around VNBYTES() macro

The VNBYTES() macro needs to have parentheses to prevent some (harmless)
macro expansion bugs.  The VNBYTES() macro is used like this:

VID_TO_PIXEL(x) * VNBYTES(vid_priv->bpix)

The * operation is done before the / operation.  It still ends up with
the same results, but it's not ideal.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agocmd: Fix a size parameter in test_readonly()
Dan Carpenter [Tue, 25 Jul 2023 06:50:26 +0000 (09:50 +0300)]
cmd: Fix a size parameter in test_readonly()

The parentheses are in the wrong place so this passes the number of
bytes to write as "sizeof(index_0) != TPM_SUCCESS" when just
"sizeof(index_0)" was intended.  (1 byte vs 4 bytes).

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
16 months agocmd: Fix an error code in cmd_mux_find()
Dan Carpenter [Tue, 25 Jul 2023 06:50:08 +0000 (09:50 +0300)]
cmd: Fix an error code in cmd_mux_find()

This returns the wrong variable.  It ends up returning NULL when it was
suppose to return an error pointer.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
16 months agolib/charset: fix u16_strlcat() return value
Matthias Schiffer [Fri, 14 Jul 2023 11:24:51 +0000 (13:24 +0200)]
lib/charset: fix u16_strlcat() return value

strlcat returns min(strlen(dest), count)+strlen(src). Make u16_strlcat's
behaviour the same for consistency.

Fixes: eca08ce94ceb ("lib/charset: add u16_strlcat() function")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
16 months agoRevert "lib: string: Fix strlcpy return value", fix callers
Matthias Schiffer [Fri, 14 Jul 2023 11:24:50 +0000 (13:24 +0200)]
Revert "lib: string: Fix strlcpy return value", fix callers

Both the Linux kernel and libbsd agree that strlcpy() should always
return strlen(src) and not include the NUL termination. The incorrect
U-Boot implementation makes it impossible to check the return value for
truncation, and breaks code written with the usual implementation in
mind (for example, fdtdec_add_reserved_memory() was subtly broken).

I reviewed all callers of strlcpy() and strlcat() and fixed them
according to my understanding of the intended function.

This reverts commit d3358ecc54be0bc3b4dd11f7a63eab0a2842f772 and adds
related fixes.

Fixes: d3358ecc54be ("lib: string: Fix strlcpy return value")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
16 months agoPrepare v2023.10-rc2
Tom Rini [Mon, 7 Aug 2023 19:26:50 +0000 (15:26 -0400)]
Prepare v2023.10-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 7 Aug 2023 19:17:12 +0000 (15:17 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMerge branch '2023-08-07-assorted-fixes'
Tom Rini [Mon, 7 Aug 2023 19:11:17 +0000 (15:11 -0400)]
Merge branch '2023-08-07-assorted-fixes'

- Update Azure jobs again, a few MAINTAINERS updates, a few Kconfig
  fixes, an erofs fix and a fix for the recent ten64 updates.

16 months agofs/erofs: Remove an unnecessary assertion
Yifan Zhao [Wed, 26 Jul 2023 04:56:04 +0000 (12:56 +0800)]
fs/erofs: Remove an unnecessary assertion

In [1] Sam points out an assertion does not hold true for 32-bit
platforms, which only impacts Large File Support (LFS) API usage
in erofs-utils according to Xiang [2]. We don't think these APIs
are used in u-boot and this restriction could be safely removed.

[1] https://lists.denx.de/pipermail/u-boot/2023-July/524679.html
[2] https://lists.denx.de/pipermail/u-boot/2023-July/524727.html

Fixes: 3a21e92fc255 ("fs/erofs: Introduce new features including ztailpacking, fragments and dedupe")
Signed-off-by: Yifan Zhao <zhaoyifan@sjtu.edu.cn>
Tested-by: Sam Edwards <CFSworks@gmail.com>
16 months agocommon: Drop duplicate space in SPL_BMP description
Marek Vasut [Sat, 29 Jul 2023 13:34:51 +0000 (15:34 +0200)]
common: Drop duplicate space in SPL_BMP description

Drop duplicate space in Kconfig symbol description.

Signed-off-by: Marek Vasut <marex@denx.de>
16 months agocommon: fix detection of SYS_MALLOC_F_LEN=0x0
Heinrich Schuchardt [Tue, 1 Aug 2023 13:33:41 +0000 (15:33 +0200)]
common: fix detection of SYS_MALLOC_F_LEN=0x0

CONFIG_$(SPL_TPL_)SYS_MALLOC_F_LEN is defined as hex. If set to zero
manually, .config contains '0x0' and not '0' as value.

The default value for CONFIG_SPL_SYS_MALLOC_F_LEN should not be set to 0
but to 0x0 if CONFIG_SPL_FRAMEWORK=n to match a manually set value.

Fixes: c0126bd862a0 ("spl: Support bootstage, log, hash and early malloc in TPL")
Fixes: b61694705217 ("SPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agospl: move SPL_CRC32 option to lib/Kconfig
Oleksandr Suvorov [Thu, 3 Aug 2023 16:05:40 +0000 (19:05 +0300)]
spl: move SPL_CRC32 option to lib/Kconfig

All SPL hash algorithm options are collected in lib/Kconfig. Move
SPL_CRC32 there as well.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agospl: remove duplicate SPL_MD5 option
Oleksandr Suvorov [Thu, 3 Aug 2023 16:05:39 +0000 (19:05 +0300)]
spl: remove duplicate SPL_MD5 option

There is another SPL_MD5 option defined in lib/Kconfig.
Renaming SPL_MD5_SUPPORT introduced duplicate option with
different description. As for now FIT and hash algorithm options
are not related to each others, removing a duplicate option seems OK.

Fixes: 4b00fd1a84c ("Kconfig: Rename SPL_MD5_SUPPORT to SPL_MD5")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
16 months agobloblist: Enforce CRC32
Tom Rini [Mon, 7 Aug 2023 16:32:19 +0000 (12:32 -0400)]
bloblist: Enforce CRC32

In the common bloblist code we call crc32 to get a checksum for the
data.  Ensure we will have the CRC32 code via select.

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMAINTAINERS: Update rockchip platform maintain files
Kever Yang [Mon, 7 Aug 2023 07:52:47 +0000 (15:52 +0800)]
MAINTAINERS: Update rockchip platform maintain files

Add px30, rv1126 soc, and rockchip soc based boards.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
16 months agoMAINTAINERS: add DT/bindings files to at91 entry
Eugen Hristev [Mon, 7 Aug 2023 07:22:03 +0000 (10:22 +0300)]
MAINTAINERS: add DT/bindings files to at91 entry

With this change the DT and binding files are under the at91 tree
maintainer, and get_maintainer.pl correctly reports the entry.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
16 months agoboard: ten64: add missing error checks for retimer power on
Mathew McBride [Mon, 7 Aug 2023 01:41:08 +0000 (01:41 +0000)]
board: ten64: add missing error checks for retimer power on

The retimer reset/power on logic was changed in a recent commit,
however, it neglected to check if the commands sent to the
board microcontroller (to control power to the retimer chip)
actually completed.

Add return checks for these operations so any failures will
be reported to the user.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Fixes: 7a041fea2 ("board: traverse: ten64: ensure retimer reset
is done on new board revisions")

16 months agoARM: renesas: Update MAINTAINERS file
Marek Vasut [Sun, 6 Aug 2023 18:57:34 +0000 (20:57 +0200)]
ARM: renesas: Update MAINTAINERS file

Update MAINTAINERS file. Add missing MAINTAINERS file for Spider,
Whitehawk and V3HSK boards. Update mail addresses. Add file globs
to match on DT and driver files related to these boards.

The GRPEACH and R2DPLUS are special in that they are not R-Car
and have their own set of specialized drivers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agoget_maintainer.pl: Add an ignore list for git history
Tom Rini [Mon, 7 Aug 2023 13:20:53 +0000 (09:20 -0400)]
get_maintainer.pl: Add an ignore list for git history

As Pali Rohár has asked to not be copied on changes to files he is not
a specific maintainer of, add his address to .get_maintainer.ignore.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
16 months agoAzure: Squash a number of jobs and re-order slightly
Tom Rini [Fri, 4 Aug 2023 21:07:44 +0000 (17:07 -0400)]
Azure: Squash a number of jobs and re-order slightly

To reduce overall job time, move a number of smaller jobs together.
These should still be safely under 1 hour total time, but reducing the
overall number of jobs should help with the queue slightly.

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoAzure: Rework Rockchip jobs again
Tom Rini [Fri, 4 Aug 2023 20:46:15 +0000 (16:46 -0400)]
Azure: Rework Rockchip jobs again

The job for rockchip vendor platforms has again gotten close to or
exceeded one hour.  Rework things such that we move the 32bit platforms
back to the general 32bit ARM job (as there's time there) and make these
build only the 64bit platforms.

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMerge tag 'dm-pull-5aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Sun, 6 Aug 2023 02:11:04 +0000 (22:11 -0400)]
Merge tag 'dm-pull-5aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm

binman support for Xilinx signing
buildman minor fixes

16 months agobuildman: Drop warning about orphaned defconfigs
Simon Glass [Thu, 3 Aug 2023 18:51:37 +0000 (12:51 -0600)]
buildman: Drop warning about orphaned defconfigs

Some boards use a MAINTAINERS entry to specify common files without
referencing any defconfigs. This is allowed and should not result in a
warning.

Drop the warning in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobuildman: Exit after reading toolchain
Simon Glass [Thu, 3 Aug 2023 18:51:36 +0000 (12:51 -0600)]
buildman: Exit after reading toolchain

Recent refactoring changed buildman to continue operation after fetching
a toolchain. Fix this.

Fixes: b8680646521 ("bulidman: Move toolchain handling to a function")
Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoevent: Fix a wrong type_name from dm_post_init to dm_post_init_f
Jaehoon Chung [Tue, 1 Aug 2023 10:17:00 +0000 (19:17 +0900)]
event: Fix a wrong type_name from dm_post_init to dm_post_init_f

DM_POST_INIT was changed to DM_POST_INIT_F.
To debug correct message, change type_name from dm_post_init to
dm_post_init_f.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
s/an/a/ :
Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: ftest: Add test for xilinx-bootgen etype
Lukas Funke [Thu, 3 Aug 2023 15:22:14 +0000 (17:22 +0200)]
binman: ftest: Add test for xilinx-bootgen etype

Add test for the 'xilinx-bootgen' etype

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Allow missing bootgen tool; comment testXilinxBootgenMissing() comment:
Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: etype: Add xilinx-bootgen etype
Lukas Funke [Thu, 3 Aug 2023 15:22:15 +0000 (17:22 +0200)]
binman: etype: Add xilinx-bootgen etype

This adds a new etype 'xilinx-bootgen'. By using this etype it is
possible to created an signed SPL (FSBL in Xilinx terms) for
ZynqMP boards.

The etype uses Xilinx Bootgen tools in order to transform the SPL into
a bootable image and sign the image with a given primary and secondary
public key. For more information to signing the FSBL please refer to the
Xilinx Bootgen documentation.

Here is an example of the etype in use:

    spl {
        filename = "boot.signed.bin";

        xilinx-bootgen {
            pmufw-filename = "pmu-firmware.elf";
            psk-key-name-hint = "psk0";
            ssk-key-name-hint = "ssk0";
            auth-params = "ppk_select=0", "spk_id=0x00000000";

            u-boot-spl-nodtb {
            };
            u-boot-spl-dtb {
            };
        };
    };

For this to work the hash of the primary public key has to be fused
into the ZynqMP device and authentication (RSA_EN) has to be set.

For testing purposes: if ppk hash check should be skipped one can add
the property 'fsbl_config = "bh_auth_enable";' to the etype. However,
this should only be used for testing(!).

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agobinman: btool: Add Xilinx Bootgen btool
Lukas Funke [Thu, 3 Aug 2023 15:22:13 +0000 (17:22 +0200)]
binman: btool: Add Xilinx Bootgen btool

Add the Xilinx Bootgen as bintool. Xilinx Bootgen is used to create
bootable SPL (FSBL in Xilinx terms) images for Zynq/ZynqMP devices. The
btool creates a signed version of the SPL. Additionally to signing the
key source for the decryption engine can be passend to the boot image.

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
16 months agobinman: Renumber 291 and 292 test files
Simon Glass [Thu, 3 Aug 2023 23:23:58 +0000 (17:23 -0600)]
binman: Renumber 291 and 292 test files

These have ended up with the same numbers as earlier files. Fix them.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Sat, 5 Aug 2023 16:24:33 +0000 (12:24 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- Fix some issues with usb gadget ethernet.  A small set of updates for
  docs, etc, is still pending

16 months agocmd: Enable BIND by default if we have USB_ETHER
Tom Rini [Fri, 4 Aug 2023 16:06:21 +0000 (12:06 -0400)]
cmd: Enable BIND by default if we have USB_ETHER

The nature of the network stack means that if we are going to use the
gadget mode USB network driver there's no easy path to implicitly
bind/unbind the driver. Enable the "bind" command by default here so
that we can bind/unbind this as needed.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
16 months agousb: gadget: ether: Handle gadget driver registration in probe and remove
Marek Vasut [Fri, 4 Aug 2023 15:41:11 +0000 (17:41 +0200)]
usb: gadget: ether: Handle gadget driver registration in probe and remove

Move the ethernet gadget driver registration and removal from ethernet
bind and unbind callbacks into driver DM probe and remove callbacks.
This way, when the driver is bound, which is triggered deliberately
using 'bind' command, the USB ethernet gadget driver is instantiated
and bound to the matching UDC. In reverse, when the driver is unbound,
which is again triggered deliberately using 'unbind' command, the USB
ethernet gadget driver instance is removed.

Effectively, this now behaves like running either 'ums' or 'dfu' or
any other commands utilizing USB gadget functionality.

This also drops use of usb_gadget_release() and moves the use of
usb_gadget_initialize() into usb_ether_init() used only by legacy
platforms that do not use 'bind' command properly yet. Those have
no place in drivers.

Signed-off-by: Marek Vasut <marex@denx.de>
Tested-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agousb: gadget: ether: Move probe function above driver structure
Marek Vasut [Fri, 4 Aug 2023 15:41:10 +0000 (17:41 +0200)]
usb: gadget: ether: Move probe function above driver structure

Move the driver probe function above the driver structure, so it
can be placed alongside other related functions, like upcoming
remove function. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Tested-by: Tom Rini <trini@konsulko.com>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agousb: gadget: ether: Inline functions used once
Marek Vasut [Fri, 4 Aug 2023 15:41:09 +0000 (17:41 +0200)]
usb: gadget: ether: Inline functions used once

These functions here are only ever called once since drop of non-DM
networking code. Inline them. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Tested-by: Tom Rini <trini@konsulko.com>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agoMerge branch '2023-08-04-toradex-platform-updates'
Tom Rini [Fri, 4 Aug 2023 20:04:11 +0000 (16:04 -0400)]
Merge branch '2023-08-04-toradex-platform-updates'

Two Toradex platform series.  First, to quote Andrejs:

This series adds Yavia Carrier board name string to the known
Toradex carrier board list, and reworks carrier board and display
adapter name handling.

And then to quote Marcel:
This series adds initial support for the Toradex Verdin AM62 SoM.
The first commit adds resp. PID4s to the ConfigBlock, the second one
fixes an early clocking issue confirmed to be a weird bug in TI's
scripting, the third one fixes some binman labeling issue. And last but
not least support for the Toradex Verdin AM62 is added.

16 months agoboard: toradex: add verdin am62 support
Marcel Ziswiler [Fri, 4 Aug 2023 10:08:08 +0000 (12:08 +0200)]
board: toradex: add verdin am62 support

This adds initial support for the Toradex Verdin AM62 Quad 1GB WB IT
V1.0A module and subsequent V1.1 launch configuration SKUs. They are
strapped to boot from their on-module eMMC. U-Boot supports booting
from the on-module eMMC only, DFU support is disabled for now due to
missing AM62x USB support.

The device trees were taken straight from Linux v6.5-rc1.

Boot sequence is:
SYSFW ---> R5 SPL (both in tiboot3.bin) ---> ATF (TF-A) ---> OP-TEE
  ---> A53 SPL (part of tispl.bin) ---> U-boot proper (u-boot.img)

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
16 months agoarm: dts: k3-binman: fix rcfg_yaml and pcfg_yaml labels
Marcel Ziswiler [Fri, 4 Aug 2023 10:08:07 +0000 (12:08 +0200)]
arm: dts: k3-binman: fix rcfg_yaml and pcfg_yaml labels

Fix rcfg_yaml to really point to rm-cfg.yaml and pcfg_yaml to really
point to pm-cfg.yaml which likely is the intention.

While at it also add labels for the remaining items like custmpk_pem,
dkey_pem, bcfg_yaml_sysfw, scfg_yaml_sysfw, pcfg_yaml_sysfw and
rcfg_yaml_sysfw.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
16 months agoarm: mach-k3: am62: fix 2nd mux option of clkout0
Marcel Ziswiler [Fri, 4 Aug 2023 10:08:06 +0000 (12:08 +0200)]
arm: mach-k3: am62: fix 2nd mux option of clkout0

Fix second mux option of clkout0 which should really be
DEV_BOARD0_CLKOUT0_IN_PARENT_HSDIV4_16FFT_MAIN_2_HSDIVOUT1_CLK10
rather than twice the same according to [1].

[1] https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am62x/clocks.html#clocks-for-board0-device

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
16 months agotoradex: tdx-cfg-block: add verdin am62 skus
Marcel Ziswiler [Fri, 4 Aug 2023 10:08:05 +0000 (12:08 +0200)]
toradex: tdx-cfg-block: add verdin am62 skus

Add initial Verdin AM62 Quad 1GB WB IT prototype and launch
configuration SKUs to ConfigBlock handling.

0069: Verdin AM62 Quad 1GB WB IT
0071: Verdin AM62 Solo 512MB
0072: Verdin AM62 Solo 512MB WB IT
0073: Verdin AM62 Dual 1GB ET
0074: Verdin AM62 Dual 1GB IT
0075: Verdin AM62 Dual 1GB WB IT
0076: Verdin AM62 Quad 2GB WB IT

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
16 months agotoradex: tdx-cfg-block: rework display adapter name handling
Max Krummenacher [Tue, 18 Jul 2023 09:07:34 +0000 (11:07 +0200)]
toradex: tdx-cfg-block: rework display adapter name handling

Rework the rather big array of zero length strings with 4 entries of
actual display adapter names to a array of structs which ties a pid4
to its correspondent human readable string.
Provide an accessor to get the string for a given PID4.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
16 months agotoradex: tdx-cfg-block: rework carrier board name handling
Max Krummenacher [Tue, 18 Jul 2023 09:07:33 +0000 (11:07 +0200)]
toradex: tdx-cfg-block: rework carrier board name handling

Rework the rather big array of zero length strings with 4 entries of
actual carrier board names to a array of structs which ties a pid4
to its correspondent human readable string.
Provide an accessor to get the string for a given PID4.
Rework the user of the information to use the accessor.

Note that check_pid8_sanity() is used for early samples of Dahlia and
the development board. Yavia isn't affected.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
16 months agotoradex: tdx-cfg-block: add yavia carrier cfg block info
Max Krummenacher [Tue, 18 Jul 2023 09:07:32 +0000 (11:07 +0200)]
toradex: tdx-cfg-block: add yavia carrier cfg block info

Add the Yavia Carrier board name string to the known carrier
board list.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
16 months agoMerge branch '2023-08-03-assorted-fixes'
Tom Rini [Thu, 3 Aug 2023 21:45:38 +0000 (17:45 -0400)]
Merge branch '2023-08-03-assorted-fixes'

- More MAINTAINERS file updates, bootstd fixes, a fat fix and debug
  message fix

16 months agobootstd: Init the size before reading extlinux file
Simon Glass [Thu, 27 Jul 2023 03:01:25 +0000 (21:01 -0600)]
bootstd: Init the size before reading extlinux file

The implementation in extlinux_pxe_getfile() does not pass a valid size
to bootmeth_read_file(), so this can fail if the uninited value happens to
be too small.

Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Init the size before reading the devicetree
Simon Glass [Thu, 27 Jul 2023 03:01:24 +0000 (21:01 -0600)]
bootstd: Init the size before reading the devicetree

The implementation in distro_efi_try_bootflow_files() does not pass a
valid size to bootmeth_common_read_file(), so this can fail if the
uninted value happens to be too small.

Fix this.

This was reported by someone but I cannot now find the email.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Avoid allocating memory for the EFI file
Simon Glass [Thu, 27 Jul 2023 03:01:23 +0000 (21:01 -0600)]
bootstd: Avoid allocating memory for the EFI file

The current bootflow-iteration algorithm reads the bootflow file into
an allocated memory buffer so it can be examined. This works well in
most cases.

However, while the common case is that the first bootflow is immediately
booted, it is also possible just to scan for available bootflows, perhaps
selecting one to boot later.

Even with the common case, EFI bootflows can be quite large. It doesn't
make sense to read it into an allocated buffer when we have kernel_addr_t
providing a suitable address for it. Even if we do have plenty of malloc()
space available, it is a violation of U-Boot's lazy-init principle to
read the bootflow before it is needed.

So overall it seems better to make a change.

Adjust the logic to read just the size of the EFI file at first. Later,
when the bootflow is booted, read the rest of the file into the designated
kernel buffer.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Da Xue <da@libre.computer>
Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
16 months agobootstd: Use a function to detect network in EFI bootmeth
Simon Glass [Thu, 27 Jul 2023 03:01:22 +0000 (21:01 -0600)]
bootstd: Use a function to detect network in EFI bootmeth

This checks for a network-based bootflow in two places, one of which is
less than ideal. Move the correct test into a function and use it in both
places.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootflow: Export setup_fs()
Simon Glass [Thu, 27 Jul 2023 03:01:21 +0000 (21:01 -0600)]
bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agovirtio: provide driver name in debug message
Heinrich Schuchardt [Wed, 26 Jul 2023 15:43:40 +0000 (17:43 +0200)]
virtio: provide driver name in debug message

If a driver cannot be bound, provide the driver name in the debug
message. Now the debug message may look like this:

    (virtio-pci.l#0): virtio-rng driver not configured

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agofat: correct sign for deletion mark
Heinrich Schuchardt [Wed, 26 Jul 2023 08:33:13 +0000 (10:33 +0200)]
fat: correct sign for deletion mark

The FAT file systems uses character '\xe5' to mark a deleted directory
entry. If a file name starts with this character, it is substituted by
'\x05' in the directory entry.

While (signed char)'\xe5' is a negative number 0xe5 is a positive integer
number. We therefore have define a constant DELETED_MARK which matches the
signedness of the characters in the directory entry.

Correct a comparison where we used the constant 0xe5 with the wrong sign.
Use the constant aRING instead of 0x05 like in the rest of the code.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 57b745e2387a ("fs: fat: call set_name() only once")
Fixes: 28cef9ca2e86 ("fs: fat: create correct short names")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agorzn1-snarc: Add missing MAINTAINERS file
Tom Rini [Tue, 25 Jul 2023 22:31:55 +0000 (18:31 -0400)]
rzn1-snarc: Add missing MAINTAINERS file

This should have been included when the platform was added, make one
now.

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoboard/freescale: Drop two orphaned entries
Tom Rini [Tue, 25 Jul 2023 22:31:54 +0000 (18:31 -0400)]
board/freescale: Drop two orphaned entries

As the defconfig files here have been removed we can also remove the
entries.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agovexpress64: Rework MAINTAINERS file slightly
Tom Rini [Tue, 25 Jul 2023 22:31:53 +0000 (18:31 -0400)]
vexpress64: Rework MAINTAINERS file slightly

Given that we no longer have a configs/vexpress_aemv8a_defconfig file,
drop that and then include at least the aarch64-specific config.h file
here.  Also move Linus and Peter up to the main entry as well so that
they'll get tagged for the board code too and not literally only the
defconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoARM: imx: Update MAINTAINERS file on DH electronics i.MX8M Plus DHCOM
Marek Vasut [Tue, 18 Jul 2023 16:14:35 +0000 (18:14 +0200)]
ARM: imx: Update MAINTAINERS file on DH electronics i.MX8M Plus DHCOM

Make use of globs to cover all the DTs and defconfigs.
Fill in missing DH u-boot list name.

Signed-off-by: Marek Vasut <marex@denx.de>
16 months agofreescale: Remove Rajesh Bhagat MAINTAINERS
Sean Anderson [Tue, 18 Oct 2022 18:12:46 +0000 (14:12 -0400)]
freescale: Remove Rajesh Bhagat MAINTAINERS

Rajesh's email bounces. Remove his email from all boards he maintains.
Fortunately, he has co-maintainers on most boards. I have taken the
liberty of volunteering Pramod to maintain the LS1012AFRDM, since he
also maintains the LS1012AFRWY. Let me know if the board should be
orphaned instead.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
16 months agoMerge tag 'efi-2023-10-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Thu, 3 Aug 2023 16:43:24 +0000 (12:43 -0400)]
Merge tag 'efi-2023-10-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-10-rc2-2

Documentation:

* Move README.falcon to HTML
* Describe usage of QEMU virtio block device
* Add SPDX license identifiers to svg images
* Add more detail to the description of U-Boot boot phases

UEFI:

* Fix buffer overflows
* Fix memory leak in efi_add_memory_map_pg
* Properly check return values of calloc, uuid_str_to_bin,
  efi_parse_pkcs7_header

16 months agoMerge branch '2023-08-03-mediatek-and-ten64-updates'
Tom Rini [Thu, 3 Aug 2023 14:34:04 +0000 (10:34 -0400)]
Merge branch '2023-08-03-mediatek-and-ten64-updates'

Merge in a series for MediaTek update and another for Ten64.

To quote Weijie Gao for MediaTek:
This patch series add support for MediaTek MT7988 SoC with its reference
boards and related drivers.

This patch series add basic boot support on eMMC/SD/SPI-NOR/SPI-NAND for
these boards. The clock, pinctrl drivers and the SoC initializaton code
are also included.

Product spec for MT7988:
https://www.mediatek.com/products/broadband-wifi/mediatek-filogic-880

And to quote Mathew McBride for Ten64:
This is a series of updates for the Ten64 board,
that are part of our firmware releases but not yet upstreamed
into U-Boot.

Changes of note include:

- Turning on standard boot support

  Standard boot improves the user experience over distroboot on Ten64,
  as we had various hacks in our firmware to solve some corner-case
  issues (e.g DTB handling) in distroboot, which are not needed with the
  bootflow system.

- Recognition of the new 'RevD' board variant distributed to OEM
  customers

- Fixing various boot issues related to FIT images and operating systems
  running out of the NAND (OpenWrt, recovery environment).

- A better 'opt-out' solution for fsl_setenv_bootcmd for Layerscape
  platforms booting from TF-A.

  This was discussed when the Ten64 was upstreamed into U-Boot. I think
  declaring fsl_setenv_bootcmd as __weak and allowing individual boards
  to override is the best way to do this without significant rework.
  (We actually depend on a similar feature for the DPAA2/MC firmware
  loading)

Compared to our firmware branch, there is still a few features missing (e.g USB
Hub, fan controller and fixes for the VSC8514). Some of these depend on other
things (like sorting out device tree schemas) so may not appear in mainline
U-Boot for a while yet.