Commit graph

2191 commits

Author SHA1 Message Date
Samuel Dionne-Riel
373991d693 common: Kconfig: Fix CMD_BMP/BMP dependency
Using `default y` will not select BMP when CMD_BMP has been enabled, if
it was already configured.

By using `select`, if `CMD_BMP` is turned on, it will force the presence
of `BMP`.

Fixes: 072b0e16c4 ("common: Kconfig: Add BMP configs")
Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
2023-07-21 15:32:12 -04:00
Heinrich Schuchardt
338b67f76c cmd: fix loads, saves on sandbox
The loads and saves commands crash on the sandbox due to illegal memory
access.

For command line arguments the sandbox uses a virtual address space which
does not equal the addresses of the memory allocated with memmap(). Add the
missing address translations for the loads and saves commands.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20 14:10:57 -06:00
Joshua Watt
55a4244372 cmd: mbr: Force DOS driver to be used for verify
Forces the DOS partition type driver to be used when verifying the MBR.
This is particularly useful when using a hybrid MBR & GPT layout as
otherwise MBR verification would mostly likely fail since the GPT
partitions will be returned, even if the MBR is actually valid.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17 16:20:08 -04:00
Joshua Watt
22cdb3f0f1 android_ab: Add option to skip decrementing tries
It is is sometimes desired to be able to skip decrementing the number of
tries remaining in an Android A/B boot, and instead just check which
slot will be tried later. This can commonly be be the case for platforms
that want to A/B u-boot itself, but are required to boot from a FAT MBR
partition. In these cases, u-boot must do an early check that the MBR
points to the correct A/B boot partition, and if not rewrite the MBR to
point to the correct one and reboot. Decrementing the try count in this
case is not desired because it means that each u-boot might constantly
ping-pong overwriting the MBR and rebooting until all the retries are
used up.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-07-17 15:39:55 -04:00
Tom Rini
13aa090b87 Merge https://source.denx.de/u-boot/custodians/u-boot-x86
- bootstd: Add a bootmeth for ChromiumOS on x86
- x86: Use qemu-x86_64 to boot EFI installers
2023-07-17 10:38:28 -04:00
Simon Glass
0be0f205b9 bdinfo: Show the malloc base with the bdinfo command
It is useful to see the base of the malloc region. This is visible when
debugging but not in normal usage.

Add it to the global data so that it can be shown.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Nikhil M Jain <n-jain1@ti.com>
2023-07-17 17:12:21 +08:00
Simon Glass
d2e7972d7b qfw: Show the file address if available
Some files have an associated address. Show this with the 'qfw list'
command so that it is possible to dump the data.

Note that the reference to 'md' is for the md.rst file, not a
markdown file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17 17:12:07 +08:00
Simon Glass
125194e6a1 part: Allow setting the partition-table type
Some devices have multiple partition types available on the same media.
It is sometimes useful to see these to check that everything is working
correctly.

Provide a way to manually set the partition-table type, avoiding the
auto-detection process.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17 17:12:06 +08:00
Simon Glass
b279f5170a bdinfo: Show the RAM top and approximate stack pointer
These are useful pieces of information when debugging. The RAM top shows
where U-Boot started allocating memory from, before it relocated. The
stack pointer can be checked to ensure it is in the correct region.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Nikhil M Jain <n-jain1@ti.com>
2023-07-17 17:12:03 +08:00
Simon Glass
297184143a acpi: Add a comment to set the acpi tables
Sometimes a previous bootloader has written ACPI tables. It is useful to
be able to find and list these. Add an 'acpi set' command to set the
address for these tables.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17 17:08:44 +08:00
Simon Glass
4fb2536e5b x86: Allow listing MTRRs in SPL
Move MTRR-listing code into a common file so it can be used from SPL.
Update the 'mtrr' command to call it.

