]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
3 years agoMerge tag 'u-boot-amlogic-next-20230628' of https://source.denx.de/u-boot/custodians...
Tom Rini [Wed, 28 Jun 2023 14:10:03 +0000 (10:10 -0400)] 
Merge tag 'u-boot-amlogic-next-20230628' of https://source.denx.de/u-boot/custodians/u-boot-amlogic into next

- add support for Amlogic A1 SoC and ad401 board
- add support for Videostrong KII Pro
- introduce secure power domain for A1 SoC

3 years agodrivers: meson: introduce secure power controller driver
Alexey Romanov [Wed, 31 May 2023 09:31:56 +0000 (12:31 +0300)] 
drivers: meson: introduce secure power controller driver

This patch adds Power controller driver support for Amlogic
A1 family using secure monitor calls. The power domains register
only can access in secure world.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230531093156.29240-4-avromanov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agodt-bindings: power: add Meson A1 PWRC bindings
Alexey Romanov [Wed, 31 May 2023 09:31:55 +0000 (12:31 +0300)] 
dt-bindings: power: add Meson A1 PWRC bindings

We can use them in secure pwrc driver.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230531093156.29240-3-avromanov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agoarch/arm: meson: sm: introduce power domain functions
Alexey Romanov [Wed, 31 May 2023 09:31:54 +0000 (12:31 +0300)] 
arch/arm: meson: sm: introduce power domain functions

This commit adds functions to manage secure power domain for
Amlogic SoC's using smc functionality.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230531093156.29240-2-avromanov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agodoc: boards: amlogic: add documentation for KII Pro
Ferass El Hafidi [Sun, 7 May 2023 12:42:29 +0000 (12:42 +0000)] 
doc: boards: amlogic: add documentation for KII Pro

Add build instructions for the KII Pro set-top box.

Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
Link: https://lore.kernel.org/r/20230507124109.31778-4-vitali64pmemail@protonmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agoboards: amlogic: add KII Pro defconfig
Ferass El Hafidi [Sun, 7 May 2023 12:42:24 +0000 (12:42 +0000)] 
boards: amlogic: add KII Pro defconfig

Add configurations for the Videostrong KII Pro set-top box.
This defconfig is cloned from the WeTek Play2's.

Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
Link: https://lore.kernel.org/r/20230507124109.31778-3-vitali64pmemail@protonmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agoarm: dts: add support for Videostrong KII Pro
Ferass El Hafidi [Sun, 7 May 2023 12:42:19 +0000 (12:42 +0000)] 
arm: dts: add support for Videostrong KII Pro

Import the device tree from mainline linux (v6.4-rc1) and add the
old PHY reset bindings in the PHY node, else U-Boot and linux won't
be able to use the PHY.

Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
Link: https://lore.kernel.org/r/20230507124109.31778-2-vitali64pmemail@protonmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agoboard: amlogic: add support for AD401 board
Igor Prusov [Fri, 5 May 2023 12:56:39 +0000 (15:56 +0300)] 
board: amlogic: add support for AD401 board

The AD401 board is the Amlogic A1 SoC reference board

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230505125639.3605-6-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agopinctrl: meson: add pinctrl driver for Amlogic A1
Igor Prusov [Fri, 5 May 2023 12:56:38 +0000 (15:56 +0300)] 
pinctrl: meson: add pinctrl driver for Amlogic A1

Based on Linux kernel commit:
dabad1ff85611 (pinctrl: meson: add pinctrl driver support for Meson-A1 SoC)

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230505125639.3605-5-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agoARM: meson: add A1 support
Igor Prusov [Fri, 5 May 2023 12:56:37 +0000 (15:56 +0300)] 
ARM: meson: add A1 support

Add support for Amlogic A1 SoC family.

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Signed-off-by: Evgeny Bachinin <eabachinin@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230505125639.3605-4-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agoARM: dts: sync meson-a1-ad401 from Linux 6.3-rc7
Igor Prusov [Fri, 5 May 2023 12:56:36 +0000 (15:56 +0300)] 
ARM: dts: sync meson-a1-ad401 from Linux 6.3-rc7

Add meson-a1-ad401.dts file from Linux 6.3-rc7

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230505125639.3605-3-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agoARM: dts: Add Amlogic Meson A1 DT from Linux 6.3-rc7
Igor Prusov [Fri, 5 May 2023 12:56:35 +0000 (15:56 +0300)] 
ARM: dts: Add Amlogic Meson A1 DT from Linux 6.3-rc7

Import Linux 6.3-rc7 Device tree and necessary bindings for Amlogic A1
board from 6a8f57ae2eb0 ("Linux 6.3-rc7").

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230505125639.3605-2-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
3 years agoMerge branch 'riscv-fixes' of https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Tue, 27 Jun 2023 13:39:58 +0000 (09:39 -0400)] 
Merge branch 'riscv-fixes' of https://source.denx.de/u-boot/custodians/u-boot-riscv

3 years agoriscv: Fix alignment of RELA sections in the linker scripts
Bin Meng [Tue, 27 Jun 2023 01:24:56 +0000 (09:24 +0800)] 
riscv: Fix alignment of RELA sections in the linker scripts

In current linker script both .efi_runtime_rel and .rela.dyn sections
are of RELA type whose entry size is either 12 (RV32) or 24 (RV64).
These two are arranged as a continuous region on purpose so that the
prelink-riscv executable can fix up the PIE addresses in one loop.

However there is an 'ALIGN(8)' between these 2 sections which might
cause a gap to be inserted between these 2 sections to satisfy the
alignment requirement on RV32. This would break the assumption of
the prelink process and generate an unbootable image.

Fixes: 9a6569a043d3 ("riscv: Update alignment for some sections in linker scripts")
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Rick Chen <rick@andestech.com>
3 years agoMAINTAINERS: update SiFive HiFive Unmatched maintainers
Heinrich Schuchardt [Mon, 1 May 2023 12:57:08 +0000 (14:57 +0200)] 
MAINTAINERS: update SiFive HiFive Unmatched maintainers

