Commit graph

84032 commits

Author SHA1 Message Date
Tom Rini
6e73ab32d8 spl: sata: Rework the loading case it not use IS_ENABLED(...)
In this case, using IS_ENABLED(...) to attempt to load the image results
in harder to read and less useful code, along with having to define a
CONFIG value that would be unused. To maintain the current albeit
slightly odd behavior, maintain that if we have both SPL_FS_FAT and
SPL_SATA_RAW_U_BOOT_USE_SECTOR enabled, we use SPL_FS_FAT for the load.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
d35e44fbe7 autoboot: Rework CONFIG_AUTOBOOT_STOP_STR_* usage
In order to not define a CONFIG value when the
CONFIG_AUTOBOOT_STOP_STR_* functionality is not enabled, rework the
assignment of empty and unused (as the code will be discarded under if
0, in the end) values to be AUTOBOOT_STOP_STR_* instead of
CONFIG_AUTOBOOT_STOP_STR_*.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
1c88640fc8 arm: lib1funcs.S: Update compatibility with Linux comment slightly
At this point, the Linux code for "lib1funcs" has changed rather
dramatically. While a resync would be beneficial, it's outside the scope
of what we need here.  Simply remove the define for CONFIG_AEABI and
tests for it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
5bbf9c927a dm: ns16550: Restore how we define UART_REG
Prior to commit 9591b63531 ("Convert CONFIG_SYS_NS16550_MEM32 et al to
Kconfig") we had defined CONFIG_SYS_NS16550_REG_SIZE to -1 with
DM_SERIAL such that we would then have a size 0 character array. This
resulted in functionally no padding. The confusion on my part came from
dealing with the constraints around platforms that do not use DM_SERIAL
in SPL/TPL. After Andre Przywara reported that sunxi was broken, I've
re-read the code and comments again and thought on this harder. What we
want I believe is what this patch does now.

If DM_SERIAL is defined for this stage, regardless of
CONFIG_SYS_NS16550_REG_SIZE then we will dynamically handle reg shifts
and 'struct ns16550' needs no padding (which is functionally what
unsigned char foo[0] provides). This is the same case as NS16550_DYNAMIC
and DEBUG_UART. Expand the existing comment here slightly.

Otherwise, we will have CONFIG_SYS_NS16550_REG_SIZE set to a non-zero
value, and handle padding within the struct.

Cc: Simon Glass <sjg@chromium.org>
Cc: Sergei Antonov <saproj@gmail.com>
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Fixes: 9591b63531 ("Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig")
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-01-20 12:27:06 -05:00
Tom Rini
ae8a922bd2 arm: Rework usage of CONFIG_ARMV[78]_SECURE_BASE in linker scripts
In order to avoid defining CONFIG_ARMV[78_]SECURE_BASE as empty in the
linker scripts, if not already defined, add and use
__ARMV[78_]SECURE_BASE for when the base is not defined and we want the
linker scripts to continue.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
81451a3985 i2c: fsl_i2c: Rework usage of CONFIG_SYS_IMMR
This driver is used on both m68k, where CONFIG_SYS_IMMR is not used, and
PowerPC an ARM where it is. Abstract this to a new value rather than
re-defining a CONFIG symbol on m68k.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
409163a46e arc: Migrate ARC_MMU_VER to Kconfig
Move this value to Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
a3fda0d30a global: Remove unused CONFIG defines
Remove some CONFIG symbols and related comments, etc, that are unused
within the code itself at this point.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Ilias Apalodimas
e10fffe8b5 efi_loader: fix CapsuleMax variable reporting
Currently the code that adds the CapsuleMax variable is under a
Kconfig named 'EFI_HAVE_CAPSULE_UPDATE.  Git history only shows a
single occurrence of that.  The IS_ENABLED should be checking for
EFI_HAVE_CAPSULE_SUPPORT

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-20 17:10:57 +01:00
Ilias Apalodimas
cd63e2d26c efi_loader: update the error message of TCG protocol installation
"Unable to find TPMv2 device" doesn't explain much with regards to the
error origin. Update it to match what we have in the RNG protocol
installation.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-01-20 16:38:52 +01:00
Heinrich Schuchardt
90c420509e efi_loader: ensure that file ubootefi.var is created
Currently file ubootefi.var is only created if the user sets a non-volatile
EFI variable. If the file is missing, a warning is written.

With the change PlatformLang is always persisted. So the file will exist on
second boot.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-20 16:38:52 +01:00
Jan Kiszka
e585b79ee4 efi_loader: Avoid overwriting previous outputs on console screen clearing
Before clearing the screen, ensure that no previous output of firmware
or UEFI programs will be overwritten on serial devices or other
streaming consoles. This helps generating complete boot logs.

Tested regarding multi-output against qemu-x86_defconfig. Still, there
were remaining concerns about side effects, so this is provided as an
opt-in feature.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-01-20 16:38:52 +01:00
Jan Kiszka
de94f0f320 efi_loader: Set default console colors on efi_cout_clear_screen if needed
Ensures a consistent background color of the whole screen for succeeding
outputs as both demanded by the spec and implemented in EDK2 as well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-01-20 16:38:52 +01:00
Dario Binacchi
5ef229a007 doc: fix references to distro documentation
Commit 37c5195dfc ("doc: Move distro boot doc to rST") renamed
doc/README.distro to doc/develop/distro.rst.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Soeren Moch <smoch@web.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2023-01-20 16:38:52 +01:00
Heinrich Schuchardt
b1315ad333 doc: man-page for bdinfo
Provide a man-page for the bdinfo command

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-20 16:38:52 +01:00
Heinrich Schuchardt
389be395c6 doc: man-page for blkcache
Provide a man-page for the blkcache command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-20 16:38:52 +01:00
Heinrich Schuchardt
8a7301b1fa doc: man-page for source command
Provide a man-page for the source command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
2023-01-20 16:38:52 +01:00
Heinrich Schuchardt
de9433550b fs/fat: avoid noisy message fat_read_file()
UEFI applications call file system functions to determine if a file exists.
The return codes are evaluated to show appropriate messages.
U-Boot's file system layer should not interfere with the output.

Rename file_fat_read_at() to fat_read_file() adjusting the parameter
sequence and names and eliminate the old wrapper function.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-20 16:38:52 +01:00
Tom Rini
8bd3c0a7e1 TPM fixes and state reporting
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgWII69YpahbL5iK5gS8AYozs+qIFAmPKS78ACgkQgS8AYozs
 +qI5bg//VWZTgUAvk5GijVFcko+Dm4ItQrD22ggTLZgMXXXbYWFKx0SZbN8hwtgE
 sYGQnOCSuwP08omTSj46L80fF1LcPjhi5/QOp6vN5Zq9U8BVngrZr62zlOpPHVvH
 b2kQv1nb0M23WzC2SPqzUAIHD08/5kHUmITed0jLRjD1X7xbp+JwWeeycSG/dtmF
 g2R0lCT60wWStCqrtGYrSl/4SZ65K05sT/8bz46yYb4jNnqdmw7REcSJUvrE+1aN
 K5o8alKrp3meNmKrzNlIs1VUWdX7zyOlpwPNr5evFFoJy14IT4Z7iyy8ahImfaX0
 +WWhFbmIlqFJm8EPF94W97j6CWDxGoMcBz1U/wI09i+mm3sbtOIcXSfQegLhYJSr
 dc2s0tjEXcmkU+8WGeAId0jE7W3nf3akOFzHceUTJMlE72IpC+T9iKzDvW3rWDdM
 0/tWvQ0qDCPdkpLXHo7pnMSXNQ4m17+h2852iX6Lllw5sBj3lfJLb5udKI4fQVXa
 Zdp1lUjjsjCtg17iynx1cEdxEUPKU84X8/AI9/N6vvBt2Wn7IstN7ZXscg+N70+Q
 879MyUGeCWtjdjXDPAvwhA505I9DN3paX0xkNUbbqXCsWjE0NR8yc4vaSid68mV3
 aYDe/0n5VxjrbieMOldr66I6IyoP+j/kwRLzB+A1CfmwX/9QQO0=
 =p8+l
 -----END PGP SIGNATURE-----

Merge tag 'tpm-20012023' of https://source.denx.de/u-boot/custodians/u-boot-tpm

TPM fixes and state reporting
2023-01-20 10:36:00 -05:00
Ilias Apalodimas
eda976d36a tee: optee: fix uuid comparisons on service discovery
When comparing UUIDs for discovered services we only compare up to the
ptr size instead of the entire UUID

Fixes: 94ccfb78a4 ("drivers: tee: optee: discover OP-TEE services")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2023-01-20 10:04:56 +02:00
Ilias Apalodimas
9d28f67c81 tpm2: ftpm: add the device in the OP-TEE services list
commit fe8a4ed011 ("tee: optee: discover services dependent on tee-supplicant")
is trying to automatically scan and add TAs that are presented on pseudo
bus from the secure world.
In order to be able to list and compare the scanned devices the available drivers
have to register themselves on the op-tee service list.

Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-20 10:04:56 +02:00
Ilias Apalodimas
8aedcaf991 MAINTAINERS: add a new entry on TEE MAINTAINERS
Since I do have a look on TEE patches regardless and Jens doesn't have
his own tree, add myself as a co-maintainer.  I'll be carrying over the
TEE related patches from now on.  While at it add the maintenance tree
for TPM

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-20 10:04:56 +02:00
Ilias Apalodimas
218a9917d6 tee: optee: fix a print error on rng probing
If we fail to probe the optee-rng device, we print a wrong message
referring to the firmware tpm.

Fixes: 476a3d58df ("tee: optee: don't fail probe because of optee-rng")
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-20 10:04:56 +02:00
Tom Rini
53c47c59e6 convert rockchip to use binman
patman fix for checkpatch
 binman optional entries, improved support for ELF symbols
 trace improvements
 minor fdt refactoring
 -----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAmPIpV4RHHNqZ0BjaHJv
 bWl1bS5vcmcACgkQfxc6PpAIreZuqwgA0UpYQEX6/MegzHSCIx3AMT4rCF1Ytitr
 LS4Cbvj1Q09Rt9jriW7wAV5AobVPwGf2L5SVcnWv2I9+MmypDIXEe8HIrt2fRFu9
 bzn/2GOzXczuXqPFa/CWOUwjvCzTb8Sl9NtRszrP5NvOzuN15x00ZUYaXFO7fgsB
 zZMzOKxemwjdtLaox+x+VIJ95HMDEkYrWTAqTPg74CNVSjRbbLNqNq0zqkHB8SnH
 ubgphtIKYItTeIXcfIa9V4LeQp0ZitkzSfAibX+nIPCMPg9jbG9MrQQ+VvSZDjnM
 y8wa8gFj47Ek+gGNFXMHIpO6tBd83uHRgtf2x+zhcovLELYnZ6fDGw==
 =1K6m
 -----END PGP SIGNATURE-----

Merge tag 'dm-pull-18jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm

convert rockchip to use binman
patman fix for checkpatch
binman optional entries, improved support for ELF symbols
trace improvements
minor fdt refactoring
2023-01-19 09:46:57 -05:00
Tom Rini
7aec35be4b Merge branch '2022-01-18-assorted-updates'
- A few TI platform fixes, compression test cleanup and zstd update,
  npcm7xx update, add "part type" subcommand, VBE bugfix on some
  platforms, cleanup EVENT related Kconfig option logic (and fix some
  platforms), other minor cleanups.
2023-01-19 09:41:54 -05:00
Joost van Zwieten
ace75d642f odroid: limit boot memory to lowmem
In commit 4963f63fe6 ("image: Use gd->ram_base/_size in
env_get_bootm_size()") the size of the available memory for U-Boot to
use when relocating images, and not otherwise constrained, was changed
to include all known memory banks. In the case of this platform however,
all of the memory known to U-Boot is not also part of the Linux kernel
"lowmem" and so we must use CFG_SYS_BOOTMAPSZ to limit where we relocate
images to. We set a conservative limit of 256MB here to mirror the
previous behavior.

Signed-off-by: Joost van Zwieten <joost@diskos.nl>
[trini: Reword the commit messsage]
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-18 19:41:16 -05:00
Heinrich Schuchardt
1a064d0599 configs: enable poweroff command on QEMU ARM platforms
Enable the sysreset based poweroff command. It invokes PSCI.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-18 19:41:16 -05:00
Simon Glass
635bb31dad vbe: Allow probing the VBE bootmeth to fail in OS fixup
This device is created when there are no bootmeths defined in the device
tree. But it cannot be probed without a device tree node.

For now, ignore a probe failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Karsten Merker <merker@debian.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Fixes: a56f663f07 ("vbe: Add info about the VBE device to the fwupd node")
Tested-by: Vagrant Cascadian <vagrant@debian.org>
Tested-by: Karsten Merker <merker@debian.org>
2023-01-18 19:41:16 -05:00
Brandon Maier
65d373abb0 test: compression: add zstd uncompression test
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
2023-01-18 19:41:15 -05:00
Brandon Maier
4b9b25d943 lib: zstd: update to latest Linux zstd 1.5.2
Update the zstd implementation to match Linux zstd 1.5.2 from commit
2aa14b1ab2.

This was motivated by running into decompression corruption issues when
trying to uncompress files compressed with newer versions of zstd. zstd
users also claim significantly improved decompression times with newer
zstd versions which is a side benefit.

Original zstd code was copied from Linux commit 2aa14b1ab2 which is a
custom-built implementation based on zstd 1.3.1. Linux switched to an
implementation that is a copy of the upstream zstd code in Linux commit
e0c1b49f5b, this results in a large code diff. However this should make
future updates easier along with other benefits[1].

This commit is a straight mirror of the Linux zstd code, except to:
- update a few #include that do not translate cleanly
  - linux/swab.h -> asm/byteorder.h
  - linux/limits.h -> linux/kernel.h
  - linux/module.h -> linux/compat.h
- remove assert() from debug.h so it doesn't conflict with u-boot's
  assert()
- strip out the compressor code as was done in the previous u-boot zstd
- update existing zstd users to the new Linux zstd API
- change the #define for MEM_STATIC to use INLINE_KEYWORD for codesize
- add a new KConfig option that sets zstd build options to minify code
  based on zstd's ZSTD_LIB_MINIFY[2].

These changes were tested by booting a zstd 1.5.2 compressed kernel inside a
FIT. And the squashfs changes by loading a file from zstd compressed squashfs
with sqfsload. buildman was used to compile test other boards and check for
binary bloat, as follows:

> $ buildman -b zstd2 --boards dh_imx6,m53menlo,mvebu_espressobin-88f3720,sandbox,sandbox64,stm32mp15_dhcom_basic,stm32mp15_dhcor_basic,turris_mox,turris_omnia -sS
> Summary of 6 commits for 9 boards (8 threads, 1 job per thread)
> 01: Merge branch '2023-01-10-platform-updates'
>        arm:  w+   m53menlo dh_imx6
> 02: lib: zstd: update to latest Linux zstd 1.5.2
>    aarch64: (for 2/2 boards) all -3186.0 rodata +920.0 text -4106.0
>        arm: (for 5/5 boards) all +1254.4 rodata +940.0 text +314.4
>    sandbox: (for 2/2 boards) all -4452.0 data -16.0 rodata +640.0 text -5076.0

[1] e0c1b49f5b
[2] f302ad8811/lib/libzstd.mk (L31)

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
[trini: Set ret to -EINVAL for the error of "failed to detect
compressed" to fix warning, drop ZSTD_SRCSIZEHINT_MAX for non-Linux host
tool builds]
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-18 19:04:17 -05:00
Maxim Cournoyer
4c59078895 patman: symlink top level .checkpatch.conf
This makes it possible to run the patman test suite simply by invoking
'pytest' from the patman sub-directory:

  $ cd tools/patman
  $ pytest

Otherwise, the top level .checkpatch.conf would be ignored and
multiple test_checkpatch.py tests would fail.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:41 -07:00
Maxim Cournoyer
da413b5635 Revert "patman: invoke the checkpatch.pl script with '--u-boot' and '--strict'"
This reverts commit 648d8186dd, because
it broke usage of patman on Linux, whose check script doesn't know
about '--strict' or '--u-boot'.

Reported-by: Sjoerd Simons <sjoerd@collabora.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Sjoerd Simons <sjoerd@collabora.com>
2023-01-18 14:55:41 -07:00
Simon Glass
571bc4e67d binman: Support positioning an entry by and ELF symbol
In some cases it is useful to position an entry over the top of a symbol
in an ELF file. For example, if the symbol holds a version string then it
allows the string to be accessed from the fdtmap.

Add support for this.

Suggested-by: Pali Rohár <pali@kernel.org>
Suggested-by: Keith Short <keithshort@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:41 -07:00
Simon Glass
8f5afe21ae dtoc: Add a way to read a phandle with params
Add a function to read a phandle and associated name and offset. This is
useful for binman.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:41 -07:00
Simon Glass
c1157860c5 binman: Provide general support for updating ELF symbols
The current support for updating variables in a binary is hard-coded to
work with U-Boot:

- It assumes the image starts at __image_copy_start
- It uses the existing U-Boot-specific entry types

It is useful for other projects to use these feature.

Add properties to enable writing symbols for any blob, a way of specifying
the base symbol and a way of providing the ELF filename to allow symbol
lookup to take place.

With this it is possible to update a Zephyr image, such as zephyr.bin
after it has been built.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:41 -07:00
Simon Glass
9766f69c98 binman: Support overlapping entries
In some cases it is useful to have an entry overlap with another in a
section, either to update the contents within a blob, or to add an entry
to the fdtmap that covers only part of the blob.

Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:41 -07:00
Simon Glass
97fb8081ec binman: Add a function to check for special section nodes
This appears in two places in the code. Use a shared function instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:40 -07:00
Simon Glass
62ef2f7bf3 binman: Add a null entry
It is sometimes useful to define an entry which does not have its own
contents but does appear in the image. The contents are set by the section
which contains it, even though it appears as an entry in the fdtmap.

Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:40 -07:00
Simon Glass
4331d66661 binman: Clarify use of False when obtaining data
This means that the data is not yet available. Update some comments to
make this clearer.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:40 -07:00
Simon Glass
0b079fcb09 binman: Add a test for an inner section with a size
This is a slightly different scenario from the existing testSections
tests. Add a new test for it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:40 -07:00
Simon Glass
12c3e948ee rockchip: Drop the FIT generator script
This is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:40 -07:00
Simon Glass
31f35e83b1 rockchip: Convert all boards to use binman
Instead of the bash script, use binman to generate the FIT for arm64.

For 32-bit boards, use binman for all images, dropping the intermediate
files.

With this change, only Zynq is now using SPL_FIT_GENERATOR so update the
Kconfig rule accordingly.

Clean up the Makefile to the extent possible. Unfortunately, two boards
do not use SPL_FRAMEWORK so don't enable the u-boot.img rule:

   evb-rk3036
   kylin-rk3036

So a small remnant remains.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:40 -07:00
Simon Glass
e0c0efff2a rockchip: Support building the all output files in binman
Add the required binman images to replace the Makefile rules which are
currently used. This includes subsuming:

   - tpl/u-boot-tpl-rockchip.bin if TPL is enabled
   - idbloader.img if either or both of SPL and TPL are enabled
   - u-boot.itb if SPL_FIT is enabled
   - u-boot-rockchip.bin if SPL is used, either using u-boot.itb when
     SPL_FIT is enabled or u-boot.img when it isn't

Note that the intermediate files are dropped with binman, since it
producing everything in one pass. This means that
tpl/u-boot-tpl-rockchip.bin is not created, for example.

Note that for some 32-bit rk3288 boards, rockchip-optee.dtsi is included.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 14:55:39 -07:00
Simon Glass
4170dd9ec0 rockchip: Use multiple-images for rk3399
Enable multiple-images so we can generate more than one image. Also
add a comment for the end of the #if block.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 11:50:01 -07:00
Simon Glass
c4db0720ad rockchip: evb-rk3288: Drop raw-image support
This boards uses SPL_FIT so does not need to support loading a raw image.
Drop it to avoid binman trying to insert a symbol which has no value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 11:50:01 -07:00
Simon Glass
67a0501708 binman: Support optional external blobs
Some blobs are actually not necessary for the board to work correctly. Add
a property to allow this to be indicated. Missing optional blobs do not
cause a build failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 11:50:01 -07:00
Simon Glass
2f80c5ef13 binman: Support new op-tee binary format
OP-TEE has a format with a binary header that can be used instead of the
ELF file. With newer versions of OP-TEE this may be required on some
platforms.

Add support for this in binman. First, add a method to obtain the ELF
sections from an entry, then use that in the FIT support. We then end up
with the ability to support both types of OP-TEE files, depending on which
one is passed in with the entry argument (TEE=xxx in the U-Boot build).

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 11:50:01 -07:00
Simon Glass
39f4a85bb2 binman: Add a way to check for a valid ELF file
Add a function which checks whether data is in ELF format or not. This
will be used by binman to check this for entries.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 11:50:01 -07:00
Simon Glass
c8c9f3108a binman: Support optional entries
Support entries which can be optional depending on their contents. This
allows special entry types which appear in the image only when needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18 11:50:01 -07:00
Simon Glass
23ab4e0054 binman: Use a reference for binman symbols docs
Several etypes have this reference in their documentation. Now that we are
using rST, link to the section directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-01-18 11:50:01 -07:00