2921 Commits

Author SHA1 Message Date
Tom Rini
d395ea73dc Merge tag 'net-20260209' of https://source.denx.de/u-boot/custodians/u-boot-net
Pull request net-20260209.

net:
- airoha: mdio support for the switch
- phy: mscc: allow RGMII with internal delay for the VSC8541
- dwc_eth_qos: Update tail pointer handling

net-legacy:
- Stop conflating return value with file size in net_loop()

net-lwip:
- wget: rework the '#' printing
- tftp: add support of tsize option to client
2026-02-09 08:28:01 -06:00
Tom Rini
b887a1c1a1 Merge patch series "Add command for getting ramsize in scripts"
Frank Wunderlich <frank-w@public-files.de> says:

Add command for getting ramsize in scripts

Link: https://lore.kernel.org/r/20260204184045.111808-1-linux@fw-web.de
2026-02-07 11:51:43 -06:00
Frank Wunderlich
8acc8a6546 test: cmd: add test for memsize
Add a test for memsize command in same way as meminfo.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
2026-02-07 11:51:33 -06:00
Frank Wunderlich
e202eca183 cmd: mem: add command for getting ram size for use in scripts
Add a command for getting detected ram size with possibility to
assign it to an environment variable.

example usage:

BPI-R4> memsize
4096 MiB
BPI-R4> memsize memsz
BPI-R4> printenv memsz
memsz=4096
BPI-R4>

board with 8GB ram:

BPI-R4> memsize
8192 MiB
BPI-R4> memsize memsz
BPI-R4> printenv memsz
memsz=8192
BPI-R4>

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
2026-02-07 11:51:33 -06:00
Yuya Hamamachi
86f90e2a5f net: Stop conflating return value with file size in net_loop()
The net_loop() currently conflates return value with file size
at the end of successful transfer, in NETLOOP_SUCCESS state.

The return type of net_loop() is int, which makes this practice
workable for file sizes below 2 GiB, but anything above that will
lead to overflow and bogus negative return value from net_loop().

The return file size is only used by a few sites in the code base,
which can be easily fixed. Change the net_loop() return value to
always be only a return code, in case of error the returned value
is the error code, in case of successful transfer the value is 0
or 1 instead of 0 or net_boot_file_size . This surely always fits
into a signed integer.

By keeping the return code 0 or 1 in case of successful transfer,
no conditionals which depended on the old behavior are broken, but
all the sites had to be inspected and updated accordingly.

Fix the few sites which depend on the file size by making them
directly use the net_boot_file_size variable value. This variable
is accessible to all of those sites already, because they all
include net-common.h .

Signed-off-by: Yuya Hamamachi <yuya.hamamachi.sx@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2026-02-06 16:37:31 +01:00
Marek Vasut
109e378e9b cmd: zip: Add missing unmap_sysmem() for buffers in the unzip command
Unmap the sysmem that got mapped by this command.

Use symbolic return value for the command while updating
the return value handling.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2026-02-06 09:29:55 -06:00
Marek Vasut
3a76ba66ec cmd: zip: Use map_sysmem() with buffers in the zip command
The current implementation casts an address to a pointer. Make it more
sandbox-friendly by using map_sysmem().

Use symbolic return value for the command while updating
the return value handling.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2026-02-06 09:29:53 -06:00
Marek Vasut
f2c704c0e8 cmd: unzip: Use map_sysmem() with buffers in the gzwrite command
The current implementation casts an address to a pointer. Make it more
sandbox-friendly by using map_sysmem().

Convert 'addr' variable to unsigned long, as that is the return type of
hextoul() and address parameter type of map_sysmem().

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2026-02-06 09:29:50 -06:00
Marek Vasut
02ffe4a0c9 gunzip: Fix len parameter in function signature
The only call site of gzwrite() is cmd/unzip.c do_gzwrite(), where
the 'len' parameter passed to gzwrite(..., len, ...) function is of
type unsigned long. This usage is correct, the 'len' parameter is
an unsigned integer, and the gzwrite() function currently supports
input data 'len' of up to 4 GiB - 1 .

