]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
2 years agoriscv: dts: starfive: Enable pcie0 dts node
Minda Chen [Mon, 7 Aug 2023 08:53:36 +0000 (16:53 +0800)] 
riscv: dts: starfive: Enable pcie0 dts node

In StarFive VF2 board. pcie0 connect to VTI usb controller.
Enable it to support usb host.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 years agopci: plda: Get correct ECAM offset in multiple PCIe RC case
Minda Chen [Mon, 7 Aug 2023 08:53:35 +0000 (16:53 +0800)] 
pci: plda: Get correct ECAM offset in multiple PCIe RC case

Get the correct ECAM offset and record the secondary bus
number in Multiple RC case.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 years agocmd/sbi: display new extensions
Heinrich Schuchardt [Wed, 2 Aug 2023 20:39:46 +0000 (22:39 +0200)] 
cmd/sbi: display new extensions

The SBI specification v2.0-rc2 defines new extensions:

* Nested Acceleration Extension (NACL)
* Steal Time Accounting (STA)

Allow the sbi command to display these.

Add missing implementation IDs.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 years agoriscv: qemu: imply CONFIG_DM_RNG
Heinrich Schuchardt [Fri, 28 Jul 2023 13:54:15 +0000 (15:54 +0200)] 
riscv: qemu: imply CONFIG_DM_RNG

The EFI_RNG_PROTOCOL is needed for Linux' KASLR.

QEMU can provide a virtio-rng device to emulate a hardware random number
generator which is supported by our virtio_rng driver.

Enabling CONFIG_DM_RNG will enable CONFIG_VIRTIO_RNG and
CONFIG_EFI_RNG_PROTOCOL by default too.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agoMerge tag 'x86-pull-20230809' of https://source.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Wed, 9 Aug 2023 17:17:34 +0000 (13:17 -0400)] 
Merge tag 'x86-pull-20230809' of https://source.denx.de/u-boot/custodians/u-boot-x86

- x86: Fixes for distro booting
- x86: Move some boards to text environment

2 years agoMerge branch '2023-08-09-misc-cleanups' into next
Tom Rini [Wed, 9 Aug 2023 17:15:51 +0000 (13:15 -0400)] 
Merge branch '2023-08-09-misc-cleanups' into next

- Rework the arch linker scripts to be consistent for all, support
  Kconfig fragments in the board directory and fix some Kconfig options
  that were hex-type by default of 0 not 0x0.

2 years agox86: qemu-x86: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:02:05 +0000 (21:02 -0600)] 
x86: qemu-x86: Convert to text environment

Use the common include.

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: qemu: Add required linux/sizes.h include
Simon Glass [Mon, 31 Jul 2023 03:02:04 +0000 (21:02 -0600)] 
x86: qemu: Add required linux/sizes.h include

These files rely on the config.h file provided this include. Add it
explictily so we can move to a text environment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: efi-x86_payload: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:02:03 +0000 (21:02 -0600)] 
x86: efi-x86_payload: Convert to text environment

Use the common include.

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: efi-x86_app: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:02:02 +0000 (21:02 -0600)] 
x86: efi-x86_app: Convert to text environment

Use the common include. Drop the unnecessary changes, since missing
stdio drivers will be ignored.

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: slimbootloader: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:02:01 +0000 (21:02 -0600)] 
x86: slimbootloader: Convert to text environment

Use the common include along with some additions.

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[Drop common env from slimbootloader.env]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: minnowmax: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:02:00 +0000 (21:02 -0600)] 
x86: minnowmax: Convert to text environment

Use the common include along with some additions.

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: cougarcanyon2: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:01:59 +0000 (21:01 -0600)] 
x86: cougarcanyon2: Convert to text environment

Use the common include. The existing environment includes "vga" but that
is not valid anymore, so let it use vidconsole

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: cherryhill: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:01:58 +0000 (21:01 -0600)] 
x86: cherryhill: Convert to text environment

Use the common include.

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: edison: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:01:57 +0000 (21:01 -0600)] 
x86: edison: Convert to text environment

Don't use the common include since Edison's environment is empty.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: galileo: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:01:56 +0000 (21:01 -0600)] 
x86: galileo: Convert to text environment

Use the common include.

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: bayleybay: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:01:55 +0000 (21:01 -0600)] 
x86: bayleybay: Convert to text environment

Use the common include.

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: crownbay: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:01:54 +0000 (21:01 -0600)] 
x86: crownbay: Convert to text environment

Use the common include.

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: coreboot: Convert to text environment
Simon Glass [Mon, 31 Jul 2023 03:01:53 +0000 (21:01 -0600)] 
x86: coreboot: Convert to text environment

Use the common include and add some options specific to this board.

Drop everything from the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: Add a common include for environment settings
Simon Glass [Mon, 31 Jul 2023 03:01:52 +0000 (21:01 -0600)] 
x86: Add a common include for environment settings

Create a text-file version of x86-common.h which can be used by x86
boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: Drop unused distro settings
Simon Glass [Mon, 31 Jul 2023 03:01:51 +0000 (21:01 -0600)] 
x86: Drop unused distro settings

No x86 board uses distro boot, so drop these settings.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: Drop inclusion of ibmpc.h
Simon Glass [Mon, 31 Jul 2023 03:01:50 +0000 (21:01 -0600)] 
x86: Drop inclusion of ibmpc.h

