pandora-u-boot.git
3 months agolib: correct description of CONFIG_SYS_FDT_PAD
Heinrich Schuchardt [Sun, 2 Mar 2025 15:02:31 +0000 (16:02 +0100)]
lib: correct description of CONFIG_SYS_FDT_PAD

CONFIG_SYS_FDT_PAD defines the number of unused bytes added to a
device-tree and not the total size.

Fixes: 40ed7be4af52 ("Convert CONFIG_SYS_FDT_PAD to Kconfig")
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agoarm: use type jmp_buf instead of struct jmp_buf_data
Heinrich Schuchardt [Sun, 2 Mar 2025 14:21:21 +0000 (15:21 +0100)]
arm: use type jmp_buf instead of struct jmp_buf_data

Instead of using the implementation specific struct jmp_buf_data use the
standard compliant type jmp_buf when switching exception levels.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agoefi_loader: Clean up usage of structure jmp_buf_data
Yao Zi [Sun, 2 Mar 2025 14:21:20 +0000 (15:21 +0100)]
efi_loader: Clean up usage of structure jmp_buf_data

Structure jmp_buf_data provides the underlying format of jmp_buf, which
we actually don't care about. Clean up existing code to use the standard
jmp_buf type. This introduces no functional change.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agocommon: clean up setjmp.h
Heinrich Schuchardt [Sun, 2 Mar 2025 14:21:19 +0000 (15:21 +0100)]
common: clean up setjmp.h

Separate setjmp.h into an architecture independent part and an architecture
specific part. This simplifies moving from using struct jmp_buf_data
directly to using type jmp_buf in our code which is the C compliant way.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agoarm: include asm-generic/int-ll64.h in setjmp.h
Heinrich Schuchardt [Sun, 2 Mar 2025 14:21:18 +0000 (15:21 +0100)]
arm: include asm-generic/int-ll64.h in setjmp.h

Don't assume that u32 and u64 are already defined.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agosandbox: remove linux/types.h dependency in setjmp.h
Heinrich Schuchardt [Sun, 2 Mar 2025 14:21:17 +0000 (15:21 +0100)]
sandbox: remove linux/types.h dependency in setjmp.h

ulong is defined in linux/types.h use unsigned long instead.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agoefi_loader: efi_net: Add support for multiple efi_net_obj
Adriano Cordova [Mon, 3 Mar 2025 14:13:17 +0000 (11:13 -0300)]
efi_loader: efi_net: Add support for multiple efi_net_obj

Add support for multiple efi_net_obj structs in efi_net.c. This comes
in preparation for an EFI network driver supporting multiple network
interfaces. For now the EFI network stack still registers a single ethernet
udevice as an EFI network device even if multiple are present, namely
the one that was the current device at the moment of EFI initialization.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_net: Add dhcp cache
Adriano Cordova [Mon, 3 Mar 2025 14:13:16 +0000 (11:13 -0300)]
efi_loader: efi_net: Add dhcp cache

Add a dhcp cache to store the DHCP ACKs received by the U-Boot network
stack.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_net: Add device path cache
Adriano Cordova [Mon, 3 Mar 2025 14:13:15 +0000 (11:13 -0300)]
efi_loader: efi_net: Add device path cache

In preparation to support mutiple efi net udevices. Add a device path
cache to support device paths from multiple ethernet udevices.
The device paths can be added to the cache before EFI gets initialized and
the protocols get installed.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_device_path: Pass net udevice as argument
Adriano Cordova [Mon, 3 Mar 2025 14:13:14 +0000 (11:13 -0300)]
efi_loader: efi_device_path: Pass net udevice as argument

In preparation to support multiple EFI net objects, support
constructing device paths using an ethernet device different
than the default. Add a udevice argument to the device path
generation, and keep the callsites with eth_get_dev() to
preserve existing functionality.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_net: Add efi_net_do_start() to efi_net.c
Adriano Cordova [Mon, 3 Mar 2025 14:13:13 +0000 (11:13 -0300)]
efi_loader: efi_net: Add efi_net_do_start() to efi_net.c

This gets called each time a payload is to get executed by bootefi.
For now this only updates the PXE IP address.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_setup: Add efi_start_obj_list() to efi_setup.c
Adriano Cordova [Mon, 3 Mar 2025 14:13:12 +0000 (11:13 -0300)]
efi_loader: efi_setup: Add efi_start_obj_list() to efi_setup.c

The coomand bootefi calls efi_init_obj_list to do the efi set up
before launching an .efi payload, but efi_init_obj_list is called
only once. There are some initializations which depend on the
environment and should be done each time a payload gets launched and
not only once. A motivation for this changes is the following order
of events:

1. Launch an EFI application (e.g. bootefi hello)
2. Change the ip address
3. Launch another application which uses the pxe protocol

As the EFI pxe protocol was initialized when the handles
for efi net were created in 1., the ip was hardcoded there.

In this example, another possibility would be to make a callback for ip
address changes to go all the way up to efi_net.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: expose symbols to be used by the EFI network stack
Adriano Cordova [Mon, 3 Mar 2025 14:13:11 +0000 (11:13 -0300)]
efi_loader: expose symbols to be used by the EFI network stack

The following symbols are exposed:
- efi_reinstall_protocol_interface
This is done so that the device path protocol interface
of the network device can be changed internally by u-boot
when a new bootfile gets downloaded.
- eth_set_dev
To support multiple network udevices
- efi_close_event
This comes in preparation to support unregistering
an EFI network device from the EFI network stack when
the underlying U-boot device gets removed
- efi_[dis]connect_controller
The EFI network driver uses ConnectController to add a
NIC to the EFI network stack.
- efi_uninstall_protocol_interface
connect_controler for the efi network driver can install
protocols, which need to be uninstalled in disconnect_controller
- EFI_SIMPLE_NETWORK_PROTOCOL_GUID

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agolegacy-net: wget: fix wget_info handling after new tcp legacy stack
Adriano Cordova [Mon, 3 Mar 2025 14:13:10 +0000 (11:13 -0300)]
legacy-net: wget: fix wget_info handling after new tcp legacy stack