The function signature of gzwrite() function in both include/gzip.h
and lib/gunzip.c does however list 'len' as signed integer, which
is not correct, and ultimatelly limits the implementation to only
2 GiB input data 'len' .

Fix this, update gzwrite() function parameter 'len' data type to
size_t consistently in include/gzip.h and lib/gunzip.c .

Furthermore, update gzwrite() function 'szwritebuf' parameter in
lib/gunzip.c from 'unsigned long' to 'size_t' to be synchronized
with include/gzip.h . Rewrite the other parameters to size_t and
off_t and propagate the change too.

Since the gzwrite() function currently surely only supports input
data size of 4 GiB - 1, add input data size check. The limitation
comes from the current use of zlib z_stream .avail_in parameter,
to which the gzwrite() function sets the entire input data size,
and which is of unsigned int type, which cannot accept any number
beyond 4 GiB - 1. This limitation will be removed in future commit.

Reported-by: Yuya Hamamachi <yuya.hamamachi.sx@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2026-02-06 09:29:48 -06:00
Tom Rini
e7a21a985d Merge patch series "part: fix partition searching"
Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> says:

It was noted that a GPT partition with the maximum available partition
number (ex: /dev/mmcblk128) can't be read/write from U-Boot using
read/write commands. Futher investigation shows that the problem is
deeper.

This set of patches fixes uncovered issues.

Link: https://lore.kernel.org/r/20260119223305.3022690-1-mikhail.kshevetskiy@iopsys.eu
2026-02-04 10:31:02 -06:00
Mikhail Kshevetskiy
6a1f8c8973 cmd: gpt: fix partition search boundaries
GPT disk partition with max available number (ex: /dev/mmcblk128) can't
be used from U-Boot. Here is an example:

  => mmc part

  Partition Map for mmc device 0  --   Partition Type: EFI

  Part	Start LBA	End LBA		Name
	Attributes
	Type GUID
	Partition GUID
  1	0x00001000	0x000013ff	"env1"
	attrs:	0x0000000000000000
	type:	0fc63daf-8483-4772-8e79-3d69d8477de4
	guid:	5452574f-2211-4433-5566-778899aabb02
  2	0x00001400	0x000017ff	"env2"
	attrs:	0x0000000000000000
	type:	0fc63daf-8483-4772-8e79-3d69d8477de4
	guid:	5452574f-2211-4433-5566-778899aabb03
  .................
  8	0x00158000	0x0034bfff	"apps"
	attrs:	0x0000000000000000
	type:	0fc63daf-8483-4772-8e79-3d69d8477de4
	guid:	5452574f-2211-4433-5566-778899aabb09
  128	0x00000420	0x00000fff	"fip"
	attrs:	0x0000000000000000
	type:	c12a7328-f81f-11d2-ba4b-00a0c93ec93b
	guid:	5452574f-2211-4433-5566-778899aabb01

  => gpt setenv mmc 0 fip
  error!
  => gpt setenv mmc 0 apps
  success!

The error is caused by invalid boundary checks. This patch fixes an
issue.

Fixes: 12fc1f3bb223 ("cmd: gpt: add eMMC and GPT support")
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Acked-by: Quentin Schulz <quentin.schulz@cherry.de>
2026-02-04 10:30:55 -06:00
Jonas Karlman
8d89b16ea4 net: lwip: Use ipaddr helpers
The ip_addr_t of lwIP has support for both IPv6 and IPv4 addresses.
Some lwIP commans is directly accessing the internal addr field of the
ip_addr_t instead of using ipaddr helper functions.

Change to use ipaddr helper functions where appropriate to remove direct
access of the internal addr field. Also change a few instances from ip4
to the version less ipaddr helpers.