This is not needed in this file anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: edison: Drop inclusion of ibmpc.h
Simon Glass [Mon, 31 Jul 2023 03:01:49 +0000 (21:01 -0600)] 
x86: edison: Drop inclusion of ibmpc.h

This should be included by files that need it, not the config.h file.
Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: i8254: Include required ibmpc.h header
Simon Glass [Mon, 31 Jul 2023 03:01:48 +0000 (21:01 -0600)] 
x86: i8254: Include required ibmpc.h header

This is needed for this file, so include it here explicitly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: Drop CFG_SYS_STACK_SIZE
Simon Glass [Mon, 31 Jul 2023 03:01:47 +0000 (21:01 -0600)] 
x86: Drop CFG_SYS_STACK_SIZE

This is only used in one file and the value is the same for both boards
which define it. Use the fixed value of 32KB and drop the CFG. This will
allow removal of the config.h files.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agoenv: Explain how to use #include files in text environment
Simon Glass [Mon, 31 Jul 2023 03:01:46 +0000 (21:01 -0600)] 
env: Explain how to use #include files in text environment

Provide documentation on how to share common settings among boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agoenv: Use include/env for text-environment includes
Simon Glass [Mon, 31 Jul 2023 03:01:45 +0000 (21:01 -0600)] 
env: Use include/env for text-environment includes

The 'environment' word is too long. We mostly use 'env' in U-Boot, so use
that as the name of the include directory too.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agodoc: Explain how to avoid the distro-boot scripts
Simon Glass [Mon, 31 Jul 2023 03:01:44 +0000 (21:01 -0600)] 
doc: Explain how to avoid the distro-boot scripts

Now that standard boot is available, mention this in the environment
documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: Update qemu documentation
Simon Glass [Sun, 30 Jul 2023 17:16:07 +0000 (11:16 -0600)] 
x86: Update qemu documentation

Add some hints and observations related to booting distros on QEMU on x86.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: Enable useful options for qemu-86
Simon Glass [Sun, 30 Jul 2023 17:16:06 +0000 (11:16 -0600)] 
x86: Enable useful options for qemu-86

This build can be used to boot 32-bit standard-distro builds. Enable some
more options, so that all possible EFI UUIDs are decoded, we can search
memory for tables, support the full set of standard-boot features, have
full logging along with debug UART and can boot from CDROM media.

This mirrors a similar patch for qemu-x86_64

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[Drop the unknown option from defconfig]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2 years agovideo: Add a Kconfig option for SPL video handoff
Simon Glass [Sun, 30 Jul 2023 17:16:05 +0000 (11:16 -0600)] 
video: Add a Kconfig option for SPL video handoff

At present this feature is enabled in SPL if a bloblist is available.
Some platforms may not want to use this, so add an option to allow the
feature to be disabled.

Note that the feature unfortunately only fills in part of the
video-handoff information, so causes failures on x86 platforms. For now,
disable it there.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com> # qemu-x86_64
2 years agox86: Correct copying of BIOS mode information
Simon Glass [Sun, 30 Jul 2023 17:16:04 +0000 (11:16 -0600)] 
x86: Correct copying of BIOS mode information

This is copying beyond the end of the destination buffer. Correct the code
by using the size of the  vesa_mode_info struct. We don't need to copy the
rest of the bytes in the buffer.

This long-standing bug prevents virtio bootdevs working correctly on
qemu-x86 at present.

Fixes: 0ca2426beae ("x86: Add support for running option ROMs natively")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com> # qemu-x86_64
2 years agoRevert "x86: Switch QEMU over to use the bochs driver"
Simon Glass [Sun, 30 Jul 2023 17:16:02 +0000 (11:16 -0600)] 
Revert "x86: Switch QEMU over to use the bochs driver"

Unfortunately the bochs driver does not currently work with distros.
It causes a hang between grub menu selection and the OS displaying
something.

Preliminary investigation shows that GRUB does not jump to the kernel
at all.

This reproduces reliably.

This reverts commit b8956425d525c3c25fd218f252f89a5e44df6a9f.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com> # qemu-x86_64
[Slightly modify the commit message about preliminary investigation]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: Run QEMU machine setup in SPL
Simon Glass [Sun, 30 Jul 2023 17:16:01 +0000 (11:16 -0600)] 
x86: Run QEMU machine setup in SPL

Call the hardware-init function from QEMU from SPL. This allows the
video BIOS to operate correctly.

Create an x86-wide qemu.h header to avoid having to #ifdef the header
in spl.c

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com> # qemu-x86_64
2 years agovideo: Tidy up Makefile rule for video
Simon Glass [Sun, 30 Jul 2023 17:16:00 +0000 (11:16 -0600)] 
video: Tidy up Makefile rule for video

Drop the duplication and add a single rule which can handle SPL as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: spl: Drop unwanted debug()
Simon Glass [Sun, 30 Jul 2023 17:15:59 +0000 (11:15 -0600)] 
x86: spl: Drop unwanted debug()

This was left over from some previous debugging. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: coreboot: Update doc for CBFS access
Simon Glass [Sun, 30 Jul 2023 17:15:19 +0000 (11:15 -0600)] 
x86: coreboot: Update doc for CBFS access