Check wget_info->buffer_size for overflow and do not clean the wget_info struct
on failure, let the owner of the struct handle the error. The latter is necesary
, e.g., for when a request fails because the provided buffer was too small.

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoefi_loader: efi_net: let efi_net_set_dp properly update the device path
Adriano Cordova [Mon, 27 Jan 2025 12:34:45 +0000 (09:34 -0300)]
efi_loader: efi_net: let efi_net_set_dp properly update the device path

This commit fixes an use after free introduced in Commit e55a4acb54
(" efi_loader: net: set EFI bootdevice device path to HTTP when loaded
from wget"). The logic in efi_net_set_dp is reworked so that when the
function is invoked it not only changes the value of the static variable
net_dp (this is how the function was implemented in e55a4acb54) but also
updates the protocol interface of the device path protocol in case efi
has started.

Fixes: e55a4acb54e8 ("efi_loader: net: set EFI bootdevice device path to HTTP when loaded from wget")
Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
3 months agoMerge patch series "This series adds support for file renaming to EFI_FILE_PROTOCOL...
Tom Rini [Fri, 7 Mar 2025 17:50:34 +0000 (11:50 -0600)]
Merge patch series "This series adds support for file renaming to EFI_FILE_PROTOCOL.SetInfo()."

Gabriel Dalimonte <gabriel.dalimonte@gmail.com> says:

This series adds support for file renaming to EFI_FILE_PROTOCOL.SetInfo().
One of the use cases for renaming in EFI is to facilitate boot loader
boot counting.

No existing filesystems in U-Boot currently include file renaming,
resulting in support for renaming at the filesystem level and a
concrete implementation for the FAT filesystem.

Link: https://lore.kernel.org/r/20250217182648.31294-1-gabriel.dalimonte@gmail.com
3 months agoefi_loader: support file rename in SetInfo()
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:47 +0000 (13:26 -0500)]
efi_loader: support file rename in SetInfo()

Following the UEFI specification. The specification did not seem to
delineate if file_name was explicitly a file name only, or could
include paths to move the file to a different directory. The more
generous interpretation of supporting paths was selected.

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agoefi_loader: move path out of file_handle
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:46 +0000 (13:26 -0500)]
efi_loader: move path out of file_handle

In order to support renaming via SetInfo(), path must allow for longer
values than what was originally present when file_handle was allocated.

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
3 months agofs: fat: update parent dirs metadata on dentry create/delete
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:45 +0000 (13:26 -0500)]
fs: fat: update parent dirs metadata on dentry create/delete

POSIX filesystem functions that create or remove directory entries contain
text along the lines of "[function] shall mark for update the last data
modification and last file status change timestamps of the parent
directory of each file." [1][2][3] The common theme is these timestamp
updates occur when a directory entry is added or removed. The
create_link() and delete_dentry_link() functions have been changed to
update the modification timestamp on the directory where the direntry
change occurs. This differs slightly from Linux in the case of rename(),
where Linux will not update `new_path`'s parent directory's timestamp if
it is replacing an existing file. (via `vfat_add_entry` [4])

The timestamps are not updated if the build configuration does not support
RTCs. This is an effort to minimize introducing erratic timestamps where
they would go from [current date] -> 2000-01-01 (error timestamp in the
FAT driver). I would assume an unchanged timestamp would be more valuable
than a default timestamp in these cases.

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/rename.html
[2] https://pubs.opengroup.org/onlinepubs/9799919799/functions/unlink.html
[3] https://pubs.opengroup.org/onlinepubs/9799919799/functions/open.html
[4] https://elixir.bootlin.com/linux/v6.12.6/source/fs/fat/namei_vfat.c#L682

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
3 months agofs: fat: add rename
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:44 +0000 (13:26 -0500)]
fs: fat: add rename

The implementation roughly follows the POSIX specification for
rename() [1]. The ordering of operations attempting to minimize the chance
for data loss in unexpected circumstances.

The 'mv' command was implemented as a front end for the rename operation
as that is what most users are likely familiar with in terms of behavior.

The 'FAT_RENAME' Kconfig option was added to prevent code size increase on
size-oriented builds like SPL.

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/rename.html

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
3 months agofs: add rename infrastructure
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:43 +0000 (13:26 -0500)]
fs: add rename infrastructure

The selection for *rename as the name for the rename/move operation
derives from the POSIX specification where they name the function
rename/renameat. [1] This aligns with Linux where the syscalls for
renaming/moving also use the rename/renameat naming.

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/rename.html

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agofs: fat: factor out dentry link create/delete
Gabriel Dalimonte [Mon, 17 Feb 2025 18:26:42 +0000 (13:26 -0500)]
fs: fat: factor out dentry link create/delete

The create_link() code was previously duplicated in two existing functions.
The two functions will be used in a future commit to achieve renaming.

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
3 months agoMerge patch series "tools: Minor clean-ups for the command library"
Tom Rini [Tue, 4 Mar 2025 19:31:54 +0000 (13:31 -0600)]
Merge patch series "tools: Minor clean-ups for the command library"

Simon Glass <sjg@chromium.org> says:

This series adds comments and fixes pylint warnings in the command
library. It also introduces a new, simpler way of running a single
command.

Link: https://lore.kernel.org/r/20250203162704.627469-1-sjg@chromium.org
3 months agou_boot_pylib: Add a function to run a single command
Simon Glass [Mon, 3 Feb 2025 16:26:45 +0000 (09:26 -0700)]
u_boot_pylib: Add a function to run a single command

Add a helper to avoid needing to use a list within a list for this
simple case.

Update existing users of runpipe() to use this where possible.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agou_boot_pylib: Fix pylint warnings in command
Simon Glass [Mon, 3 Feb 2025 16:26:44 +0000 (09:26 -0700)]
u_boot_pylib: Fix pylint warnings in command

