Commit Graph
105695 Commits
Author SHA1 Message Date
Daniel GolleandTom Rini a9a289a211 rtc: pcf8563: add haoyu,hym8563 compatible
The HYM8563 is a PCF8563 clone with an identical timekeeping register
layout and is found e.g. on the Radxa ROCK 5B. Match its compatible so
DM_RTC (and with it the EFI GetTime/SetTime runtime services) can use
the existing driver with upstream DT.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-07-29 14:50:18 -06:00
Tom Rini ece349ade2 Prepare v2026.07
Signed-off-by: Tom Rini <trini@konsulko.com>
2026-07-06 17:50:43 -06:00
Tom Rini 18761722e6 Merge patch series "Remove patman from the U-Boot tree"
Simon Glass <sjg@chromium.org> says:

patman is now maintained as a standalone 'patch-manager' package, so
remove it from the tree. The command becomes a stub that tells people to
run 'pip install patch-manager'.

buildman still imports the shared modules commit and patchstream (along
with their dependencies), so this series leaves those in place. It drops
the tool's code, tests, CI hooks and packaging, and removes the in-tree
documentation, moving the b4 contributor guide alongside the patman note
in the patch-sending docs. It also adds a .patman-defaults file so the external
tool is set up for U-Boot, next to the existing .b4-config. Where the CI
jobs relied on patman's requirements for the setuptools that pylibfdt
needs, they now install scripts/dtc/pylibfdt/requirements.txt instead.

More could be done here: commit and patchstream (and their dependencies
series, get_maintainer and settings) only remain because buildman still
imports them. A follow-up could move those into u_boot_pylib (or
buildman itself) and drop the rest, leaving tools/patman as just the
stub.

Link: https://lore.kernel.org/r/20260705193251.2190705-1-sjg@chromium.org
2026-07-06 08:28:51 -06:00
Simon GlassandTom Rini 91b94aff14 patman: Remove the patch-management code
Delete the command-line tool and its supporting modules, now that this
functionality lives in the standalone patch-manager package.

Keep the modules that buildman still imports (commit and patchstream,
plus their dependencies series, get_maintainer and settings), along with
the stub command. Trim __init__.py to match.

Signed-off-by: Simon Glass <sjg@chromium.org>
2026-07-06 08:28:51 -06:00
Simon GlassandTom Rini f7a4848a9c patman: Remove the test suite
These tests cover the patch-management functionality, which is being
removed from the tree in favour of the standalone patch-manager package.
Drop the tests and their data files.

Signed-off-by: Simon Glass <sjg@chromium.org>
2026-07-06 08:28:51 -06:00
Simon GlassandTom Rini f2cf431533 patman: Replace the tool with a stub for patch-manager
patman is now maintained as a standalone 'patch-manager' package, rather
than in the U-Boot tree. Replace the command with a small stub which
tells people how to install it.

buildman still uses the shared modules commit and patchstream (and their
dependencies), so leave those in place; the patches that follow remove
the patch-management code itself.

Signed-off-by: Simon Glass <sjg@chromium.org>
2026-07-06 08:28:51 -06:00
Simon GlassandTom Rini a24a86b547 patman: Add a .patman-defaults file for U-Boot
patman is now installed from the separate patch-manager package. It reads
a .patman-defaults file from the tree root as its lowest-priority config,
so a project can ship defaults that developers still override from their
own ~/.patman, a local .patman or the command line. This behaviour is new
in patman version 0.0.20

Add one for U-Boot, alongside .b4-config, pinning the patchwork server and
the get_maintainer.pl invocation so the tool works out of the box without
depending on patman's built-in defaults. A few other settings are listed,
commented out, as a starting point.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-07-06 08:28:51 -06:00
Simon GlassandTom Rini c8db155525 test: Stop running the patman tests
The patman tests no longer exist in the tree, so drop them from the
test/run script (used by 'make tcheck' and friends) and from the
tools-testing example in the documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2026-07-06 08:28:51 -06:00
Simon GlassandTom Rini c2f2085b15 tools: Stop packaging patman as a pip module
patman is no longer shipped from the U-Boot tree, so drop it from the
'make pip' target and from make_pip.sh, and remove its packaging files
(setup.py, pyproject.toml, requirements.txt). Nothing else refers to
them by this point in the series, so they can go.

