platform/kernel/u-boot.git
3 years agoRemove including timestamp.h in version.h
Pali Rohár [Mon, 2 Aug 2021 13:18:38 +0000 (15:18 +0200)]
Remove including timestamp.h in version.h

Header file version.h does not use anything from timestamp.h. Including of
timestamp.h has side effect which cause recompiling object file at every
make run because timestamp.h changes at every run.

So remove timestamp.h from version.h and include timestamp.h in files
which needs it.

This change reduce recompilation time of final U-Boot binary when U-Boot
source files were not changed as less source files needs to be recompiled.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Add in lib/acpi/acpi_table.c and test/dm/acpi.c, rework a few others]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoversion: Remove global macro U_BOOT_VERSION_STRING from version.h
Pali Rohár [Mon, 2 Aug 2021 13:18:37 +0000 (15:18 +0200)]
version: Remove global macro U_BOOT_VERSION_STRING from version.h

Version string is available in global variable char version_string[].
Macro U_BOOT_VERSION_STRING is not used by any other file, so remove it
completely from version.h. Other files were already converted to use
variable version_string[].

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agox86: quark: MRC: Remove U_BOOT_DATE and U_BOOT_TIME from debug log
Pali Rohár [Mon, 2 Aug 2021 13:18:36 +0000 (15:18 +0200)]
x86: quark: MRC: Remove U_BOOT_DATE and U_BOOT_TIME from debug log

U_BOOT_DATE and U_BOOT_TIME are updated on every run of make command.
Therefore mrc.c file is recompiled every time when running make which means
that whole U-Boot binary is recompiled on every run of make command.

Simplify it and do not recompile U-Boot binary on every run of make command
by not depending on macros U_BOOT_DATE and U_BOOT_TIME.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agoversion: Do not make version_string[] variable as a weak
Pali Rohár [Mon, 2 Aug 2021 13:18:35 +0000 (15:18 +0200)]
version: Do not make version_string[] variable as a weak

There is no platform which needs to overload version_string[] variable, so
remove weak symbol mark.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agopowerpc: Drop version_string placement optimization
Tom Rini [Thu, 16 Sep 2021 19:30:08 +0000 (15:30 -0400)]
powerpc: Drop version_string placement optimization

As explained by Wolfgang, historically PowerPC would do a number of
things to hand-optimize placement of the binary on NOR flash in order to
maximize utilization of very scarce resources.  These days, we simply
aren't optimizing our binary layout for NOR flash placement and it's
quite likely this wasn't working as intended.  Furthermore, this level
of optimization makes it difficult to have version_string be a global,
instead of a weak and overridden value, and so make more progress on
reproducible builds, which is a current concern.

Move to having PowerPC no longer store version_string in the early part
of text so that it might be part of the first page of NOR and instead
use the same declaration everyone else does.

Link: https://lore.kernel.org/r/96716.1629798400@gemini.denx.de/
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agom68k: mcf: Remove overloading version_string
Pali Rohár [Mon, 2 Aug 2021 13:18:32 +0000 (15:18 +0200)]
m68k: mcf: Remove overloading version_string

There is no need to overload version_string at the end of start.S files.
Common implementation of version_string should be fine.