Email account pragnesh.patel@sifive.com does not exist anymore.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agoboard: starfive: Fixed errors reported when executing get_maintainer.pl
Yanhong Wang [Fri, 28 Apr 2023 01:28:20 +0000 (09:28 +0800)] 
board: starfive: Fixed errors reported when executing get_maintainer.pl

Fixed errors reported when executing 'scripts/get_maintainer.pl -f
configs/starfive_visionfive2_defconfig'.

Invalid MAINTAINERS address: 'startfive'

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 years agoPrepare v2023.07-rc5 v2023.07-rc5
Tom Rini [Mon, 26 Jun 2023 15:44:06 +0000 (11:44 -0400)] 
Prepare v2023.07-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 26 Jun 2023 15:43:56 +0000 (11:43 -0400)] 
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agosmegw01: Fix duplicate bootcmd
Eduard Strehlau [Mon, 26 Jun 2023 14:31:36 +0000 (11:31 -0300)] 
smegw01: Fix duplicate bootcmd

Two conflicting bootcmds were included in the environment.
Streamline to defining the bootcmd only in the env file.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
3 years agoMerge branch '2023-06-23-assorted-important-fixes'
Tom Rini [Sun, 25 Jun 2023 01:36:19 +0000 (21:36 -0400)] 
Merge branch '2023-06-23-assorted-important-fixes'

- Merge in a few important fixes.  This includes a (partial) regression
  fix, updating documentation and some sanity checking around image
  loading.

3 years agoimx: hab: Simplify the mechanism
Marek Vasut [Sun, 28 May 2023 21:00:30 +0000 (23:00 +0200)] 
imx: hab: Simplify the mechanism

The current mechanism is unnecessarily complex. Simplify the whole mechanism
such that the entire fitImage is signed, IVT is placed at the end, followed
by CSF, and this entire bundle is also authenticated. This makes the signing
scripting far simpler.

Signed-off-by: Marek Vasut <marex@denx.de>
3 years agoimx: hab: Fix a couple of build warnings with DEBUG enabled
Marek Vasut [Sun, 28 May 2023 23:29:20 +0000 (01:29 +0200)] 
imx: hab: Fix a couple of build warnings with DEBUG enabled

In case the DEBUG is enabled, these three lines warn about cast of
pointer to integer of different size, add the missing casts to fix
the warnings.

Signed-off-by: Marek Vasut <marex@denx.de>
3 years agospl: spl_legacy: Add extra address checks
Marek Vasut [Mon, 29 May 2023 12:04:06 +0000 (14:04 +0200)] 
spl: spl_legacy: Add extra address checks

Check whether the loaded image or entry point does not overlap SPL.

Signed-off-by: Marek Vasut <marex@denx.de>
3 years agoARM: imx: Add weak default reset_cpu()
Marek Vasut [Fri, 23 Jun 2023 19:56:27 +0000 (21:56 +0200)] 
ARM: imx: Add weak default reset_cpu()

Add weak default reset_cpu() implementation needed by e.g. panic().

Signed-off-by: Marek Vasut <marex@denx.de>
3 years agoARM: at91: Switch sama5d2_icp_mmc to simple malloc in SPL
Marek Vasut [Fri, 23 Jun 2023 22:34:54 +0000 (00:34 +0200)] 
ARM: at91: Switch sama5d2_icp_mmc to simple malloc in SPL

To avoid SRAM overflow in the SPL build, use simple malloc implementation.

Signed-off-by: Marek Vasut <marex@denx.de>
3 years agomips: cpu: Use plain puts() in restart handler
Marek Vasut [Fri, 23 Jun 2023 18:49:21 +0000 (20:49 +0200)] 
mips: cpu: Use plain puts() in restart handler

This removes dependency on fprintf() , which is not available
in SPL unless full printf support is enabled.

Signed-off-by: Marek Vasut <marex@denx.de>
3 years agomkimage: Use PATH_MAX for path length
Mingli Yu [Mon, 19 Jun 2023 06:22:50 +0000 (14:22 +0800)] 
mkimage: Use PATH_MAX for path length

Fixed when build xilinx_zynqmp in long directory ( >256):
  |  /buildarea1/testtest/wr_build/wr1023test_secureboot/test1-what/test2-what/test3-what/test4-what/test5-what/test6-what/test7-what/test8-what/test9-what/test10-what/test11-what/test12-what/build/tmp-glibc/work/xilinx_zynqmp-wrs-linux/u-boot-xlnx/1_v2023.01-xilinx-v2023.1+gitAUTOINC+40a08d69e7-r0/build/fitImage-linux: Image file name (uboot-mkimage) too long, can't create tmpfile.
  | Error: Bad parameters for FIT image type

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
3 years agodoc: statistics: Re-generate the last 3 releases
Tom Rini [Tue, 20 Jun 2023 20:00:20 +0000 (16:00 -0400)] 
doc: statistics: Re-generate the last 3 releases

With some changes to our mapping files in gitdm, re-generate the last
few releases worth of statistics to correctly reflect contributions. We
only go back this far to try and find a balance between highlighting
contributions and still being reviewable.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agomenu: Re-enable the ANSI codes
Simon Glass [Sat, 17 Jun 2023 10:49:48 +0000 (11:49 +0100)] 
menu: Re-enable the ANSI codes

The intent here was to allow ANSI codes to be disabled, since it was
proving impoosible to test operation of the menu code when it kept moving
the cursor. Unfortunately this ended up in the patch.

Correct this by enabling ANSI again.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Pali Rohár <pali@kernel.org>
Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Reported-by: Frank Wunderlich <frank-w@public-files.de>
Fixes: 32bab0eae51b ("menu: Make use of CLI character processing")
Tested-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
3 years agoMerge tag 'doc-2023-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 23 Jun 2023 18:23:11 +0000 (14:23 -0400)] 
Merge tag 'doc-2023-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request doc-2023-07-rc6