There is no intended functional change, besides the change from using
ip4 addr helper to using version less ipaddr helper.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
2026-02-04 09:04:36 +01:00
Tom Rini
71f2564b17 Merge tag 'mmc-for-2026.04-rc2' of https://source.denx.de/u-boot/custodians/u-boot-mmc
- Add DMA support for mediatek mmc
- Cleanup mmc cmd
- Fix typos in mmc

[trini: Fix "quoted string split across lines" checkpatch warning]
Signed-off-by: Tom Rini <trini@konsulko.com>
2026-02-03 12:46:30 -06:00
Yao Zi
b4f0479e07 cmd: mmc: Return symbolic value when part switching fails in mmc dev
Return symbolic value CMD_RET_FAILURE instead of literal "1" when
failing to switch the partition to improve readability.

Signed-off-by: Yao Zi <me@ziyao.cc>
Tested-by: Anshul Dalal <anshuld@ti.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-02-03 22:11:46 +08:00
Yao Zi
f955e00e42 cmd: mmc: Check whether arguments are valid numbers in dev subcommand
Currently when any of speed_mode, part, or dev fails to be parse as a
number, no error is reported. In this case __init_mmc_device() is called
with weird arguments, probably zeroes if there's no digit prefixing the
argument, which is especially confusing when the invocation occasionally
succeeds.

Let's check whether arguments are valid numbers without trailing
characters. This is quite helpful for speed_mode: it requires an index
instead of a mode name, one may easily pass in a string, which will be
parsed as zero (MMC_LEGACY), without carefully reading the
documentation, then finds the MMC device is under an unexpected mode.

Signed-off-by: Yao Zi <me@ziyao.cc>
Tested-by: Anshul Dalal <anshuld@ti.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-02-03 22:11:45 +08:00
Yao Zi
97cc26f6b6 cmd: mmc: Simplify dev subcommand handling
Replace the big if-else block in do_mmc_dev() with switch-case and use
fallthrough to remove the duplicated code for parsing dev and part.

Signed-off-by: Yao Zi <me@ziyao.cc>
Tested-by: Anshul Dalal <anshuld@ti.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-02-03 22:11:45 +08:00
Tom Rini
0fcd154859 bootm: Remove BOOTM_NETBSD from defaults
After talking with someone from the NetBSD project, platforms that do
not boot with a device tree (and so would be using our BOOTM_NETBSD
support) a very few in number. So we can remove this option from being
enabled by default and save a little space in most places with platforms
that need it still being able to re-enable it, if needed. Ideally, in a
few years we can instead just remove the code entirely.

Link: https://lore.kernel.org/r/aWKQOW_ajq0DsbYA@big-apple.aprisoft.de/
Signed-off-by: Tom Rini <trini@konsulko.com>
2026-01-27 15:52:03 -06:00
David Lechner
9fed667f89 cmd/Kconfig: fix typo in CMD_PINMUX description
Fix typo with correct spelling of "purposes".

Also change "debug" to "debugging" while touching this since that is
the more common phrasing.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-01-21 13:30:49 -06:00
J. Neuschäfer
ba8ca7965b Update links to doc/develop/falcon.rst
README.falcon was converted to ReST/HTML in 2023.

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2026-01-19 10:31:21 +01:00
Heinrich Schuchardt
460fba63b5 cmd/meminfo: display of addresses above 4 GiB
Addresses above 4 GiB don't fit into 8 digits.
Use 13 digits which encompass up to 15 TiB.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <simon.glass@canonical.com>
2026-01-19 10:31:21 +01:00
Tom Rini
1da640cc46 Merge tag 'u-boot-dfu-20260116' of https://source.denx.de/u-boot/custodians/u-boot-dfu
u-boot-dfu-20260116

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

Android:
* Fix missing dependency for BOOTMETH_ANDROID
* Add bootconfig support
* Add 'get ramdisk' command to abootimg

DFU:
* Improve error handling in dfu_fill_entity()