Add an example to show how cbfs is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[Removed CONFIG_CMD_CBFS from defconfig files]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2 years agobootstd: Add some more debugging in the bootdev uclass
Simon Glass [Sun, 30 Jul 2023 17:15:16 +0000 (11:15 -0600)] 
bootstd: Add some more debugging in the bootdev uclass

Add some more output to make it easier to see what is going wrong when
a bootdev hunter fails.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agobootstd: Correct creating of bootdev sibling
Simon Glass [Sun, 30 Jul 2023 17:15:15 +0000 (11:15 -0600)] 
bootstd: Correct creating of bootdev sibling

Use the correct function here, since there may be multiple IDE devices
available.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2 years agobootstd: Rename bootdev_setup_sibling_blk()
Simon Glass [Sun, 30 Jul 2023 17:15:14 +0000 (11:15 -0600)] 
bootstd: Rename bootdev_setup_sibling_blk()

This name is a little confusing since it suggests that it sets up the
sibling block device. In fact it sets up a bootdev for it. Rename the
function to make this clearer.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2 years agolib: Suppress E when writing error-string output
Simon Glass [Sun, 30 Jul 2023 17:15:13 +0000 (11:15 -0600)] 
lib: Suppress E when writing error-string output

When CONFIG_ERRNO_STR is not enabled this shows a spurious 'E' from the
format string. Fix this.

Fixes: 7f331941321 ("lib: Support printing an error string")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agousb: Return -ENOENT when no devices are found
Simon Glass [Sun, 30 Jul 2023 17:15:12 +0000 (11:15 -0600)] 
usb: Return -ENOENT when no devices are found

When USB finds no devices it currently returns -EPERM which bootstd does
not understand. This causes other bootdevs of the same priority to be
skipped.

Fix this by returning the correct error code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agoscripts: kconfig: Add config fragment support in board/../
Jason Kacines [Tue, 11 Jul 2023 21:20:46 +0000 (16:20 -0500)] 
scripts: kconfig: Add config fragment support in board/../

Add support to config fragments (.config) located in the /board
directory. This will allow only base defconfigs to live in /configs and
all fragments to live in their respective device directory in /board/..

Signed-off-by: Jason Kacines <j-kacines@ti.com>
2 years agotreewide: unify the linker symbol reference format
Shiji Yang [Thu, 3 Aug 2023 01:47:17 +0000 (09:47 +0800)] 
treewide: unify the linker symbol reference format

Now all linker symbols are declared as type char[]. Though we can
reference the address via both the array name 'var' and its address
'&var'. It's better to unify them to avoid confusing developers.
This patch converts all '&var' linker symbol refrences to the most
commonly used format 'var'.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agotreewide: rework linker symbol declarations in sections header
Shiji Yang [Thu, 3 Aug 2023 01:47:16 +0000 (09:47 +0800)] 
treewide: rework linker symbol declarations in sections header

1. Convert all linker symbols to char[] type so that we can get the
   corresponding address by calling array name 'var' or its address
   '&var'. In this way, we can avoid some potential issues[1].
2. Remove unused symbol '_TEXT_BASE'. It has been abandoned and has
   not been referenced by any source code.
3. Move '__data_end' to the arch x86's own sections header as it's
   only used by x86 arch.
4. Remove some duplicate declared linker symbols. Now we use the
   standard header file to declare them.

[1] This patch fixes the boot failure on MIPS target. Error log:
SPL: Image overlaps SPL

Fixes: 1b8a1be1a1f1 ("spl: spl_legacy: Fix spl_end address")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoKconfigs: Correct default of "0" on hex type entries
Tom Rini [Wed, 2 Aug 2023 15:09:43 +0000 (11:09 -0400)] 
Kconfigs: Correct default of "0" on hex type entries

It is not a parse error to have a default value of "0" for a "hex" type
entry, instead of "0x0".  However, "0" and "0x0" are not treated the
same even by the tools themselves. Correct this by changing the default
value from "0" to "0x0" for all hex type questions that had the
incorrect default. Fix one instance (in two configs) of a default of "0"
being used on a hex question to be "0x0". Remove the cases where a
defconfig had set a value of "0x0" to be used as the default had been
"0".

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge tag 'doc-2023-10-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Wed, 9 Aug 2023 12:28:50 +0000 (08:28 -0400)] 
Merge tag 'doc-2023-10-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for doc-2023-10-rc3

Documentation:

* Update examples for imx8mp_evk
* OpenOCD debugging guide for TI K3 boards
* Explain using gadget devices on TI boards
* Describe best practices for board ports

2 years agoMerge tag 'fsl-qoriq-2023-8-9' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Wed, 9 Aug 2023 12:28:27 +0000 (08:28 -0400)] 
Merge tag 'fsl-qoriq-2023-8-9' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq

- Drop one unused function for layerscape

2 years agoarm64: fsl: layerscape: Remove unused functions
Shenlin Liang [Fri, 28 Jul 2023 06:57:44 +0000 (14:57 +0800)] 
arm64: fsl: layerscape: Remove unused functions

Function board_switch_core_volt has not been used since it was
defined

Signed-off-by: Shenlin Liang <liangshenlin@eswincomputing.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agodoc: Begin adding a best practices document for board ports
Tom Rini [Tue, 8 Aug 2023 20:36:16 +0000 (16:36 -0400)] 
doc: Begin adding a best practices document for board ports