This file has a lot of warnings. Before adding any more features, fix
those which are straightforward to resolve.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agou_boot_pylib: Add an exception-class for errors
Simon Glass [Mon, 3 Feb 2025 16:26:43 +0000 (09:26 -0700)]
u_boot_pylib: Add an exception-class for errors

Throwing an Exception is not very friendly since it is the top-level
class of all exceptions. Declare a new class instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agou_boot_pylib: Correct case for test_result
Simon Glass [Mon, 3 Feb 2025 16:26:42 +0000 (09:26 -0700)]
u_boot_pylib: Correct case for test_result

This should be in capitals and defined at the start of the file. Update
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agolib: ecdsa: fix prevent memory leak in ecdsa_add_verify_data
Anton Moryakov [Thu, 6 Feb 2025 21:47:59 +0000 (00:47 +0300)]
lib: ecdsa: fix prevent memory leak in ecdsa_add_verify_data

- Ensure `free_ctx` is called in both error and success paths.
- Fix memory leak in `ctx.signature` when `do_add` fails."

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
3 months agotiny-printf: emit \0 as %c
Alexander Sverdlin [Thu, 20 Feb 2025 12:49:07 +0000 (13:49 +0100)]
tiny-printf: emit \0 as %c

The current code has a problematic corner case with formar "%c" and
0 as parameter. The proper zero byte is being emitted into digit buffer
but the final copy into outstr expects null-terminated string and doesn't
copy the required \0 byte. This has lead to malformed TFTP packets, refer
to tftp_send() which relies on %c to generate multiple zero-terminated
strings in one buffer.

Introduce a variable to force the copy of one character in this case.
The new behaviour is consistent with non-tiny implementation.

Reported-by: Chintan Vankar <c-vankar@ti.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
3 months agoMerge patch series "arm: mach-k3: j722s: Enable ESM to support watchdogs"
Tom Rini [Mon, 3 Mar 2025 20:22:24 +0000 (14:22 -0600)]
Merge patch series "arm: mach-k3: j722s: Enable ESM to support watchdogs"

Keerthy <j-keerthy@ti.com> says:

The series enables watchdog support on J722S. It adds ESM initialization
to enable routing the watchdog events to trigger a SOC reset.

Link: https://lore.kernel.org/r/20250217105718.3109-1-j-keerthy@ti.com
3 months agoMerge patch series "J784S4: Enable USB DFU boot, DFU flash and UMS configs"
Tom Rini [Mon, 3 Mar 2025 20:21:14 +0000 (14:21 -0600)]
Merge patch series "J784S4: Enable USB DFU boot, DFU flash and UMS configs"

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

This series enables configs for USB DFU boot, USB DFU flash and USB Mass
Storage command for J784S4. The device-tree changes required for enabling
these features will be posted as patches to Linux device-tree mailing lists
and will eventually make it to U-Boot via DT Sync.

Link: https://lore.kernel.org/r/20250218094950.2542006-1-s-vadapalli@ti.com
3 months agoconfigs: j784s4_evm_a72_defconfig: enable USB DFU boot, DFU flash and UMS
Siddharth Vadapalli [Tue, 18 Feb 2025 09:49:45 +0000 (15:19 +0530)]
configs: j784s4_evm_a72_defconfig: enable USB DFU boot, DFU flash and UMS

Enable support for USB DFU boot via USB0 instance of USB on J784S4 SoC
which is a Cadence USB Controller. Additionally, enable support for USB
DFU flash and USB Mass Storage (UMS) command. While at it, sync with
savedefconfig.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
3 months agoconfigs: j784s4_evm_r5_defconfig: enable USB DFU boot
Siddharth Vadapalli [Tue, 18 Feb 2025 09:49:44 +0000 (15:19 +0530)]
configs: j784s4_evm_r5_defconfig: enable USB DFU boot

The USB0 instance of USB on J784S4 SoC is a Cadence USB Controller and
supports USB DFU boot. Enable support for it.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
3 months agoconfigs: j722s_evm_r5_defconfig: Enable the ESM Configs to support watchdog
Keerthy [Mon, 17 Feb 2025 10:57:18 +0000 (16:27 +0530)]
configs: j722s_evm_r5_defconfig: Enable the ESM Configs to support watchdog

Enable ESM configs. ESMs are a prerequisite to enable
watchdog reset functionality. The ESM aka error signalling module
is primarily responsible for sensing the watchdog reset event.

Signed-off-by: Keerthy <j-keerthy@ti.com>
3 months agoarm: mach-k3: j722s: Initialize MCU & MAIN Domain ESMs
Keerthy [Mon, 17 Feb 2025 10:57:17 +0000 (16:27 +0530)]
arm: mach-k3: j722s: Initialize MCU & MAIN Domain ESMs

Initialize MCU & MAIN Domain ESMs as a prerequisite to enable
watchdog reset functionality. The ESM aka error signalling module
is primarily responsible for sensing the watchdog reset event.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
3 months agoMerge patch series "rsa: Add rsa_verify_openssl() to use openssl for host builds"
Tom Rini [Fri, 28 Feb 2025 22:51:10 +0000 (16:51 -0600)]
Merge patch series "rsa: Add rsa_verify_openssl() to use openssl for host builds"

Paul HENRYS <paul.henrys_ext@softathome.com> says:

This serie of patches adds a new tool to authenticate files signed with
a preload header.  This tool is also used in the tests to actually
verify the authenticity of the file signed with such a preload header.

Link: https://lore.kernel.org/r/20250224212055.2992852-1-paul.henrys_ext@softathome.com
3 months agobinman: Authenticate the image when testing the preload signature
Paul HENRYS [Mon, 24 Feb 2025 21:20:55 +0000 (22:20 +0100)]
binman: Authenticate the image when testing the preload signature

