]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
14 months agoARM: dts: at91: sam9x60: Define pinctrl node with its label
Balamanikandan Gunasundar [Mon, 10 Feb 2025 06:51:38 +0000 (12:21 +0530)] 
ARM: dts: at91: sam9x60: Define pinctrl node with its label

Define the pinctrl nodes with its label to align with the Linux DT.
Without this change the pinmux nodes are grouped under an additional
'pinctrl' child node which is not identified by the pinctrl driver
when the GPIO banks are made as child nodes of pinctrl node.

Signed-off-by: Balamanikandan Gunasundar <balamanikandan.gunasundar@microchip.com>
Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>
14 months agoARM: dts: at91: sam9x60: Add AIC node
Manikandan Muralidharan [Mon, 10 Feb 2025 06:51:37 +0000 (12:21 +0530)] 
ARM: dts: at91: sam9x60: Add AIC node

Add Advanced Interrupt Controller node and define it as interrupt
parent in sam9x60 SoC DT.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>
14 months agospi: atmel-quadspi: Improve probe debugging
Alexander Dahl [Thu, 23 Jan 2025 12:12:15 +0000 (13:12 +0100)] 
spi: atmel-quadspi: Improve probe debugging

Report spi clk speed and make use of `log_ret()`.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
14 months agospi: atmel-quadspi: Add support for classic SPI mode
Alexander Dahl [Thu, 23 Jan 2025 12:12:14 +0000 (13:12 +0100)] 
spi: atmel-quadspi: Add support for classic SPI mode

The qspi controller on sama5d2 and sam9x60 supports "classic" SPI mode
without spi-mem enhancements and accelerations, very similar to the old
SPI controller on sam9g20 or the modern flexcom controllers of the same
SoC family.

Register interface differs somewhat, especially because only one
hardware controlled CS line is supported.  Some fields are missing, some
are in different registers, but in principal it works similar.  So code
is very much inspired by the old atmel-spi driver.

Tested on sam9x60 with a non-mainline driver to configure an FPGA.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
14 months agospi: atmel-quadspi: Allow setting SMM to classic SPI mode
Alexander Dahl [Thu, 23 Jan 2025 12:12:13 +0000 (13:12 +0100)] 
spi: atmel-quadspi: Allow setting SMM to classic SPI mode

Switching between Serial Memory Mode (SMM) and (classic) SPI mode is a
preparation for implementing .xfer() in the future.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
14 months agospi: atmel-quadspi: Remove default mode setting at probe time
Alexander Dahl [Thu, 23 Jan 2025 12:12:12 +0000 (13:12 +0100)] 
spi: atmel-quadspi: Remove default mode setting at probe time

The Serial Memory Mode (SMM) is enabled with atmel_qspi_set_cfg() on
each invocation of atmel_qspi_exec_op().  Setting SMM through
atmel_qspi_init() at probe time is redundant.

Removing the SMM setting at probe time should therefore 1) be safe to do
and 2) allows for setting it to a different value in a future
implementation of .xfer() which needs to disable SMM.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
14 months agospi: atmel-quadspi: Avoid overwriting MR register settings
Alexander Dahl [Thu, 23 Jan 2025 12:12:11 +0000 (13:12 +0100)] 
spi: atmel-quadspi: Avoid overwriting MR register settings

Port these commits:

v6.11-rc5-90-g329ca3eed4a9a ("spi: atmel-quadspi: Avoid overwriting delay register settings")
v6.12-rc1-1-g162d9b5d2308c ("spi: atmel-quadspi: Fix wrong register value written to MR").
v6.13-rc2-27-gf663898d047a7 ("spi: atmel-quadspi: Factor out switching to Serial Memory Mode to function")

Cc: Csókás Bence <csokas.bence@prolan.hu>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
14 months agospi: atmel-quadspi: Port collected fixes from Linux v5.10 and v5.15
Alexander Dahl [Thu, 23 Jan 2025 12:12:10 +0000 (13:12 +0100)] 
spi: atmel-quadspi: Port collected fixes from Linux v5.10 and v5.15

Port changes from a 4 piece patch series from Linux kernel v5.10, merged
with v5.10-rc1-83-gc732b7567d869 ("Merge series "spi: atmel-quadspi: Fix
AHB memory accesses" from Tudor Ambarus …").

