pandora-u-boot.git
3 months agoMerge patch series "binman: build_from_git: Add argument specifying branch"
Tom Rini [Wed, 12 Mar 2025 16:25:33 +0000 (10:25 -0600)]
Merge patch series "binman: build_from_git: Add argument specifying branch"

This series from Leonard Anderweit <l.anderweit@phytec.de> provides some
improvements to the binman tool and i.MX specific tooling then makes use
of it.

Link: https://lore.kernel.org/r/20250226210501.72794-1-l.anderweit@phytec.de
3 months agobinman: cst: Build from source
Leonard Anderweit [Wed, 26 Feb 2025 21:05:01 +0000 (22:05 +0100)]
binman: cst: Build from source

Build the imx code singing tool from source instead of relying on the
distro to provide the tool.
Use the debian/unstable branch because the default branch is outdated.
The binary is supposed to be build with docker, work around that by selecting
the correct Makefile directly.
Also append the description and add a link to documentation.

Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agobinman: build_from_git: Add optional make path inside git repo
Leonard Anderweit [Wed, 26 Feb 2025 21:05:00 +0000 (22:05 +0100)]
binman: build_from_git: Add optional make path inside git repo

Add optional argument make_path to build_from git. The new argument
allows specifying the path to a Makefile in case it is not in the root
of the git repo.
Also adjust the corresponding test.

Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agobinman: build_from_git: Add argument specifying branch
Leonard Anderweit [Wed, 26 Feb 2025 21:04:59 +0000 (22:04 +0100)]
binman: build_from_git: Add argument specifying branch

Add optional argument git_branch to build_from_git. The new argument
allows specifying which branch of the repo to use.

Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agoMerge patch series "drivers: Driver support for ADI SC5xx SoCs"
Tom Rini [Wed, 12 Mar 2025 16:25:13 +0000 (10:25 -0600)]
Merge patch series "drivers: Driver support for ADI SC5xx SoCs"

Greg Malysa <malysagreg@gmail.com> says:

This series adds all of the supported peripheral drivers for the sc5xx
series of SoCs from Analog Devices and other drivers that are used by
the evaluation kits, such as a GPIO expander used by the EZLITE carrier
boards. This series passes gitlab CI tests.

Link: https://lore.kernel.org/r/20250226173150.13198-1-malysagreg@gmail.com
3 months agommc: Add support for ADI SC5XX-family processor SDHCI peripherals
Nathan Barrett-Morrison [Wed, 26 Feb 2025 17:30:34 +0000 (12:30 -0500)]
mmc: Add support for ADI SC5XX-family processor SDHCI peripherals

Co-developed-by: Greg Malysa <malysagreg@gmail.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
3 months agospi: Add support for ADI SC5XX-family processor SPI peripherals
Nathan Barrett-Morrison [Wed, 26 Feb 2025 17:30:33 +0000 (12:30 -0500)]
spi: Add support for ADI SC5XX-family processor SPI peripherals

This adds support for the ADI-specific SPI driver present in the ADI
SC5xx line of SoCs. This IP block is distinct from the QSPI/OSPI block
that uses the Cadence driver. Both may be used at once with appropriate
pin muxing configuration.

Co-developed-by: Greg Malysa <malysagreg@gmail.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
Co-developed-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Co-developed-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
3 months agoremoteproc: Add in SHARC loading for ADI SC5XX-family processors
Nathan Barrett-Morrison [Wed, 26 Feb 2025 17:30:32 +0000 (12:30 -0500)]
remoteproc: Add in SHARC loading for ADI SC5XX-family processors

This adds the ability to load ldr-formatted files to the SHARC
coprocessors using the rproc interface. Only a minimal subset
of rproc functionality is supported: loading and starting
the remote core.

Secure boot and signed ldr verification are not available
at this time through the U-Boot interface.

Co-developed-by: Greg Malysa <malysagreg@gmail.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Co-developed-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
3 months agodma: Add driver for ADI SC5xx-family SoC MDMA functionality
Greg Malysa [Wed, 26 Feb 2025 17:30:31 +0000 (12:30 -0500)]
dma: Add driver for ADI SC5xx-family SoC MDMA functionality

Add a rudimentary MDMA driver for the Analog Devices SC5xx SoCs,
primarily intended for use with and tested against the QSPI/OSPI
IP included in the SoC.

Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Co-developed-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
3 months agowatchdog: Add support for ADI SC5XX-family watchdog peripheral
Nathan Barrett-Morrison [Wed, 26 Feb 2025 17:30:30 +0000 (12:30 -0500)]
watchdog: Add support for ADI SC5XX-family watchdog peripheral

