Commit Graph

5632 Commits

Author SHA1 Message Date
Andrey Zhizhikin 1fcb783fdc Prepare v2021.07
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDjIUMACgkQFHw5/5Y0
 tyyEuQv9G2grWGZ8ySREjJdkScNmmu9LUjTlkmmcMA/SovnevG9qx/R1gCRJpl77
 bFGqUK6TYAByAzd+7HXPo9EGNGkA9uweD5uD5s+xbUdLfkcF1Eit3cmhd13AfZfO
 aoGlgPl6kaboht+wwcj8UWPVBuly/wyce7//bqf+4Goo4uVM9c1Rkmp2QZLi7lCP
 WeU92Le6b6+Sq9CBJpyooZvBKsbvu0EEvmw/inFyVzS1ScHRVNPWbnhQYq1axqlw
 H0AdNlJUW+L9vr+GSvJdnBeP8UsvZXG/Wk4GKjivtjA2+b7ZgQhFj0ek0R4MPNhe
 8bq3yMDVaY5ul8bQa6hMbzlPW3DiEhXe1hTdSPHHwOiZaVFJ2txsASVxwpb/nFf0
 S1y55NaVBJOLy2ueGMfijdFrvIsToYGwo+zek2q/YxYL0beFoMFaroR8c0VBBnVE
 sc9DOzdN69tssX8SkWHEkdVGaviOsRoP2SGw8erCezv+GroLfKBPMIXR3CTZyBEM
 buht72sv
 =BxIW
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdQaENiSDAlGTDEbB7G51OISzHs0FAmDkFuMACgkQ7G51OISz
 Hs0J7RAAlG26jJV+8y+EzINaPQvmxxtKcpXqJJw02aIinbgU5+jf6n7KGETzKvW1
 Rgh6ExLYiefJcUkdpQCM7LmRJtIPu/G5rMA06z6H42Opf2AuRBGwlSuysLn6z+SU
 cztc9nxLKP8xMlf2E9PuVG6tmv39gB9qEF14jv0gU9fjh8vbVpbWY69WD8DTdRsm
 WPkIVlgNS2kvTYh0dF//0Ir+QVGcYjbtAbRGhcj+VCpk9Mv7B5uSr3qBuxEBhW6U
 OWBgyRay5yPTmUnWX1iT9wwFyNJ3tQEo+kWkcoq5WCWK7AayQA+DndgUu6fYJPx6
 EF7/ppipyF0CD0eH9fQEOsdW8QNjULHa3KEM0RcM5Zb3NrwJV8LoDNSVzT34Z+eh
 UzNhbcAZUhZswlX50u8tr4r9wc0xfaULpXy1vv4KAWoZkxjtaSvQTbw1lkf5d6hK
 7UMZKbtSqaGntZAEyZC5Hb4vTHHGfvANzsVTD4nJ6QjLDuwOq/w9SUvjz8yUmhtX
 o/ujlZBo61BI9zwtIEDOhO8wYE/sOB9i7tkden2aen2zAlSW5/HFPUfvRcr3KO4D
 4Qwo7baRLmJJvn9BTmmFLphZ2IIHfyUg2OwyINZeXO0KtGjX2q3x492jhtCjmVi/
 1oqsqUb6heklRqZMnCJwgJrYNNXYRfiypSKbGGTTuuRGVwPyvGQ=
 =P5k7
 -----END PGP SIGNATURE-----

Merge tag 'v2021.07' into 2021.07+fslc

Prepare v2021.07

Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
2021-07-06 08:40:00 +00:00
Da Xue 760d2f9e9e autoboot: fix MENUKEY
replace CONFIG_AUTOBOOT_USE_MENUKEY with CONFIG_AUTOBOOT_MENUKEY