Port the single fix v5.15-rc1-14-g09134c5322df9 ("spi: Fixed division by
zero warning").

Reduces differences between linux and u-boot driver.

Cc: Tudor Ambarus <tudor.ambarus@microchip.com>
Cc: Yoshitaka Ikeda <ikeda@nskint.co.jp>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
14 months agospi: atmel-quadspi: Depend on SPI_MEM
Alexander Dahl [Thu, 23 Jan 2025 07:37:13 +0000 (08:37 +0100)] 
spi: atmel-quadspi: Depend on SPI_MEM

Most other spi-mem drivers also depend on SPI_MEM.  Fixes this build
error:

    arm-v5te-linux-gnueabi-ld.bfd: drivers/spi/atmel-quadspi.o: in function `atmel_qspi_supports_op':
    /mnt/data/adahl/src/u-boot/drivers/spi/atmel-quadspi.c:460: undefined reference to `spi_mem_default_supports_op'
    make[1]: *** [/mnt/data/adahl/src/u-boot/Makefile:1821: u-boot] Error 1

Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
14 months agospi: ca_sflash: Remove redundant dependency
Alexander Dahl [Thu, 23 Jan 2025 07:37:12 +0000 (08:37 +0100)] 
spi: ca_sflash: Remove redundant dependency

This is inside of an 'if DM_SPI' block, and thus always true.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
14 months agotest: Update documentation
Simon Glass [Fri, 7 Feb 2025 18:31:00 +0000 (11:31 -0700)] 
test: Update documentation

Update documentation for how to write tests and the 'ut' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Do flag-processing in the correct place
Simon Glass [Fri, 7 Feb 2025 18:30:59 +0000 (11:30 -0700)] 
test: Do flag-processing in the correct place

At present the 'ut' command handles its flags in a strange way, in that
they must come after the subcommand.

So, we must use 'ut bloblist -r2' to run the bloblist tests twice. This
is an artefact of the way tests were run, through subcommands.

It is now possible to correct this, by doing flag-processing before
running the suite.

Update the code to handle this, so that 'ut -r2 bloblist' works. Update
the 'test_suite' test to check the new arguments.

Add a sanity-check for -I while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Move code out of cmd_ut_category()
Simon Glass [Fri, 7 Feb 2025 18:30:58 +0000 (11:30 -0700)] 
test: Move code out of cmd_ut_category()

Move the logic from this function into run_suite(), on the way to having
flag parsing in the top-level 'ut' command instead of its children.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Allow running a selection of suites
Simon Glass [Fri, 7 Feb 2025 18:30:57 +0000 (11:30 -0700)] 
test: Allow running a selection of suites

Enhance the ut command to accept a comma-separated list of test suites
to run. Report the summary information for these at the end.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Drop suites.h
Simon Glass [Fri, 7 Feb 2025 18:30:56 +0000 (11:30 -0700)] 
test: Drop suites.h

This file is empty now. Remove it and its uses.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Make cmd_ut_category() static
Simon Glass [Fri, 7 Feb 2025 18:30:55 +0000 (11:30 -0700)] 
test: Make cmd_ut_category() static

This function is not used outside the cmd_ut file anymore, so make it
static.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Drop support for test commands
Simon Glass [Fri, 7 Feb 2025 18:30:54 +0000 (11:30 -0700)] 
test: Drop support for test commands

Now that everything is using the new test-suite features, drop support
for running commands.

Fix a missing closing-bracket while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Rename optee test-file
Simon Glass [Fri, 7 Feb 2025 18:30:53 +0000 (11:30 -0700)] 
test: Rename optee test-file

This has nothing to do with commands anymore, so rename the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Drop the function for running optee tests
Simon Glass [Fri, 7 Feb 2025 18:30:52 +0000 (11:30 -0700)] 
test: Drop the function for running optee tests

Use the new suite-runner to run these tests instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Split optee tests into three functions
Simon Glass [Fri, 7 Feb 2025 18:30:51 +0000 (11:30 -0700)] 
test: Split optee tests into three functions

These tests run three different checks on the nodes, but the logic is
currently all in one tests.

Split the code out into three different tests, which do different setup
and then run the same checks.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Update optee to do init and uninit from tests
Simon Glass [Fri, 7 Feb 2025 18:30:50 +0000 (11:30 -0700)] 
test: Update optee to do init and uninit from tests

Rather than having an init function and then running the tests, create a
test-init function to do it. This will allow us to get rid of the
command function.

Fix the comment abotu 'environment' while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Drop the function for running bootstd tests
Simon Glass [Fri, 7 Feb 2025 18:30:49 +0000 (11:30 -0700)] 
test: Drop the function for running bootstd tests

Use the new suite-runner to run these tests instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Update bootstd to do init from tests
Simon Glass [Fri, 7 Feb 2025 18:30:48 +0000 (11:30 -0700)] 
test: Update bootstd to do init from tests

Rather than having an init function and then running the tests, create a
test-init function to do it. This will allow us to get rid of the
command function.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Drop the function for running fdt_overlay tests
Simon Glass [Fri, 7 Feb 2025 18:30:47 +0000 (11:30 -0700)] 
test: Drop the function for running fdt_overlay tests

Use the new suite-runner to run these tests instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Update fdt_overlay to do init from tests
Simon Glass [Fri, 7 Feb 2025 18:30:46 +0000 (11:30 -0700)] 
test: Update fdt_overlay to do init from tests

Rather than having an init function and then running the tests, create a
test-init function to do it. This will allow us to get rid of the
command function.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Update fdt_overlay test to use fdtdec functions
Simon Glass [Fri, 7 Feb 2025 18:30:45 +0000 (11:30 -0700)] 
test: Update fdt_overlay test to use fdtdec functions

Use the helpers provided for this purpose, rather than different ones in
this particular test.

Leave fdt_getprop_str() alone as it seems to have more value.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Move fdt_overlay init into a function
Simon Glass [Fri, 7 Feb 2025 18:30:44 +0000 (11:30 -0700)] 
test: Move fdt_overlay init into a function

Move the init code into a separate function since it is quite large.
Adjust it to use unit-test functions which have become available since
the test was written.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Make all tests depend on UNIT_TEST
Simon Glass [Fri, 7 Feb 2025 18:30:43 +0000 (11:30 -0700)] 
test: Make all tests depend on UNIT_TEST

Rather than having this condition defined separately for each suite,
bracket all options with 'if UNIT_TEST'.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Move fdt-overlay-test rule into test/
Simon Glass [Fri, 7 Feb 2025 18:30:42 +0000 (11:30 -0700)] 
test: Move fdt-overlay-test rule into test/

The Makefile rules for tests should be within test/Makefile so move the
'fdt-overlay' rule over.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Move optee-test rule into test/
Simon Glass [Fri, 7 Feb 2025 18:30:41 +0000 (11:30 -0700)] 
test: Move optee-test rule into test/

The Makefile rules for tests should be within test/Makefile so move the
'optee' rule over.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Move env-test rule into test/
Simon Glass [Fri, 7 Feb 2025 18:30:40 +0000 (11:30 -0700)] 
test: Move env-test rule into test/

The Makefile rules for tests should be within test/Makefile so move the
'env' rule over.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Tweak FDT-overlay tests
Simon Glass [Fri, 7 Feb 2025 18:30:39 +0000 (11:30 -0700)] 
test: Tweak FDT-overlay tests

Use fdt_overlay consistently in the identifiers and file/dir names.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Support an init/uninit functions for test suites
Simon Glass [Fri, 7 Feb 2025 18:30:38 +0000 (11:30 -0700)] 
test: Support an init/uninit functions for test suites

Some suites need things to be set up before they can run. Add a way to
declare an init function using the UNIT_TEST_INIT() macro. The init
function is just like any other test, but is always placed first so that
it runs before all the other test functions in the suite.

Add an uninit function as well, to clean up after the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Leave out the prefix when printing test names
Simon Glass [Fri, 7 Feb 2025 18:30:37 +0000 (11:30 -0700)] 
test: Leave out the prefix when printing test names

When tests are all in the same suite it is annoying to have to read all
the common text after each name. Skip this to help the user.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Show the average time per test
Simon Glass [Fri, 7 Feb 2025 18:30:36 +0000 (11:30 -0700)] 
test: Show the average time per test

Show the average duration of a test, so we can keep track of how it is
trending. Report the suite with the longest average test to encourage
people to improve it.

Add a function to update the stats based on the results from a single
suite and another to show the summary information.

Make this optional, since sandbox's SPL tests do not have a timer driver
and people may want to print results without times.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Keep track of suite duration
Simon Glass [Fri, 7 Feb 2025 18:30:35 +0000 (11:30 -0700)] 
test: Keep track of suite duration

Show the time taken by each test suite with 'ut all' and the total time
for all suites.

Take care to remove any sandbox time-offset from the values.

Fix the comment-format on timer_test_add_offset() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Add up the number of tests manually
Simon Glass [Fri, 7 Feb 2025 18:30:34 +0000 (11:30 -0700)] 
test: Add up the number of tests manually

All tests should belong to a suite, but if there is a suite we don't
know about (e.g. not added to cmd_ut.c) then the totals will not add up.
Add a check for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Fix a stray asterisk in ut_run_list()
Simon Glass [Fri, 7 Feb 2025 18:30:33 +0000 (11:30 -0700)] 
test: Fix a stray asterisk in ut_run_list()

Drop the unwanted asterisk in the comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agotest: Drop sandbox_set_enable_memio() from mux-cmd test
Simon Glass [Fri, 7 Feb 2025 18:30:32 +0000 (11:30 -0700)] 
test: Drop sandbox_set_enable_memio() from mux-cmd test

This test does not appear to use sandbox's memory-mapped I/O so there is
no need to enable it.

Even if there were a need, it should be disabled at the end of the test,
so as not to affect other tests.

Drop these lines from the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agoMerge patch series "Enable bloblist support on Vexpress64"
Tom Rini [Wed, 12 Feb 2025 00:09:05 +0000 (18:09 -0600)] 
Merge patch series "Enable bloblist support on Vexpress64"

Harrison Mutai <harrison.mutai@arm.com> says:

This series of patches enhances the vexpress64 platform by enabling bloblist
support. It also introduces support for CONFIG_BLOBLIST_PASSAGE. This is
necessary to boot vexpress64 and other boards without manually specifying a
fixed address and size for the bloblist.

After this change, all the bloblist init modes are supported (i.e., fixed,
alloc, passage) and Vexpress64 boots with CONFIG_BLOBLIST_PASSAGE.

Link: https://lore.kernel.org/r/20250204175844.19890-1-harrison.mutai@arm.com
14 months agoboard: vexpress64: enable bloblist for SPL handoff
Harrison Mutai [Tue, 4 Feb 2025 17:58:42 +0000 (17:58 +0000)] 
board: vexpress64: enable bloblist for SPL handoff

Enable bloblist on vexpress64 platforms to facilitate information
passing from TF-A using the firmware handoff framework.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
14 months agobloblist: add support for CONFIG_BLOBLIST_PASSAGE
Harrison Mutai [Tue, 4 Feb 2025 17:58:41 +0000 (17:58 +0000)] 
bloblist: add support for CONFIG_BLOBLIST_PASSAGE

When the configuration option CONFIG_BLOBLIST_PASSAGE is selected, the
bloblist present in the incoming standard passage is utilised in-place.
There is no need to specify the size of the bloblist as the system
automatically detects it using the header information.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
14 months agoboard: vexpress64: default to hardware device tree
Harrison Mutai [Tue, 4 Feb 2025 17:58:40 +0000 (17:58 +0000)] 
board: vexpress64: default to hardware device tree

When booting into the Linux kernel with semi-hosting, use the device
tree provided by hardware unless one is provided in the current
directory.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
14 months agobloblist: fix typo in code comments
Harrison Mutai [Tue, 4 Feb 2025 17:58:39 +0000 (17:58 +0000)] 
bloblist: fix typo in code comments

Fix the two typos in the spelling of same and set in common/Kconfig and
include/bloblist.h.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
14 months agoconfigs: Resync with savedefconfig
Tom Rini [Tue, 11 Feb 2025 15:11:21 +0000 (09:11 -0600)] 
configs: Resync with savedefconfig

Resync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
14 months agoMerge tag 'u-boot-dfu-20250211' of https://source.denx.de/u-boot/custodians/u-boot-dfu
Tom Rini [Tue, 11 Feb 2025 14:56:54 +0000 (08:56 -0600)] 
Merge tag 'u-boot-dfu-20250211' of https://source.denx.de/u-boot/custodians/u-boot-dfu

u-boot-dfu-20250211:

CI:
- https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/24556

Android:
- Handle boot images with missing DTB

Usb gadget:
- Fix nullptr in g_dnl when serial# is unset
- Add missing schedule() in f_mass_storage gadget
- Add support for STih407 in dwc3-generic
- Fix usb clocks on STih407
- Migrate STih407 to DM_USB_GADGET

14 months agocommon: Add NULL checks for xrealloc in make_string cli_hush.c
Anton Moryakov [Thu, 6 Feb 2025 22:01:23 +0000 (01:01 +0300)] 
common: Add NULL checks for xrealloc in make_string cli_hush.c

- Check return value of xrealloc for NULL.
- Free allocated memory and return NULL if xrealloc fails.
- Prevent NULL pointer dereference in strlen and strcat.

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
14 months agocommon: Add NULL checks for malloc_cache_aligned in autoboot.c
Anton Moryakov [Thu, 6 Feb 2025 21:55:21 +0000 (00:55 +0300)] 
common: Add NULL checks for malloc_cache_aligned in autoboot.c

- Check return value of malloc_cache_aligned for presskey and sha.
- Return -ENOMEM if memory allocation fails.
- Free allocated memory in error paths."

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
14 months agotools: proftool: Fix potential memory leaks
Maks Mishin [Wed, 5 Feb 2025 16:26:07 +0000 (19:26 +0300)] 
tools: proftool: Fix potential memory leaks

Dynamic memory, referenced by 'line', is allocated by calling
function 'calloc' and lost when the function terminates with code -1.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
14 months agotools: ublimage: Fix memory leak in parse_cfg_file()
Maks Mishin [Sun, 2 Feb 2025 17:05:42 +0000 (20:05 +0300)] 
tools: ublimage: Fix memory leak in parse_cfg_file()

Dynamic memory, referenced by 'line', is allocated at ublimage.c:159
by calling function 'getline' and lost at ublimage.c:184.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
14 months agotools: fix NULL_AFTER_DEREF in image-host.c
Anton Moryakov [Thu, 30 Jan 2025 13:42:43 +0000 (16:42 +0300)] 
tools: fix NULL_AFTER_DEREF in image-host.c

Report of the static analyzer:
1. NULL_AFTER_DEREF Pointer 'str', which is dereferenced at
   image-host.c:688 by calling function 'strdup', is compared to a NULL
   value at image-host.c:691.
2. NULL_AFTER_DEREF Pointer 'list', which is dereferenced at
   image-host.c:689, is compared to a NULL value at image-host.c:691.

Corrections explained:
1. Checking for NULL before using pointers: The if (!list || !str) check
   is now performed before calling strdup and realloc, which prevents
   null pointer dereferences.
2. Checking the result of strdup: strdup can return NULL if memory
   allocation fails. This also needs to be checked.
3. Checking the result of realloc: If realloc returns NULL, then memory
   has not been allocated and dup must be freed to avoid memory leaks.

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
14 months agoconfigs: stih410-b2260: Enable CMD_USB_MASS_STORAGE flag
Patrice Chotard [Thu, 30 Jan 2025 16:35:47 +0000 (17:35 +0100)] 
configs: stih410-b2260: Enable CMD_USB_MASS_STORAGE flag

Enable CMD_USB_MASS_STORAGE flag.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-10-patrice.chotard@foss.st.com
[mkorpershoek: fixed up commit footer]
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agoboard: stih410-b2260: Remove board_usb_init/cleanup()
Patrice Chotard [Thu, 30 Jan 2025 16:35:46 +0000 (17:35 +0100)] 
board: stih410-b2260: Remove board_usb_init/cleanup()

Since DM_USB_GADGET is enable for this board, board_usb_init()
and board_usb_cleanup() can be removed.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-9-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agoconfigs: stih410-b2260: Enable DM_USB_GADGET flag
Patrice Chotard [Thu, 30 Jan 2025 16:35:45 +0000 (17:35 +0100)] 
configs: stih410-b2260: Enable DM_USB_GADGET flag

Enable DM_USB_GADGET flag.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-8-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agoconfigs: stih410-b2260: Enable USB_DWC3_GENERIC and USB_DWC3_STI flags
Patrice Chotard [Thu, 30 Jan 2025 16:35:44 +0000 (17:35 +0100)] 
configs: stih410-b2260: Enable USB_DWC3_GENERIC and USB_DWC3_STI flags

Enable USB_DWC3_GENERIC and USB_DWC3_STI flags.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20250130163547.512990-7-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agousb: dwc3-generic: Add STih407 support
Patrice Chotard [Thu, 30 Jan 2025 16:35:43 +0000 (17:35 +0100)] 
usb: dwc3-generic: Add STih407 support

Add STi glue logic to manage the DWC3 HC on STiH407
SoC family. It configures the internal glue logic and
syscfg registers.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250130163547.512990-6-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agousb: dwc3-generic: Reorder include
Patrice Chotard [Thu, 30 Jan 2025 16:35:42 +0000 (17:35 +0100)] 
usb: dwc3-generic: Reorder include

Reorder include following rules available here :
https://docs.u-boot.org/en/latest/develop/codingstyle.html#include-files

Remove useless include files.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-5-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agousb: dwc3: Remove dwc3 glue driver support for STi
Patrice Chotard [Thu, 30 Jan 2025 16:35:41 +0000 (17:35 +0100)] 
usb: dwc3: Remove dwc3 glue driver support for STi

STi will migrate to dwc3-generic driver, dwc3-sti-glue driver
can be removed.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250130163547.512990-4-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agoconfigs: stih410-b2260: Enable DM_REGULATOR flag
Patrice Chotard [Thu, 30 Jan 2025 16:35:40 +0000 (17:35 +0100)] 
configs: stih410-b2260: Enable DM_REGULATOR flag

Since commit 6aa8bde8786d ("usb: host: ehci-generic: Remove DM_REGULATOR
flag") device_get_supply_regulator() returns -ENOSYS which is not handle
by ehci_enable_vbus_supply() and thus, ehci_usb_probe() return an error.

By enabling DM_REGULATOR flag, device_get_supply_regulator() return -ENOENT
which is handle and ehci_usb_probe() return 0.

This fixed the following issue:
stih410-b2260 =>usb start
starting USB...
Bus dwc3@9900000: Register 2000240 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus usb@9a03c00: USB OHCI 1.0
Bus usb@9a03e00: probe failed, error -38
Bus usb@9a83c00: USB OHCI 1.0
Bus usb@9a83e00: probe failed, error -38
scanning bus dwc3@9900000 for devices... 1 USB Device(s) found
scanning bus usb@9a03c00 for devices... data abort
pc : [<7df929b4>]          lr : [<7df92918>]
reloc pc : [<7d6409b4>]    lr : [<7d640918>]
sp : 7c73b848  ip : 9cf13c5c     fp : 7c879d08
r10: 7c85d040  r9 : 7c74ded0     r8 : 09a03c00
r7 : 00000002  r6 : 7c85d080     r5 : 7c86a040  r4 : 00000000
r3 : 00000000  r2 : 00000000     r1 : 7c85d080  r0 : 7c85d040
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
Code: 05853ae4 0affffe2 e59a2010 e59a300c (e5832010)
Resetting CPU ...

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-3-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agoARM: dts: sti: Add fixed clock for ehci and ohci nodes in stih410-b2260.dtsi
Patrice Chotard [Thu, 30 Jan 2025 16:35:39 +0000 (17:35 +0100)] 
ARM: dts: sti: Add fixed clock for ehci and ohci nodes in stih410-b2260.dtsi

On STi platforms, all clocks are enabled by BOOTROM, so CONFIG_CLK is
not set as no clock driver for STI exists.

As ehci-generic and ohci-generic drivers are used on platforms where
CONFIG_CLK is set, clk_get_bulk() returns-ENOSYS in case of
stih410-b2260.
To avoid this error, add fixed clocks for ehci and ohci nodes for
stih410-b2260 to fix the following errors:

Bus usb@9a03c00: ohci_generic usb@9a03c00: Failed to get clocks (ret=-19)
Port not available.
Bus usb@9a03e00: ehci_generic usb@9a03e00: Failed to get clocks (ret=-19)
Port not available.
Bus usb@9a83c00: ohci_generic usb@9a83c00: Failed to get clocks (ret=-19)
Port not available.
Bus usb@9a83e00: ehci_generic usb@9a83e00: Failed to get clocks (ret=-19)
Port not available.
scanning bus dwc3@9900000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-2-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agousb: gadget: f_mass_storage: Add schedule() in sleep_thread()
Patrice Chotard [Mon, 2 Dec 2024 07:46:44 +0000 (08:46 +0100)] 
usb: gadget: f_mass_storage: Add schedule() in sleep_thread()

In case "ums" command is used on platforms which don't implement
g_dnl_board_usb_cable_connected() and USB cable is not connected,
we stay inside sleep_thread() forever and watchdog is triggered.

Add schedule() call to avoid this issue.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20241202074644.5380-1-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agoarm: Remove redundant loading of image copy start offse
Liya Huang [Sun, 19 Jan 2025 01:04:58 +0000 (09:04 +0800)] 
arm: Remove redundant loading of image copy start offse

Because the beginning is already computed

Signed-off-by: Liya Huang <1425075683@qq.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agoPrepare v2025.04-rc2 v2025.04-rc2
Tom Rini [Mon, 10 Feb 2025 22:00:49 +0000 (16:00 -0600)] 
Prepare v2025.04-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
14 months agoCI: Drop extra condition for sjg lab
Simon Glass [Sun, 1 Dec 2024 14:42:29 +0000 (07:42 -0700)] 
CI: Drop extra condition for sjg lab

The rules part of the template makes sure that this doesn't run until
specifically requested. Drop the check in the script itself, so it is
possible to trigger a run manually without re-pushing the tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agoMerge patch series "Enable MCU ESM reset"
Tom Rini [Mon, 10 Feb 2025 16:32:03 +0000 (10:32 -0600)] 
Merge patch series "Enable MCU ESM reset"

Judith Mendez <jm@ti.com> says:

This patch series enables ESM reset configuration in board_init_f
for am62x and am62px devices.

This is necessary in order for error events to reset the system.

This patches are tested using watchdog to reset the system via ESM.

Link: https://lore.kernel.org/r/20250129234403.574766-1-jm@ti.com
14 months agoconfigs: am62*_evm_r5: Enable ESM and MISC configs
Santhosh Kumar K [Wed, 29 Jan 2025 23:44:03 +0000 (17:44 -0600)] 
configs: am62*_evm_r5: Enable ESM and MISC configs

Enable CONFIG_SPL_DRIVERS_MISC, CONFIG_SPL_MISC, CONFIG_ESM_K3
to probe the Main ESM and MCU ESM nodes.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Signed-off-by: Judith Mendez <jm@ti.com>
14 months agoarm: mach-k3: am62*_init: Probe ESM nodes
Santhosh Kumar K [Wed, 29 Jan 2025 23:44:02 +0000 (17:44 -0600)] 
arm: mach-k3: am62*_init: Probe ESM nodes

On AM62A and AM62P devices, it is possible to route Main ESM error
events to MCU ESM. MCU ESM high error output can trigger the reset
logic to reset the device. So, for these devices we have Main ESM and
MCU ESM nodes in the device tree. Add functions to probe these nodes
if CONFIG_ESM_K3 is enabled.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Signed-off-by: Judith Mendez <jm@ti.com>
14 months agoinclude: env: phytec: Add optargs to K3 files
Nathan Morrisson [Wed, 29 Jan 2025 10:34:44 +0000 (02:34 -0800)] 
include: env: phytec: Add optargs to K3 files

Add the optargs variable so that we can set optional arguments while
booting.

Signed-off-by: Nathan Morrisson <nmorrisson@phytec.com>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
14 months agoenv: fat: Avoid writing to read-only location
Andre Przywara [Thu, 30 Jan 2025 13:36:46 +0000 (13:36 +0000)] 
env: fat: Avoid writing to read-only location

The env_fat_get_dev_part() function mostly returns a fixed string, set
via some Kconfig variable. However when the first character is a colon,
that means that the boot device number is determined at runtime, and
patched in. This requires altering the string.

So far this was done via some ugly and actually illegal direct write to
the .rodata string storage. We got away with this because U-Boot maps
everything as read/write/execute so far.

A proposed patch set actually enforces read-only (and no-execute)
permissions in the page tables, so this routine now causes an exception:
=======================
Loading Environment from FAT... "Synchronous Abort" handler, esr 0x9600004f, far 0xfffb7d4c
elr: 000000004a054228 lr : 000000004a05421c (reloc)
elr: 00000000fff7c228 lr : 00000000fff7c21c
.....
=======================

Rewrite the routine to do away with the dodgy string manipulation,
instead allocate the string in the r/w .data section, where we can
safely manipulate it.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
14 months agoMerge patch series "FIX: Re-enable MUX_MMIO on J721E/J7200"
Tom Rini [Mon, 10 Feb 2025 16:29:36 +0000 (10:29 -0600)] 
Merge patch series "FIX: Re-enable MUX_MMIO on J721E/J7200"

Siddharth Vadapalli <s-vadapalli@ti.com> says:

Hello,

This series re-enables MUX_MMIO at U-Boot proper on J721E and J7200
SoCs. The commits which introduced support for Hyperflash boot on both
of these SoCs disabled MUX_MMIO functionality at U-Boot proper, thereby
introducing a regression.

Series is based on commit
2b1c8d3b2d cmd: Fix Kconfig coding style
of the master branch of U-Boot.

Link: https://lore.kernel.org/r/20250201091809.1894892-1-s-vadapalli@ti.com
14 months agoconfigs: j7200_evm_a72_defconfig: Re-enable MUX_MMIO at U-Boot proper
Siddharth Vadapalli [Sat, 1 Feb 2025 09:18:00 +0000 (14:48 +0530)] 
configs: j7200_evm_a72_defconfig: Re-enable MUX_MMIO at U-Boot proper

Commit under Fixes introduced support for Hyperflash boot but also disabled
MUX_MMIO support at U-Boot proper. MUX_MMIO is required at U-Boot proper
to setup the SERDES Lane Mapping as described by the device-tree. On J7200
SoC, PCIe functionality is broken since commit under fixes.

Fix this regression by re-enabling MUX_MMIO.

Fixes: 038f6faea9f0 ("configs: j7200_evm_*_defconfig: Add configs for Hyperflash boot")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Anurag Dutta <a-dutta@ti.com>
14 months agoconfigs: j721e_evm_a72_defconfig: Re-enable MUX_MMIO at U-Boot proper
Siddharth Vadapalli [Sat, 1 Feb 2025 09:17:59 +0000 (14:47 +0530)] 
configs: j721e_evm_a72_defconfig: Re-enable MUX_MMIO at U-Boot proper

Commit under Fixes introduced support for Hyperflash boot but also disabled
MUX_MMIO support at U-Boot proper. MUX_MMIO is required at U-Boot proper
to setup the SERDES Lane Mapping as described by the device-tree.

Fix this regression by re-enabling MUX_MMIO.

Fixes: fd7fcd4098d5 ("configs: j721e_evm_*_defconfig: Add configs for Hyperflash boot")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
14 months agortc: emul_rtc: Make emul_rtc_probe() static
Michal Simek [Mon, 3 Feb 2025 09:18:57 +0000 (10:18 +0100)] 
rtc: emul_rtc: Make emul_rtc_probe() static

emul_rtc_probe() is not called from anywhere else that's why make it
static. Issue is reported by build with W=1.

Signed-off-by: Michal Simek <michal.simek@amd.com>
14 months agonet: designware: support phy io micro voltage setting.
Michael Chang [Wed, 5 Feb 2025 02:01:06 +0000 (10:01 +0800)] 
net: designware: support phy io micro voltage setting.

Support phy io micro voltage setting for NPCM8XX rgmii
interface.

Signed-off-by: Michael Chang <zhang971090220@gmail.com>
14 months agomediatek: mt7981: enable ethernet switch auto-detction
Weijie Gao [Wed, 5 Feb 2025 01:24:37 +0000 (09:24 +0800)] 
mediatek: mt7981: enable ethernet switch auto-detction

This patch enables switch auto-detction for mt7981 as some new mt7981
boards will use AN8855 ethernet switch.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
14 months agoconfigs: phycore_am64x_r5_defconfig: Enable PHYTEC_SOM_DETECTION
Wadim Egorov [Wed, 5 Feb 2025 04:30:13 +0000 (05:30 +0100)] 
configs: phycore_am64x_r5_defconfig: Enable PHYTEC_SOM_DETECTION

Enable configs required for detecting and fixing up for different RAM variants.
Also resync after savedefconfig.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: Daniel Schultz <d.schultz@phytec.de>
14 months agoboard: phytec: phycore_am64x: Add support for 1 GB RAM variant and ECC
Wadim Egorov [Wed, 5 Feb 2025 04:30:12 +0000 (05:30 +0100)] 
board: phytec: phycore_am64x: Add support for 1 GB RAM variant and ECC

Detect RAM size via EEPROM and adjust DDR size and banks accordingly.
Include necessary fixups to handle ECC-enabled configurations.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: Daniel Schultz <d.schultz@phytec.de>
14 months agoarch: arm: dts: phyboard-electra-uboot.dtsi: Add bootph props to i2c
Wadim Egorov [Wed, 5 Feb 2025 04:30:11 +0000 (05:30 +0100)] 
arch: arm: dts: phyboard-electra-uboot.dtsi: Add bootph props to i2c

Add bootph-all properties to I2C0 nodes to ensure the bus and EEPROM
are accessible across all stages. This enables reading the SoM
configuration at any point during the boot process.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
14 months agotest/py: usb: Fix format string for fstype command
Andrew Goodbody [Wed, 5 Feb 2025 13:04:26 +0000 (13:04 +0000)] 
test/py: usb: Fix format string for fstype command

USB tests on ext partitions can fail with the following output

test/py/tests/test_usb.py:245: in test_usb_part
    'fstype usb %d:%d' % i, part_id
E   TypeError: not enough arguments for format string

So add brackets around the format string arguments to prevent the
error.

Fixes: a730947974e3 ("test/py: usb: Distinguish b/w ext2/ext4 partitions")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Love Kumar <love.kumar@amd.com>
14 months agotools: mkenvimage: List -V parameter in help text
Marek Vasut [Wed, 5 Feb 2025 14:34:28 +0000 (15:34 +0100)] 
tools: mkenvimage: List -V parameter in help text

The -V version parameter is missing in the optional list of parameters
in help text. Add it.

Signed-off-by: Marek Vasut <marex@denx.de>
14 months agomediatek: mt7986: rename pinctrl to pio in mt7986-u-boot.dtsi
Weijie Gao [Thu, 6 Feb 2025 00:41:28 +0000 (08:41 +0800)] 
mediatek: mt7986: rename pinctrl to pio in mt7986-u-boot.dtsi

The change from pinctrl to pio was missing in mt7986-u-boot.dtsi and will
cause build failure. Now fix it.

Fixes: f1775996ba9 (mediatek: mt7986: move gpio-controller up and rename pinctrl to pio)
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
14 months agopinctrl: mediatek: support reading register base address by name
Weijie Gao [Thu, 6 Feb 2025 02:19:06 +0000 (10:19 +0800)] 
pinctrl: mediatek: support reading register base address by name

This patch add support to read register base address by name if
provided.

Also devfdt_get_addr_* is changed to dev_read_addr_* to support DT
live tree.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
14 months agopinctrl: mediatek: mt7988: remove _base from reg-names
Weijie Gao [Thu, 6 Feb 2025 02:18:57 +0000 (10:18 +0800)] 
pinctrl: mediatek: mt7988: remove _base from reg-names

The reg-names in mt7988.dtsi have no _base suffix. Remove the suffix
will also make it match upstream linux format.

Fixes: 8c2cb748ef5 (pinctrl: mediatek: mt7988: rename reg-names to upstream linux format)
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
14 months agoAzure: Add missing "set -e" to docs job
Tom Rini [Fri, 7 Feb 2025 19:12:50 +0000 (13:12 -0600)] 
Azure: Add missing "set -e" to docs job

Without setting the shell flag to exit immediately when a command exists
with a non-zero status we can have the situation where the htmldocs
target fails with an error but the job will succeed due to infodocs
passing and being the last build target.

Signed-off-by: Tom Rini <trini@konsulko.com>
14 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-samsung
Tom Rini [Mon, 10 Feb 2025 14:45:04 +0000 (08:45 -0600)] 
Merge https://source.denx.de/u-boot/custodians/u-boot-samsung

- e850-96 platform updates

14 months agoMerge patch series "cmd/setexpr: support concatenation of direct strings"
Tom Rini [Fri, 7 Feb 2025 19:35:32 +0000 (13:35 -0600)] 
Merge patch series "cmd/setexpr: support concatenation of direct strings"

Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says:

The setexpr.s command allows to concatenate two strings.

According to the description in doc/usage/cmd/setexpr.rst the parameters
value1 and value2 can be either direct values or pointers to a
memory location holding the values.

Unfortunately `setexpr.s <value1> + <value2>` fails if any of the values
is a direct value. $? is set to false.

* Add support for direct values in setexpr.s.
* Correct the unit test for "setexpr.s fred 0".
* Add a new unit test for "setexpr.s fred '1' + '3'" giving '13'.
* Remove invalid memory leak tests

Link: https://lore.kernel.org/r/20250203151029.60265-1-heinrich.schuchardt@canonical.com
14 months agocmd/setexpr: support concatenation of direct strings
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:29 +0000 (16:10 +0100)] 
cmd/setexpr: support concatenation of direct strings

The setexpr.s command allows to concatenate two strings.

According to the description in doc/usage/cmd/setexpr.rst the parameters
value1 and value2 can be either direct values or pointers to a
memory location holding the values.

Unfortunately `setexpr.s <value1> + <value2>` fails if any of the values
is a direct value. $? is set to false.

* Add support for direct values in setexpr.s.
* Correct the unit test for "setexpr.s fred 0".
* Add a new unit test for "setexpr.s fred '1' + '3'" giving '13'.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
14 months agotest: remove available memory check in setexpr_test_str_oper()
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:28 +0000 (16:10 +0100)] 
test: remove available memory check in setexpr_test_str_oper()