Use this in SPL just before adjusting the MTRRs, so we can see the state
set up by the board. Only show it when debug is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17 17:08:44 +08:00
Simon Glass
33ebcb4681 bootstd: Support automatically setting Linux parameters
Some Linux parameters can be set automatically by U-Boot, if it knows the
device being used. For example, since U-Boot knows the serial console
being used, it can add parameters for earlycon and console.

Add support for this.

Note that this is an experimental feature and we will see how useful it
turns out to be. It is very handy for ChromeOS, since otherwise it is very
difficult to manually determine the UART address or port number,
particularly in a script.

Provide an example of how this is used with ChromeOS.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17 13:38:35 +08:00
Simon Glass
82c0938f1d bootstd: Add support for updating elements of the cmdline
Add a bootflow command to update the command line more easily. This allows
changing a particular parameter rather than editing a very long strings.
It is also easier to handle with scripting.

The new 'bootflow cmdline' command allows getting and setting single
parameters.

Fix up the example output while we are here, since there are a few new
items.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17 13:38:35 +08:00
Simon Glass
347a845aec bdinfo: Show information about the serial port
It is useful to see the detailed setting of the serial port, e.g. to
allow setting up earlycon or console for Linux. Add this output to the
'bdinfo' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: squashed in 20230716033929.253357-2-sjg@chromium.org]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17 13:38:34 +08:00
Simon Glass
43b6fa9c14 bootstd: Allow storing x86 setup information
On x86 boards Linux uses a block of binary data to provide information
about the command line, memory map, etc. Provide a way to store this in
the bootflow so it can be passed on to the OS.

No attempt is made to generalise the code, since other archs don't need
this information. The field is present always, though, to avoid needing
accessors or #ifdefs when building code on other archs.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16 23:13:17 +08:00
Simon Glass
d42243fe21 bootstd: Use the bootargs env var for changing the cmdline
The "bootargs" environment variable is used to set the command-line
arguments to pass to the OS. Use this same mechanism with bootstd as well.
When the variable is updated, it is written to the current bootflow. When
the current bootflow is updated, the environment variable is updated too.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16 23:13:17 +08:00
Simon Glass
f4a91655c3 bootstd: Allow storing the OS command line in the bootflow
Some operating systems have a command line which can be adjusted before
booting. Store this in the bootflow so it can be controlled within
U-Boot.

Fix up the example output while we are here, since there are a few new
items.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16 23:13:17 +08:00
Tom Rini
3a7a17dbdc Pull request efi-2023-10-rc1
Documentation:
 
 * enhance UEFI anti-rollback documentation
 
 EFI:
 
 * Reconnect drivers if UninstallProtocol fails
 * Prefer short device paths for boot options
 * Fix error handling when updating boot options for block devices
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmSyctkACgkQxIHbvCwF
 GsQowA//X8yryuuYnXu1z2/L9GWeIi/467M4xulThHgODq7NaUAZw+hOa/roQ8ND
 HbVzdkU/ZROmYlC/+nAPPCIPodYryvjrLtPflBIxQy1hf4NlVCJGFTqZM+uJGe9b
 kjXuKAd7oAUIbwsDEBF7tBg/lAKn7xhRUbajnd8LGganSWSmYC/kE5ZjPz68Upg+
 K3Smw4BwOI2bdTqJsq2XTMx97k4QDKx8qeAoTkYbHTco/eDTAmMIqKSnl3/rP1lg
 5m1SDAlkxqEvpuyTifaPrQx7chf2b0v5z0iF6yaqDCYb/07GdZLPm3lG3w4stLce
 c0BWS0uCPTW6bvX93QF8hm7ImiEdwzQNMpNl2x+8Zx6RoU0yx/gh4VdtLTTbY7tX
 904m4Tn5Ez6Mtb6/fcAAiVakzTiuf8Zogr7lkDV0jf5UghBrPCM3xqwAwyD5luCX
 huImX6QKzlmiUSM/qzr7i6+PWYp1tMgYwvzwDy9BH1zW9C910HJstiKnvaATdstw
 w3P63x7ryH8hnGV8YjeWs3GBCHHb/8WI5G88dZYjChya0Q1DPsSCA0QzBd+XRhVB
 mb6lGj6pvpmp9UqLP6EQxQpK5jGyIBk5NMs1w2wij0oT6kPeLwcOIQ0uyeKPR2bP
 S4jBa6Qx28uQpcF1R9m8Azs3QJYdeyCAIou2Qz4ndhERCpKKNIc=
 =+qF4
 -----END PGP SIGNATURE-----

