Commit graph

2697 commits

Author SHA1 Message Date
Harsha Vardhan V M
578e7882bf cmd: fuse: Add fuse writebuff sub-system command
Add CMD_FUSE_WRITEBUFF config option to add and enable fuse writebuff
sub-system command. Add fuse_writebuff function to be invoked on
writebuff command.

Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-04-04 12:25:02 -06:00
Harsha Vardhan V M
005eeda378 cmd: fuse: Remove custom string functions
Remove custom string functions and replace them with normal string
functions. Remove the custom strtou32 and replace it with
simple_strtoul.

Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-04-04 12:25:02 -06:00
Tom Rini
8bc3542384 Merge patch series "pxe: Precursor series for supporting read_all() in extlinux / PXE"
Simon Glass <sjg@chromium.org> says:

This series includes some patches related to allowing read_all() to be
used with the extlinux / PXE bootmeths.

These patches were split out from the stb4 series, since it will need to
have additional patches for LWIP, to avoid breaking PXE booting when
LWIP is used.

Link: https://lore.kernel.org/r/20250306002533.2380866-1-sjg@chromium.org
2025-03-18 13:12:51 -06:00
Simon Glass
0f094b8b14 net: Provide a function to run network operations
Add a new netboot_run() function which can be used for simple network
operations, such as loading a file. Put the implementation in an
internal function, used by the existing code.

Place this function into the net/ code, so that it does not need the
command line to be available.

Document which network operations are supported, i.e. a limited subset,
for now.

For the one board which uses lwip, it is not quite clear how to avoid
using the cmdline interface. This will need some discussion.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:16 -06:00
Simon Glass
f278f0cb49 net: Drop #ifdef in parse_args()
Use IS_ENABLED() to avoid an extra build path.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-18 13:12:16 -06:00
Simon Glass
bfffdfaaf6 net: Refactor part of netboot_common() into a function
Move the core code for starting an netboot operation into a separate
function, so that we can (with additional work) move towards calling it
from outside the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
25d51d3c79 net: Return the size from parse_args()
Rather than setting global variables, return the size, if provided. For
tftput, use the addr argument to store the save address, to avoid adding
yet another parameter.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
f604212048 net: Return the address and size from parse_addr_size()
Rather than updating the global, update the value of some parameters,
so the action of the function is simpler.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
4b6070e056 net: Return the load address from parse_args()
Rather than updating the global, update the value of a parameter, so the
action of the function is simpler.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
f1ece5d86e net: Simplify parse_args()
This function repeats the same code in a few places, namely setting
net_boot_file_name_explicit and copying of the filename to
net_boot_file_name

Move these two operations to the caller, with just the filename (or
NULL) returned by parse_args()

This makes things a little easier to follow.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
3ccbc10cd9 net: Tidy up the comments to parse_args()
This function is a bit vague as to what it does. Expand the comment a
little, to specify which args are provided and which variables are
updated.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-18 13:12:15 -06:00
Simon Glass
2c04afbc95 net: Keep the bootstage functions together
Move the bootstage_mark() function just before net_loop(), so that the
IPv6 code is not in the way.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
c73da92304 x86: Drop the unnecessary base_ptr argument to zboot_dump()
This value is include the bootm_info, so drop the unnecessary parameter.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
1592ff27d5 bootstd: Correct display of kernel version
The address of the bzImage is not recorded in the bootflow, so we cannot
actually locate the version at present. Handle this case, to avoid
showing invalid data.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
4e36b1739b x86: Move the bootm state for zimage into cmd/
Rather than holding the state in the implementation code, move it to the
command code. The state is now passed to the implementation functions
and can there (with future work) be pass in from bootstd, without going
through the commands.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
00cfb598e7 x86: Rename state to bmi
Use the common name for the struct, in preparation for passing it around
between functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
2de073527b x86: Drop duplicate definition of zimage_dump()
This is now defined in bootm.h so drop the duplicate in the x86 code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
299d24eddf x86: Make do_zboot_states() static
This function is only called within zboot.c so make the function
private.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Ilias Apalodimas
e34ecf9d5e meminfo: add memory details for armv8
Upcoming patches are mapping memory with RO, RW^X etc permsissions.
Fix the meminfo command to display them properly

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-14 13:30:12 +02:00
Tom Rini
6fd111bc4e cmd: Drop last reference to CMD_REISERFS
While the code was removed in commit 3766a249a3 ("fs: drop reiserfs")
this reference in the Makefile was missed. Remove it now.