env_set() frees the previous value after allocating the new value.
As the free() may merge memory chunks the available memory is not
expected to stay constant.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
14 months agotest: remove available memory check in setexpr_test_str()
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:27 +0000 (16:10 +0100)] 
test: remove available memory check in setexpr_test_str()

env_set() frees the previous value after allocating the new value.
As the free() may merge memory chunks the available memory is not
expected to stay constant.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
14 months agotest: clean up setexpr_test_str()
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:26 +0000 (16:10 +0100)] 
test: clean up setexpr_test_str()

Assign variable buf in the sub-test where it is used.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
14 months agoMerge patch series "led: add function naming option from linux"
Tom Rini [Fri, 7 Feb 2025 16:53:43 +0000 (10:53 -0600)] 
Merge patch series "led: add function naming option from linux"

Heiko Schocher <hs@denx.de> says:

In linux we have the option to create the name of a led
optionally through the following properties:

- function
- color
- function-enumerator

This series adds support for parsing this properties if there
is no label property.

Link: https://lore.kernel.org/r/20250128135246.74838-1-hs@denx.de
[trini: Document name parameter in led.h]

14 months agoled: add function naming option from linux
Heiko Schocher [Tue, 28 Jan 2025 13:52:46 +0000 (14:52 +0100)] 
led: add function naming option from linux