Signed-off-by: Da Xue <da@libre.computer>
2021-07-02 15:03:53 -04:00
Andrey Zhizhikin 73fb2c32f7 Prepare v2021.07-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDaJXgACgkQFHw5/5Y0
 tyySmwwAkW7GVAv+bXSd+8u1IsScl0QrSCoBdfHpdMcAME3gZmXqxClxskfbYJR/
 3IByQFlsn7j8HruR/49+etk0i0Pc4HNfynTLuAy+77/lh+h3Pnru/VPBhQqR7KW0
 NN5STn91QWLl74vRmx5wmEfSMhg7LTE1US8Rh6UXAd2dAiPd+hUawIR9D0Pq5Gzm
 nn7HvamDYspFUgSYYl8h1RtRQ9VqAFpnnPphpLkvX6323uCQwccXu5pnj1fLfGfj
 iO2Q+bDcwpEdUosox/LM1BdMoaSA+opOjk/e72y9V84+Jk6D+Jn5zQEpF5TJnTyI
 Yi2+NuJWS5xFWk1dnJrbGt0HpWM2oO12dZZ7eYy/FdsPJiWAS0ppRuxHVb868vjD
 ulca7acFPUjGyo3vBw1S0iVmPCBFGHBoyg3QLrUHYbpISeBeoa2w2cDxQl90ahw/
 TgRx+yutKfwkBPfILwDylNOgCGRwvLfroRyMEMiQ3gTSOCBmBX/yMv1k8tb9ZvPZ
 /WVsK6dw
 =F7x1
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdQaENiSDAlGTDEbB7G51OISzHs0FAmDbKXIACgkQ7G51OISz
 Hs0VJw/+LRufCgQnZ2OsEE2y9cgMDECvFuiprmOCeCD4+z8vitrWhYhd/dv39LLQ
 C8ONhHdCbIsw1ivyKeD2ir8O2DU28a0C0x/zHplwtrL9pFd6XVbj9flf8GBi9FR3
 21y75kvwKScNIJ1iSGxwzcbVTr5VO3rfshDOoH6m68gHc4uqEUG0sZDooUydm1kp
 Xhtsbc5ew/2DbCrdPV0qrUDQ59uKck8jGXKRoKlJBHrL3MOBKExx2epql0Igiv9R
 TAunyiCdTzWF+B0OVY/JWTuu5cHCpYJdp/wV7aP/1lKeFj7W81qc+AyynnXld0hh
 mzxgl3Xl4Uh3nvMXU0+3FU53HuxCgCHfbIStNejedFqtXsA+QGOzpXaB65ZpNThI
 PDBNleGlWJdeDTYDj6XMP6mN4UwbHSoKHnrtfEpJBFVewjJ/qMV39+FPWVcfQvqb
 uZ+/UzUwnkOfS8yew97McfMJJwRLDZZwAMa/8RtoeUxutdLONJwGH2+z6fpHA5+B
 M7J83J7ygDJ9S4Lj3yHwGsXwFaIJNUyApnxnuS0kJY49AoPe1VGyPxvtcFVSkeMl
 dT/OQ5tbaLbr+6knkSoInQ0rYsTDcuj+RHz7sTth91t+vTbyOY0zq4zarhV18i6p
 /8f3jospJraK1ZDGAN4KniHvE/QsKJKJNv2yrkqS9tTQYjEKInM=
 =Vcvn
 -----END PGP SIGNATURE-----

Merge tag 'v2021.07-rc5' into 2021.07+fslc

Prepare v2021.07-rc5

Conflicts (manual resolve):
- configs/imx8mm_evk_defconfig:
- configs/imx8mn_ddr4_evk_defconfig:
- configs/imx8mn_evk_defconfig:
- configs/imx8mp_evk_defconfig:
Drop our local change, which are incuded in the commit 2bba78076b
("configs: Resync with savedefconfig") from upstream.

