Commit graph

76421 commits

Author SHA1 Message Date
Heinrich Schuchardt
3b7bf8a9e4 test: unit test for the EFI_TCG2_PROTOCOL
Encapsulate the UEFI EFI_TCG2_PROTOCOL unit test in an Python test.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-30 09:23:48 +01:00
Heinrich Schuchardt
617270b97b configs: enable CMD_TPM on QEMU ARM
With TPM emulation enabled in u-boot-test-hooks we should also provide the
tpm2 command used for the test/py/tests/test_tpm2.py test.

One of the Python TPMv2 tests expects sandbox specific values. So disable
it on other platforms.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-30 09:23:37 +01:00
Heinrich Schuchardt
9d2465347c doc: qemu-arm peripherials
* add description how to add RNG device
* for a disk specify format=raw to avoid a warning
* fix a typo

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-30 09:23:27 +01:00
Tom Rini
ade37460a9 Prepare v2022.01-rc3
Signed-off-by: Tom Rini <trini@konsulko.com>
2021-11-29 11:16:03 -05:00
Ivan Mikhaylov
2f7c7aeb5c board: iot2050: update build documentation for OP-TEE
Set ta-target explicitly to correspond with OP-TEE recipe in
siemens/meta-iot2050.

Errors without explicit set of ta-target:
aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mthumb’
aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mno-unaligned-access’
aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mfloat-abi=hard’
make: *** [mk/compile.mk:159: out/arm-plat-k3/ta_arm32-lib/libdl/dlfcn.o] Error 1

Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
2021-11-29 11:15:37 -05:00
Vincent Stehlé
270eeb6871 qemu: common: Fix build with update capsule
The common emulation Makefile has a dependency on a non-existent
qemu_capsule.o when building with support for capsule update enabled
(CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y).
The code which was in qemu_capsule.c has been completely moved to
lib/efi_loader/efi_capsule.c by commit 7a6fb28c8e ("efi_loader: capsule:
add back efi_get_public_key_data()").
Remove the false dependency.

This fixes the following build error:

  make[1]: *** No rule to make target 'board/emulation/common/qemu_capsule.o', needed by 'board/emulation/common/built-in.o'.  Stop.

Fixes: commit 47a25e81d3 ("Revert "efi_capsule: Move signature from DTB to .rodata"")
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Simon Glass <sjg@chromium.org>
2021-11-29 11:15:37 -05:00
Sean Anderson
7d3bebb206 fastboot: Add maintainers entry
Add an entry in maintainers for fastboot. It is starting off orphaned, but
hopefully someone can pick it up.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2021-11-29 11:15:37 -05:00
Sean Anderson
4469d3b4db clk: Add myself as a maintainer for the clock subsystem
Lukasz has not been very responsive in reviewing clock patches. Add
myself as a maintainer.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Acked-by: Lukasz Majewski <lukma@denx.de>
2021-11-29 11:15:37 -05:00
Tom Rini
693650b15d Pull request for efi-2022-01-rc3-2
Test:
 * fix pylint warnings
 
 UEFI:
 * disable interrupts before removing devices in ExitBootServices()
 * implement poweroff in efi_system_reset() on sandbox
 * allow booting via EFI even if some block device fails
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmGhUDgACgkQxIHbvCwF
 GsTQRQ//TM2VwpjMWYBB6K91hVEHVJ4wYpNb5/ZqP0+NwYJbNo/3zF4qwFeSTN6O
 tbarpoiM6GNlSIC4Eo/+17JdUJd7NkfsGnhaV+SxG5Q+etaU0OabC8hbyPqw+nmg
 fbaL43xGygSj5t2RWqyBQYsnsYimgwkAz7pbCBnvrpIsGKImVqp36ft5KWo1ICTE
 JD8yRb9IMpPKfY5aK0q3c8X/Qbf6oPI1u6xGVcwyc+vQb4RjRMX46sGMJswcLnF0
 jGcxIB66/MeKeKN8bTtUoRZ9F4itF3k+FA0rnnwzQl+xre2Tu0fTnaEYHzKayu5J
 ilaPIcqXPvjfcN00V34kKzXWeMWm8saQA8Ecqowlrw2qQbahYrxX96n0RXzuNyy/
 LxpQtEyrGu/lQfPg9YOABKCRhZZPT3C8EE+0lUqGg1+5Ap0QPTXiNKJ7vx76cCny
 E7zYBQRmbhvmlrfFVACYS7zbUaxTbSMGmDKhhBU4tGFAzkb+bGkErRzjUbvt3TaR
 eQZoOAU6+kuEl9haSlKxo8IwnljfjpIqbgLgBdJ+BLQH/W67rFh631CNfM8x10qG
 7qbzLHLjIXwL2z86tfgmUvMGoLisOPDr53QbhLFv02ywFn4UgjGxcyoRFqlxIi0g
 9+A9nvbpQ4ZnI3HRHjYJ+uFbt9A8am3HwK7CBMR7EN666at7hz8=
 =X5Tv
 -----END PGP SIGNATURE-----

Merge tag 'efi-2022-01-rc3-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-01-rc3-2

Test:
* fix pylint warnings

UEFI:
* disable interrupts before removing devices in ExitBootServices()
* implement poweroff in efi_system_reset() on sandbox
* allow booting via EFI even if some block device fails
2021-11-26 17:10:53 -05:00
Heinrich Schuchardt
2b5e710859 test: fix pylint error in u_boot_console_exec_attach.py
* provide module docstring

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26 22:02:37 +01:00
Heinrich Schuchardt
6e6d37f7f9 test: fix pylint error in u_boot_console_sandbox.py
* provide module docstring

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26 22:02:37 +01:00
Heinrich Schuchardt
9aa1a14d13 test: fix pylint errors in u_boot_utils.py
* there is no os.path.unlink() method
* don't inherit from object
* add module docstring
* move imports to the top
* avoid unused variable

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26 22:02:37 +01:00
Heinrich Schuchardt
67e9b64701 test: fix pylint errors in u_boot_spawn.py
* don't inherit from object
* imports should be on the top level
* avoid unused variable names
* avoid unnecessary else after raise

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26 22:02:37 +01:00
Heinrich Schuchardt
09e409810a test: fix pylint errors in multiplexed_log.py
* don't inherit from object
* remove superfluous comprehension
* add module docstring

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26 22:02:37 +01:00
Heinrich Schuchardt
9abd2ca96e efi_selftest: simplify endian conversion for FDT test
UEFI code is always little-endian. Remove a superfluous test.

Remove a superfluous type conversion.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-26 21:30:59 +01:00
Heinrich Schuchardt
9d1564dabc efi_loader: segfault in efi_clear_os_indications()
If we call efi_clear_os_indications() before initializing the memory store
for UEFI variables a NULL pointer dereference occurs.

The error was observed on the sandbox with:

    usb start
    host bind 0 sandbox.img
    load host 0:1 $kernel_addr_r helloworld.efi
    bootefi $kernel_addr_r

Here efi_resister_disk() failed due to an error in the BTRFS implementation.

Move the logic to clear EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED
to the rest of the capsule code.

If CONFIG_EFI_IGNORE_OSINDICATIONS=y, we should still clear the flag.
If OsIndications does not exist, we should not create it as it is owned by
the operating system.

Fixes: 149108a3eb ("efi_loader: clear OsIndications")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-26 21:30:59 +01:00
Heinrich Schuchardt
1ae35c72b8 test: address some pylint warnings
* remove unused variables
* module description must precede import statements
* fix inconsistent return values

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-26 21:30:59 +01:00
Heinrich Schuchardt
7a001e0f3d sandbox: poweroff in efi_system_reset()
efi_system_reset() should exit if called with EFI_RESET_SHUTDOWN.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-26 21:30:59 +01:00
Heinrich Schuchardt
cd9a26bfe5 efi_loader: efi_disk_register() should not fail
Our algorithm for creating USB device paths may lead to duplicate device
paths which result in efi_disk_register() failing. Instead we should just
skip devices that cannot be registered as EFI block devices.

Fix a memory leak in efi_disk_add_dev() caused by the duplicate device
path.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-26 21:30:59 +01:00
Tom Rini
3f73e79de8 efi: Call bootm_disable_interrupts earlier in efi_exit_boot_services
If we look at the path that bootm/booti take when preparing to boot the
OS, we see that as part of (or prior to calling do_bootm_states,
explicitly) the process, bootm_disable_interrupts() is called prior to
announce_and_cleanup() which is where udc_disconnect() /
board_quiesce_devices() / dm_remove_devices_flags() are called from.  In
the EFI path, these are called afterwards.  In efi_exit_boot_services()
however we have been calling bootm_disable_interrupts() after the above
functions, as part of ensuring that we disable interrupts as required
by the spec.  However, bootm_disable_interrupts() is also where we go
and call usb_stop().  While this has been fine before, on the TI J721E
platform this leads us to an exception.  This exception seems likely to
be the case that we're trying to stop devices that we have already
disabled clocks for.  The most direct way to handle this particular
problem is to make EFI behave like the do_bootm_states() process and
ensure we call bootm_disable_interrupts() prior to ending up in
usb_stop().

Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Simon Glass <sjg@chromium.org>
Suggested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-26 21:30:59 +01:00
Tom Rini
2ad8d0cb95 Merge branch 'efi-2022-01' of https://source.denx.de/u-boot/custodians/u-boot-efi
Scripts:
* Update spelling.txt

LMB:
* remove extern keyword in lmb.h
* drop unused lmb_size_bytes()

Test:
* test truncation in snprintf()

Documentation:
* add include/lmb.h to HTML documentation

UEFI:
* reduce non-debug logging output for measured boot
* fix use after free in measured boot
* startup the tpm device when installing the protocol
* implement EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES
* record capsule result only if capsule is read
2021-11-20 09:36:37 -05:00
Ilias Apalodimas
d6b55a420c efi_loader: startup the tpm device when installing the protocol
Due to U-Boot's lazy binding mentality the TPM is probed but not properly
initialized.  The user can startup the device from the command line
e.g 'tpm2 startup TPM2_SU_CLEAR'.  However we can initialize the TPM during
the TCG protocol installation,  which is easier to use overall.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20 10:53:01 +01:00
Ilias Apalodimas
5ba0397049 efi_loader: fix FinalEvents table if an EFI app invoked GetEventLog
As described in the TCG spec [1] in sections 7.1.1 and 7.1.2 the FinalEvent
table should include events after GetEventLog has been called.  This
currently works for us as long as the kernel is the only EFI application
calling that.  Specifically we only implement what's described in 7.1.1.

So refactor the code a bit and support EFI application(s) calling
GetEventLog.  Events will now be logged in both the EventLog and FinalEvent
table as long as ExitBootServices haven't been invoked.

[1] https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
dc52578d7b efi_loader: bump EFI_SPECIFICATION_VERSION to 2.9
We have implemented all what is new in UEFI specification 2.9 and relevant
for U-Boot.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
22ad3f5f7b efi_selftest: unit test for EFI_GROUP_BEFORE_EXIT_BOOT_SERVICE
Add a test for the EFI_GROUP_BEFORE_EXIT_BOOT_SERVICE event group.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
43eaf5b13f efi_loader: EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES
Implement the EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES event group
handling.

Add the definition of EFI_EVENT_GROUP_AFTER_READY_TO_BOOT.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20 10:53:00 +01:00
Masami Hiramatsu
5d49b32f0a efi_loader: capsule: Record capsule result only if capsule is read
Record capsule update result only if the capsule file is
successfully read, because the capsule GUID is not sure when
the file can not be read or the file is not a capsule.
Without this fix, if user puts a dummy (non-capsule) file
under (ESP)EFI/UpdateCapsule, U-Boot causes a synchronous
abort.

This also fixes use-after-free bug of the 'capsule' variable.

Fixes: c74cd8bd08 ("efi_loader: capsule: add capsule_on_disk support")
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20 10:53:00 +01:00
Masahisa Kojima
3961bd9b55 efi_loader: Reduce efi_tcg2 logging statement
log_info() is used for the debug level logging statement
which should use log_debug() instead. Convert it to reduce the
log output.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
e032cb2ac9 efi_loader: Sphinx comments in efi_api.h
Fix incorrect Sphinx comments in efi_api.h:

* add missing 'struct'
* correct indentation

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-20 10:53:00 +01:00
Masahisa Kojima
45c16fd0c2 efi: add comment for efi_system_table and efi_configuration_table
This commit adds the comment for efi_system_table and
efi_configuration_table structure.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
3f80064fd5 doc: fix typos in trace.rst
Fix obvious typos. Use US spelling consistently.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
dfec0e9d9c scripts: update spelling.txt from upstream Linux
This list is used by checkpatch.pl. The Linux v5.15 version has several
words that where mispelled in U-Boot too.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
0c9e8bf2bb test: test truncation in snprintf()
Test that the return value of snprintf() is correct in the case of
truncation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
ac7606af7d lmb: fix typo 'commun'
%s/commun/common/

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
7db07aa24f lmb: drop unused lmb_size_bytes()
lmb_size_bytes() is unused.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
951a8c4871 lmb: remove extern keyword in lmb.h
The extern keyword is not needed in include/lmb.h to declare functions.
Remove it.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
4ad4c2daeb doc: add include/lmb.h to the HTML documentation
Correct Sphinx style comments in include/lmb.h

Add the logical memory block API to the HTML documentation.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20 10:53:00 +01:00
Heinrich Schuchardt
5a515132d9 lmb: remove lmb_is_nomap() from include
Defining static functions in includes should be avoided.
Function lmb_is_nomap() is only used in the unit test.
So move it to the unit test.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-20 10:53:00 +01:00
Tom Rini
454a97485a - pinctrl: Correct the driver GPIO declaration
- meson64_android: handle errors on boot and run fastboot on boot failure
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmGX4fgACgkQd9zb2sjI
 SdFoHxAAmdSz0fAO6NNY9i6Ee8J5iinDfun6j/aUJprjxK5CeMaeHvyAA3L+quQl
 zMaLKrx8d9l6VSKAL1fdV8ob1w8FFCC6uYiLp32HZ2CzZskyLDa4GXipzQB0O6LS
 VvfUjhOEMi/OpUzCM/OtWSi54fajntYIWdxZH24fD+HCwlercpyuUG/nelEqLYFd
 REgWPV/XUkH6Odfr/sYSEioSzYGYgtCSBjEBrS4PgAUiH/GONFuU+UpNfLjKzJoB
 Da4JAue4dT9CYRNiqu2yqRdbe22fsp922bWRv1gytxcxE4jMGOCJ7HonpLAXJxuB
 w6BHItj0KHhwhxHQ1mhm5mx/ZmN3c50qYWT8W9pIFreU0Iuq8/Zw7pazCb1IaH62
 ri0Mthf50baRIqpAMdpbcRsSh5B6fsxURB+O1+TpPtw66QK1gouQyPDKDX2yaFAD
 gDkDToPk8jaWcxJ4eUyyaLkH8JZe98JXSSLMjJUsnTPLs7lCnjGuOH1fVvUyT75M
 VBaDi2FOAArplYJ8X/sJbBquEx819u8vPLkkPAD8sD/49xpnzsgnnWHJRJ3D3j0V
 bT0GCRCSl9nSrXa1rpB8zeA0YsSLDQ7b1Hy++H5MOJ4fZAOXzcGbR+zTlXnVhoFZ
 7wqWMhMJc70V1VHjEULk/Eqb3qh89RwCgCtSmNBniR1xi2796tU=
 =i2VH
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-amlogic-20211119' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- pinctrl: Correct the driver GPIO declaration
- meson64_android: handle errors on boot and run fastboot on boot failure
2021-11-19 16:33:33 -05:00
Tom Rini
b5f2c68d5c TPM1.2 and Atmel fixes
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgWII69YpahbL5iK5gS8AYozs+qIFAmGXVGcACgkQgS8AYozs
 +qLoVA/8CDEhyU20XorNzyk/+Dpy4+7s91wnRiNuQxDcwJke5dcgCtJ62cURsWI/
 69gnijt1Pif1ODPWECj9Fh8SYp0S8ZL/7YBS9JjpgHNCPvOuxoaSvO4Q0CejDBWO
 7Yj2UZwR2AvUO57bD3pOVQJns5PiCyF94zt/5LO9NCCnAoXxc2dH2M2Eelxac5wA
 zx4PksKeX72k1HkSywQgM4uWOweWs8OzgSE5mBiGQTP/9aYCeRtPv3i7JlClqw4R
 uNqSGJrDEKfJnV3kmZpKAACl91vS+4g7rfQbOyB7DOL1hNpJ7/7d2++/j8P8jB17
 zCXW+mK60+4/0pJ2Bk/6XddbTYvMskija+lQib1FHshAPbDrbXNbS8WrDInMFC3L
 RfCugrxG9fgtu3yWqy1+GyDEN3s5yATYBSo27xfOvW5919McMTEy1YGjA7R1K5l/
 WLFO9oBSLYolZPZgEqi0Z7sNr2BSVmodk0KCJkcXR8J5YIc8r4dtfSRhw0lcdcD8
 c/Wi5+i0PX4ZmuDrbjffjvUJ1Mz2n9igI3ADK2Xn/Lf7KVHW7oiPcQYeijqhTAVa
 zu9DXIw+E8o4Nq3/u4VDecTRZcGUVWR83DJYGn4U0NDMC9PCLj3TBG9KogKt/Ceo
 au1F50co7qxqehmtnm8Bej/He87fIJmZmbaqT388ZXNwMEVPTNo=
 =m8lp
 -----END PGP SIGNATURE-----

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

TPM1.2 and Atmel fixes

# gpg verification failed.
2021-11-19 16:33:23 -05:00
Neil Armstrong
28f70cfcfd configs: meson64_android: add PANIC stage for SYSTEM fails
If bootloader was updated without running oem format, reboot will cause
boot loop because the SYSTEM stage fails.

Add a final PANIC stage running fastboot to permit recovery.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2021-11-19 18:15:26 +01:00
Neil Armstrong
bdc68df4dd configs: meson64_android: bypass other checks on run_fastboot=1
This can lead to GPT and BCB errors even if fastboot was selected early
by usb rom boot and the eMMC is blank/invalid.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2021-11-19 18:15:26 +01:00
Simon Glass
886d36efdb pinctrl: meson: Correct the driver GPIO declaration
This should use the provided U_BOOT_DRIVER() macro so that the driver gets
added to the appropriate linker list. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 7c9dcfed50 ("pinctrl: meson: rework gx pmx function")
Reported-by: Tom Rini <trini@konsulko.com>
Tested-by: Tom Rini <trini@konsulko.com> on libretech-cc
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-11-19 18:15:26 +01:00
Tom Rini
8391a0f3d9 Merge branch '2021-11-18-regression-fixes'
- An assortment of fixes related to GD, GD_FLG_SKIP_RELOC, and the lmb
- Environment fix on synquacer developmentbox
- Fix for get_info is not valid in partition code
2021-11-18 18:25:19 -05:00
Marek Vasut
b1f3f982fa arm64: Add missing GD_FLG_SKIP_RELOC handling
In case U-Boot enters relocation with GD_FLG_SKIP_RELOC, skip the
relocation. The code still has to set up new_gd pointer and new
stack pointer.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2021-11-18 18:20:19 -05:00
Marek Vasut
bd994c007a lmb: Reserve U-Boot separately if relocation is disabled
In case U-Boot starts with GD_FLG_SKIP_RELOC, the U-Boot code is
not relocated, however the stack and heap is at the end of DRAM
after relocation. Reserve a LMB area for the non-relocated U-Boot
code so it won't be overwritten.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2021-11-18 18:20:19 -05:00
Marek Vasut
47d7d03622 board_f: Copy GD to new GD even if relocation disabled
Even if U-Boot has relocation disabled via GD_FLG_SKIP_RELOC , the
relocated stage of U-Boot still picks GD from new_gd location. The
U-Boot itself is not relocated, but GD might be, so copy the GD to
new GD location even if relocation is disabled.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Peng Fan <peng.fan@oss.nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2021-11-18 18:20:19 -05:00
schspa
50f7b2effd part: return -ENOSYS when get_info not valid.
In some case, get_info() interface can be NULL, add this check to stop
from crash.

Signed-off-by: schspa <schspa@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-18 18:20:06 -05:00
Masami Hiramatsu
0171d056ec Revert "board: synquacer: developerbox: Don't set gd->env_addr to default_environment"
Without default setting of gd->env_addr, U-Boot will cause
a synchronous abort if the env-variables on the SPI flash is
broken or not saved corectly. Set gd->env_addr correctly.

This reverts commit 535870f3b0.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2021-11-18 14:22:11 -05:00
Mathew McBride
4a08dba019 drivers: tpm: atmel_twi: fix printf specifier compile warning
%d was being used as the specifier for size_t, leading to a
compiler warning

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-17 13:47:36 +02:00