in linux we have the option to create the name of a led
optionally through the following properties:

- function
- color
- function-enumerator

This patch adds support for parsing this properties if there
is no label property.

The led name is created in led_post_bind() and we need some
storage place for it. Currently this patch prevents to use
malloc() instead it stores the name in new member :

        char name[LED_MAX_NAME_SIZE];

of struct led_uc_plat. While at it append led tests for the
new feature.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
14 months agodoc: remove redundant leds bindings
Heiko Schocher [Tue, 28 Jan 2025 13:52:45 +0000 (14:52 +0100)] 
doc: remove redundant leds bindings

remove file doc/device-tree-bindings/leds/common.txt
as we have this now already in
dts/upstream/include/dt-bindings/leds/common.h
which is imported from linux.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
14 months agoMerge tag 'xilinx-for-v2025.04-rc2' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 6 Feb 2025 14:09:54 +0000 (08:09 -0600)] 
Merge tag 'xilinx-for-v2025.04-rc2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

AMD/Xilinx changes for v2025.04-rc2

fpga:
- Cleanup help
- Show xilinx only options on Xilinx devices

ospi-versal:
- Fix alignment issue
- Fix cadence_qspi_flash_reset() prototype

zynqmp:
- Define usb_pgood_delay
- Fix bootseq number