USB Gadget:
* ci_udc: Ensure ci_ep->desc is valid before using it
* ci_udc: Add additional debug prints
2026-01-16 09:53:57 -06:00
Guillaume La Roque (TI.com)
892409d4fc cmd: abootimg: Add 'get ramdisk' command
Add support for retrieving ramdisk address and size from Android boot
images. This command allows users to extract the ramdisk information
for boot image v3+ which combines vendor ramdisk, boot ramdisk and
bootconfig sections.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Guillaume La Roque (TI.com) <glaroque@baylibre.com>
Link: https://lore.kernel.org/r/20260112-bootconfig-v5-4-79b242159ac7@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2026-01-15 14:00:55 +01:00
Guillaume La Roque (TI.com)
8f6d435570 boot: android: Add sandbox memory mapping support
Use map_to_sysmem() to convert header pointers to physical addresses
in parse_hdr functions, and add proper map_sysmem()/unmap_sysmem()
calls in android_image_get_data() for sandbox compatibility.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Guillaume La Roque (TI.com) <glaroque@baylibre.com>
Link: https://lore.kernel.org/r/20260112-bootconfig-v5-2-79b242159ac7@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2026-01-15 13:55:22 +01:00
Link Mauve
7d650e7f90 Add missing “net” prefix in help net
The usage of the net sub-system was missing the complete command for “net
stats”.

Signed-off-by: Link Mauve <linkmauve@linkmauve.fr>
Reviewed-by: Jerome Forissier <jerome@forissier.org>
2026-01-15 11:09:28 +01:00
Andrew Goodbody
230cf3bc27 net: lwip: nfs: Port the NFS code to work with lwIP
After the preparatory patches moved most of the NFS code into common
files we now add the code to enable NFS support with lwIP.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
2026-01-15 11:09:28 +01:00
Francois Berder
5e76249790 cmd: onenand: Fix handling error path in onenand_block_test
If memory allocation for verify_buf fails, then one
needs to make sure that memory allocated for buf is
released.

Signed-off-by: Francois Berder <fberder@outlook.fr>
2026-01-02 15:51:54 -06:00
Quentin Schulz
747a24b229 cmd: bdinfo: fix incorrect Kconfig options check for print_eth()
CMD_NET_LWIP has never existed so it cannot be right. I'm guessing the
intent was to allow print_eth() to be called when NET_LWIP is defined
(NET means "legacy networking stack" as opposed to NET_LWIP which is the
 newest (and incompatible) stack). There probably was some mix-up
between CMD_NET and NET options.

The dependency on CMD_NET seems unnecessary as it seems perfectly fine
to run bdinfo without CMD_NET (build and run tested). So let's instead
make the dependency on NET || NET_LWIP.

Let's sync the unit test as well.