Merge tag 'efi-2023-10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-10-rc1

Documentation:

* enhance UEFI anti-rollback documentation

EFI:

* Reconnect drivers if UninstallProtocol fails
* Prefer short device paths for boot options
* Fix error handling when updating boot options for block devices
2023-07-15 11:19:11 -04:00
Raymond Mao
9945bc4f86 Fix incorrect return code of boot option update
Correct the return code for out-of-memory and no boot option found

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-15 11:20:41 +02:00
Raymond Mao
339b527bd4 Move bootorder and bootoption apis to lib
Rename and move bootorder and bootoption apis from cmd to lib
for re-use between eficonfig and bootmgr
Fix 'unexpected indentation' when 'make htmldocs' after functions
are moved

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-15 11:20:41 +02:00
Peter Robinson
10de125707 disable NFS support by default
While NFS is widely used in data centres, and private
networks it's quite a nuanced usecase for device firmware.
A lot of devices already disable it.

Various network protocols should really be opt in, not opt
out, because they add extra size and are potential attack
vectors from a security PoV. In the NFS case it doesn't
really make sense for a lot of devices like tables, SBCs etc.
It's also something we don't really want for SystemReady-IR
due to security concerns.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-14 15:21:07 -04:00
Simon Glass
a0874dc4ac expo: Add a configuration editor
Add a new 'cedit' command which allows editing configuration using an
expo. The configuration items appear as menus on the display.

This is extremely basic, only supporting menus and not providing any way
to load or save the configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14 12:54:51 -04:00
Simon Glass
822f7a4543 cat: Update command to use fs_load_alloc()
Use this new function since it implements the required functionality and
reduces duplicated code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14 12:54:51 -04:00
Tom Rini
8e21064cb3 Pull request efi-2023-07-rc7
Documentation:
 
 * Fix links to Linux kernel documentation
 
 UEFI:
 
 * Fix memory leak in efidebug dh subcommand
 * Fix underflow when calculating remaining variable store size
 * Increase default variable store size to 64 KiB
 * mkeficapsule: fix efi_firmware_management_capsule_header data type
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmSqfx0ACgkQxIHbvCwF
 GsRFeA/+O4zGJ5HnHpJtGjmJzvEzQZFv65pr8y4I72wO9wwY8RhWeBnup39j5Tlm
 hMDLPptqoDw/3eFaDEhxW8Rbi6Pz3hizSg7RP/HNzj5Efrl8sFij2aDwKyTQr7jx
 yjJNuiQZHitWg9iOSHNDzVB79pT+abMNZmvk9ASRcDDtSuiwsy7MZGBxynmBRAJX
 UP8RKa0tmC6/d5DlLRvZtCtnQ5YI4IDMWoZsgIedt1SkIVVj9lZcanHWMOD6Lcrw
 PgLZZdy/cwbK8vl6sIqsJBVpSuZSbhL3yA5ZEAFWmIQWuogcbbaH8PMeYvoHlJPP
 f8mlCTnoF9vCc2LOFUog84KlwGrtQc+qSZMfOP+hBGBgpxf1MmPA7fhhRB6+lfrJ
 27TJUNf0+wnpeuDGtQ+qr6/PXP9fFgopvWMR/G/2XWjZK2xkqsVYK+BH55/V93By
 oZrRBlrBSre5uFZHcWYGAYP5Drddif7Ex++gUJhucbb9Bp6uqGVm2r/k3gscX4kk
 HkbCl9IwRasZCBOK+xCZulJ/OVF5bzV+8zQHtMo6cN8ilz830WyLAmiaFQxROXxN
 f6eXeYTSKQikKiZegFD4+/yG5XgxAezO9YkhJZwd082JcSFuF3RdwrHzk4mKxhRC
 9IVBt855sI4HxAE3V5JlbGgufxCro4wNU7Z6abrcNGI73UxqOSA=
 =p8s8
 -----END PGP SIGNATURE-----

