Commit graph

12840 commits

Author SHA1 Message Date
Manish V Badarkhe
31df063281 docs: move the Juno-specific build option to Arm build option file
Moved the Juno-specific build option from the common build option
file to the Arm build option file.

Change-Id: I0f53203f0cfca4a3baadab2cee4339c9694cfe8b
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-06-22 16:00:32 +02:00
Chris Kay
41e56f422d feat(fvp): allow configurable FVP Trusted SRAM size
In some build configurations TF-A can exceed the existing 256KB SRAM,
triggering a build failure. More recent versions of the base FVP allow
you to configure a larger Trusted SRAM of 512KB.

This change introduces the `FVP_TRUSTED_SRAM_SIZE` build option, which
allows you to explicitly specify how much of the Trusted SRAM to
utilise, e.g.:

    FVP_TRUSTED_SRAM_SIZE=384

This allows previously-failing configurations to build successfully by
utilising more than the originally-allocated 256KB of the Trusted SRAM
while maintaining compatibility with older configurations/models that
only require/have 256KB.

Change-Id: I8344d3718564cd2bd53f1e6860e2fe341ae240b0
Signed-off-by: Chris Kay <chris.kay@arm.com>
2023-06-21 14:16:11 +02:00
Lauren Wehrmeister
83fde9fcdf Merge "feat(cpus): conform DSU errata to errata framework PCS" into integration 2023-06-20 21:19:49 +02:00
Manish Pandey
732af872d4 Merge changes from topic "xlnx_zynqmp_sizefixes" into integration
* changes:
  fix(zynqmp): type cast addresses to fix overflow issue
  fix: integer suffix macro definition
2023-06-20 18:45:23 +02:00
Manish Pandey
733cc2ad2c Merge "fix(build): include Cortex-A78AE cpu file for FVP" into integration 2023-06-20 18:43:32 +02:00
Olivier Deprez
e779c1afe2 Merge changes Ic58f4966,Ib7b438b8,I400f0f1f into integration
* changes:
  refactor(el3-spmc): add comments
  refactor(el3-spmc): move checks after loop
  refactor(el3-spmc): validate alignment earlier
2023-06-20 16:07:36 +02:00
Manish Pandey
1f58063bf9 Merge "feat(intel): add intel_rsu_update() to sip_svc_v2" into integration 2023-06-20 15:35:28 +02:00
Manish Pandey
3a95b5d5ea Merge "feat(lib): implement memcpy_s in lib" into integration 2023-06-20 15:34:24 +02:00
Akshay Belsare
91291633a1 fix(zynqmp): type cast addresses to fix overflow issue
Type cast the build time base and size argument to unsigned integer
and the limit derived from these two as unsigned long to avoid
size overflow issue during build.

For zynqmp platform, calculating the limit without typecasting results
in build error as follows

make -j DEBUG=0 RESET_TO_BL31=1 PLAT=zynqmp \
ZYNQMP_ATF_MEM_BASE=0x70000000 ZYNQMP_ATF_MEM_SIZE=0x10000000 \
XILINX_OF_BOARD_DTB_ADDR=0x100000 bl31

plat/xilinx/zynqmp/include/platform_def.h:51:62:
error: integer overflow in expression of type 'int' results
				in '-2147483648' [-Werror=overflow]
 51 | # define BL31_LIMIT   (ZYNQMP_ATF_MEM_BASE + ZYNQMP_ATF_MEM_SIZE)

Change-Id: Id093a50e748884d4fba65626e94f361f6c23cecc
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
2023-06-20 15:22:24 +02:00
Akshay Belsare
1a56ed4b35 fix: integer suffix macro definition
The current implementation of macro L/LL/UL/ULL concatenates the input
with "L"/"LL"/"UL"/"ULL" respectively.
In the case where a macro is passed to L/LL/UL/ULL as input,
the input macro name is concatenated with, rather than expanding
the input macro and then concatenating it.
The implementation of L/LL/UL/ULL is modified to two level macro,
so as to concatenate to the expansion of a macro argument.

