]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
11 months agoboard: ti: j721e: Drop SERDES PHY init from board file
Roger Quadros [Fri, 12 Jan 2024 12:49:47 +0000 (14:49 +0200)]
board: ti: j721e: Drop SERDES PHY init from board file

Since commit 69b19ca67bcb ("arm: dts: k3-j721e: Sync with v6.6-rc1"),
the following error message is seen at u-boot
"Sierra init failed:-19"

Probing and initializing the SERDES PHY from
board file is not a clean solution so drop it.

Proper use case should be via PHY_UCLASS APIs.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
11 months agoMerge tag 'dm-next-7jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm...
Tom Rini [Mon, 8 Jan 2024 14:11:53 +0000 (09:11 -0500)]
Merge tag 'dm-next-7jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm into next

switch to SMBIOS3 tables
allow devicetree from bloblist
ACPI support for ARM and RISC-V

11 months agoarm: enable support for QEMU firmware tables
Heinrich Schuchardt [Tue, 19 Dec 2023 15:04:08 +0000 (16:04 +0100)]
arm: enable support for QEMU firmware tables

Enable the QEMU firmware interface if ACPI tables are to be supported on
the QEMU platform.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoconfigs: qemu: add config fragment for ACPI
Heinrich Schuchardt [Tue, 19 Dec 2023 15:04:07 +0000 (16:04 +0100)]
configs: qemu: add config fragment for ACPI

Provide a configuration fragment to enable ACPI on QEMU.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agoriscv: allow usage of ACPI
Heinrich Schuchardt [Tue, 19 Dec 2023 15:04:06 +0000 (16:04 +0100)]
riscv: allow usage of ACPI

Select CONFIG_SUPPORT_ACPI to allow usage of ACPI tables with RISC-V.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agoriscv: add support for QEMU firmware tables
Heinrich Schuchardt [Tue, 19 Dec 2023 15:04:05 +0000 (16:04 +0100)]
riscv: add support for QEMU firmware tables

Enable the QEMU firmware interface if ACPI tables are to be supported on
the QEMU platform.

Enable the QFW MMIO interface if the QEMU firmware interface is enabled.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoacpi: enable writing ACPI tables on QEMU
Heinrich Schuchardt [Tue, 19 Dec 2023 15:04:04 +0000 (16:04 +0100)]
acpi: enable writing ACPI tables on QEMU

Invoke write_acpi_tables() via EVT_LAST_STAGE_INIT on QEMU except on X86.
X86 calls write_acpi_tables() in write_tables().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agoriscv: add ACPI fields to global data
Heinrich Schuchardt [Tue, 19 Dec 2023 15:04:03 +0000 (16:04 +0100)]
riscv: add ACPI fields to global data

Add fields for the location of ACPI tables to the global data.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
11 months agoarm: add ACPI fields to global data
Heinrich Schuchardt [Tue, 19 Dec 2023 15:04:02 +0000 (16:04 +0100)]
arm: add ACPI fields to global data

Add fields for the location of ACPI tables to the global data.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agoacpi: carve out qfw_acpi.c
Heinrich Schuchardt [Tue, 19 Dec 2023 15:04:01 +0000 (16:04 +0100)]
acpi: carve out qfw_acpi.c

Move the code related to copying tables from QEMU to a separate code
module.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoacpi: Kconfig symbol CONFIG_QFW_ACPI
Heinrich Schuchardt [Tue, 19 Dec 2023 15:04:00 +0000 (16:04 +0100)]
acpi: Kconfig symbol CONFIG_QFW_ACPI

We have two implementations of write_acpi_tables(). One for writing ACPI
tables based on ACPI_WRITER() entries another based on copying tables from
QEMU.

Create a symbol CONFIG_QFW_ACPI that signifies copying ACPI tables from
QEMU and use it consistently.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agoacpi: support 64bit in acpi_find_table for DSDT and FACS
Heinrich Schuchardt [Sat, 16 Dec 2023 08:12:00 +0000 (09:12 +0100)]
acpi: support 64bit in acpi_find_table for DSDT and FACS

Use X_DSDT and X_FIRMWARE_CTRL if available.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Rebased on -next to use nomap:
Signed-off-by: Simon Glass <sjg@chromium.org>
11 months agocmd: acpi: check HW reduced flag in acpi list
Heinrich Schuchardt [Sat, 16 Dec 2023 08:11:59 +0000 (09:11 +0100)]
cmd: acpi: check HW reduced flag in acpi list

On non x86 platforms the hardware reduce flag must be set in the FADT
table. Write an error message if the flag is missing.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Rebased on -next to use nomap, add hyphens:
Signed-off-by: Simon Glass <sjg@chromium.org>
11 months agocmd: acpi: fix listing DSDT and FACS
Heinrich Schuchardt [Sat, 16 Dec 2023 08:11:58 +0000 (09:11 +0100)]
cmd: acpi: fix listing DSDT and FACS