Merge tag 'efi-2023-07-rc7' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-07-rc7

Documentation:

* Fix links to Linux kernel documentation

UEFI:

* Fix memory leak in efidebug dh subcommand
* Fix underflow when calculating remaining variable store size
* Increase default variable store size to 64 KiB
* mkeficapsule: fix efi_firmware_management_capsule_header data type
2023-07-11 13:27:32 -04:00
Masahisa Kojima
0c95744bcc cmd: efidebug: add missing efi_free_pool for dh subcommand
This adds the missing efi_free_pool call for dh subcommand.

Fixes: a80146205d ("cmd: efidebug: add dh command")
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-07-09 03:53:08 +02:00
Ying Sun
aadc1a6069 cmd: CONFIG_CMD_SAVES depends on CONFIG_CMD_LOADS
CONFIG_CMD_SAVES is used to enable support for the "saveenv" command
and is only implemented in cmd/load.c
when "#if defined(CONFIG_CMD_LOADS)" is met.

It is recommended to add dependency constraints to its definition.
Prevents "saveenv" command from not being supported
when "CONFIG_CMD_SAVES=y CONFIG_CMD_LOADS=n".

Suggested-by: Yanjie Ren <renyanjie01@gmail.com>
Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-07 16:25:56 -04:00
Heinrich Schuchardt
7906155ed3 cmd/sbi: display new extensions
OpenSBI already implements some extensions that are not ratified yet:

* Debug Console Extension (DBCN)
* System Suspend Extension (SUSP)
* Collaborative Processor Performance Control Extension (CPPC)

Allow the sbi command to display these.

Provide the FID definitions of the Debug Console Extension. We can use that
extension for an early debug console driver.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-07-06 17:28:08 +08:00
Tom Rini
e80f4079b3 Prepare v2023.07-rc6
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmSjExsACgkQFHw5/5Y0
 tywJ3gwAsTbr9mCmCzaKs2F/Jh6H47WEUMEz96wE8eXwuS57pfNJhml4v2rEhYpQ
 MlBjz6vTOyHDrtinRlvempJWVZEuoflMb6M2OTqVFqZPuPT3cLLuSdM4pgb5SdKS
 jNDWcxr12LqiDS0Mz+QOHdps3H8mzsCnOXeOTT+VaSeYHPOLQ+M9OV2o/aY2BsNi
 JLAGX+8i7FuZnVYZzSv6PQYYGZZV+Kvl5oLlPPJttsA7bGu4m2k8zRQQdzd+PIbu
 owAh3CHSKCy1g+y7ASn1Nd2VE06huvqGG7Qo2sj+Ypf/wbNy16qbMc2C7HDwDcul
 nrnf6BZ+MTelwxyPHBOR52ERgY6H8rgpvsCNL0arxaCHJOVddXtrUY1591vE71aB
 nGxhnyLnHwOXXdDGsPsR7p4SF16e6RzaINKmDorQ37nidRnTFLlFCxidnR8ztscR
 aUpLraqYUquGJf7lejYX2OZg2f36lvpYKy1lwuJfd9fUSgK8iyUKrE9wOJhWnTK8
 cIOnS/A+
 =DNor
 -----END PGP SIGNATURE-----

Merge tag 'v2023.07-rc6' into next

Prepare v2023.07-rc6
2023-07-05 11:28:55 -04:00
Marek Vasut
77aed22b48 spl: spl_legacy: Add extra address checks
Check whether the loaded image or entry point does not overlap SPL.

