]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
13 months agosamsung: snow: Use BLOBLIST_FIXED
Simon Glass [Wed, 26 Feb 2025 16:26:15 +0000 (09:26 -0700)] 
samsung: snow: Use BLOBLIST_FIXED

Snow requires a fixed bloblist to operate, so re-enable this option.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 864106f3c47 ("bloblist: Make BLOBLIST_ALLOC the default")
13 months agoboard: verdin-am62: fix missing memory fixup call
Stefan Eichenberger [Mon, 3 Mar 2025 18:16:03 +0000 (19:16 +0100)] 
board: verdin-am62: fix missing memory fixup call

The commit bc07851897bd ("board: ti: Pull redundant DDR functions to a
common location and Fixup DDR size when ECC is enabled") broke DRAM
support for the Verdin AM62. This was partially fixed with commit
3f866c47b582 ("board: verdin-am62: add dram_init_banksize"). However,
because fixup_memory_node was not called, the Linux kernel was started
with the wrong memory size on modules with less memory available. This
resulted in boot failures. Fix this issue by calling fixup_memory_node
in the board file.

spl_perform_fixups will be called in the SPL and now sets the correct
memory size in the device tree of U-Boot by calling fixup_memory_node.
U-Boot will then adjust the memory sizes of Linux during bootm/booti in
fdt_fixup_memory_banks. This chain ensures that U-Boot and Linux only
use RAM that is actually available.

Fixes: 3f866c47b582 ("board: verdin-am62: add dram_init_banksize")
Fixes: bc07851897bd ("board: ti: Pull redundant DDR functions to a common location and Fixup DDR size when ECC is enabled")
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
13 months agomiiphy: define mii_devs with LIST_HEAD()
Weijie Gao [Sat, 25 Jan 2025 15:26:32 +0000 (23:26 +0800)] 
miiphy: define mii_devs with LIST_HEAD()

When enabling net console and console multiplexing, a boot crash was
observed using mtk_eth driver with stdin/stdout set to "serial,nc"
in persistent environment:

> CPU:   MediaTek MT7981
> Model: OpenWrt One
> DRAM:  1 GiB
> Core:  35 devices, 15 uclasses, devicetree: separate
> spi-nand: spi_nand spi_nand@0: Winbond SPI NAND was found.
> spi-nand: spi_nand spi_nand@0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
> Loading Environment from UBI... SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
> mtd: partition "ubi" extends beyond the end of device "spi-nand0" -- size truncated to 0x7f00000
> Read 126976 bytes from volume ubootenv to 000000007f7bf0c0
> Read 126976 bytes from volume ubootenv2 to 000000007f7de100
> OK
> "Synchronous Abort" handler, esr 0x96000004, far 0xeafffffeea000018
> elr: 0000000041e63cd4 lr : 0000000041e1b844 (reloc)
> elr: 000000007ff9ecd4 lr : 000000007ff56844
> x0 : eafffffeea000018 x1 : 000000007fb552e0
> x2 : 00000000000000fe x3 : 0000000000000000

The cause is that "serial,nc" forced the console subsystem to
initialize the ethernet driver before ethernet subsystem
initialization (console_init_r() is called before initr_net()).

During the mtk_eth driver initialization, mdio_register() will be
called, and miiphy_get_dev_by_name() will then be called.

The miiphy_get_dev_by_name() will check the list "mii_devs" to see
if the passed device name exists. However the mii_devs is defined
without initialization:
> static struct list_head mii_devs;
and the actual initialization is done in the following chain:
initr_net -> eth_initialize -> eth_common_init -> miiphy_init
Since initr_net() hasn't be called, iterating over the mii_devs
will access to physical address 0 (mii_devs.next == NULL) and will
cause the crash.

The fix is to define mii_devs using:
> static LIST_HEAD(mii_devs);

As the "current_mii" is defined as a static variable, it will
always be NULL in board_r stage and initializing it will NULL is
unnecessary. So the entire miiphy_init() can be remove.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
13 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>
13 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>
13 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
13 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
13 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>
13 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>
13 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>
13 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>
13 months agoMAINTAINERS: Update contact information for Greg Malysa
Greg Malysa [Fri, 28 Feb 2025 19:28:27 +0000 (14:28 -0500)] 
MAINTAINERS: Update contact information for Greg Malysa

My previous address is no longer accessible, but I will continue to be
involved in maintaining the ADI sc5xx platforms. This updates my contact
information and hopefully avoids bouncing emails from other developers.

Signed-off-by: Greg Malysa <malysagreg@gmail.com>
13 months agoarm64: versal2: Show major and minor silicon version
Michal Simek [Tue, 18 Feb 2025 12:43:07 +0000 (13:43 +0100)] 
arm64: versal2: Show major and minor silicon version

ES1 silicon is 0x10 (16) and production is 0x20 (32) but correct number to
see are v1.0 or v2.0 instead of v16 or v32.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20095339334fe07f373ffae3bdbfec51f5a00dc7.1739882585.git.michal.simek@amd.com
13 months agoclk: versal: Store driver data in data section
Padmarao Begari [Tue, 18 Feb 2025 05:24:19 +0000 (10:54 +0530)] 
clk: versal: Store driver data in data section

Line 171 in README is describing that before relocation
no code should use global variable because global variables
are placed to BSS section which is initialized to 0 after
relocation.

On Versal platforms clock driver is initialized before
relocation (via using dm,bootph-all flag in DT) and global
variables are initialized which works if this is used only
before relocation. But the variables are used after
relocation too but values are zeroed which is ending up
incorrect behavior.

That's why place variables to data section to ensure that
values are not cleared which is for now the quickest
temporary solution. The correct way to do it is to move
all global variables to private data to avoid it.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250218052419.1141139-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoxilinx: zynq: Guard code around SPL_FS_LOAD_PAYLOAD_NAME
Michal Simek [Fri, 7 Feb 2025 06:43:23 +0000 (07:43 +0100)] 
xilinx: zynq: Guard code around SPL_FS_LOAD_PAYLOAD_NAME

Guard code around CONFIG_SPL_FS_LOAD_PAYLOAD_NAME usage to avoid
compilation failure.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f15a9762494945814b06a71db90ee4db59dd17ed.1738910601.git.michal.simek@amd.com
13 months agoMerge tag 'fsl-qoriq-2025-3-3' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 3 Mar 2025 13:49:07 +0000 (07:49 -0600)] 
Merge tag 'fsl-qoriq-2025-3-3' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq

CI: https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq/-/pipelines/24933

Fixes:

- Re-arm packet buffer in error case in tsec driver
- Fix LS1021a build
- Fix flush dcache alignment in caam_hash

13 months agoMerge tag 'efi-2025-04-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 3 Mar 2025 13:47:13 +0000 (07:47 -0600)] 
Merge tag 'efi-2025-04-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi

CI:

* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/24904

UEFI:

* Let efi_net_set_dp properly update the device path

Network:

* Avoid buffer overflows in wget_info with legacy TCP stack

13 months agoclk: versal: Update the reference clocks as per bindings
Venkatesh Yadav Abbarapu [Thu, 6 Feb 2025 09:15:33 +0000 (14:45 +0530)] 
clk: versal: Update the reference clocks as per bindings

As per the bindings the reference clocks naming has changed
from "pl_alt_ref_clk" to "pl_alt_ref" and "ref_clk" to "ref".
Update the same in the clock driver. Also add the fallback option
for older DT bindings.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250206091533.1447234-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agocrypto: fsl_hash: fix flush dcache alignment in caam_hash()
Benjamin Lemouzy [Fri, 21 Feb 2025 07:05:01 +0000 (08:05 +0100)] 
crypto: fsl_hash: fix flush dcache alignment in caam_hash()

Loading a FIT kernel image with hash hardware acceleration enabled
(CONFIG_SHA_HW_ACCEL=y) displays the following CACHE warning:

    [...]
    Trying 'kernel-1' kernel subimage
    [...]
    Verifying Hash Integrity ... sha256CACHE: Misaligned operation at
range [160001281673fae8]
    [...]
    Trying 'ramdisk-1' ramdisk subimage
    [...]
    Verifying Hash Integrity ... sha256CACHE: Misaligned operation at
range [1676d6d41737a5d4]
    [...]
    Trying 'fdt-imx6q-xxx.dtb' fdt subimage
    [...]
    Verifying Hash Integrity ... sha256CACHE: Misaligned operation at
range [1673fbdc1674b0dc]
    [...]

This patch fixes it.

Tested on:
- i.MX 6 custom board
- LS1021A custom board

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agoboard: freescale: fix LS1021a build
Benjamin Lemouzy [Mon, 17 Feb 2025 15:36:03 +0000 (16:36 +0100)] 
board: freescale: fix LS1021a build

