efi_memory: avoid possible null pointer dereference
Populate the previous memory descriptor node pointer only after it's
parent struct has been initialised. The compiler fixes this logic to
do the right thing, but it is better to have correct code in place.
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Ilias Apalodimas [Thu, 20 Jun 2024 20:15:31 +0000 (23:15 +0300)]
efi_loader: adjust config options for capsule updates
EFI_IGNORE_OSINDICATIONS is used to ignore OsIndications if setvariable
at runtime is not supported and allow the platform to perform capsule
updates on disk. With the recent changes boards can conditionally enable
setvariable at runtime using EFI_RT_VOLATILE_STORE.
Let's make that visible in our Kconfigs and enable EFI_IGNORE_OSINDICATIONS
when set variable at runtime is disabled.
Since EFI_RT_VOLATILE_STORE needs help from the OS to persist the
variables, allow users to ignore OsIndications even if setvariable at
runtime is enabled.
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
v2 changes:
* Drop sw_blink_state structure, move its necessary fields to
led_uc_plat structure.
* Add cyclic_info pointer to led_uc_plat structure. This
simplify code a lot.
* Remove cyclic function search logic. Not needed anymore.
* Fix blinking period. It was twice large.
* Other cleanups.
v3 changes:
* Adapt code to recent cyclic function changes
* Move software blinking functions to separate file
* Other small changes
v4 changes:
* Refactoring of led_set_period() function
v5 changes
* Fix compilation if CONFIG_LED_BLINK is not defined
v6 changes:
* Enable LEDST_BLINK state unconditionally.
* Function led_set_period() becomes available when CONFIG_LED_BLINK
is disabled. This makes led code simpler.
* Software blinking requires about 100 bytes of data for a led. It's
not a good idea to allocate so much memory for each supported led.
Change the code to allocate blinking data only for required leds.
If hardware (or driver) doesn't support leds blinking, it's
now possible to use software implementation of blinking instead.
This relies on cyclic functions.
Signed-off-by: Michael Polyntsov <michael.polyntsov@iopsys.eu> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Simon Glass <sjg@chromium.org>
Changes:
* enable LEDST_BLINK state unconditionally
* function led_set_period() becomes available when CONFIG_LED_BLINK
is disabled. This makes led code simpler.
* fix cmd/led.c to work properly when LEDST_BLINK present, but
CONFIG_LED_BLINK is disabled
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sat, 20 Jul 2024 10:49:48 +0000 (11:49 +0100)]
binman: fit: Allow running fdtgrep on devicetree blobs
When using FIT to load firmware builds for multiple models, the FIT must
include a common binary along with a number of devicetree blobs, one for
each model. This is the same mechanism as is used for loading an OS.
However, SPL builds do not normally use the full devicetree, but instead
a cut-down version which various nodes and properties removed.
Add a new fit,fdt-phase property to allow binman to produce these
devicetree blobs.
Simon Glass [Sat, 20 Jul 2024 10:49:45 +0000 (11:49 +0100)]
binman: Add support for alternative FDTs
FIT provides a way to select between different devicetree blobs
depending on the model. This works fine for U-Boot proper and allows SPL
to select the correct blob for the current board at runtime. The boot
sequence (SPL->U-Boot proper) is therefore covered by the existing
feature set.
The first boot phase (typically TPL) cannot use FIT since SoC boot ROMs
don't currently support it. Therefore the TPL image must be specific to
each model it boots on.
To support booting on mulitple models, binman must therefore produce a
separate TPL image for each model, even if the images for the rest of
the phases are identical.
TPL needs to be packaged as an executable binary along with a reduced
devicetree. When multiple models are supported, a reduced devicetree
must be provided for each model.
U-Boot's build system is designed to build a single devicetree for SPL
builds, so does not support this requirement.
Add a new 'alternatives' feature to Binman, allowing it to automatically
subset a devicetree to produce the reduced devicetree for a particular
phase for each supported model. With this it is possible to produce a
separate TPL image for each of the models. The correct one can then be
loaded onto a board, along with the common FIT image(s).
Simon Glass [Sat, 20 Jul 2024 10:49:37 +0000 (11:49 +0100)]
binman: Write the compressed output to a file
When an entry is compressed, write the compressed contents to a file so
that it is possible to see what was produced. This aids debugging with
new images.
Simon Glass [Thu, 18 Jul 2024 09:11:24 +0000 (10:11 +0100)]
qconfig: Sort the boards by name when finding
There is no particular ordering of the board list at present, since it
is generated by a multi-threaded process. Sort them by name to make it
easier to see if a particular board is present.
Simon Glass [Thu, 11 Jul 2024 08:10:04 +0000 (09:10 +0100)]
buildman: Show board list with -x
When -x is used, buildman does not show the list of boards that will be
built, since there are no terms which cause boards to be added, only
terms which cause them to be removed.
Add a special case to fix this.
Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com>
Andrew Goodbody [Tue, 2 Jul 2024 17:00:09 +0000 (18:00 +0100)]
sandbox: Fix LTO to work with STACKPROTECTOR
Add the STACKPROTECTOR symbols to the script that generates the
symbols that should not be removed by the use of LTO when linking
a shared object. This prevents a fail to build due to link errors.
https://source.denx.de/u-boot/u-boot/-/issues/35
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Installing patman with `cd ./tools/patman && pip install -e .` fails
with the error below.
As described in the error output below, the license line is not allowed
to be only defined in the setup.py. We remove the 'license' field
entirely, as the Python Packaging User Guide recommends using projects
classifiers instead[1] and we already set the GPL-2.0+ classifier.
> $ cd ./tools/patman && pip install -e .
> Obtaining file:///.../u-boot/tools/patman
> Installing build dependencies ... done
> Checking if build backend supports build_editable ... done
> Getting requirements to build editable ... error
> error: subprocess-exited-with-error
>
> × Getting requirements to build editable did not run successfully.
> │ exit code: 1
> ╰─> [61 lines of output]
> /tmp/pip-build-env-mqjvnmz8/overlay/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:76:
> _MissingDynamic: `license` defined outside of `pyproject.toml` is ignored.
> !!
>
> ********************************************************************************
> The following seems to be defined outside of `pyproject.toml`:
>
> `license = 'GPL-2.0+'`
>
> According to the spec (see the link below), however, setuptools CANNOT
> consider this value unless `license` is listed as `dynamic`.
>
> https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table
>
> To prevent this problem, you can list `license` under `dynamic` or alternatively
> remove the `[project]` table from your file and rely entirely on other means of
> configuration.
> ********************************************************************************
>
> !!
Tom Rini [Fri, 26 Jul 2024 00:04:16 +0000 (18:04 -0600)]
Merge branch 'qcom-main' of https://gitlab.denx.de/u-boot/custodians/u-boot-snapdragon
* Qualcomm platforms >~2016 gain support for the RPMh (Resource Power Manager)
peripheral which is used to control most regulators. The RB5 is now able to
power up its USB VBUS regulator via the rpmh regulator driver. Git history
from the original Linux driver is preserved for ease of maintenance.
* IPQ40xx SoCs gain ethernet networking support via the new ESS EDMA driver.
Robert Marko [Mon, 3 Jun 2024 12:06:13 +0000 (14:06 +0200)]
dt-bindings: clock: qcom: ipq4019: drop downstream file
IPQ4019 clock dt-bindings are available in Linux upstream, and we can just
use those instead of carrying a downstream file that matches the upstream one
anyway.
Signed-off-by: Robert Marko <robert.marko@sartura.hr> Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
power: regulator: qcom-rpmh-regulator: port ops to U-Boot
Port over the regulator ops to U-Boot's regulator API. Add back the
pmic5 mode map using U-Boot dm_regulator_mode API and adjust the
pmic5_pldo and pmic5_pldo_lv definitions. No functional changes.
A lot of the features in here are only relevant when running
multi-threaded with interrupts. Drop everything except what we need to
run single-threaded with a single TCS (which is all the rpmh-rsc
framework in U-Boot supports).
Keep rpmh_write_async() for simplicity and make it wrap the regular
rpmh_write().