If field X_FIRMWARE_CTRL is filled, field FIRMWARE must be ignored. If
field X_DSDT is filled, field DSDT must be ignored.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Rebased on -next to use nomap:
Signed-off-by: Simon Glass <sjg@chromium.org>
11 months agoacpi: use 64-bit addresses in FADT table
Heinrich Schuchardt [Sat, 16 Dec 2023 08:11:57 +0000 (09:11 +0100)]
acpi: use 64-bit addresses in FADT table

Fields X_FIRMWAE_CTRL and X_DSDT must be 64bit wide. Convert pointers to
to uintptr_t to fill these.

If field X_FIRMWARE_CTRL is filled, field FIRMWARE must be ignored. If
field X_DSDT is filled, field DSDT must be ignored. We should not fill
unused fields.

See the field definitions in chapter "5.2.9 Fixed ACPI Description Table
(FADT)" of the ACPI Specification 6.5.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agofdt: Allow the devicetree to come from a bloblist
Simon Glass [Thu, 4 Jan 2024 01:49:19 +0000 (18:49 -0700)]
fdt: Allow the devicetree to come from a bloblist

Standard passage provides for a bloblist to be passed from one firmware
phase to the next. That can be used to pass the devicetree along as well.
Add an option to support this.

Tests for this will be added as part of the Universal Payload work.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoefi: Correct smbios-table installation
Simon Glass [Sun, 31 Dec 2023 15:25:55 +0000 (08:25 -0700)]
efi: Correct smbios-table installation

At present this code allocates memory when writing the tables and
then unnecessarily adds another memory map when installing it.

Adjust the code to allocate the tables using the normal U-Boot
mechanism. This avoids doing an EFI memory allocation early in
U-Boot, which may use memory that would be overwritten by a
'load' command, for example.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 months agoacpi: Write pointers to tables instead of addresses
Simon Glass [Sun, 31 Dec 2023 15:25:54 +0000 (08:25 -0700)]
acpi: Write pointers to tables instead of addresses

Sandbox uses an API to map between addresses and pointers. This allows
it to have (emulated) memory at zero and avoid arch-specific addressing
details. It also allows memory-mapped peripherals to work.

As an example, on many machines sandbox maps address 100 to pointer
value 10000000.

However this is not correct for ACPI, if sandbox starts another program
(e.g EFI app) and passes it the tables. That app has no knowledge of
sandbox's address mapping. So to make this work we want to store
10000000 as the value in the table.

Add two new 'nomap' functions which clearly make this exeption to how
sandbox works.

This should allow EFI apps to access ACPI tables with sandbox, e.g. for
testing purposes.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
11 months agoacpi: Rename test dm_test_setup_ctx_and_base_tables()
Simon Glass [Sun, 31 Dec 2023 15:25:53 +0000 (08:25 -0700)]
acpi: Rename test dm_test_setup_ctx_and_base_tables()

Use the word 'acpi' in this test so that it runs along with all the
other ACPI tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
11 months agoefi: smbios: Drop support for SMBIOS2 tables
Simon Glass [Sun, 31 Dec 2023 15:25:52 +0000 (08:25 -0700)]
efi: smbios: Drop support for SMBIOS2 tables

Only the v3 table is supported now, so always use this when installing
the EFI table.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
11 months agosmbios: Drop support for SMBIOS2 tables
Simon Glass [Sun, 31 Dec 2023 15:25:51 +0000 (08:25 -0700)]
smbios: Drop support for SMBIOS2 tables

These tables are a pain since there is no way to handle memory above
4GB. Use SMBIOS3 always.

This should hopefully not create problems on x86 devices, since SMBIOS3
was released seven years ago (2015).

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
11 months agosmbios: Require the caller to align the SMBIOS table
Simon Glass [Sun, 31 Dec 2023 15:25:50 +0000 (08:25 -0700)]
smbios: Require the caller to align the SMBIOS table

All callers handle this alignment, so drop the unnecessary code. This
simplifies things a little.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoefi: Use the correct GUID for the SMBIOS table
Simon Glass [Sun, 31 Dec 2023 15:25:49 +0000 (08:25 -0700)]
efi: Use the correct GUID for the SMBIOS table

EFI does not use the 'anchor string' to determine the SMBIOS table
version, instead preferring to have two separate GUIDs. Use the correct
one, depending on the table version.

Call unmap_system() to balance to the use of map_sysmem()

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agosmbios: Correct gd_smbios_start()
Simon Glass [Sun, 31 Dec 2023 15:25:48 +0000 (08:25 -0700)]
smbios: Correct gd_smbios_start()