Fix build error "undefined reference to `is_warm_boot'" when
ls1021atsn and ls1021atwr boards are built with CONFIG_SPL=y and
CONFIG_DEEP_SLEEP=n.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: tsec: Re-arm packet buffer in error case
J. Neuschäfer [Sun, 16 Feb 2025 21:18:13 +0000 (22:18 +0100)] 
net: tsec: Re-arm packet buffer in error case

When an error is detected in the TSEC receive path, the driver currently
prints an error message, but leaves the corresponding packet descriptor
in its old state (i.e. owned by the CPU side). As a result, the packet
queue can be starved of available buffers if enough errors happen.

To recover from errors, re-arm the packet buffer descriptor after an
error has been detected.

Errors can be provoked by changing a PHY with phy-mode = "rgmii-id" to
phy-mode = "rgmii".

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: tsec: Reorder tsec_recv and tsec_free_pkt
J. Neuschäfer [Sun, 16 Feb 2025 21:18:12 +0000 (22:18 +0100)] 
net: tsec: Reorder tsec_recv and tsec_free_pkt

This is necessary for the following patch. No functional change.

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agoMerge tag 'u-boot-rockchip-20250301' of https://source.denx.de/u-boot/custodians...
Tom Rini [Sat, 1 Mar 2025 13:51:14 +0000 (07:51 -0600)] 
Merge tag 'u-boot-rockchip-20250301' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/2489

- Fix SD-Card boot on rk3308-rock-s0 v1.1;
- Fix crash on nanopi-r4s seconde usb port;
- Disable undeeded PCI config for nanopi-r3s-rk3566
- Correct usage of IS_ENABLED()