* move FIT documentation to HTML
* man-pages for the bind, bootm, and unbind commands

3 years agodoc: Improve documentation for the bootm command
Simon Glass [Fri, 23 Jun 2023 12:22:14 +0000 (13:22 +0100)] 
doc: Improve documentation for the bootm command

Reformat and rewrite the documentation for this command.

This is a complicated command, so further improvements are welcome.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Bring in the command-syntax extensions
Simon Glass [Fri, 23 Jun 2023 12:22:13 +0000 (13:22 +0100)] 
doc: Bring in the command-syntax extensions

Bring this file into the documentation. For now it is not in the correct
format for a command, but it is valid rST. Futher work will improve this.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Add signing to the FIT spec
Simon Glass [Fri, 23 Jun 2023 12:22:12 +0000 (13:22 +0100)] 
doc: Add signing to the FIT spec

Move this properties into the main spec.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Move external FIT docs into the main body
Simon Glass [Fri, 23 Jun 2023 12:22:11 +0000 (13:22 +0100)] 
doc: Move external FIT docs into the main body

Rather than having this as an addition to the end, move this into the
main body of the spec, rewriting as needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Expand FIT tables to include all values
Simon Glass [Fri, 23 Jun 2023 12:22:10 +0000 (13:22 +0100)] 
doc: Expand FIT tables to include all values

Add tables which include all values for type, algo, arch, algo and
compression.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Tidy up the format docs to be more generic
Simon Glass [Fri, 23 Jun 2023 12:22:09 +0000 (13:22 +0100)] 
doc: Tidy up the format docs to be more generic

Avoid reference to uImage which is the old format. Drop the historical
language at the top and rewrite a few other sections. Correct the
U-Boot filename which is now in the boot/ directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Bring in the FIT overlay information
Simon Glass [Fri, 23 Jun 2023 12:22:08 +0000 (13:22 +0100)] 
doc: Bring in the FIT overlay information

Bring this file into the documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Bring in the FIT howto
Simon Glass [Fri, 23 Jun 2023 12:22:07 +0000 (13:22 +0100)] 
doc: Bring in the FIT howto

Bring this file into the documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Bring in FIT signature files
Simon Glass [Fri, 23 Jun 2023 12:22:06 +0000 (13:22 +0100)] 
doc: Bring in FIT signature files

Bring these files into the documentation.

Fix 'wtih' and 'it' typos and repeated 'could' while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Bring in FIT x86 boot
Simon Glass [Fri, 23 Jun 2023 12:22:05 +0000 (13:22 +0100)] 
doc: Bring in FIT x86 boot

Bring this file into the documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Bring in the FIT examples
Simon Glass [Fri, 23 Jun 2023 12:22:04 +0000 (13:22 +0100)] 
doc: Bring in the FIT examples

Convert these to rST format and add them to the index.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Reformat the FIT documentation to make it nicer
Simon Glass [Fri, 23 Jun 2023 12:22:03 +0000 (13:22 +0100)] 
doc: Reformat the FIT documentation to make it nicer

Fix up headings and tables to read better.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Convert FIT source-file format to rST
Simon Glass [Fri, 23 Jun 2023 12:22:02 +0000 (13:22 +0100)] 
doc: Convert FIT source-file format to rST

Move this document and convert it to rST. Make minimal changes, enough
for it to build successfully.

Future patches will tidy this up.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Move FIT into its own directory
Simon Glass [Fri, 23 Jun 2023 12:22:01 +0000 (13:22 +0100)] 
doc: Move FIT into its own directory

Create a new usage/fit directory which will house information about FIT.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: bind man-page
Heinrich Schuchardt [Wed, 21 Jun 2023 19:24:55 +0000 (21:24 +0200)] 
doc: bind man-page

provide a man-page for the bind command

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agodoc: unbind man-page
Heinrich Schuchardt [Fri, 16 Jun 2023 15:11:49 +0000 (17:11 +0200)] 
doc: unbind man-page

Provide a man-page for the unbind command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agoARM: dts: trimslice: sync SPI node with Linux dts
Tomasz Maciej Nowak [Thu, 30 Mar 2023 18:24:22 +0000 (20:24 +0200)] 
ARM: dts: trimslice: sync SPI node with Linux dts

After "spi: spi_flash_probe_bus_cs() rely on DT for spi speed and mode"
series flash speed and mode wasn't passed to driver anymore, which
resulted in:

Loading Environment from SPIFlash... tegra20_sflash spi@7000c380: Invalid chip select 0:0 (err=-19)
*** Warning - spi_flash_probe_bus_cs() failed, using default environment

Fix it by syncing SPI node of affected device dts with Linux kernel dts.
The changed SPI bus frequency doesn't influence stability of read/write
operations.

Ref: https://patchwork.ozlabs.org/project/uboot/cover/20220518064648.1843664-1-patrice.chotard@foss.st.com
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Tom <twarren@nvidia.com>
3 years agoARM: tegra: Enable poweroff command on Jetson TX2
Thierry Reding [Tue, 31 Jan 2023 15:11:10 +0000 (16:11 +0100)] 
ARM: tegra: Enable poweroff command on Jetson TX2

This command is useful to power off the system from within U-Boot.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom <twarren@nvidia.com>
3 years agoARM: tegra: Enable poweroff command on Jetson TX1 and Jetson Nano
Thierry Reding [Tue, 31 Jan 2023 15:11:09 +0000 (16:11 +0100)] 
ARM: tegra: Enable poweroff command on Jetson TX1 and Jetson Nano

