Commit Graph

73171 Commits

Author SHA1 Message Date
Marek Vasut
5c54260130 ARM: stm32: Add additional ID register check for KSZ8851 presence
Currently the code sets eth1addr only if /ethernet1 alias exists in DT,
the node pointed to by the alias has "micrel,ks8851-mll" compatible
string, and the KSZ8851 CCR register read indicates programmed EEPROM
is not connected.

This is not sufficient to detect cases where the DT still contains the
KSZ8851 nodes, but the chip itself is not present. Extend the detection
to handle these cases.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-05-28 14:54:16 +02:00
Christoph Niedermaier
5c38c06ec0 ARM: stm32: Update dhelectronics/dh_stm32mp1/MAINTAINERS file
Adding new DH electronics mailing list.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-05-28 14:38:47 +02:00
Patrice Chotard
6d734be905 reset: stm32: Fix bank and offset computation
BITS_PER_LONG is used to represent register's size which is 32.
But when compiled on arch64, BITS_PER_LONG is then equal to 64.

Fix bank and offset computation to make it work on arch32 and
arch64 and ensure that register's size is always equal to 32.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Pankaj Dev <pankaj.dev@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-05-28 11:24:02 +02:00
Patrick Delaunay
a5bb384caa dfu: dfu_mtd: remove the mtd_block_op error when mtd_lock is not supported
Fix the result of DFU_OP_WRITE operation in mtd_block_op function
when mtd_lock is not supported (-EOPNOTSUPP) to avoid DFU stack
error on the DFU manifestation of the MTD device, when
dfu_flush_medium_mtd is called.

Without this patch, dfu-util failed on dfuERROR state at the end
of the write operation on the alternate even if MTD write
opeartion is correctly performed.

$> dfu-util -a 3 -D test.bin
....
DFU mode device DFU version 0110
Device returned transfer size 4096
Copying data from PC to DFU device
....
Download	[=========================] 100%       225469 bytes
Download done.
state(10) = dfuERROR, status(14) = Something went wrong,
  but the device does not know what it was Done!

Fixes: 65f3fc18fc ("dfu_mtd: Add provision to unlock mtd device")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2021-05-28 11:21:51 +02:00
Tom Rini
aab8b17e94 Merge tag 'ti-v2021.07-rc4' of https://source.denx.de/u-boot/custodians/u-boot-ti
- Fix reset for AM64 platforms
- Enable networking PHY driver for AM64
- Fix default R5F cluster setting in J7
2021-05-27 07:42:49 -04:00
Tom Rini
a0ecfa568d Merge branch '2021-05-26-assorted-bugfixes' 2021-05-27 07:41:25 -04:00
Faiz Abbas
fed603f868 ARM: ti: Increase the allocated size for MLO.raw
MLO has increased to a size greater than the allocated
128 kB in dfu_alt_info_emmc and _mmc.

Therefore, double the allocated size for MLO.raw in
the default environment.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210419065027.5834-1-a-govindraju@ti.com
2021-05-27 14:56:42 +05:30
Suman Anna
7194a95d13 arm: dts: k3-am642-sk: Add sysreset controller node
The AM64x SoC uses a central Device Management and Security Controller
(DMSC) processor that manages all the low-level device controls
including the system-wide SoC reset. The system-wide reset is managed
through the system reset driver.

Add a sysreset controller node as a child of the dmsc node to enable
the "reset" command from U-Boot prompt for the K3 AM642 SK.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-05-27 14:53:14 +05:30
Suman Anna
a97ee92e4a arm: dts: k3-am642-evm: Add sysreset controller node
The AM64x SoC uses a central Device Management and Security Controller
(DMSC) processor that manages all the low-level device controls
including the system-wide SoC reset. The system-wide reset is managed
through the system reset driver.