13 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
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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
13 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>
13 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>
13 months agolegacy-net: wget: fix wget_info handling after new tcp legacy stack
Adriano Cordova [Thu, 6 Feb 2025 17:40:11 +0000 (14:40 -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>
13 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>
13 months agorockchip: nanopi-r3s-rk3566: disable unneeded CONFIG_NVME_PCI
Tianling Shen [Wed, 15 Jan 2025 05:37:05 +0000 (13:37 +0800)] 
rockchip: nanopi-r3s-rk3566: disable unneeded CONFIG_NVME_PCI

This board does not have any NVMe slot, so disable unneeded
CONFIG_NVME_PCI option.

Fixes: bf4a33e725ae ("board: rockchip: add FriendlyElec NanoPi R3S")
Signed-off-by: Tianling Shen <cnsztl@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agorockchip: nanopi-r4s: Enable second usb port and fix crash
Justin Klaassen [Fri, 31 Jan 2025 17:06:13 +0000 (17:06 +0000)] 
rockchip: nanopi-r4s: Enable second usb port and fix crash

The patch enables the second USB3.0 Type-A USB port on the NanoPi R4S
board, which prevents a crash when initializing the usb system in U-Boot
and allows both Type-A USB ports to be used for booting.

=> usb start
starting USB...
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: "Synchronous Abort" handler, esr 0x96000010, far 0x0

Signed-off-by: Justin Klaassen <justin@tidylabs.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agoclk: rockchip: Correct usage of IS_ENABLED() macro
Tom Rini [Wed, 26 Feb 2025 20:31:23 +0000 (14:31 -0600)] 
clk: rockchip: Correct usage of IS_ENABLED() macro

These two files were using IS_ENABLED() to test for CONFIG flags but omitted
the CONFIG_ prefix and so did not work as expected.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agorockchip: rk3308-rock-s0: Fix SD-card boot on v1.1 hw revision
Jonas Karlman [Thu, 20 Feb 2025 18:31:28 +0000 (18:31 +0000)] 
rockchip: rk3308-rock-s0: Fix SD-card boot on v1.1 hw revision

BootROM leave GPIO4_D6 configured as SDMMC_PWREN function and DW MMC
driver set PWREN high in dwmci_init().

However, HW revision prior to v1.2 must pull GPIO4_D6 low to access
sdmmc. For HW revision v1.2 the state of GPIO4_D6 has no impact.

Upstream Linux commit 26c100232b09 "arm64: dts: rockchip: Fix sdmmc
access on rk3308-rock-s0 v1.1 boards" fixed this issue by adding a
vcc_sd regulator.

Include the new vcc_sd regulator in SPL and enable required Kconfig
options to set GPIO4_D6 low to fix reading sdmmc on v1.1 hw revision.

Fixes: 25438c40a007 ("board: rockchip: Add Radxa ROCK S0")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agoMerge patch series "mbedtls: fix incorrect kconfig dependencies on mbedtls"
Tom Rini [Thu, 27 Feb 2025 18:11:07 +0000 (12:11 -0600)] 
Merge patch series "mbedtls: fix incorrect kconfig dependencies on mbedtls"

This series from Raymond Mao <raymond.mao@linaro.org> fixes assorted
problems with how dependencies were expressed in Kconfig for mbedtls and
assorted algorithms.

Link: https://lore.kernel.org/r/20250203220825.707590-1-raymond.mao@linaro.org
13 months agombedtls: refactor mbedtls build for XPL
Raymond Mao [Mon, 3 Feb 2025 22:08:14 +0000 (14:08 -0800)] 
mbedtls: refactor mbedtls build for XPL

Refactor the entire kconfig page for mbedtls, adapt mbedtls makefile
and default config file using 'XPL_', in order to have independent
mbedtls kconfig options in U-Boot Proper, SPL, TPL and VPL.
User can choose legacy or mbedtls libraries for them independently.

Set mbedtls native hashing libraries as default when MBEDTLS_LIB,
SPL_MBEDTLS_LIB, TPL_MBEDTLS_LIB or VPL_MBEDTLS_LIB is selected.

If users prefer using U-Boot legacy hashing libraries, please select
MBEDTLS_LIB_HASHING_ALT, SPL_MBEDTLS_LIB_HASHING_ALT,
TPL_MBEDTLS_LIB_HASHING_ALT or VPL_MBEDTLS_LIB_HASHING_ALT for U-Boot
Proper, SPL, TPL and VPL respectively.

Moreover, rename a few kconfig options and update their descriptions to
improve the consistency of terminology.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agombedtls: access mbedtls private members in mscode and pkcs7 parser
Raymond Mao [Mon, 3 Feb 2025 22:08:13 +0000 (14:08 -0800)] 
mbedtls: access mbedtls private members in mscode and pkcs7 parser

U-Boot requires to access x509_internal.h, mbedtls_sha256_context and
mbedtls_sha1_context in the porting layer, and this requires to
enable MBEDTLS_ALLOW_PRIVATE_ACCESS.

Enable it to mscode and pkcs7_parser to fix a mbedtls internal building
error when X509 is selected.

Moreover, Move it to a separate file to avoid enabling it in multiple
places.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agombedtls: fix incorrect kconfig dependencies on mbedtls
Raymond Mao [Mon, 3 Feb 2025 22:08:12 +0000 (14:08 -0800)] 
mbedtls: fix incorrect kconfig dependencies on mbedtls

Fixed the building failures when WGET_HTTPS,NET_LWIP and MBEDTLS_LIB
are selected due to a few incorrect kconfig dependencies.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 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.

13 months agoarch: arm: dts: k3-am642-phycore-som-binman: Add custMpk to overlays
Daniel Schultz [Tue, 11 Feb 2025 06:42:05 +0000 (22:42 -0800)] 
arch: arm: dts: k3-am642-phycore-som-binman: Add custMpk to overlays

There are some device-tree overlays with missing entries for the
keyfile. Add them to sign all images in the U-Boot FIT image.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
13 months agoarch: arm: dts: k3-am625-phycore-som-binman: Add custMpk to overlays
Daniel Schultz [Tue, 11 Feb 2025 06:42:04 +0000 (22:42 -0800)] 
arch: arm: dts: k3-am625-phycore-som-binman: Add custMpk to overlays

There are some device-tree overlays with missing entries for the
keyfile. Add them to sign all images in the U-Boot FIT image.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
13 months agoMerge tag 'u-boot-imx-master-20250227' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Thu, 27 Feb 2025 14:00:30 +0000 (08:00 -0600)] 
Merge tag 'u-boot-imx-master-20250227' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

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

- Fix bootstd booting on imx8mm_evk, imx8mq_evk, imx8mp_evk and
  imx93_evk

13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 months agoimx8mp_evk: Pass kernel_addr_r
Fabio Estevam [Thu, 27 Feb 2025 10:29:16 +0000 (07:29 -0300)] 
imx8mp_evk: Pass kernel_addr_r

Currently, booting via bootstd fails because the kernel cannot be retrieved.
The reason for this is the lack of 'kernel_addr_r'.

Pass 'kernel_addr_r' to fix booting via bootstd.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
13 months agoimx93_evk: Pass kernel_addr_r
Fabio Estevam [Thu, 27 Feb 2025 10:29:15 +0000 (07:29 -0300)] 
imx93_evk: Pass kernel_addr_r

Currently, booting via bootstd fails because the kernel cannot be retrieved.
The reason for this is the lack of 'kernel_addr_r'.

Pass 'kernel_addr_r' to fix booting via bootstd.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
13 months agoimx8mm: imx8mm_evk: fix BOOTSTD boot
Peng Fan [Sat, 22 Feb 2025 12:17:11 +0000 (20:17 +0800)] 
imx8mm: imx8mm_evk: fix BOOTSTD boot

Select BOOTSTD_FULL and BOOTSTD_BOOTCOMMAND
Correct DEFAULT_FDT_FILE
Correct env file for imx8mm_evk_fspi_defconfig

Fixes: 364ba68ed1a ("imx: imx8mm_evk: Switch to BOOTSTD")
Reported-by: Ludwig Nussel <ludwig.nussel@siemens.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agoimx8mq: imx8mq_evk: fix DEFAULT_FDT_FILE
Peng Fan [Sat, 22 Feb 2025 12:17:10 +0000 (20:17 +0800)] 
imx8mq: imx8mq_evk: fix DEFAULT_FDT_FILE

The CONFIG_DEFAULT_FDT_FILE should be imx8mq_evk.dtb for this board

Fixes: 7050bd925f7 ("imx: imx8mq_evk: Switch to BOOTSTD")
Reported-by: Ludwig Nussel <ludwig.nussel@siemens.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 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.

13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 months agoMerge tag 'qcom-fixes-2025.04-rc4' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 26 Feb 2025 14:55:32 +0000 (08:55 -0600)] 
Merge tag 'qcom-fixes-2025.04-rc4' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon

CI: https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/pipelines/24841

The clk_stub, regulator, and pinctrl fixes enable the sdcard on the RB5
dev board (and sm8250 devices broadly). clk_stub is only enabled in
qcom_defconfig and the others are qcom specific so these shouldn't
affect other platforms.

Lastly, a small ufetch fix from Sam which gets color rendering correctly
on U-Boots framebuffer video device.

13 months agocmd: ufetch: use 3-bit colour ANSI codes
Sam Day [Mon, 3 Feb 2025 16:42:20 +0000 (16:42 +0000)] 
cmd: ufetch: use 3-bit colour ANSI codes

Currently, the 8-bit escapes are being used, which aren't supported by
vidconsole_escape_char. Since the current usage maps directly to the
3-bit equivalents anyway, let's use those instead.

With this change, the fetch output looks as fetching in the vidconsole
as it does over serial!

Signed-off-by: Sam Day <me@samcday.com>
Tested-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Tested-by: Ferass El Hafidi <funderscore@postmarketos.org>
13 months agopinctrl: qcom: sm8250: fix pin count
Caleb Connolly [Mon, 10 Feb 2025 16:30:24 +0000 (16:30 +0000)] 
pinctrl: qcom: sm8250: fix pin count

The pin count wasn't updated when the special pins were added, as a
result it was never possible to configure the special pins on SM8250
boards.

Fix the pin count and allow the special pins to be configured. This
fixes sdcard support on the RB5.

Fixes: 58fa52042471 ("pinctr: qcom: sm8250: add special pins pins configuration data")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agopower: regulator: add additional supported LDOs for pm8150l
Caleb Connolly [Mon, 10 Feb 2025 16:30:23 +0000 (16:30 +0000)] 
power: regulator: add additional supported LDOs for pm8150l

Add the other LDOs that our rpmh driver can currently support. Some of
these are used on the RB5 to power the sdcard.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoclk: stub: add sm8150 compatible id
Julius Lehmann [Mon, 10 Feb 2025 16:27:27 +0000 (16:27 +0000)] 
clk: stub: add sm8150 compatible id

Add support for sm8150 clock controller to clk stub driver.

Signed-off-by: Julius Lehmann <lehmanju@devpi.de>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
13 months agoqcom_defconfig: enable stub clock
Caleb Connolly [Mon, 10 Feb 2025 16:27:26 +0000 (16:27 +0000)] 
qcom_defconfig: enable stub clock

Enable the stub clock driver for rpmcc

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>