Use preload_check_sign to authenticate the generated image when testing the
preload signature in testPreLoad().

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agoconfigs: Enable the pre-load signature in tools-only_defconfig
Paul HENRYS [Mon, 24 Feb 2025 21:20:54 +0000 (22:20 +0100)]
configs: Enable the pre-load signature in tools-only_defconfig

pre-load related config options are enabled to have support of it in host
tools.

'CONFIG_FIT_SIGNATURE=y' is being automatically removed since it is
selected by CONFIG_IMAGE_PRE_LOAD_SIG.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agotools: Add preload_check_sign to authenticate images with a pre-load
Paul HENRYS [Mon, 24 Feb 2025 21:20:53 +0000 (22:20 +0100)]
tools: Add preload_check_sign to authenticate images with a pre-load

preload_check_sign is added so that it can be used to authenticate images
signed with the pre-load signature supported by binman and U-Boot.
It could also be used to test the signature in binman tests signing
images with the pre-load.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agoboot: Add support of the pre-load signature for host tools
Paul HENRYS [Mon, 24 Feb 2025 21:20:52 +0000 (22:20 +0100)]
boot: Add support of the pre-load signature for host tools

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agoimage: Add an inline declaration of unmap_sysmem()
Paul HENRYS [Mon, 24 Feb 2025 21:20:51 +0000 (22:20 +0100)]
image: Add an inline declaration of unmap_sysmem()

Add an empty inline declaration when compiling tools for a host where
unmap_sysmem() is not defined.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agorsa: Add rsa_verify_openssl() to use openssl for host builds
Paul HENRYS [Mon, 24 Feb 2025 21:20:50 +0000 (22:20 +0100)]
rsa: Add rsa_verify_openssl() to use openssl for host builds

rsa_verify_openssl() is used in lib/rsa/rsa-verify.c to authenticate data
when building host tools.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agoMerge patch series "boards: siemens: iot2050: SM variant, sysinfo support, fixes...
Tom Rini [Fri, 28 Feb 2025 14:42:01 +0000 (08:42 -0600)]
Merge patch series "boards: siemens: iot2050: SM variant, sysinfo support, fixes & cleanups"

Baocheng Su <baocheng.su@siemens.com> says:

This introduces a sysinfo driver which also permits SMBIOS support.

The first 10 patches of v2 have already been applied. The remaining is
solely the sysinfo driver. To maintain consistency and ease of searching
through the history, the series title remains unchanged.

Link: https://lore.kernel.org/r/20250218023614.52574-1-baocheng.su@siemens.com
3 months agoboard: siemens: iot2050: Use sysinfo for board initialization
Baocheng Su [Tue, 18 Feb 2025 02:36:14 +0000 (10:36 +0800)]
board: siemens: iot2050: Use sysinfo for board initialization

Drop the info structure parsing of the board in favor of our new sysinfo
driver to avoid code duplication.

Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
Signed-off-by: Li Hua Qian <huaqian.li@siemens.com>
[Jan: rebasing, split-up, cleanup]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
3 months agosysinfo: Add driver for IOT2050 boards
Baocheng Su [Tue, 18 Feb 2025 02:36:13 +0000 (10:36 +0800)]
sysinfo: Add driver for IOT2050 boards

This brings a sysinfo driver and DT entry for the IOT2050 board series.
It translates the board information passed from SE-Boot to SPL into
values that can be retrieved via the sysinfo API. Will is already used
to fill the SMBIOS table when booting via EFI.

Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
Signed-off-by: Li Hua Qian <huaqian.li@siemens.com>
[Jan: split-off as separate patch, cleanup]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
3 months agosysinfo: Add SYSID_BOARD_RAM_SIZE_MB
Baocheng Su [Tue, 18 Feb 2025 02:36:12 +0000 (10:36 +0800)]
sysinfo: Add SYSID_BOARD_RAM_SIZE_MB

Add a new field SYSID_BOARD_RAM_SIZE_MB to sysinfo structure to store
the size of RAM in MB. dram_init can use this field to get the RAM size
via sysinfo driver.

Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
3 months agosysinfo: Add API for accessing data elements
Baocheng Su [Tue, 18 Feb 2025 02:36:11 +0000 (10:36 +0800)]
sysinfo: Add API for accessing data elements

This commit introduces a new API to the sysinfo module, allowing access
to data elements. This is particularly useful for handling data with
multiple instances, such as MAC addresses.

Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
3 months agosmbios: Fill UUID from sysinfo when available
Baocheng Su [Tue, 18 Feb 2025 02:36:10 +0000 (10:36 +0800)]
smbios: Fill UUID from sysinfo when available

Allow for the sysinfo drivers to provide a system UUID to SMBIOS. Will
be first used by the IOT2050 boards.

Signed-off-by: Li Hua Qian <huaqian.li@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
3 months agodma: ti: k3-udma: Avoid Memory leak issues during dma memcpy
Prasanth Babu Mantena [Thu, 20 Feb 2025 13:18:27 +0000 (18:48 +0530)]
dma: ti: k3-udma: Avoid Memory leak issues during dma memcpy

During dma memcpy, bcdma descriptor gets allocated for each
transaction and not freed after completion of that transaction.
So, avoid the memory allocation for every transaction.

Add one descriptor per dma device and allocate it once in
resource setup. This descriptor can now be used for all
dma memcpy transactions optimally.

Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
3 months agoserial: ns16550: Fix pointer type mismatch
J. Neuschäfer [Tue, 18 Feb 2025 13:39:45 +0000 (14:39 +0100)]
serial: ns16550: Fix pointer type mismatch

serial_out_dynamic() takes a u8* addr and uses it for 8-bit or 32-bit
accesses, depending on the value of plat->reg_width. This results in a
pointer type mismatch that the compiler may even turn into an error:

drivers/serial/ns16550.c: In function â€˜serial_out_dynamic’:
drivers/serial/ns16550.c:115:42: error: passing argument 1 of â€˜out_be32’ from incompatible pointer type [-Wincompatible-pointer-types]
  115 |                                 out_be32(addr, value);
      |                                          ^~~~
      |                                          |
      |                                          u8 * {aka unsigned char *}