- configs/mx6sabresd_defconfig:
Merge changes from commit 2f7d3890b6 ("mx6sabre_common: Dynamically
change the video output") with upstream commit 2bba78076b ("configs:
Resync with savedefconfig").

Link: https://lore.kernel.org/u-boot/20210628194137.GU9516@bill-the-cat/
Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
2021-06-29 14:03:31 +00:00
Heinrich Schuchardt 5ad9220bf7 malloc: add SPDX license identifiers
The original code is in the public domain. Licenses/README states that the
general license for U-Boot is GPL 2.0+. So we can mark the malloc code as
GPL 2.0+ too.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-06-23 08:45:03 -04:00
Da Xue 5a87df8380 autoboot: fix typos of CONFIG_AUTOBOOT_USE_MENUKEY
Replace typo CONFIG_USE_AUTOBOOT_MENUKEY with
CONFIG_AUTOBOOT_USE_MENUKEY as when they were introduced initially there
was some mismatch in which name was used where.

Fixes: 8fc31e23aa ("autoboot: Rename CONFIG_MENUKEY to CONFIG_AUTOBOOT_MENUKEY")
Signed-off-by: Da Xue <da@libre.computer>
2021-06-22 14:01:22 -04:00
Andrey Zhizhikin c10bedd96f Prepare v2021.07-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmC+K5YACgkQFHw5/5Y0
 tyzRzwwApJt1odkpxfLPYtb8fCl7a4kTPyNswdToOMB+orxA36e7eREd1GFSH2fp
 5sZLkpn2TuXVVeUpReJnWoLcxKyR0RCXzr52VCfWJNWTkiYo4xMUaG/VutC5jdZJ
 Sn+crqGWZs1Cf9Ok1/5wSFEHDq/4H2t99UsGb6PyQvuqS6ub+7nk4/GkaVzoPhPW
 GunlRmTujutXAx0clTJHV3FPn5jpvjjbrgSAaE8ERp6uFB5tiOsxa9Zl8stRD487
 EHXRzwYPPdr6Q/OMHZc/gUfqD9Uw9nG6q6DtQwwi96jdUJMBsNwTQk08OkQ18ra2
 P6/+U+a7J7Xls/PnvepE/uPpu1jnkHWWazAS8npZqemq2twOKfV0/u/ENcy07GHl
 a+shSDPZ+XNoLoXJpZsSY9GvxQPyL2CJ4IiFktUYsk6Y2KV+b6HLDPjn7NbQ8czy
 DVNOEKnOufpBApwWRQvr8q+Y3+8DofS/S/82g6SLKyqiiHdUkWpXe0lKbxsSdqab
 YTYL5TyJ
 =/PGO
 -----END PGP SIGNATURE-----

Merge tag 'v2021.07-rc4' into 2021.07+fslc

Prepare v2021.07-rc4

Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
2021-06-10 07:59:20 +00:00
Green Wan 70415e1e52 board: sifive: add HiFive Unmatched board support
Add defconfig and board support for HiFive Unmatched.

Signed-off-by: Green Wan <green.wan@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2021-05-31 16:35:55 +08:00
Alexandru Gagniuc ec0512b173 Revert "lib: introduce HASH_CALCULATE option"
When we think of Kconfig, we usually think of features that we like
to enable or not. Ideally, we wouldn't use Kconfig to fix a build
issue, although sometimes it might make sense. With Kconfig it's hard
to guarantee that the fix is universal. We can only say that it works
for the set of tested configurations. In the majority of cases, it's
preferable to let the linker figure things out for us.

The reverted commit attempted to fix a build issue by adding an
invisible Kconfig option. This is wrong in several ways:

It invents a new Kconfig variable when CONFIG_HASH already
exists for the same purpose.
Second, hash-checksum.c makes use of the hash_progressive_lookup_algo()
symbol, which is only provided with CONFIG_HASH, but this dependency
was not expressed in the reverted patch.

It feels like Kconfig is turning into a listing of all available
source files, and a buffet to 'select' which ones to compile. The
purpose of this revert is to enable the next change to make use of
CONFIG_HASH instead of adding to Kconfig.

This reverts commit 87316da05f.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Acked-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2021-05-28 16:17:01 +02: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
Andrey Zhizhikin 44ec13f2c1 Prepare v2021.07-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmCsSqsACgkQFHw5/5Y0
 tyxxggwAlaLSgLIMc6SrKdJOqDCUojhG+unUplGSf3lfKhhC7QKy8ddrLD9Y2K99
 dJRQDIfkGZ6ugTN06wCdXZT3jHqgL0eNWTxAD7dpw4pznLCMXqAVKXfB9mLO2eXc
 bR247EQWo9LPhaop1lo09qDJ9FJnyDn5eTNlIEkSQzr+ODUKQjZk8PcmC+ykdMcF
 WfCUYgyzGGXySEsIBqjS8M+4zm+u1fgnpfCEBRvKjQ7++XymtWmL/GmgZxG3o3gf
 2jrGDnjdsRw5hFLceg2XA3wkISaV7l6o71lSMPDdB8gvss+FuA6JA7dSXC9/feAb
 SsfDdvCoyqdBFum5ywJKJaqZtqx1lLBErLaBgOGk/hhEZ0z8y72r4/uG5QvQMK5X
 vea4xxJaUUGbtefeFpZHA8dNE2v0t4x+obc9YfbwErJYhAts8bYBXucO8KK55aLv
 xyxKRkGfHztFPjSfRHnv8zWaWr7u0pekT9sranQUHX0qEC1PpRrAr3QEyzcjxro+
 2u7f2uv/
 =tcJb
 -----END PGP SIGNATURE-----

Merge tag 'v2021.07-rc3' into 2021.07+fslc

Prepare v2021.07-rc3

Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
2021-05-25 12:46:21 +00:00
Bin Meng 84dee33ca8 riscv: Drop USE_SPL_FIT_GENERATOR
Now that we have switched to binman to generate u-boot.itb for all
RISC-V boards, USE_SPL_FIT_GENERATOR is no longer needed and can
be dropped.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-19 17:01:51 +08:00
Bin Meng 6e847f6d5d common: kconfig: Correct a typo in SPL_LOAD_FIT
It should be FDT, not FTD.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Rick Chen <rick@andestech.com>
2021-05-19 17:01:49 +08:00
Tom Rini 428bec7cf9 Merge branch '2021-05-17-assorted-fixes' 2021-05-18 14:17:54 -04:00
Masahisa Kojima 87316da05f lib: introduce HASH_CALCULATE option
Build error occurs when CONFIG_EFI_SECURE_BOOT or
CONFIG_EFI_CAPSULE_AUTHENTICATE is enabled,
because hash-checksum.c is not compiled.

Since hash_calculate() implemented in hash-checksum.c can be
commonly used aside from FIT image signature verification,
this commit itroduces HASH_CALCULATE option to decide
if hash-checksum.c shall be compiled.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-05-18 12:36:13 +02:00
Heinrich Schuchardt e2ae483c3b hash: Kconfig option for SHA512 hardware acceleration
Commit a479f103dc ("hash: Allow for SHA512 hardware implementations")
defined function definitions for hardware accelerated SHA384 and SHA512.
If CONFIG_SHA_HW_ACCEL=y, these functions are used.

We already have boards using CONFIG_SHA_HW_ACCEL=y but none implements the
new functions hw_sha384() and hw_sha512().

For implementing the EFI TCG2 protocol we need SHA384 and SHA512. The
missing hardware acceleration functions lead to build errors on boards like
peach-pi_defconfig.

Introduce a new Kconfig symbol CONFIG_SHA512_HW_ACCEL to control if the
functions hw_sha384() and hw_sha512() shall be used to implement the SHA384
and SHA512 algorithms.

Fixes: a479f103dc ("hash: Allow for SHA512 hardware implementations")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-18 12:36:12 +02:00
peng.wang@smartm.com 6c353b34cf cli: slighly more clear error messages
This patch tries to distinguish two error messages.

Signed-off-by: peng.wang@smartm.com <peng.wang@smartm.com>
2021-05-17 17:06:42 -04:00
Kory Maincent bbdbcaf59d fdt_support: move fdt_valid from cmd_fdt.c to fdt_support.c
Move the fdt_valid function to fdt_support.
This changes allow to be able to test the validity of a devicetree in
other c files.

Update code syntax.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Maxime Ripard <maxime@cerno.tech>
2021-05-13 07:19:34 -04:00
Dario Binacchi a47abd7bf4 Revert "fdt: translate address if #size-cells = <0>"
This reverts commit d64b9cdcd4.

As pointed by [1] and [2], the reverted patch made every DT 'reg'
property translatable. What the patch was trying to fix was fixed in a
different way from previously submitted patches which instead of
correcting the generic address translation function fixed the issue with
appropriate platform code.

[1] https://patchwork.ozlabs.org/project/uboot/patch/1614324949-61314-1-git-send-email-bmeng.cn@gmail.com/
[2] https://lore.kernel.org/linux-clk/20210402192054.7934-1-dariobin@libero.it/T/

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-05-12 16:27:57 +05:30
Otavio Salvador f0f7f23c85 Prepare v2021.07-rc2
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmCZn8UACgkQFHw5/5Y0
 tyw+GAwAsupHDouwir3d710jhMnFfJk6PBRkbwdeypBNA3zkQlQE2dbLZ9p4NBCv
 CYCS1LsmWxWIehrJu3qXiddl+k6pbQ5eI3g6sl/cus27q39hIo3B6/4prXs4alH3
 a6lf1x9HjzOM+TblIReI9Zqd6S7FzS1L/f3xeYMGn1+vNg1rQMtrzbOlnsCB5ESq
 XFcfzvTur+hBsCe+9D1g9RxxEpnn0QKN4/9qtzes2loX9QL2WcloOWIaz9ZBtc0P
 7me8Tj0AMaRiWbpyHzumYK/qENJu/Pb1DZeFLH5ETCNHKsg1znc/82MScuUYqxJe
 3CTRu2ws83Chc1hBlFbHVoC4M8PuMKewwfQlqtIKvNxOKYVqUwpIDvAB4aQRW7Dd
 s8dVIWqzWCQA34SoaX/pw0JCYznhs+ByM4+x1cxfXqAW0kV92E5Ytdf19DdbQSkx
 Vq93jFe13uv0MFNWTzguiXzV83i9L43P8hmvAQvzucTbb4C2KEzYvi/WIq/bjHPw
 zEdEAZ7v
 =aTso
 -----END PGP SIGNATURE-----

Merge tag 'v2021.07-rc2' into 2021.07+fslc

Prepare v2021.07-rc2

* tag 'v2021.07-rc2':
  Prepare v2021.07-rc2
  MAINTAINERS: Add an entry for VirtIO
  doc: develop: Convert README.virtio to reST
  x86: Correct regwidth prompt in cbsysinfo
  cmd/exception: support ebreak exception on RISC-V
  atcspi200: Add timeout mechanism in spi_xfer()
  riscv: cpu: fu740: clear feature disable CSR
  riscv: cpu: Add callback to init each core
  fdt_support.c: Allow late kernel cmdline modification
  cmd: gpt: Add option to write GPT partitions to environment variable
  sandbox: add test of CONFIG_ENV_IMPORT_FDT
  env: allow environment to be amended from control dtb
  test: Add gpio-sysinfo test
  sysinfo: Add gpio-sysinfo driver
  sysinfo: Require that sysinfo_detect be called before other methods
  sysinfo: Use global sysinfo IDs for existing sysinfo drivers
  dm: gpio: Fix gpio_get_list_count failing with livetree

Change-Id: I391f68fc2c7413372aa66f38805b8dca3cdb80c2
2021-05-11 18:10:42 -03:00
Niko Mauno f0b21ebd41 fdt_support.c: Allow late kernel cmdline modification
By declaring board-specific board_fdt_chosen_bootargs() the kernel
command line arguments can be adjusted before injecting to flat dt
chosen node.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
2021-05-04 12:52:46 -04:00
Rasmus Villemoes 95fd977201 env: allow environment to be amended from control dtb
It can be useful to use the same U-Boot binary for multiple purposes,
say the normal one, one for developers that allow breaking into the
U-Boot shell, and one for use during bootstrapping which runs a
special-purpose bootcmd. Or one can have several board variants that
can share almost all boot logic, but just needs a few tweaks in the
variables used by the boot script.

To that end, allow the control dtb to contain a /config/enviroment
node (or whatever one puts in fdt_env_path variable), whose
property/value pairs are used to update the run-time environment after
it has been loaded from its persistent location.

The indirection via fdt_env_path is for maximum flexibility - for
example, should the user wish (or board logic dictate) that the values
in the DTB should no longer be applied, one simply needs to delete the
fdt_env_path variable; that can even be done automatically by
including a

  fdt_env_path = "";

property in the DTB node.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2021-05-04 11:50:50 -04:00
Sean Anderson 4d65c6bcd7 sysinfo: Require that sysinfo_detect be called before other methods
This has the uclass enforce calling detect() before other methods.  This
allows drivers to cache information in detect() and perform (cheaper)
retrieval in the other accessors. This also modifies the only instance
where this sequencing was not followed.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-04 07:57:18 -04:00
Ye Li 560a81e9cb MLK-21854-2 imx: uuu: Update autoboot to run uuu or fastboot
When booting from USB device, change u-boot autoboot to default
run UUU bootcmd or enter fastboot directly for android.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit eba8710106348a283940b851080b049bc7fbe466)
(cherry picked from commit decfa984826db8ae39e93f2968b8a04d009eef0d)
2021-05-02 14:22:43 -03:00
Yuichiro Goto 77ed7a2ac9 IOMUX: Fix buffer overflow in iomux_replace_device()
Use of strcat() against an uninitialized buffer would lead
to buffer overflow. This patch fixes it.