This command is useful to power off the system from within U-Boot.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom <twarren@nvidia.com>
3 years agoMerge branch '2023-06-21-fix-get_ram_size-with-cache-enabled' into next
Tom Rini [Thu, 22 Jun 2023 13:59:43 +0000 (09:59 -0400)] 
Merge branch '2023-06-21-fix-get_ram_size-with-cache-enabled' into next

To quote the author:
Ensure that every write is flushed to memory and afterward reads are
from memory.

Since the algorithm rely on the fact that accessing to not existent
memory lead to write at addr / 2 without this modification accesses to
aliased (not physically present) addresses are cached and wrong size is
returned.

This was discovered while working on a TI AM625 based board where cache
is normally enabled, see commit c02712a74849 ("arm: mach-k3: Enable
dcache in SPL").

3 years agocommon/memsize.c: Fix get_ram_size() when cache is enabled
Emanuele Ghidoli [Tue, 30 May 2023 13:33:27 +0000 (15:33 +0200)] 
common/memsize.c: Fix get_ram_size() when cache is enabled

Ensure that every write is flushed to memory and afterward reads are
from memory.
Since the algorithm rely on the fact that accessing to not existent
memory lead to write at addr / 2 without this modification accesses
to aliased (not physically present) addresses are cached and
wrong size is returned.

This was discovered while working on a TI AM625 based board
where cache is normally enabled, see commit c02712a74849 ("arm: mach-k3: Enable dcache in SPL").

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
3 years agosandbox: Add a dummy dcache_status() function
Emanuele Ghidoli [Tue, 30 May 2023 13:33:26 +0000 (15:33 +0200)] 
sandbox: Add a dummy dcache_status() function

This adds dcache_status() so that code using it can build
without error on sandbox. This is required in preparation
of adding cache handling into get_ram_size function.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Wed, 21 Jun 2023 18:42:50 +0000 (14:42 -0400)] 
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

3 years agoMerge branch '2023-06-20-assorted-update' into next
Tom Rini [Wed, 21 Jun 2023 18:39:38 +0000 (14:39 -0400)] 
Merge branch '2023-06-20-assorted-update' into next

- Assorted updates and improvements

3 years agousb: dwc2: Fix the write to W1C fields in HPRT register
Teik Heng Chong [Wed, 21 Jun 2023 03:13:58 +0000 (11:13 +0800)] 
usb: dwc2: Fix the write to W1C fields in HPRT register

Fix the write to the HPRT register which treat W1C fields
as if they were mere RW. This leads to unintended clearing of such fields

This bug was found during the testing on Simics model. Referring to
specification DesignWare Cores USB 2.0 Hi-Speed On-The-Go (OTG)
Databook (3.30a)"5.3.4.8 Host Port Control and Status Register (HPRT)", the
HPRT.PrtPwr is cleared by this mistake. In the Linux driver (contrary to
U-Boot), HPRT is always read using dwc2_read_hprt0 helper function which
clears W1C bits. So after write back those bits are zeroes.

Signed-off-by: Teik Heng Chong <teik.heng.chong@intel.com>
3 years agocmd: usb: Prevent reset in usb tree/info command
Xavier Drudis Ferran [Wed, 21 Jun 2023 07:13:07 +0000 (09:13 +0200)] 
cmd: usb: Prevent reset in usb tree/info command

   Commands causing reset in some configs:

When bootflow scan is run, this will cause a UCLASS_BOOTDEV device to
be added as sibling of those UCLASS_BLK devices found in the search
chain defined in environment variable "boot_targets", until boot
succeeds from some device. This can happen automatically as part of
the default boot process on some boards (example: Rock Pi 4) depending
on the board configuration (DISTRO_DEFAULTS, BOOTSTD, BOOTCOMMAND,
etc.) because they have bootcmd=bootflow scan.

If boot doesn't succeed from any device, and usb is in boot_targets,
and an usb storage device is plugged to some usb port at boot time,
its UCLASS_MASS_STORAGE device will have a UCLASS_BOOTDEV device as
child, besides a UCLASS_BLK child.

If once the boot fails the user enters at the U-Boot shell prompt:

usb info

or

usb tree

The code in cmd/usb.c will eventually recurse into the UCLASS_BOOTDEV
device and pass a null usb_device pointer to usb_show_tree_graph() or
usb_show_info() (because it has no parent_priv_).

This causes a reset. The expected behaviour would be to ignore the
UCLASS_BOOTDEV device, continue listing the usb information and return
to the prompt.

   Minimal test:

Another way to trigger this reset as a minimal test or on boards with
a different bootcmd would be:

- make sure "usb" is in environment variable boot_targets (might need
  setenv boot_targets usb; and/or saveenv and reset), then, with a usb
  storage device plugged to a usb port, run:

=> usb reset ; bootflow scan ; usb info

   Solution:

Fix it (twice) by checking for null parent_priv_ and adding
UCLASS_BOOTDEV to the list of ignored class ids before the recursive
call.

This prevents the current particular problem with UCLASS_BOOTDEV, even
in case it ever gets some parent_priv_ struct which is not an
usb_device, despite being the child of a usb_device->dev. And it also
prevents possible future problems if other children are added to usb
devices that don't have parent_priv_ because they are not part of the
usb tree, just abstractions of functionality (like UCLASS_BLK and
UCLASS_BOOTDEV are now).

Signed-off-by: Xavier Drudis Ferran <xdrudis@tinet.cat>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
3 years agotest: dm: restore /firmware nodes after testing
AKASHI Takahiro [Thu, 8 Jun 2023 00:55:59 +0000 (09:55 +0900)] 
test: dm: restore /firmware nodes after testing

dm_test_restore() is called after dm unit test is run.
But this function does not scan any nodes under /firmware since
it calls dm_scan_fdt().

This causes an issue. For instance, scmi_sandbox_agent device
will disappear after running 'ut dm scmi_sandbox_agent'.

