]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
2 years agopci: pcie-brcmstb: bring over some robustness improvements from Linux
Sam Edwards [Mon, 14 Aug 2023 22:34:13 +0000 (16:34 -0600)] 
pci: pcie-brcmstb: bring over some robustness improvements from Linux

Since the initial U-Boot driver was ported here from Linux, the latter
has had a few changes for robustness/stability. This patch brings over
two of them:
- Do not attempt to access the configuration space of a PCIe device if
  the link has gone down, as that will result in an asynchronous SError
  interrupt which will crash U-Boot.
- Wait for the recommended 100ms after PERST# is deasserted.

I sent this patch while debugging a crash involving PCIe, but these
are unrelated improvements. I do not believe that this patch fixes any
real-world bug.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2 years agoMerge tag 'u-boot-at91-2023.10-a' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Wed, 30 Aug 2023 13:32:10 +0000 (09:32 -0400)] 
Merge tag 'u-boot-at91-2023.10-a' of https://source.denx.de/u-boot/custodians/u-boot-at91 into next

First set of u-boot-at91 features for the 2023.10 cycle:

This feature set includes a new board sama5d29 Curiosity, and various
fixes and alignments for sam9x60 and sam9x60 curiosity board.

2 years agoMerge branch '2023-08-29-integrate-efi-capsule-update-better-in-to-u-boot-buildflow...
Tom Rini [Tue, 29 Aug 2023 20:58:42 +0000 (16:58 -0400)] 
Merge branch '2023-08-29-integrate-efi-capsule-update-better-in-to-u-boot-buildflow' into next

To quote the author:
This patchset aims to bring two capsule related tasks under the U-Boot
build flow.

The first task is related to generation of capsules. The capsules can be
generated as part of U-Boot build, and this is being achieved through
binman, by adding a capsule entry type. The capsules can be generated by
specifying the capsule parameters as properties under the capsule entry
node.

The other task is the embedding of the public key into the platform's
DTB. The public key is in the form of an EFI Signature List(ESL) file
and is used for capsule authentication. This is being achieved by adding
the signature node containing the capsule public key in the platform's
DTB.

Corresponding changes have also been made to the test setup of the EFI
capsule update feature. The ESL public key file was embedded into the
sandbox platform's test.dtb as part of the test setup, post U-Boot
build. This is now no longer needed as the embedding of the ESL happens
as part of the build.

Secondly, the capsules needed for testing the EFI capsule update feature
were being generated through the invocation of the mkeficapsule tool.
This setup has also been changed to introduce generation of these
capsules through binman.

The document has been updated to reflect the above changes.

2 years agodoc: capsule: Document the new mechanism to embed ESL file into dtb
Sughosh Ganu [Tue, 22 Aug 2023 17:40:08 +0000 (23:10 +0530)] 
doc: capsule: Document the new mechanism to embed ESL file into dtb

Update the document to specify how the EFI Signature List(ESL) file
can be embedded into the platform's dtb as part of the U-Boot build.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agotest: capsule: Remove logic to add public key ESL
Sughosh Ganu [Tue, 22 Aug 2023 17:40:07 +0000 (23:10 +0530)] 
test: capsule: Remove logic to add public key ESL

The public key EFI Signature List(ESL) needed for capsule
authentication is now embedded into the platform's DTB as part of the
build. Remove the superfluous logic from the test setup.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 years agosandbox: capsule: Add path to the public key ESL file
Sughosh Ganu [Tue, 22 Aug 2023 17:40:06 +0000 (23:10 +0530)] 
sandbox: capsule: Add path to the public key ESL file

Add the path to the public key EFI Signature List(ESL) file for the
sandbox variants which enable capsule authentication. This ESL file
gets embedded into the platform's device-tree as part of the build.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 years agoscripts/Makefile.lib: Embed capsule public key in platform's dtb
Sughosh Ganu [Tue, 22 Aug 2023 17:40:05 +0000 (23:10 +0530)] 
scripts/Makefile.lib: Embed capsule public key in platform's dtb

The EFI capsule authentication logic in u-boot expects the public key
in the form of an EFI Signature List(ESL) to be provided as part of
the platform's dtb. Currently, the embedding of the ESL file into the
dtb needs to be done manually.

Add a target for generating a dtsi file which contains the signature
node with the ESL file included as a property under the signature
node. Include the dtsi file in the dtb. This brings the embedding of
the ESL in the dtb into the U-Boot build flow.

The path to the ESL file is specified through the
CONFIG_EFI_CAPSULE_ESL_FILE symbol.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agoscripts/Makefile.lib: Add dtsi include files as deps for building DTB
Sughosh Ganu [Tue, 22 Aug 2023 17:40:04 +0000 (23:10 +0530)] 
scripts/Makefile.lib: Add dtsi include files as deps for building DTB

At the time of building the DTB, some dtsi files can be selected for
inclusion. Have these dtsi files as dependencies for the DTB
target. This also ensures generation or updating the dtsi files if
need be.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoscripts/Makefile.lib: Collate all dtsi files for inclusion
Sughosh Ganu [Tue, 22 Aug 2023 17:40:03 +0000 (23:10 +0530)] 
scripts/Makefile.lib: Collate all dtsi files for inclusion

At the time of building a device-tree file, all the *u-boot.dtsi files
are looked for, in a particular order, and the first file found is
included. Then, the list of files specified in the
CONFIG_DEVICE_TREE_INCLUDES symbol are included.