versal:
- Fix mini_ospi configuration

versal2:
- Enable OPTEE

xilinx:
- Enable some flashes
- Clean up SYS_MALLOC_F_LEN Kconfig
- Some binman fixes
- DT updates
- Enable mkfwumdata compilation
- Enable meminfo command
- Switch to LWIP and enable HTTPS

14 months agoboot: android: handle boot images with missing DTB
Sam Day [Thu, 23 Jan 2025 14:35:01 +0000 (14:35 +0000)] 
boot: android: handle boot images with missing DTB

607b07554e2 removed the check on the return status of the
android_image_get_dtb_img_addr call from android_image_get_dtb_by_index,
which results in null pointer accesses shortly after when trying to
check the header of a nonexistent DTB.

Fixes: 607b07554e2 ("android: boot: move to andr_image_data structure")
Signed-off-by: Sam Day <me@samcday.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250123-android-handle-no-dtb-v1-1-1cb7373247da@samcday.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agousb: gadget: g_dnl: Fix NULLPTR dereference when serial# is unset
Michael Ferolito [Tue, 28 Jan 2025 03:09:45 +0000 (21:09 -0600)] 
usb: gadget: g_dnl: Fix NULLPTR dereference when serial# is unset

The current behaviour of this function will dereference a null pointer
if the serial# environment variable is unset. This was discovered on a
board where U-Boot did not have access to the first 256MB of ram,
resulting in a board crash.
In the event that U-Boot has full access to memory, it will still read
from address 0, which is probably not optimal.
This simple check is enough to fix it