Fixes: 3766a249a3 ("fs: drop reiserfs")
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-03-13 14:23:00 -06:00
Jerome Forissier
12cc6531a1 net: lwip: add support for built-in root certificates
Introduce Kconfig symbols WGET_BUILTIN_CACERT and
WGET_BUILTIN_CACERT_PATH to provide root certificates at build time.

Usage example:

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

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-11 14:16:03 +01:00
Jerome Forissier
2df965d385 net: lwip: extend wget to support CA (root) certificates
Add the "cacert" (Certification Authority certificates) subcommand to
wget to pass root certificates to the code handling the HTTPS protocol.
The subcommand is enabled by the WGET_CACERT Kconfig symbol.

Usage example:

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

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-11 14:16:03 +01:00
Tom Rini
1b42f57ec8 Prepare v2025.04-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmfPdnYACgkQFHw5/5Y0
 tyw17wv+KqFxDoJKTGVWeP4fu+zhTQlFo0f2tAlWylAdJnDP6nR/I49zid2mjRbZ
 2Bq3mE3G2Ag1efJ3UGHck0Zn1O9OpqVvk734IHSJFygN77l2xmNSMXZd8MLOsbaU
 4JXhxbLUdumCSkwVjjc9/sN+kJUfpwmFBwjqPWmE8rVU+IjApdZP0hBmfxACivl3
 p0JJZ870JkgSd5KuAGO/MUbinl/QYOdpitbo2EinOyqnLnivw5PzlcAYF0STNcgJ
 XfsT7Ap9T3woPTkT1mXGo+0gBs1OPxXcXp6nywFY75EVIGYRetDEXr8/jf74Jg83
 XK8+mqFP+bhlLOMydCdRHyQU8+WGNPfWtcOa7ekC3DjR9Kf7VwoTujqa9B9ILg6m
 UBagI/zUIWGAHi4oe2vMV16nR1cPT1ZexPoswZJrj/iDC6WaN0gWwDQgcPODm0UL
 rPYYNPWne/iGYgbkhy1zqZMEj7ytnvtjaVMRFdbTSwWUR3s23q9btqjlOwfXbtYZ
 0ENfAAu0
 =xGcd
 -----END PGP SIGNATURE-----

Merge tag 'v2025.04-rc4' into next

This uses Heinrich's merge of lib/efi_loader/efi_net.c which results in
no changes.
2025-03-10 20:18:51 -06:00
Tom Rini
743c15b9fd Merge patch series "This series adds support for file renaming to EFI_FILE_PROTOCOL.SetInfo()."
Gabriel Dalimonte <gabriel.dalimonte@gmail.com> says:

This series adds support for file renaming to EFI_FILE_PROTOCOL.SetInfo().
One of the use cases for renaming in EFI is to facilitate boot loader
boot counting.

No existing filesystems in U-Boot currently include file renaming,
resulting in support for renaming at the filesystem level and a
concrete implementation for the FAT filesystem.

Link: https://lore.kernel.org/r/20250217182648.31294-1-gabriel.dalimonte@gmail.com
2025-03-07 12:06:21 -06:00
Gabriel Dalimonte
06159a1465 fs: fat: add rename
The implementation roughly follows the POSIX specification for
rename() [1]. The ordering of operations attempting to minimize the chance
for data loss in unexpected circumstances.

The 'mv' command was implemented as a front end for the rename operation
as that is what most users are likely familiar with in terms of behavior.

The 'FAT_RENAME' Kconfig option was added to prevent code size increase on
size-oriented builds like SPL.

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/rename.html