Change 5b33ad174a "Unify type of "cpu_idx" across PSCI module."
has modified the implementation of U() to two level macros without
changing the implementation of other macros.

Change-Id: Ie93d67dff5ce96223a3faf6c98b98fcda530fc34
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
2023-06-20 15:22:19 +02:00
Joanna Farley
92a44d5587 Merge "build(changelog): pretend scope-less build changes have the build scope" into integration 2023-06-20 15:16:26 +02:00
Manish Pandey
78ee4cdd48 Merge changes from topic "jc/refact_Makefile" into integration
* changes:
  refactor(build): move SVE_VECTOR_LEN flag to add_defines section
  refactor(build): cleanup Makefile to handle build flags precisely
2023-06-20 15:13:11 +02:00
Manish V Badarkhe
843da4659c Merge "fix: pass SMCCCv1.3 SVE hint to internal flags" into integration 2023-06-20 12:23:23 +02:00
Manish V Badarkhe
8725938059 Merge changes I814cdadb,I429eb473,I441f9a60 into integration
* changes:
  fix(n1sdp): fix spi_ids range for n1sdp multichip boot
  fix(gicv3): move invocation of gicv3_get_multichip_base function
  fix(gic600): fix gic600 maximum SPI ID
2023-06-20 12:10:44 +02:00
Jayanth Dodderi Chidanand
a8cf6faeae refactor(build): move SVE_VECTOR_LEN flag to add_defines section
Presently, we have an explicit section to add definitions, wherein
we evaluate the definitions after being overwritten by the platform.

To keep it aligned with this pattern, SVE_VECTOR_LEN is moved here.

Change-Id: Ia3373d954a7ee97980fe72d5a069e202352f25b1
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-06-20 11:09:27 +01:00
Jayanth Dodderi Chidanand
c5e1da836c refactor(build): cleanup Makefile to handle build flags precisely
Presently, Makefile is unsystematic with no precise ordering
of configuration and commands.
This patch addresses this issue, by sorting and arranging the related
sections in an order, which helps in maintaining it precisely.
Further, this assists developers in identifying the concerned section
and add related changes appropriately with ease.

Additionally, SIMICS build option linked to Intel platform, has been
removed, as there is no platform specific support to utilise it.
[https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/16737]

Change-Id: I72c09905334f94f803cdfd85f56e2c9572f9b3ef
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-06-20 11:09:19 +01:00
sahil
31f60a9683 fix(n1sdp): fix spi_ids range for n1sdp multichip boot
According to GIC-600 TRM, it supports upto 960 SPIs.
This patch configures the SPI IDs range to 32-991, and distributes
them equally across both the chips.

Signed-off-by: sahil <sahil@arm.com>
Change-Id: I814cdadb59c8765c239ae0375e547718b7f208ff
2023-06-20 09:52:41 +01:00
Sandrine Bailleux
fb45d56ce3 Merge changes from topic "fix-for-hash-lengths" into integration
* changes:
  fix(auth): allow hashes of different lengths
  feat(juno): add mbedtls_asn1_get_len symbol in ROMlib
  feat(fvp): add mbedtls_asn1_get_len symbol in ROMlib
2023-06-19 17:10:41 +02:00
Manish V Badarkhe
d557aaec77 Merge "chore(smccc): bump up SMCCC version to 1.4" into integration 2023-06-16 16:36:33 +02:00
Olivier Deprez
b2d851785f fix: pass SMCCCv1.3 SVE hint to internal flags
This change fixes the initial support for SMCCCv1.3 SVE hint bit [1].
In the aarch64 smc handler, the FID[16] bit is improperly extracted
and results in the corresponding flags bit to be always set.
Fix by doing the proper masking and set into the flags register.