So call dm_extended_scan() instead. This change will be coherent
with what dm_scan() and test_pre_run() does.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agostdio: Remove stdio_init()
Masahiro Yamada [Tue, 6 Jun 2023 11:37:42 +0000 (20:37 +0900)] 
stdio: Remove stdio_init()

This function is not used by anyone.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoconfigs: am64x_evm_*_defconfig: Enable High Secure device support
Vignesh Raghavendra [Sat, 3 Jun 2023 12:36:14 +0000 (18:06 +0530)] 
configs: am64x_evm_*_defconfig: Enable High Secure device support

Enable CONFIG_TI_SECURE_DEVICE to support booting High Secure(HS)
variants of AM64x SoC.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agoconfigs: synquacer: increase SYS_MALLOC_F_LEN
Masahisa Kojima [Thu, 1 Jun 2023 09:13:51 +0000 (18:13 +0900)] 
configs: synquacer: increase SYS_MALLOC_F_LEN

DM_FLAG_PRE_RELOC flag is added into some drivers
by recent commits such as
1bd790bc4b ("firmware: psci: enable DM_FLAG_PRE_RELOC").
Current SYS_MALLOC_F_LEN of SynQuacer Developerbox platform
is too small, Developerbox will not boot due to lack of
heap memory.

This commit increases the size of heap memory.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
3 years agotest: bdinfo: Add test for command bdinfo
Marek Vasut [Wed, 31 May 2023 01:03:58 +0000 (03:03 +0200)] 
test: bdinfo: Add test for command bdinfo

Add test for command bdinfo .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agopython: Update requirements.txt for security issues
Tom Rini [Tue, 30 May 2023 19:50:30 +0000 (15:50 -0400)] 
python: Update requirements.txt for security issues

Per GitHub Dependabot:
- Use setuptools 65.5.1 to avoid some DoS issue
- Use requests 2.31.0 to avoid leaking some proxy information

Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodrivers: spi: omap3_spi: Initialize mode for all channels
Julien Panis [Mon, 29 May 2023 13:42:28 +0000 (15:42 +0200)] 
drivers: spi: omap3_spi: Initialize mode for all channels

At first SPI transfers, multiple chip selects can be
enabled simultaneously. This is due to chip select
polarity, which is not properly initialized for all
channels. This patch fixes the issue.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
3 years agopsci: fix use of clobbered registers in asm
Sam Edwards [Sun, 28 May 2023 00:09:42 +0000 (18:09 -0600)] 
psci: fix use of clobbered registers in asm

The functions `psci_get_context_id` and `psci_get_target_pc`
are written in C, so the C compiler may clobber registers r0-r3.
Do not use these registers to save data across calls.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
3 years agomkimage: ecdsa: password for signing from environment
Stefano Babic [Thu, 25 May 2023 08:18:05 +0000 (10:18 +0200)] 
mkimage: ecdsa: password for signing from environment

Use a variable (MKIMAGE_SIGN_PASSWORD) like already done for RSA to
allow the signing process to run in batch.

Signed-off-by: Stefano Babic <sbabic@denx.de>
3 years agousb: eth: lan78xx: Fix logic in lan78xx_read_otp() to avoid a warning
Tom Rini [Thu, 4 Jun 2020 20:35:15 +0000 (16:35 -0400)] 
usb: eth: lan78xx: Fix logic in lan78xx_read_otp() to avoid a warning

In lan78xx_read_otp() we want to know if sig is LAN78XX_OTP_INDICATOR_1
or LAN78XX_OTP_INDICATOR_2.  In the case of matching the first one we
set offset to itself, and clang warns about this.  Rework the logic so
that if sig is the second indicator we adjust the offset as today and if
it does not match the first indicator we return -EINVAL

Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agospl: spl-nor: return error if no valid image was loaded
Mario Kicherer [Mon, 30 Jan 2023 09:21:43 +0000 (10:21 +0100)] 
spl: spl-nor: return error if no valid image was loaded

If only FIT images are enabled and loading the FIT image fails,
spl_nor_load_image() should return an error instead of zero.

Without this patch:

>>SPL: board_init_r()
spl_init
Trying to boot from NOR
Unsupported OS image.. Jumping nevertheless..
image entry point: 0x0

With patch:

>>SPL: board_init_r()
spl_init
Trying to boot from NOR
SPL: failed to boot from all boot devices (err=-6)
.### ERROR ### Please RESET the board ###

Signed-off-by: Mario Kicherer <dev@kicherer.org>
3 years agoMerge branch '2023-06-19-spl-nvme-support' into next
Tom Rini [Tue, 20 Jun 2023 13:35:16 +0000 (09:35 -0400)] 
Merge branch '2023-06-19-spl-nvme-support' into next

To quote the author:
This patchset adds support to load images of the SPL's next booting
stage from a NVMe device

3 years agocommon: spl: Add spl NVMe boot support
Mayuresh Chitale [Sat, 3 Jun 2023 14:02:56 +0000 (19:32 +0530)] 
common: spl: Add spl NVMe boot support

Add support to load the next stage image from an NVMe disk which may
be formatted as an EXT or FAT filesystem.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
[trini: Drop hunk changing disk/part.c as that breaks other users]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agonvme: pci: Enable for SPL
Mayuresh Chitale [Sat, 3 Jun 2023 14:02:55 +0000 (19:32 +0530)] 
nvme: pci: Enable for SPL

Enable NVME and PCI NVMe drivers for SPL builds. Also enable PCI_PNP
for SPL which is required to auto configure the PCIe devices.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
3 years agospl: blk: Support loading images from fs
Mayuresh Chitale [Sat, 3 Jun 2023 14:02:54 +0000 (19:32 +0530)] 
spl: blk: Support loading images from fs

Add a generic API to support loading of SPL payload from any supported
filesystem on a given partition of a block device.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
3 years agospl: Add Kconfig options for NVME
Mayuresh Chitale [Sat, 3 Jun 2023 14:02:53 +0000 (19:32 +0530)] 
spl: Add Kconfig options for NVME