Co-developed-by: Greg Malysa <malysagreg@gmail.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 months agonet: Add support for ADI SC5xx SoCs with DWC QoS ethernet
Greg Malysa [Wed, 26 Feb 2025 17:30:29 +0000 (12:30 -0500)]
net: Add support for ADI SC5xx SoCs with DWC QoS ethernet

The ADI SC598 includes a Designware QoS 5.20a IP block. This
commit adds support for using the existing ethernet QoS driver
with the SC598 SoC.

Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Co-developed-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
3 months agoi2c: Add support for ADI SC5XX-family I2C peripheral
Nathan Barrett-Morrison [Wed, 26 Feb 2025 17:30:28 +0000 (12:30 -0500)]
i2c: Add support for ADI SC5XX-family I2C peripheral

Co-developed-by: Greg Malysa <malysagreg@gmail.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Co-developed-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 months agousb: musb-new: Add support for Analog Devices SC5xx SoCs
Nathan Barrett-Morrison [Wed, 26 Feb 2025 17:30:27 +0000 (12:30 -0500)]
usb: musb-new: Add support for Analog Devices SC5xx SoCs

This adds support for the MUSB-based USB controller found in the
Analog Devices SC57x and SC58x SoCs.

Co-developed-by: Greg Malysa <malysagreg@gmail.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
3 months agogpio: Add support for ADI ADP5588 GPIO expander chips
Nathan Barrett-Morrison [Wed, 26 Feb 2025 17:30:26 +0000 (12:30 -0500)]
gpio: Add support for ADI ADP5588 GPIO expander chips

This adds support for the ADP588 GPIO expander from Analog Devices. It
is accessed over I2C and provides up to 18 pins. It is largely a port of
the Linux driver developed by Michael Hennerich
<michael.hennerich@analog.com>

Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
3 months agogpio: Add support for SC5XX-family processor GPIO driver
Greg Malysa [Wed, 26 Feb 2025 17:30:25 +0000 (12:30 -0500)]
gpio: Add support for SC5XX-family processor GPIO driver

This adds support for using the GPIO pins on the SC5XX family of SoCs
from Analog Devices.

Co-developed-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
3 months agodoc: Add dt-bindings and descriptions for ADI SC5xx-family pinctrl
Greg Malysa [Wed, 26 Feb 2025 17:30:24 +0000 (12:30 -0500)]
doc: Add dt-bindings and descriptions for ADI SC5xx-family pinctrl

This adds the necessary dt-bindings and documentation to use the ADI
SC5xx pinctrl driver in a device tree. It is not yet available upstream
in the Linux kernel. Eventually, it will be moved there.

Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
3 months agopinctrl: Add support for ADI SC5XX-family pinctrl
Greg Malysa [Wed, 26 Feb 2025 17:30:23 +0000 (12:30 -0500)]
pinctrl: Add support for ADI SC5XX-family pinctrl

This adds support for pin configuration on the Analog Devices SC5XX SoC
family. This commit is largely a port of the Linux driver, which has not
yet been submitted upstream.

Co-developed-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Co-developed-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Signed-off-by: Arturs Artamonovs <arturs.artamonovs@analog.com>
Signed-off-by: Oliver Gaskell <Oliver.Gaskell@analog.com>
Signed-off-by: Greg Malysa <malysagreg@gmail.com>
3 months agoMerge patch series "pci_auto: Downgrade prefetch if necessary"
Tom Rini [Wed, 12 Mar 2025 16:24:05 +0000 (10:24 -0600)]
Merge patch series "pci_auto: Downgrade prefetch if necessary"

This series from Patrick Rudolph <patrick.rudolph@9elements.com> fixes
an issue with how we treat PCIe vs PCI in some cases and fixes the
qemu-arm-sbsa reference platform support.

Link: https://lore.kernel.org/r/20250226135647.194842-1-patrick.rudolph@9elements.com
3 months agoemulation: qemu-sbsa: Enable PCI enumeration
Patrick Rudolph [Wed, 26 Feb 2025 13:56:44 +0000 (14:56 +0100)]
emulation: qemu-sbsa: Enable PCI enumeration

Enable PCI enumeration by default to get the Bochs display driver up
and running before the boot medium is scanned.
This is just to enhance the user-experience while booting the machine.

TEST: U-Boot logo, version, log output and the U-Boot shell is visible
      on the display device.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
3 months agoemulation: qemu-sbsa: Select SYS_PCI_64BIT
Patrick Rudolph [Wed, 26 Feb 2025 13:56:43 +0000 (14:56 +0100)]
emulation: qemu-sbsa: Select SYS_PCI_64BIT

qemu's sbsa-ref is always using a 64bit CPU and the PCI prefetch MMIO
window is located above 4GiB, thus always enable SYS_PCI_64BIT.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
3 months agopci_auto: Downgrade prefetch if necessary
Patrick Rudolph [Wed, 26 Feb 2025 13:56:42 +0000 (14:56 +0100)]
pci_auto: Downgrade prefetch if necessary

Legacy PCI devices, like qemu's Bochs VGA device, are allowed to have
prefetchable 32-bit BARs, while PCIe devices are not allowed to have
32-bit prefetchable BARs. Typically prefetchable BARs are 64-bit and
typically the prefetch MMIO window is also 64-bit and placed above
4GiB, as it's the case on qemu sbsa-ref.

Currently the U-Boot code assumes that prefetchable BARs are
64-bit BARs and always tries to assign them into the prefetch
MMIO window.

When a 32-bit BAR is marked as prefetch, but the prefetch area is
not within the first 4GiB of the address space, then downgrade the
BAR and place it in the non-prefetch MMIO window.

For prefetch BARs there's no downside on being placed in non prefetch
MMIO areas, besides the possible slower performance when a driver tries
to map it Write-Combine.

TEST: Fixes pci_auto on QEMU sbsa-ref fails to autoconfigure BAR0.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
3 months agoMerge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into...
Tom Rini [Wed, 12 Mar 2025 13:56:16 +0000 (07:56 -0600)]
Merge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next

3 months agoMerge branch 'graph' of https://source.denx.de/u-boot/custodians/u-boot-tegra into...
Tom Rini [Wed, 12 Mar 2025 13:55:47 +0000 (07:55 -0600)]
Merge branch 'graph' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next

3 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next
Tom Rini [Wed, 12 Mar 2025 01:05:03 +0000 (19:05 -0600)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

3 months agonet: ravb: Fix RX frame size limit
Paul Barker [Tue, 4 Mar 2025 20:07:08 +0000 (20:07 +0000)]
net: ravb: Fix RX frame size limit

The value written to the RFLR register includes the length of the CRC
data at the end of each Ethernet frame. So we need to increase the value
written to this register to ensure that we can receive full size frames.

While we're here we can also copy the improved comment from the Linux
kernel.

Fixes: 8ae51b6f324e ("net: ravb: Add Renesas Ethernet RAVB driver")
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Fix comment
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agonet: ravb: Add dependency on CONFIG_BITBANGMII
Paul Barker [Tue, 4 Mar 2025 20:07:07 +0000 (20:07 +0000)]
net: ravb: Add dependency on CONFIG_BITBANGMII

The Renesas RAVB driver always requires bitbang MDIO bus support.

Fixes: 8ae51b6f324e ("net: ravb: Add Renesas Ethernet RAVB driver")
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agoclk: rzg2l: Ignore disable for core clocks
Paul Barker [Tue, 4 Mar 2025 19:44:35 +0000 (19:44 +0000)]
clk: rzg2l: Ignore disable for core clocks

Following on from commit 9a699a0a0d62 ("clk: rzg2l: Ignore enable for
core clocks"), we also need to ignore attempts to disable core clocks to
avoid the need for conditionals around clk_disable_bulk() calls in
drivers which support both RZ/G2L and other Renesas SoCs.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agonet: miiphybb: Drop mdio_init()
Marek Vasut [Sun, 2 Mar 2025 01:24:52 +0000 (02:24 +0100)]
net: miiphybb: Drop mdio_init()

Inline mdio_init() back into mdio_alloc(), separate
access to mdio_init() is no longer necessary.

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_alloc()/bb_miiphy_free() and struct bb_miiphy_bus
Marek Vasut [Sun, 2 Mar 2025 01:24:51 +0000 (02:24 +0100)]
net: miiphybb: Drop bb_miiphy_alloc()/bb_miiphy_free() and struct bb_miiphy_bus

These functions are no longer necessary, remove them.
The struct bb_miiphy_bus is no longer necessary either,
remove it as well.

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: Switch back to mdio_alloc()
Marek Vasut [Sun, 2 Mar 2025 01:24:50 +0000 (02:24 +0100)]
arm: mvebu: a38x: Switch back to mdio_alloc()

Use mdio_alloc() again to allocate MDIO bus. This is possible
because all the miiphybb parameters and ops passing is handled in
at bb_miiphy_read()/bb_miiphy_write() level.

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: Switch back to mdio_alloc()
Marek Vasut [Sun, 2 Mar 2025 01:24:49 +0000 (02:24 +0100)]
net: sh_eth: Switch back to mdio_alloc()

Use mdio_alloc() again to allocate MDIO bus. This is possible
because all the miiphybb parameters and ops passing is handled in
at bb_miiphy_read()/bb_miiphy_write() level.

This also fixes previously missed bb_miiphy_free() in .remove
callback of this driver. which does not pose a problem anymore.

Fixes: 08eefb5e792d ("net: sh_eth: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: ravb: Switch back to mdio_alloc()
Marek Vasut [Sun, 2 Mar 2025 01:24:48 +0000 (02:24 +0100)]
net: ravb: Switch back to mdio_alloc()

Use mdio_alloc() again to allocate MDIO bus. This is possible
because all the miiphybb parameters and ops passing is handled in
at bb_miiphy_read()/bb_miiphy_write() level.

This also fixes previously missed bb_miiphy_free() in .remove
callback of this driver. which does not pose a problem anymore.

Fixes: 079eaca6e7b4 ("net: ravb: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: designware: Switch back to mdio_alloc()
Marek Vasut [Sun, 2 Mar 2025 01:24:47 +0000 (02:24 +0100)]
net: designware: Switch back to mdio_alloc()

Use mdio_alloc() again to allocate MDIO bus. This is possible
because all the miiphybb parameters and ops passing is handled in
at bb_miiphy_read()/bb_miiphy_write() level.

This also fixes previously missed bb_miiphy_free() in .remove
callback of this driver. which does not pose a problem anymore.

Fixes: cbb69c2fafcc ("net: designware: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks")
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 priv from struct bb_miiphy_bus
Marek Vasut [Sun, 2 Mar 2025 01:24:46 +0000 (02:24 +0100)]
net: miiphybb: Drop priv from struct bb_miiphy_bus

Remove the priv member from struct bb_miiphy_bus and its assignment
from drivers. This turns struct bb_miiphy_bus int struct mii_dev
wrapper, to be cleaned up next.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Pass struct mii_dev directly to bb_miiphy_read/write()
Marek Vasut [Sun, 2 Mar 2025 01:24:45 +0000 (02:24 +0100)]
net: miiphybb: Pass struct mii_dev directly to bb_miiphy_read/write()

Access to MDIO bus private data can be provided by both
struct mii_dev .priv member and struct bb_miiphy_bus .priv
member, use the former directly and remove .priv from the
later. Drop unused bb_miiphy_getbus(). This removes any
dependency on struct bb_miiphy_bus from the miiphybb code,
except for helper functions which will be removed later.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Pass struct bb_miiphy_bus_ops directly to bb_miiphy_read/write()
Marek Vasut [Sun, 2 Mar 2025 01:24:44 +0000 (02:24 +0100)]
net: miiphybb: Pass struct bb_miiphy_bus_ops directly to bb_miiphy_read/write()

The access to struct bb_miiphy_bus_ops via ops pointer in
struct bb_miiphy_bus is not necessary with wrappers added
in previous patch. Pass the ops pointer directly to both
bb_miiphy_read() and bb_miiphy_write() functions.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agonet: miiphybb: Wrap driver side bb_miiphy_read/write() accessors
Marek Vasut [Sun, 2 Mar 2025 01:24:43 +0000 (02:24 +0100)]
net: miiphybb: Wrap driver side bb_miiphy_read/write() accessors

Do not call bb_miiphy_read()/bb_miiphy_write() accessors directly
in drivers, instead call them through wrapper functions. Those are
meant to be used as function parameter adaptation layer between
struct mii_dev callback function parameters and what the miiphybb
does expect and will soon expect. This is a preparatory patch, 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: Split off struct bb_miiphy_bus_ops
Marek Vasut [Sun, 2 Mar 2025 01:24:42 +0000 (02:24 +0100)]
net: miiphybb: Split off struct bb_miiphy_bus_ops

Move miiphybb operations into separate struct bb_miiphy_bus_ops
structure, add pointer to struct bb_miiphy_bus_ops into the base
struct bb_miiphy_bus and access the ops through this pointer in
miiphybb generic code. The variable reshuffling in miiphybb.c
cannot be easily avoided.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agopinctrl: renesas: Drop special RZN1 entry from Makefile
Marek Vasut [Fri, 28 Feb 2025 12:02:52 +0000 (13:02 +0100)]
pinctrl: renesas: Drop special RZN1 entry from Makefile

The RZN1 symbol name is CONFIG_RZN1, there is no CONFIG_ARCH_RZN1.
Since RZN1 enables CONFIG_ARCH_RENESAS as well, remove the special
RZN1 entry from Makefile, the RZN1 pinctrl driver will still be
pulled in via CONFIG_ARCH_RENESAS.

Fixes: e4aea57fa773 ("pinctrl: renesas: add R906G032 driver")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agoARM: renesas: Enable USBHS UDC and UMS on Renesas R-Car Gen3 Salvator-X(S)
Marek Vasut [Sun, 9 Feb 2025 15:05:16 +0000 (16:05 +0100)]
ARM: renesas: Enable USBHS UDC and UMS on Renesas R-Car Gen3 Salvator-X(S)

The Renesas R-Car Gen3 Salvator-X(S) boards contain USB micro-B port
on which the USBHS controller is accessible. Enable the USBHS UDC
driver to make this port usable, enable UMS USB Mass Storage support
to make it possible to expose block devices as USB Mass Storage to
Host PC.

The USB VID/PID is picked from R-Car Series, 3rd Generation reference
manual Rev.2.00 chapter 19.2.8 USB download mode, and matches R-Car H3
BootROM USB download mode VID/PID.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agoconfigs: qc750: add 3 second delay before power off
Svyatoslav Ryhel [Tue, 11 Mar 2025 17:47:02 +0000 (19:47 +0200)]
configs: qc750: add 3 second delay before power off

Introduce a 3-second delay and an informational message during boot to
enhance user experience.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agoconfigs: x3_t30: add 3 second delay before power off
Svyatoslav Ryhel [Tue, 11 Mar 2025 17:39:55 +0000 (19:39 +0200)]
configs: x3_t30: add 3 second delay before power off

Introduce a 3-second delay and an informational message during boot to
enhance user experience.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agoconfigs: picasso: add 3 second delay before power off
Svyatoslav Ryhel [Tue, 11 Mar 2025 17:39:27 +0000 (19:39 +0200)]
configs: picasso: add 3 second delay before power off

Introduce a 3-second delay and an informational message during boot to
enhance user experience.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agoconfigs: grouper: add 3 second delay before power off
Svyatoslav Ryhel [Tue, 11 Mar 2025 17:38:17 +0000 (19:38 +0200)]
configs: grouper: add 3 second delay before power off

Introduce a 3-second delay and an informational message during boot to
enhance user experience.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agoconfigs: endeavoru: add 3 second delay before power off
Svyatoslav Ryhel [Tue, 11 Mar 2025 17:37:39 +0000 (19:37 +0200)]
configs: endeavoru: add 3 second delay before power off

Introduce a 3-second delay and an informational message during boot to
enhance user experience.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agoconfigs: transformer: add 3 second delay before power off
Svyatoslav Ryhel [Tue, 11 Mar 2025 17:37:08 +0000 (19:37 +0200)]
configs: transformer: add 3 second delay before power off

Introduce a 3-second delay and an informational message during boot to
enhance user experience.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agoARM: tegra20: mark second DC with bootph-all
Svyatoslav Ryhel [Wed, 5 Mar 2025 10:19:20 +0000 (12:19 +0200)]
ARM: tegra20: mark second DC with bootph-all

For the Tegra 2, similar to other Tegra SoC generations, 'bootph-all'
must be applied to both display controllers.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agoARM: tegra: clock: fix PLLD/PLLD2 related clock calculations
Jonas Schwöbel [Tue, 4 Mar 2025 07:02:11 +0000 (09:02 +0200)]
ARM: tegra: clock: fix PLLD/PLLD2 related clock calculations

While PLLD/D2 is the nominal parent clock, all derived clocks are generated
from its single output, plld_out0, which is PLLD/D2 divided by two. Direct
use of PLLD/D2 is absent in peripheral clock configurations. Therefore,
clock derivation formulas must take in account this division.

Signed-off-by: Jonas Schwöbel <jonasschwoebel@yahoo.de>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agocommon: edid: update timing selection logic
Jonas Schwöbel [Mon, 3 Mar 2025 11:31:07 +0000 (13:31 +0200)]
common: edid: update timing selection logic

Older EDID timing algorithms relied solely on detailed timings, typically
optimized for a display's native resolution. This caused issues with newer
4K panels on older hardware, which couldn't handle those high resolutions.
To address this, the algorithm now also considers standard timings, offering
lower, compatible resolutions. Future improvements may include checking
established timings for even broader compatibility.

Signed-off-by: Jonas Schwöbel <jonasschwoebel@yahoo.de>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agoboard: xiaomi: mocha: add Xiaomi Mi Pad A0101 support
Svyatoslav Ryhel [Sat, 16 Nov 2024 12:33:47 +0000 (14:33 +0200)]
board: xiaomi: mocha: add Xiaomi Mi Pad A0101 support

The Mi Pad is a tablet computer based on Nvidia Tegra K1 SoC which
originally ran the Android operating system. The Mi Pad has a 7.9" IPS
display with 1536 x 2048 (324 ppi) resolution. 2 GB of RAM and 16/64 GB of
internal memory that can be supplemented with a microSDXC card giving up to
128 GB of additional storage.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agoMerge tag 'net-next-20250310' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 11 Mar 2025 14:57:33 +0000 (08:57 -0600)]
Merge tag 'net-next-20250310' of https://source.denx.de/u-boot/custodians/u-boot-net into next

Pull request net-next-20250310.

CI:
* https://source.denx.de/u-boot/custodians/u-boot-net/-/pipelines/25084

net-lwip:
* Add support for CA (root) certificates to HTTPS
* Add CONFIG_LWIP_DEBUG_RXTX to trace in/out messages

3 months agoconfigs: qemu_arm64_lwip_defconfig: enable WGET_CACERT
Jerome Forissier [Wed, 5 Mar 2025 14:26:47 +0000 (15:26 +0100)]
configs: qemu_arm64_lwip_defconfig: enable WGET_CACERT

Enable the "wget cacert" command.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agodoc: cmd: wget: document cacert subcommand
Jerome Forissier [Wed, 5 Mar 2025 14:26:46 +0000 (15:26 +0100)]
doc: cmd: wget: document cacert subcommand

Document the 'wget cacert' subcommand which allows to configure root
(CA) certificates for HTTPS.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agonet: lwip: add support for built-in root certificates
Jerome Forissier [Wed, 5 Mar 2025 14:26:45 +0000 (15:26 +0100)]
net: lwip: add support for built-in root certificates

Introduce Kconfig symbols WGET_BUILTIN_CACERT and
WGET_BUILTIN_CACERT_PATH to provide root certificates at build time.

Usage example:

 wget -O cacert.crt https://cacerts.digicert.com/DigiCertTLSECCP384RootG5.crt
 make qemu_arm64_lwip_defconfig
 echo CONFIG_WGET_BUILTIN_CACERT=y >>.config
 echo CONFIG_WGET_BUILTIN_CACERT_PATH=cacert.crt >>.config
 make olddefconfig
 make -j$(nproc) CROSS_COMPILE="ccache aarch64-linux-gnu-"
 qemu-system-aarch64 -M virt -nographic -cpu max \
    -object rng-random,id=rng0,filename=/dev/urandom \
    -device virtio-rng-pci,rng=rng0 -bios u-boot.bin
 => dhcp
 # HTTPS transfer using the builtin CA certificates
 => wget https://digicert-tls-ecc-p384-root-g5.chain-demos.digicert.com/
 1867 bytes transferred in 1 ms (1.8 MiB/s)
 Bytes transferred = 1867 (74b hex)

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agolwip: tls: warn when no CA exists amd log certificate validation errors
Jerome Forissier [Wed, 5 Mar 2025 14:26:44 +0000 (15:26 +0100)]
lwip: tls: warn when no CA exists amd log certificate validation errors

Using HTTPS without root (CA) certificates is a security issue. Print a
warning in this case. Also, when certificate verification fail, print
an additional message because "HTTP client error 4" is not very
informative (4 is HTTPC_RESULT_ERR_CLOSED).

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agolwip: tls: enforce checking of server certificates based on CA availability
Jerome Forissier [Wed, 5 Mar 2025 14:26:43 +0000 (15:26 +0100)]
lwip: tls: enforce checking of server certificates based on CA availability

Instead of relying on some build time configuration to determine if
server certificates need to be checked against CA certificates, do it
based on the availability of such certificates. If no CA is configured
then no check can succeed; on the other hand if we have CA certs then
we should not ignore them. It is always possible to remove the CA certs
(via 'wget cacert 0 0') to force an HTTPS download that would fail
certificate validation.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agonet: lwip: extend wget to support CA (root) certificates
Jerome Forissier [Wed, 5 Mar 2025 14:26:42 +0000 (15:26 +0100)]
net: lwip: extend wget to support CA (root) certificates

Add the "cacert" (Certification Authority certificates) subcommand to
wget to pass root certificates to the code handling the HTTPS protocol.
The subcommand is enabled by the WGET_CACERT Kconfig symbol.

Usage example:

 => dhcp
 # Download some root certificates (note: not authenticated!)
 => wget https://cacerts.digicert.com/DigiCertTLSECCP384RootG5.crt
 # Provide root certificates
 => wget cacert $fileaddr $filesize
 # Enforce verification (it is optional by default)
 => wget cacert required
 # Forget the root certificates
 => wget cacert 0 0
 # Disable verification
 => wget cacert none

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agonet: lwip: add CONFIG_LWIP_DEBUG_RXTX
Jerome Forissier [Thu, 6 Mar 2025 14:32:22 +0000 (15:32 +0100)]
net: lwip: add CONFIG_LWIP_DEBUG_RXTX

Add Kconfig symbol LWIP_DEBUG_RXTX to dump the incoming and outgoing
packets when NET_LWIP=y.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agonet: lwip: rename linkoutput() as net_lwip_tx()
Jerome Forissier [Thu, 6 Mar 2025 14:32:21 +0000 (15:32 +0100)]
net: lwip: rename linkoutput() as net_lwip_tx()

Rename static function linkoutput() as net_lwip_tx() for consistency
with net_lwip_rx().

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agoMerge tag 'v2025.04-rc4' into next
Tom Rini [Tue, 11 Mar 2025 00:12:27 +0000 (18:12 -0600)]
Merge tag 'v2025.04-rc4' into next

This uses Heinrich's merge of lib/efi_loader/efi_net.c which results in
no changes.

3 months agoPrepare v2025.04-rc4 v2025.04-rc4
Tom Rini [Mon, 10 Mar 2025 23:31:52 +0000 (17:31 -0600)]
Prepare v2025.04-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 10 Mar 2025 23:30:32 +0000 (17:30 -0600)]
configs: Resync with savedefconfig

Resync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agoMerge tag 'u-boot-dfu-next-20250310' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 10 Mar 2025 16:13:03 +0000 (10:13 -0600)]
Merge tag 'u-boot-dfu-next-20250310' of https://source.denx.de/u-boot/custodians/u-boot-dfu into next

u-boot-dfu-next-20250310

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

Usb gadget:
- Remove legacy CONFIG_USB_DEVICE
- Remove legacy usbtty driver

3 months agoenv: Provide a work-around for unquoting fdtfile
Simon Glass [Wed, 13 Nov 2024 15:09:37 +0000 (08:09 -0700)]
env: Provide a work-around for unquoting fdtfile

Some boards use a CONFIG option to specify the value of this variable.
This is normally handled by efi_get_distro_fdt_name() but in the case
of sunxi this does not work, since 'soc' is sunxi, but the files are
in the allwinner directory.

Provide a work-around for this particular case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 months agoMerge tag 'efi-next-20250310' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 10 Mar 2025 13:49:17 +0000 (07:49 -0600)]
Merge tag 'efi-next-20250310' of https://source.denx.de/u-boot/custodians/u-boot-efi into next

Pull request efi-next-20250310

CI:

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

UEFI:

* Clean up usage of structure jmp_buf_data
* Refactor EFI network protocol implementation for future support
  of multiple network interfaces.
  - efi_net: let efi_net_set_dp properly update the device path
  - expose symbols to be used by the EFI network stack
  - efi_setup: Add efi_start_obj_list() to efi_setup.c
  - efi_net: Add efi_net_do_start() to efi_net.c
  - efi_device_path: Pass net udevice as argument
  - efi_net: Add device path cache
  - efi_net: Add dhcp cache
  - efi_net: Add support for multiple efi_net_obj

Others:

* legacy-net: wget: fix wget_info handling after new tcp legacy stack
* lib: correct description of CONFIG_SYS_FDT_PAD
* Separate setjmp.h into architecture dependent and independent parts
  - sandbox: remove linux/types.h dependency in setjmp.h
  - arm: include asm-generic/int-ll64.h in setjmp.h
  - common: clean up setjmp.h
* arm: use type jmp_buf instead of struct jmp_buf_data

3 months agoMerge tag 'u-boot-stm32-20250310' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Mon, 10 Mar 2025 13:48:25 +0000 (07:48 -0600)]
Merge tag 'u-boot-stm32-20250310' of https://source.denx.de/u-boot/custodians/u-boot-stm

ARM: stm32mp: Fix boot hang on STM32MP15xx with 1 GiB of DRAM.

3 months agoARM: stm32mp: Fix dram_bank_mmu_setup() for ram_top=0
Marek Vasut [Sun, 9 Mar 2025 02:05:54 +0000 (03:05 +0100)]
ARM: stm32mp: Fix dram_bank_mmu_setup() for ram_top=0

On STM32MP15xx with 1 GiB of DRAM, the gd->ram_top becomes 0,
because DRAM base 0xc0000000 + DRAM size 0x40000000 leads to
gd->ram_top overflow which resets it to 0. Handle this special
case simply by checking for gd->ram_top being zero, and if it
is, assume there is no addr >= gd->ram_top .

This fixes boot hang on STM32MP15xx with 1 GiB of DRAM.

Fixes: 25fb58e88aba ("ARM: stm32mp: Fix dram_bank_mmu_setup() for LMB located above ram_top")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 months agousb: gadget: Remove the legacy usbtty driver
Tom Rini [Thu, 27 Feb 2025 20:51:01 +0000 (14:51 -0600)]
usb: gadget: Remove the legacy usbtty driver

The lone user of this driver has been removed for some time. Remove this
driver as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250227205101.4127604-2-trini@konsulko.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
3 months agousb: gadget: Remove final remnants of CONFIG_USB_DEVICE
Tom Rini [Thu, 27 Feb 2025 20:51:00 +0000 (14:51 -0600)]
usb: gadget: Remove final remnants of CONFIG_USB_DEVICE

The lone user of the legacy USB device framework have been removed for
some time. Remove the final parts of the code that were missed.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250227205101.4127604-1-trini@konsulko.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
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 agotest: dm: add video bridge tests
Svyatoslav Ryhel [Sun, 16 Feb 2025 17:09:31 +0000 (19:09 +0200)]
test: dm: add video bridge tests

Add tests for video bridge ops.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agovideo: bridge: add transparent LVDS de/encoder bridge
Svyatoslav Ryhel [Sun, 16 Feb 2025 16:04:54 +0000 (18:04 +0200)]
video: bridge: add transparent LVDS de/encoder bridge

Add a simple and transparent LVDS de/encoder driver with a powerdown
gpio and a power supply.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agovideo: bridge-uclass: add inline fallbacks of video bridge functions
Svyatoslav Ryhel [Fri, 21 Feb 2025 11:09:30 +0000 (13:09 +0200)]
video: bridge-uclass: add inline fallbacks of video bridge functions

Hide video bridge functions behind config condition and add inline
fallbacks to avoid erroring out when using header without config
enabled.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agovideo: bridge-uclass: add get_display_timing ops
Svyatoslav Ryhel [Fri, 14 Feb 2025 08:57:05 +0000 (10:57 +0200)]
video: bridge-uclass: add get_display_timing ops

Add get_display_timing ops for internal bridges linked to
panels that do not support EDID (MIPI-DSI panels for example)
or have EDID not routed.

Tested-by: Dang Huynh <danct12@riseup.net> (PineTab 2)
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 months agotest: dm: add ofnode_graph tests
Svyatoslav Ryhel [Sun, 16 Feb 2025 11:14:40 +0000 (13:14 +0200)]
test: dm: add ofnode_graph tests

Test suit for of_graph parsing helpers.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agocore: ofnode: add of_graph parsing helpers
Svyatoslav Ryhel [Sat, 15 Feb 2025 17:46:29 +0000 (19:46 +0200)]
core: ofnode: add of_graph parsing helpers

Add a mostly complete list of ofnode analogs of of_graph
parsing helpers.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
3 months agosandbox: remap memory load addresses
Svyatoslav Ryhel [Fri, 7 Mar 2025 08:59:57 +0000 (10:59 +0200)]
sandbox: remap memory load addresses

The existing memory layout places the bloblist at 0xb000 and the fdt at
0x100, resulting in a 0xaf00 size constraint for the fdt. This constraint
has been reached. Lets modify the layout by moving the bloblist to 0x100,
device tree to 0x1000 and placing early memory allocation after pre-console
buffer at 0xf4000. This should guarantee sufficient memory allocation for
future expansion.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.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 agoscripts/checkpatch.pl: Upgrade IS_ENABLED_CONFIG to error for U-Boot
Tom Rini [Wed, 26 Feb 2025 15:33:45 +0000 (09:33 -0600)]
scripts/checkpatch.pl: Upgrade IS_ENABLED_CONFIG to error for U-Boot

A problem we have today is that some instances of IS_ENABLED(FOO) have
crept in to the code. This is in turn because with checkpatch.pl this is
only a warning and not an error, so they were overlooked. And looking
deeper, in the Linux kernel this pattern is allowed because
IS_ENABLED(DEFINED_FLAG) is allowed if discouraged and a quick skim of
the instances I saw in the current kernel follow this pattern. In U-Boot
however, this is not allowed, so bump to an error.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agofs/squashfs: Fix memory leak in sqfs_size_nest()
Andrea della Porta [Sun, 2 Mar 2025 18:29:31 +0000 (19:29 +0100)]
fs/squashfs: Fix memory leak in sqfs_size_nest()

In case MAX_SYMLINK_NEST is reached while determining the size
on a symlink node, the function returns immediately.
This would not free the resources after the free_strings: label
causing a memory leak.

Set the ret value and just break out of the switch to fix this.

Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>