Signed-off-by: Pali Rohár <pali@kernel.org>
[trini: Keep the align, it's important for the rest of linkage]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoversion: Move version_string[] from version.h to version_string.h
Pali Rohár [Mon, 2 Aug 2021 13:18:31 +0000 (15:18 +0200)]
version: Move version_string[] from version.h to version_string.h

More C files do not use compile time timestamp macros and do not have to be
recompiled every time when SOURCE_DATE_EPOCH changes.

This patch moves version_string[] from version.h to version_string.h and
updates other C files which only needs version_string[] string to include
version_string.h instead of version.h. After applying this patch these
files are not recompiled every time when SOURCE_DATE_EPOCH changes.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoefi_loader: Use directly version_string variable
Pali Rohár [Mon, 2 Aug 2021 13:18:30 +0000 (15:18 +0200)]
efi_loader: Use directly version_string variable

Macro U_BOOT_VERSION_STRING is already stored in variable version_string.
So use directly this variable instead of storing U_BOOT_VERSION_STRING into
temporary variable.

Signed-off-by: Pali Rohár <pali@kernel.org>
[trini: This area was reworked since posted, what is here is now really
        inspired by the previous version, so drop Ilias' Acked-by]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoRemove #include <version.h> from files which do not need it
Pali Rohár [Mon, 2 Aug 2021 13:18:29 +0000 (15:18 +0200)]
Remove #include <version.h> from files which do not need it

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoRemove #include <timestamp.h> from files which do not need it
Pali Rohár [Mon, 2 Aug 2021 13:18:28 +0000 (15:18 +0200)]
Remove #include <timestamp.h> from files which do not need it

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agom68k: Add missing ENTRY entry in linker script
Tom Rini [Fri, 17 Sep 2021 16:05:20 +0000 (12:05 -0400)]
m68k: Add missing ENTRY entry in linker script

Currently, there is no ENTRY() entry in the m68k linker script.
However, since they currently contain a version_string symbol, which
then overrides the default weak version_string symbol, the linker
decides we must keep start.o in the resulting link.  Add an ENTRY() line
so that the linker will know to keep this, even when version_string is
no longer provided in start.S

Cc: Huan Wang <alison.wang@nxp.com>
Cc: Angelo Dureghello <angelo@sysam.it>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agotest: Add a way to skip console checking until a string matches
Simon Glass [Thu, 19 Aug 2021 03:40:33 +0000 (21:40 -0600)]
test: Add a way to skip console checking until a string matches

Some tests produce a lot of output that does not need to be individually
checked by an assertion. Add a macro to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agosandbox: Add a way to map a file into memory
Simon Glass [Thu, 19 Aug 2021 03:40:31 +0000 (21:40 -0600)]
sandbox: Add a way to map a file into memory

It is useful to map a file into memory so that it can be accessed using
simple pointers. Add a function to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agosandbox: Add a way to find the size of a file
Simon Glass [Thu, 19 Aug 2021 03:40:30 +0000 (21:40 -0600)]
sandbox: Add a way to find the size of a file

Add a function to return the size of a file. This is useful in situations
where we need to allocate memory for it before reading it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
3 years agodm: core: Fix a few incorrect comments on first/next functions
Simon Glass [Thu, 19 Aug 2021 03:40:29 +0000 (21:40 -0600)]
dm: core: Fix a few incorrect comments on first/next functions

Tighten up these comments to make the behaviour clearer.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agotest: Tidy a comment in the bloblist test
Simon Glass [Thu, 19 Aug 2021 03:40:28 +0000 (21:40 -0600)]
test: Tidy a comment in the bloblist test

Fix up a copy error.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agosqfs: Suppress the message about missing filesystem
Simon Glass [Thu, 19 Aug 2021 03:40:27 +0000 (21:40 -0600)]
sqfs: Suppress the message about missing filesystem

This message comes up a lot when scanning filesystems. It suggests to the
user that there is some sort of error, but in fact there is no reason to
expect that a particular partition has a sqfs filesystem. Other
filesystems don't print this error.

Turn it into a debug message.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
3 years agobtrfs: Suppress the message about missing filesystem
Simon Glass [Thu, 19 Aug 2021 03:40:26 +0000 (21:40 -0600)]
btrfs: Suppress the message about missing filesystem

This message comes up a lot when scanning filesystems. It suggests to the
user that there is some sort of error, but in fact there is no reason to
expect that a particular partition has a btrfs filesystem. Other
filesystems don't print this error.

Turn it into a debug message.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Qu Wenruo <wqu@suse.com>
3 years agosandbox: Add license headers to the dts files
Simon Glass [Thu, 19 Aug 2021 03:40:25 +0000 (21:40 -0600)]
sandbox: Add license headers to the dts files

Many of these files are missing a header. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agosandbox: Correct handling of --rm_memory
Simon Glass [Thu, 19 Aug 2021 03:40:24 +0000 (21:40 -0600)]
sandbox: Correct handling of --rm_memory

This option has no argument so we should not trip to skip one.

Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodtoc: Further improve documentation about warnings
Simon Glass [Thu, 19 Aug 2021 03:40:23 +0000 (21:40 -0600)]
dtoc: Further improve documentation about warnings

Split this information into subsections and expand it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoscripts/config_whitelist.txt: Fix after merging
Tom Rini [Thu, 16 Sep 2021 17:18:21 +0000 (13:18 -0400)]
scripts/config_whitelist.txt: Fix after merging

CONFIG_SPIFLASH is manually re-added as it is not a new symbol, but now
only exists in CONFIG_SYS_EXTRA_OPTIONS.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agopci: Fix mismerge with v2021.10-rc4
Tom Rini [Thu, 16 Sep 2021 15:45:03 +0000 (11:45 -0400)]
pci: Fix mismerge with v2021.10-rc4

With legacy PCI code removed and thus DM_PCI also removed, a few places
did not get correctly updated with the merge to next and thus broke.
Remove now extraneous dependencies on DM_PCI.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge tag 'v2021.10-rc4' into next
Tom Rini [Thu, 16 Sep 2021 14:29:40 +0000 (10:29 -0400)]
Merge tag 'v2021.10-rc4' into next

Prepare v2021.10-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
# gpg: Signature made Tue 14 Sep 2021 06:58:32 PM EDT
# gpg:                using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C
# gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate]

# Conflicts:
# board/Arcturus/ucp1020/spl.c
# cmd/mvebu/Kconfig
# common/Kconfig.boot
# common/image-fit.c
# configs/UCP1020_defconfig
# configs/sifive_unmatched_defconfig
# drivers/pci/Kconfig
# include/configs/UCP1020.h
# include/configs/sifive-unmatched.h
# lib/Makefile
# scripts/config_whitelist.txt

3 years agoPrepare v2021.10-rc4
Tom Rini [Tue, 14 Sep 2021 22:58:10 +0000 (18:58 -0400)]
Prepare v2021.10-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoconfigs: Resync with savedefconfig
Tom Rini [Tue, 14 Sep 2021 22:48:05 +0000 (18:48 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoimage: Avoid erroneous double byte-swap in CRC value
Alexandru Gagniuc [Tue, 14 Sep 2021 20:53:33 +0000 (15:53 -0500)]
image: Avoid erroneous double byte-swap in CRC value

The hash algorithm selection was streamlined in commit 92055e138f28
("image: Drop if/elseif hash selection in calculate_hash()"). Said
commit kept the call to cpu_to_uimage() to convert the CRC to big
endian format.

This would have been correct when calling crc32_wd(). However, the
->hash_func_ws member of crc32 points to crc32_wd_buf(), which already
converts the CRC to big endian. On a little endian host, doing both
conversions results in a little-endian CRC. This is incorrect.

To remedy this, simply drop the call to cpu_to_uimage(), thus only
doing the byte-order conversion once.

Fixes: 92055e138f28 ("image: Drop if/elseif hash selection in
       calculate_hash()")
Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoMerge branch '2021-09-14-assorted-fixes'
Tom Rini [Tue, 14 Sep 2021 19:47:07 +0000 (15:47 -0400)]
Merge branch '2021-09-14-assorted-fixes'

- Assorted bugfixes

3 years agoimage: rsa: Move padding_algos to linker lists
Alexandru Gagniuc [Wed, 18 Aug 2021 22:49:02 +0000 (17:49 -0500)]
image: rsa: Move padding_algos to linker lists

We are not guaranteed to have the padding_pkcs_15_verify symbol since
commit 92c960bc1d ("lib: rsa: Remove #ifdefs from rsa.h"), and
commit 61416fe9df ("Kconfig: FIT_SIGNATURE should not select RSA_VERIFY")

The padding_algos only make sense with RSA verification, which can now
be disabled in lieu of ECDSA. In fact this will lead to build failures
because of the missing symbol mentioned earlier.

To resolve this, move the padding_algos to a linker list, with
declarations moved to rsa_verify.c. This is consistent with commit
6909edb4ce ("image: rsa: Move verification algorithm to a linker list")

One could argue that the added #ifdef USE_HOSTCC is ugly, and should
be hidden within the U_BOOT_PADDING_ALGO() macro. However, this would
be inconsistent with the "cryptos" list. This logic for was not
previously explored:

Without knowledge of the U_BOOT_PADDING_ALGO() macro, its use is
similar to something being declared. However, should #ifndef
USE_HOSTCC be part of the macro, it would not be obvious that it
behaves differently on host code and target code. Having the #ifndef
outside the macro makes this obvious.

Also, the #ifdef is not always necessary. For example ecda-verify
makes use of U_BOOT_CRYPTO_ALGO() without any accompanying #ifdefs.
The fundamental issue is a lack of separation of host and target code
in rsa_verify. Therefore, the declaration of a padding algo with the
external #ifdef is more readable and consistent.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agopinctrl: fix typo
Yuan Fang [Wed, 8 Sep 2021 11:06:48 +0000 (19:06 +0800)]
pinctrl: fix typo

fix typo in pinctrl Kconfig file to avoid git commit failure on
some commit hooks check.

Signed-off-by: Yuan Fang <fangyuanseu@gmail.com>
3 years agolib: fix typos in Kconfig
Oleksandr Suvorov [Wed, 1 Sep 2021 13:05:08 +0000 (16:05 +0300)]
lib: fix typos in Kconfig

There are trivial typos in the Kconfig file. Fixed them.
Also, fixed grammar in the descriptions with typos.

Fixes: d56b4b1974 ("configs: Migrate RBTREE, LZO, CMD_MTDPARTS, CMD_UBI and CMD_UBIFS")
Fixes: 7264f2928b ("spl: fit: Eanble GZIP support for image decompression")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
3 years agolib/rsa: don't use NULL as key_id
Heinrich Schuchardt [Sat, 28 Aug 2021 10:13:05 +0000 (12:13 +0200)]
lib/rsa: don't use NULL as key_id

If keydir is not provided but name is we want to use name as key_id.

But with the current coding name is only used on its own if it is NULL
and keydir is provided which never occurs.

Fixes: 824ee745fbca ("lib/rsa: Use the 'keyfile' argument from mkimage")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Tue, 14 Sep 2021 01:03:36 +0000 (21:03 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

- a fix for U-Boot 2021.10 to bring back MMC boot on older boards.

3 years agosunxi: mmc: A20: Fix MMC optimisation
Andre Przywara [Fri, 3 Sep 2021 15:49:16 +0000 (16:49 +0100)]
sunxi: mmc: A20: Fix MMC optimisation

Some SoCs (as seen on A20) seem to misreport the MMC FIFO level if the
FIFO is completely full: the level size reads as zero, but the FIFO_FULL
bit is set. We won't do a single iteration of the read loop in this
case, so will be stuck forever.

Check for this situation and use a safe minimal FIFO size instead when
we hit this case.

This fixes MMC boot on A20 devices after the MMC FIFO optimisation
(9faae5457f52).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoMerge branch '2021-09-09-finish-pre-DM_PCI-removal'
Tom Rini [Mon, 13 Sep 2021 22:23:24 +0000 (18:23 -0400)]
Merge branch '2021-09-09-finish-pre-DM_PCI-removal'

- Finish removing the non-DM_PCI legacy code.

3 years agopci: Drop DM_PCI
Simon Glass [Mon, 2 Aug 2021 00:54:44 +0000 (18:54 -0600)]
pci: Drop DM_PCI

This option has not effect now. Drop it, using PCI instead where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopci: Drop PCI_INDIRECT_BRIDGE
Simon Glass [Mon, 2 Aug 2021 00:54:43 +0000 (18:54 -0600)]
pci: Drop PCI_INDIRECT_BRIDGE

This does not work with driver model so can be removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agonet: Drop DM_PCI check from designware driver
Simon Glass [Mon, 2 Aug 2021 00:54:34 +0000 (18:54 -0600)]
net: Drop DM_PCI check from designware driver

We don't need this check anymore since when PCI is enabled, driver model
is always used.

Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopci: acpi: Drop DM_PCI check from ahci
Simon Glass [Mon, 2 Aug 2021 00:54:25 +0000 (18:54 -0600)]
pci: acpi: Drop DM_PCI check from ahci

We don't need these checks anymore since when PCI is enabled, driver model
is always used.

Drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopci: Drop DM_PCI check from fdtdec
Simon Glass [Mon, 2 Aug 2021 00:54:18 +0000 (18:54 -0600)]
pci: Drop DM_PCI check from fdtdec

We don't need this check anymore since when PCI is enabled, driver model
is always used.

Sadly this doesn't work with nds32 for some reason to do with the
toolchain. Add a work-around for that.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopci: Drop old code from header file
Simon Glass [Mon, 2 Aug 2021 00:54:16 +0000 (18:54 -0600)]
pci: Drop old code from header file

We don't need this code anymore since when PCI is enabled, driver model is
always used.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoppc: Remove UCP1020 board
Simon Glass [Mon, 2 Aug 2021 00:54:15 +0000 (18:54 -0600)]
ppc: Remove UCP1020 board

This board has not been converted to CONFIG_DM_PCI by the deadline.
Remove it.

Note that we have to add CONFIG_SPIFLASH to scripts/config_whitelist.txt
because it's not really migrated at this point.

Acked-by: Michael Durrant <mdurrant@arcturusnetworks.com>
Acked-by: Oleksandr Zhadan <oleks@arcturusnetworks.com>
Acked-by: Oleksandr Zhadan and Michael Durrant <arcsupport@arcturusnetworks.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Handle CONFIG_SPIFLASH differently and delete Kconfig file]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge tag 'mmc-2021-9-13' of https://source.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Mon, 13 Sep 2021 12:31:41 +0000 (08:31 -0400)]
Merge tag 'mmc-2021-9-13' of https://source.denx.de/u-boot/custodians/u-boot-mmc

Support using mmc command for enumerating mmc card in a given mode
Fix device_remove in mmc
Fix switch issue with send_status disabled
Drop 1ms delay in fsl_esdhc command sending
Revert "mmc: sdhci: set to INT_DATA_END when there are data"

3 years agommc: fsl_esdhc: remove 1ms sleep in esdhc_send_cmd_common()
Michael Walle [Fri, 10 Sep 2021 09:20:52 +0000 (11:20 +0200)]
mmc: fsl_esdhc: remove 1ms sleep in esdhc_send_cmd_common()

Since the beginning of this driver which was initially for the MPC8379
and MPC8536 SoCs, there is this spurious 1ms delay. According to the
comment it should actually be only 8 clock cycles. Esp. during EFI block
transfers, this 1ms add up to a significant delay and slows down EFI
boot.

I couldn't find any mention in the MPC8536 that there should be a delay
of 8 clock cycles between commands. The SD card specification mentions that
the clock has to be left enabled for 8 cycles after a command or
response. But I don't see how this delay will help with this.

Go ahead and just remove it. If there will ever be any regression we can
introduce a compile time flag, but for now I'd like to keep it simple.

In the split off imx driver this delay was also removed in commit
9098682200e6 ("mmc: fsl_esdhc_imx: remove the 1ms delay before sending
command").

Signed-off-by: Michael Walle <michael@walle.cc>
3 years agoMerge tag 'efi-2021-10-rc4-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 13 Sep 2021 00:33:21 +0000 (20:33 -0400)]
Merge tag 'efi-2021-10-rc4-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-10-rc4-2

Documentation:

* improve documentation of U-Boot for /config DT node
* integrate bloblist documentation

UEFI:

* correct usage of EFI_CALL()
* code tidy up

3 years agoMerge branch '2021-09-11-update-docker-container' into next
Tom Rini [Sat, 11 Sep 2021 17:18:35 +0000 (13:18 -0400)]
Merge branch '2021-09-11-update-docker-container' into next

- Update to latest Docker container images for CI.  This includes QEMU
  6.1.0 and support for SiFive Unleashed being tested.

3 years agoCI: Update to latest container images
Tom Rini [Sat, 11 Sep 2021 16:06:14 +0000 (12:06 -0400)]
CI: Update to latest container images

- Current Ubuntu/Focal tag
- QEMU 6.1.0
- genimage tool added

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoazure/gitlab: Add tests for SiFive Unleashed board
Bin Meng [Thu, 26 Aug 2021 15:33:35 +0000 (23:33 +0800)]
azure/gitlab: Add tests for SiFive Unleashed board

This adds CI tests for SiFive Unleashed board.

QEMU supports booting exact the same images as used on the real
hardware out of the box, that U-Boot SPL loads U-Boot proper
from either an SD card or the SPI NOR flash, hence we can easily
set up CI to cover these 2 boot flows of SiFive Unleashed board.

With this, now we can have regression testing of mmc-spi-slot and
sifive spi drivers, as well as mmc and spi-nor subsystems.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoriscv: sifive: unleashed: Add genimage config files
Bin Meng [Thu, 26 Aug 2021 15:33:34 +0000 (23:33 +0800)]
riscv: sifive: unleashed: Add genimage config files

This adds genimage [1] config files for generating SD card and spi-nor
images, which can be programmed to an SD card or SPI flash and boot
from there.

The same images will be used for U-Boot CI testing for this board.

[1] https://github.com/pengutronix/genimage

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
3 years agotools: docker: Build and install genimage
Bin Meng [Thu, 26 Aug 2021 15:33:33 +0000 (23:33 +0800)]
tools: docker: Build and install genimage

genimage [1] is a tool to create flash/disk images. This is required
by some targets, e.g.: sifive_unleashed, to generate sdcard or spi-nor
images for real hardware, as well as U-Boot CI testing.

[1] https://github.com/pengutronix/genimage

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agotools: docker: Bump up QEMU version to 6.1.0
Bin Meng [Thu, 26 Aug 2021 15:33:32 +0000 (23:33 +0800)]
tools: docker: Bump up QEMU version to 6.1.0

At present U-Boot CI testing is still using QEMU 4.2.0 which is
pretty old. Let's bump up to QEMU 6.1.0.

ninja-build is added as the prerequisite required by QEMU 6.1.0.

Note there is a bug in QEMU 6.1.0 Xilinx Zynq UART emulation codes.
A quick fix [1] was posted on QEMU mailing list but it it too late
for 6.1.0 release. Let's manually apply the bug fix on top of the
v6.1.0 release tag at the time being.

[1] http://patchwork.ozlabs.org/project/qemu-devel/patch/20210823020813.25192-2-bmeng.cn@gmail.com/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoDockerfile: Update to latest "focal" tag
Tom Rini [Sat, 11 Sep 2021 14:36:48 +0000 (10:36 -0400)]
Dockerfile: Update to latest "focal" tag

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch '2021-09-10-assorted-TI-updates'
Tom Rini [Sat, 11 Sep 2021 12:15:56 +0000 (08:15 -0400)]
Merge branch '2021-09-10-assorted-TI-updates'

- A number of TI platform bugfixes

3 years agoefi_loader: simplify efi_watchdog_timer_notify()
Heinrich Schuchardt [Thu, 9 Sep 2021 05:47:05 +0000 (07:47 +0200)]
efi_loader: simplify efi_watchdog_timer_notify()

We can call do_reset() directly without invoking the UEFI API.
This decreases the code size.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: eliminate EFI_CALL() in nvedit_efi.c
Heinrich Schuchardt [Thu, 9 Sep 2021 05:39:40 +0000 (07:39 +0200)]
efi_loader: eliminate EFI_CALL() in nvedit_efi.c

Reduce the code size by avoiding using the external UEFI API and using our
internal functions instead.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: Remove incorrect calls of EFI_CALL in TCG2
Ilias Apalodimas [Wed, 8 Sep 2021 21:30:49 +0000 (00:30 +0300)]
efi_loader: Remove incorrect calls of EFI_CALL in TCG2

There is two unneeded EFI_CALL references in tcg2_measure_pe_image().
The first one in efi_search_protocol() and the second on in the device path
calculation.  The second isn't even a function we should be calling, but a
pointer assignment, which happens to work with the existing macro.

While at it switch the malloc call to a calloc, remove the unnecessary cast
and get rid of an unneeded if statement before copying the device path

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: require CONFIG_BLK
Heinrich Schuchardt [Tue, 7 Sep 2021 06:56:47 +0000 (08:56 +0200)]
efi_loader: require CONFIG_BLK

The move to driver model should by now be completed. To be able to remove
pre-driver model code from our block IO code require CONFIG_BLK=y for UEFI
support.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoefi_loader: boot_service_capability_min should be capitalized
Masahisa Kojima [Mon, 6 Sep 2021 03:04:12 +0000 (12:04 +0900)]
efi_loader: boot_service_capability_min should be capitalized

boot_service_capability_min is constant, it should be capitalized.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: Complete the list of available runtime-config options
Simon Glass [Thu, 9 Sep 2021 20:10:32 +0000 (14:10 -0600)]
doc: Complete the list of available runtime-config options

The current list is missing a few items. Add them.

Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: Tidy up the bindings for the config/ node
Simon Glass [Thu, 9 Sep 2021 20:10:31 +0000 (14:10 -0600)]
doc: Tidy up the bindings for the config/ node

Sort these and add a type so it is clear how to set the value. Add a note
about usage to the top. Correct the 'no-keyboard' binding which is missing
a prefix.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agobloblist: Move to rST format
Simon Glass [Wed, 8 Sep 2021 13:33:52 +0000 (07:33 -0600)]
bloblist: Move to rST format

Move this documentation to the new format.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agodoc: board: toradex: fix file names
Oleksandr Suvorov [Thu, 9 Sep 2021 19:12:09 +0000 (22:12 +0300)]
doc: board: toradex: fix file names

Fix the documentation file names: s/apalix/apalis/.

Fixes: e98ea49a0e ("toradex: MAINTAINERS: entries for new reST docs")
Fixes: 3730106cf0 ("doc: board: apalis-imx8x: add documentation")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoconfigs: j72*_evm: Define the buffer sizes for dfu
Aswath Govindraju [Thu, 26 Aug 2021 15:58:59 +0000 (21:28 +0530)]
configs: j72*_evm: Define the buffer sizes for dfu

On J721e R5 SPL, dfu buffer for loading sysfw.itb image gets allocated
before DRAM gets initialized. So, the buffer gets allocated in MCU L3
RAM. The current buffer size to be allocated is 256KB  and the available
total heap memory is 0x70000 (448KB). This leads to NOMEM errors during
allocation.

In other cases when constraints such as above are not present fix the size
of buffers to the sector size in OSPI for proper functioning.

Also, if CONFIG_SYS_DFU_DATA_BUF_SIZE is defined and
CONFIG_SYS_DFU_MAX_FILE_SIZE is not defined then the max file size for dfu
transfer is defined as CONFIG_SYS_DFU_DATA_BUF_SIZE.

Fix these by setting appropriate buffer sizes in their respective defconfig
files and defining the max file size as 8 MB which is the default dfu
buffer size.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
3 years agoenvironment: ti: k3_dfu: Increase the size allocated for bootloader images in dfu_alt...
Aswath Govindraju [Thu, 26 Aug 2021 15:58:58 +0000 (21:28 +0530)]
environment: ti: k3_dfu: Increase the size allocated for bootloader images in dfu_alt_info_ram

The size of u-boot.img is above 1MB and that of tispl.bin is close to 1MB,
in case of j721e. Therefore, increase the sizes allocated for tispl.bin and
u-boot.img to 2 MB and 4 MB respectively, in dfu_alt_info_ram environment
variable.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
3 years agoarm: dts: k3-j721e-r5-*.dts: Fix clock-names property in the usb0 instance
Aswath Govindraju [Thu, 26 Aug 2021 15:58:57 +0000 (21:28 +0530)]
arm: dts: k3-j721e-r5-*.dts: Fix clock-names property in the usb0 instance

In the cdns3 usb driver, the clock name looked for is ref. Therefore, fix
the clock-names property in usb0 instance for proper initialization of
cdns3 usb gadget driver.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
3 years agoARM: dts: Fix node status to "okay" on TI boards
Roger Quadros [Tue, 24 Aug 2021 11:07:27 +0000 (14:07 +0300)]
ARM: dts: Fix node status to "okay" on TI boards

As per Device Tree Specification [1], the status parameter of nodes can
be "okay", "disabled", etc. "ok" is not a valid parameter.

U-boot Driver Model does not recognize status="ok" either and treats
the node as disabled.

[1] https://github.com/devicetree-org/devicetree-specification/releases/tag/v0.3

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
3 years agotools: k3_fit_atf: Fix DM binary FIT load addresses
Suman Anna [Sat, 14 Aug 2021 06:49:01 +0000 (01:49 -0500)]
tools: k3_fit_atf: Fix DM binary FIT load addresses

The DM binary runs on the MCU R5F Core0 after R5 SPL on J721E and J7200
SoCs. The binary is built alongside the TFA, OPTEE and A72 SPL binaries
and included in the tispl.bin FIT image. The R5 SPL loads the DM binary
at 0xA0000000 address, based on the value used in the FIT image build
script. The DM binary though is an ELF image and not a regular binary
file, and so is processed further to load the actual program segments
using the U-Boot's standard ELF loader library.

The DM binary does leverage a certain portion of DDR for its program
segments, and typically reserves 16 MB of DDR at 0xA0000000 with the
1st MB used for IPC between Linux and the remote processor, and
remaining memory for firmware segments. This can cause an incomplete
loading of the program segments if the DM binary is larger than 1 MB,
due to overlap of the initial loaded binary and the actual program
segments.

Fix this by using the address 0x89000000, which matches the current
"addr_mcur5f0_0load" env variable used by R5 SPL before the DM firmware
inclusion into the tispl.bin.

Fixes: df5363a67f35 ("tools: k3_fit_atf: add DM binary to the FIT image")
Signed-off-by: Suman Anna <s-anna@ti.com>
3 years agoarm: dts: k3-am642-evm-u-boot: Add u-boot, dm-spl tag in the pinmux node of mmc1
Aswath Govindraju [Mon, 9 Aug 2021 17:02:23 +0000 (22:32 +0530)]
arm: dts: k3-am642-evm-u-boot: Add u-boot, dm-spl tag in the pinmux node of mmc1

Add u-boot,dm-spl tag in the pinmux device tree node, required for MMCSD1
subsystem.

Fixes: b6059ddc45b9 ("arm: dts: k3-am642: Add r5 specific dt support")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
3 years agoam33xx: Fix USB for am335x boards
Matwey V. Kornilov [Sat, 7 Aug 2021 11:17:38 +0000 (14:17 +0300)]
am33xx: Fix USB for am335x boards

USB nodes were mistakenly disabled in

    commit 942853dd96df ("arm: dts: Resync BeagleBone device trees")

This commit is to fix the following issue:

    starting USB...
    No working controllers found
    USB is stopped. Please issue 'usb start' first.
    starting USB...
    No working controllers found

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0782e8572ce43f521ed6ff15e4a7ab9aa5acdc85
Fixes: 942853dd96df ("arm: dts: Resync BeagleBone device trees")
Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Reviewed-by: Paul Barker <paul.barker@sancloud.com>
3 years agoinclude: configs: am64x_evm: Add env variables for booting to kernel using USB MSC...
Aswath Govindraju [Wed, 4 Aug 2021 13:12:46 +0000 (18:42 +0530)]
include: configs: am64x_evm: Add env variables for booting to kernel using USB MSC device

Add env variables for booting to kernel from USB MSC device. The second
partition in the USB MSC device needs to formatted as ext4 file system with
kernel and dtb images, present in the /boot folder.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
3 years agoenvironment: ti: mmc.h: Make the finduuid generic for usage across different device...
Aswath Govindraju [Wed, 4 Aug 2021 13:12:45 +0000 (18:42 +0530)]
environment: ti: mmc.h: Make the finduuid generic for usage across different device types

Make finduuid generic by making it dependent on the boot variable. For
example, this can now be used for finding the uuid of partitions in usb
device too.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
3 years agoboard: ti: am64x: Add support for fixing dr_mode while booting from USB
Aswath Govindraju [Wed, 4 Aug 2021 13:12:44 +0000 (18:42 +0530)]
board: ti: am64x: Add support for fixing dr_mode while booting from USB

Fix the dr_mode in the U-Boot device tree blob, by reading the mode field
from the USB Boot Configuration fields. The dr_mode will only be fixed when
booting from USB.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
3 years agoARM: omap3: evm: Enable booting 'fitImage' with DEFAULT_FIT_TI_ARGS
Derald D. Woods [Mon, 2 Aug 2021 03:46:19 +0000 (03:46 +0000)]
ARM: omap3: evm: Enable booting 'fitImage' with DEFAULT_FIT_TI_ARGS

This commit uses the existing DEFAULT_MMC_TI_ARGS and
DEFAULT_FIT_TI_ARGS defintions to replace the 'mmc*' environment
variables in the configuration. The check for the 'boot_fit' is handled
like the 'am335x_*' boards with 'CONFIG_BOOTCOMMAND'.

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
3 years agoarm: am335x: Enable SPL_OF_CONTROL on some configs
Tom Rini [Sat, 31 Jul 2021 23:21:58 +0000 (19:21 -0400)]
arm: am335x: Enable SPL_OF_CONTROL on some configs

Both am335x_boneblack_vboot and am335x_evm_spiboot require
SPL_OF_CONTROL to function but are currently missing this option.  Add
it.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Fri, 10 Sep 2021 12:24:19 +0000 (08:24 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- mvebu: dts: Armada8k enable mdio (Sven)
- a37xx: pci: Fix / enhance error handling (Pali)
- mvebu: espressobin/turris_: Enable GPT partition support (Pali)
- mvebu: sata_mv: Probe all ports (Tony)
- a37xx: pci: Don't spam about PIO Response Status (Marek)

3 years agommc: fix device_remove when HS400_ES is enabled
Ye Li [Tue, 17 Aug 2021 09:20:34 +0000 (17:20 +0800)]
mmc: fix device_remove when HS400_ES is enabled

HS400_ES is missed when down grade to HS mode during
device_remove the mmc device

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: fix switch issue with send_status disabled
Ye Li [Tue, 17 Aug 2021 09:20:33 +0000 (17:20 +0800)]
mmc: fix switch issue with send_status disabled

When send_status is false or wait_dat0 is not supported, the switch
function should not send CMD13 but directly return.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agodoc: usage: mmc: Document usage of speed mode in "mmc dev" and "mmc rescan"
Aswath Govindraju [Fri, 13 Aug 2021 17:34:42 +0000 (23:04 +0530)]
doc: usage: mmc: Document usage of speed mode in "mmc dev" and "mmc rescan"

Add documentation on the usage of "mmc dev" and "mmc rescan" commands to
set user defined speed modes.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
3 years agommc: Add support for enumerating MMC card in a given mode using mmc command
Aswath Govindraju [Fri, 13 Aug 2021 17:34:41 +0000 (23:04 +0530)]
mmc: Add support for enumerating MMC card in a given mode using mmc command

Add support for enumerating MMC card in a given mode using mmc rescan and
mmc dev commands. The speed mode is provided as the last argument in these
commands and is indicated using the index from enum bus_mode in
include/mmc.h. A speed mode can be set only if it has already been enabled
in the device tree.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoRevert "mmc: sdhci: set to INT_DATA_END when there are data"
Yuezhang.Mo@sony.com [Wed, 17 Mar 2021 06:44:37 +0000 (06:44 +0000)]
Revert "mmc: sdhci: set to INT_DATA_END when there are data"

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b)
command, the DAT0 will driven to LOW as BUSY status, and in
sdhci specification, the transfer complete bit should be wait
for BUSY status de-assert.

All response-with-busy commands don't contain data, the data
judgement is no need.

Signed-off-by: Yuezhang.Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoarm: a37xx: pci: Don't spam about PIO Response Status
Marek Behún [Tue, 7 Sep 2021 15:27:08 +0000 (17:27 +0200)]
arm: a37xx: pci: Don't spam about PIO Response Status

Use dev_dbg() instead of dev_err() in pcie_advk_check_pio_status().

For example CRS is not an error status, it just says that the request
should be retried.

Without this, U-Boot spams the terminal with
  pcie_advk pcie@d0070000: Non-posted PIO Response Status: UR, 0xc80 @ 0x100000
  pcie_advk pcie@d0070000: Non-posted PIO Response Status: UR, 0xc80 @ 0x108000
  pcie_advk pcie@d0070000: Non-posted PIO Response Status: UR, 0xc80 @ 0x110000
  pcie_advk pcie@d0070000: Non-posted PIO Response Status: UR, 0xc80 @ 0x120000
  pcie_advk pcie@d0070000: Non-posted PIO Response Status: UR, 0xc80 @ 0x128000
  pcie_advk pcie@d0070000: Non-posted PIO Response Status: UR, 0xc80 @ 0x130000
  ...
when a device is not connected to a PCIe switch (Unsupported Request
from the switch).

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: marvell: Dreamplug: fix typo in eth1 name
Tony Dinh [Mon, 6 Sep 2021 23:28:35 +0000 (16:28 -0700)]
arm: marvell: Dreamplug: fix typo in eth1 name

Ethernet 1 should be ethernet-controller@76000.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu : sata_mv should probe all ports
Tony Dinh [Sun, 5 Sep 2021 21:48:25 +0000 (14:48 -0700)]
arm: mvebu : sata_mv should probe all ports

While a board could have multiple SATA ports, some of the ports might
not have a disk attached to them. So while probing for disks,
sata_mv_probe() should continue probing all ports, and skip one with
no disk attached.

Tests with:

- Seagate Goflex Net (Marvell Kirkwood 88F6281) out-of-tree u-boot.
- Zyxel NSA325 (Marvell Kirkwood 88F6282 out-of-tree u-boot.

Observation:

If a board has 2 or more SATA ports, and there is only one disk
attached to one of the ports, sata_mv_probe() does not return
a successful probe status. And if only one disk is attached to the
2nd port (i.e. port 1), it is not probed at all.

Patch Description:

Let sata_mv_probe() continues probing all ports, even if there
is error in probing a given port, and then return a successful
status if there is at least one port was probed successfully.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: a38x: Fix 5200000 baudrate
Pali Rohár [Thu, 2 Sep 2021 10:00:51 +0000 (12:00 +0200)]
arm: mvebu: a38x: Fix 5200000 baudrate

Fix baudrate value 5150000 which was added in commit ead4864fa6cc ("arm:
mvebu: a38x: Define supported UART baudrates").

Exact value for divisor 3 with 250 MHz TCLK is 5208333 baudrate. In above
commit I incorrectly rounded it to 5150000 value due to testing with
USB-UART hw which incorrectly reported exact value and divisor configured
on other other end of UART link.

Fix this value to 520000 baudrate which is more close to the exact hardware
value and also has less fraction parts.

Signed-off-by: Pali Rohár <pali@kernel.org>
Fixes: ead4864fa6cc ("arm: mvebu: a38x: Define supported UART baudrates")
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: espressobin: Enable GPT partition support
Pali Rohár [Thu, 2 Sep 2021 08:46:37 +0000 (10:46 +0200)]
arm: mvebu: espressobin: Enable GPT partition support

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: turris_{omnia, mox}: GPT partition support
Pali Rohár [Thu, 2 Sep 2021 08:34:00 +0000 (10:34 +0200)]
arm: mvebu: turris_{omnia, mox}: GPT partition support

This allows U-Boot to access filesystems on GPT partitioned disks.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Implement re-issuing config requests on CRS response
Pali Rohár [Fri, 27 Aug 2021 12:14:44 +0000 (14:14 +0200)]
arm: a37xx: pci: Implement re-issuing config requests on CRS response

According to PCIe base specification, if CRS Software Visibility is not
enabled, the Root Complex must re-issue the Configuration Request as a new
Request.

Normally this part of Root Complex is implemented in hardware but aardvark
is somehow special and does not implement it in hardware and expect that
handling of config requests are fully implemented in software.

This re-issuing functionality is required also because U-Boot does not
support CRS Software Visibility feature and therefore expects that Root
Complex re-issues requests as is specified in PCIe base specification.

Retry / re-issue config request up to the PIO_MAX_RETRIES, to prevent
infinite loop. After retry count exceed PIO_MAX_RETRIES, returns failure.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: a37xx: pci: Disable returning CRS response
Pali Rohár [Fri, 27 Aug 2021 12:14:43 +0000 (14:14 +0200)]
arm: a37xx: pci: Disable returning CRS response

There was mistake in commit 4cd61c43fd51 ("arm: a37xx: pci: Fix handling
PIO config error responses"). U-Boot does not support handling of CRS
return value for PCI_VENDOR_ID config read request and also does not set
CRSSVE bit.

Therefore disable returning CRS response for now.

Signed-off-by: Pali Rohár <pali@kernel.org>
Fixes: 4cd61c43fd51 ("arm: a37xx: pci: Fix handling PIO config error responses")
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: mvebu: dts: Armada8k enable mdio
Sven Auhagen [Tue, 24 Aug 2021 08:14:25 +0000 (10:14 +0200)]
arm: mvebu: dts: Armada8k enable mdio

Since mvpp2 is using the new mdio driver and the cp110 has been
synced with the linux upstream, the mdio has to enabled in the
device tree file.
This is missing for some device tree files and therefore the
network cards do not come online.

Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: Sheevaplug: Update board maintainer
Tony Dinh [Thu, 12 Aug 2021 21:33:34 +0000 (14:33 -0700)]
arm: kirkwood: Sheevaplug: Update board maintainer

Change maintainer to me. Prafulla is no longer active in U-Boot community.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoMAINTAINERS: Update ARM TI entry
Lokesh Vutla [Fri, 3 Sep 2021 07:15:37 +0000 (12:45 +0530)]
MAINTAINERS: Update ARM TI entry

Move TI maintainership to Tom.
Updated with the following commands:
find ./ -name MAINTAINERS | xargs sed -i s/"Lokesh Vutla <lokeshvutla@ti.com>"/"Tom Rini <trini@konsulko.com>"/g

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Acked-by: Tom Rini <trini@konsulko.com>
3 years agoKconfig: Drop duplicate 'select SHA512' instances
Tom Rini [Thu, 9 Sep 2021 14:57:34 +0000 (10:57 -0400)]
Kconfig: Drop duplicate 'select SHA512' instances

When dropping SHA512_ALGO in general, we didn't catch some cases where
an option was selecting  both SHA512 and SHA512_ALGO and caused them to
select SHA512 twice.  Kconfig doesn't complain, but this is still wrong
and should be corrected.

Fixes: e60e44993120 ("lib: Drop SHA512_ALGO in lieu of SHA512")
Reported-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch '2021-09-08-fix-FIT-hash-algos-in-SPL'
Tom Rini [Thu, 9 Sep 2021 01:23:55 +0000 (21:23 -0400)]
Merge branch '2021-09-08-fix-FIT-hash-algos-in-SPL'

- Merge some fixes to how we enable hash algorithms for FIT images in
  SPL.  This fixes a few cases where we should have had some options
  enabled, but did not.  This also removes otherwise unused options in a
  few other cases.

3 years agoimage: Drop IMAGE_ENABLE_{MD5, CRC32} #defines
Alexandru Gagniuc [Fri, 3 Sep 2021 00:54:22 +0000 (19:54 -0500)]
image: Drop IMAGE_ENABLE_{MD5, CRC32} #defines

These are no longer used, so drop them.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoimage: Drop if/elseif hash selection in calculate_hash()
Alexandru Gagniuc [Fri, 3 Sep 2021 00:54:21 +0000 (19:54 -0500)]
image: Drop if/elseif hash selection in calculate_hash()

calculate_hash() would try to select the appropriate hashing function
by a if/elseif contruct. But that is exactly why hash_lookup_algo()
exists, so use it instead.

This does mean that we now have to 'select HASH' to make sure we get
the hash_lookup_algo() symbol. However, the change makes sense because
even basic FITs will have to deal with "hash" nodes.

My only concern is that the 'select SPL_HASH' might cause some
platform to grow above its SPL size allowance

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
[trini: Make FSL_CAAM be implied only on ARM && SPL]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agocommon: Move MD5 hash to hash_algo[] array.
Alexandru Gagniuc [Fri, 3 Sep 2021 00:54:20 +0000 (19:54 -0500)]
common: Move MD5 hash to hash_algo[] array.

MD5 is being called directly in some places, but it is not available
via hash_lookup_algo("md5"). This is inconsistent with other hasing
routines. To resolve this, add an "md5" entry to hash_algos[].

The #ifdef clause looks funnier than those for other entries. This is
because both MD5 and SPL_MD5 configs exist, whereas the other hashes
do not have "SPL_" entries. The long term plan is to get rid of the
ifdefs, so those should not be expected to survive much longer.

The md5 entry does not have .hash_init/update/finish members. That's
okay because hash_progressive_lookup_algo() will catch that, and
return -EPROTONOSUPPORT, while hash_lookup_algo() will return the
correct pointer.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
[trini: Use CONFIG_IS_ENABLED not IS_ENABLED for MD5 check]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agocommon/spl: Drop [ST]PL_HASH_SUPPORT in favor of [ST]PL_HASH
Alexandru Gagniuc [Fri, 3 Sep 2021 00:54:19 +0000 (19:54 -0500)]
common/spl: Drop [ST]PL_HASH_SUPPORT in favor of [ST]PL_HASH

All of these configs exist. Stick to using CONFIG_[ST]PL_HASH, and drop all
references to CONFIG_[ST]PL_HASH_SUPPORT.  This means we need for
CHAIN_OF_TRUST to select SPL_HASH now.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
[trini: Add TPL case, fix CHAIN_OF_TRUST, other tweaks]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agolib: Drop SHA512_ALGO in lieu of SHA512
Alexandru Gagniuc [Fri, 3 Sep 2021 00:54:18 +0000 (19:54 -0500)]
lib: Drop SHA512_ALGO in lieu of SHA512

SHA512_ALGO was used as a "either SHA512 or SHA384", although the
implementations of these two algorithms share a majority of code.

From a Kconfig interface perspective, it makes sense to present two
distinct options. This requires #ifdefing out the SHA512
implementation from sha512.c. The latter doesn't make any sense.

It's reasonable to say in Kconfig that SHA384 depends on SHA512, and
seems to be the more polite way to handle the selection.

Thus, automatically select SHA512 when SHA384 is enabled.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agocommon: Remove unused CONFIG_FIT_SHAxxx selectors
Alexandru Gagniuc [Fri, 3 Sep 2021 00:54:17 +0000 (19:54 -0500)]
common: Remove unused CONFIG_FIT_SHAxxx selectors

Originally CONFIG_FIT_SHAxxx enabled specific SHA algos for and only
for hash_calculate() in common/image-fit.c. However, since commit
14f061dcb1 ("image: Drop IMAGE_ENABLE_SHAxxx"),
the correct selector was changed to CONFIG_SHAxxx.

The extra "_FIT_" variants are neither used, nor needed. Remove them.
One defconfig disables FIT_SHA256, which is now changed to 'SHA256'.

CMD_MVEBU_BUBT needs to select select SHA256 to avoid undefined
references to "sha256_*()". bubt.c needs sha256, so this selection is
correct. It is not clear why this problem did not manifest before.

Note that SHA selection in SPL is broken for this exact reason. There
is no corresponding SPL_SHAxxx. Fixing this is is beyond the scope of
this change.

Also note that we make CONFIG_FIT now imply SHA256, to make up for
FIT_SHA256 previously being a default y option.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
[trini: Add imply SHA256 to FIT]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch '2021-09-07-ATAGs-and-related-migration' into next
Tom Rini [Wed, 8 Sep 2021 02:29:57 +0000 (22:29 -0400)]
Merge branch '2021-09-07-ATAGs-and-related-migration' into next

- Merge ATAGs and MACH_ID options to Kconfig, and then disable them for
  nearly all platforms.  A small number of platforms actively require
  this support still, and have it still enabled.  Otherwise, it's migrated
  and disabled.