Sumit Garg [Thu, 22 Feb 2024 09:36:04 +0000 (15:06 +0530)]
doc: devicetree: Updates for devicetree-rebasing subtree
Encourage SoC/board maintainers to migrate to using devicetree-rebasing
subtree and maintain a regular sync with Linux kernel devicetree files
and bindings.
Along with that add documentation regarding how to run DT bindings
schema checks.
Sumit Garg [Thu, 22 Feb 2024 09:36:01 +0000 (15:06 +0530)]
dts: Add alternative location for upstream DTB builds
Allow platform owners to mirror devicetree files from devitree-rebasing
directory into dts/upstream/src/$(ARCH) (special case for arm64). Then
build then along with any *-u-boot.dtsi file present in arch/$(ARCH)/dts
directory. Also add a new Makefile for arm64.
This will help easy migration for platforms which currently are compliant
with upstream Linux kernel devicetree files.
Sumit Garg [Thu, 22 Feb 2024 09:36:00 +0000 (15:06 +0530)]
Makefile: Allow upstream DT subtree to provide DT includes
Allow platforms to reuse DT headers and dtsi includes directly form
upstream DT subtree which will be frequently synced with Linux kernel.
This will further allow us to drop corresponding DT includes copy from
U-Boot tree.
Also, since the DT includes from upstream DT subtree are done after DT
includes from U-Boot tree, so it shouldn't cause any conflicts.
Allow u-boot to build DTB from a different directory tree such that
*-u-boot.dtsi files can be included from a common location. Currently
that location is arch/$(ARCH)/dts/, so statically define that common
location.
This is needed for platform owners to start building DTB files from
devicetree-rebasing directory but still being able to include
*-u-boot.dtsi files.
Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Sumit Garg [Thu, 22 Feb 2024 09:35:58 +0000 (15:05 +0530)]
Makefile: Add support for DT bindings schema checks
This adds the build infrastructure for checking DT binding schema
documents and validating dtb files using the binding schema. Here we use
devicetree-rebasing subtree to provide the DT bindings. Along with that
adapt dts/upstream/Bindings/Makefile to align with old U-Boot Kbuild
infrastructure.
Dependency:
-----------
The DT schema project must be installed in order to validate the DT schema
binding documents and validate DTS files using the DT schema. The DT schema
project can be installed with pip::
pip3 install dtschema
Note that 'dtschema' installation requires 'swig' and Python development
files installed first. On Debian/Ubuntu systems::
apt install swig python3-dev
Testing:
--------
Build dts files and check using DT binding schema:
$ make dtbs_check
Optionally, DT_SCHEMA_FILES can be passed in with a schema file(s) to
use for validation. This makes it easier to find and fix errors
generated by a specific schema.
Note, at this point dtbs_check is an optional build target as there are
many warnings generated due to custom DT properties used by many
platforms in u-boot. It is expected with these checks that compliance
with DT bindings to take place. Once that's done it can be added to CI
builds to remain compliant with DT bindings.
Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Tom Rini [Thu, 29 Feb 2024 14:24:49 +0000 (09:24 -0500)]
Merge patch series "Handoff bloblist from previous boot stage"
Raymond Mao <raymond.mao@linaro.org> says:
This patch set adds/adapts a few bloblist APIs and implements Arm arch
custom function to retrieve the bloblist (aka. Transfer List) from
previous loader via boot arguments when BLOBLIST option is enabled and
all boot arguments are compliant to the register conventions defined
in the Firmware Handoff spec v0.9.
If an arch wishes to have different behaviors for loading bloblist
from the previous boot stage, it is required to implement the custom
function xferlist_from_boot_arg().
Raymond Mao [Sat, 3 Feb 2024 16:36:27 +0000 (08:36 -0800)]
dts: OF_HAS_PRIOR_STAGE should depend on !BLOBLIST
When BLOBLIST is enabled, FDT is expected to be from bloblist
carried from previous stage, instead of from OF_BOARD, therefore
only enable OF_HAS_PRIOR_STAGE when BLOBLIST is disabled.
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Raymond Mao [Sat, 3 Feb 2024 16:36:26 +0000 (08:36 -0800)]
bloblist: Load the bloblist from the previous loader
During bloblist initialization, load the bloblist via boot arguments
from the previous loader.
If a valid bloblist exists in boot arguments, relocate it into the
fixed bloblist memory region.
If not, fallback to support BLOBLIST_ADDR or BLOBLIST_ALLOC.
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Raymond Mao [Sat, 3 Feb 2024 16:36:25 +0000 (08:36 -0800)]
arm: Get bloblist from boot arguments
Add arch custom function to get bloblist from boot arguments.
Check whether boot arguments aligns with the register conventions
defined in FW Handoff spec v0.9.
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Raymond Mao [Sat, 3 Feb 2024 16:36:22 +0000 (08:36 -0800)]
bloblist: refactor of bloblist_reloc()
The current bloblist pointer and size can be retrieved from global
data, so we don't need to pass them from the function arguments.
This change also help to remove all external access of gd->bloblist
outside of bloblist module.
Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Raymond Mao [Sat, 3 Feb 2024 16:36:21 +0000 (08:36 -0800)]
bloblist: check bloblist with specified buffer size
Instead of expecting the bloblist total size to be the same as the
pre-allocated buffer size, practically we are more interested in
whether the pre-allocated buffer size is bigger than the bloblist
total size.
Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Raymond Mao [Sat, 3 Feb 2024 16:36:20 +0000 (08:36 -0800)]
bloblist: add API to check the register conventions
Add bloblist_check_reg_conv() to check whether the bloblist is compliant
to the register conventions defined in Firmware Handoff specification.
This API can be used for all Arm platforms.
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Roger Quadros [Wed, 31 Jan 2024 13:33:46 +0000 (15:33 +0200)]
mux: autoprobe if "idle-states" present in device tree
Some platforms need the MUX state to be auto initialized at
boot time even if there are no explicit users for the MUX.
In these cases, the MUX device tree has "idle-states" property
which specifies what state the MUX should be initialized to.
So far we were relying on custom u-boot property "u-boot,mux-autoprobe"
to autoprobe such MUXes. This patch causes the MUX to autoprobe
if it has "idle-states" property in device tree.
This should allow us to stop using the custom "u-boot,mux-autoprobe"
property.
Tom Rini [Wed, 28 Feb 2024 20:09:30 +0000 (15:09 -0500)]
Merge tag 'efi-next-2024-02-28' of https://source.denx.de/u-boot/custodians/u-boot-efi into next
Pull request efi-next-2024-02-28
* set IMAGE_DLLCHARACTERISTICS_NX_COMPAT in EFI binaries
* provide SBI based runtime system reset
* page align EFI binary section on ARMv7
* separate .data and .text sections of EFI binaries on ARMv7
arm: separate .data and .text sections of EFI binaries
EFI binaries should not contain sections that are both writable and
executable. Separate the RX .text section from the RW .data section.
We currently don't created relocation sections (.rel.*) for our EFI
binaries. Anyway these would have to be converted to PE/COFF relocations.
Enumerate them under DISCARD and add a comment.
Correct the characteristics of the sections.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
efi_loader: set IMAGE_DLLCHARACTERISTICS_NX_COMPAT
The IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag marks an EFI binary where
the following conditions are met [1]:
* Executable and writable sections are separated.
* The application does not run self-modifying code.
* The application uses the EFI_MEMORY_ATTRIBUTE_PROTOCOL when loading
executable code.
* The application does not assume that all memory ranges are usable.
* The stack is not expected to be executable.
The only EFI binaries U-Boot provides that do not fulfill these
requirements are the EFI app and the EFI payload.
Once we have implemented separation of writable and executable memory in
U-Boot we can use the IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag to decide
if we will load an EFI binary.
[1] New UEFI CA memory mitigation requirements for signing
https://techcommunity.microsoft.com/t5/hardware-dev-center/new-uefi-ca-memory-mitigation-requirements-for-signing/ba-p/3608714
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tom Rini [Tue, 27 Feb 2024 19:14:15 +0000 (14:14 -0500)]
Merge patch series "kbuild: Allow for CONFIG_SYS_CONFIG_NAME to be unset"
Perform a little re-organization of Kconfig so that we can have
CONFIG_SYS_CONFIG_NAME be unset and so not require a "board.h" file.
Then go and remove a number of now not required header files.
Tom Rini [Mon, 22 Jan 2024 22:39:20 +0000 (17:39 -0500)]
Kconfig: Centralize prompting for SYS_CONFIG_NAME
Generally speaking, we do not prompt for this value and define it in the
board specific Kconfig file. There are some valid use cases however
today where we do prompt for this value, so instead of having this be
done in a number of locations, do this at the top-level location only.
This removes the question from a number of other locations and makes it
consistent that when we do set the value directly, we always do it the
same way. We don't need to specify the type, it's always string.
Tom Rini [Mon, 22 Jan 2024 22:39:19 +0000 (17:39 -0500)]
hc2910-2aghd05: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the hc2910-2aghd05 platform and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:18 +0000 (17:39 -0500)]
slimbootloader: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the slimbootloader platform and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:17 +0000 (17:39 -0500)]
qemu-x86*: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the qemu-x86* platforms and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:16 +0000 (17:39 -0500)]
minnowmax: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the minnowmax platform and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:15 +0000 (17:39 -0500)]
galileo: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the galileo platform and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:14 +0000 (17:39 -0500)]
efi-x86_payload: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the efi-x86_payload* platforms and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:13 +0000 (17:39 -0500)]
efi-x86_app: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the efi-x86_app* platforms and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:12 +0000 (17:39 -0500)]
edison: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the edison platform and remove
the otherwise empty file.
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 22 Jan 2024 22:39:11 +0000 (17:39 -0500)]
crownbay: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the crownbay platform and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:10 +0000 (17:39 -0500)]
cougarcanyon2: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the cougarcanyon2 platform and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:09 +0000 (17:39 -0500)]
cherryhill: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the cherryhill platform and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:08 +0000 (17:39 -0500)]
bayleybay: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the bayleybay platform and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:07 +0000 (17:39 -0500)]
coreboot: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the coreboot platform and remove
the otherwise empty file.
Tom Rini [Mon, 22 Jan 2024 22:39:06 +0000 (17:39 -0500)]
xilinx_mbv: Remove empty config header
Now that we support having CONFIG_SYS_CONFIG_NAME be unset to indicate a
lack of board.h file, unset this on the xilinx_mbv platforms and remove
the otherwise empty file.
Acked-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 22 Jan 2024 22:39:05 +0000 (17:39 -0500)]
kbuild: Allow for CONFIG_SYS_CONFIG_NAME to be unset
It is possible to have a platform which does not require a board.h file
to build, but today we need an empty one for our generated config.h file
to be valid. Allow for omitting this file if CONFIG_SYS_CONFIG_NAME is
not set.
Tom Rini [Sat, 24 Feb 2024 22:51:50 +0000 (17:51 -0500)]
Merge tag 'u-boot-imx-master-20240224' of https://source.denx.de/u-boot/custodians/u-boot-imx
- Enable the thermal driver for the imx8m phycore boards.
- Convert imx53-qsb to watchdog driver to fix the 'reset' command.
- Remove multiline string from imx6dl-sielaff.
- Add SPI boot support for imxrt1050-evk.
- Convert opos6uldev to watchdog driver to fix the 'reset' command.
Jesse Taube [Mon, 19 Feb 2024 23:00:59 +0000 (18:00 -0500)]
imx: imxrt1050-evk: Add support for SPI flash booting
Add support for booting the imxrt1050-evk from spi.
Add imximage config and the ability for SPL to boot from NOR.
Enable binman in Kconfig and device tree for imxrt* as it is used to
prepend fspi_header.bin to SPL and u-boot.img.
Tom Rini [Tue, 20 Feb 2024 22:57:52 +0000 (17:57 -0500)]
Merge patch series "board/ti: k3 boards: Stop using findfdt"
Nishanth Menon <nm@ti.com> says:
This is a wide cleanup to switch to setting fdtfile using env_set
instead of scripted magic. 'fdtfile' is expected to be set by default.
This allows the stdboot triggered efi loaders to find the correct OS
device tree file even if regular boot process is interrupted by user
intervention.
Nishanth Menon [Mon, 12 Feb 2024 19:47:17 +0000 (13:47 -0600)]
board: ti: common: Introduce a common fdt ops library
Introduce a common fdt operations library for basic device tree
operations that are common between various boards.
The first library to introduce here is the capability to set up
fdtfile as a standard variable as part of board identification rather
than depend on scripted ifdeffery.
Reviewed-by: Jonathan Humphreys <j-humphreys@ti.com> Reviewed-by: Roger Quadros <rogerq@kernel.org> Signed-off-by: Nishanth Menon <nm@ti.com>
Nishanth Menon [Mon, 12 Feb 2024 19:47:16 +0000 (13:47 -0600)]
board: ti: Add missing common/Kconfig references
Add missing board/ti/common/Kconfig references for the platforms that
missed it. The intent is for the common Kconfig to be usable across TI
reference boards as required.
Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Nishanth Menon <nm@ti.com>
Shantur Rathore [Wed, 14 Feb 2024 09:54:03 +0000 (09:54 +0000)]
common: usb-hub: Reset USB 3.0 hubs only
Additional testing of the changes introduced in commit 33e06dcbe57a "common:
usb-hub: Reset hub port before scanning") revealed that some USB 2.0 and 3.0
flash drives didn't work in U-Boot on some Allwinner SoCs that support USB
2.0 interfaces only. More precisely, some of the tested USB 2.0 and 3.0
flash drives failed to be detected and work on an OrangePi Zero 3, based on
the Allwinner H616 SoC that supports USB 2.0 only, while the same USB flash
drives worked just fine on a Pine64 H64, based on the Allwinner H6 SoC that
supports both USB 2.0 and USB 3.0 interfaces.
The USB ID of the above-mentioned USB 3.0 flash drive that failed to work is
1f75:0917 (Innostor Technology Corporation IS917 Mass storage), it is 32 GB
in size and sold under the PNY brand. The mentioned USB 2.0 drive is some
inexpensive no-name drive with an invalid USB ID.
Resetting USB 3.0 hubs only, which this patch introduces to the USB hub
resets, has been tested to work as expected, resolving the identified issues
on the Allwinner H616, while not introducing any new issues on other tested
Allwinner SoCs. Thus, let's fix it that way.
According to the USB 3.0 specification, resetting a USB 3.0 port is required
when an attached USB device transitions between different states, such as
when it resumes from suspend. Though, the Linux kernel performs additional
USB 3.0 port resets upon initial USB device attachment, as visible in commit 07194ab7be63 ("USB: Reset USB 3.0 devices on (re)discovery") in the kernel
source, to ensure proper state of the USB 3.0 hub port and proper USB mode
negotiation during the initial USB device attachment and enumeration.
These additional types of USB port resets don't exist for USB 2.0 hubs,
according the USB 2.0 specification. The resets seem to be added to the USB
3.0 specification as part of the port and device mode negotiation.
The Linux kernel resets USB 3.0 (i.e. SuperSpeed) hubs only, as visible in
commit 10d674a82e55 ("USB: When hot reset for USB3 fails, try warm reset.")
in the kernel source. The check for SuperSpeed hubs is performed in a way
that also applies to newer SuperSpeed Plus (USB 3.1 or 3.2) hubs as well,
which hopefully makes it future proof.
Fixes: 33e06dcbe57a ("common: usb-hub: Reset hub port before scanning")
Link:
https://lore.kernel.org/u-boot/20240207102327.35125-1-i@shantur.com/T/#u
Link:
https://lore.kernel.org/u-boot/20240201164604.13315fa6@donnerap.manchester.arm.com/T/#u
Signed-off-by: Shantur Rathore <i@shantur.com> Helped-by: Dragan Simic <dsimic@manjaro.org> Tested-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Dragan Simic <dsimic@manjaro.org> Reviewed-by: Marek Vasut <marex@denx.de>
- Convert msc_sm2s_imx8mp to DM_SERIAL.
- Make Ethernel functional on msc_sm2s_imx8mp.
- General improvements for msc_sm2s_imx8mp.
- Add suport for the Sielaff i.MX6 Solo board.
- Update GE HealthCare maitainers' e-mail addresses.
Marek Vasut [Sun, 11 Feb 2024 17:34:30 +0000 (18:34 +0100)]
ARM: renesas: Enable LTO on R-Car
Enable LTO globally on Renesas R-Car platforms. This has been enabled
on a subset of boards already, but at this point it is safe to enable
it globally. This saves units or tens of kiB from the resulting build.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Marek Vasut [Sun, 11 Feb 2024 17:34:28 +0000 (18:34 +0100)]
ARM: renesas: Disable EFI on R-Car Gen2
These systems are unlikely to use EFI as this functionality has not been
enabled until it got pulled in by Kconfig default. This functionality
does add some 60-70 kiB to the u-boot.img size, which overflows the size
limit. Disable it.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
clk: renesas: Fix broken clocks on all Gen2 boards
To prepare support for multiple register layouts pointers to register
tables where added to struct cpg_mssr_info. These pointers are suppose
to be filled in at probe time and no intended change in behavior was
intended.
However the new pointers where only filled in by some paths of the
driver implemented in clk-rcar-gen3.c. The path implemented in
clk-rcar-gen2.c was not updated leaving the pointers uninitialized
leading to a crash when trying to probe the clocks.
Fix this by filling in the pointers in the Gen2 code path with the
values used before they where moved to struct cpg_mssr_info.
Fixes: d413214fb748 ("clk: renesas: Add register pointers into struct cpg_mssr_info") Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Tested-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # R8A7791 Porter Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
- Fix avb_verify command with SD cards
- Add u-boot-dfu maintainer tree for AB/AVB
- Avb: report verified boot state based on lock state
- Misc avb refactors improve code quality
Igor Opaniuk [Fri, 9 Feb 2024 19:20:44 +0000 (20:20 +0100)]
cmd: avb: rework do_avb_verify_part
Use existing str_avb_slot_error() function for obtaining
verification fail reason details.
Take into account device lock state for setting correct
androidboot.verifiedbootstate kernel cmdline parameter.
Igor Opaniuk [Fri, 9 Feb 2024 19:20:40 +0000 (20:20 +0100)]
avb: move SPDX license identifiers to the first line
Move SPDX license identifiers to the first line, so it conforms
to license placement rule [1]:
Placement:
The SPDX license identifier in kernel files shall be added at the first
possible line in a file which can contain a comment. For the majority
of files this is the first line, except for scripts which require the
'#!PATH_TO_INTERPRETER' in the first line. For those scripts the SPDX
identifier goes into the second line.