Fixes: 95744d2527cb ("cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2026-01-02 15:51:54 -06:00
Tom Rini
5652ccc86a Merge patch series "video: display: refactor display_read_timing to avoid code duplication"
Julien Stephan <jstephan@baylibre.com> says:

Commit 2dcf143398ad ("dm: video: Repurpose the 'displayport' uclass to 'display'")
left the display_read_edid() function unused by mistake.

This series addresses that oversight and introduces a new useful cmd.

Patch 1:
 - Refactors display_read_timing() to use the existing
   display_read_edid() function, eliminating redundant code.
 - Marks display_read_edid() as static since it is not used outside of
   the file.

Patch 2:
 - Adds a new read_edid command, which can be very useful for debugging
   or developing new display drivers.
 - As this command uses display_read_edid(), the function is made
   non-static again.

Link: https://lore.kernel.org/r/20250630-read_edid_cleanup-v1-0-ec7d425472c7@baylibre.com
2025-12-30 11:23:00 -06:00
Julien Stephan
5e9b0b56ad cmd: add new command to read edid
Add a new command to read EDID info from connected display.

When applicable EDID can also be retrieved by commands such as:

  i2c dev x
  i2c edid 0x50

but the new read_edid function relies on the implementation of the
read_edid callback from DISPLAY driver.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
2025-12-30 11:22:57 -06:00
Quentin Schulz
de3754fea3 cmd: bdinfo: provide long help with all options
Document the bdinfo -a, -e and -m options in the long help, but only
when they can be used. The string concatenation is a bit odd with two
newlines, but it does render properly once in U-Boot CLI.

Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-12-24 09:17:21 +01:00
Heinrich Schuchardt
00bc1adae4 cmd/bdinfo: LMB and device-tree are not related
The usage of the LMB library and the device-tree source are not related.

Remove the dependency in the bdinfo output and adjust the unit test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-12-24 09:16:03 +01:00
Tom Rini
dac8d9c3cc Prepare v2026.01-rc5
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQTzzqh0PWDgGS+bTHor4qD1Cr/kCgUCaUnFqQAKCRAr4qD1Cr/k
 CrOEAQC3eaLxXYwOXMVFP1C6w7PfYTfUDKuSdgaRYqxF0ldPwQEA3eDTIIA/CPgg
 1M+K8q8ck+cKRK0P9CagbwyzNnvi4Qw=
 =0Z3i
 -----END PGP SIGNATURE-----

Merge tag 'v2026.01-rc5' into next

Prepare v2026.01-rc5
2025-12-22 16:31:21 -06:00
Brian Sune
f26db83ca9 fix PL330 CMD supported target
The config is wrongly written, result
in only support socdk board.

Fixes: 92dcb3ad5d98 ("cmd/dma: implement dmareset command")
Signed-off-by: Brian Sune <briansune@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-12-22 10:03:59 -06:00
Marek Vasut
2333d446b7 cmd: nvedit: Validate argument count before use
Avoid NULL pointer dereference in case 'env select' is invoked
without parameters, check the arg count and make sure it is at
least 2, otherwise print usage.

The crash is easy to trigger e.g. in sandbox:
$ ./u-boot -Tc "env select"

Fixes: a97d22ebba23 ("cmd: env: add env select command")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Tested-by: Vincent Stehlé <vincent.stehle@arm.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-12-18 10:26:22 -06:00
Heinrich Schuchardt
a8a81af848 cmd: lwip/wget: avoid NULL dereference in _set_cacert()
Running `wget cacert builtin` leads to a crash in _set_cacert():

    Unhandled exception: Load access fault

Function _set_cacert() dereferences variable wget_info.
We must initialize it before executing the cacert sub-command.

Fixes: d3761a31ef09 ("lwip: split net/lwip/wget.c")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-12-18 16:27:15 +01:00
Tom Rini
57ff26c424 fs/jffs2: Make depend on !64BIT
Building this code on 64bit platforms leads to warnings (and so errors
in CI). Rather than rework the code, as this is a deprecated filesystem,
don't try and disallow building on 64bit hosts.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-12-10 11:59:38 -06:00
Tom Rini
59202e5ae7 Prepare v2026.01-rc4
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQTzzqh0PWDgGS+bTHor4qD1Cr/kCgUCaTchRAAKCRAr4qD1Cr/k
 CrO7AP4krur8pHNA7jaKYZqIqYtJNFWay1gBmhwKCMY3w3e6+AD+Ma1/Ehqyy81g
 evgaI1RmELrPQozZtXgKpzTS5YAL7wo=
 =vTwE
 -----END PGP SIGNATURE-----

Merge tag 'v2026.01-rc4' into next

Prepare v2026.01-rc4
2025-12-08 13:17:27 -06:00
Quentin Schulz
c4594242aa led: remove support for red LED in legacy API
To the exception of red_led_on in the arm-specific assembly code, all
code interacting with the red status LED was guarded by the
CONFIG_LED_STATUS_RED symbol, which is enabled in none of the upstream
defconfigs.

Since the last board which overrode the weak red_led_on function got
migrated to the new LED mechanism, there's also no user of the
arm-specific assembly code anymore, therefore it can be removed along
the other unreachable code sections.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Heiko Schocher <hs@nabladev.com>
2025-12-05 13:38:09 -06:00
Quentin Schulz
16415e9563 led: remove support for green status led in legacy API
The last user of it was removed in a previous commit so let's remove its
support entirely.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Heiko Schocher <hs@nabladev.com>
2025-12-05 13:38:09 -06:00
Quentin Schulz
c31f51d502 led: remove coloured_LED_init, yellow and blue status LEDs in legacy API
The last user of coloured_LED_init has been recently removed, so we can
remove all places it's called and defined as it does nothing now.

Nobody makes use of the yellow and blue status LEDs from the legacy API,
so let's remove all references to it.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-12-05 10:34:52 -06:00
Tom Rini
b3835a812f Merge patch series "test: let UNIT_TEST imply CONSOLE_RECORD"
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says:

Many C unit tests are not executed if CONFIG_CONSOLE_RECORD is not set.
Hence Tom suggested to let UNIT_TEST imply CONSOLE_RECORD.

The first patch makes the skipped C unit tests visible.

The rest of the series deals with hidden bugs in our tests.

The 'fdt get value' command returned incorrect values on low-endian
systems. So this needed fixing too.

Link: https://lore.kernel.org/r/20251123225711.227016-1-heinrich.schuchardt@canonical.com
2025-12-05 08:55:19 -06:00
Heinrich Schuchardt
21fbda84b3 cmd: fix 'fdt get value'
The 32bit cells of a device-tree property are big-endian. When printing
them via 0x08x we must first convert to the host endianness.

Remove the restriction to 20 bytes length. This would not allow to read an
SHA256 value.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-12-05 08:54:44 -06:00
Tom Rini
33750d8d88 Merge patch series "Add support for SM3 secure hash"
Heiko Schocher <hs@nabladev.com> says:

Add SM3 secure hash, as specified by OSCCA GM/T 0004-2012 SM3 and described
at https://datatracker.ietf.org/doc/html/draft-sca-cfrg-sm3-02

TPMv2 defines hash algo sm3_256, which is currently
not supported and prevented TPMv2 chip with newer
firmware to work with U-Boot. Seen this on a ST33TPHF2XI2C

    u-boot=> tpm2 init
    u-boot=> tpm2 autostart
    tpm2_get_pcr_info: too many pcrs: 5
    Error: -90
    u-boot=>

Implement sm3 hash, so we can fix this problem.

Link: https://lore.kernel.org/r/20251118043042.27726-1-hs@nabladev.com
2025-12-04 09:39:11 -06:00
Heiko Schocher
7c3f05ad51 tpm2: add sm3 256 hash support
add sm3 256 hash support, so TPM2 chips which report
5 pcrs with sm3 hash do not fail with:

  u-boot=> tpm2 autostart
  tpm2_get_pcr_info: too many pcrs: 5
  Error: -90

Signed-off-by: Heiko Schocher <hs@nabladev.com>
2025-12-04 09:38:58 -06:00
Heiko Schocher
c4ab316269 lib: sm3: implement U-Boot parts
add the U-Boot specific parts for the SM3 hash
implementation:

Signed-off-by: Heiko Schocher <hs@nabladev.com>
2025-12-04 09:38:58 -06:00
Tom Rini
d300702c5b Merge patch series "led: remove u-boot,boot-led and u-boot,error-led + add cmd doc"
Quentin Schulz <foss+uboot@0leil.net> says:

u-boot,boot-led and u-boot,error-led aren't actually handled by some
generic code but rather by board or architecture specific code. They
also aren't properties that are part of the official dt-binding so they
cannot be upstreamed. For u-boot,boot-led, there's actually a proper
replacement which is /options/u-boot/boot-led[1] (+ CONFIG_LED_BOOT=y).

For Rockchip boards, either nothing (for RK3066, PX30 and RK3399) was
using that property or (for RK3188) the code handling it was guarded by
symbols that were not enabled in the defconfig. For those, the property
and guarded code are removed.

For the Sam9x60 Curiosity, it seems that even though the LED is
controlled whenever CONFIG_LED is enabled, it isn't enabled by default
in the defconfig (but the code was added without modifying the
defconfig, explicitly leaving a choice to the user). I decided to keep
that feature by simply migrating it to the new API, though I cannot test
it as I do not own the device.

The STM32 boards will be migrated in the near future once their upstream
(kernel) Device Trees gain the new way to specify this (via
/options/u-boot/boot-led). I'll let Patrice handle this, see
https://lore.kernel.org/u-boot/94ed1988-13e8-4fe3-bdff-ba2c9973c556@foss.st.com/
and
https://lore.kernel.org/u-boot/2a3aa43a-ce19-41e1-ab56-556629ce5cf9@foss.st.com/

After this, only one user of u-boot,boot-led will be left, based on
STM32: board/dhelectronics/dh_stm32mp1/board.c. @Patrice, maybe that's
something you want to have a look at as well, this seems to be some
evaluation kit?

The only users of u-boot,error-led are STM32 boards, so I'll leave this
to Patrice as well, I do not know what's the way to go for that one.

In any case, I would like to not encourage people to use out-of-spec DT
properties when there is another option (u-boot,boot-led), so I remove
the properties from the dt-binding document from U-Boot.

The help text for the blink subcommand of the led command was misleading
so this is now fixed.

This also moves the content of doc/README.LED into the doc/api/led.rst,
while clearly stating one shouldn't be using this anymore.

This also gets rid of dt-binding that we already have in dts/upstream.

Finally, this adds documentation for the led shell command.

[1] https://github.com/devicetree-org/dt-schema/blob/v2025.08/dtschema/schemas/options/u-boot.yaml#L113-L116

Link: https://lore.kernel.org/r/20251112-led-old-dt-v1-0-2892d49517db@cherry.de
2025-12-03 12:18:16 -06:00
Quentin Schulz
29a7fe55c5 cmd: led: fix help text for blink subcommand
The blink subcommand actually requires an additional parameter
(blink-freq) but not the others.

In order to simplify the help text, split the blink subcommand help text
from the off|on|toggle subcommands.

Then, fix the help text so that it is clear that the frequency is
required.

While at it, specify the duty cycle.

Fixes: ffe2052d6e8a ("dm: led: Add a new 'led' command")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-12-03 11:03:45 -06:00
Heinrich Schuchardt
642a9e716e cmd/extension: avoid NULL pointer dereference
extension_get_list() will return NULL if there is no extension device.
Check for this situation.

Addresses-Coverity-ID: 638557 - Null pointer dereferences (NULL_RETURNS)
Fixes: 2d12958ee71b ("boot: Remove legacy extension board support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Kory Maincent <kory.maincent@bootlin.com>
2025-11-27 08:43:45 -06:00
Tom Rini
4a4871e3dc Prepare v2026.01-rc3
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQTzzqh0PWDgGS+bTHor4qD1Cr/kCgUCaSR5rQAKCRAr4qD1Cr/k
 ChMOAP9QG0whaK+QkH6d8+FEosPKdzpKQUdPCuq+Kbh6OWpcfgD5ARWPQ8m4QrkV
 RQ64xc0kJBdM7ez2iAl3Xkhg2GKFzww=
 =DUDH
 -----END PGP SIGNATURE-----

Merge tag 'v2026.01-rc3' into next

Prepare v2026.01-rc3
2025-11-24 09:34:29 -06:00
Mikhail Kshevetskiy
5572d94100 cmd: mtd: benchmark: use lldiv() instead of 64-bit division
As was noted by Heinrich Schuchardt, some SoCs may not support 64-bit
divisions. Fix an issue by using lldiv() instead.

The code assumes that the benchmark never takes more than 4294 seconds
and thus the difference will be less than U32_MAX.

Also replace (speed / 1024) by (speed >> 10) to avoid potential 64-bit
division.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2025-11-18 20:06:21 +01:00