Add kconfig options to enable NVME and PCI NVMe support in SPL

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoglobal: Use proper project name U-Boot (next)
Michal Simek [Mon, 5 Jun 2023 11:58:59 +0000 (13:58 +0200)] 
global: Use proper project name U-Boot (next)

Use proper project name in DTs, messages and READMEs.

Signed-off-by: Michal Simek <michal.simek@amd.com>
3 years agoMerge branch '2023-06-19-corstone1000-fwu-updates' into next
Tom Rini [Mon, 19 Jun 2023 20:43:53 +0000 (16:43 -0400)] 
Merge branch '2023-06-19-corstone1000-fwu-updates' into next

To quote the author:
Now that the nvmxip block driver is merged we can add on top
of it the platform code to use GPT and FWU metadata in the
Corstone1000.

But first, push 2 fixes that are needed to make all this work:
 - move nvmxip header to include
 - setup fwu metadata structures as packed (we have a 32bit
   writer - Secure enclave Cortex-M0 and a 64bit reader host
   Cortex-A35)

3 years agocorstone1000: add nvmxip, fwu-mdata and gpt options
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:20 +0000 (09:09 +0100)] 
corstone1000: add nvmxip, fwu-mdata and gpt options

Enable the newest features: nvmxip, fwu-metadata and
gpt. Commands to print the partition info, gpt info
and fwu metadata will be available.

Adjust also env boot script the address of the
bootbank with the new gpt layout, and also remove
the not needed kernel address bank0 and bank1
and retrieve function that would test the bank flag
before and now we are getting the info from the fwu
metadata.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
3 years agocorstone1000: set kernel_addr based on boot_idx
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:19 +0000 (09:09 +0100)] 
corstone1000: set kernel_addr based on boot_idx

We need to distinguish between boot banks and from which
partition to load the kernel+initramfs to memory.

For that, fetch the boot index, fetch the correspondent
partition, calculate the correct kernel address and
then set the env variable kernel_addr with that value.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
3 years agocorstone1000: add boot index
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:18 +0000 (09:09 +0100)] 
corstone1000: add boot index

it is expected that the firmware that runs before
u-boot somehow provide the information of the bank
for now we will fetch the info from the metadata
since the Secure enclave is the one responsible for
this information.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
3 years agocorstone1000: add fwu-metadata store info
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:17 +0000 (09:09 +0100)] 
corstone1000: add fwu-metadata store info

Add fwu-mdata node and handle for the reference
nvmxip-qspi.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
3 years agonvmxip: move header to include
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:16 +0000 (09:09 +0100)] 
nvmxip: move header to include

Move header to include to allow external code
to get the internal bdev structures to access
block device operations.

as at it, just add the UCLASS_NVMXIP string
so we get the correct output in partitions
listing.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
3 years agofwu_metadata: make sure structures are packed
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:15 +0000 (09:09 +0100)] 
fwu_metadata: make sure structures are packed

The fwu metadata in the metadata partitions
should/are packed to guarantee that the info is
correct in all platforms. Also the size of them
are used to calculate the crc32 and that is important
to get it right.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agoMerge tag 'u-boot-at91-fixes-2023.07-a' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 19 Jun 2023 13:18:40 +0000 (09:18 -0400)] 
Merge tag 'u-boot-at91-fixes-2023.07-a' of https://source.denx.de/u-boot/custodians/u-boot-at91

First set of u-boot-atmel fixes for the 2023.07 cycle:

This small fixes set includes one init fix for scmi clocks and a missing
gpio_request for pm9g45.

3 years agoMerge tag 'efi-2023-07-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi 245/head
Tom Rini [Fri, 16 Jun 2023 23:05:52 +0000 (19:05 -0400)] 
Merge tag 'efi-2023-07-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-07-rc5

Documentation:

* man-page for imxtract
* correct EVT_DM_POST_INIT_F description

UEFI:

* bootm: don't call booti_setup for EFI images
* simplify efi_disk_remove
* fix tests that failed when executed repeatedly

3 years agoMerge tag 'u-boot-stm32-20230616' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 16 Jun 2023 14:51:58 +0000 (10:51 -0400)] 
Merge tag 'u-boot-stm32-20230616' of https://source.denx.de/u-boot/custodians/u-boot-stm into next

serial: stm32: Fixes to avoid suprious characters
Use U-Boot device tree to configure MTD partitions stm32mp13 and stm32mp15 boards
stm32mp: stm32prog: Add support of ENV partition type
config: stm32mp15: remove CONFIG_FASTBOOT_USB_DEV and CONFIG_FASTBOOT_CMD_OEM_FORMAT
stm32: Add IWDG handling into PSCI suspend code
stm32: Fix OF_LIST on DHCOR
stm32: Add missing header for save_boot_params
stm32: Use __section(".data") with dot in the section name on DHSOM
stm32mp: soome changes and fixes for STM32MP13 and STM32MP15 boards
dts: stm32mp: alignment with v6.3
dts: stm32f769-disco: remove the dsi_host node
configs: stm32f746-disco: remove a useless comment

3 years agoserial: stm32: BRR must be set only when usart is disable
Patrice Chotard [Wed, 31 May 2023 06:01:31 +0000 (08:01 +0200)] 
serial: stm32: BRR must be set only when usart is disable

To avoid spurious chars, BRR register must only be written when
USART is disabled.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoserial: stm32: Wait TC bit before performing initialization
Patrice Chotard [Wed, 31 May 2023 06:01:30 +0000 (08:01 +0200)] 
serial: stm32: Wait TC bit before performing initialization

In case there is still chars from previous bootstage to transmit, wait
for TC (Transmission Complete) bit to be set which ensure that the last
data written in the USART_TDR has been transmitted out of the shift
register.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoconfigs: stm32f746-disco: remove a useless comment
Dario Binacchi [Sat, 22 Apr 2023 14:01:40 +0000 (16:01 +0200)] 
configs: stm32f746-disco: remove a useless comment