This error was observed on PowerPC.

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
3 months agomtd: mtdpart: Support MTD_SIZE_REMAINING with unallocated memory area
Alexander Stein [Thu, 20 Feb 2025 14:58:07 +0000 (15:58 +0100)]
mtd: mtdpart: Support MTD_SIZE_REMAINING with unallocated memory area

If there is an unallocated memory area before the last, filling parting
the size calculation for MTD_SIZE_REMAINING does not take this hole
into account.
Fix this by calculating the remaining size just based on total size
and partition offset.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
3 months agoMerge patch series "env: mmc: Make redundant env in both eMMC boot partitions conside...
Tom Rini [Fri, 28 Feb 2025 14:35:57 +0000 (08:35 -0600)]
Merge patch series "env: mmc: Make redundant env in both eMMC boot partitions consider DT properties"

This series from Marek Vasut <marex@denx.de> clarifies and makes a bit
more configurable the case of redundant environment storage using the
eMMC boot partitions.

Link: https://lore.kernel.org/r/20250221184732.202336-1-marex@denx.de
3 months agoenv: mmc: Clean up env_mmc_load() ifdeffery
Marek Vasut [Fri, 21 Feb 2025 18:47:24 +0000 (19:47 +0100)]
env: mmc: Clean up env_mmc_load() ifdeffery

Rename the variants of env_mmc_load() for redundant and non-redundant
environment to env_mmc_load_redundant() and env_mmc_load_singular()
respectively and convert the env_mmc_load() implementation to use of
if (IS_ENABLED(...)). As a result, drop __maybe_unused from
mmc_env_is_redundant_in_both_boot_hwparts().

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
3 months agoenv: mmc: Make redundant env in both eMMC boot partitions consider DT properties
Marek Vasut [Fri, 21 Feb 2025 18:47:23 +0000 (19:47 +0100)]
env: mmc: Make redundant env in both eMMC boot partitions consider DT properties

Introduce a new function mmc_env_is_redundant_in_both_boot_hwparts()
which replaces IS_ENABLED(ENV_MMC_HWPART_REDUND) and internally does
almost the same check as the macro which assigned ENV_MMC_HWPART_REDUND
did, and call it in place of IS_ENABLED(ENV_MMC_HWPART_REDUND).

The difference compared to IS_ENABLED(ENV_MMC_HWPART_REDUND) is
in the last conditional, which does not do plain macro compare
(CONFIG_ENV_OFFSET == CONFIG_ENV_OFFSET_REDUND), but instead does
mmc_offset(mmc, 0) == mmc_offset(mmc, 1). If OF_CONTROL is not
in use, this gets optimized back to original macro compare, but
if OF_CONTROL is in use, this also takes into account the DT
properties u-boot,mmc-env-offset and u-boot,mmc-env-offset-redundant.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
3 months agoMerge tag 'u-boot-imx-next-20250227' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Thu, 27 Feb 2025 15:23:36 +0000 (09:23 -0600)]
Merge tag 'u-boot-imx-next-20250227' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/24876

- Convert imx6q-lxr and imxrt1050 to OF_UPSTREAM.
- Fix potential memory leak on ]imx/imx8/imx8m]image.
- Restrict DDR_SI_TEST to only Siemens Capricorn board.
- Fix CONFIG_BOOTCOUNT_ALTBOOTCMD on Data Modul and DH imx8m boards.

3 months agoimx6q-lxr: Convert to OF_UPSTREAM
Fabio Estevam [Thu, 27 Feb 2025 13:02:20 +0000 (10:02 -0300)]
imx6q-lxr: Convert to OF_UPSTREAM

The imx6q-lxr devicetree has landed in kernel 6.13.

Switch to OF_UPSTREAM to make use of the upstream devicetree.

Signed-off-by: Fabio Estevam <festevam@denx.de>
3 months agoARM: imx: Introduce DH i.MX6 DHSOM board specific defconfigs
Marek Vasut [Sat, 22 Feb 2025 17:13:26 +0000 (18:13 +0100)]
ARM: imx: Introduce DH i.MX6 DHSOM board specific defconfigs

Move content of dh_imx6_defconfig into dh_imx6.config. Retain legacy
dh_imx6_defconfig as multi-config for all DH i.MX6 DHSOM based boards.
Introduce separate imx6_dhcom_drc02_defconfig, imx6_dhcom_pdk2_defconfig
and imx6_dhcom_picoitx_defconfig for each i.MX6 DHSOM based board, to
make build for those boards easier. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
3 months agoARM: imx: Fix CONFIG_BOOTCOUNT_ALTBOOTCMD duplication on DH i.MX8MP DHCOM
Marek Vasut [Fri, 21 Feb 2025 17:08:01 +0000 (18:08 +0100)]
ARM: imx: Fix CONFIG_BOOTCOUNT_ALTBOOTCMD duplication on DH i.MX8MP DHCOM

Deduplicate the config files again, move CONFIG_BOOTCOUNT_ALTBOOTCMD
into common imx8mp_dhsom.config .