To help guide developers down the right path, begin a document that
lists some best practices to follow when creating a new board port.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodoc: imx8mp_evk: Use in-tree build in the example
Fabio Estevam [Mon, 7 Aug 2023 13:42:47 +0000 (10:42 -0300)] 
doc: imx8mp_evk: Use in-tree build in the example

To make it consistent with the instructions from other NXP imx8m boards,
such as imx8mm-evk and imx8mn-evk, use U-Boot in-tree build in the
examples.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agodoc: imx8mp_evk: Remove unneeded export ATF_LOAD_ADDR line
Fabio Estevam [Mon, 7 Aug 2023 13:42:46 +0000 (10:42 -0300)] 
doc: imx8mp_evk: Remove unneeded export ATF_LOAD_ADDR line

Originally, exporting the ATF_LOAD_ADDR was required, but since binman has
been used to generate the flash.bin, it is no longer needed to do
such manual export.

The ATF address is now passed via binman in imx8mp-u-boot.dtsi:

atf {
description = "ARM Trusted Firmware";
type = "firmware";
arch = "arm64";
compression = "none";
load = <0x970000>;
entry = <0x970000>;

atf_blob: atf-blob {
filename = "bl31.bin";
type = "atf-bl31";
};
};

Remove the  unneeded export ATF_LOAD_ADDR line.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agodoc: ti: Explain how the various gadget devices can be used
Miquel Raynal [Mon, 7 Aug 2023 06:42:41 +0000 (08:42 +0200)] 
doc: ti: Explain how the various gadget devices can be used

Describe the current situation wrt the handling of USB devices on AM33xx
based boards, taking the example of a common board (the Beagle Bone
Black) and explaining how the different USB gadgets can be used.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
2 years agodoc: board: toradex: fix verdin module output
Marcel Ziswiler [Sun, 6 Aug 2023 23:44:46 +0000 (01:44 +0200)] 
doc: board: toradex: fix verdin module output

Fix the Verdin module output which was missing white space for correct
rendering.

While at it also leave product links, add section author also for the
Verdin iMX8M Mini and Plus, and add a missing CROSS_COMPILE export for
the Verdin iMX8M Mini.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Nishanth Menon <nm@ti.com> #verdin-am62
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agodoc: Add the link for the documentation of the .its
Jit Loon Lim [Fri, 4 Aug 2023 02:28:39 +0000 (10:28 +0800)] 
doc: Add the link for the documentation of the .its

Provide the link for the .its related documentation for Arria10.

Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
2 years agodoc: board: ti: k3: Add a guide to debugging with OpenOCD
Jason Kacines [Thu, 3 Aug 2023 06:29:22 +0000 (01:29 -0500)] 
doc: board: ti: k3: Add a guide to debugging with OpenOCD

Bootloader debug usually tends to be a bit dicey prior to DDR and
serial port getting active in the system. JTAG typically remains the
only practical debug option during the initial bringup.

OpenOCD is one of the most popular environment for providing debug
capability via a GDB compatible interface for developers to work with.

Debugging U-Boot and bootloaders on K3 platform does have a bit of
tribal knowledge that is better documented in our common platform
documentation.

Signed-off-by: Jason Kacines <j-kacines@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2 years agoMerge branch '2023-08-08-assorted-code-corrections' into next
Tom Rini [Wed, 9 Aug 2023 01:38:05 +0000 (21:38 -0400)] 
Merge branch '2023-08-08-assorted-code-corrections' into next

- A number of code corrections caught by Smatch and a few others as
  well.

2 years agopci: correct function name in message
Heinrich Schuchardt [Thu, 27 Jul 2023 16:50:14 +0000 (18:50 +0200)] 
pci: correct function name in message

If an error message contains a function name, it should match the name of
the function throwing the message.

Fixes: 7739d93d8288 ("pci: Match region flags using a mask")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoboard_f: Cosmetic style fix
Bin Meng [Fri, 21 Jul 2023 16:15:21 +0000 (00:15 +0800)] 
board_f: Cosmetic style fix

Some coding convention fixes for print_resetinfo().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocrc32: Drop duplicates crc header includes
Ilya Lukin [Fri, 14 Jul 2023 14:39:32 +0000 (17:39 +0300)] 
crc32: Drop duplicates crc header includes

Fixes: 3db711085752 ("crc32: Use the crc.h header for crc functions")
Signed-off-by: Ilya Lukin <4.shket@gmail.com>
2 years agobtrfs: fix some error checking for btrfs_decompress()
Dan Carpenter [Thu, 3 Aug 2023 10:29:34 +0000 (13:29 +0300)] 
btrfs: fix some error checking for btrfs_decompress()

The btrfs_decompress() function mostly (u32)-1 on error but it can
also return -EPERM or other kernel error codes from zstd_decompress().
The "ret" variable is an int, so we could just check for negatives.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Qu Wenruo <wqu@suse.com>
2 years agotest: fix a couple NULL vs IS_ERR() checks
Dan Carpenter [Mon, 31 Jul 2023 14:08:41 +0000 (17:08 +0300)] 
test: fix a couple NULL vs IS_ERR() checks

The x509_cert_parse() and pkcs7_parse_message() functions return error
pointers.  They don't return NULL.  Update the checks accordingly.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoexpo: allocate correct amount of memory
Dan Carpenter [Mon, 31 Jul 2023 14:08:29 +0000 (17:08 +0300)] 
expo: allocate correct amount of memory

This should be allocating the memory for "item" instead of "menu".
The item struct is 48 bytes instead of 96 (assuming a 64bit system)
so this saves a little memory.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocmd: improve string matching for hex
Dan Carpenter [Mon, 31 Jul 2023 14:03:59 +0000 (17:03 +0300)] 
cmd: improve string matching for hex

Match the "=0x" instead of just "=0".

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Heinrich.Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agocramfs: clean up some error messages
Dan Carpenter [Thu, 27 Jul 2023 07:16:03 +0000 (10:16 +0300)] 
cramfs: clean up some error messages

This line break is not done correctly.  We don't want to have all those
tabs in the printed output.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotest: unicode: fix a sizeof() vs ARRAY_SIZE() bug
Dan Carpenter [Thu, 27 Jul 2023 07:12:58 +0000 (10:12 +0300)] 
test: unicode: fix a sizeof() vs ARRAY_SIZE() bug

The u16_strlcat() is in units of u16 not bytes.  So the limit needs to
be ARRAY_SIZE() instead of sizeof().

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2 years agocmd: pxe_utils: add some missing tabs
Dan Carpenter [Thu, 27 Jul 2023 07:12:39 +0000 (10:12 +0300)] 
cmd: pxe_utils: add some missing tabs

These lines are supposed to be indented one more tab.  Otherwise it's
confusing to read.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agoremoteproc: uclass: Clean up a return
Dan Carpenter [Wed, 26 Jul 2023 07:00:33 +0000 (10:00 +0300)] 
remoteproc: uclass: Clean up a return

We know that "pa" is non-NULL so it's nicer to just return zero instead
of return !pa.  This has no effect on runtime behavior.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agofdt: off by one in ofnode_lookup_fdt()
Dan Carpenter [Wed, 26 Jul 2023 06:59:52 +0000 (09:59 +0300)] 
fdt: off by one in ofnode_lookup_fdt()

The "oftree_count" is the number of entries which have been set in
the oftree_list[] array.  If all the entries have been initialized then
this off by one would result in reading one element beyond the end
of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agofs: btrfs: Prevent error pointer dereference in list_subvolums()
Dan Carpenter [Wed, 26 Jul 2023 06:59:04 +0000 (09:59 +0300)] 
fs: btrfs: Prevent error pointer dereference in list_subvolums()

If btrfs_read_fs_root() fails with -ENOENT, then we go to the next
entry.  Fine.  But if it fails for a different reason then we need
to clean up and return an error code.  In the current code it
doesn't clean up but instead dereferences "root" and crashes.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Qu Wenruo <wqu@suse.com>
2 years agocros_ec: Fix an error code is cros_ec_get_sku_id()
Dan Carpenter [Wed, 26 Jul 2023 06:58:34 +0000 (09:58 +0300)] 
cros_ec: Fix an error code is cros_ec_get_sku_id()

The ec_command_inptr() function returns negative error codes or
the number of bytes that it was able to read.  The cros_ec_get_sku_id()
function should return negative error codes.  Right now it returns
positive error codes or negative byte counts.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agovideo: Add parentheses around VNBYTES() macro
Dan Carpenter [Wed, 26 Jul 2023 06:54:08 +0000 (09:54 +0300)] 
video: Add parentheses around VNBYTES() macro

The VNBYTES() macro needs to have parentheses to prevent some (harmless)
macro expansion bugs.  The VNBYTES() macro is used like this:

VID_TO_PIXEL(x) * VNBYTES(vid_priv->bpix)

The * operation is done before the / operation.  It still ends up with
the same results, but it's not ideal.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocmd: Fix a size parameter in test_readonly()
Dan Carpenter [Tue, 25 Jul 2023 06:50:26 +0000 (09:50 +0300)] 
cmd: Fix a size parameter in test_readonly()

The parentheses are in the wrong place so this passes the number of
bytes to write as "sizeof(index_0) != TPM_SUCCESS" when just
"sizeof(index_0)" was intended.  (1 byte vs 4 bytes).

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2 years agocmd: Fix an error code in cmd_mux_find()
Dan Carpenter [Tue, 25 Jul 2023 06:50:08 +0000 (09:50 +0300)] 
cmd: Fix an error code in cmd_mux_find()

This returns the wrong variable.  It ends up returning NULL when it was
suppose to return an error pointer.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2 years agolib/charset: fix u16_strlcat() return value
Matthias Schiffer [Fri, 14 Jul 2023 11:24:51 +0000 (13:24 +0200)] 
lib/charset: fix u16_strlcat() return value

strlcat returns min(strlen(dest), count)+strlen(src). Make u16_strlcat's
behaviour the same for consistency.

Fixes: eca08ce94ceb ("lib/charset: add u16_strlcat() function")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
2 years agoRevert "lib: string: Fix strlcpy return value", fix callers
Matthias Schiffer [Fri, 14 Jul 2023 11:24:50 +0000 (13:24 +0200)] 
Revert "lib: string: Fix strlcpy return value", fix callers

Both the Linux kernel and libbsd agree that strlcpy() should always
return strlen(src) and not include the NUL termination. The incorrect
U-Boot implementation makes it impossible to check the return value for
truncation, and breaks code written with the usual implementation in
mind (for example, fdtdec_add_reserved_memory() was subtly broken).

I reviewed all callers of strlcpy() and strlcat() and fixed them
according to my understanding of the intended function.

This reverts commit d3358ecc54be0bc3b4dd11f7a63eab0a2842f772 and adds
related fixes.

Fixes: d3358ecc54be ("lib: string: Fix strlcpy return value")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2 years agoMerge branch '2023-08-08-introuce-Arm-FF-A-support'
Tom Rini [Tue, 8 Aug 2023 19:23:16 +0000 (15:23 -0400)] 
Merge branch '2023-08-08-introuce-Arm-FF-A-support'

To quote the author:
Adding support for Arm FF-A v1.0 (Arm Firmware Framework for Armv8-A) [A].

FF-A specifies interfaces that enable a pair of software execution
environments aka partitions to communicate with each other. A partition
could be a VM in the Normal or Secure world, an application in S-EL0, or
a Trusted OS in S-EL1.

FF-A is a discoverable bus and similar to architecture features.
FF-A bus is discovered using ARM_SMCCC_FEATURES mechanism performed by
the PSCI driver.

   => dm tree

    Class     Index  Probed  Driver                Name
   -----------------------------------------------------------
   ...
    firmware      0  [ + ]   psci                      |-- psci
    ffa                   0  [   ]   arm_ffa               |   `-- arm_ffa
   ...

Clients are able to probe then use the FF-A bus by calling the DM class
searching APIs (e.g: uclass_first_device).

This implementation of the specification provides support for Aarch64.

The FF-A driver uses the SMC ABIs defined by the FF-A specification to:

    - Discover the presence of secure partitions (SPs) of interest
    - Access an SP's service through communication protocols
      (e.g: EFI MM communication protocol)

The FF-A support provides the following features:

    - Being generic by design and can be used by any Arm 64-bit platform
    - FF-A support can be compiled and used without EFI
    - Support for SMCCCv1.2 x0-x17 registers
    - Support for SMC32 calling convention
    - Support for 32-bit and 64-bit FF-A direct messaging
    - Support for FF-A MM communication (compatible with EFI boot time)
    - Enabling FF-A and MM communication in Corstone1000 platform as a use case
    - A Uclass driver providing generic FF-A methods.
    - An Arm FF-A device driver providing Arm-specific methods and reusing the Uclass methods.
    - A sandbox emulator for Arm FF-A, emulates the FF-A side of the Secure World and provides
      FF-A ABIs inspection methods.
    - An FF-A sandbox device driver for FF-A communication with the emulated Secure World.
      The driver leverages the FF-A Uclass to establish FF-A communication.
    - Sandbox FF-A test cases.
    - A new command called armffa is provided as an example of how to access the
      FF-A bus

For more details about the FF-A support please refer to [B] and refer to [C] for
how to use the armffa command.

Please find at [D] an example of the expected boot logs when enabling
FF-A support for a platform. In this example the platform is
Corstone1000. But it can be any Arm 64-bit platform.

More details:

[A]: https://developer.arm.com/documentation/den0077/latest/
[B]: doc/arch/arm64.ffa.rst
[C]: doc/usage/cmd/armffa.rst
[D]: example of boot logs when enabling FF-A

2 years agoarm_ffa: efi: corstone1000: enable MM communication
Abdellatif El Khlifi [Fri, 4 Aug 2023 13:33:45 +0000 (14:33 +0100)] 
arm_ffa: efi: corstone1000: enable MM communication

turn on EFI MM communication

On Corstone-1000 platform MM communication between u-boot
and the secure world (Optee) is done using the FF-A bus.

Changes made are generated using savedefconfig.

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
2 years agoarm_ffa: efi: introduce FF-A MM communication
Abdellatif El Khlifi [Fri, 4 Aug 2023 13:33:44 +0000 (14:33 +0100)] 
arm_ffa: efi: introduce FF-A MM communication

Add MM communication support using FF-A transport

This feature allows accessing MM partitions services through
EFI MM communication protocol. MM partitions such as StandAlonneMM
or smm-gateway secure partitions which reside in secure world.

An MM shared buffer and a door bell event are used to exchange
the data.

The data is used by EFI services such as GetVariable()/SetVariable()
and copied from the communication buffer to the MM shared buffer.

The secure partition is notified about availability of data in the
MM shared buffer by an FF-A message (door bell).

On such event, MM SP can read the data and updates the MM shared
buffer with the response data.

The response data is copied back to the communication buffer and
consumed by the EFI subsystem.

MM communication protocol supports FF-A 64-bit direct messaging.

We tested the FF-A MM communication on the Corstone-1000 platform.

We ran the UEFI SCT test suite containing EFI setVariable, getVariable and
getNextVariable tests which involve FF-A MM communication and all tests
are passing with the current changes.

We made the SCT test reports (part of the ACS results) public following the
latest Corstone-1000 platform software release. Please find the test
reports at [1].

[1]: https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-test-report/-/tree/master/embedded-a/corstone1000/CORSTONE1000-2023.06/acs_results_fpga.zip

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Tested-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarm_ffa: introduce armffa command
Abdellatif El Khlifi [Fri, 4 Aug 2023 13:33:43 +0000 (14:33 +0100)] 
arm_ffa: introduce armffa command

Provide armffa command showcasing the use of the U-Boot FF-A support

armffa is a command showcasing how to invoke FF-A operations.
This provides a guidance to the client developers on how to
call the FF-A bus interfaces. The command also allows to gather secure
partitions information and ping these  partitions. The command is also
helpful in testing the communication with secure partitions.

For more details please refer to the command documentation [1].

A Sandbox test is provided for the armffa command.

[1]: doc/usage/cmd/armffa.rst

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoarm_ffa: introduce sandbox test cases for UCLASS_FFA
Abdellatif El Khlifi [Fri, 4 Aug 2023 13:33:42 +0000 (14:33 +0100)] 
arm_ffa: introduce sandbox test cases for UCLASS_FFA

Add functional test cases for the FF-A support

These tests rely on the FF-A sandbox emulator and FF-A
sandbox driver which help in inspecting the FF-A communication.

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoarm_ffa: introduce sandbox FF-A support
Abdellatif El Khlifi [Fri, 4 Aug 2023 13:33:41 +0000 (14:33 +0100)] 
arm_ffa: introduce sandbox FF-A support

Emulate Secure World's FF-A ABIs and allow testing U-Boot FF-A support

Features of the sandbox FF-A support:

- Introduce an FF-A emulator
- Introduce an FF-A device driver for FF-A comms with emulated Secure World
- Provides test methods allowing to read the status of the inspected ABIs

The sandbox FF-A emulator supports only 64-bit direct messaging.

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoarm_ffa: introduce Arm FF-A support
Abdellatif El Khlifi [Fri, 4 Aug 2023 13:33:40 +0000 (14:33 +0100)] 
arm_ffa: introduce Arm FF-A support

Add Arm FF-A support implementing Arm Firmware Framework for Armv8-A v1.0

The Firmware Framework for Arm A-profile processors (FF-A v1.0) [1]
describes interfaces (ABIs) that standardize communication
between the Secure World and Normal World leveraging TrustZone
technology.

This driver uses 64-bit registers as per SMCCCv1.2 spec and comes
on top of the SMCCC layer. The driver provides the FF-A ABIs needed for
querying the FF-A framework from the secure world.

The driver uses SMC32 calling convention which means using the first
32-bit data of the Xn registers.

All supported ABIs come with their 32-bit version except FFA_RXTX_MAP
which has 64-bit version supported.

Both 32-bit and 64-bit direct messaging are supported which allows both
32-bit and 64-bit clients to use the FF-A bus.

FF-A is a discoverable bus and similar to architecture features.
FF-A bus is discovered using ARM_SMCCC_FEATURES mechanism performed
by the PSCI driver.

Clients are able to probe then use the FF-A bus by calling the DM class
searching APIs (e.g: uclass_first_device).

The Secure World is considered as one entity to communicate with
using the FF-A bus. FF-A communication is handled by one device and
one instance (the bus). This FF-A driver takes care of all the
interactions between Normal world and Secure World.

The driver exports its operations to be used by upper layers.

Exported operations:

- ffa_partition_info_get
- ffa_sync_send_receive
- ffa_rxtx_unmap

Generic FF-A methods are implemented in the Uclass (arm-ffa-uclass.c).
Arm specific methods are implemented in the Arm driver (arm-ffa.c).

For more details please refer to the driver documentation [2].

[1]: https://developer.arm.com/documentation/den0077/latest/
[2]: doc/arch/arm64.ffa.rst

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agolib: uuid: introduce testcase for uuid_str_to_le_bin
Abdellatif El Khlifi [Fri, 4 Aug 2023 13:33:39 +0000 (14:33 +0100)] 
lib: uuid: introduce testcase for uuid_str_to_le_bin

provide a test case

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2 years agolib: uuid: introduce uuid_str_to_le_bin function
Abdellatif El Khlifi [Fri, 4 Aug 2023 13:33:38 +0000 (14:33 +0100)] 
lib: uuid: introduce uuid_str_to_le_bin function

convert UUID string to little endian binary data

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
2 years agoarm64: smccc: add support for SMCCCv1.2 x0-x17 registers
Abdellatif El Khlifi [Fri, 4 Aug 2023 13:33:37 +0000 (14:33 +0100)] 
arm64: smccc: add support for SMCCCv1.2 x0-x17 registers

add support for x0-x17 registers used by the SMC calls

In SMCCC v1.2 [1] arguments are passed in registers x1-x17.
Results are returned in x0-x17.

This work is inspired from the following kernel commit:

arm64: smccc: Add support for SMCCCv1.2 extended input/output registers

[1]: https://documentation-service.arm.com/static/5f8edaeff86e16515cdbe4c6?token=

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2 years agoPrepare v2023.10-rc2 v2023.10-rc2
Tom Rini [Mon, 7 Aug 2023 19:26:50 +0000 (15:26 -0400)] 
Prepare v2023.10-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 7 Aug 2023 19:17:12 +0000 (15:17 -0400)] 
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2023-08-07-assorted-fixes'
Tom Rini [Mon, 7 Aug 2023 19:11:17 +0000 (15:11 -0400)] 
Merge branch '2023-08-07-assorted-fixes'

- Update Azure jobs again, a few MAINTAINERS updates, a few Kconfig
  fixes, an erofs fix and a fix for the recent ten64 updates.

2 years agofs/erofs: Remove an unnecessary assertion
Yifan Zhao [Wed, 26 Jul 2023 04:56:04 +0000 (12:56 +0800)] 
fs/erofs: Remove an unnecessary assertion

In [1] Sam points out an assertion does not hold true for 32-bit
platforms, which only impacts Large File Support (LFS) API usage
in erofs-utils according to Xiang [2]. We don't think these APIs
are used in u-boot and this restriction could be safely removed.

[1] https://lists.denx.de/pipermail/u-boot/2023-July/524679.html
[2] https://lists.denx.de/pipermail/u-boot/2023-July/524727.html

Fixes: 3a21e92fc255 ("fs/erofs: Introduce new features including ztailpacking, fragments and dedupe")
Signed-off-by: Yifan Zhao <zhaoyifan@sjtu.edu.cn>
Tested-by: Sam Edwards <CFSworks@gmail.com>
2 years agocommon: Drop duplicate space in SPL_BMP description
Marek Vasut [Sat, 29 Jul 2023 13:34:51 +0000 (15:34 +0200)] 
common: Drop duplicate space in SPL_BMP description

Drop duplicate space in Kconfig symbol description.

Signed-off-by: Marek Vasut <marex@denx.de>
2 years agocommon: fix detection of SYS_MALLOC_F_LEN=0x0
Heinrich Schuchardt [Tue, 1 Aug 2023 13:33:41 +0000 (15:33 +0200)] 
common: fix detection of SYS_MALLOC_F_LEN=0x0

CONFIG_$(SPL_TPL_)SYS_MALLOC_F_LEN is defined as hex. If set to zero
manually, .config contains '0x0' and not '0' as value.

The default value for CONFIG_SPL_SYS_MALLOC_F_LEN should not be set to 0
but to 0x0 if CONFIG_SPL_FRAMEWORK=n to match a manually set value.

Fixes: c0126bd862a0 ("spl: Support bootstage, log, hash and early malloc in TPL")
Fixes: b61694705217 ("SPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agospl: move SPL_CRC32 option to lib/Kconfig
Oleksandr Suvorov [Thu, 3 Aug 2023 16:05:40 +0000 (19:05 +0300)] 
spl: move SPL_CRC32 option to lib/Kconfig

All SPL hash algorithm options are collected in lib/Kconfig. Move
SPL_CRC32 there as well.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agospl: remove duplicate SPL_MD5 option
Oleksandr Suvorov [Thu, 3 Aug 2023 16:05:39 +0000 (19:05 +0300)] 
spl: remove duplicate SPL_MD5 option

There is another SPL_MD5 option defined in lib/Kconfig.
Renaming SPL_MD5_SUPPORT introduced duplicate option with
different description. As for now FIT and hash algorithm options
are not related to each others, removing a duplicate option seems OK.

Fixes: 4b00fd1a84c ("Kconfig: Rename SPL_MD5_SUPPORT to SPL_MD5")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2 years agobloblist: Enforce CRC32
Tom Rini [Mon, 7 Aug 2023 16:32:19 +0000 (12:32 -0400)] 
bloblist: Enforce CRC32

In the common bloblist code we call crc32 to get a checksum for the
data.  Ensure we will have the CRC32 code via select.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMAINTAINERS: Update rockchip platform maintain files
Kever Yang [Mon, 7 Aug 2023 07:52:47 +0000 (15:52 +0800)] 
MAINTAINERS: Update rockchip platform maintain files

Add px30, rv1126 soc, and rockchip soc based boards.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoMAINTAINERS: add DT/bindings files to at91 entry
Eugen Hristev [Mon, 7 Aug 2023 07:22:03 +0000 (10:22 +0300)] 
MAINTAINERS: add DT/bindings files to at91 entry

With this change the DT and binding files are under the at91 tree
maintainer, and get_maintainer.pl correctly reports the entry.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
2 years agoboard: ten64: add missing error checks for retimer power on
Mathew McBride [Mon, 7 Aug 2023 01:41:08 +0000 (01:41 +0000)] 
board: ten64: add missing error checks for retimer power on

The retimer reset/power on logic was changed in a recent commit,
however, it neglected to check if the commands sent to the
board microcontroller (to control power to the retimer chip)
actually completed.

Add return checks for these operations so any failures will
be reported to the user.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Fixes: 7a041fea2 ("board: traverse: ten64: ensure retimer reset
is done on new board revisions")

2 years agoARM: renesas: Update MAINTAINERS file
Marek Vasut [Sun, 6 Aug 2023 18:57:34 +0000 (20:57 +0200)] 
ARM: renesas: Update MAINTAINERS file

Update MAINTAINERS file. Add missing MAINTAINERS file for Spider,
Whitehawk and V3HSK boards. Update mail addresses. Add file globs
to match on DT and driver files related to these boards.

The GRPEACH and R2DPLUS are special in that they are not R-Car
and have their own set of specialized drivers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 years agoget_maintainer.pl: Add an ignore list for git history
Tom Rini [Mon, 7 Aug 2023 13:20:53 +0000 (09:20 -0400)] 
get_maintainer.pl: Add an ignore list for git history

As Pali Rohár has asked to not be copied on changes to files he is not
a specific maintainer of, add his address to .get_maintainer.ignore.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>