Fixes: 694cd5618c ("IOMUX: Introduce iomux_replace_device()")
Signed-off-by: Yuichiro Goto <goto@k-tech.co.jp>
Cc: Peter Robinson <pbrobinson@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
2021-04-27 08:05:30 -04:00
Jernej Skrabec a327feeef4 common: edid: Search for valid timing in extension block
One of my monitors have only 4k@60 timing in base EDID block which is
out of range for devices with HDMI 1.4. It turns out that it has
additional detailed timings in CTA-861 Extension Block and two of them
are appropriate for HDMI 1.4.

Add additional search for valid detailed timing in extension block.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-04-24 13:44:47 +02:00
Jernej Skrabec 3daea8632c common: edid: extract code for detailed timing search
Code which searches for valid detailed timing entry will be used in more
places. Extract it.

No functional change is made. However, descriptors are casted to
edid_detailed_timing instead of edid_monitor_descriptor. Descriptor can
be of either type, but since we're interested only in DTD, it is more
fitting to cast to edid_detailed_timing.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-04-24 13:44:44 +02:00
Jernej Skrabec 4fb0c3c43f common: edid: check for digital display earlier
When searching for detailed timing in EDID, check for digital display
earlier. There is no point parsing other parameters if this flag is not
present.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-04-24 13:44:41 +02:00
Joel Peshkin 4e9bce1243 Add support for stack-protector
Add support for stack protector for UBOOT, SPL, and TPL
as well as new pytest for stackprotector