This should access arch-specific properties. Fix it and update the
existing usage.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agosmbios: Use SMBIOS 3.0 to support an address above 4GB
Simon Glass [Sun, 31 Dec 2023 15:25:47 +0000 (08:25 -0700)]
smbios: Use SMBIOS 3.0 to support an address above 4GB

When the SMBIOS table is written to an address above 4GB a 32-bit table
address is not large enough.

Use an SMBIOS3 table in that case.

Note that we cannot use efi_allocate_pages() since this function has
nothing to do with EFI. There is no equivalent function to allocate
memory below 4GB in U-Boot. One solution would be to create a separate
malloc() pool, or just always put the malloc() pool below 4GB.

- Use log_debug() for warning
- Rebase on Heinrich's smbios.h patch
- Set the checksum for SMBIOS3

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
11 months agosmbios: SMBIOS 3.0 (64-bit) Entry Point structure
Heinrich Schuchardt [Sun, 31 Dec 2023 15:25:46 +0000 (08:25 -0700)]
smbios: SMBIOS 3.0 (64-bit) Entry Point structure

Add definition of the SMBIOS 3.0 (64-bit) Entry Point structure.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
11 months agosmbios: Move the rest of the SMBIOS2 code
Simon Glass [Sun, 31 Dec 2023 15:25:45 +0000 (08:25 -0700)]
smbios: Move the rest of the SMBIOS2 code

Move all of this logic into the else clause, since it will not be used
for SMBIOS3

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agosmbios: Refactor 32-bit code into an else statement
Simon Glass [Sun, 31 Dec 2023 15:25:44 +0000 (08:25 -0700)]
smbios: Refactor 32-bit code into an else statement

In preparation for adding support for SMBIOS3 move this code into an
else statement. There is no functional change.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoMerge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into...
Tom Rini [Sat, 6 Jan 2024 14:57:56 +0000 (09:57 -0500)]
Merge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next

Documentation updates for endeavoru, lg_x3, grouper and transformers,
addition of MIPI calibration clock name for T114 (inline with T124+),
conversion of TEGRA_SUPPORT_NON_SECURE into Kconfig and endeavoru
stability improvements.

11 months agoMerge branch '2024-01-05-fw_env-fixes' into next
Tom Rini [Sat, 6 Jan 2024 14:57:30 +0000 (09:57 -0500)]
Merge branch '2024-01-05-fw_env-fixes' into next

- A few fw_env fixes

11 months agofw_env: autodetect NAND erase size and env sectors
Anthony Loiseau [Thu, 21 Dec 2023 22:44:38 +0000 (23:44 +0100)]
fw_env: autodetect NAND erase size and env sectors

As already done for NOR chips, if device ESIZE and ENVSECTORS static
configurations are both zero, then autodetect them at runtime.

Cc: Joe Hershberger <joe.hershberger@ni.com>
cc: Stefan Agner <stefan@agner.ch>
cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Anthony Loiseau <anthony.loiseau@allcircuits.com>
11 months agofw_env: keep calling read() until whole flash block is read
Rafał Miłecki [Wed, 13 Dec 2023 12:13:54 +0000 (13:13 +0100)]
fw_env: keep calling read() until whole flash block is read

It's totally valid for read() to provide less bytes than requested
maximum. It may happen if there is no more data available yet or source
pushes data in small chunks.

This actually happens when trying to read env data from NVMEM device.
Kernel may provide NVMEM content in page size parts (like 4096 B).

This fixes warnings like:
Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 16384 bytes but got 4096
Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 12288 bytes but got 4096
Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 8192 bytes but got 4096

Since the main loop in flash_read_buf() is used to read blocks this
patch adds a new nested one.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
11 months agofw_env: rename variables holding env data content
Rafał Miłecki [Wed, 13 Dec 2023 09:23:44 +0000 (10:23 +0100)]
fw_env: rename variables holding env data content

Rename "addr0" and "addr1" to "buf0" and "buf1" accordingly. Name "addr"
suggests that variable contains a numeric value being some kind of
address. Name "buf" is de facto a standard name for pointer to allocated
memory for reading data to.

While at it drop redundant checks for NULL before calling free().

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
11 months agofw_env: fix reading NVMEM device's "compatible" value
Rafał Miłecki [Tue, 12 Dec 2023 17:33:27 +0000 (18:33 +0100)]
fw_env: fix reading NVMEM device's "compatible" value

Call to fread() was changed to check for return value. The problem is it
can't be checked for returning 1 (as it is) to determine success.

We call fread() with buffer size as "size" argument. Reading any
"compatible" value shorter than buffer size will result in returning 0
even on success.

Modify code to use fstat() to determine expected read length.

This fixes regression that broke using fw_env with NVMEM devices.