Combine these files that are to be included into a variable, and then
include all these files in one go.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agosandbox: trace: Increase trace buffer size
Sughosh Ganu [Tue, 22 Aug 2023 17:40:02 +0000 (23:10 +0530)] 
sandbox: trace: Increase trace buffer size

When running the trace test on the sandbox platform, the current size
of 16MiB is no longer large enough for capturing the entire trace
history, and results in truncation. Use a size of 32MiB for the trace
buffer on the sandbox platform while running the trace test.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodoc: Add documentation to highlight capsule generation related updates
Sughosh Ganu [Tue, 22 Aug 2023 17:40:01 +0000 (23:10 +0530)] 
doc: Add documentation to highlight capsule generation related updates

The EFI capsules can now be generated as part of U-Boot build, through
binman. Highlight these changes in the documentation.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agotest: capsule: Generate EFI capsules through binman
Sughosh Ganu [Tue, 22 Aug 2023 17:40:00 +0000 (23:10 +0530)] 
test: capsule: Generate EFI capsules through binman

Support has been added for generating the EFI capsules through
binman. Make changes in the EFI capsule update testing feature to
generate capsules through binman.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 years agobinman: capsule: Add support for generating EFI capsules
Sughosh Ganu [Tue, 22 Aug 2023 17:39:59 +0000 (23:09 +0530)] 
binman: capsule: Add support for generating EFI capsules

Add support in binman for generating EFI capsules. The capsule
parameters can be specified through the capsule binman entry. Also add
test cases in binman for testing capsule generation.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobtool: mkeficapsule: Add a bintool for EFI capsule generation
Sughosh Ganu [Tue, 22 Aug 2023 17:39:58 +0000 (23:09 +0530)] 
btool: mkeficapsule: Add a bintool for EFI capsule generation

Add a bintool for generating EFI capsules. This calls the mkeficapsule
tool which generates the capsules.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agosandbox: capsule: Enable EFI capsule module on sandbox variants
Sughosh Ganu [Tue, 22 Aug 2023 17:39:57 +0000 (23:09 +0530)] 
sandbox: capsule: Enable EFI capsule module on sandbox variants

Enable the EFI capsule update code on all sandbox variants. This was
already enabled on the sandbox, sandbox64 and sandbox_flattree
variants. The rest of the variants also have the EFI capsule update
module  enabled now. With this commit, the mkeficapsule tool also gets
enabled on all variants.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agosandbox: capsule: Add keys and certificates needed for capsule update testing
Sughosh Ganu [Tue, 22 Aug 2023 17:39:56 +0000 (23:09 +0530)] 
sandbox: capsule: Add keys and certificates needed for capsule update testing

Add the private keys and public key certificates which are to be used
for capsule authentication while testing the EFI capsule update
functionality. There are two pairs of private and public keys, good
and bad. The good key pair will be used for signing capsules, whilst
the bad key pair is to be used as malicious keys for testing
authentication failure cases. The capsule_pub_key_good.crt is also
converted to an EFI Signature List(ESL) file, SIGNER.esl, which is
embedded in the platform's device-tree for capsule authentication.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agonuvoton: npcm845-evb: Add a newline at the end of file
Sughosh Ganu [Tue, 22 Aug 2023 17:39:55 +0000 (23:09 +0530)] 
nuvoton: npcm845-evb: Add a newline at the end of file

Add a newline at the end of the dts, without which the build fails
when including a dtsi file.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agobinman: bintool: Build a tool from a list of commands
Sughosh Ganu [Tue, 22 Aug 2023 17:39:54 +0000 (23:09 +0530)] 
binman: bintool: Build a tool from a list of commands

Add support to build a tool from source with a list of commands. This
is useful when a tool can be built with multiple commands instead of a
single command.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoARM: dts: at91: sam9x60-curiosity: Sync gpio button from Linux
Alexander Dahl [Wed, 23 Aug 2023 13:58:56 +0000 (15:58 +0200)] 
ARM: dts: at91: sam9x60-curiosity: Sync gpio button from Linux

Copied as is from Linux Kernel release v6.4.
(dts file is still the same in Linux v6.5-rc7 but was moved to vendor
sub-directories with v6.5-rc1.)

Button works out of the box now if the following config options are
enabled: CONFIG_BUTTON, CONFIG_BUTTON_GPIO, CONFIG_CMD_BUTTON,
CONFIG_DM_GPIO.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
2 years agoboard: sam9x60-curiosity: Let LED subsystem init leds if enabled
Alexander Dahl [Wed, 23 Aug 2023 13:58:55 +0000 (15:58 +0200)] 
board: sam9x60-curiosity: Let LED subsystem init leds if enabled

If CONFIG_LED and CONFIG_LED_GPIO are enabled, it is not necessary to
initialize the RGB LED on the board by manually setting hardcoded GPIOs
anymore.  Everything is well defined in dts and can be used like on
boards of other vendors.

Keep the old behaviour as fallback, though.

With all this in place enabling CONFIG_CMD_LED gives us a working 'led'
command on the U-Boot shell.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
2 years agoARM: dts: at91: sam9x60-curiosity: Sync LED nodes from Linux
Alexander Dahl [Wed, 23 Aug 2023 13:58:54 +0000 (15:58 +0200)] 
ARM: dts: at91: sam9x60-curiosity: Sync LED nodes from Linux

Copied as is from Linux Kernel release v6.4.

(dts file is still the same in Linux v6.5-rc7 but was moved to vendor
sub-directories with v6.5-rc1.)