Signed-off-by: Gabriel Dalimonte <gabriel.dalimonte@gmail.com>
2025-03-07 11:50:22 -06:00
Raymond Mao
a26e957381 mbedtls: fix incorrect kconfig dependencies on mbedtls
Fixed the building failures when WGET_HTTPS,NET_LWIP and MBEDTLS_LIB
are selected due to a few incorrect kconfig dependencies.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-02-27 12:11:02 -06:00
Sam Day
6267ce5565 cmd: ufetch: use 3-bit colour ANSI codes
Currently, the 8-bit escapes are being used, which aren't supported by
vidconsole_escape_char. Since the current usage maps directly to the
3-bit equivalents anyway, let's use those instead.

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

Signed-off-by: Sam Day <me@samcday.com>
Tested-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Tested-by: Ferass El Hafidi <funderscore@postmarketos.org>
2025-02-26 13:48:27 +00:00
Tom Rini
3ecda19009 Prepare v2025.04-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAme8+MQACgkQFHw5/5Y0
 tywiiQv+IQhGDnt1knghs1f3N/ImsAof4EG44MuuaYFFIb25NC4WO55rG2J5Jmd/
 zrUEKnwMWjDUmKqt9BneQ+NfsOTKfnUWiSdTv2KOsI/FJGOj0KhU8TDA6qdiR6Ev
 thfN5QKLtSrIgg3ua19LUT1+AComjD6w86GRwpQ2iSy6WuPlqlU3VDB1JndXMDh1
 VIz1wuGp8CFgZWb1h8yznajObqK6PBnGwX3MVkPrV7oUSJgVq7dNid/1NFDl+EsV
 SDKEjUJbnAoWiXbW3q+lBfpyxZ7jnTNl6d5nssnmjTlpOradaEOsaj7Y3MRliSQs
 1Fe6rRd4rEr7jI8jBvyveXEJ8ahocTP0haC5MRhin8R6ZO0faQbm1UVVKINuvVIn
 nNU62IInPJXTVPUBFTnZGnwtowmzSdOyBaLcjzFCGD4M9MOikWNwzymIMN7tinyO
 yAy3eJIwqLJ/AtuqYGIbs5wkRcwZnLz0QM9ebBl8lYzmezsx21Z3LpUqAjhUb9Nr
 nJJrzI2/
 =ExnJ
 -----END PGP SIGNATURE-----

Merge tag 'v2025.04-rc3' into next

Prepare v2025.04-rc3
2025-02-24 17:15:14 -06:00
Tom Rini
3f19062d46 Merge patch series "Introduce K3 remoteproc driver for M4 subsystem"
Judith Mendez <jm@ti.com> says:

Some K3 devices like am62x and am64x have a M4 processor in the MCU
voltage domain. This patch series introduces remoteproc M4 driver which
will be used to load firmware into and start the M4 remote core.

This series also adds support for R5F cores on am64x SoCs in patch 2 and
sets up environment to load FW in remote cores in patch 3,4,5.