Signed-off-by: Marek Vasut <marex@denx.de>
2023-06-24 13:47:00 -04:00
Xavier Drudis Ferran
7a875a8e5c cmd: usb: Prevent reset in usb tree/info command
Commands causing reset in some configs:

When bootflow scan is run, this will cause a UCLASS_BOOTDEV device to
be added as sibling of those UCLASS_BLK devices found in the search
chain defined in environment variable "boot_targets", until boot
succeeds from some device. This can happen automatically as part of
the default boot process on some boards (example: Rock Pi 4) depending
on the board configuration (DISTRO_DEFAULTS, BOOTSTD, BOOTCOMMAND,
etc.) because they have bootcmd=bootflow scan.

If boot doesn't succeed from any device, and usb is in boot_targets,
and an usb storage device is plugged to some usb port at boot time,
its UCLASS_MASS_STORAGE device will have a UCLASS_BOOTDEV device as
child, besides a UCLASS_BLK child.

If once the boot fails the user enters at the U-Boot shell prompt:

usb info

or

usb tree

The code in cmd/usb.c will eventually recurse into the UCLASS_BOOTDEV
device and pass a null usb_device pointer to usb_show_tree_graph() or
usb_show_info() (because it has no parent_priv_).

This causes a reset. The expected behaviour would be to ignore the
UCLASS_BOOTDEV device, continue listing the usb information and return
to the prompt.

   Minimal test:

Another way to trigger this reset as a minimal test or on boards with
a different bootcmd would be:

- make sure "usb" is in environment variable boot_targets (might need
  setenv boot_targets usb; and/or saveenv and reset), then, with a usb
  storage device plugged to a usb port, run:

=> usb reset ; bootflow scan ; usb info

   Solution:

Fix it (twice) by checking for null parent_priv_ and adding
UCLASS_BOOTDEV to the list of ignored class ids before the recursive
call.

This prevents the current particular problem with UCLASS_BOOTDEV, even
in case it ever gets some parent_priv_ struct which is not an
usb_device, despite being the child of a usb_device->dev. And it also
prevents possible future problems if other children are added to usb
devices that don't have parent_priv_ because they are not part of the
usb tree, just abstractions of functionality (like UCLASS_BLK and
UCLASS_BOOTDEV are now).

Signed-off-by: Xavier Drudis Ferran <xdrudis@tinet.cat>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
2023-06-21 13:08:30 +02:00
Sean Edmond
1b3117db3e net: ipv6: Fix CID 453851 and CID 436278
CID 453851 : sprintf() shouldn't copy from/to tmp
CID 436278 : DHCP6 option_len should be checked before use

Signed-off-by: Sean Edmond <seanedmond@microsoft.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-06-14 15:48:45 -04:00
Ioana Ciornei
c85e96d0d1 cmd: net: add a 'net stats' command to dump network statistics
Add a new option to the 'net' command which can be used to dump network
statistics.