Commit 8fc78fc73b7f9d ("configs: migrate CONFIG_BMP_16/24/32BPP to defconfigs")
made the comment useless.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoARM: dts: stm32f769-disco: remove the dsi_host node
Dario Binacchi [Sat, 22 Apr 2023 14:02:36 +0000 (16:02 +0200)] 
ARM: dts: stm32f769-disco: remove the dsi_host node

The node has become useless, as described in the
commit 754815b854258 ("video: stm32: remove the compatible "synopsys, dw-mipi-dsi" support")

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoARM: dts: stm32mp: alignment with v6.3
Patrick Delaunay [Mon, 24 Apr 2023 14:21:10 +0000 (16:21 +0200)] 
ARM: dts: stm32mp: alignment with v6.3

Device tree alignment with Linux kernel v6.3:
f5a058023239 - ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi
8539ebb435a5 - ARM: dts: stm32: enable i2c1 and i2c5 on
  stm32mp135f-dk.dts
8539ebb435a5 - ARM: dts: stm32: add spi nodes into stm32mp131.dtsi
15f72e0da4da - ARM: dts: stm32: add pinctrl and disabled spi5 node in
  stm32mp135f-dk
ea99a5a02ebc - ARM: dts: stm32: Create separate pinmux for qspi cs pin
  in stm32mp15-pinctrl.dtsi
a306d8962a24 - ARM: dts: stm32: Rename mdio0 to mdio
0a5ebb1f3367 - ARM: dts: stm32: Replace SAI format with dai-format DT
  property
ccdab19738a6 - ARM: dts: stm32: add adc support to stm32mp13
022932ab55fd - ARM: dts: stm32: add adc pins muxing on stm32mp135f-dk
ab2806ddad9d - ARM: dts: stm32: add dummy vdd_adc regulator on
  stm32mp135f-dk
e46a180c060f - ARM: dts: stm32: add adc support on stm32mp135f-dk
9ebf215fbae1 - ARM: dts: stm32: add PWR fixed regulators on stm32mp131
16f4ff60519a - ARM: dts: stm32: add USBPHYC and dual USB HS PHY support
  on stm32mp131
4a47f0f3e936 - ARM: dts: stm32: add UBSH EHCI and OHCI support on
  stm32mp131
2a46bb66c47f - ARM: dts: stm32: add USB OTG HS support on stm32mp131
9ebf215fbae1 - ARM: dts: stm32: add fixed regulators to support usb on
  stm32mp135f-dk
16f4ff60519a - ARM: dts: stm32: enable USB HS phys on stm32mp135f-dk
c4e7254cf6dc - ARM: dts: stm32: enable USB Host EHCI on stm32mp135f-dk
44978e135916 - ARM: dts: stm32: add pins for stm32g0 typec controller on stm32mp13
4f532403b1e5 - ARM: dts: stm32: enable USB OTG in dual role mode on
  stm32mp135f-dk
e1f15571c96c - ARM: dts: stm32: add mcp23017 pinctrl entry for stm32mp13
6cc71374002e - ARM: dts: stm32: add mcp23017 IO expander on I2C1 on
  stm32mp135f-dk
7ffd2266bd32 - ARM: dts: stm32: Fix qspi pinctrl phandle for
  stm32mp15xx-dhcor-som
21d83512bf2b - ARM: dts: stm32: Fix qspi pinctrl phandle for
  stm32mp15xx-dhcom-som
732dbcf52f74 - ARM: dts: stm32: Fix qspi pinctrl phandle for
  stm32mp151a-prtt1l
003b7c6b24f4 - ARM: dts: stm32: remove sai kernel clock on
  stm32mp15xx-dkx
f2b17b39bfff - ARM: dts: stm32: rename sound card on stm32mp15xx-dkx
dee3cb759d3d - ARM: dts: stm32: Remove the pins-are-numbered property
ae8cf3b48727 - ARM: dts: stm32: add i2s nodes on stm32mp131
619746a27bd0 - ARM: dts: stm32: add sai nodes on stm32mp131
c5e05d08ef90 - ARM: dts: stm32: add spdifrx node on stm32mp131
0a5afd3ee0d0 - ARM: dts: stm32: add dfsdm node on stm32mp131
bf9d876bea2e - ARM: dts: stm32: add timers support on stm32mp131
a3183748371d - ARM: dts: stm32: add timer pins muxing for stm32mp135f-dk
a9060c1326bc - ARM: dts: stm32: add timers support on stm32mp135f-dk
a12154058f75 - ARM: dts: stm32: Fix User button on stm32mp135f-dk
2f33df889e99 - ARM: dts: stm32: Use new media bus type macros
366384e49551 - ARM: dts: stm32: Update part number NVMEM description on
  stm32mp131

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agomedia: dt-bindings: media: Add macros for video interface bus types
Patrick Delaunay [Mon, 24 Apr 2023 14:21:09 +0000 (16:21 +0200)] 
media: dt-bindings: media: Add macros for video interface bus types

Add a new dt-bindings/media/video-interfaces.h header that defines
macros corresponding to the bus types from media/video-interfaces.yaml.
This allows avoiding hardcoded constants in device tree sources.