This patch series also enables remoteproc drivers by default as per what
remoteproc sybsystem is supported per SoC, thus all remoteproc options
are now deleted in configs/* since they are no longer required.

This patch series was tested on am64x EVM, am62x SK, am62ax SK,
am62px SK boards.

Any additional tested by's are welcome since I was not able to
test any additional boards.

Tested by running the following commands in u-boot prompt:

=> setenv dorprocboot 1
=> run boot_rprocs

Link: https://lore.kernel.org/r/20250210202944.1071931-1-jm@ti.com
2025-02-14 13:39:10 -06:00
Judith Mendez
9e0daf9bac cmd: Enable CMD remoteproc by default for K3 ARCH
Enable CMD_REMOTEPROC by default if building for K3 ARCH so
that it does not have to be defined in each board defconfig
file.

Signed-off-by: Judith Mendez <jm@ti.com>
2025-02-14 13:17:36 -06:00
Jerome Forissier
a091d173e3 net: Kconfig: depend on DM_RNG for WGET_HTTPS
net/lwip/wget.c/mbedtls_hardware_poll() is calling dm_rng_read() but
dependency is not recorded anywhere that's why depend on DM_RNG
when WGET_HTTPS is used.

Suggested-by: Michal Simek <michal.simek@amd.com>
Co-developed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
2025-02-12 12:37:24 -06:00
Tom Rini
ac3dcb0c27 Merge patch series "cmd/setexpr: support concatenation of direct strings"
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says:

The setexpr.s command allows to concatenate two strings.

According to the description in doc/usage/cmd/setexpr.rst the parameters
value1 and value2 can be either direct values or pointers to a
memory location holding the values.

Unfortunately `setexpr.s <value1> + <value2>` fails if any of the values
is a direct value. $? is set to false.

* Add support for direct values in setexpr.s.
* Correct the unit test for "setexpr.s fred 0".
* Add a new unit test for "setexpr.s fred '1' + '3'" giving '13'.
* Remove invalid memory leak tests

Link: https://lore.kernel.org/r/20250203151029.60265-1-heinrich.schuchardt@canonical.com
2025-02-07 13:35:32 -06:00
Heinrich Schuchardt
af7eca24a7 cmd/setexpr: support concatenation of direct strings
The setexpr.s command allows to concatenate two strings.

According to the description in doc/usage/cmd/setexpr.rst the parameters
value1 and value2 can be either direct values or pointers to a
memory location holding the values.

Unfortunately `setexpr.s <value1> + <value2>` fails if any of the values
is a direct value. $? is set to false.

* Add support for direct values in setexpr.s.
* Correct the unit test for "setexpr.s fred 0".
* Add a new unit test for "setexpr.s fred '1' + '3'" giving '13'.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-07 13:35:23 -06:00
Michal Simek
6b82252c36 fpga: Make do_fpga_loads() static
do_fpga_loads() is not called from anywhere else that's why make it static.

Reviewed-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/cbe93e4eb33752aaddc943b15fd04731d4f75b68.1738574893.git.michal.simek@amd.com
2025-02-05 16:22:55 +01:00
Ibai Erkiaga
f8f378877b fpga: add new symbol for fpga_loadb
Adding new symbol for the fpga loadb command which is exclusive to
Xilinx. Default value is y for backward compatibility.

Clarify the type of file used for fpga programming commands

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-6-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-02-05 16:22:55 +01:00
Ibai Erkiaga
ce54f50c9d fpga: xilinx exclusive commands
Ensure all Xilinx exclusive fpga commands have a KConfig symbol and
dependency to FPGA_XILINX listed. Remove (Xilinx only) text from the
help command.

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-5-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-02-05 16:22:55 +01:00
Ibai Erkiaga
4937392254 fpga: resort fpga commands
Resort the fpga commands both in the Kconfig and in the source code to
list

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-4-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-02-05 16:22:55 +01:00
Ibai Erkiaga
d2619de211 fpga: improve loads usage information
Current usage information for loads command is too verbose and long for
a command usage prompt. This flag simplifies the text for readability
purposes.

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-3-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-02-05 16:22:55 +01:00
Ibai Erkiaga
c0fed34e0e fpga: fix alignment on fpga cmd usage info
The current implementation generates some alignment issues as well as
some overlapping when all the fpga command options are enabled. The fix
is intended to improve readability of the usage info.

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Acked-by: Alexander Dahl <ada@thorsis.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-2-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-02-05 16:22:55 +01:00
Heinrich Schuchardt
ca3985ff86 cmd: sbi: add bhyve SBI implementation ID
Bhyve is the hypervisor used by FreeBSD.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-02-03 11:33:04 +08:00
Michal Simek
2b1c8d3b2d cmd: Fix Kconfig coding style
Some entries are not using tabs for indentation and also help should use
two spaces indentation.

Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-01-31 11:29:05 -06:00
Raymond Mao
9d2bc92ba7 tpm: add TPM2_PCR_Allocate command
TPM2_PCR_Allocate command is required to reconfigure a TPM device
to enable or disable algorithms in run-time, thus this patch introduces
the implementation of PCR allocate APIs and adds related cmd functions
for testing.

To test the feature, ensure that TPM is started up.
Run pcr_allocate command to turn on/off an algorithm, multiple calls
are supported and all changes will be cached:
`tpm2 pcr_allocate <algorithm_name> <on|off>`
Run startup command with argument 'off' to shutdown the TPM.
`tpm2 startup TPM2_SU_CLEAR off`
Reboot the board via `reset` to activate the changes.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-01-28 08:58:41 +02:00
Raymond Mao
6d8e52a6e3 tpm: add TPM2_Shutdown command
TPM2_shutdown command is sharing same structure and logics with
TPM2_startup, thus this patch extends the existing startup APIs and
cmd functions to support shutdown instead of created new ones.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-01-28 08:58:41 +02:00
Heinrich Schuchardt
cb43e3e427 log: enable filtering on functions
Up to now we could only use log level, category, and file for filtering.
Allow filtering on a list of functions.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-01-26 11:06:56 +01:00
Tom Rini
a3b71cc6f5 Merge patch series "upl: Prerequite patches for updated spec"
Simon Glass <sjg@chromium.org> says:

The current UPL spec[1] has been tidied up and improved over the last
year, since U-Boot's original UPL support was written.

This series includes some prerequisite patches needed for the real UPL
patches. It is split from [2]

[1] https://github.com/UniversalPayload/spec/tree/3f1450d
[2] https://patchwork.ozlabs.org/project/uboot/list/?series=438574&state=*

Link: https://lore.kernel.org/r/20250111000029.245022-1-sjg@chromium.org
2025-01-22 17:08:47 -06:00
Simon Glass
c83e71064e boot: Rename fit_image_get_data_and_size()
This function is really just getting the data. The size comes along for
the ride. In fact this function is only reliable way to obtain the data
for an image in a FIT, since the FIT may use external data.

Rename it to fit_image_get_data()

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-22 15:58:04 -06:00
Simon Glass
78bff2ebba x86: Enable meminfo command
Enable this command for x86 boards as it is quite useful for seeing
where memory is.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-22 15:58:03 -06:00
J. Neuschäfer
3db33a6fd6
cmd: ufetch: Show CPU architecture under "CPU"
When looking at ufetch output it isn't immediately obvious which CPU
architecture the presented board has. This patch therefore adds the
CPU architecture string (for example "powerpc") to the "CPU:" line.
The new format is:

	CPU: powerpc (1 cores, 1 in use)

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20241211-ufetch-v2-3-2b5432ffaeb1@posteo.net
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-01-22 16:43:54 +01:00
J. Neuschäfer
c38d5bad35
cmd: Allow building ufetch without CONFIG_BLK
The ufetch command is still quite useful on systems without block
device support; remove the CONFIG_BLK dependency and make sure the code
compiles/works with and without CONFIG_BLK.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Link: https://lore.kernel.org/r/20241211-ufetch-v2-2-2b5432ffaeb1@posteo.net
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-01-22 16:43:54 +01:00
J. Neuschäfer
e288366364
cmd: ufetch: Fix type mismatch on 32-bit
On 32-bit architectures, LAST_LINE (_LAST_LINE - 1UL) is 64 bits long,
but size_t (from ARRAY_SIZE(...)) is 32 bits. This results in a warning
because the max() macro expects the same type on both sides:

cmd/ufetch.c: In function ‘do_ufetch’:
include/linux/kernel.h:179:24: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
  179 |         (void) (&_max1 == &_max2);              \
      |                        ^~
cmd/ufetch.c:92:25: note: in expansion of macro ‘max’
   92 |         int num_lines = max(LAST_LINE + 1, ARRAY_SIZE(logo_lines));
      |                         ^~~

Fix this by casting LAST_LINE to size_t.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Link: https://lore.kernel.org/r/20241211-ufetch-v2-1-2b5432ffaeb1@posteo.net
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-01-22 16:43:54 +01:00