To do this, 3 new callbacks are added to the eth_ops structure:
.get_sset_count(), .get_strings(), .get_stats(). These callbacks
have the same functions as in Linux: to return the number of counters,
the strings which describe those counters and the actual values.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-06-14 18:40:16 +08:00
Tom Rini
cb4fe56eca tpm autostart
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgWII69YpahbL5iK5gS8AYozs+qIFAmSIBcIACgkQgS8AYozs
 +qI6Xw/+P3tRSykQSKAFzvmOxdh8XiBk8EWv6aT0YhAlbl9sRyV1t/tnce54UE6F
 QQQ3cSDGaPsDLRbWtI/FLWdjbxWz7f0Lj1a3YyxodBV3cG7fD/+U3xQbwpJAGlis
 UTqWgWZp6qVQpBb0+44YkDybNiiM8CDTPYYaODITJijVHauMQxVFn/RX/A+5uH6B
 zIG0NyCelPCx6gVqezxP4LsXhBiU6GaB8mCRkMILdXrLk/1+IjvJScKFQcu3dNTD
 /QGe4SPDVFr2l8eQytmjGdvWlSpC686iyL/eIHoAugSdlHL/hLEkIa8uol+loZXx
 RCbcqLYPumq1m0D/UZbFVyoTnOXPQVEBQtG/tGkcUlOGd1T8/7CDWZ8iihq0n6oZ
 h3wV5nBYzEHdPb4Yn58JxCfJINTTZr8VEB46DCBM729MWght/Zmrtw4KlfczApDE
 XygXDfqQk/P1B1qiMatvXQJmnKq1PkDXo4MYz9EVJYF3kBPqFZUAt8wjtsW+pviJ
 mn/KKuhr6cNTjPTbadUrg69AZmGRKpNB22Ba1kBGOc8P1LzG0YIV0gS09Om3psX1
 WP93Lfxn5fdHGFUsIjWZOM0gj8zIttvLUPtY26KWnAz0qYOR//IOYfmGtt69LNby
 sUbIRPW+NBqjFtldh6xt3kLhR46YLWSsNzhsRwCLtlW8qDUBHWs=
 =qPYf
 -----END PGP SIGNATURE-----

Merge tag 'tpm-for_tom-13062023' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next

tpm autostart
2023-06-13 13:14:49 -04:00
Ilias Apalodimas
e663b2ff4b tpm: Add 'tpm autostart' shell command
For a TPM device to be operational we need to initialize it and
perform its startup sequence.  The 'tpm init' command currently calls
tpm_init() which ends up calling the ->open() per-device callback and
performs the initial hardware configuration as well as requesting
locality 0 for the caller.  There no code that currently calls
tpm_init() without following up with a tpm_startup() and tpm_self_test_full()
or tpm_continue_self_test().

So let's add a 'tpm autostart' command and call tpm_auto_start() which
leaves the device in an operational state.

It's worth noting that calling tpm_init() only, doesn't allow a someone
to use the TPM since the startup sequence is mandatory. We always
repeat the pattern of calling
- tpm_init()
- tpm_startup()
- tpm_self_test_full() or tpm_continue_self_test()

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-06-13 08:51:07 +03:00
Tom Rini
7da82de916 Xilinx changes for v2023.10-rc1
global:
 - Use proper U-Boot project name
 
 Fix sparse warnings in zynqmp-clk, zynqmp handoff, board
 
 cmd:
 - Cover incorrect 0 length entries
 
 Versal NET:
 - Add bootmode logic
 - Support SPP production version
 - Add loadpdi command
 
 ZynqMP:
 - Clear pmufw node command ID handling
 - Change power domain behavior around zynqmp_pmufw_node()
 - Fix zynqmp cmd return values and pmufw command
 - Fix R5 tcm init and modes
 
 mmc:
 - Sync Versal NET emmc DT binding
 
 pcie:
 - Add support for ZynqMP PCIe root port
 
 video:
 - Add support for ZynqMP DP
 
 tools:
 - Fix debug message in relocate-rela
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZIcDaAAKCRDKSWXLKUoM
 IZmlAKCbiI7CS8ngZpbzOIuMveebNn1jYgCghyl20Bb2zWoNy+sIY2fPIO9mwx4=
 =wPDv
 -----END PGP SIGNATURE-----

Merge tag 'xilinx-for-v2023.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next

Xilinx changes for v2023.10-rc1

global:
- Use proper U-Boot project name

Fix sparse warnings in zynqmp-clk, zynqmp handoff, board

cmd:
- Cover incorrect 0 length entries

Versal NET:
- Add bootmode logic
- Support SPP production version
- Add loadpdi command

ZynqMP:
- Clear pmufw node command ID handling
- Change power domain behavior around zynqmp_pmufw_node()
- Fix zynqmp cmd return values and pmufw command
- Fix R5 tcm init and modes

mmc:
- Sync Versal NET emmc DT binding

pcie:
- Add support for ZynqMP PCIe root port