Also fix binman's pyproject.toml, which declares package-data for a
'patman' package (a copy-paste leftover); use 'binman' instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2026-07-06 08:28:50 -06:00
Simon GlassandTom Rini 5c2d490539 tools: docker: Drop patman from the CI image
The CI runner image pre-caches pip packages by downloading each tool's
requirements.txt from master. A later patch removes patman's
requirements.txt from the tree, so stop fetching and installing it.

The same step already installs setuptools explicitly (patman's
requirements list it too), so this needs nothing further.

This takes effect the next time someone rebuilds the image; the existing
image keeps working in the meantime.

Signed-off-by: Simon Glass <sjg@chromium.org>
2026-07-06 08:28:50 -06:00
Simon GlassandTom Rini bb74c34fd6 CI: Stop building and testing patman
patman is now just a stub, so drop its requirements file and its
'patman test' run from the Azure and GitLab pipelines.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-07-06 08:28:50 -06:00
Simon GlassandTom Rini d4e3ef0b0a CI: Install pylibfdt's requirements in the tool jobs
The GitLab and Azure tool-test and pylint jobs build the pylibfdt
bindings, which need setuptools. That currently comes only from patman's
requirements.txt, which a later patch drops. Install
scripts/dtc/pylibfdt/requirements.txt in those jobs, the proper source
for that dependency, so setuptools survives patman's removal.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-07-06 08:28:50 -06:00
Simon GlassandTom Rini f6c56009f6 doc: Remove the patman documentation
The full patman manual now lives with the standalone patch-manager
package, making the 1000-line copy in the tree redundant.

Remove the in-tree manual, its README and the doc/develop/patman.rst
toctree page.

The sending-patches guide already introduces patman, so point it at the
patch-manager package instead of the now-dead ':doc:' cross-reference
and, with the manual gone, add a couple of lines on how the tool works.
Point the SPI howto at that guide too, rather than repeating the install
details.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2026-07-06 08:28:50 -06:00
Simon GlassandTom Rini 08183ba1af doc: Move the b4 guide into sending_patches
The b4 contributor guide sits in the coding-style document, which is an
odd place for it. Move it into sending_patches.rst, next to the patman
note, so both patch-sending tools are described together.

The b4_contrib label moves with it, so the reference from process.rst
still resolves.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-07-06 08:28:50 -06:00
Tom Rini a25c9bd192 Merge tag 'mmc-for-2026.07' of https://source.denx.de/u-boot/custodians/u-boot-mmc
CI: https://source.denx.de/u-boot/custodians/u-boot-mmc/-/pipelines/30621

