]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
9 months 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.

9 months 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.

9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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.

9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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.

9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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>
9 months 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.

9 months 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>
9 months agoarm: qemu: Enable usb keyboard as an input device
Alper Nebi Yasak [Mon, 14 Aug 2023 17:39:43 +0000 (20:39 +0300)] 
arm: qemu: Enable usb keyboard as an input device

Commit 02be57caf730 ("riscv: qemu: Enable usb keyboard as an input
device") adds PCI xHCI support to QEMU RISC-V virtual machines and
enables using a USB keyboard as one of the input devices. Similarly,
enable those for ARM virtual machines as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
9 months agoarm: qemu: Enable PRE_CONSOLE_BUFFER
Alper Nebi Yasak [Mon, 14 Aug 2023 17:39:42 +0000 (20:39 +0300)] 
arm: qemu: Enable PRE_CONSOLE_BUFFER

Commit 608b80b5b855 ("riscv: qemu: Enable PRE_CONSOLE_BUFFER") enables
buffering console messages for QEMU RISC-V virtual machines so those
printed before the video console is available will still show up on the
display. Similarly, enable it for ARM virtual machines as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
9 months agoarm: qemu: Enable Bochs video support
Alper Nebi Yasak [Mon, 14 Aug 2023 17:39:41 +0000 (20:39 +0300)] 
arm: qemu: Enable Bochs video support

Commit 716161663ec49 ("riscv: qemu: Enable Bochs video support") enables
a video console for QEMU RISC-V virtual machines using an emulated Bochs
VGA card. Similarly, enable it for ARM virtual machines as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
9 months agoMerge branch '2023-08-24-further-ufs-updates' into next
Tom Rini [Thu, 24 Aug 2023 19:39:55 +0000 (15:39 -0400)] 
Merge branch '2023-08-24-further-ufs-updates' into next

- Cleanup and improve the UFS subsystem slightly, in preparation for
  supporting more platforms.

9 months agoufs: Implement cache management
Marek Vasut [Wed, 16 Aug 2023 15:05:55 +0000 (17:05 +0200)] 
ufs: Implement cache management

Add function to flush and invalidate cache over request and response
queue entries, and perform flush and optional invalidate over block
layer data that are passed into the UFS layer. This makes it possible
to use UFS with caches enabled.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
9 months agoufs: Use utp_transfer_req_desc pointer in ufshcd_get_tr_ocs
Marek Vasut [Wed, 16 Aug 2023 15:05:54 +0000 (17:05 +0200)] 
ufs: Use utp_transfer_req_desc pointer in ufshcd_get_tr_ocs

Use utp_transfer_req_desc pointer to reference to utrdl queue
instead of referencing the queue directly. This makes the code
more consistent. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
9 months agoufs: Pass hba pointer to ufshcd_prepare_req_desc_hdr()
Marek Vasut [Wed, 16 Aug 2023 15:05:53 +0000 (17:05 +0200)] 
ufs: Pass hba pointer to ufshcd_prepare_req_desc_hdr()

Pass the hba pointer itself to ufshcd_prepare_req_desc_hdr()
instead of duplicating utp_transfer_req_desc access at each
call site. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
9 months agoufs: Handle UFS 3.0 controllers
Marek Vasut [Wed, 16 Aug 2023 15:05:52 +0000 (17:05 +0200)] 
ufs: Handle UFS 3.0 controllers

Extend the version check to handle UFS 3.0 controllers as well.
Tested on R-Car S4 UFS 3.0 controller.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
9 months agoufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO
Marek Vasut [Wed, 16 Aug 2023 15:05:51 +0000 (17:05 +0200)] 
ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO

Add UFSHCD_QUIRK_HIBERN_FASTAUTO quirk for host controllers which supports
auto-hibernate the capability but only FASTAUTO mode.

Ported from Linux kernel commit
2f11bbc2c7f3 ("scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTO")

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
9 months agoufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS
Marek Vasut [Wed, 16 Aug 2023 15:05:50 +0000 (17:05 +0200)] 
ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS

Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS for host controllers which do not
support 64-bit addressing.

Ported from Linux kernel commit
6554400d6f66 ("scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS")
with ufs_scsi_buffer_aligned() based on U-Boot generic bounce buffer.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
9 months agoufs: Convert quirks to BIT() macro
Marek Vasut [Wed, 16 Aug 2023 15:05:49 +0000 (17:05 +0200)] 
ufs: Convert quirks to BIT() macro

Use BIT() macro for quirks, no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
9 months agoMerge branch '2023-08-22-assorted-code-cleanups' into next
Tom Rini [Wed, 23 Aug 2023 14:40:47 +0000 (10:40 -0400)] 
Merge branch '2023-08-22-assorted-code-cleanups' into next

- Assorted cleanups and fixes for a few tests, how we handle
  disks/partitions and bounce buffers.

9 months agomtd: nand: raw: atmel: Remove duplicate line
Alexander Dahl [Tue, 8 Aug 2023 13:02:49 +0000 (15:02 +0200)] 
mtd: nand: raw: atmel: Remove duplicate line

Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
9 months agonet: Fix the displayed value of bytes transferred
Siddharth Vadapalli [Mon, 14 Aug 2023 04:53:47 +0000 (10:23 +0530)] 
net: Fix the displayed value of bytes transferred

In the case of NETLOOP_SUCCESS, the decimal value of the u32 variable
"net_boot_file_size" is printed using "%d", resulting in negative values
being reported for large file sizes. Fix this by using "%u" to print the
decimal value corresponding to the bytes transferred.

Fixes: 1411157d8578 ("net: cosmetic: Fixup var names related to boot file")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agoscsi: Add buffer_aligned check pass-through
Marek Vasut [Sun, 13 Aug 2023 23:50:00 +0000 (01:50 +0200)] 
scsi: Add buffer_aligned check pass-through

Some devices have limited DMA capabilities and require that the
buffers passed to them fit specific properties. Add new optional
callback which can be used at driver level to indicate whether a
buffer alignment is suitable for the device DMA or not. This is
a pass-through callback from block uclass to drivers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agoblk: Add bounce buffer support to read/write operations
Marek Vasut [Sun, 13 Aug 2023 23:49:59 +0000 (01:49 +0200)] 
blk: Add bounce buffer support to read/write operations

Some devices have limited DMA capabilities and require that the
buffers passed to them fit specific properties. Add new optional
callback which can be used at driver level to indicate whether a
buffer alignment is suitable for the device DMA or not, and
trigger use of generic bounce buffer implementation to help use
of unsuitable buffers at the expense of performance degradation.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agodisk: dos: Infer MBR partition sector size from underlying drive sector size
Marek Vasut [Sun, 13 Aug 2023 23:48:45 +0000 (01:48 +0200)] 
disk: dos: Infer MBR partition sector size from underlying drive sector size

Block devices with 4k sectors imply the MBR sectors are also 4k instead
of regular 512B. Avoid hard-coding the 512B sector size and isntead read
the current block device sector size from it, and if the sector size is
larger than 512B, use the block device sector size.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 months agocommon: bouncebuf: Add missing cast to dma_addr_t
Marek Vasut [Sun, 13 Aug 2023 23:47:47 +0000 (01:47 +0200)] 
common: bouncebuf: Add missing cast to dma_addr_t

Fix the following warning produced on qemu-x86_64_defconfig:

"
common/bouncebuf.c: In function ‘bounce_buffer_stop’:
common/bouncebuf.c:82:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   82 |                 dma_unmap_single((dma_addr_t)state->bounce_buffer,
      |                                  ^
"

The warning is valid, the pointer has to be up-cast first.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Andrew Davis <afd@ti.com>
9 months agodisk: Make blk_get_ops() internal to blk uclass
Marek Vasut [Sun, 13 Aug 2023 23:46:48 +0000 (01:46 +0200)] 
disk: Make blk_get_ops() internal to blk uclass

Move the macro into blk-uclass.c , since it is only used there.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 months agodisk: Move part_create_block_devices() to blk uclass
Marek Vasut [Sun, 13 Aug 2023 23:46:47 +0000 (01:46 +0200)] 
disk: Move part_create_block_devices() to blk uclass

Move part_create_block_devices() to blk uclass and unexpose
the function. This can now be internal to the block uclass.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agodisk: Switch part_blk_*() functions to disk_blk_*()
Marek Vasut [Sun, 13 Aug 2023 23:46:46 +0000 (01:46 +0200)] 
disk: Switch part_blk_*() functions to disk_blk_*()

The behavior of the part_blk_*() functions is now identical
to disk_blk_*() functions, switch the former to the later.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agodisk: Extend disk_blk_part_validate() with range checking
Marek Vasut [Sun, 13 Aug 2023 23:46:45 +0000 (01:46 +0200)] 
disk: Extend disk_blk_part_validate() with range checking

Check whether access is out of bounds of the partition and
return an error. This way there is no danger of esp. write
or erase outside of the confines of partition.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agodisk: Handle partition to block device offset conversion
Marek Vasut [Sun, 13 Aug 2023 23:46:44 +0000 (01:46 +0200)] 
disk: Handle partition to block device offset conversion

Convert the read/write/erase offset from one within a partition
to one within a block device, to correctly access the data on
the block device for both write and erase operations.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agodisk: Simplify disk_blk_{write, erase}() using blk_{write, erase}()
Marek Vasut [Sun, 13 Aug 2023 23:46:43 +0000 (01:46 +0200)] 
disk: Simplify disk_blk_{write, erase}() using blk_{write, erase}()

These two functions are basically identical, just call the blk_*()
functions from disk_blk_*() functions. The only difference is that
the disk_blk_*() functions have to use parent block device as the
udevice implementing block device operations.

Add documentation on what those functions really do. The documentation
is not wrong even though it likely does look that way. The write/erase
functions really do not take into account the partition offset. This
will be fixed in the next patch.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agodisk: Simplify disk_blk_read() using blk_read()
Marek Vasut [Sun, 13 Aug 2023 23:46:42 +0000 (01:46 +0200)] 
disk: Simplify disk_blk_read() using blk_read()

The disk_blk_read() can be simplified using blk_read(), the only
things which needs to be handled are the read offset based on the
partition properties, and the block device ops which are coming
from the parent udevice, not the partition udevice.

The later is currently not implemented correctly as far as I can
tell, since the current code extracts block device descriptor from
the parent udevice which is OK, but extracts block device operations
from the partition udevice, which does not seem OK.

Switching to the blk_read() fixes that too.

The dev_get_blk() usage is simplified using UCLASS_PARTITION check.

Add non-confusing documentation what this really does.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agodisk: Drop always true conditional check
Marek Vasut [Sun, 13 Aug 2023 23:46:41 +0000 (01:46 +0200)] 
disk: Drop always true conditional check

if (device_get_uclass_id(dev) == UCLASS_PARTITION) is always
true, because this disk_blk_read() function calls dev_get_blk()
above and checks its return value for non-NULL. The dev_get_blk()
performs the same device_get_uclass_id(dev) check and returns NULL
if not UCLASS_PARTITION. Drop the duplicate check.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agotest: acpi: Handle both 32bit and 64bit ACPI tables
Marek Vasut [Sun, 13 Aug 2023 01:25:59 +0000 (03:25 +0200)] 
test: acpi: Handle both 32bit and 64bit ACPI tables

Handle both 32bit and 64bit systems, i.e. sandbox and sandbox64
the same way drivers/cpu/cpu_sandbox.c sets those ACPI tables up.
This fixes "$ ./u-boot -Tc 'ut dm dm_test_acpi_write_tables'"
test failure on sandbox64.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 months agotest: Fix the help for the ut command
Marek Vasut [Sat, 12 Aug 2023 22:16:41 +0000 (00:16 +0200)] 
test: Fix the help for the ut command

Drop the 'ut' prefix, this is superfluous and not present in
any of the other ut tests.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 months agoMerge tag 'v2023.10-rc3' into next
Tom Rini [Mon, 21 Aug 2023 21:32:17 +0000 (17:32 -0400)] 
Merge tag 'v2023.10-rc3' into next

Prepare v2023.10-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
9 months agoPrepare v2023.10-rc3 v2023.10-rc3
Tom Rini [Mon, 21 Aug 2023 20:19:59 +0000 (16:19 -0400)] 
Prepare v2023.10-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>