[1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/17511

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I62b8e211d48a50f28e184ff27cd718f51d8d56bf
2023-06-16 15:03:36 +02:00
Manish Pandey
de7e3e9ceb chore(smccc): bump up SMCCC version to 1.4
TF-A code supports SMCCC spec version 1.4 while version is still kept
1.2. Bump up the version.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ie5476c4601bd504d3f3e8433e1d672ebd0a758b1
2023-06-16 13:06:16 +01:00
sahil
36704d09c6 fix(gicv3): move invocation of gicv3_get_multichip_base function
gicv3_get_multichip_base in case of GICV3_IMPL_GIC600_MULTICHIP flag
being set, only works if the id belongs to SPI range.
Moving invocation of the function after confirming that the
intr_num belongs to SPI range.

Signed-off-by: sahil <sahil@arm.com>
Change-Id: I429eb473a7aeccb30309b1ffa5994663393ba0a2
2023-06-16 12:32:29 +02:00
sahil
69ed7dc2e9 fix(gic600): fix gic600 maximum SPI ID
According to GIC-600 TRM, it supports up to 960 SPIs. With the
starting SPI_ID of 32, the maximum SPI_ID should be 991. This patch
fixes the value of GIC600_SPI_ID_MAX which is currently configured
to be 960.

Signed-off-by: sahil <sahil@arm.com>
Change-Id: I441f9a607d160db8533f2a03e02afd1a9bab991e
2023-06-16 12:32:20 +02:00
Manish Pandey
bf1e58e737 Merge "docs: update PSCI reference" into integration 2023-06-16 10:44:39 +02:00
Lauren Wehrmeister
aa1055e300 Merge "fix(cpus): reduce generic_errata_report()'s size" into integration 2023-06-15 19:07:36 +02:00
Lauren Wehrmeister
d2e0743698 Merge changes from topic "bk/errata_refactor" into integration
* changes:
  feat(cpus): add more errata framework helpers
  docs: document the errata framework
2023-06-15 16:28:41 +02:00
Demi Marie Obenour
22a53545aa fix(auth): allow hashes of different lengths
Trusted Board Boot supports multiple hash algorithms, including SHA-256,
SHA-384, and SHA-512.  These algorithms produce hashes of different
lengths, so the resulting DER-encoded hash objects are also of different
lengths.  However, the common Trusted Board Boot code only stores the
contents of the object, not its length.  Before commit
f47547b354, this was harmless: ASN.1
objects are self-delimiting, and any excess padding was ignored.
f47547b354 changed the code to reject
excess padding.  However, this breaks using a shorter hash in a build
that supports longer hashes: the shorter hash will have padding after
it, and verify_hash() will reject it.  This was found by an Arm
customer: TF-A v2.9 refused to boot, even though TF-A v2.6 (which did
not have f47547b354) worked just fine.

Storing the length of the hash turns out to be quite difficult.
However, it turns out that hashes verified by verify_hash() always come
from the ROTPK or an X.509 certificate extension.  Furthermore, _all_
X.509 certificate extensions used by Trusted Board Boot are ASN.1
DER encoded, so it is possible to reject padding in get_ext().  Padding
after the ROTPK is harmless, and it is better to ignore that padding
than to refuse to boot the system.

Change-Id: I28a19d7783e6036b65e86426d78c8e5b2ed6f542
Fixes: f47547b354 ("fix(auth): reject invalid padding in digests")
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-06-15 15:31:00 +02:00
Sandrine Bailleux
ec8ba97e4f feat(juno): add mbedtls_asn1_get_len symbol in ROMlib
mbedtls_asn1_get_len() will be needed by the X.509 parser in an
upcoming patch.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I5609da000bbfc8a1503c298550ae3b0ba881fc96
2023-06-15 15:30:41 +02:00
Sandrine Bailleux
06050601d2 feat(fvp): add mbedtls_asn1_get_len symbol in ROMlib
mbedtls_asn1_get_len() will be needed by the X.509 parser in an
upcoming patch.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I14310c80033a1142a94c0c4b54d63331479b643d
2023-06-15 15:28:57 +02:00
Boyan Karatotev
f43e09a12e fix(cpus): reduce generic_errata_report()'s size
For a pretty implementation and straightforward code, the CVE/erratum
dispatching of the errata status reporting was done with a macro,
closely following the old code. Unfortunately, this produces a function
that was over a kilobyte in size, which unsurprisingly doesn't fit on
some platforms.

Convert the macro to a proper C function and call it once. Also hide the
errata ordering checking behind the FEATURE_DETECTION flag to further
save space. This functionality is not necessary for most builds.
Development and platform bringup builds, which should find this
functionality useful, are expected to have FEATURE_DETECTION enabled.

This reduces the function to under 600 bytes.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Ibf5376a26cbae28d9dc010128452cb3c694a3f78
2023-06-15 10:14:59 +01:00
Boyan Karatotev
94a75ad456 feat(cpus): add more errata framework helpers
Figuring out the naming format of errata is annoying, so add a shorthand
for the custom checker functions. Also add some more semantic macros
instead of passing around constants.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Ibdcf72146738026df4ebd047bfb30790fd4a1053
2023-06-15 10:14:59 +01:00
Boyan Karatotev
6a0e8e80fb docs: document the errata framework
Also add a recommended Procedure Call Standard (PCS) to use inside CPU
files and split everything into sections to make it easier to follow.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Idd876d8e598b5dfe1193aa3e7375c52f6edf5671
2023-06-15 10:14:58 +01:00
Manish V Badarkhe
032c698350 Merge "feat(ast2700): add Aspeed AST2700 platform support" into integration 2023-06-15 10:57:58 +02:00
Manish V Badarkhe
3be6b4fbe5 docs: update PSCI reference
PSCI specification reference in the documentation is updated
to point to latest specification and duplicate PSCI references are
removed.

Change-Id: I35ee365f08c557f3017af4d51f6d063a7501b27e
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-06-15 09:46:43 +01:00
Manish V Badarkhe
c219b03df6 Merge "fix(spmd): relax use of EHF with SPMC at S-EL2" into integration 2023-06-13 18:21:39 +02:00
Manish Pandey
e1ce6cdf60 Merge "fix(versal): add missing irq mapping for wakeup src" into integration 2023-06-13 18:18:54 +02:00
Mahesh Rao
e3c3a48c85 feat(intel): add intel_rsu_update() to sip_svc_v2
Add smc function id for intel_rsu_update() in sip_svc_v2. For temporarily
saving the RSU application image address before a cold reset is
issued.

Signed-off-by: Mahesh Rao <mahesh.rao@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: I43bc7bd5aa5fa9238bceba1d826bf0a34ff87adb
2023-06-13 15:44:26 +08:00
Jay Buddhabhatti
06b9c4c87d fix(versal): add missing irq mapping for wakeup src
The commit 0ec6c31320 provides irq to device index mapping
which is required to check for IRQs and set peripheral as a
wake source if IRQ is enabled. But in that commit some IRQ
numbers are missed. Because of that, wakeup using some
peripheral interrupts will not work. Add those missing IRQ
numbers.

Fixes: 0ec6c31320 ("feat(versal): replace irq array with switch case")
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Change-Id: Icbc773050c328be253702e63e7cf8450c7dee133
2023-06-13 00:29:21 -07:00
Olivier Deprez
bb6d0a174f fix(spmd): relax use of EHF with SPMC at S-EL2
Follow up to [1] and [2], for systems implementing the SPMC at S-EL2,
it is necessary to leave the option for handling Group0 interrupts
(while the normal world runs) through the EHF by the use of the
EL3_EXCEPTION_HANDLING option.
Specifically for RAS, the handling through EHF is still required because
the platform function provided by the SPMD doesn't provide the facility
to link back to the RAS handling framework.

[1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/16047
[2] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/19897

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Idf8741887904a286fb3f5ab2d754afd2fc78d3b0
2023-06-13 08:59:17 +02:00
Jit Loon Lim
f328bff667 feat(lib): implement memcpy_s in lib
To support memcpy_s for better security purpose
to avoid overflowing the dest while copy from src.

Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: I63c3ea6a3e99c10d69be6bce04843c14b0a28a4d
2023-06-13 11:25:48 +08:00
Lauren Wehrmeister
0484b2cb9c Merge "docs: update Measured Boot PoC" into integration 2023-06-12 18:23:37 +02:00
Demi Marie Obenour
794c409f48 refactor(el3-spmc): add comments
Change-Id: Ic58f4966159cafa83eec8e6b18a96b0a8b2ce781
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-06-12 12:21:05 -04:00
Demi Marie Obenour
966c63e6b2 refactor(el3-spmc): move checks after loop
This makes the code cleaner.  No functional change intended.

Change-Id: Ib7b438b830e8e3b7ac6e30d688f5172cbaa58121
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-06-12 12:21:05 -04:00
Demi Marie Obenour
27ac582ae0 refactor(el3-spmc): validate alignment earlier
Future changes will cause spmc_shmem_obj_get_comp_mrd to panic instead
of returning NULL, so be sure that comp_mrd_offset has been validated
already.  The existing code checks for 8-byte alignment, but comments in
el3_spmc_ffa_memory.h indicate that 16-byte alignment is expected, so
require 16-byte alignment.

Change-Id: I400f0f1f163522cb5ea77d4811c91e8b7e655c18
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2023-06-12 12:21:05 -04:00
Manish Pandey
f51bbacff6 Merge "fix(zynqmp): fix prepare_dtb() memory description" into integration 2023-06-12 17:33:00 +02:00
Sandrine Bailleux
7ae96dcebd Merge "chore(bl): add UNALIGNED symbols for TEXT/RODATA" into integration 2023-06-12 14:43:17 +02:00
Manish V Badarkhe
7a8a97f582 Merge changes from topics "hm/latex", "hm/latexpdf" into integration
* changes:
  fix(docs): fix build errors for latexpdf
  chore: reformat sphinx configuration
2023-06-12 13:49:19 +02:00
Michal Simek
f7d445fcbb chore(bl): add UNALIGNED symbols for TEXT/RODATA
Add symbols to mark end of TEXT/RODATA before page alignment.
Similar change was done by commit 8d69a03f6a ("Various
improvements/cleanups on the linker scripts") for
RO_END/COHERENT_RAM. These symbols help to know how much free
space is in the final binary because of page alignment.

Also show all *UNALIGNED__ symbols via poetry.
For example:
poetry run memory -p zynqmp -b debug

Change-Id: I322beba37dad76be9f4e88ca7e5b3eff2df7d96e
Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-06-12 12:50:08 +02:00
Harrison Mutai
443d6ea699 fix(docs): fix build errors for latexpdf
Fixes errors encountered when handling SVG graphics, unicode characters,
and deeply nested lists (i.e. in the change log) with the `latexpdf`
docs build. Adds `sphinxcontrib-svg2pdfconverter` to allow embedding SVG
images into PDF files; changes the LaTeX engine to XeLaTex to provide
wider support for unicode characters (see [1] for more details); and
increases the maximum list depth.

[1] https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-latex_engine

Change-Id: I2ee265d301f6822bae7aa6dfa3a8bfcf070076d3
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2023-06-12 10:56:30 +01:00
Manish Pandey
f4d011b0f0 Merge changes from topic "psci-osi" into integration
* changes:
  fix(psci): add optional pwr_domain_validate_suspend to plat_psci_ops_t
  fix(sc7280): update pwr_domain_suspend
  fix(fvp): update pwr_domain_suspend
2023-06-12 10:22:50 +02:00