- Fix redundant 1.8V voltage switch on cold boot with UHS card
- Revert "mmc: sdhci-cadence: trigger tuning for SD HS mode on SD6HC (v6) PHY"
2026-07-06 08:10:22 -06:00
Tanmay KathpaliaandPeng Fan 3e0208cc64 Revert "mmc: sdhci-cadence: trigger tuning for SD HS mode on SD6HC (v6) PHY"
This reverts commit b42c67188c ("mmc: sdhci-cadence: trigger tuning
for SD HS mode on SD6HC (v6) PHY").

The reverted patch introduced several issues:

1. Non-standard tuning trigger: The SD Physical Layer Specification
   only mandates execute_tuning for SDR50 and SDR104 UHS-I modes.
   Triggering tuning for SD High Speed mode is outside the spec and
   is handled via a non-standard set_ios_post callback rather than
   through the established SDHCI framework tuning path.

2. Non-standard device tree property: The patch introduced a new
   "cdns,sd-hs-tuning" DT property to opt into SD HS tuning. This
   is not aligned with existing DT bindings and bypasses the standard
   MMC capability negotiation mechanism.

3. Incorrect tunable mode allowlist: The sdhci_cdns6_mode_is_tuned()
   function includes SD_HS, UHS_SDR50, and MMC_HS_400_ES as tunable
   modes. According to the Cadence SD6HC IP User Guide (section 7.5.2,
   Figure 18), tuning is only required for UHS-I SDR104 (SD) and
   HS200 (eMMC). SD High Speed, UHS-I SDR50, and DDR50 only require
   a PHY settings update from the pre-calculation script, not the
   tuning procedure. HS400 transitions through HS200 and reuses its
   tuned DLL value with a partial settings update. HS400ES only
   requires a plain settings update from the calculation script with
   no dependency on HS200 tuning.

4. Tuned state management outside the framework: The patch manually
   tracks tuned DLL state (tuned_mode, tuned_dll_slave_ctrl) and
   restores it across PHY reconfigurations. This duplicates
   responsibility that belongs in the core MMC tuning framework and
   adds unnecessary complexity to the driver.

Reverting to realign the driver with the IP documentation and the SD
Physical Layer Specification.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-06 14:06:27 +08:00
Tanmay KathpaliaandPeng Fan aa2561443c mmc: sd: fix redundant 1.8V voltage switch on cold boot with UHS card
When a UHS card successfully negotiates 1.8V signaling during normal
initialization, the host voltage switch is performed as part of the
ACMD41 handshake. Without this fix, the warm-reboot recovery path
would fire again immediately after, switching the host voltage a
second time unnecessarily.

Add a check so the recovery path is only entered when the voltage
switch was not already performed during the current initialization
session.

Fixes: 906ee6785b ("mmc: sd: Handle UHS-I voltage signaling without power cycle")
Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-07-06 14:06:08 +08:00
Ilias ApalodimasandTom Rini 780084d7c0 MAINTAINERS: Add entry for ARM
Since I've added various features in the arm architecture
support and review most of the patches nowadays, add myself
as a co-maintainer

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-07-03 14:42:50 -06:00
Neil ArmstrongandTom Rini 08028efaaf treewide: change email links from mailman to patch.msgid.link with message-id
In preparation of the migration of the mailman mailing-list currently
hosted on the denx.de infrastructure, migrate the links in the code,
comments and documentation to https://patch.msgid.link to be future proof
and always link to the expected content data and uses the message-id in
the URL which will help find the appropriate e-mail in the future.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-07-03 14:41:14 -06:00
Andrew GoodbodyandTom Rini a215eb7dd8 Kconfig: Fix grammatical error in help text
Fix the incorrect use of 'your' instead of 'you are' and reflow the text
around it.

Fixes: af9e6ad4ab ("board_f: Add new function to allow runtime DTB selection")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2026-07-03 14:40:49 -06:00
Michal SimekandTom Rini 2e184a1f24 .mailmap: Run mailmapper and sync name locations
The patch is output from
scripts/mailmapper > tmp; mv tmp .mailmap
with moving <swarren@wwwdotorg.org> and <swarren@wwwdotorg.org> to the same
block with "This contributor prefers not to receive mails" description.

Signed-off-by: Michal Simek <michal.simek@amd.com>
2026-07-03 14:39:45 -06:00
Michal SimekandTom Rini 6da1278ee9 .mailmap: update e-mail address for Abbarapu Venkatesh Yadav
Name and email address has changed but format wasn't correct. Keep origin
line which is doing conversion from xilinx.com to amd.com and then have
conversion from AMD to Qualcomm. Also move name to proper location.

Fixes: f21920f7e7 (".mailmap: update e-mail address for Abbarapu Venkatesh Yadav")
Signed-off-by: Michal Simek <michal.simek@amd.com>
2026-07-03 14:37:20 -06:00
João Marcos CostaandTom Rini a66b6e6b64 .mailmap: map old addresses to their up-to-date counterparts
This essentially maps @free-electrons.com to @bootlin.com addresses.

Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2026-07-03 14:37:07 -06:00
Quentin SchulzandTom Rini c480bbd92b drivers: sysreset: revert support for args in request
This reverts:
- commit e49c84f7bb ("doc: usage: cmd: reset: specify when the -edl
  option is available")
- commit 1076feb8a3 ("cmd: boot: fix edl being shown when not
  supported")
- commit 63c806ba0e ("qcom_defconfig: enable psci based sysreset")
- commit ef06c5d76f ("cmd: boot: Add '-edl' option to reset command
  documentation")
- commit 32825eaddc ("sysreset: Implement PSCI based reset to EDL mode
  for QCOM SoCs")
- commit fcb48b8981 ("drivers: sysreset: Add sysreset op that can take
  arguments")

There was a conflict reverting commit 63c806ba0e ("qcom_defconfig:
enable psci based sysreset") due to commit 02ef1859b4 ("configs:
Resync with savedefconfig"), but the conflict resolution was trivial.

The args support for the sysreset uclass contains a logic bug. The first
sysreset device implementing the request_arg callback will consume the
args, not support the specified arg and thus return -EPROTONOSUPPORT
which will stop the iteration over all sysreset devices.

This is an issue if one has multiple sysreset devices and each with
support for different (valid) args. If a sysreset device implements a
-dummy argument and another -foo and a user calls reset -dummy from the
U-Boot CLI, it'll depend on which sysreset device will be attempted
first. If it is the one implementing -foo, it'll return it doesn't
support the argument with -EPROTONOSUPPORT in which case the device
implementing -dummy will never be attempted and instead we'll do a cold
reset which is very likely not what's expected from the user.

Casey suggested[1] we revert this and start from scratch again with a
different implementation instead.

[1] https://lore.kernel.org/u-boot/77ff0f56-5c3b-42e7-bdd1-bf90296da900@linaro.org/

Acked-by: Casey Connolly <casey.connolly@linaro.org>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2026-07-03 13:45:58 -06:00
Tom Rini f605dcee10 Merge tag 'qcom-fixes-2026.07' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon
CI: https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/pipelines/30574

A last minute fix for the release, the UFS controller on the new Milos
SoC (used in the Fairphone Gen. 6) needs a stub driver for it's ref
clock (similar to SM8650 before) and a handful of other clocks to get
the UFS controller probed.

This change shouldn't impact any other platforms.
2026-06-30 09:24:24 -06:00
Luca WeissandCasey Connolly e4f83e403a clk/qcom: milos: Add TCSRCC clocks
With a recent change to the UFS driver, now all clocks need to be
available. Add all the clocks from the TCSRCC block on Milos.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://patch.msgid.link/20260625-milos-ufs-fix-v1-2-b0923dabc35f@fairphone.com
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2026-06-30 13:04:59 +02:00
Luca WeissandCasey Connolly 5c7ff1b540 clk/qcom: milos: Add remaining UFS clocks
With a recent change to the UFS driver, now all clocks need to be
available. Add them.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://patch.msgid.link/20260625-milos-ufs-fix-v1-1-b0923dabc35f@fairphone.com
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2026-06-30 13:04:59 +02:00
Tom Rini a3f393c02c Merge tag 'u-boot-imx-master-20260627' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/30543

- Fix MAC address representation on i.MX9
- Fix iMX8MQ PLL
- Fix SPL trampoline buffer for 1GB DDR on i.MX9
2026-06-27 14:09:17 -06:00
Ye LiandFabio Estevam 9b41032699 clk: imx: imx8mq: Fix iMX8MQ PLL issue
The fractional PLL used on iMX8MQ is not pll14xx, it is different
PLL and not exist in u-boot. Add this fractional PLL driver and
update iMX8MQ clock driver to adapt this fraction PLL.

Fixes: 11c8ab01f3 ("clk: imx8mq: Add a clock driver for the imx8mq")
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2026-06-27 14:53:01 -03:00
Alice GuoandFabio Estevam 8c051851a5 imx9: scmi: use 48-bit MAC add instead of incrementing mac[5]
Replace mac[5] += offset with a proper 48-bit MAC address add to avoid
overflow issues when mac[5] was close to 255.

Example:
i.MX95 MAC2: 00:11:22:33:44:FE + 6
Old: 00:11:22:33:44:04 (overflow, wraps to 0)
New: 00:11:22:33:45:04 (correct carry from mac[5] to mac[4])

Signed-off-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 16:50:55 -03:00
Peng FanandFabio Estevam 3232cd38b4 imx9: scmi: Correct shutdown checking
The shutdown checking should use shutdown flags, not bootflags.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 16:50:55 -03:00
Ye LiandFabio Estevam 5402b5980e imx9: scmi: Fix SPL trampoline buffer for 1GB DDR
After supporting get DRAM size from SM, the trampoline buffer address
still depends on PHYS_SDRAM_SIZE. If the real DDR size is less than
PHYS_SDRAM_SIZE, the trampoline buffer address is invalid and SPL will
crash. So use board_phys_sdram_size to get real DDR size to calculate
correct address.

Fixes: e1cc7117b6 ("imx9: scmi: Get DDR size through SM SCMI API")
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
2026-06-26 16:50:55 -03:00
Tom Rini 6902fb4c17 Merge branch 'master' of git://source.denx.de/u-boot-usb
- usb: onboard-hub: Add support for Corechips SL6341 USB 2.0/3.0 hub controller
2026-06-25 12:32:18 -06:00
Alexey CharkovandMarek Vasut f519a74a32 usb: onboard-hub: Add support for Corechips SL6341 USB 2.0/3.0 hub controller
Corechips SL6341 is a 4-port USB 2.0 and 3.0 hub controller. It always
requires external 1V1 power and can optionally use external 3V3 power
(or alternatively it has a 5V->3V3 LDO built in to derive 3V3 power from
VBUS). It also exposes a reset pin.

Device tree bindings are merged for upstream release with Linux 7.1 as
commit bfcb86e58f3a ("dt-bindings: usb: Add Corechips SL6341 USB2.0/3.0
hub controller") [1]

Link: https://github.com/torvalds/linux/commit/bfcb86e58f3a58d05b95970d81b94cb011982780 [1]
Signed-off-by: Alexey Charkov <alchark@flipper.net>
Reviewed-by: Marek Vasut <marek.vasut+usb@mailbox.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2026-06-25 00:06:47 +02:00
Tom Rini 77a48fa272 Merge tag 'mediatek-for-master-2026-06-24' of https://source.denx.de/u-boot/custodians/u-boot-mediatek
- Cherry-pick upstream devicetree fix for duplicate regulator names.
- Fix regressions due to recent mach-wide cleanups accidentally changing
  gd->bd->bi_dram[0].size.
2026-06-24 10:02:34 -06:00
David Lechner b4fa246a15 arm: mediatek: mt8512: fix gd->bd->bi_dram[0].size
Use board_get_usable_ram_top() instead of get_effective_memsize() to
limit gd->ram_top.

Both board_get_usable_ram_top() and get_effective_memsize() are used to
set gd->ram_top in setup_dest_addr(). However, get_effective_memsize()
also sets gd->bd->bi_dram[0].size in dram_init_banksize(), which is
undesirable.

Prior to commit b9e6281632 ("arm: mediatek: mt8512:
drop dram_init_banksize()"), gd->bd->bi_dram[0].size was overridden in
a board-specific dram_init_banksize() implementation.

We can just use board_get_usable_ram_top() now to set gd->ram_top to the
correct value instead. Overriding gd->bd->bi_dram[0].size was a bit
confusing since it isn't easily apparent which order the functions that
set it are called.

Fixes: b9e6281632 ("arm: mediatek: mt8512: drop dram_init_banksize()")
Link: https://patch.msgid.link/20260615-mtk-fix-ram-size-v2-8-f72cfc52ce58@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-24 10:06:16 -05:00
David Lechner ec457f7cfd arm: mediatek: mt8195: fix gd->bd->bi_dram[0].size
Use board_get_usable_ram_top() instead of get_effective_memsize() to
set gd->ram_top to something <= 4GiB.

Both board_get_usable_ram_top() and get_effective_memsize() are used to
set gd->ram_top in setup_dest_addr(). However, get_effective_memsize()
also sets gd->bd->bi_dram[0].size in dram_init_banksize(), which is
undesirable.

Prior to commit d83bd9729d ("arm: mediatek: mt8195:
drop dram_init_banksize()"), gd->bd->bi_dram[0].size was overridden in
a board-specific dram_init_banksize() implementation. When that was
removed get_effective_memsize() set gd->bd->bi_dram[0].size to the wrong
value because of get_effective_memsize() being overridden in commit
af4cba9a05 ("arm: mediatek: mt8195: fix gd->ram_top limit")

We can just use board_get_usable_ram_top() now to set gd->ram_top to the
correct value instead. This is possible now, thanks to
LMB_LIMIT_DMA_BELOW_RAM_TOP being set by default for 64-bit Mediatek
ARM SoCs.

Fixes: d83bd9729d ("arm: mediatek: mt8195: drop dram_init_banksize()")
Link: https://patch.msgid.link/20260615-mtk-fix-ram-size-v2-7-f72cfc52ce58@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-24 10:06:16 -05:00
David Lechner 58c7145d68 arm: mediatek: mt8189: fix gd->bd->bi_dram[0].size
Use board_get_usable_ram_top() instead of get_effective_memsize() to
set gd->ram_top to something <= 4GiB.

Both board_get_usable_ram_top() and get_effective_memsize() are used to
set gd->ram_top in setup_dest_addr(). However, get_effective_memsize()
also sets gd->bd->bi_dram[0].size in dram_init_banksize(), which is
undesirable.

We can just use board_get_usable_ram_top() now to set gd->ram_top to the
correct value instead. This is possible now, thanks to
LMB_LIMIT_DMA_BELOW_RAM_TOP being set by default for 64-bit Mediatek
ARM SoCs.

Fixes: a7c682565b ("arm: mediatek: add support of MT8189 SoC family")
Link: https://patch.msgid.link/20260615-mtk-fix-ram-size-v2-6-f72cfc52ce58@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-24 10:06:16 -05:00
David Lechner 6f274732f7 arm: mediatek: mt8188: fix gd->bd->bi_dram[0].size
Use board_get_usable_ram_top() instead of get_effective_memsize() to
set gd->ram_top to something <= 4GiB.

Both board_get_usable_ram_top() and get_effective_memsize() are used to
set gd->ram_top in setup_dest_addr(). However, get_effective_memsize()
also sets gd->bd->bi_dram[0].size in dram_init_banksize(), which is
undesirable.

Prior to commit b3467e51e9 ("arm: mediatek: mt8188:
drop dram_init_banksize()"), gd->bd->bi_dram[0].size was overridden in
a board-specific dram_init_banksize() implementation. When that was
removed get_effective_memsize() set gd->bd->bi_dram[0].size to the wrong
value because of get_effective_memsize() being overridden in commit
7518e10cd2 ("arm: mediatek: mt8188: fix gd->ram_top limit").

We can just use board_get_usable_ram_top() now to set gd->ram_top to the
correct value instead. This is possible now, thanks to
LMB_LIMIT_DMA_BELOW_RAM_TOP being set by default for 64-bit Mediatek
ARM SoCs.

Fixes: b3467e51e9 ("arm: mediatek: mt8188: drop dram_init_banksize()")
Link: https://patch.msgid.link/20260615-mtk-fix-ram-size-v2-5-f72cfc52ce58@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-24 10:06:16 -05:00
David Lechner 3b7adad0b5 arm: mediatek: mt7988: fix gd->bd->bi_dram[0].size
Use board_get_usable_ram_top() instead of get_effective_memsize() to
set gd->ram_top to something <= 4GiB.

Both board_get_usable_ram_top() and get_effective_memsize() are used to
set gd->ram_top in setup_dest_addr(). However, get_effective_memsize()
also sets gd->bd->bi_dram[0].size in dram_init_banksize(), which is
undesirable.

Prior to commit bddd6bbef3 ("arm: mediatek: mt7988:
drop dram_init_banksize()"), gd->bd->bi_dram[0].size was overridden in
a board-specific dram_init_banksize() implementation. When that was
removed get_effective_memsize() set gd->bd->bi_dram[0].size to the wrong
value because of CFG_MAX_MEM_MAPPED.

Rather than continue to use an old-style CFG_ option and the potentially
confusing overriding of gd->bd->bi_dram[0].size (it is difficult to see
which order the functions that set it are called), we can just use
board_get_usable_ram_top() to set gd->ram_top to the correct value
instead. This is possible now, thanks to LMB_LIMIT_DMA_BELOW_RAM_TOP
being set by default for 64-bit Mediatek ARM SoCs.

The CFG_MAX_MEM_MAPPED option is removed since it is no longer needed.
The config header and Kconfig option are also removed since that was
the last CFG_ option.

Reported-by: Rudy Andram <rmandrad@gmail.com>
Closes: https://lore.kernel.org/u-boot/20260602162233.2418471-1-rmandrad@gmail.com/
Fixes: bddd6bbef3 ("arm: mediatek: mt7988: drop dram_init_banksize()")
Link: https://patch.msgid.link/20260615-mtk-fix-ram-size-v2-4-f72cfc52ce58@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-24 10:06:16 -05:00
David Lechner c074950b48 arm: mediatek: mt7987: fix gd->bd->bi_dram[0].size
Use board_get_usable_ram_top() instead of get_effective_memsize() to
set gd->ram_top to something <= 4GiB.

Both board_get_usable_ram_top() and get_effective_memsize() are used to
set gd->ram_top in setup_dest_addr(). However, get_effective_memsize()
also sets gd->bd->bi_dram[0].size in dram_init_banksize(), which is
undesirable.

Prior to commit 56183fb025 ("arm: mediatek: mt7987: drop
dram_init_banksize()"), gd->bd->bi_dram[0].size was overridden in
a board-specific dram_init_banksize() implementation. When that was
removed get_effective_memsize() set gd->bd->bi_dram[0].size to the wrong
value because of CFG_MAX_MEM_MAPPED.

Rather than continue to use an old-style CFG_ option and the potentially
confusing overriding of gd->bd->bi_dram[0].size (it is difficult to see
which order the functions that set it are called), we can just use
board_get_usable_ram_top() to set gd->ram_top to the correct value
instead. This is possible now, thanks to LMB_LIMIT_DMA_BELOW_RAM_TOP
being set by default for 64-bit Mediatek ARM SoCs.

On mt7987, there is already an implementation of
board_get_usable_ram_top() for other reasons, so it is modified to
also limit ram_top to 4GiB (mt7987 is currently the only thing that
sets CONFIG_MTK_TZ_MOVABLE=y so it is safe to change this here without
unintentional side-effects).

The CFG_MAX_MEM_MAPPED option is removed since it is no longer needed.
The config header and Kconfig option are also removed since that was
the last CFG_ option.

Fixes: 56183fb025 ("arm: mediatek: mt7987: drop dram_init_banksize()")
Link: https://patch.msgid.link/20260615-mtk-fix-ram-size-v2-3-f72cfc52ce58@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-24 10:06:16 -05:00
David Lechner 2d9a9f1cad net: mtk_eth: select LMB_LIMIT_DMA_BELOW_RAM_TOP
Default to CONFIG_LMB_LIMIT_DMA_BELOW_RAM_TOP=y when MEDIATEK_ETH is
enabled. The MediaTek Ethernet controller can only access the first 4GB
of RAM when DMA is used.

Link: https://patch.msgid.link/20260615-mtk-fix-ram-size-v2-2-f72cfc52ce58@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-24 10:06:16 -05:00
David Lechner ae73cc6df7 mmc: mtk-sd: select LMB_LIMIT_DMA_BELOW_RAM_TOP
Default to CONFIG_LMB_LIMIT_DMA_BELOW_RAM_TOP=y when CONFIG_MTK_SD is
enabled. The MediaTek SD controller can only access the first 4GB of RAM
when DMA is used. "imply" is used rather than "select" in case someone
want's to turn off the option when DMA is not used.

Link: https://patch.msgid.link/20260615-mtk-fix-ram-size-v2-1-f72cfc52ce58@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-24 10:06:16 -05:00
David Lechner 7aedd1f7fb arm64: dts: mediatek: mt6359: give regulators unique names
Change the regulator-name properties to be unique for all regulators.
U-Boot cannot handle duplicate names.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

[ upstream commit: d91639d0ab3223b61c00442021dc639c9ddc2b76 ]

(cherry picked from commit 22ce1d7d45a696128b8ad2cb9fbc4f2073bcb4f6)

Reviewed-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260611-mtk-pick-dt-mt6359-unique-names-v1-1-601546be1210@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-24 09:51:00 -05:00
Quentin StrydomandTom Rini fcda974e36 arm: aspeed: Fix AST2600 SPL external DTB alignment
For AST2600 SPL with CONFIG_SPL_SEPARATE_BSS=y and
CONFIG_OF_SEPARATE=y, fdt_find_separate() expects the appended control
DTB at _image_binary_end.

The AST2600 SPL linker script aligned _image_binary_end via the
.binman_sym_table section. In builds where that section has no emitted
contents, objcopy -O binary does not include the alignment bytes in
spl/u-boot-spl-nodtb.bin. This causes the nodtb binary to end before
_image_binary_end, so the appended DTB is placed too early.

On evb-ast2600 this produced:

  sizeof(spl/u-boot-spl-nodtb.bin) = 0xc92c
  _image_binary_end                = 0xc930

SPL then looked four bytes past the FDT header and failed with:

  Missing DTB
  No serial driver found

Move the 8-byte alignment into the preceding emitted __u_boot_list
section so the objcopy output and _image_binary_end agree.

Signed-off-by: Quentin Strydom <qstrydom0@gmail.com>
2026-06-23 10:41:25 -06:00
Tom Rini 4edbb6fb60 Merge tag 'net-20260623' of https://source.denx.de/u-boot/custodians/u-boot-net
Pull request net-20260623.

net:
- airoha_eth: fix mt7531 mdio related initialization bug

net-legacy:
- cdp: reject CDP TLVs with a length below the 4-byte header
- Clear IP defragmentation state after returning a complete packet

net-lwip:
- Halt ethernet after network commands
2026-06-23 10:36:58 -06:00
Piyush PaliwalandJerome Forissier 91d5e0ee3e net: cdp: reject CDP TLVs with a length below the 4-byte header
cdp_receive() reads a 16-bit TLV length (tlen) from the packet and only
checks that it does not exceed the remaining buffer (tlen > len). It then
unconditionally does "tlen -= 4" to skip the TLV header. As tlen is a
u16, a crafted TLV with a length of 0..3 underflows tlen to ~65532-65535.

For a CDP_APPLIANCE_VLAN_TLV the underflowed length then drives the inner
"while (tlen > 0)" loop, which walks ~64KB past the receive buffer reading
*ss each step -> out-of-bounds read (crash / info-influence). A length of
0 additionally fails to advance pkt/len, hanging the parse loop.

Reject any TLV whose declared length is smaller than its own 4-byte
header. This is the same class of bug as the recent bootp/dhcpv6/sntp/nfs
fixes (unchecked length field), in a sibling LAN parser that was missed.

Verified with a standalone AddressSanitizer harness using the verbatim
cdp_receive()/cdp_compute_csum() routines: a 16-byte CDP frame with an
appliance-VLAN TLV of length 3 triggers a heap-buffer-overflow READ that
the check eliminates.

Fixes: f575ae1f7d ("net: Move CDP out of net.c")
Cc: stable@vger.kernel.org
Signed-off-by: Piyush Paliwal <piyushthepal@gmail.com>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
2026-06-23 13:13:16 +02:00
David LechnerandJerome Forissier 9f7906a58c net: lwip: introduce net_lwip_eth_stop() function
Add a introduce net_lwip_eth_stop() function and use that to stop the
network interface after each command that uses the network.

This makes the behavior the same as the legacy net code and avoids
potential issues with the network interface being left in an active
state after a command finishes.

The start/stop is reference-counted since there is at least one command
(dhcp) that calls another command (tftp) to avoid starting and stopping
the network interface multiple times in a single command.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
2026-06-23 13:13:16 +02:00
David LechnerandJerome Forissier 91911aa0c7 net: lwip: wget: return errno codes from wget_do_request()
Change the return values of the lwip implementation of wget_do_request()
to be errno codes instead of command return codes.

wget_do_request() is not a command, so it does not make sense to return
command return codes from it. Also, the legacy network implementation of
wget_do_request() already returns errno codes so it is logical for the
lwip implementation to do the same.

This fixes a bug in try_load_from_uri_path() in efi_manager.c where it
checks that the return value of wget_do_request() is < 0. Before this
change, CMD_RET_FAILURE would not be considered an error since it has a
value of 1.

The value of ENODEV is used in places where there could actually be a
number of different causes of failure and it isn't possible to
discriminate (i.e. failing function returns NULL for all errors). Since
all callers of wget_do_request() don't propagate the error code, it
doesn't matter so much that this is not ideal, at least at this point in
time.

Fixes: 3c656c928b ("net: lwip: add wget command")
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-23 13:13:16 +02:00
David LechnerandJerome Forissier 747720eb73 net: lwip: wget: fix error handling in wget_do_request()
Split wget_do_request() into two functions to make error handling less
error-prone.

After a successful call to net_lwip_new_netif(), net_lwip_remove_netif()
must always be called to prevent leaks. This was missed in the CACERT
section of the code where we returned on error without cleaning up.

Instead of adding more calls to net_lwip_remove_netif(), refactor the
code into two functions. The outer function handles managing the netif
lifecycle. The inner function no longer has to worry about cleaning up
before returning on error.

To keep things simple, the `path` local variable is removed during the
refactoring. Instead, ctx.path is used directly everywhere.

Fixes: 3c656c928b ("net: lwip: add wget command")
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-06-23 13:13:16 +02:00