Fixes: c059a22b7776 ("tools: env: fw_env: Fix unused-result warning")
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
11 months agoboard: htc: endeavoru: add an early SPL RCM hook
Svyatoslav Ryhel [Fri, 5 Jan 2024 15:35:26 +0000 (17:35 +0200)]
board: htc: endeavoru: add an early SPL RCM hook

Unlike all other supported Tegra devices and most known Tegra devices, the
HTC One X has no hardware way to enter APX/RCM mode, which may lead to a
dangerous situation when, if BCT is set correctly and the bootloader is
faulty, the device will hang in a permanent brick state. Exiting from this
state can be done only by disassembling the device and shortening the
testpad to the ground.

To prevent this or to minimize the probability of such an accident, it was
proposed to add the RCM rebooting hook as early into SPL as possible since
SPL is much more robust and has minimal changes that can break bootflow.

gpio_early_init_uart() function was chosen as it is the earliest function
exposed for setup by the device. Hook performs a check for volume up button
state and triggers RCM if it is pressed.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
11 months agoMerge patch series "ATF and OP-TEE Firewalling for K3 devices."
Tom Rini [Thu, 4 Jan 2024 21:53:49 +0000 (16:53 -0500)]
Merge patch series "ATF and OP-TEE Firewalling for K3 devices."

Manorit Chawdhry <m-chawdhry@ti.com> says:

K3 devices have firewalls that are used to prevent illegal accesses to
memory regions that are deemed secure. The series prevents the illegal
accesses to ATF and OP-TEE regions that are present in different K3
devices.

AM62X, AM62AX and AM64X are currently in hold due to some firewall
configurations that our System Controller (TIFS) needs to handle.
The devices that are not configured with the firewalling nodes will not
be affected and can continue to work fine until the firewall nodes are
added so will be a non-blocking merge.

Test Logs: https://gist.github.com/manorit2001/4cead2fb3a19eb5d19005b3f54682627
CICD Run: https://github.com/u-boot/u-boot/pull/442

11 months agodocs: board: ti: k3: Add secure booting documentation
Manorit Chawdhry [Fri, 29 Dec 2023 10:46:33 +0000 (16:16 +0530)]
docs: board: ti: k3: Add secure booting documentation

This commit adds a general flow to explain the usage of firewalls and
the chain of trust in K3 devices.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
11 months agodocs: board: ti: k3: Cleanup FIT signature documentation
Manorit Chawdhry [Fri, 29 Dec 2023 10:46:32 +0000 (16:16 +0530)]
docs: board: ti: k3: Cleanup FIT signature documentation

The previous documentation had been very crude so refactor it to make it
cleaner and concise.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
11 months agoarm: dts: k3-j7200-binman: Add firewall configurations
Manorit Chawdhry [Fri, 29 Dec 2023 10:46:31 +0000 (16:16 +0530)]
arm: dts: k3-j7200-binman: Add firewall configurations

The following commits adds the configuration of firewalls required to
protect ATF and OP-TEE memory region from non-secure reads and
writes using master and slave firewalls present in our K3 SOCs.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Tested-by: Thomas Richard <thomas.richard@bootlin.com>
11 months agoarm: dts: k3-j721s2-binman: Add firewall configurations
Manorit Chawdhry [Fri, 29 Dec 2023 10:46:30 +0000 (16:16 +0530)]
arm: dts: k3-j721s2-binman: Add firewall configurations

The following commits adds the configuration of firewalls required to
protect ATF and OP-TEE memory region from non-secure reads and
writes using master and slave firewalls present in our K3 SOCs.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
11 months agoarm: dts: k3-j721e-binman: Add firewall configurations
Manorit Chawdhry [Fri, 29 Dec 2023 10:46:29 +0000 (16:16 +0530)]
arm: dts: k3-j721e-binman: Add firewall configurations

The following commits adds the configuration of firewalls required to
protect ATF and OP-TEE memory region from non-secure reads and
writes using master and slave firewalls present in our K3 SOCs.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
11 months agoarm: dts: k3-binman: Add k3-security.h and include it in k3-binman.dtsi
Manorit Chawdhry [Fri, 29 Dec 2023 10:46:28 +0000 (16:16 +0530)]
arm: dts: k3-binman: Add k3-security.h and include it in k3-binman.dtsi

For readability during configuring firewalls, adding k3-security.h file
and including it in k3-binman.dtsi to be accessible across K3 SoCs

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
11 months agobinman: ftest: Add test for ti-secure firewall node
Manorit Chawdhry [Fri, 29 Dec 2023 10:46:27 +0000 (16:16 +0530)]
binman: ftest: Add test for ti-secure firewall node

Add test for TI firewalling node in ti-secure.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
11 months agobinman: ti-secure: Add support for firewalling entities
Manorit Chawdhry [Fri, 29 Dec 2023 10:46:26 +0000 (16:16 +0530)]
binman: ti-secure: Add support for firewalling entities