video:
- Add support for ZynqMP DP

tools:
- Fix debug message in relocate-rela
2023-06-12 16:42:37 -04:00
Tom Rini
260d4962e0 Merge tag v2023.07-rc4 into next
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-06-12 14:55:33 -04:00
Michal Simek
1be82afa80 global: Use proper project name U-Boot
Use proper project name in comments, Kconfig, readmes.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0dbdf0432405c1c38ffca55703b6737a48219e79.1684307818.git.michal.simek@amd.com
2023-06-12 13:24:31 +02:00
Ashok Reddy Soma
f5aa35c932 cmd: sf/nand: Print and return failure when 0 length is passed
For sf commands, when '0' length is passed for erase, update, write or
read, there might be undesired results. Ideally '0' length means nothing to
do.

So print 'ERROR: Invalid size 0' and return cmd failure when length '0' is
passed to sf commands. Same thing applies for nand commands also.

Example:

ZynqMP> sf erase 0 0
ERROR: Invalid size 0
ZynqMP> sf write 10000 0 0
ERROR: Invalid size 0
ZynqMP> sf read 10000 0 0
ERROR: Invalid size 0
ZynqMP> sf update 1000 10000 0
ERROR: Invalid size 0
ZynqMP>

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230516115236.22458-1-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-06-12 13:24:31 +02:00
Jassi Brar
1e917a69e5 fwu: rename fwu_get_verified_mdata to fwu_get_mdata
fwu_get_mdata() sounds more appropriate than fwu_get_verified_mdata()

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2023-06-09 13:52:40 -04:00
Jassi Brar
246ec2a12c fwu: meta-data: switch to management by common code
The common code can now read, verify and fix meta-data copies
while exposing one consistent structure to users.
 Only the .read_mdata() and .write_mdata() callbacks of fwu_mdata_ops
are needed. Get rid of .get_mdata() .update_mdata() .get_mdata_part_num()
.read_mdata_partition() and .write_mdata_partition() and also the
corresponding wrapper functions.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2023-06-09 13:52:40 -04:00
Ben Dooks
b46cec4166 ubifs: allow loading to above 4GiB
The ubifsload command is truncating any address above 4GiB as it casts
this address to an u32, instead of using an unsigned long which most of
the other load commands do. Change this to an unsigned long to allow
loading into high memory for boards which use these areas.

Fixes the following error:

=> ubifsload 0x2100000000 /boot/Image.lzma
Loading file '/boot/Image.lzma' to addr 0x00000000...
Unhandled exception: Store/AMO access fault

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
2023-06-06 10:37:25 +02:00
Ashok Reddy Soma
899fb5aa8b cmd: sf/nand: Print and return failure when 0 length is passed
For sf commands, when '0' length is passed for erase, update, write or
read, there might be undesired results. Ideally '0' length means nothing to
do.

So print 'ERROR: Invalid size 0' and return cmd failure when length '0' is
passed to sf commands. Same thing applies for nand commands also.

Example:

ZynqMP> sf erase 0 0
ERROR: Invalid size 0
ZynqMP> sf write 10000 0 0
ERROR: Invalid size 0
ZynqMP> sf read 10000 0 0
ERROR: Invalid size 0
ZynqMP> sf update 1000 10000 0
ERROR: Invalid size 0
ZynqMP>

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
2023-05-31 17:23:01 -04:00
Baruch Siach
d20481ee3c cmd: fs: document where 'size' stores its result
Make it a little bit easier for the user to utilize the 'size' command.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-31 17:23:01 -04:00
Bin Meng
33c63cea5e cmd: fdt: Correct checking of configuration node
fit_conf_get_node() returns a negative value on error.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-31 17:23:01 -04:00
Simon Glass
1e4d965b59 acpi: Put the version numbers in a central place
At present two acpi files are built every time since they use a version
number from version.h