Add a sysreset controller node as a child of the dmsc node to enable
the "reset" command from U-Boot prompt for the K3 AM642 EVM.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-05-27 14:53:14 +05:30
Dave Gerlach
beed30583c firmware: ti_sci: Update ti_sci_msg_req_reboot to include domain
The ti_sci_msg_req_reboot message payload has been extended to include a
domain field, but for the purposes of u-boot this should be zero to
reset the entire SoC as it did before. Include domain for completeness
and set to zero to ensure proper operation.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-05-27 14:53:14 +05:30
Suman Anna
4ec04073ab arm: dts: k3-j721e: Fix up MAIN R5FSS cluster mode back to Split-mode
The default U-Boot environment variables and design are all set up for
both the MAIN R5FSS clusters to be in Split-mode. This is the setting
in v2021.01 U-Boot and the dt nodes are synched with the kernel binding
property names in commit 468ec2f3ef ("remoteproc: k3_r5: Sync to
upstreamed kernel DT property names") merged in v2021.04-rc2.

The modes for both the clusters got switched back to LockStep mode by
mistake in commit 70e167495a ("arm: dts: k3-j721e: Sync Linux v5.11-rc6
dts into U-Boot") also in v2021.04-rc2. This throws the following warning
messages when early-booting the cores using default env variables,

  k3_r5f_rproc r5f at 5d00000: Invalid op: Trying to start secondary core 7 in lockstep mode
  Load Remote Processor 3 with data at addr=0x82000000 98484 bytes: Failed!
  k3_r5f_rproc r5f at 5f00000: Invalid op: Trying to start secondary core 9 in lockstep mode
  Load Remote Processor 5 with data at addr=0x82000000 98484 bytes: Failed!

Fix this by switching back both the clusters to the expected Split-mode.
Make this mode change in the u-boot specific dtsi file to avoid such
sync overrides in the future until the kernel dts is also switched to
Split-mode by default.

Fixes: 70e167495a ("arm: dts: k3-j721e: Sync Linux v5.11-rc6 dts into U-Boot")
Reported-by: Minas Hambardzumyan <minas@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-05-27 14:52:16 +05:30
Vignesh Raghavendra
df3fc620bb configs: am64x_evm_a53_defconfig: Enable DP83867 PHY driver
AM64x GP and SK EVM have DP83867 PHY connected to CPSW external port0.
Enable the driver in order to use ethernet at U-Boot prompt.
CONFIG_PHY_TI is selected by CONFIG_PHY_TI_DP83867 and thus can be dropped.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2021-05-27 14:50:32 +05:30
Sean Anderson
cb6c9c83e2 test: Remove duplicate macro
ut_asserteq_strn is defined twice. Remove one definition.

Fixes: 33d7edfd5f ("test: Add a way to check part of a console line or skip it")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-05-26 17:26:07 -04:00
Harm Berntsen
b725ed5071 GitLab: Remove tags for sandbox_noinst tests
Commit 712cc962b7 ("GitLab: Remove "tags" stanzas") removed the 'all'
tag from all the jobs. The sandbox_noinst_test.py test was added in
between the author date and commit date (commit 6c914e4232
("azure/gitlab: Add tests for sandbox_noinst")) which is probably why it
still contains the tags. This commit fixes that so all jobs now don't
require tags on the GitLab runners.

Signed-off-by: Harm Berntsen <harm.berntsen@nedap.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
2021-05-26 17:26:07 -04:00
Alper Nebi Yasak
77bfaad048 test: Fix filesystem tests always being skipped
Commit 1ba21bb06b ("test: Don't unmount not (yet) mounted system")
fixes an issue in the filesystem tests where the test setup may fail
to mount an image and still attempt to unmount it. However, the commit
unintentionally breaks the test setups in two ways.

The newly created unmounted filesystem images are being immediately
deleted due to some cleanup steps being misplaced into finally blocks,
which makes them always run instead of only on failures. The mount calls
always fail since the images never exist, causing the tests to be always
skipped. This patch moves these cleanup calls into the except blocks to
fix this and makes the tests run again.

There are also unmount calls misplaced into finally blocks, making them
run after the tests instead of before the tests. These unmount calls
make the filesystem image file consistent with the changes made to it as
part of the test setup, and this misplacement is making a number of
tests fail unexpectedly.

The unmount calls must be run before the tests use the image, meaning
before the yield call and not in the finally block. They must also be
run as a cleanup step when the filesystem setup fails, so they can't be
placed as the final call in the try blocks since they would be skipped
on such failures. For these reasons, this patch places the unmount calls
both in the except blocks and the else blocks of the final setup step.
This makes the unexpectedly failing tests to succeed again.

Furthermore, this isolates the mount calls to their own try-except
statement to avoid reintroducing the original issue of unmounting a
not-mounted image while fixing the unmount misplacement.

After these fixes, running "make tests" with guestmount available results
in two test failures not related to the mentioned commit. If the
guestmount executables are unavailable, the mounts fallback to using
sudo and result in no failures.

Fixes: 1ba21bb06b ("test: Don't unmount not (yet) mounted system")
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-05-26 17:26:07 -04:00
Michal Simek
ce869b55f8 spl: Kconfig: Use tabs instead of space for alignment
A lot of entries were using spaces instead of tab for alignment that's why
it is good to fix it to use the same style everywhere.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-26 17:26:07 -04:00
Marek Vasut
9e8bb07885 fs: btrfs: Add missing cache aligned allocation
The superblock buffer must be cache aligned, since it might be used
in DMA context, allocate it using ALLOC_CACHE_ALIGN_BUFFER() just
like it was done in btrfs_read_superblock() and read_tree_node().

This fixes this output on boot and non-working btrfs on iMX53:
CACHE: Misaligned operation at range [ced299d0, ced2a9d0]

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Behún <marek.behun@nic.cz>
Cc: Qu Wenruo <wqu@suse.com>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2021-05-26 17:26:07 -04:00
Heinrich Schuchardt
53ba2c21c2 fs/squashfs: zero out unused fields in fs_dirent
When reading directories the UEFI sub-system must supply file attributes
and timestamps. These fields will have to be added to struct fs_dirent.
SquashFS should not fill these fields with random data. Ensure that they
are zeroed out.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
2021-05-26 17:26:07 -04:00
Matt Merhar
f6c0d365d3 powerpc: fix regression in arch_initr_trap()
The assembly output of the arch_initr_trap() function differed by a
single byte after common.h was removed from traps.c:

 fff49a18 <arch_initr_trap>:
 fff49a18:      94 21 ff f0     stwu    r1,-16(r1)
 fff49a1c:      7c 08 02 a6     mflr    r0
 fff49a20:      90 01 00 14     stw     r0,20(r1)
-fff49a24:      80 62 00 44     lwz     r3,68(r2)
+fff49a24:      80 62 00 38     lwz     r3,56(r2)
 fff49a28:      4b ff 76 19     bl      fff41040 <trap_init>
 fff49a2c:      80 01 00 14     lwz     r0,20(r1)
 fff49a30:      38 60 00 00     li      r3,0
 fff49a34:      38 21 00 10     addi    r1,r1,16
 fff49a38:      7c 08 03 a6     mtlr    r0

This was causing a consistent hard lockup during the MMC read / loading
of the QoriQ FMan firmware on a P2041RDB board.

Re-adding the header causes identical assembly to be emitted and allows
the firmware loading and subsequent boot to succeed.

Fixes: 401d1c4f5d ("common: Drop asm/global_data.h from common header")
Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
2021-05-26 17:26:07 -04:00
Sean Anderson
26de4296cc part: Add check for NULL dev_part_str
Some callers (e.g. cmd/fs.c) of fs_set_blk_dev may use a NULL dev_part_str.
While blk_get_device_part_str handles this fine,
part_get_info_by_dev_and_name does not. This fixes commands crashing when
implicitly using bootdevice.

The unit test has also been updated to set bootdevice to a known value and
to restore it after we are done.

Fixes: 7194527b6a ("cmd: fs: Use part_get_info_by_dev_and_name_or_num to parse partitions")
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-26 17:26:07 -04:00
Vignesh Raghavendra
1e7879045f pinctrl: single: Fix probe failure getting register area size
If reg property of pinctrl-single node requires address translation then
probe fails with following message:

single-pinctrl pinctrl@4301c000: failed to get base register size

This is because driver uses dev_read_addr_size() to get size which also
tries to fetch untranslated addr and fails.
Fix this by using dev_read_addr_size_index() which takes care of address
translation and also makes following dev_read_addr() call redundant.

This fixes Ethernet failures on TI's AM654 based EVMs due to lack of
pinmux configuration.

Fixes: 9fd8a430f3 ("pinctrl: single: get register area size by device API")
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2021-05-26 17:26:07 -04:00
Tom Rini
f4b2786b80 configs: Resync with savedefconfig
Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2021-05-25 12:40:16 -04:00
Tom Rini
aee18604e2 net: Remove ne2000 driver
With the last user of this driver removed, remove the driver.

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2021-05-25 12:40:16 -04:00
Tom Rini
f25a0c3742 Pull request for efi-2021-07-rc4
Documentation:
 
 * correct mmc man-page
 
 Bug fixes:
 
 * reduce code size of efidebug command
 * remove 31 character limit for file paths in efidebug command
 * fix build warning in the TCG2 protocol implementation
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmCtA2wACgkQxIHbvCwF
 GsSGDRAAlgLjaj+dhxhv7zsrUxbqL3/hB2yqeOXo+JCx0AMvly5S43f4LvlwNNUH
 ixleYpRzR+rR2W/PP5yOnY4dmEUqusYdYPG1KdL4wPuX1Xa302Ug6GGszIFPT5/s
 8yrgaHfhUqJTR9hjqVryQplrwmV+QF5VydvFBTXD2eQtfae6HV1YfTCG+OulMKtf
 6nPRR5+4AChLnhVCjXJVLsq4lkLns8oNtdKg9N1PqODzaGKoRtVKribc8KYFR1Kq
 NWwwK8jflIdzF1GIss7PGrAs9d17oJc/Ut4U7XwjlDn+ZZFtvFKUL3bHmEEngyZv
 C6XYsM6tEfvajJ1aG4TF1TDkzh7SiJ6I95rcqFQAl2ithWriXif6ckjpWr/JEw0l
 eydwutd8YWleGkQdrS/e0SGVyZ3l5MJKSSAFhrzrx+SMG4xCqJ3bMUWH5ups/3Il
 uyL2bPYG//s/mQS++fgB5T3fG3BC53NelMOCERNyrWaBoCb4ieDBJJ0cdCFUP+F0
 Zv1BMrTWGUUhr77X6cp/VFw8cs0Q3pHX0ek07njsi0z1AJFc8IqhHWb8xmN0VZVw
 dI5fOT+vA8TnHQXVy3uRgVLymgq9Imo1O+9t6pA+DqLToBsW5bSCgK7htFeQFDrz
 wRFRmXEdkA/3WrOaJsXdd5fOzge8CK5Dqqpj0ZI8oLk9GhL9oL4=
 =GZQh
 -----END PGP SIGNATURE-----

Merge tag 'efi-2021-07-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-07-rc4

Documentation:

* correct mmc man-page

Bug fixes:

* reduce code size of efidebug command
* remove 31 character limit for file paths in efidebug command
* fix build warning in the TCG2 protocol implementation
2021-05-25 11:48:55 -04:00
Tom Rini
4c3e99460c - MIPS: octeon: fix CFI flash setup
- MIPS: remove qemu_mips boards
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiQkHUH+J02LLC9InKPlOlyTyXBgFAmCs/XcACgkQKPlOlyTy
 XBhc2g//fMT4IfCjRRwKXdTuifpqI80ONPoNNaf2Hwq7AeW5l0VPdXd5JfMYJBHX
 107gLyR6QL5UtZyixF1DR2COjVe2k/4Bw60crGt2AvRmW9eeej+QKmZ84Zgam+sy
 a5fgkqsQrNVccWZWJyGw5MCrdLbK02JZUQBUsT0YiAr6dlyyV8ZWPtWFkisyfYTr
 5J/a1z+D7G1BJqgus7iLOMsWpKoE2otXefJGWG4qPDGH80SN845MzkPRQeeZahxF
 03oQPkiLwrjYRXorL7x7cozansi22HpY+3RtW+vxuox64HTWe6Ruam4bkeqPDpXw
 k4Mko0PxGLnzett/GzPg/pIJ9Mn4YiMzILg6QcWTfFbtyPt8ZZkhe+D0Zo8kvrko
 LZZeh0yBxuYwChCvcIfXyaY/L7w1GpSmhJZH5Vj+ufzUCPX83+ZdlYkni5esNjjt
 lFuJ/gNdvZC0Yr44ipVb3hHeNuaKe77RJV/DUiO9YCz24eGkg5BV+LAD/B7JiUzx
 E16e9+NSSkHEzI3nIktX+Qf8zedwEi0/6dItElIaBJ6l2BawGEZnwGJhZ46tl/dw
 muhIAoFfjlXFepqmzzgqD/l4BSU+J5iStzzMk83tDGp5h9zdTDrc3Zn5VfndTjhp
 KYGR6IU9CTgugojwljAc5QwXhja4NnSri0Tghkgfs/wJHtiBW8U=
 =g+33
 -----END PGP SIGNATURE-----

Merge tag 'mips-pull-2021-05-25' of https://source.denx.de/u-boot/custodians/u-boot-mips

- MIPS: octeon: fix CFI flash setup
- MIPS: remove qemu_mips boards
2021-05-25 11:48:37 -04:00
Daniel Schwierzeck
835b4fdf3b doc: update and fix Qemu MIPS documentation
Update description to use the MIPS Malta board for Qemu.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2021-05-25 15:35:06 +02:00
Daniel Schwierzeck
5308a71db8 MIPS: remove deprecated qemu_mips board
Remove qemu_mips boards because DM migration doesn't make sense.
The board support for qemu_mips is already marked as deprecated
in Qemu in favour of the Malta board. Also qemu_mips support
has been removed from Linux a long time ago.

The official replacement is the Malta board. The same Malta U-Boot
image can be used with Qemu and on physical hardware.
All combinations of Big Endian and Little Endian as well as 32 bit
and 64 bit are supported.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2021-05-25 15:35:06 +02:00
Stefan Roese
9c8e58ac23 mips: octeon: octeon_ebb7304_defconfig: Fix CFI flash setup
This patch makes the necessary adjustments in the defconfig to fully
support the CFI flash on the Octeon EBB7304.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2021-05-25 15:35:06 +02:00
Ilias Apalodimas
1f6871df40 efi_loader: Fix -Wextra warning for EFI TCG2
Compiling with -Wextra produces a number of (harmless) warnings for the EFI
TCG2 protocol.  Let's fix those in case we ever enable the flag on the EFI
subsystem

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-05-25 14:33:22 +02:00
Heinrich Schuchardt
acfe1def3f efi_loader: simplify accessing variables
Use efi_get_variable_int() instead of EFI_CALL(RT->get_variable()).
Use efi_set_variable_int() instead of EFI_CALL(efi_set_variable()).

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-05-25 13:06:58 +02:00
Heinrich Schuchardt
2ecee31017 efi_loader: use efi_create_indexed_name()
Simplify the creation of indexed variable names like 'Boot0000' by using
function efi_create_indexed_name().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-05-25 13:06:58 +02:00
Heinrich Schuchardt
60177e0ac2 efi_loader: simplify show_efi_boot_order()
To print a UTF-16 string use %ls instead of converting string to UTF-8.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-05-25 13:06:58 +02:00
Heinrich Schuchardt
cd5a87e7b7 efi_loader: simplify show_efi_boot_opt_data()
To print a UTF-16 string use %ls instead of converting string to UTF-8.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-05-25 13:06:58 +02:00
Heinrich Schuchardt
9a6b33bef2 efi_loader: path length in efi_dp_from_name()
Before this patch efi_dp_from_name() only accommodated a maximum file path
length of 31 characters. This leads to boot failures due to file name
truncation.

Allow arbitrary path lengths.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-05-25 13:06:57 +02:00
Masahisa Kojima
f6081a8a1e efi_loader: expose efi_image_parse() even if UEFI Secure Boot is disabled
This is preparation for PE/COFF measurement support.
PE/COFF image hash calculation is same in both
UEFI Secure Boot image verification and measurement in
measured boot. PE/COFF image parsing functions are
gathered into efi_image_loader.c, and exposed even if
UEFI Secure Boot is not enabled.

This commit also adds the EFI_SIGNATURE_SUPPORT option
to decide if efi_signature.c shall be compiled.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-05-25 13:06:57 +02:00
Heinrich Schuchardt
6754e24b54 efi_loader: remove weak efi_get_public_key_data()
Configuring a system with CONFIG_EFI_CAPSULE_AUTHENTICATE=y but without a
method to retrieve the public key data is a misconfiguration. We should get
a build failure for it. Therefore remove the weak efi_get_public_key_data()
implementation.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-05-25 13:06:57 +02:00
Jaehoon Chung
07f2687204 doc: usage: modify mmc man-page
Modify mmc man-page.
- Change a description about mmc erase command.
- Add whitespace to distinguish.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-05-25 13:06:57 +02:00
Tom Rini
e1bf0336a5 Prepare v2021.07-rc3
Signed-off-by: Tom Rini <trini@konsulko.com>
2021-05-24 20:53:13 -04:00
Tom Rini
27c6d9663c Merge branch '2021-05-24-add-lto-support'
- Add LTO (link time optimization) support to the build system and
  enable it on a few boards.  This is an alternative to using
  -ffunction-sections/-fdata-sections and --gc-sections at link time to
  remove unused code.  This can result in notable savings, but needs
  testing on each platform before use as it can expose problems by
  optimizing away various functionally necessary calls.
2021-05-24 16:12:31 -04:00
Tom Rini
2fc62f2991 stackprot: Make our test a bit more complex
With better compiler optimizations available, a compiler may see we do
nothing with our buffer after calling memset and omit the call, thus
causing us to not smash the stack.  Add a comment to explain why we now
also have a printf call, so that the test will pass as the memset will
not be omitted.

Reported-by: Marek Behún <marek.behun@nic.cz>
Signed-off-by: Tom Rini <trini@konsulko.com>
2021-05-24 14:23:01 -04:00
Marek Behún
960f110c37 ARM: enable LTO for some boards
Enable LTO for some boards that were tested by people on U-Boot Mailing
List.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Adam Ford <aford173@gmail.com>
Tested-by: Pali Rohár <pali@kernel.org>
Tested-by: Tim Harvey <tharvey@gateworks.com>
2021-05-24 14:21:30 -04:00
Marek Behún
34ccadcd33 ARM: don't use --gc-sections with LTO when using private libgcc
When using LTO, we can throw away the --gc-sections flag, but only if
using private libgcc.

When using system's libgcc, --gc-sections is still needed, otherwise
linking will fail due to undefined references to libc's symbols.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-24 14:21:30 -04:00
Marek Behún
75c7d10c1f ARM: don't use -ffunction-sections/-fdata-sections with LTO build
When building with LTO, using -ffunction-sections/-fdata-sections is not
useful anymore.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-24 14:21:30 -04:00
Marek Behún
8f9696510a ARM: make LTO available
Make LTO available for ARM architecture.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-24 14:21:30 -04:00
Marek Behún
2361b5eb5c ata: ahci: fix ahci_link_up() type mismatch for LTO
When building highbank_defconfig with LTO, the compiler complains about
type mismatch of function ahci_link_up().

The third parameter of this function is of type u8 in
drivers/ata/ahci.c, but of type int in board/highbank/ahci.c.

There is no reason in using u8, and the code using this function
actually passes an int variable into the function (so it is implicitly
converted to u8).

Change the type of this parameter to int in drivers/ata/ahci.c.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-05-24 14:21:30 -04:00
Marek Behún
37de198fa2 armv8: SPL: discard relocation information
For some reason when building SPL for ARMv8 with LTO, the relocation
information is not discarded.

Discard it explicitly in the linker script.

This fixes LTO build for imx8mm_venice_defconfig.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-24 14:21:30 -04:00
Marek Behún
baa977bd0f ARM: omap3: fix LTO for DM3730 (and possibly other omap3 boards)
Adam Ford says that DM3730 needs board.c compiled without LTO flags.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Adam Ford <aford173@gmail.com>
2021-05-24 14:21:30 -04:00
Marek Behún
79dec66ca7 ARM: fix LTO for rockchip and samsung
When building with LTO, the compiler complains about type mismatch of
function usb_gadget_handle_interrupts(). This function is defined
without parameters in files
  arch/arm/mach-rockchip/board.c
  board/samsung/common/exynos5-dt.c
but it should have one parameter, int index.

Fix this.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2021-05-24 14:21:30 -04:00
Marek Behún
9d3918f3fd ARM: fix LTO for seaboard
When seaboard_defconfig is compiled with LTO, the compiler complains
about some instructions not being supported in ARM mode.

This is caused by arch/arm/mach-tegra/tegra20/warmboot_avp.c having
different CFLAGS declared in Makefile. This file needs to be compiled
without LTO.

Fix this by removing -flto for this file.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-24 14:21:30 -04:00
Marek Behún
e8bb990fe7 ARM: imx8m: fix imx_eqos_txclk_set_rate() type mismatch for LTO
When building imx8mp_evk_defconfig with LTO, the compiler complains
about type mismatch of function imx_eqos_txclk_set_rate() in file
  drivers/net/dwc_eth_qos.c:845:12
which contains a weak definition of this function, vs file
  arch/arm/mach-imx/imx8m/clock_imx8mm.c
which contains an implementation.

Change the type of this function in the implementation to fix this.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-05-24 14:21:30 -04:00