We can now firewall entities while loading them through our secure
entity TIFS, the required information should be present in the
certificate that is being parsed by TIFS.

The following commit adds the support to enable the certificates to be
generated if the firewall configurations are present in the binman dtsi
nodes.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
11 months agodtoc: Change dst to self in debug message
Manorit Chawdhry [Fri, 29 Dec 2023 10:46:25 +0000 (16:16 +0530)]
dtoc: Change dst to self in debug message

Fix the error message to not use dst and use self as it is copying the
properties to self.

While using templating if there are no subnodes defined, we end up in
this situation where "dst" isn't defined and it tries to print the error
message and fails.

'UnboundLocalError: local variable 'dst' referenced before assignment'

Fixes: 55e1278d5eca ("dtoc: Allow inserting a list of nodes into another")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agoARM: tegra114: support nonsecure state detection
Svyatoslav Ryhel [Mon, 11 Dec 2023 09:37:07 +0000 (11:37 +0200)]
ARM: tegra114: support nonsecure state detection

Principle is exactly the same as on T124, testing of register
which behaves differently in secure and non-secure states.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
11 months agoARM: tegra114: expand MC register map
Svyatoslav Ryhel [Mon, 11 Dec 2023 09:10:23 +0000 (11:10 +0200)]
ARM: tegra114: expand MC register map