Signed-off-by: Joel Peshkin <joel.peshkin@broadcom.com>

Adjust UEFI build flags.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-20 07:31:12 -04:00
Alexandru Gagniuc 58b504e5e1 Revert "spl: Drop bd_info in the data section"
This reverts commit 38d6b7ebda.

struct global_data contains a pointer to the bd_info structure. This
pointer was populated spl_set_bd() to a pre-allocated bd_info in the
".data" section. The referenced commit replaced this mechanism to one
that uses malloc(). That new mechanism is only used if SPL_ALLOC_BD=y.
which very few boards do.

The result is that (struct global_data)->bd is NULL in SPL on most
platforms. This breaks falcon mode, since arch_fixup_fdt() tries to
access (struct global_data)->bd and set the "/memory" node in the
devicetree. The result is that the "/memory" node contains garbage
values, causing linux to panic() as it sets up the page table.

Instead of trying to fix the mess, potentially causing other issues,
revert to the code that worked, while this change is reworked.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-19 11:34:01 -04:00
Alexandru Gagniuc 033ac4ebba image-fit: Accept OP-TEE images when booting a FIT
OP-TEE images are normally packaged with
	type = "tee;
	os = "tee";

However, fit_image_load() thinks that is somehow invalid. However if
they were declared as type = "kernel", os = "linux", fit_image_load()
would happily accept them and allow the boot to continue. There is no
technical limitation to excluding "tee".