This is not necessary. Make use of the same technique as for the version
string, so that they are build only when they change.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-31 17:23:01 -04:00
Tom Rini
6e1852ca2c Pull request efi-2023-07-rc3
Documentation:
 
 * update the description of signature algorithms
 
 UEFI:
 
 * fix unaligned access to GUID in HII database protocol
 * fix launching EFI binaries loaded via semihosting
 * fix filling of file path in loaded image protocol for non-block devices
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmRjIuIACgkQxIHbvCwF
 GsQsZQ/9HijBls1e0WV58F01w3ky0NQoJRVi0ujMEzQuPBkJX1i718f1O+QxJF43
 dpHNiPkXvC9PHDHxBevyC0x0ptsqeNB5Tg5gpl3/M1Ko+23nP4ozhJ6TrtngJ50h
 P9aadOhVAUPH1c4/tIqVFNBI8DrRl8waQ9F8hnycJQ8kw76ye5YBYWwcHKVBwoyc
 1ZIt60M3pBsopQJEVbaoUOc223yYnaV2mLweihndUsRjAI8xO8FNBcyTnDtwazLj
 5F99AnZ1JWH5fYVI+M8ssfMS14SkmdGXH3drbcsQtiUs3k1pFHihBfQdYalfgB/9
 QYsPc7A84Nua+5SajNd6aSFuZCmCXU/4yaAWKIaoKVfGVgsGrRxbqvDuKz3ax4Gb
 jLHWt+mLnk8IrLYNG91QrlA7vUxEcurSUnvq3j69MRUSJWUlDj+bkyGBzWcsdB2K
 niliWo53CFCqRmVL9wf8kLEdaOMV8KJ1V7dxZvbbUa48HccfBXzxbSYnNm1//RYL
 M3jOmBYr0p//I6vLk2P8NWpPqyJUPgrcCHF7RGS8axfa24HMhj2ECJMiXlO8beUx
 CeVov+8GhuRKAcUyf6NaUcbQhyHCk5szEbBKqlH4rwLyuuumOdyB+4SP/WDs7n+x
 +JEqK4m6yfzlkJM9UBHM/yG88DwDhEszk8u22x5/oU9SbYsvTx8=
 =gJu0
 -----END PGP SIGNATURE-----

Merge tag 'efi-2023-07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-07-rc3

Documentation:

* update the description of signature algorithms

UEFI:

* fix unaligned access to GUID in HII database protocol
* fix launching EFI binaries loaded via semihosting
* fix filling of file path in loaded image protocol for non-block devices
2023-05-16 11:23:30 -04:00
Simon Glass
c889434845 bootstd: Tidy up reporting of errors
In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-13 09:52:32 -04:00
Simon Glass
d8d40bc392 bootstd: Correct default boot command
The patch to relax flag requirements was not accepted[1], so we still have
to have separate bootcommands depending on CMD_BOOTFLOW_FULL.

The previous attempt at this did not work, since it used the wrong name
for the options.

Fix this and change the message to mention BOOTSTD_FULL since this affects
not just the flags, but all functionality, so is more likely what the user
wants.

Drop the useless condition on CMD_BOOTFLOW_FULL while we are here.

[1] https://patchwork.ozlabs.org/project/uboot/patch/20230329071655.1959513-2-sjg@chromium.org/

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: a91492b6e9 ("bootstd: Provide a default command")
2023-05-13 09:52:32 -04:00
Simon Glass
9fea3a799d usb: Tidy up the usb_start flag
This should be declared in a header file so that type-checking works
correctly.

Add a single declaration to usb.h and remove the others.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2023-05-13 09:52:32 -04:00
Heinrich Schuchardt
c7c0ca3767 efi_loader: fix efi_dp_from_file()
* When called from efi_dp_from_name() we miss to append the filename
  for non-block devices.
* expand_media_path() could be simplified by using efi_dp_from_file to
  prepend the device path of the boot device.

This can be avoided by passing a device path to efi_dp_from_file() instead
of a block device descriptor and a partition number.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-05-13 11:09:51 +02:00