Signed-off-by: Michael Ferolito <michaelsunn101@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20250128030945.1219589-1-michaelsunn101@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
14 months agoarm64: configs: Remove SYS_BOOTM_LEN for TI devices
Aashvij Shenai [Wed, 29 Jan 2025 10:56:09 +0000 (16:26 +0530)] 
arm64: configs: Remove SYS_BOOTM_LEN for TI devices

AM62x BOOTM_LEN is too small to contain OS images. Removing this sets the
size to a default 0x4000000 (for all arm64 devices).

It is unnecessary to specifically call the default size for the other
configs.

Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
Signed-off-by: Aashvij Shenai <a-shenai@ti.com>
14 months agoarm: Correct dependency for STATIC_MACH_TYPE
Liya Huang [Tue, 28 Jan 2025 13:31:49 +0000 (21:31 +0800)] 
arm: Correct dependency for STATIC_MACH_TYPE

Kconfig should not display the STATIC_MACH_TYPE option when
SUPPORT_PASSING_ATAGS is not selected. For example, when using most
platforms with menuconfig, it shows the STATIC_MACH_TYPE option causing
confusion.  As we know, this should not occur when SUPPORT_PASSING_ATAGS
is not selected

[trini: Reword commit message]
Signed-off-by: Liya Huang <1425075683@qq.com>
14 months agoarmv7m: kconfig adds the NVIC option and masks the GIC option when NVIC is selected
Liya Huang [Tue, 28 Jan 2025 13:22:15 +0000 (21:22 +0800)] 
armv7m: kconfig adds the NVIC option and masks the GIC option when NVIC is selected

ARMv7-M architecture uses NVIC instead of GIC.
NVIC is an interrupt controller specially designed for
ARM Cortex-M series processors.

Signed-off-by: Liya Huang <1425075683@qq.com>
14 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Wed, 5 Feb 2025 18:38:50 +0000 (12:38 -0600)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh