102206 Commits

Author SHA1 Message Date
Daniel Golle
d488490abd mtd: spinand: set bitflip_threshold to 75% of ECC strength
Reporting an unclean read from SPI-NAND only when the maximum number
of correctable bitflip errors has been hit seems a bit late.
UBI LEB scrubbing, which depends on the lower MTD device reporting
correctable bitflips, then only kicks in when it's almost too late.

Set bitflip_threshold to 75% of the ECC strength, which is also the
default for raw NAND.

This is a port of linux commit
1824520e7477 (mtd: spinand: set bitflip_threshold to 75% of ECC strength)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/2117e387260b0a96f95b8e1652ff79e0e2d71d53.1723427450.git.daniel@makrotopia.org
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> # U-Boot port
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:26:06 +02:00
Mikhail Kshevetskiy
2a0f8e7da0 mtd: spinand: Sync core code and device support with Linux 6.10
This makes the U-Boot SPI NAND driver almost the same as in Linux 6.10.
The only major difference is support of ECC engines. The Linux driver
supports different ECC engines while U-Boot uses on-die ECC only.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:26:03 +02:00
Mikhail Kshevetskiy
e644bb73da mtd: spinand: Refactor ECC/OOB functions
changes:
 * Move spinand_check_ecc_status(), spinand_noecc_ooblayout_ecc(),
   spinand_noecc_ooblayout_free() and spinand_noecc_ooblayout close
   to each other.
 * some code formatting
 * remove comments not present in linux driver

This aligns the code with Linux 6.10.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:26:00 +02:00
Mikhail Kshevetskiy
a3770a6325 mtd: spinand: Refactor spinand_init* functions
No functional changes, just some refactoring to better match linux
kernel driver.

changes:
 * move spinand configuration reading out from spinand_init_cfg_cache()
   to separate function spinand_read_cfg()
 * move spinand flash initialization to separate function
   spinand_init_flash()
 * move direct mapping initialization to the end of spinand_init()

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:25:58 +02:00
Mikhail Kshevetskiy
4254ed38ec mtd: spinand: Align logic for enabling ECC to match Linux kernel
This aligns the logic to match the Linux kernel implementation.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:25:56 +02:00
Mikhail Kshevetskiy
5faba88f98 mtd: spinand: Make use of spinand_to_[mtd/nand]() helpers
Use spinand_to_nand() and spinand_to_mtd() helpers instead of
nanddev_to_mtd() and direct access to spinand structure fields.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:25:54 +02:00
Mikhail Kshevetskiy
64b7865c72 mtd: spinand: Extend spinand_wait() to match Linux kernel implementation
This aligns spinand_wait() with the linux kernel. Instead of calling into
spi_mem_poll_status() which is not implemented in U-Boot, we code the
polling logic and make sure that schedule() is called periodically.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:25:51 +02:00
Alexander Lobakin
bae27e402d mtd: spinand: core: add missing MODULE_DEVICE_TABLE()
The module misses MODULE_DEVICE_TABLE() for both SPI and OF ID tables
and thus never autoloads on ID matches.
Add the missing declarations.
Present since day-0 of spinand framework introduction.

This is a port of linux commit
25fefc88c71f ("mtd: spinand: core: add missing MODULE_DEVICE_TABLE()")

Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210323173714.317884-1-alobakin@pm.me
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> # U-Boot port
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:25:49 +02:00
Miquel Raynal
9ce01e0ada mtd: nand: Add a NAND page I/O request type
Use an enum to differentiate the type of I/O (reading or writing a
page). Also update the request iterator.

This is a port of linux commit
701981cab016 ("mtd: nand: Add a NAND page I/O request type")

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200827085208.16276-5-miquel.raynal@bootlin.com
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> # U-Boot port
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:25:47 +02:00
Mikhail Kshevetskiy
aecd0bd412 mtd: spinand: Use the spi-mem dirmap API
Make use of the spi-mem direct mapping API to let advanced controllers
optimize read/write operations when they support direct mapping.

Based on a linux commit 981d1aa0697c ("mtd: spinand: Use the spi-mem dirmap API")
created by Boris Brezillon <bbrezillon@kernel.org> with additional
fixes taken from Linux 6.10.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:25:44 +02:00
Mikhail Kshevetskiy
ce6a23e7e8 spi: spi-mem: Extend SPI MEM ops to match Linux 6.16
This pulls in multiple changes from the Linux kernel in order to keep
the code in sync. This also fixes octal mode support.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05 20:25:37 +02:00
Tom Rini
4e4a9de31d Merge branch 'next' of git://source.denx.de/u-boot-usb into next
- Make the i2c-bus property for an onboard USB hub optional
2025-10-05 09:50:57 -06:00
Michal Simek
f4dd112a38 usb: onboard-hub: Make i2c-bus optional
DT binding doesn't mandate i2c-bus as required property because hub itself
doesn't need to have i2c connected.
It can be in standalone mode that only power regulator and reset should be
handled.
Or hub should be configured via spi interface.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
2025-10-05 06:11:44 +02:00
Tom Rini
dc6c80056e global: Add expected space between '#include' and directive
These files had '#include<file.h>' rather than '#include <file.h>' which
while functional is not the correct style.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-10-04 13:31:01 -06:00
Yegor Yefremov
c23688d053 clk: ti: fix K3 clock driver help texts
Add "in SPL" to the SPL related driver help texts.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-10-04 12:51:01 -06:00
Thomas Bonnefille
3bbaa9dca6 env: fix typo in multiple Kconfig descriptions
%s/environemt/environment

Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
2025-10-04 12:15:57 -06:00
Tom Rini
eede1fccec Merge patch series "Drop ATAGS for B&R boards"
Wolfgang Wallner <wolfgang.wallner@br-automation.com> says:

There was recently a discussion on which boards need ATAGS support.
The B&R boards which have this support enabled actualyl don't need it.
This patch series drops the settings from the relevant defconfigs.

Link: https://lore.kernel.org/r/20250919134308.122437-1-wolfgang.wallner@br-automation.com
2025-10-03 16:55:44 -06:00
Tom Rini
601cebc29d cmd: spl: Remove ATAG support from this command
While we continue to have some systems which support extremely legacy
OS booting methods, we do not have use cases for supporting this in
Falcon mode anymore. Remove this support and references from the
documentation.

Co-developed-by: Anshul Dalal <anshuld@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-10-03 16:55:44 -06:00
Marek Vasut
70ae44f371 linux/kernel.h: Update upper_NN_bits() and lower_NN_bits() macros
Synchronize upper_NN_bits() and lower_NN_bits() macros with Linux 6.16
commit 118d777c4cb4 ("wordpart.h: Add REPEAT_BYTE_U32()"). This fixes the
lower_32_bits() macros and assures it works with 64bit systems correctly.
This also adds 16bit variants of these macros, which will be used by the
Airoha PHY driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-10-03 16:55:18 -06:00
Wolfgang Wallner
de8f386810 configs: brcp170: Drop CONFIG_SUPPORT_PASSING_ATAGS
CONFIG_SUPPORT_PASSING_ATAGS is not needed for this board.

Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2025-10-03 15:19:08 -06:00
Wolfgang Wallner
92c2effbbf configs: brcp150: Drop CONFIG_SUPPORT_PASSING_ATAGS
CONFIG_SUPPORT_PASSING_ATAGS is not needed for this board.

Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2025-10-03 15:19:07 -06:00
Wolfgang Wallner
5c9dffa405 configs: brcp1: Drop CONFIG_SUPPORT_PASSING_ATAGS
CONFIG_SUPPORT_PASSING_ATAGS is not needed for these boards.

Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2025-10-03 15:19:07 -06:00
Anshul Dalal
8fd3768ca1 arm: armv8: remove redundant definition of mmu_status
mmu_status is used in io memcpy functions to prevent accesses to non
8-byte aligned addresses when the mmu is disabled. Though there is a
redundant definition enabled when icaches is turned off by setting
SYS_ICACHE_OFF.

This patch removes the redundant definition, allowing mmu_status to
properly report the status regardless of config settings. This shouldn't
be a problem since access to non 8-byte aligned data can be done
irrespective of icache state.

Fixes: 268f6ac1f95c ("arm64: Update memcpy_{from, to}io() helpers")

Signed-off-by: Anshul Dalal <anshuld@ti.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-10-03 15:13:58 -06:00
Sam Protsenko
072264c4b3 Revert "fdt: Make sure there is no stale initrd left"
This reverts commit 9fe2e4b46458f9c4ec6b8115ebf18b4b26fe6127.

Commit 9fe2e4b46458 ("fdt: Make sure there is no stale initrd left")
introduces a regression in case when U-Boot transfers control to an EFI
app which acts as a subsequent bootloading program. Such an app might
try to set "linux,initrd-start" and "linux,initrd-end" fdt properties,
but by that time those properties are already removed by the code added
in the mentioned commit.

Particularly, the issue was observed on the E850-96 board where GBL EFI
app [1] can't run Android successfully anymore. More specifically, the
kernel can't see the ramdisk and panics with next messages:

    /dev/root: Can't open blockdev
    VFS: Cannot open root device "" or unknown-block(0,0): error -6
    Please append a correct "root=" boot option; ...
    Kernel panic - not syncing: VFS: Unable to mount root fs on
    unknown-block(0,0)

fdt_initrd() function (where initrd dts properties are removed) is
called two times:

1. First it's called by EFI boot manager (e.g. as a part of U-Boot
Standard Boot mechanism) when it's installing FDT:

    fdt_initrd
    image_setup_libfdt
    efi_install_fdt
    efi_bootmgr_run
    efi_mgr_boot

It's already enough for EFI app to malfunction. But then it's also
called second time:

2. From the EFI app, via EFI DT fixup protocol:

    fdt_initrd
    image_setup_libfdt
    efi_dt_fixup
    struct efi_dt_fixup_protocol efi_dt_fixup_prot = {
        .fixup = efi_dt_fixup
    };

See [2] for specific GBL code which sets those fdt properties and then
runs DT fixup protocol callback.

This issue was discussed [3], but no action was taken since then. Revert
this patch for now, until a proper solution can be found.

[1] https://source.android.com/docs/core/architecture/bootloader/generic-bootloader/gbl-dev
[2] https://android.googlesource.com/platform/bootable/libbootloader/+/refs/heads/gbl-mainline/gbl/libgbl/src/android_boot/mod.rs#208
[3] https://lists.denx.de/pipermail/u-boot/2025-July/593879.html

Fixes: 9fe2e4b46458 ("fdt: Make sure there is no stale initrd left")
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2025-10-03 07:45:20 -06:00
Tom Rini
5a3c306aaf Pull request doc-202510-rc6
* Update coding style to recommend b4 for patch submission
 * pytest: Fix inline code and other formatting
 * develop: fix grammar and syntax
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmjfS60ACgkQxIHbvCwF
 GsRRQQ//Q9FGkshCwucASSzB3nnHZzw/aOT+q1Ido5JKj5wmh+roM9l/YG6xhsjB
 03zKac9yWonpKWE8bJtUGGCJ3l1DJdN7mqPKpddelRA5bIshHrJEMoA43jKgEnQG
 Tbqyj3o15b1bB/5lI88hArSZCGSOd6ejpdOOYWMv6VWQNIzxLeyEaLoJTJZOg2R6
 Frgg1MZIC2Oyj7PFuQhVO3JXDzeYKW2kPSvF3FroZfOK6QTVy1E78ii0GX0ZvxjO
 uud7gFnuvRh5yKo9EArLvPfp84rAIffFHXcWRxvEDK5LOlCC7sHibvEGjGmR21Wc
 LhPDeY7AVaBLilDu1yesBWd3q0hVmE2yMmw+uOmPuVvi/Tza2weVbGaW+A6QSf7o
 6TAfHbSQTpWgTxRvjMpls8KII0rqVVrdGn0tVc0qPLIYlYoDXDrvi6w4PEVrN5s7
 nXtuBBUyBN8fR7BBMBcV1bMQcI16B8c+j8zbbciG9KqKEtIvDBTVqZKKb42PpG1F
 mM/7IMevkH1/3uQd+KceQ5AZ7F5nu17k1Kd8idwm8qWBj1W+B7n00Sw0iqgDDDUw
 gzKEj4RRUMsAIF4n4++JKmtlakFKqzoD5+GSRSSzIHXFA0QgdpmpaImgDpmVFt+m
 19lOsAFJY9nVRFOlqx7oxc9p8VllDbvQsTX0QPlDCAAsVbMK2A4=
 =k7xB
 -----END PGP SIGNATURE-----

Merge tag 'doc-202510-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request doc-202510-rc6

CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/27807

* Update coding style to recommend b4 for patch submission
* pytest: Fix inline code and other formatting
* develop: fix grammar and syntax
2025-10-03 07:43:36 -06:00
Martin Schwan
a8d451aa14 doc: pytest: Fix inline code and other formatting
Mainly fix inline code and some other formatting mistakes. Inline code
uses double backticks `` in reStructuredText instead of single backticks
as in Markdown.

Also fix some smaller formatting issues, such as excess colons before
literal blocks.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
2025-10-03 06:01:33 +02:00
Javier Tia
5a21f5b4c9 doc: Update coding style to recommend b4 for patch submission
Replace references to patman with b4 as the recommended tool for
preparing and sending patches. b4 is widely adopted in the Linux kernel
community and U-Boot ships with configuration to simplify its use with
the project mailing list.

The updated guidelines describe how to prepare series with b4, handle
cover letters and recipient lists, run style checks, and send patches
safely. Instructions also highlight how to collect and apply review tags
before resending.

This change documents the preferred workflow for contributors and
ensures consistency with common practices across related upstream
communities.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Signed-off-by: Javier Tia <javier.tia@linaro.org>
2025-10-03 05:59:34 +02:00
Yegor Yefremov
eb5014841c doc: develop: fix grammar and syntax
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-10-03 05:58:45 +02:00
Michal Simek
e589d5822c env: spi: Fix gd->env_valid for the first write
When both SPI environment locations are invalid (gd->env_valid ==
ENV_INVALID), the first call to saveenv writes to the primary location and
sets the active flag. However, the logic for updating gd->env_valid
incorrectly sets it to ENV_REDUND, which does not match the actual location
written. This causes the first two writes to target the same location, and
alternation only begins after the second write.

Update the logic to alternate gd->env_valid based on whether the last write
was to the primary or redundant location, ensuring the first write sets
ENV_VALID and subsequent writes alternate as expected. This aligns
env_valid with the actual storage location and fixes the alternation
sequence from the first write.

With this change, the "Valid environment" printout correctly reflects the
active location after each save, and the alternation between primary and
redundant locations works as intended from the start.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
Acked-by: E Shattow <e@freeshell.de>
2025-10-02 11:32:34 -06:00
Andrew Goodbody
72f72fab00 b4-config: Improve b4 config for correct operation
The recent change to .b4-config resulted in some expected recipients not
being added to the address lists. Rework the commands so that all
expected recipients are added while maintaining the ordering from the
first change.

Fixes: 26efc940c86 ("b4-config: configure `b4` for U-Boot")

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-10-02 11:30:15 -06:00
Tom Rini
a14253b15c u-boot-dfu-next-20251001
Fastboot:
 - Fix has-slot command when using nand back-end.
 
 USB gadget:
 - Add missing null checks to atmel, dwc2 drivers (smatch)
 - Remove redundant check in dwc3 gadget (smatch)
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEELulCp7Yfar5TE60AGQ0dtGZOGTUFAmjdKNUACgkQGQ0dtGZO
 GTU1VwgAo5YVdV4jATGOVgzZPD7pxEqokNVRBtTHymcqykhYd0YhvN/+V893fWIM
 wcKkCEc2VMMtzhvfoPnLafzZ0U0aMdRMQ/FsMqTCzan2KAnDNdC2RGUh+MSx74Cx
 iQYzQmYqMuugfCqq8706ANeUt2+o3dbjMy035ib3nLHTRnARix2ush38HJHm9Ygy
 ZJ/SmSZgmw4bgLRTWWWSp48OiBCod3F1inTjeWyzJD+l3k7uOFe9hBGY4p7C5yyE
 cw/DuAPwu+3sFMofqNZUuqg+BHcLX86B/s1B2o8De+3MTTE3zmTTsxYO/+lL1RBA
 NPY4Z4EArhmmNqMEI+XIQWp2bOPJ4w==
 =szfp
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-dfu-next-20251001' of https://source.denx.de/u-boot/custodians/u-boot-dfu into next

u-boot-dfu-next-20251001

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

Fastboot:
- Fix has-slot command when using nand back-end.

USB gadget:
- Add missing null checks to atmel, dwc2 drivers (smatch)
- Remove redundant check in dwc3 gadget (smatch)
2025-10-02 11:20:01 -06:00
Tom Rini
aff68c8514 Merge tag 'u-boot-socfpga-next-20250930' of https://source.denx.de/u-boot/custodians/u-boot-socfpga into next
SoCFPGA updates for v2025.10:

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

This pull request brings a set of updates across SoCFPGA platforms
covering Agilex5, Agilex7, N5X, and Stratix10. The changes include:

* Agilex5 enhancements:
  - USB3.1 enablement and DWC3 host driver support
  - System Manager register configuration for USB3
  - Watchdog timeout increase and SDMMC clock API integration
  - dcache handling improvements in SMC mailbox path
  - Enable SPL_SYS_DCACHE_OFF in defconfig

* Clock driver improvements:
  - Introduce dt-bindings header for Agilex clocks
  - Add enable/disable API and EMAC clock selection fixes
  - Replace manual shifts with FIELD_GET usage

* DDR updates:
  - IOSSM mailbox compatibility check
  - Correct DDR calibration status handling

* Device tree changes:
  - Agilex5: disable cache allocation for reads
  - Stratix10: add NAND IP node
  - Enable driver model watchdog
  - Enable USB3.1 node for Agilex5

* Config cleanups:
  - Simplify Agilex7 VAB defconfig
  - Remove obsolete SYS_BOOTM_LEN from N5X VAB config
  - Enable CRC32 support for SoCFPGA
  - Increase USB hub debounce timeout

Overall this set improves reliability of DDR and cache flows,
adds missing USB and MMC features for Agilex5, and refines clock
and configuration handling across platforms.

This patch set has been tested on Agilex 5 devkit, and Agilex devkit.
2025-09-30 16:11:23 -06:00
Tom Rini
667b9ef5b0 - set reversed bit when using internal phy on GXL SoCs
- support gpio toggle command for amlogic gpio
 - fix saradc
 - remove unreachable in meson clk driver
 - Stop premature exit from for loop in meson pwm driver
 - fix JetHub D1 eth mac fallback generation
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmjcIuoACgkQd9zb2sjI
 SdHQgRAApKIBtM19N8J/lYz9NSin6hXX0S9FqoU5Ovi5UIEUun3XS5CF8kBBgXWI
 9gyxL27dtkE30T2iP35+PLLI2CpnjipRV0iX2o4/W3dgYN4w/oI4lCukxWU9yRnR
 vdgXkhNO0Gsn6gOlij+aYAqV4deT8N1Gncr78+52WE8KlMTJW0xa2RQMv3vZ+WTl
 98XINziF5adF05LEoQFq0f+7h7GIj1o68PzdFmb/iA7/x5dMCj1sL6PjPFVWhHDx
 Q70kTHi1w2cFDMMLbqncZaF8yb+86PUPdVx3J7H3nEWNqZPiAv3PvPx7VeCdB3LJ
 QUBOOfExKBTLJCiPpa7dSkWV7t5CHOeJCLxHeWDayEuwuIEqbCkYnGyglyViTaUP
 r7hu5L9zQ8XaT046ffBbuYtOT+lBp24wrnUB62pMU80UqeTSyx2tnJ+wE1e3J/nn
 2zCW1lJnO+TokZUdNObheZ2cUQoZKjRyOZrmCRtC0mdT9CKuRFzpSmZMcMHhgHUr
 CPQF/wUkWhM997BTs/jmI8EXYRH+MXTn6FNOkS8TJ7OrXLmu7OEweevXlDuJ/rQC
 FEa6vl3IxMzFBBxtVDi/UPsGGPo69MYsocSsHE8HKEaLsmAn7Xwp7JBO5basjWe9
 hOSWnn82gflJnC9LPS1yMk/IhQ+n+a8UtMumWiaRnlROh/wsjNo=
 =IyAF
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-amlogic-next-20250930' of https://source.denx.de/u-boot/custodians/u-boot-amlogic into next

- set reversed bit when using internal phy on GXL SoCs
- support gpio toggle command for amlogic gpio
- fix saradc
- remove unreachable in meson clk driver
- Stop premature exit from for loop in meson pwm driver
- fix JetHub D1 eth mac fallback generation
2025-09-30 16:01:05 -06:00
Viacheslav Bocharov
d521fa32cc ARM: amlogic: fix JetHub D1 eth mac fallback generation
JetHome has allocated a special range for MAC fallback on JetHub D1/D1+
devices.

Signed-off-by: Viacheslav Bocharov <adeep@lexina.in>
Link: https://lore.kernel.org/r/20250903110726.546083-1-adeep@lexina.in
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-09-30 20:32:15 +02:00
Andrew Goodbody
b1e2cbd65c pwm: meson: Stop premature exit from for loop
In meson_pwm_probe the for loop attempts to get the name of a clock but
the following if..else statements only perform useful work if -ENODATA
is returned from clk_get_by_name. If clk_get_by_name simply succeeds
then this results in a premature exit from the for loop and the
following code can never be reached. Make the else clause only apply for
an error return from clk_get_by_name.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250808-pwm_meson-v1-1-cddb7e5f76bd@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-09-30 20:32:15 +02:00
Andrew Goodbody
bb2d7ea6f2 clk: meson: Remove unreachable code
A second return following the first return is unreachable code so remove
it.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250723-clk_meson-v1-1-8cd6e73145a4@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-09-30 20:32:15 +02:00
Andrew Goodbody
b332723882 adc: meson-saradc: uint cannot be less than zero
timeout is declared as a uint but then tested for being less than zero
which must always fail. Change the while loop for a pre-decrement on
timeout and test timeout for being zero.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250722-meson_saradc-v1-1-1ab45d53da9d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-09-30 20:32:15 +02:00
Yang Xiwen
033dbc7f9e pinctrl: meson: support gpio toggle command
meson_gpio_get() always assumes gpio is configured to input mode. This
is incorrect and breaks `gpio toggle` command:

gpio: pin aobus-banks2 (gpio 2) value is 0
   Warning: value of pin is still 1

Fix it by adding the logic to handle both input and output mode.

Fixes: 2009a8d03fe5 ("pinctrl: meson: add GPIO support")
Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250617-meson_ppinctrl-v3-1-218d9321a8d2@outlook.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-09-30 20:32:15 +02:00
Neil Armstrong
1a367adfd6 net: mdio: mux-meson-gxl: set reversed bit when using internal phy
This bit is necessary to receive packets from the internal PHY.
Without this bit set, no activity occurs on the interface.

Normally u-boot sets this bit, but if u-boot is compiled without
net support, the interface will be up but without any activity.

The vendor SDK sets this bit along with the PHY_ID bits.

Ported from the Linux change at [1] from Da Xu merged in
commit [2].

[1] https://lore.kernel.org/all/20250425192009.1439508-1-da@libre.computer/
[2] b23285e93bef ("net: mdio: mux-meson-gxl: set reversed bit when using internal phy")

Suggested-by: Da Xue <da@libre.computer>
Link: https://lore.kernel.org/r/20250502-u-boot-topic-mdio-mux-gxl-bit28-v1-1-399f6c3db154@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-09-30 20:32:15 +02:00
Tom Rini
5b93c3ec7f stm32mp1: Fix env_get_location()
stm32mp2: Update register used by BL31 for boot parameter
 -----BEGIN PGP SIGNATURE-----
 
 iQJQBAABCgA6FiEEXyrViUccKBz9c35Jysd4L3sz/6YFAmjb+YQcHHBhdHJpY2Uu
 Y2hvdGFyZEBmb3NzLnN0LmNvbQAKCRDKx3gvezP/pvRLEAChov+7C95883Wf5udm
 tkMosqA4J/7Md8GRru2GVye19lOu9DQUtjo9vDDId179fddBLtZv4aOxPkLO9PNr
 7BaNmNFzgMo0SdQjjnuLsRLCDEm88YL97XXAbJAThJAL3pGudq56GzJgUxn9vG7b
 +vS3mkTgC46uvy0wj4z5pDbkUMCzuFQ3ZKTziGRo0IB8Vu/f20nDqf0Ssmz2sIwX
 o6kY5bOl1Hjogjn+AfJ8hANhMMDAJ4KDxyfuFMxAHe38EJhYXwt2gr4Apu2a1Y4e
 xOLKrQeZtw66a4vpKO4HnUDFtDzF80gprqGLj/1mlop8ZOpdqQx+f6oIKG4HA20f
 MIdnnDRDsNXJ37/6YEx64HYB3mZ7NJI6WBwTqPKPSYx170gu/O/R8lP/X9grerB8
 ucvzz1+y8sOPzSE5mLQKYlmzS4mkGxMYpcTrGlS6IcnB0D7MEVGXL3uLjT7L+W82
 pj64q5v9wFhjIzCKXDxrNdKxk9tkwKsoRPQKL3x7Cjh42ZQ/sMCaIpQrxAMXZ0i6
 47r/4K5QliqgKl6ANUHsjsDnnPk2DjVxrtoU5F9jVDbUP2Im8dV86Vgqcf3M92p2
 D5iWMSCeO2lsXWuvgRxlOKk7EdHUpDzmEsMgZZgSxixgf+c7MsWRHHj7/Oy7UQVw
 Np5KL7V0QcWkruJI5Caj7Sar8A==
 =Bqb7
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-stm32-20250930' of https://source.denx.de/u-boot/custodians/u-boot-stm

CI: https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/27776

- stm32mp1: Fix env_get_location()
- stm32mp2: Update register used by BL31 for boot parameter
2025-09-30 10:47:19 -06:00
Jamie Gibbons
8dee93cfc5 board: mpfs_icicle: fix pointer assignment in board_fdt_blob_setup()
Correct the assignment in board_fdt_blob_setup() to use *fdtp instead of
fdtp, ensuring the caller receives the correct FDT address. This
resolves an issue where the device tree pointer was not properly set due
to assigning to the local parameter rather than the dereferenced
pointer.

Fixes: 7c16ebba1ed ("board: mpfs_icicle: implement board_fdt_blob_setup()/board_fit_config_name_match()")
Signed-off-by: Jamie Gibbons <jamie.gibbons@microchip.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
2025-09-30 10:10:08 -06:00
Patrick Delaunay
8a2e75e6a1 stm32mp2: update register used by BL31 for boot parameter
Use the ARM64 kernel booting register settings, defined in Linux
documentation Documentation/arch/arm64/booting.rst:

 x0 = physical address of device tree blob (dtb) in system RAM.

so kernel can replace U-Boot in FIP without modification of BL31.

Use x0 for future TF-A version and keep x2 as fallback to be compatible
with previous version of TF-A BL31.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-09-30 17:37:10 +02:00
Tom Rini
662672dede Merge tag 'net-20250930' of https://source.denx.de/u-boot/custodians/u-boot-net
Pull request net-20250930

net-common:
- DesignWare: avoid regulator enable failure
- Fix RMII help text

net-lwip:
- Ensure alignment of packet buffers
- Use NTP server(s) obtained from DHCP
2025-09-30 08:57:25 -06:00
Kory Maincent
d1afa66504 Revert "board: st: stm32mp1: Clean env_get_location()"
This reverts commit d37641c61ba212241c38e3fd22f0335fc0bebc96.

Restore support for environment storage in EXT4 filesystem on eMMC boot.
The previous cleanup incorrectly removed this fallback option which is
needed for boards that store their environment in an EXT4 partition.

This configuration is OS-specific rather than board-dependent and should
remain as it is configurable via menuconfig. Even if it is not described
in ST defconfigs people may have enabled it in their defconfig.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-09-30 16:44:26 +02:00
Tim Harvey
b2217c935e net: lwip: ensure alignment of packet buffers
Network packet buffers should be aligned to PKTALIGN. Add a compiler
attribute to ensure this.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
[jf: use __aligned(x) from <linux/compiler_attributes.h>]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-09-30 13:08:38 +02:00
Jerome Forissier
61a6f5ab99 net: lwip: dhcp: set ntpserverip environment variable
Once the DHCP exchange is complete, if we have an IP address for an NTP
server, set the ntpserverip environment variable accordingly. Although
not necessary to make the sntp command use that server (since it is
known internally to the lwIP stack), this makes the behavior in line
with the legacy NET stack. This is also consistent with exporting the
DNS servers etc.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Michal Simek <michal.simek@amd.com>
2025-09-30 12:01:36 +02:00
Jerome Forissier
57a623230e net: lwip: dhcp: make NTP servers usable by the sntp command
When both CMD_DHCP and CMD_SNTP are enabled, one would expect the NTP
servers received by DHCP to be used by the sntp command by default. Fix
dhcp_loop() so that it is indeed the case.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reported-by: Michal Simek <michal.simek@amd.com>
2025-09-30 12:01:36 +02:00
Jerome Forissier
4462ab9a0b net: lwip: enable debug traces for SNTP when CONFIG_LWIP_DEBUG is set
Now that SNTP is supported, enable SNTP debug traces when LWIP_DEBUG is
enabled. In particular, this allows to see which NTP servers are
received during DHCP.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2025-09-30 12:01:36 +02:00
Ben Wolsieffer
bf82aa8ae0 net: designware: avoid regulator enable failure
Use regulator_set_enable_if_allowed() to avoid failure if regulator is
shared between multiple devices.

Signed-off-by: Ben Wolsieffer <ben.wolsieffer@hefring.com>
2025-09-30 12:01:36 +02:00
Yegor Yefremov
adc6d192e9 net: fix RMII help text
Replace MII with RMII as it is a Reduced Media-Independent Interface.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-09-30 12:01:36 +02:00