Allowing "tee" images is useful in a boot flow where OP-TEE is
executed before linux.

In fact, I think it's unintuitive for a "load"ing function to also do
parsing and contain a bunch ad-hoc heuristics that only its caller
might know. But I don't make the rules, I just write fixes. In more
polite terms: refactoring the fit_image API is beyond the scope of
this change.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14 16:02:43 -04:00
Alexandru Gagniuc 47b6f7f845 image-fit: Accept IH_TYPE_FIRMWARE in fit_image_load() as valid
Consider the following FIT:

	images {
		whipple {};
	};
	configurations {
		conf-1 {
			firmware = "whipple";
		};
	};

Getting the 'firmware' image with fit_image_load() is not possible, as
it doesn't understand 'firmware =' properties. Although one could pass
IH_TYPE_FIRMWARE for 'image_type', this needs to be converted to a
"firmware" string for FDT lookup -- exactly what this change does.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14 16:02:43 -04:00
Alexandru Gagniuc 51d3a8b54f spl: LOAD_FIT_FULL: Support 'kernel' and 'firmware' properties
The 'firmware' property of a config node takes precedence over the
'kernel' property. 'standalone' is deprecated. However, give users a
couple of releases where 'standalone' still works, but warns loudly.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-14 16:02:43 -04:00
Alexandru Gagniuc 60138aa87c spl: LOAD_FIT_FULL: Relocate FDT for u-boot payloads
U-Boot expects the FDT to be located right after the _end
linker symbol (see fdtdec.c: board_fdt_blob_setup())

The "basic" LOAD_FIT path is aware of this limitation, and relocates
the FDT at the expected location. Guessing the expected location
probably only works reliably on 32-bit arm, and it feels like a hack.
One proposal would be to pass the FDT address to u-boot
(e.g. using 'r2' on arm platforms).

The variable is named "fdt_hack" to remind future contributors that,
"hey! we should fix the underlying problem". However, that is beyond
the scope of this patch.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-14 16:02:43 -04:00
Alexandru Gagniuc 2eaae17bc9 spl: LOAD_FIT_FULL: Do not hard-code os to IH_OS_U_BOOT
The information on the OS should be contained in the FIT, as the
self-explanatory "os" property of a node under /images. Hard-coding
this to U_BOOT might send us down the wrong path later in the boot
process.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-14 16:02:43 -04:00
Alexandru Gagniuc 18fd663c63 spl: LOAD_FIT_FULL: Fix selection of the "fdt" node
The correct FDT to use is described by the "fdt" property of the
configuration node. When the fit_unamep argument to fit_image_load()
is "fdt", we get the "/images/fdt" node. This is incorrect, as it
ignores the "fdt" property of the config node, and in most cases,
the "/images/fdt" node doesn't exist.