Fixes: 940135eea5df ("Kconfig: Move CONFIG_BOOTCOUNT_ALTBOOTCMD to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
3 months agoARM: imx: Fix CONFIG_BOOTCOUNT_ALTBOOTCMD duplication on Data Modul i.MX8M eDM SBC
Marek Vasut [Fri, 21 Feb 2025 17:07:17 +0000 (18:07 +0100)]
ARM: imx: Fix CONFIG_BOOTCOUNT_ALTBOOTCMD duplication on Data Modul i.MX8M eDM SBC

Deduplicate the config files again, move CONFIG_BOOTCOUNT_ALTBOOTCMD
into common imx8m_data_modul.config .

Fixes: 940135eea5df ("Kconfig: Move CONFIG_BOOTCOUNT_ALTBOOTCMD to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
3 months agoARM: imx: Fix CONFIG_BOOTCOUNT_ALTBOOTCMD update on Data Modul i.MX8M Mini eDM SBC
Marek Vasut [Fri, 21 Feb 2025 17:07:16 +0000 (18:07 +0100)]
ARM: imx: Fix CONFIG_BOOTCOUNT_ALTBOOTCMD update on Data Modul i.MX8M Mini eDM SBC

The environment is missing quotes for string variable, add them.

Fixes: 940135eea5df ("Kconfig: Move CONFIG_BOOTCOUNT_ALTBOOTCMD to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 months agotools: imx8mimage: Fix potential memory leak
Maks Mishin [Sun, 2 Feb 2025 17:10:39 +0000 (20:10 +0300)]
tools: imx8mimage: Fix potential memory leak

Dynamic memory, referenced by 'line', is allocated at imx8mimage.c:187
by calling function 'getline' and lost at imx8mimage.c:210.

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

Dynamic memory, referenced by 'line', is allocated at imx8image.c:270
by calling function 'getline' and lost at imx8image.c:294.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
3 months agotools: imximage: Fix potential memory leak
Maks Mishin [Fri, 31 Jan 2025 10:04:46 +0000 (13:04 +0300)]
tools: imximage: Fix potential memory leak

Dynamic memory, referenced by 'line', is allocated at imximage.c:761
by calling function 'getline' and lost at imximage.c:793.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
3 months agosiemens: common: Make DDR_SI_TEST depend on TARGET_CAPRICORN
Liya Huang [Fri, 31 Jan 2025 00:52:43 +0000 (08:52 +0800)]
siemens: common: Make DDR_SI_TEST depend on TARGET_CAPRICORN

The DDR_SI_TEST config option is only relevant to the i.MX8 Capricorn
board.
Make DDR_SI_TEST depend on DDR_SI_TEST so that it does not show up
on other targets.

Signed-off-by: Liya Huang <1425075683@qq.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 months agoARM: dts: imxrt1050: Migrate to OF_UPSTREAM
Jesse Taube [Mon, 27 Jan 2025 21:19:50 +0000 (16:19 -0500)]
ARM: dts: imxrt1050: Migrate to OF_UPSTREAM

The device tree for imxrt1050 is now
available in the /dts/upstream directory.
Migrate board to use OF_UPSTREAM.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next
Tom Rini [Wed, 26 Feb 2025 20:32:16 +0000 (14:32 -0600)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

bbmiiphy clean up and DM alignment, finally gets rid of the static
bbmiiphy variables and plugs bbmiiphy into MDIO framework.

3 months agonet: miiphybb: Drop bb_miiphy_buses and bb_miiphy_buses_num
Marek Vasut [Sat, 22 Feb 2025 20:33:33 +0000 (21:33 +0100)]
net: miiphybb: Drop bb_miiphy_buses and bb_miiphy_buses_num

Neither bb_miiphy_buses nor bb_miiphy_buses_num are used anymore.
Drop both of them.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agonet: sh_eth: Drop use of miiphy_get_dev_by_name()
Marek Vasut [Sat, 22 Feb 2025 20:33:32 +0000 (21:33 +0100)]
net: sh_eth: Drop use of miiphy_get_dev_by_name()

Instead of doing another lookup, trivially access the struct mii_dev
embedded in struct bb_miiphy_bus . No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: ravb: Drop use of miiphy_get_dev_by_name()
Marek Vasut [Sat, 22 Feb 2025 20:33:31 +0000 (21:33 +0100)]
net: ravb: Drop use of miiphy_get_dev_by_name()

Instead of doing another lookup, trivially access the struct mii_dev
embedded in struct bb_miiphy_bus . No functional change.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agoarm: mvebu: a38x: Drop use of miiphy_get_dev_by_name()
Marek Vasut [Sat, 22 Feb 2025 20:33:30 +0000 (21:33 +0100)]
arm: mvebu: a38x: Drop use of miiphy_get_dev_by_name()

Instead of doing another lookup, trivially access the struct mii_dev
embedded in struct bb_miiphy_bus . No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Drop name field from struct bb_miiphy_bus
Marek Vasut [Sat, 22 Feb 2025 20:33:29 +0000 (21:33 +0100)]
net: miiphybb: Drop name field from struct bb_miiphy_bus

The struct bb_miiphy_bus embeds struct struct mii_dev, which
already contains one copy of name field. Drop the duplicate
top level copy of name field.

The a38x code does static assignment of disparate names, use
snprintf(...) to fill in matching name in probe to avoid any
breakage.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agonet: miiphybb: Use container_of() in bb_miiphy_getbus()
Marek Vasut [Sat, 22 Feb 2025 20:33:28 +0000 (21:33 +0100)]
net: miiphybb: Use container_of() in bb_miiphy_getbus()

Replace the name based look up in bb_miiphy_getbus() with trivial
container_of() call. This works because the struct bb_miiphy_bus
always embeds the matching struct mii_dev . This also makes the
code much simpler and more efficient.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agonet: designware: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks
Marek Vasut [Sat, 22 Feb 2025 20:33:27 +0000 (21:33 +0100)]
net: designware: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks

Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks
currently listed in bb_miiphy_buses[] array. This is a temporary
duplication of assignment to avoid breakage, which will be removed
in follow up patches. At this point, the bb_miiphy callbacks can
reach these accessors by doing container_of() on struct mii_dev.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: sh_eth: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks
Marek Vasut [Sat, 22 Feb 2025 20:33:26 +0000 (21:33 +0100)]
net: sh_eth: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks

Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks
currently listed in bb_miiphy_buses[] array. This is a temporary
duplication of assignment to avoid breakage, which will be removed
in follow up patches. At this point, the bb_miiphy callbacks can
reach these accessors by doing container_of() on struct mii_dev.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: ravb: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks
Marek Vasut [Sat, 22 Feb 2025 20:33:25 +0000 (21:33 +0100)]
net: ravb: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks

Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks
currently listed in bb_miiphy_buses[] array. This is a temporary
duplication of assignment to avoid breakage, which will be removed
in follow up patches. At this point, the bb_miiphy callbacks can
reach these accessors by doing container_of() on struct mii_dev.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agoarm: mvebu: a38x: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks
Marek Vasut [Sat, 22 Feb 2025 20:33:24 +0000 (21:33 +0100)]
arm: mvebu: a38x: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks

Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks
currently listed in bb_miiphy_buses[] array. This is a temporary
duplication of assignment to avoid breakage, which will be removed
in follow up patches. At this point, the bb_miiphy callbacks can
reach these accessors by doing container_of() on struct mii_dev.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Introduce bb_miiphy_alloc()/bb_miiphy_free() wrappers
Marek Vasut [Sat, 22 Feb 2025 20:33:23 +0000 (21:33 +0100)]
net: miiphybb: Introduce bb_miiphy_alloc()/bb_miiphy_free() wrappers

Introduce bb_miiphy_alloc()/bb_miiphy_free() wrappers to allocate and free
struct bb_miiphy_bus. Make struct bb_miiphy_bus wrap struct mii_dev, which
will become useful later in bb_miiphy_bus accessors, which would be able
to access struct bb_miiphy_bus using container_of, even if the PHY stack
only passes in the inner struct mii_dev .

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agonet: miiphy: Introduce mdio_init()
Marek Vasut [Sat, 22 Feb 2025 20:33:22 +0000 (21:33 +0100)]
net: miiphy: Introduce mdio_init()

Introduce mdio_init() split off from mdio_alloc(), which is used
to initialize already allocated struct mii_dev.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agonet: designware: Extract bbmiiphy initialization into dedicated function
Marek Vasut [Sat, 22 Feb 2025 20:33:21 +0000 (21:33 +0100)]
net: designware: Extract bbmiiphy initialization into dedicated function

Pull the bbmiiphy initialization code from designware_eth_probe() into
dedicated function, dw_bb_mdio_init(), just like all the other MDIO
initialization functions.

Keep check for "snps,bitbang-mii" in the designware_eth_probe(), so the
driver can initialize this MDIO only in case the property is present,
and initialize regular DW MDIO in case it is not present.

The dw_bb_mdio_init() allocates its own MDIO instance, because thus far
code gated behind "snps,bitbang-mii" did depend on allocation of MDIO bus
by the other two MDIO bus options and then rewrote the newly allocated
MDIO bus callbacks, which is wrong, instead allocate proper MDIO bus with
the correct callbacks outright.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: designware: Drop bus index
Marek Vasut [Sat, 22 Feb 2025 20:33:20 +0000 (21:33 +0100)]
net: designware: Drop bus index

There is literally one single bbmiiphy bus in this driver,
remove the bus index handling.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Drop bb_miiphy_init() and .init callback
Marek Vasut [Sat, 22 Feb 2025 20:33:19 +0000 (21:33 +0100)]
net: miiphybb: Drop bb_miiphy_init() and .init callback

The .init callback is not called by any function, drop it.
There are no more users of the init callback, drop the entire
mechanism.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agoarm: mvebu: a38x: Call bb_miiphy init directly in driver probe
Marek Vasut [Sat, 22 Feb 2025 20:33:18 +0000 (21:33 +0100)]
arm: mvebu: a38x: Call bb_miiphy init directly in driver probe

All the resources needed by this .init callback should already
be available by the time probe function runs, simply call the
init callback directly and set the bb_miiphy init callback to
NULL. This shouldn't break anything on this hardware, but would
be nice if someone could double-check and test that.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: designware: Reorder bb_miiphy functions
Marek Vasut [Sat, 22 Feb 2025 20:33:17 +0000 (21:33 +0100)]
net: designware: Reorder bb_miiphy functions

Move the bb_miiphy functions before MDIO registration. This is a
preparatory patch, the functions will be referenced around the MDIO
registration in the follow up patches. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agoarm: mvebu: a38x: Reorder bb_miiphy functions
Marek Vasut [Sat, 22 Feb 2025 20:33:16 +0000 (21:33 +0100)]
arm: mvebu: a38x: Reorder bb_miiphy functions

Move the bb_miiphy functions before MDIO registration. This is a
preparatory patch, the functions will be referenced around the MDIO
registration in the follow up patches. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: sh_eth: Reorder bb_miiphy functions
Marek Vasut [Sat, 22 Feb 2025 20:33:15 +0000 (21:33 +0100)]
net: sh_eth: Reorder bb_miiphy functions

Move the bb_miiphy functions before MDIO registration. This is a
preparatory patch, the functions will be referenced around the MDIO
registration in the follow up patches. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: ravb: Reorder bb_miiphy functions
Marek Vasut [Sat, 22 Feb 2025 20:33:14 +0000 (21:33 +0100)]
net: ravb: Reorder bb_miiphy functions

Move the bb_miiphy functions before MDIO registration. This is a
preparatory patch, the functions will be referenced around the MDIO
registration in the follow up patches. No functional change.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agonet: designware: Drop NULL priv assignment
Marek Vasut [Sat, 22 Feb 2025 20:33:13 +0000 (21:33 +0100)]
net: designware: Drop NULL priv assignment

This is unnecessary, the unset structure member is initialized to
NULL by default, drop the assignment.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agonet: sh_eth: Drop empty init callback
Marek Vasut [Sat, 22 Feb 2025 20:33:12 +0000 (21:33 +0100)]
net: sh_eth: Drop empty init callback

The init function does nothing, the bb_miiphy_init() already checks
whether the .init callback is assigned, and if not, skips calling it.
Remove the empty init function. The entire init callback will be
removed in follow up patches.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agonet: ravb: Drop empty init callback
Marek Vasut [Sat, 22 Feb 2025 20:33:11 +0000 (21:33 +0100)]
net: ravb: Drop empty init callback

The init function does nothing, the bb_miiphy_init() already checks
whether the .init callback is assigned, and if not, skips calling it.
Remove the empty init function. The entire init callback will be
removed in follow up patches.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agoMerge patch series "Remove "saveenv" functionality from am57xx evms"
Tom Rini [Tue, 25 Feb 2025 17:11:32 +0000 (11:11 -0600)]
Merge patch series "Remove "saveenv" functionality from am57xx evms"

Anurag Dutta <a-dutta@ti.com> says:

Previously saved environment introduce discrepancies and may lead to
incompatibilities without default settings. This series removes the saved
environment functionality on am57xx evms so that the default configuration
is always loaded

Test result: https://gist.github.com/anuragdutta731/b253ddb0a5538ab6588a3535d7bbecf7

Link: https://lore.kernel.org/r/20250208043938.52832-1-a-dutta@ti.com
3 months agoconfigs: am57xx: Remove saved environments
Anurag Dutta [Sat, 8 Feb 2025 04:39:38 +0000 (10:09 +0530)]
configs: am57xx: Remove saved environments

Saved environments lead to inconsistencies leading to conflicts
with the default environment that U-boot should update during
development. Remove the previously saved environment so that
the default environment is always loaded.

Signed-off-by: Anurag Dutta <a-dutta@ti.com>
3 months agoconfigs: am57xx_hs: Remove saved environments
Anurag Dutta [Sat, 8 Feb 2025 04:39:37 +0000 (10:09 +0530)]
configs: am57xx_hs: Remove saved environments

Saved environments cause inconsistencies leading to conflicts
with the default environment that U-boot should update during
development. Remove the previously saved environment so that
the default environment is always loaded.

Signed-off-by: Anurag Dutta <a-dutta@ti.com>
3 months agoMerge tag 'u-boot-socfpga-next-20250225' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 25 Feb 2025 14:25:00 +0000 (08:25 -0600)]
Merge tag 'u-boot-socfpga-next-20250225' of https://source.denx.de/u-boot/custodians/u-boot-socfpga into next

CI: https://source.denx.de/u-boot/custodians/u-boot-socfpga/-/pipelines/24816

Please pull the SoCFPGA changes for next from u-boot-socfpga, containing
boot support for the  Altera SoCFPGA Agilex 5 platform in U-Boot. The
changes include:

1. Board-specific configurations and setup required to enable Agilex 5
   operation in U-Boot.
2. Integration of cache coherency unit (CCU) initialization routine,
   including CCU conguration in DT.
3. Clock, firewall (configured in DT), SMMU, low level initialization
   specific to Agilex 5.
4. Integration of memory initialization routine, including DDR setup.

This patch set has been tested on Agilex 5 devkit with QSPI boot
(UBI/UBIFS) and RAM boot (TFTP & ARM DS debugger).

3 months agoconfigs: agilex5: Enable watchdog autostart
Alif Zakuan Yuslaimi [Tue, 18 Feb 2025 08:35:11 +0000 (16:35 +0800)]
configs: agilex5: Enable watchdog autostart

Automatically start watchdog timer for Agilex5. This
configuration is enabled by default in the Kconfig,
hence removing this configuration from Agilex5 defconfig.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
3 months agoconfigs: socfpga: soc64: agilex5: Enable QSPI boot with UBI / UBIFS
Alif Zakuan Yuslaimi [Tue, 18 Feb 2025 08:35:10 +0000 (16:35 +0800)]
configs: socfpga: soc64: agilex5: Enable QSPI boot with UBI / UBIFS

Add the required configuration in the U-Boot env to enable Linux QSPI
boot with UBI / UBIFS.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
3 months agoarm: socfpga: soc64: Add support for board_boot_order()
Tien Fong Chee [Tue, 18 Feb 2025 08:35:09 +0000 (16:35 +0800)]
arm: socfpga: soc64: Add support for board_boot_order()

Add board_boot_order() to retrieve the list of boot devices from
spl-boot-order property in device tree. This board_boot_order()
would be used for all Intel SOC64 devices.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
3 months agoconfigs: socfpga: soc64: agilex5: Enable XGMAC
Tien Fong Chee [Tue, 18 Feb 2025 08:35:08 +0000 (16:35 +0800)]
configs: socfpga: soc64: agilex5: Enable XGMAC

Enable XGMAC for SoCFPGA Agilex5 devkit.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
3 months agoconfigs: socfpga: soc64: agilex5: Use common ARMv8 linker script
Alif Zakuan Yuslaimi [Tue, 18 Feb 2025 08:35:07 +0000 (16:35 +0800)]
configs: socfpga: soc64: agilex5: Use common ARMv8 linker script

Use default common ARMv8 linker script instead of a separate
SoC64 linker script

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
3 months agoarm: armv8: Improve SPL data save and restore implementation
Alif Zakuan Yuslaimi [Tue, 18 Feb 2025 08:35:06 +0000 (16:35 +0800)]
arm: armv8: Improve SPL data save and restore implementation

Introduce a new symbol in the beginning of .data section in
the common ARMv8 linker script and use that as a reference
for data save and restore.

Previously, the code would rely on calculating the start of
the .data section address via data size, however, we observed
that the data size does not really reflect the SPL mapped
addresses.

In our case, the binman_sym section size was not included in
the data size, which will result in a wrong address for the
.data start section, which prevents us from properly saving
and restoring SPL data.

This approach skips the calculation for the starting address
of the .data section, and instead just defines the beginning
address of the .data section and calling the symbol as needed,
in which we think as a simpler and much more robust method.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
3 months agoarm: socfpga: agilex5: Add SPL for Agilex5 SoCFPGA
Tien Fong Chee [Wed, 14 Aug 2024 07:56:25 +0000 (15:56 +0800)]
arm: socfpga: agilex5: Add SPL for Agilex5 SoCFPGA

Add SPL support for Agilex5 SoCFPGA.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>