This expansion is required for nonsecure detection to work correctly.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
11 months agoARM: tegra124: convert TEGRA_SUPPORT_NON_SECURE into Kconfig
Svyatoslav Ryhel [Mon, 11 Dec 2023 09:29:40 +0000 (11:29 +0200)]
ARM: tegra124: convert TEGRA_SUPPORT_NON_SECURE into Kconfig

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
11 months agoconfigs: Resync with savedefconfig
Tom Rini [Wed, 3 Jan 2024 14:26:16 +0000 (09:26 -0500)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoMerge tag 'v2024.01-rc6' into next
Tom Rini [Wed, 3 Jan 2024 14:22:47 +0000 (09:22 -0500)]
Merge tag 'v2024.01-rc6' into next

Prepare v2024.01-rc6

11 months agoPrepare v2024.01-rc6
Tom Rini [Wed, 3 Jan 2024 14:11:33 +0000 (09:11 -0500)]
Prepare v2024.01-rc6

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoconfigs: Resync with savedefconfig
Tom Rini [Wed, 3 Jan 2024 14:09:56 +0000 (09:09 -0500)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoarm: dts: k3-am62a*: Sync with kernel v6.7-rc1
Nishanth Menon [Mon, 13 Nov 2023 14:51:43 +0000 (08:51 -0600)]
arm: dts: k3-am62a*: Sync with kernel v6.7-rc1

Sync with kernel v6.7-rc1 and sync up the u-boot dts files accordingly.

Signed-off-by: Nishanth Menon <nm@ti.com>
11 months agoarm: mach-k3: am62a: Add main_timer0 id to the dev list
Nishanth Menon [Mon, 13 Nov 2023 14:51:42 +0000 (08:51 -0600)]
arm: mach-k3: am62a: Add main_timer0 id to the dev list

main_timer0 is used by u-boot as the tick-timer. Add it to the soc
devices list so it an be enabled via the k3 power controller.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
11 months agoMerge patch series "sync am65x device tree with Linux v6.7-rc1"
Tom Rini [Wed, 3 Jan 2024 13:38:40 +0000 (08:38 -0500)]
Merge patch series "sync am65x device tree with Linux v6.7-rc1"

Bryan Brattlof <bb@ti.com> says:

Hello Again Everyone!

This series gets the am65x booting again along with syncing the device
tree files with v6.7-rc1 Linux.

The bulk of these patches unify the WKUP SPL board file with the arm64
files to make future syncs from Linux much easier. In the end the DTBs
should look a lot like what the DTBs look like for the am64x which
is fairly similar to the am65x.

For those interested in what UART boot looks like:
   https://paste.sr.ht/~bryanb/7df8a645dc548912cd806abd5ecab967ef3287bc

11 months agoarm: dts: k3-am654: convert bootph-pre-ram to bootph-all
Bryan Brattlof [Fri, 29 Dec 2023 17:47:23 +0000 (11:47 -0600)]
arm: dts: k3-am654: convert bootph-pre-ram to bootph-all

Many nodes are reused between WKUP SPL, MAIN SPL, and U-Boot. Using
bootph-pre-ram is causing these nodes to be present in SPL builds but
pruned away during the U-Boot build. Convert these nodes to bootph-all
so they will remain no matter which dtb build is happening.

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate mcu secure proxy node
Bryan Brattlof [Fri, 29 Dec 2023 17:47:22 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate mcu secure proxy node

With the Linux and U-Boot board dtb files unified, we now have a
duplicate mcu secure proxy node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: move dummy_clock to root node
Bryan Brattlof [Fri, 29 Dec 2023 17:47:21 +0000 (11:47 -0600)]
arm: dts: k3-am654: move dummy_clock to root node

The dummy_clock node is used to help the drivers probe the IO needed to
setup consoles and boot media to load firmware into the SoC.

This dummy_clock isn't a device that exists nor does it exist in the
mcu domain. So move it from cbass_mcu to the root node to avoid any
confusion.

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove un-needed aliases
Bryan Brattlof [Fri, 29 Dec 2023 17:47:20 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove un-needed aliases

These aliases are not needed in U-Boot. Remove them

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate root properties
Bryan Brattlof [Fri, 29 Dec 2023 17:47:19 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate root properties

With the Linux and U-Boot board dtb files unified, we have duplicate
properties in the root node. Remove them

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate vtt pinmux
Bryan Brattlof [Fri, 29 Dec 2023 17:47:18 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate vtt pinmux

With the Linux and U-Boot board dtb files unified, we now have a
duplicate vtt_pinmux node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate mdio
Bryan Brattlof [Fri, 29 Dec 2023 17:47:17 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate mdio

With the Linux and U-Boot board dtb files unified, we now have a
duplicate mdio node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove usb0
Bryan Brattlof [Fri, 29 Dec 2023 17:47:16 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove usb0

The pinmux for usb0 is missing from the Linux board dtb file. Remove it
until we can introduce it in Linux

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate ospi0 node
Bryan Brattlof [Fri, 29 Dec 2023 17:47:15 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate ospi0 node

With the Linux and U-Boot board dtb files unified, we now have a
duplicate ospi0 node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate wkup_i2c0
Bryan Brattlof [Fri, 29 Dec 2023 17:47:14 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate wkup_i2c0

With the Linux and U-Boot board dtb files unified, we now have a
duplicate wkup_i2c0 node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate sdhci1 pinmux node
Bryan Brattlof [Fri, 29 Dec 2023 17:47:13 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate sdhci1 pinmux node

With the Linux and U-Boot board dtb files unified, we now have a
duplicate sdhci1 pinmux node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate sdhci0 pinmux node
Bryan Brattlof [Fri, 29 Dec 2023 17:47:12 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate sdhci0 pinmux node

With the Linux and U-Boot board dtb files unified, we now have
a duplicate sdhci0 pinmux node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate main_uart0
Bryan Brattlof [Fri, 29 Dec 2023 17:47:11 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate main_uart0

With the Linux and U-Boot board dtb files unified, we now have a
duplicate main_uart0 node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate mcu_uart0 node
Bryan Brattlof [Fri, 29 Dec 2023 17:47:10 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate mcu_uart0 node

With the Linux and U-Boot board dtb files unified we now have a
duplicate mcu_uart0 node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: add needed regs to udmap nodes
Bryan Brattlof [Fri, 29 Dec 2023 17:47:09 +0000 (11:47 -0600)]
arm: dts: k3-am654: add needed regs to udmap nodes

Ethernet is one of a few IPs in U-Boot that depend on DMA to operate.
However there are a few missing registers ranges in the udmap nodes
need to properly setup DMA for the am65x.

A fix has been added to the Linux kernel[0] to add these ranges however
they have not made it to a Linux tag. To keep DMA operational until the
next DT sync from Linux, add these ranges to the *-u-boot.dtsi with a
note for our future selves.

[0] https://lore.kernel.org/r/20231213135138.929517-2-vigneshr@ti.com

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate mcu_udmap
Bryan Brattlof [Fri, 29 Dec 2023 17:47:08 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate mcu_udmap

With the Linux and U-Boot board dtb files unified, we now have a
duplicate mcu_udmap node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate mcu_ringacc
Bryan Brattlof [Fri, 29 Dec 2023 17:47:07 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate mcu_ringacc

With the Linux and U-Boot board dtb files unified, we now have a
duplicate mcu_ringacc node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate timer
Bryan Brattlof [Fri, 29 Dec 2023 17:47:06 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate timer

timer1 is really just the mcu_timer0 node redefined for the WKUP SPL.
Remove the timer1 and replace it with the mcu_timer0 from the Linux
device tree we imported into U-Boot.

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate wkup_uart0
Bryan Brattlof [Fri, 29 Dec 2023 17:47:05 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate wkup_uart0

With the Linux and U-Boot board files unified, we now have a duplicate
wkup_uart0 node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: remove duplicate vtt_supply
Bryan Brattlof [Fri, 29 Dec 2023 17:47:04 +0000 (11:47 -0600)]
arm: dts: k3-am654: remove duplicate vtt_supply

With the Linux and U-Boot board dtb files unified we now have a
duplicate vtt_supply node. Remove it

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: include a53 board dtb for r5 build
Bryan Brattlof [Fri, 29 Dec 2023 17:47:03 +0000 (11:47 -0600)]
arm: dts: k3-am654: include a53 board dtb for r5 build

To make things as organized as possible, start from the Linux board dtbs
and apply all properties needed for U-Boot in our *-u-boot.dtsi file for
the MAIN SPL and U-Boot builds.

We can then include these files for the WKUP SPL build making further
edits to the needed properties and nodes for the WKUP SPL bootloader's
view of the am65x.

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: copy bootph properties to a53 dts
Bryan Brattlof [Fri, 29 Dec 2023 17:47:02 +0000 (11:47 -0600)]
arm: dts: k3-am654: copy bootph properties to a53 dts

In order to unify the R5 board dtb file with the Linux board dtb file,
we will need to copy all bootph-pre-ram properties to the *-u-boot.dtsi
overlay.

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654: pull in dtb update from Linux
Bryan Brattlof [Fri, 29 Dec 2023 17:47:01 +0000 (11:47 -0600)]
arm: dts: k3-am654: pull in dtb update from Linux

Pull in dtb updates for the am654 base board from v6.7-rc1 of Linux

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoarm: dts: k3-am654-r5: Merge board file and U-Boot overlay
Bryan Brattlof [Fri, 29 Dec 2023 17:47:00 +0000 (11:47 -0600)]
arm: dts: k3-am654-r5: Merge board file and U-Boot overlay

The R5 board file for U-Boot should be the same as the board file copied
from Linux with a few alterations to work with the R5's view of the SoC.

First we need to unify the R5 board file and it's U-Boot overlay before
we can unify the Linux board file with this one.

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoconfigs: am65x_evm_a53: disable CONSOLE_MUX
Bryan Brattlof [Fri, 29 Dec 2023 17:46:59 +0000 (11:46 -0600)]
configs: am65x_evm_a53: disable CONSOLE_MUX

We do not have a need to share a single console with the evaluation
board and disabling this option reduces the complexity of configuring
the consoles. Disable CONSOLE_MUX

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoconfigs: am65x_evm_r5: enable driver for fixed regulators
Bryan Brattlof [Fri, 29 Dec 2023 17:46:58 +0000 (11:46 -0600)]
configs: am65x_evm_r5: enable driver for fixed regulators

Some of the regulators we need to successfully boot are fixed
regulators. Enable the driver to properly probe them.

Tested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agotegra114: clock: define MIPI calibration peripheral clock
Svyatoslav Ryhel [Mon, 25 Dec 2023 15:30:37 +0000 (17:30 +0200)]
tegra114: clock: define MIPI calibration peripheral clock

TEGRA114_CLK_MIPI_CAL is a fixed child of PLLP and is used
as clock source of the MIPI PHY calibration mechanism.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
11 months agodoc: board: tegra30: update information in board documents
Svyatoslav Ryhel [Sun, 24 Dec 2023 08:16:34 +0000 (10:16 +0200)]
doc: board: tegra30: update information in board documents

Recently, the U-Boot installation process has changed significantly.
This should be depicted in documentation.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
11 months agoMerge tag 'dm-next-1124' of https://source.denx.de/u-boot/custodians/u-boot-dm into...
Tom Rini [Mon, 1 Jan 2024 17:38:15 +0000 (12:38 -0500)]
Merge tag 'dm-next-1124' of https://source.denx.de/u-boot/custodians/u-boot-dm into next

support propagating supernode properties with bootph schema
align bloblist with v0.9 of Firmware Handoff spec

11 months agobloblist: Update documentation and header comment
Simon Glass [Wed, 27 Dec 2023 21:07:10 +0000 (13:07 -0800)]
bloblist: Update documentation and header comment

Align the documentation with the v0.9 spec.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agobloblist: Add alignment to bloblist_new()
Simon Glass [Wed, 27 Dec 2023 21:07:09 +0000 (13:07 -0800)]
bloblist: Add alignment to bloblist_new()

Allow the alignment to be specified when creating a bloblist.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agobloblist: Adjust the bloblist header
Simon Glass [Wed, 27 Dec 2023 21:07:08 +0000 (13:07 -0800)]
bloblist: Adjust the bloblist header

The v0.9 spec provides for a 24-byte header. Update the implementation
to match this.
Rename the fields of the bloblist header to align to the spec.
Adds an alignment field into the bloblist header.
Update the related bloblist APIs and UT testcases.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agobloblist: Reduce blob-header size
Simon Glass [Wed, 27 Dec 2023 21:07:07 +0000 (13:07 -0800)]
bloblist: Reduce blob-header size

The v0.9 spec provides for an 8-byte header for each blob, with fewer
fields.
The blob data start address should be aligned to the alignment specified
by the bloblist header.
Update the implementation to match this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
11 months agobloblist: Handle alignment with a void entry
Simon Glass [Wed, 27 Dec 2023 21:07:06 +0000 (13:07 -0800)]
bloblist: Handle alignment with a void entry

Rather than setting the alignment using the header size, add an entirely
new entry to cover the gap left by the alignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agobloblist: Checksum the entire bloblist
Simon Glass [Wed, 27 Dec 2023 21:07:05 +0000 (13:07 -0800)]
bloblist: Checksum the entire bloblist

Use a sinple 8-bit checksum for bloblist, as specified by the spec
version 0.9.
Spec v0.9 specifies that the entire bloblist area is checksummed,
including unused portions. Update the code to follow this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agobloblist: Drop spare value from bloblist record
Simon Glass [Wed, 27 Dec 2023 21:07:04 +0000 (13:07 -0800)]
bloblist: Drop spare value from bloblist record

Drop spare value from bloblist record header.

For now it is still present in the header, with an underscore, so that
tests continue to pass.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
11 months agobloblist: Access record hdr_size and tag via a function
Simon Glass [Wed, 27 Dec 2023 21:07:03 +0000 (13:07 -0800)]
bloblist: Access record hdr_size and tag via a function

Convert accesses to tag and hdr_size via function for grouping tag and
hdr_size together later.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agobloblist: Set version to 1
Simon Glass [Wed, 27 Dec 2023 21:07:02 +0000 (13:07 -0800)]
bloblist: Set version to 1

The new bloblist for v0.9 has version 1 so update this value.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agobloblist: Change the magic value
Simon Glass [Wed, 27 Dec 2023 21:07:01 +0000 (13:07 -0800)]
bloblist: Change the magic value

This uses a new value with spec v0.9 so change it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agobloblist: Adjust API to align in powers of 2
Simon Glass [Wed, 27 Dec 2023 21:07:00 +0000 (13:07 -0800)]
bloblist: Adjust API to align in powers of 2

The updated bloblist structure stores the alignment as a power-of-two
value in its structures. Adjust the API to use this, to avoid needing to
calling ilog2().
Update the bloblist alignment from 16 bytes to 8 bytes.
Drop a stale comment while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agobloblist: Update the tag numbering
Simon Glass [Wed, 27 Dec 2023 21:06:59 +0000 (13:06 -0800)]
bloblist: Update the tag numbering

Align bloblist tags with the FW handoff spec v0.9.
The most common ones are from 0.
TF related ones are from 0x100.
All non-standard ones from 0xfff000.

Added new defined tags:
BLOBLISTT_OPTEE_PAGABLE_PART for TF.
BLOBLISTT_TPM_EVLOG and BLOBLISTT_TPM_CRB_BASE for TPM.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoMakefile: Use the fdtgrep -u flag
Simon Glass [Tue, 19 Dec 2023 14:21:25 +0000 (07:21 -0700)]
Makefile: Use the fdtgrep -u flag

Use this flag so that the bootph binding is obeyed correctly.

Add a comment about what is going on.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/12
Reviewed-by: Tom Rini <trini@konsulko.com>
11 months agofdtgrep: Allow propagating properties up to supernodes
Simon Glass [Sun, 17 Dec 2023 16:36:22 +0000 (09:36 -0700)]
fdtgrep: Allow propagating properties up to supernodes

The existing bootph binding is defined such that properties in a
subnode are also implied in the supernode also, as in this example:

   buttons {
      /* bootph,pre-ram is implied by btn1 */
      compatible = "gpio-keys";

      btn1 {
         bootph,pre-ram;
         gpios = <&gpio_a 3 0>;
         label = "button1";
         linux,code = <BTN_1>;
      };

Provide an option to implement this in fdtgrep.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 months agosandbox: Correct SPL condition for building devicetree
Simon Glass [Sun, 17 Dec 2023 16:36:21 +0000 (09:36 -0700)]
sandbox: Correct SPL condition for building devicetree

With sandbox, CONFIG_SANDBOX is y so the current rule ends up building
the devicetree for only those SPL builds where it is unwanted.

Correct the condition. This allows sandbox_vpl to produce a
u-boot-vpl.dtb file.

Fixes: e7fb789612e ("sandbox: Remove OF_HOSTFILE")
Signed-off-by: Simon Glass <sjg@chromium.org>
11 months agofdtgrep: Move property checking into a function
Simon Glass [Sun, 17 Dec 2023 16:36:20 +0000 (09:36 -0700)]
fdtgrep: Move property checking into a function

The h_include() function includes a piece which checks if a node
contains a property being searched for. Move this into its own
function to reduce the size of the h_include() function.

Signed-off-by: Simon Glass <sjg@chromium.org>