Use NULL for the 'fit_unamep' argument. With NULL, fit_image_load()
uses the IH_TYPE_FLATDT value to read the config property "fdt",
which points to the correct FDT node(s).

fit_image_load() should probably be split into a function that reads
an image by name, and one that reads an image by config reference. I
don't make those decisions, I just point out the craziness.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14 15:23:01 -04:00
Sean Anderson d442f69399 common: fit: Add weak board_fit_config_name_match
Several architectures had a default board_fit_config_name_match already;
this provides a generic weak version. We default to rejecting all configs.
This will use the FIT's default config, instead of the first config. This
may result in boot failures if there are multiple configurations and the
first config is *not* the default.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2021-04-14 15:23:01 -04:00
Alexandru Gagniuc df51ae767e Kconfig: Document the limitations of the simple SPL_LOAD_FIT path
The "simple" SPL_LOAD_FIT path is the most compliant with the format
documented in doc/uImage.FIT/source_file_format.txt. The other two
paths to load a FIT are SPL_LOAD_FIT_FULL and the "bootm" command.

Since the Kconfig menu is the most likely place for a new user to see
these options, it seems like the most logical candidate to document
the limitations. This documents the _known_ issues, and is not
intended to be a complete list of all follies.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14 15:23:01 -04:00
Alexandru Gagniuc 35f4f8e6fc spl: fit: Support loading FPGA images from list of "loadables"
Commit 4afc4f37c7 ("doc: FIT image: Clarify format and simplify
syntax") and delegated FPGA images to be added via the list of
"loadables" in lieu of the "fpga" property. Now actually implement
this in code.

Note that the "compatible" property is ignored for the time being, as
implementing "compatible" loading is beyond the scope of this change.
However, "u-boot,fpga-legacy" is accepted without warning.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-14 15:23:01 -04:00
Alexandru Gagniuc d8a395109e spl: fit: Warn if FIT contains "fpga" property in config node
Commit 4afc4f37c7 ("doc: FIT image: Clarify format and simplify
syntax") requires that FPGA images be referenced through the
"loadables" in the config node. This means that "fpga" properties in
config nodes are deprecated.

Given that there are likely FIT images which use "fpga", let's not
break those right away. Print a warning message that such use is
deprecated, and give users a couple of releases to update their

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-14 15:23:01 -04:00
Alexandru Gagniuc 55e7a1a435 spl: fit: Move FPGA loading code to separate functions
The FPGA loading code in spl_simple_fit_read() can easily be separated
from the rest of the logic. It is split into two functions instead of
one because spl_fit_upload_fpga() is used in a subsequent patch.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14 15:23:01 -04:00
Alexandru Gagniuc f0a6ec3656 spl: fit: Don't overwrite previous loadable if "load" is missing
spl_load_fit_image() will try to load an image at the address given
in the "load" property. Absent such property, it uses

	image_info->load_addr

Correct use of this is demonstrated in spl_fit_append_fdt(), which
resets the 'load_addr' before each spl_load_fit_image() call.

On the other hand loading "loadables" loop in spl_load_simple_fit()
completely ignores this. It re-uses the same structure, but doesn't
reset load_addr. If loadable [i] does not have a "load" property, its
load address defaults to load_addr, which still contains the address
of loadable [i - 1].

A simple solution is to treat NULL as an invalid load address. The
caller can set load_addr = 0 to request an abort if the "load"
property is absent.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14 15:23:01 -04:00
Alexandru Gagniuc ed6c9e0b66 lib: Add support for ECDSA image signing
mkimage supports rsa2048, and rsa4096 signatures. With newer silicon
now supporting hardware-accelerated ECDSA, it makes sense to expand
signing support to elliptic curves.

Implement host-side ECDSA signing and verification with libcrypto.
Device-side implementation of signature verification is beyond the
scope of this patch.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14 15:06:08 -04:00
Alexandru Gagniuc 0bcb28dfb9 lib: Rename rsa-checksum.c to hash-checksum.c
rsa-checksum.c sontains the hash_calculate() implementations. Despite
the "rsa-" file prefix, this function is useful for other algorithms.

To prevent confusion, move this file to lib/, and rename it to
hash-checksum.c, to give it a more "generic" feel.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14 15:06:08 -04:00
Asherah Connor 5b0b43e0e2 x86: qemu: move QFW to its own uclass
We move qfw into its own uclass and split the PIO functions into a
specific driver for that uclass.  The PIO driver is selected in the
qemu-x86 board config (this covers x86 and x86_64).

include/qfw.h is cleaned up and documentation added.

Signed-off-by: Asherah Connor <ashe@kivikakk.ee>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
2021-04-12 17:44:55 -04:00
Sean Anderson 9539f71675 hush: Fix assignments being misinterpreted as commands
If there were no variable substitutions in a command, then initial
assignments would be misinterpreted as commands, instead of being skipped
over. This is demonstrated by the following example:

	=> foo=bar echo baz
	Unknown command 'foo=bar' - try 'help'

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2021-04-12 17:17:11 -04:00
Joel Stanley a479f103dc hash: Allow for SHA512 hardware implementations
Similar to support for SHA1 and SHA256, allow the use of hardware hashing
engine by enabling the algorithm and setting  CONFIG_SHA_HW_ACCEL /
CONFIG_SHA_PROG_HW_ACCEL.

Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-04-12 17:17:11 -04:00
Patrick Delaunay a2535243e0 lib: optee: migration optee_copy_fdt_nodes for OF_LIVE support
The optee_copy_fdt_nodes is only used to copy op-tee nodes
of U-Boot device tree (from gd->fdt_blob when OF_LIVE is not activated)
to external device tree but it is not compatible with OF_LIVE.

This patch migrates all used function fdt_ functions to read node on
old_blob to ofnode functions, compatible with OF_LIVE and remove this
parameter "old_blob".

The generated "device tree" is checked on stm32mp platform with OF_LIVE
activated.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-04-12 14:25:31 -04:00
Patrick Delaunay 83064c2706 board_f: cosmetic: change the debug trace to KB in reserve_video
Update the debug trace for the reserved video memory to KB as indicated
in the message with "%luk"; before the patch the computed size
gd->relocaddr - addr is in bytes.

This patch aligns the debug trace in reserve_video() with others
functions, for example on stm32mp157c-dk2:

  - Reserving 3080192k for video at: dfd00000
  + Reserving 3008k for video at: dfd00000
    Reserving 873k for U-Boot at: dfc25000
    Reserving 32776k for malloc() at: ddc23000
    Reserving 72 Bytes for Board Info at: ddc22fb0
    Reserving 280 Bytes for Global Data at: ddc22e90
    Reserving 119072 Bytes for FDT at: ddc05d70
    Reserving 0x278 Bytes for bootstage at: ddc05af0

Fixes: 5630d2fbc5 ("board: Show memory for frame buffers")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-10 16:53:56 +02:00
Tom Rini a1e95e3805 u-boot-imx-20210409
-------------------
 
 - Secure Boot :
 	- HAB for MX8M / MX7ULP
 	- CAAM fixes
 - Fixes for imxrt1020
 - Fixes for USDHC driver
 - Fixes for Toradex (Colibri / Apalis)
 - Switch to DM for several boards
 	- mx23 olinuxo
 	- usbarmory
 	- marsboard / riotboard
 	- Gateworks GW Ventana
 - NXP upstream patches (LPDDR / CAAM / HAB)
 
 CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/7089
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQS2TmnA27QKhpKSZe309WXkmmjvpgUCYHA8Xg8cc2JhYmljQGRl
 bnguZGUACgkQ9PVl5Jpo76aVbQCfb0Z+N836ZSAodyLa0t6FSHgKqfYAnRdrWQAv
 MNlGOmmpfHENtE75eSnd
 =g48D
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-imx-20210409' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20210409
-------------------

- Secure Boot :
	- HAB for MX8M / MX7ULP
	- CAAM fixes
- Fixes for imxrt1020
- Fixes for USDHC driver
- Fixes for Toradex (Colibri / Apalis)
- Switch to DM for several boards
	- mx23 olinuxo
	- usbarmory
	- marsboard / riotboard
	- Gateworks GW Ventana
- NXP upstream patches (LPDDR / CAAM / HAB)

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/7089
2021-04-09 10:08:52 -04:00
Tim Harvey aa0032f672 spl: fit: nand: allow for non-page-aligned elements
Add a weak nand_get_mtd function for nand drivers to provide mtd info
and use this to set pagesize such that reading of non page-aligned
elements can succeed.

The spl_load_simple_fit already handles block block access so all we
need to do is provide the nand writesize as the block length.

Further cleanup of the drivers which use nand_spl_loaders.c such as
am335x_spl_bch.c, atmel_nand.c, and nand_spl_simple.c could be done
using info from mtd_info instead of statically defined details.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2021-04-08 20:29:53 +02:00