Signed-off-by: Alexander Dahl <ada@thorsis.com>
2 years agoconfigs: at91: sam9x60: Switch to new reset driver
Alexander Dahl [Wed, 23 Aug 2023 13:58:53 +0000 (15:58 +0200)] 
configs: at91: sam9x60: Switch to new reset driver

Since commit 61040097a9d1 ("reset: at91: Add reset driver for basic
assert/deassert operations") the compatible "microchip,sam9x60-rstc" for
the sam9x60 reset controller in sam9x60.dtsi is not handled by
CONFIG_SYSRESET_AT91 anymore, but by CONFIG_RESET_AT91 now.  This
resulted in the following error message, when trying to reset from
U-Boot shell:

    U-Boot> reset
    resetting ...
    System reset not supported on this platform
    ### ERROR ### Please RESET the board ###

Fixed by enabling the new driver in the relevant defconfigs.  Tested on
sam9x60-curiosity board.  Defconfigs for sam9x60ek adapted in the same
way, but without testing.  These should be all sam9x60 boards affected
in U-Boot here.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
2 years agoconfigs: at91: sam9x60_curiosity: Sync both defconfig variants
Alexander Dahl [Wed, 23 Aug 2023 13:58:52 +0000 (15:58 +0200)] 
configs: at91: sam9x60_curiosity: Sync both defconfig variants

The board has two SD card slots and we have two defconfigs for booting
from either the first (micro SD) named 'sam9x60_curiosity_mmc_defconfig'
or the second (full size SD) named 'sam9x60_curiosity_mmc1_defconfig'.
For comparable Microchip boards (sama5d27-som1-ek, sama5d29-curiosity,
sama7g5ek) with two card slots the defconfigs only differ in BOOTARGS,
BOOTCOMMAND, and ENV_FAT_DEVICE_AND_PART and the same should be the case
for sam9x60_curiosity.

Here the 'mmc1' config has more options enabled to support the raw NAND
flash populated on the board, so the 'mmc' config (for mmc0) was adapted
by enabling additional options, instead of removing options from mmc1.

The 'mem=128M' argument can be dropped from kernel command line, because
it is redundant to memory node in dts in both Linux and U-Boot:

        memory@20000000 {
                reg = <0x20000000 0x8000000>;
        };

Signed-off-by: Alexander Dahl <ada@thorsis.com>
2 years agoMerge branch '2023-08-28-assorted-important-fixes'
Tom Rini [Tue, 29 Aug 2023 14:06:08 +0000 (10:06 -0400)] 
Merge branch '2023-08-28-assorted-important-fixes'

- A few platform-specific config/dts updates to fix issues, drop a
  temporary change in binman, update the MAINTAINERS file to remove
  Wolfgang Denk, fix a typo, fix a corner case with bootstd, update
  Azure to not timeout so easily, and fix a case where we would omit
  some files in SPL.

2 years agoRevert "arm: imx: mx7: Move CONFIG_OPTEE_TZDRAM_SIZE from lib/optee"
Ricardo Salveti [Fri, 25 Aug 2023 13:47:11 +0000 (16:47 +0300)] 
Revert "arm: imx: mx7: Move CONFIG_OPTEE_TZDRAM_SIZE from lib/optee"

This reverts commit c5b68ef8af3c2f515c1f5b8d63a69359a85d753b.

CONFIG_OPTEE_TZDRAM_SIZE is used by imx6-based SoCs as well. Move the
option back.

Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2 years agoRevert "binman: Add a temporary hack for duplicate phandles"
Simon Glass [Thu, 24 Aug 2023 01:18:02 +0000 (19:18 -0600)] 
Revert "binman: Add a temporary hack for duplicate phandles"

The affected boards have been fixed, so drop this hack.

This reverts commit 288ae53cb73605500b7fc01e5919753c878466be.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx: Drop unneeded phandle in FIT template
Simon Glass [Thu, 24 Aug 2023 01:18:01 +0000 (19:18 -0600)] 
imx: Drop unneeded phandle in FIT template

Adding a phandle to a template node is not allowed, since when the node is
instantiated multiple times, we end up with duplicate phandles.

Drop this invalid constructs.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Tim Harvey <tharvey@gateworks.com>
2 years agoMAINTAINERS: remove Wolfgang Denk
Heinrich Schuchardt [Wed, 23 Aug 2023 22:12:47 +0000 (00:12 +0200)] 
MAINTAINERS: remove Wolfgang Denk

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agospl: crypto: fix including SHA* object files in SPL
Oleksandr Suvorov [Wed, 23 Aug 2023 14:56:27 +0000 (17:56 +0300)] 
spl: crypto: fix including SHA* object files in SPL

If one of SHA* algorithms is disabled in u-boot, its code is not
included in SPL even if a given SHA* option is enabled in SPL. Fix
this.

Fixes: 603d15a572d ("spl: cypto: Bring back SPL_ versions of SHA")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoAzure: Set the timeout for jobs to the maximum
Tom Rini [Sun, 20 Aug 2023 17:31:26 +0000 (13:31 -0400)] 
Azure: Set the timeout for jobs to the maximum

As per current Azure Pipelines documentation we qualify for 3600 minutes
per job, if specified, as the timeout. The default unspecified timeout
is 60 minutes. Rework things to specify 0 as the timeout (and so maximum
allowed) so that we don't have failures due to running slightly past 60
minutes total.

Link: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#timeouts
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoconfigs: set CONFIG_LMB_MAX_REGIONS=64 for MT7988 boards
Daniel Golle [Mon, 21 Aug 2023 19:38:23 +0000 (20:38 +0100)] 
configs: set CONFIG_LMB_MAX_REGIONS=64 for MT7988 boards

Similar to MT7981 and MT7986 also MT7988 can have a high number of
reserved-memory regions used by the various hardware offloading
subsystems.

Raise CONFIG_LMB_MAX_REGIONS to 64 to avoid errors when trying to boot
Linux with more then 6 reserved regions:

ERROR: reserving fdt memory region failed (addr=4f700000 size=240000 flags=4)
ERROR: reserving fdt memory region failed (addr=15194000 size=1000 flags=4)
ERROR: reserving fdt memory region failed (addr=15294000 size=1000 flags=4)
ERROR: reserving fdt memory region failed (addr=15394000 size=1000 flags=4)
ERROR: Failed to allocate 0xb161 bytes below 0x80000000.
device tree - allocation error

Fixes: bc4adc97cfb ("board: mediatek: add MT7988 reference boards")
Reported-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoconfigs: Enable CONFIG_DM_SCSI in am57xx_hs_evm_usb
Andrew Davis [Mon, 21 Aug 2023 13:59:10 +0000 (08:59 -0500)] 
configs: Enable CONFIG_DM_SCSI in am57xx_hs_evm_usb

This should have already been enabled but was missed when converting the
base platform defconfig, fix this here.

Fixes: 3c5aa6caccab ("configs: Enable CONFIG_BLK in am57xx_evm and am57xx_hs_evm")
Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Adjust the default bootmeth order
Simon Glass [Sat, 19 Aug 2023 22:49:35 +0000 (16:49 -0600)] 
bootstd: Adjust the default bootmeth order

The existing distro scripts check extlinux and scripts before EFI. Adjust
the default ordering to do the same, to avoid breaking existing flows.

Add some documentation, mentioning that this order will likely change in
future.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Da Xue <da@libre.computer>
2 years agoarm: dts: mediatek: convert gmac link mode to 2500base-x for r3
Frank Wunderlich [Thu, 3 Aug 2023 16:52:58 +0000 (18:52 +0200)] 
arm: dts: mediatek: convert gmac link mode to 2500base-x for r3

Ethernet on Bananapi-r3 is broken after

commit bd70f3cea353 ("net: mediatek: add support for SGMII 1Gbps auto-negotiation mode")

because changes from this commit were not applied to bpi-r3 devicetree too:

commit aef54ea16cac ("arm: dts: medaitek: convert gmac link mode to 2500base-x")

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoboot: Fix reference to bootmenu doc
Peter Robinson [Fri, 18 Aug 2023 14:54:10 +0000 (15:54 +0100)] 
boot: Fix reference to bootmenu doc

The Kconfig references a readme file that's moved and
converted to rst so update the reference.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge tag 'efi-2023-10-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 27 Aug 2023 15:04:02 +0000 (11:04 -0400)] 
Merge tag 'efi-2023-10-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-10-rc4

Documentation:

* describe TPL/VPL/SPL boot
* Add support for sphinx-prompt and convert TI K3 to use it
* board: sdm845: Explicitly add boot.img flashing command

EFI:

* remove handle from events when deleting it

Others:

* fix gpt sub-commands setenv and enumerate
* add a parameter check in hash_calculate()

2 years agoefi_loader: delete handle from events when a protocol is uninstalled
Ilias Apalodimas [Thu, 24 Aug 2023 14:21:09 +0000 (17:21 +0300)] 
efi_loader: delete handle from events when a protocol is uninstalled

When a notification event is registered for a protocol the handle of the
protocol is added in our event notification list.  When all the protocols
of the handle are uninstalled we delete the handle but we do not remove
it from the event notification list.

Clean up the protocol removal functions and add a wrapper which
- Removes the to-be deleted handle from any lists it participates
- Remove the handle if no more protocols are present

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: describe TPL/VPL/SPL boot
Heinrich Schuchardt [Wed, 23 Aug 2023 21:49:55 +0000 (23:49 +0200)] 
doc: describe TPL/VPL/SPL boot

This is a stub describing how TPL, VPL, and SPL load the next boot stages
on a detail level for users.

For sure we will need a few patches on top to catch the whole complexity.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2 years agodoc: board: ti: k3: Convert to sphinx-prompt
Nishanth Menon [Thu, 24 Aug 2023 15:40:36 +0000 (10:40 -0500)] 
doc: board: ti: k3: Convert to sphinx-prompt

Sphinx-prompt provides a handy scheme to provide documentation that
renders nicely and yet provides a scheme to copy paste for users without
having to hand-edit the copied text as is the result of code-block

[1] https://lore.kernel.org/all/87fs48rgto.fsf@baylibre.com/
Reported-by: Simon Glass <sjg@chromium.org>
Suggested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: sphinx: Add sphinx-prompt
Nishanth Menon [Thu, 24 Aug 2023 15:40:35 +0000 (10:40 -0500)] 
doc: sphinx: Add sphinx-prompt

Sphinx-prompt[1] helps bring-in '.. prompt::' option that allows a
better rendered documentation, yet be able to copy paste without
picking up the prompt from rendered documentation.

[1] https://lore.kernel.org/all/87fs48rgto.fsf@baylibre.com/
Suggested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: board: sdm845: Explicitly add boot.img flashing command
Sumit Garg [Thu, 24 Aug 2023 12:44:20 +0000 (18:14 +0530)] 
doc: board: sdm845: Explicitly add boot.img flashing command

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Use code-block. Fix length of two heading underlines.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agocmd: let gpt_partition_entry be hexadecimal
Heinrich Schuchardt [Sat, 26 Aug 2023 01:53:43 +0000 (03:53 +0200)] 
cmd: let gpt_partition_entry be hexadecimal

In commands like 'ls mmc 0:f' the partition number is hexadecimal.

In command 'gpt setenv' variable gpt_partition_entry needs to be set
to a hexadecimal value to allow its use as a parameter in a
subsequent command.

Fixes: 57f8cf1b9aea ("cmd: fix gpt enumerate")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocmd: fix gpt enumerate
Heinrich Schuchardt [Sat, 26 Aug 2023 01:53:42 +0000 (03:53 +0200)] 
cmd: fix gpt enumerate

Do not assume that partitions are numbered continuously starting at 1.

Only a single partition table type can exist on a block device. If we found
a GPT partition table, we must not re-enumerate with the MBR partition
driver which would find the protective partition.

Fixes: 12fc1f3bb223 ("cmd: gpt: add eMMC and GPT support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocmd: fix gpt setenv
Heinrich Schuchardt [Sat, 26 Aug 2023 01:53:41 +0000 (03:53 +0200)] 
cmd: fix gpt setenv

Do not assume that partitions are continuously numbered starting at 1.

Having a partition table with a single partition 63 is valid.

Fixes: 12fc1f3bb223 ("cmd: gpt: add eMMC and GPT support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agolib: parameter check in hash_calculate
Heinrich Schuchardt [Tue, 22 Aug 2023 09:10:20 +0000 (11:10 +0200)] 
lib: parameter check in hash_calculate

If hash_calculate is invoked with region_count = 0, it will try to hash
INT_MAX regions. We should check this parameter.

* Avoid a comparison with different signedness.
* Check that region_count is at least 1.
* Avoid a superfluous assignment.

Fixes: b37b46f042cc ("rsa: Use checksum algorithms from struct hash_algo")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge branch '2023-08-26-bootstd-chromeos-impreovements-and-move-to-gcc-13.2' into...
Tom Rini [Sat, 26 Aug 2023 15:25:08 +0000 (11:25 -0400)] 
Merge branch '2023-08-26-bootstd-chromeos-impreovements-and-move-to-gcc-13.2' into next

First, update CI to using gcc-13.2 from 13.1, and rebuild the CI
containers.  This is needed because the second part adds utilities for
tests and provides, to quote the author:

This updates the ChromiumOS bootmeth to detect multiple kernel
partitions on a disk.

It also includes minor code improvements to the partition drivers,
including accessors for the optional fields.

This series also includes some other related tweaks in testing.

2 years agoCI: Move to latest Ubuntu "Jammy" tag
Tom Rini [Fri, 25 Aug 2023 17:21:27 +0000 (13:21 -0400)] 
CI: Move to latest Ubuntu "Jammy" tag

Move to the latest "Jammy" tag from Ubuntu.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoCI: Update to gcc-13.2.0
Tom Rini [Fri, 25 Aug 2023 17:21:26 +0000 (13:21 -0400)] 
CI: Update to gcc-13.2.0

The latest kernel.org toolchains for gcc are now 13.2.0, so upgrade to
that.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoCI: Add ChromiumOS utilities
Simon Glass [Thu, 24 Aug 2023 19:55:46 +0000 (13:55 -0600)] 
CI: Add ChromiumOS utilities

We need cgpt and futility for building test images. Add them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: cros: Allow detection of any kernel partition
Simon Glass [Thu, 24 Aug 2023 19:55:45 +0000 (13:55 -0600)] 
bootstd: cros: Allow detection of any kernel partition

The existing ChromiumOS bootmeth only supports reading a single kernel
partition, either 2 or 4. In fact there are normally two options
available.

Use the GUID to detect kernel partitions, with the BOOTMETHF_ANY_PART
flag, so that bootstd does not require a valid filesystem before calling
the bootmeth.

Tidy up and improve the logging while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
[trini: Add missing select of PARTITION_TYPE_GUID]
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agouuid: Add ChromiumOS partition types
Simon Glass [Thu, 24 Aug 2023 19:55:44 +0000 (13:55 -0600)] 
uuid: Add ChromiumOS partition types

Add some GUIDs for ChromiumOS so we can detect the partitions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Support bootmeths which can scan any partition
Simon Glass [Thu, 24 Aug 2023 19:55:43 +0000 (13:55 -0600)] 
bootstd: Support bootmeths which can scan any partition

Some bootmeths support scanning a partition without a filesystem on it.
Add a flag to support this.

This will allow the ChromiumOS bootmeth to find kernel partition, which
are stored in a special format, without a filesystem.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: Add a fallback for part_get_bootable()
Simon Glass [Thu, 24 Aug 2023 19:55:42 +0000 (13:55 -0600)] 
part: Add a fallback for part_get_bootable()

This function can be called when partition support is disabled. Add a
static inline to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a test for bootmeth_cros
Simon Glass [Thu, 24 Aug 2023 19:55:41 +0000 (13:55 -0600)] 
bootstd: Add a test for bootmeth_cros

The ChromiumOS bootmeth has no tests at present. Before adding more
features. add a basic test.

This creates a disk which can be scanned by the bootmeth, so make sure
things work. It is quite rudimentary, since the kernel is faked, the root
disk is missing and there is no cmdline stored.

Enable the bootmeth for snow so it can build the unit test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: test: Allow binding and using any mmc device
Simon Glass [Thu, 24 Aug 2023 19:55:40 +0000 (13:55 -0600)] 
bootstd: test: Allow binding and using any mmc device

We currently use mmc4 for tests. Update the function which sets this up
so that it can handle any device.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootflow: Show an empty filename when there is none
Simon Glass [Thu, 24 Aug 2023 19:55:39 +0000 (13:55 -0600)] 
bootflow: Show an empty filename when there is none

At present 'bootflow list' shows <NULL> for the filename when it is not
present. Show an empty string instead, since that is more user-friendly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agotest: Move 1MB.fat32.img and 2MB.ext2.img
Simon Glass [Thu, 24 Aug 2023 19:55:38 +0000 (13:55 -0600)] 
test: Move 1MB.fat32.img and 2MB.ext2.img

These are currently created in the source directory, which is not ideal.
Move them to the persistent-data directory instead. Update the test so
skip validating the filename, since it now includes a full path.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agosandbox: Add a way to access persistent test files
Simon Glass [Thu, 24 Aug 2023 19:55:37 +0000 (13:55 -0600)] 
sandbox: Add a way to access persistent test files

Some pytests create files in the persistent-data directory. It is useful
to be able to access these files in C tests. Add a function which can
locate a file given its leaf name, using the environment variable set
up in test/py/conftest.py

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agouuid: Move function comments to header file
Simon Glass [Thu, 24 Aug 2023 19:55:36 +0000 (13:55 -0600)] 
uuid: Move function comments to header file

These should be in the header file for easy browsing, not in the source
code. Move them and add a missing Return on one of the functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Correct error handling when event fails
Simon Glass [Thu, 24 Aug 2023 19:55:35 +0000 (13:55 -0600)] 
dm: core: Correct error handling when event fails

Follow the correct path in device_probe() when and event handler fails.
This avoids getting into a strange state where the device appears to be
activated but is not.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: efi: Add debugging for the signature check
Simon Glass [Thu, 24 Aug 2023 19:55:34 +0000 (13:55 -0600)] 
part: efi: Add debugging for the signature check

Add a little more debugging for the initial signature check. Drop the
pointless check for NULL. Also set a log category while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: Add an accessor for struct disk_partition sys_ind
Simon Glass [Thu, 24 Aug 2023 19:55:33 +0000 (13:55 -0600)] 
part: Add an accessor for struct disk_partition sys_ind

This field is only present when a CONFIG is set. To avoid annoying #ifdefs
in the source code, add an accessor. Update the only usage.

Note that the accessor is optional. It can be omitted if it is known that
the option is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: Add accessors for struct disk_partition type_uuid
Simon Glass [Thu, 24 Aug 2023 19:55:32 +0000 (13:55 -0600)] 
part: Add accessors for struct disk_partition type_uuid

This field is only present when a CONFIG is set. To avoid annoying #ifdefs
in the source code, add accessors. Update all code to use it.

Note that the accessor is optional. It can be omitted if it is known that
the option is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: Add accessors for struct disk_partition uuid
Simon Glass [Thu, 24 Aug 2023 19:55:31 +0000 (13:55 -0600)] 
part: Add accessors for struct disk_partition uuid

This field is only present when a CONFIG is set. To avoid annoying #ifdefs
in the source code, add accessors. Update all code to use it.

Note that the accessor is optional. It can be omitted if it is known that
the option is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: Add comments for static functions
Simon Glass [Thu, 24 Aug 2023 19:55:30 +0000 (13:55 -0600)] 
part: Add comments for static functions

Some internal functions could do with a few comments, to explain what they
do. Add these, to make the code easier to follow.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: nac: Use desc instead of dev_desc
Simon Glass [Thu, 24 Aug 2023 19:55:29 +0000 (13:55 -0600)] 
part: nac: Use desc instead of dev_desc

The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the mac code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: iso: Use desc instead of dev_desc
Simon Glass [Thu, 24 Aug 2023 19:55:28 +0000 (13:55 -0600)] 
part: iso: Use desc instead of dev_desc

The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the iso code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: efi: Use desc instead of dev_desc
Simon Glass [Thu, 24 Aug 2023 19:55:27 +0000 (13:55 -0600)] 
part: efi: Use desc instead of dev_desc

The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the efi code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: dos: Use desc instead of dev_desc
Simon Glass [Thu, 24 Aug 2023 19:55:26 +0000 (13:55 -0600)] 
part: dos: Use desc instead of dev_desc

The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the dos code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: amiga: Use desc instead of dev_desc
Simon Glass [Thu, 24 Aug 2023 19:55:25 +0000 (13:55 -0600)] 
part: amiga: Use desc instead of dev_desc

The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the amiga code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopart: Use desc instead of dev_desc
Simon Glass [Thu, 24 Aug 2023 19:55:24 +0000 (13:55 -0600)] 
part: Use desc instead of dev_desc

The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the partition code to
just use 'desc', as is done with driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMerge branch '2023-08-25-add-persistent-config-editor-via-expo' into next
Tom Rini [Fri, 25 Aug 2023 21:52:59 +0000 (17:52 -0400)] 
Merge branch '2023-08-25-add-persistent-config-editor-via-expo' into next

To quote the author:
So far cedit does not support reading and writing the configuration.
This series add several features related to this:

First, it adds support for using a file on a filesystem. This is in
FDT format and provides enough information to reset the cedit back to
the saved settings.

Second, it adds support for using the U-Boot environment. Since the
environment is generally saved across reboots, this feature provides an
easy way of storing the state on most boards. The variables all have a
'c.' prefix to avoid confusion with other variables.

Finally it adds support for using CMOS RAM. This is commonly used on x86
devices to store BIOS settings. The expo schema provides information on
the register layout.

Some other minor tweaks and improvements are included along the way.

2 years agoexpo: doc: Update documentation for persistent settings
Simon Glass [Mon, 14 Aug 2023 22:40:39 +0000 (16:40 -0600)] 
expo: doc: Update documentation for persistent settings

Add mention of persistent settings in the documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: cedit: Support reading settings from CMOS RAM
Simon Glass [Mon, 14 Aug 2023 22:40:38 +0000 (16:40 -0600)] 
expo: cedit: Support reading settings from CMOS RAM

Add a command to read edit settings from CMOS RAM, using the cedit
definition to indicate which registers and bits are used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: cedit: Support writing settings to CMOS RAM
Simon Glass [Mon, 14 Aug 2023 22:40:37 +0000 (16:40 -0600)] 
expo: cedit: Support writing settings to CMOS RAM

Add a command to write cedit settings to CMOS RAM so that it can be
preserved across a reboot. This uses a simple bit-encoding, where each
field has a 'bit position' and a 'bit length' in the schema.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: cedit: Support reading settings from environment vars
Simon Glass [Mon, 14 Aug 2023 22:40:36 +0000 (16:40 -0600)] 
expo: cedit: Support reading settings from environment vars

Add a command to read cedit settings from environment variables so that
they can be restored as part of the environment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: cedit: Support writing settings to environment vars
Simon Glass [Mon, 14 Aug 2023 22:40:35 +0000 (16:40 -0600)] 
expo: cedit: Support writing settings to environment vars

Add a command to write cedit settings to environment variables so that
they can be stored with 'saveenv'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: cedit: Support reading settings from a file
Simon Glass [Mon, 14 Aug 2023 22:40:34 +0000 (16:40 -0600)] 
expo: cedit: Support reading settings from a file

Add a command to read cedit settings from a devicetree file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: cedit: Support writing settings to a file
Simon Glass [Mon, 14 Aug 2023 22:40:33 +0000 (16:40 -0600)] 
expo: cedit: Support writing settings to a file

Support writing settings from an expo into a file in FDT format. It
consists of a single node with a two properties for each sceneitem,
one with tag ID chosen by the user and another for its text value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: Export scene_menuitem_find() for use in internal code
Simon Glass [Mon, 14 Aug 2023 22:40:32 +0000 (16:40 -0600)] 
expo: Export scene_menuitem_find() for use in internal code

Make this function available to other expo code so we can use it to look
up a menu item.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodoc: Expand documentation for the cedit command
Simon Glass [Mon, 14 Aug 2023 22:40:31 +0000 (16:40 -0600)] 
doc: Expand documentation for the cedit command

Add a little information about each subcommand.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: Move cedit theme under bootstd
Simon Glass [Mon, 14 Aug 2023 22:40:30 +0000 (16:40 -0600)] 
expo: Move cedit theme under bootstd

This is related to standard boot, so put it under the same node. This may
simplify schema upstreaming later.

Mention themes in the documentation while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: Add documentation for the configuration editor
Simon Glass [Mon, 14 Aug 2023 22:40:29 +0000 (16:40 -0600)] 
expo: Add documentation for the configuration editor

This is mentioned in passing in the 'cedit' command. Its file format is
described under `expo`. But it would be better if it had its own entry
in the documentation.

Add a new 'cedit' entry with a few details about this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: Tidy up the expo.py tool and usage
Simon Glass [Mon, 14 Aug 2023 22:40:28 +0000 (16:40 -0600)] 
expo: Tidy up the expo.py tool and usage

Tidy up this tool a little:

- define which arguments are needed
- split the enum values out into a header file
- warn if no enum values are found
- display the dtc error if something goes wrong
- avoid a Python traceback on error

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: Add a function to prepare a cedit
Simon Glass [Mon, 14 Aug 2023 22:40:27 +0000 (16:40 -0600)] 
expo: Add a function to prepare a cedit

Split out the code which prepares the cedit for use, so we can call it
from a test.

Add a log category while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: Move cedit test into its own file and tidy
Simon Glass [Mon, 14 Aug 2023 22:40:26 +0000 (16:40 -0600)] 
expo: Move cedit test into its own file and tidy

Move this test out so it can have its own file. Rename the test to use
a cedit_ prefix.

This allows us to drop the check for CONFIG_CMD_CEDIT in the test.

Also we don't need driver model objects for this test, so drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: Split out cedit into its own header
Simon Glass [Mon, 14 Aug 2023 22:40:25 +0000 (16:40 -0600)] 
expo: Split out cedit into its own header

Before adding more functions to this interface, create a new header for
the configuration editor.

Fix up the expo header guard while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: Refactor menu_build() to return the object created
Simon Glass [Mon, 14 Aug 2023 22:40:24 +0000 (16:40 -0600)] 
expo: Refactor menu_build() to return the object created

The caller reads the ID but menu_build() does this again. Add the ID as
a parameter to avoid this. Return the object created so that the caller
can adjust it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: Provide a way to iterate through all scene objects
Simon Glass [Mon, 14 Aug 2023 22:40:23 +0000 (16:40 -0600)] 
expo: Provide a way to iterate through all scene objects

For some operations it is necessary to process all objects in an expo.
Provide an iterator to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoabuf: Allow incrementing the size
Simon Glass [Mon, 14 Aug 2023 22:40:22 +0000 (16:40 -0600)] 
abuf: Allow incrementing the size

Provide a convenience function to increment the size of the abuf.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: Make scene_obj_find() take a const scene
Simon Glass [Mon, 14 Aug 2023 22:40:21 +0000 (16:40 -0600)] 
expo: Make scene_obj_find() take a const scene

This does not change the scene, so mark the pointer const.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Fri, 25 Aug 2023 14:52:39 +0000 (10:52 -0400)] 
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- Two phy-imx8mq-usb fixes and one dwc3 fix

2 years agoMerge tag 'u-boot-stm32-20230825' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 25 Aug 2023 14:52:13 +0000 (10:52 -0400)] 
Merge tag 'u-boot-stm32-20230825' of https://source.denx.de/u-boot/custodians/u-boot-stm

Remove scmi-optee shmem for STM32MP15 and STM32MP13

2 years agoARM: dts: stm32mp13: remove shmem for scmi-optee
Patrick Delaunay [Mon, 10 Jul 2023 08:44:10 +0000 (10:44 +0200)] 
ARM: dts: stm32mp13: remove shmem for scmi-optee

CFG_STM32MP1_SCMI_SHM_SYSRAM will be disabled by default for STM32MP13x
SoCs in next OP-TEE version and the OP-TEE SMCI server uses the OP-TEE
native shared memory registered by clients.

To be compatible by default with this configuration this patch removes
the shared memory in the SCMI configuration and the associated reserved
memory in SRAM.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agoARM: dts: stm32mp15: remove shmem for scmi-optee
Patrick Delaunay [Mon, 10 Jul 2023 08:44:09 +0000 (10:44 +0200)] 
ARM: dts: stm32mp15: remove shmem for scmi-optee

Since OP-TEE commit 89ba3422ee80 ("plat-stm32mp1: scmi_server: default
use OP-TEE shared memory"), integrated in OP-TEE 3.22.0-rc1
the default configuration for STM32MP15x SoCs changes,
CFG_STM32MP1_SCMI_SHM_SYSRAM is disabled by default and the OP-TEE SMCI
server uses ithe OP-TEE native shared memory registered by clients.

To be compatible by default with this configuration and the next OP-TEE
version, this patch removes the SHMEM in the SCMI configuration and the
associated reserved memory in the last 4KByte page of SRAM,
in the STM32MP15 device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agophy: phy-imx8mq-usb: clean up clock code
Tim Harvey [Thu, 13 Jul 2023 18:56:08 +0000 (11:56 -0700)] 
phy: phy-imx8mq-usb: clean up clock code

use CONFIG_IS_ENABLED for clock enable/disable and change printf's
to dev_err. Additionlly remove the comment that does not make sense.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2 years agophy: phy-imx8mq-usb: add vbus regulator support
Tim Harvey [Thu, 13 Jul 2023 18:56:07 +0000 (11:56 -0700)] 
phy: phy-imx8mq-usb: add vbus regulator support

Add support for enabling and disabling vbus-supply regulator found
on several imx8mp boards in the usb3_phy0 and usb3_phy1 nodes.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agousb: dwc3: Fix remove function if there is no ulpi_reset gpio
Venkatesh Yadav Abbarapu [Wed, 9 Aug 2023 03:33:50 +0000 (09:03 +0530)] 
usb: dwc3: Fix remove function if there is no ulpi_reset gpio

As ulpi_reset gpio is now optional, we need to check it when doing
the 'dwc3_generic_remove' function. Check if it is declared before
accessing the ulpi_reset.

Fixes: 237d1f60b1d ("usb: dwc3: Use the devm_gpiod_get_optional()
     API for reset gpio")

Reported-by: Thomas Nizan <tnizan@witekio.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2 years agoMerge branch '2023-08-24-enable-more-features-in-qemu-arm' into next
Tom Rini [Thu, 24 Aug 2023 21:42:48 +0000 (17:42 -0400)] 
Merge branch '2023-08-24-enable-more-features-in-qemu-arm' into next

To quote the author:
Now that the driver for the Bochs VGA card emulated by QEMU is no longer
limited to x86 architectures, this series enables it on arm and arm64 virtual
machines to provide a graphical interface. In line with that series this also
enables console buffering and USB keyboard.

Tested with the Debian 12 installer using GRUB EFI:

  $ tools/buildman/buildman -o build/qemu_arm64 --boards=qemu_arm64 -w
  $ cd build/qemu_arm64
  $ curl -L -o debian.img \
      https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-12.0.0-arm64-netinst.iso
  $ qemu-system-aarch64 \
      -machine virt -cpu cortex-a53 -m 4G -smp 4 \
      -bios u-boot.bin \
      -serial stdio -device VGA \
      -nic user,model=virtio-net-pci \
      -device virtio-rng-pci \
      -device qemu-xhci,id=xhci -device usb-kbd -device usb-tablet \
      -drive if=virtio,file=debian.img,format=raw,readonly=on,media=cdrom

And with one using extlinux.conf:

    $ [...]
    $ curl -L -o head.img.gz \
        https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/SD-card-images/gtk/firmware.none.img.gz
    $ curl -L -o partition.img.gz \
        https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/SD-card-images/gtk/partition.img.gz
    $ zcat head.img.gz partition.img.gz >debian.img
    $ [...]

Both can get to a graphical installer just fine, in addition to U-Boot
video console showing up in a GTK window.

2 years agodoc: qemu: arm: Add a section on booting Linux distros
Alper Nebi Yasak [Mon, 14 Aug 2023 17:39:44 +0000 (20:39 +0300)] 
doc: qemu: arm: Add a section on booting Linux distros

Add an example qemu-system-aarch64 command that can make U-Boot on QEMU
boot into the Debian Installer, along with resulting console messages
from U-Boot, based on the existing documentation section for the x86
version.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>