Based on linux commit f7eeb0084593 ("media: dt-bindings: media: Add macros
for video interface bus types")

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoARM: at91: don't initialize clocks if scmi clock driver is enabled
Clément Léger [Tue, 30 May 2023 09:05:16 +0000 (11:05 +0200)] 
ARM: at91: don't initialize clocks if scmi clock driver is enabled

Because clock devices are initialized by the SCMI server, if
CONFIG_CLK_SCMI is defined.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
3 years agopmic: stpmic1: support new prefix node name for regulator
Patrick Delaunay [Thu, 27 Apr 2023 13:36:38 +0000 (15:36 +0200)] 
pmic: stpmic1: support new prefix node name for regulator

The '_' character is discouraged in the node name, this patch adds the
new prefix of regulator subnode, with the '-' character, in STM32MP1 driver
to support the new  naming rule in Linux kernel device trees.

It is a preliminary patch before Linux device tree synchronization
for STMicroelectronics boards.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: stm32prog: use the decimal format by default for offset parsing
Patrick Delaunay [Thu, 27 Apr 2023 13:36:37 +0000 (15:36 +0200)] 
stm32mp: stm32prog: use the decimal format by default for offset parsing

Change the default base for offset parsing with simple_strtoull(),
so offset in flashlayout is coded in base 10 by default, even if string
start with '0'. The Octal encoding is not supported. The base 16
is still supported when the '0x' header is detected.

This patch solves an unexpected parsing result when the address,
provided by decimal value is starting by 0, for example 0x4400 = 00017408
is a invalid with current code.

...
P 0x04 fsbl1 Binary mmc0 00017408         tf-a.stm32
....

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: stm32prog: fix OTP read/write error management
Patrick Delaunay [Thu, 27 Apr 2023 13:36:36 +0000 (15:36 +0200)] 
stm32mp: stm32prog: fix OTP read/write error management

Avoid to ignore the OTP read/write error and transmits the error
to STM32CubeProgrammer.

Today the error is only displayed in log error:
so the user on HOST thinks the OTP operation is performed.

Reported-by: Mickael GARDET <m.gardet@overkiz.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Fixes: 75ea9e75931c ("stm32mp: stm32prog: add TEE support in stm32prog command")
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoconfigs: stm32mp1: reduce DDR_CACHEABLE_SIZE to supported 256MB DDR
Patrick Delaunay [Thu, 27 Apr 2023 13:36:35 +0000 (15:36 +0200)] 
configs: stm32mp1: reduce DDR_CACHEABLE_SIZE to supported 256MB DDR

Reduces the CONFIG_DDR_CACHEABLE_SIZE, the size of DDR mapped cacheable
before relocation, to support DDR with only 256MB because the OP-TEE
reserved memory is located at end of the DDR.

By default the new size of 128MB cacheable memory is enough
in dram_bank_mmu_setup() for early_enable_caches() in arch_cpu_init()
and is correct for DDR size = 256MB.

After relocation the real size of DDR, excluding the no-map reserved
memory, is used after the U-Boot device tree parsing.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: bsec: add check on null size in misc ops
Patrick Delaunay [Thu, 27 Apr 2023 13:36:34 +0000 (15:36 +0200)] 
stm32mp: bsec: add check on null size in misc ops

Add a protection in misc bsec ops for request with null size.

For example OP-TEE error occurs when get_eth_nb() return 0 in
setup_mac_address() for unknown part number because U-Boot read 0 OTPs.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agostm32mp: add support of STM32MP15x Rev.Y
Patrick Delaunay [Thu, 27 Apr 2023 13:36:33 +0000 (15:36 +0200)] 
stm32mp: add support of STM32MP15x Rev.Y

Add support of STM32MP15x Rev.Y for the Silicon revision REV_ID = 0x2003.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoARM: stm32: Use __section(".data") with dot in the section name on DHSOM
Marek Vasut [Thu, 4 May 2023 19:52:08 +0000 (21:52 +0200)] 
ARM: stm32: Use __section(".data") with dot in the section name on DHSOM

The correct specifier of the section is ".data" and not "data",
use the former to place the variables in ".data" section.

Fixes: 731fd50e27f ("ARM: stm32: Implement board coding on AV96")
Fixes: 92ca0f7446c ("ARM: dts: stm32: Synchronize DDR setttings on DH SoMs")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoARM: stm32: Add missing header for save_boot_params
Marek Vasut [Thu, 4 May 2023 19:52:30 +0000 (21:52 +0200)] 
ARM: stm32: Add missing header for save_boot_params

The get_stm32mp_rom_api_table() function is defined in sys_params.h ,
add the missing header to avoid compiler warning.

Fixes: dbeaca79b79 ("ARM: stm32: Factor out save_boot_params")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoARM: stm32: Fix OF_LIST on DHCOR
Tom Rini [Fri, 5 May 2023 00:11:02 +0000 (20:11 -0400)] 
ARM: stm32: Fix OF_LIST on DHCOR

The ITS file used to build the images here lists three dtb files as
being used. Today, these are built by the logic that will over-build dtb
files based on SOC/etc symbols being set. To future proof this platform
and be generally correct, we list all 3 of the device trees used here in
OF_LIST.

Cc: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoARM: stm32: Add IWDG handling into PSCI suspend code
Marek Vasut [Thu, 11 May 2023 19:55:45 +0000 (21:55 +0200)] 
ARM: stm32: Add IWDG handling into PSCI suspend code

In case the IWDG is enabled by either U-Boot or Linux, the IWDG can never
be disabled again. That includes low power states, which means that if the
IWDG is enabled, the SoC would reset itself after a while in suspend via
the IWDG. This is not desired behavior.

It is possible to enable IWDG pre-timeout IRQ which is routed into the EXTI,
and use that IRQ to wake the CPU up before the IWDG timeout is reached and
reset is triggered. This pre-timeout IRQ can be used to reload the WDT and
then suspend the CPU again every once in a while.

Implement this functionality for both IWDG1 and IWDG2 by reading out all
the unmasked IRQs, comparing the list with currently pending IRQs in GICv3:
- If any IRQ is pending and it is NOT IWDG1 or IWDG2 pre-timeout IRQ,
  wake up and let OS handle the IRQs
- If IWDG1 or IWDG2 IRQ is pending and no other IRQ is pending,
  ping the respective IWDG and suspend again

This does not seem to have any adverse impact on power consumption in suspend.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>