Commit Graph

10773 Commits

Author SHA1 Message Date
Marco Nelissen 3db9a39cb7 docs(maintainers): add new owners for Trusty SPD
Split TLK/Trusty SPD into two separate components and add additional
owners for Trusty SPD.

Signed-off-by: Marco Nelissen <marcone@google.com>
Change-Id: Ifabd1bb630fe4976e304fa29eac1c516ec6e2e18
2022-05-06 17:50:26 +02:00
Manish Pandey efceb6bead Merge changes Iaf21883b,I523c5d57,I57164923 into integration
* changes:
  fix(ufs): read and write attribute based on spec
  fix(ufs): disables controller if enabled
  refactor(ufs): adds a function for fdeviceinit
2022-05-06 17:47:28 +02:00
BenjaminLimJL f65bdf3a54 feat(intel): implement timer init divider via cpu frequency. (#1)
Get cpu frequency and update the timer init div with it.
The timer is vary based on the cpu frequency instead of hardcoded.
The implementation shall apply to only Agilex and S10

Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: I61684d9762ad34e5a60b8b176b60c8848db4b422
2022-05-06 17:37:45 +02:00
Sandrine Bailleux 2c87fabab5 Merge "fix(st): fix NULL pointer dereference issues" into integration 2022-05-06 16:53:24 +02:00
Olivier Deprez 44b9d577c0 Merge changes from topic "ffa_el3_spmc" into integration
* changes:
  feat(spmc): enable checking of execution ctx count
  feat(spmc): enable parsing of UUID from SP Manifest
  feat(spmc): add partition mailbox structs
  feat(plat/arm): allow BL32 specific defines to be used by SPMC_AT_EL3
  feat(plat/fvp): add EL3 SPMC #defines
  test(plat/fvp/lsp): add example logical partition
  feat(spmc/lsp): add logical partition framework
2022-05-06 15:58:03 +02:00
Yann Gautier b1391b294c fix(st): add missing header include
This issue is triggered when enabling -Wmissing-prototypes:
plat/st/common/bl2_io_storage.c:114:5: warning: no previous prototype
 for 'open_fip' [-Wmissing-prototypes]
  114 | int open_fip(const uintptr_t spec)
      |     ^~~~~~~~
plat/st/common/bl2_io_storage.c:119:5: warning: no previous prototype
 for 'open_storage' [-Wmissing-prototypes]
  119 | int open_storage(const uintptr_t spec)
      |     ^~~~~~~~~~~~

Add missing stm32mp_io_storage.h header include, where those functions
prototypes are defined.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I2af69fadfc4780553f41b338cd93b731210672a6
2022-05-06 15:52:38 +02:00
Manish Pandey fad4a7175b Merge changes from topic "xlnx_zynqmp_misra" into integration
* changes:
  fix(zynqmp): resolve misra R14.4 warnings
  fix(zynqmp): resolve misra R16.3 warnings
  fix(zynqmp): resolve misra R15.7 warnings
  fix(zynqmp): resolve misra R15.6 warnings
  fix(zynqmp): resolve misra 7.2 warnings
  fix(zynqmp): resolve misra R10.3
2022-05-06 15:51:25 +02:00
Manish Pandey e8ad39759b Merge "feat(brbe): add BRBE support for NS world" into integration 2022-05-06 12:46:03 +02:00
Olivier Deprez 78c82cd099 Merge changes from topic "ja/boot_protocol" into integration
* changes:
  fix(sptool): update Optee FF-A manifest
  feat(sptool): delete c version of the sptool
  feat(sptool): use python version of sptool
  feat(sptool): python version of the sptool
  refactor(sptool): use SpSetupActions in sp_mk_generator.py
  feat(sptool): add python SpSetupActions framework
2022-05-06 11:52:55 +02:00
Venkatesh Yadav Abbarapu c884c9a55b fix(zynqmp): define and enable ARM_XLAT_TABLES_LIB_V1
Enable ARM_XLAT_TABLES_LIB_V1 as ZynqMP is using
v1 library of translation tables.

With upstream patch d323af9e3d,
the usage of MAP_REGION_FLAT is referring to definition in file
include/lib/xlat_tables/xlat_tables_v2.h but while preparing
xlat tables in lib/xlat_tables/xlat_tables_common.c it is referring
to include/lib/xlat_tables/xlat_tables.h which is v1 xlat tables.
Also, ZynqMP was using v1 so defined ARM_XLAT_TABLES_LIB_V1 to
use v1 xlat tables everywhere.
This fixes the issue of xlat tables failures as it takes v2
library mmap_region structure in some files and v1 in other
files.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: Ibc0e1c536e19f4edd6a6315bf1b0dfcec33e2fdc
2022-05-06 14:55:47 +05:30
Yann Gautier 2deff904a9 fix(st): fix NULL pointer dereference issues
The get_bl_mem_params_node() function could return NULL. Add asserts to
check the return value is not NULL.
This corrects coverity issues:
	pager_mem_params = get_bl_mem_params_node(BL32_EXTRA1_IMAGE_ID);
>>>     CID 378360:    (NULL_RETURNS)
>>>     Dereferencing "pager_mem_params", which is known to be "NULL".

	paged_mem_params = get_bl_mem_params_node(BL32_EXTRA2_IMAGE_ID);
>>>     CID 378360:    (NULL_RETURNS)
>>>     Dereferencing "paged_mem_params", which is known to be "NULL".

	tos_fw_mem_params = get_bl_mem_params_node(TOS_FW_CONFIG_ID);
>>>     CID 378360:    (NULL_RETURNS)
>>>     Dereferencing "tos_fw_mem_params", which is known to be "NULL".


Do the same for other occurrences of get_bl_mem_params_node() return not
checked, in the functions plat_get_bl_image_load_info() and
bl2_plat_handle_pre_image_load().

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I79165b1628fcee3da330f2db4ee5e1dafcb1b21f
2022-05-06 11:00:15 +02:00
Venkatesh Yadav Abbarapu dd1fe7178b fix(zynqmp): resolve misra R14.4 warnings
MISRA Violation: MISRA-C:2012 R.14.4
The controlling expression of an if statement and the controlling
expression of an iteration-statement shall have essentially Boolean type.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I8f3f6f956d1d58ca201fb5895f12bcaabf2afd3b
2022-05-06 13:45:27 +05:30
Venkatesh Yadav Abbarapu e7e5d30308 fix(zynqmp): resolve misra R16.3 warnings
MISRA Violation: MISRA-C:2012 R.16.3
- An unconditional break statement shall terminate every switch-clause.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I96a8b627c593ff1293b725d443531e42368923c5
2022-05-06 13:45:22 +05:30
Venkatesh Yadav Abbarapu 16de22d037 fix(zynqmp): resolve misra R15.7 warnings
MISRA Violation: MISRA-C:2012 R.15.7
- All if . . else if constructs shall be terminated
with an else statement.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: If921ca7c30b2feea6535791aa15f4de7101c3134
2022-05-06 13:45:16 +05:30
Venkatesh Yadav Abbarapu eb0d2b1772 fix(zynqmp): resolve misra R15.6 warnings
MISRA Violation: MISRA-C:2012 R.15.6
- The body of an iteration-statement or a selection-statement shall be
  a compound statement.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I0fc8eeac0e592f00297a1ac42a1ba3df1144733b
2022-05-06 13:45:07 +05:30
Venkatesh Yadav Abbarapu 5bcbd2de12 fix(zynqmp): resolve misra 7.2 warnings
MISRA Violation: MISRA-C:2012 R.7.2
- A "u" or "U" suffix shall be applied to all integer constants that are
represented in an unsigned type.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: Ieeff81ed42155c03aebca75b2f33f311279b9ed4
2022-05-06 13:43:34 +05:30
Venkatesh Yadav Abbarapu 2b57da6c91 fix(zynqmp): resolve misra R10.3
MISRA Violation: MISRA-C:2012 R.10.3
- The value of an expression shall not be assigned to an object with a
  narrower essential type or of a different essential type category.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I5a60c66788d59e45f41ceb81758b42ef2df9f5f7
2022-05-06 13:43:28 +05:30
Sandrine Bailleux be96158fbb Merge "fix(fvp): fix NULL pointer dereference issue" into integration 2022-05-06 10:08:54 +02:00
Madhukar Pappireddy d82fae2680 Merge "docs(maintainers): update measured boot code owners" into integration 2022-05-05 22:27:35 +02:00
johpow01 744ad97445 feat(brbe): add BRBE support for NS world
This patch enables access to the branch record buffer control registers
in non-secure EL2 and EL1 using the new build option ENABLE_BRBE_FOR_NS.
It is disabled for all secure world, and cannot be used with ENABLE_RME.

This option is disabled by default, however, the FVP platform makefile
enables it for FVP builds.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I576a49d446a8a73286ea6417c16bd0b8de71fca0
2022-05-05 19:43:10 +02:00
John Powell 2e5d7a4b6b fix(security): report CVE 2022 23960 missing for aarch32 A57 and A72
Since there is no product deployed running EL3 in AArch32 mode for
Cortex-A57 and Cortex-A72, report the workaround for CVE 2022 23960
as missing on these cores.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I14d202c1179707257086ad0c4795c397e566b3e6
2022-05-05 18:38:38 +02:00
Sieu Mun Tang bb0fcc7e01 feat(intel): add SMPLSEL and DRVSEL setup for Stratix 10 MMC
SMPLSEL and DRVSEL values need to updated in
DWMMC for the IP to work correctly. This apply
on Stratix 10 device only.

Signed-off-by: Loh Tien Hock <tien.hock.loh@intel.com>
Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com>
Change-Id: Ibd799a65890690682e27e4cbbc85e83ea03d51fc
2022-05-05 23:47:20 +08:00
Sieu Mun Tang 11f4f03043 feat(intel): add support for F2S and S2F bridge SMC with mask to enable, disable and reset bridge
This adds F2S and S2F bridge enable, disable and reset
sequence to enable, disable and reset properly the bridges
in SMC call or during reset.

The reset is also maskable as the SMC from uboot can
pass in the bridge mask when requesting for bridge
enable or disable.

Signed-off-by: Loh Tien Hock <tien.hock.loh@intel.com>
Signed-off-by: Sieu Mun Tang <sieu.mun.tang@intel.com>
Change-Id: Ie144518c591664ef880016c9b3706968411bbf21
2022-05-05 22:58:03 +08:00
Madhukar Pappireddy 8d6502183d Merge "fix(intel): reject non 4-byte align request size for FPGA Crypto Service (FCS)" into integration 2022-05-05 16:12:04 +02:00
Manish V Badarkhe a42b426b85 fix(fvp): fix NULL pointer dereference issue
Fixed below NULL pointer dereference issue reported by coverity scan
by asserting the hw_config_info is not NULL.

*** CID 378361:  Null pointer dereferences  (NULL_RETURNS)
/plat/arm/board/fvp/fvp_bl2_setup.c: 84 in plat_get_next_bl_params()
78
79       /* To retrieve actual size of the HW_CONFIG */
80       param_node = get_bl_mem_params_node(HW_CONFIG_ID);
81       assert(param_node != NULL);
82
83       /* Copy HW config from Secure address to NS address */
>>>     CID 378361:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "hw_config_info", which is known to be "NULL".
84       memcpy((void *)hw_config_info->ns_config_addr,
85              (void *)hw_config_info->config_addr,
86              (size_t)param_node->image_info.image_size);

Signed-off-by: Manish V Badarkhe <manish.badarkhe@arm.com>
Change-Id: Iaf584044cfc3b2583862bcc1be825966eaffd38e
2022-05-05 11:33:40 +01:00
Marc Bonnici 5b0219ddd5 feat(spmc): enable checking of execution ctx count
This is a mandatory entry in an SP's manifest however
currently an S-EL1 partition running under the EL3 SPMC
must have the same amount of execution contexts as
physical cores therefore just check the entry matches
this value.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: I4c2a85ccde7a7bb9b1232cf6389a8c532cbf3d41
2022-05-05 09:47:31 +01:00
Marc Bonnici 857f5790da feat(spmc): enable parsing of UUID from SP Manifest
To align with other SPMC implementations parse the UUID
from the SP manifest as 4 uint32 values and store
this internally.

Change-Id: I7de5d5ef8d98dc14bc7c76892133c2333358a379
Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
2022-05-05 09:47:31 +01:00
Marc Bonnici e1df6008d9 feat(spmc): add partition mailbox structs
Add mailbox structs to the partition descriptors
and ensure these are initialised correctly.

Change-Id: Ie80166d19763c266b6a1d23e351d312dc31fb221
Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
2022-05-05 09:47:30 +01:00
Marc Bonnici 2d65ea1930 feat(plat/arm): allow BL32 specific defines to be used by SPMC_AT_EL3
For EL3 SPMC configuration enabled platforms, allow the reuse of
BL32 specific definitions.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: I37ffbbf680326c101fbb2f146085a96c138f07a1
2022-05-05 09:47:30 +01:00
Marc Bonnici 44639ab73e feat(plat/fvp): add EL3 SPMC #defines
Introduce additional #defines for running with the EL3
SPMC on the FVP.

The increase in xlat tables has been chosen to allow
the test cases to complete successfully and may need
adjusting depending on the desired usecase.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: I7f44344ff8b74ae8907d53ebb652ff8def2d2562
2022-05-05 09:47:30 +01:00
Marc Bonnici a34ccd4c20 test(plat/fvp/lsp): add example logical partition
Add an example logical partition to the FVP platform that
simply prints and echos the contents of a direct request
with the appropriate direct response.

Change-Id: Ib2052c9a63a74830e5e83bd8c128c5f9b0d94658
Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
2022-05-05 09:46:39 +01:00
Sandrine Bailleux d6fbcc57f9 Merge changes from topic "mp/delete_platforms" into integration
* changes:
  refactor(mt6795): remove mediatek's mt6795 platform
  refactor(sgm775): remove Arm sgm775 platform
2022-05-05 10:30:26 +02:00
Sandrine Bailleux 97a24f82a4 Merge "docs(maintainers): add code owners for Firmware Update driver" into integration 2022-05-05 09:34:04 +02:00
Manish V Badarkhe 598d1fa85f docs(maintainers): add code owners for Firmware Update driver
Added myself and Sandrine Bailleux as code owners for Firmware
Update driver.

Signed-off-by: Manish V Badarkhe <manish.badarkhe@arm.com>
Change-Id: I34fad895c6236fedc814fb6da4b04fd7fbed9227
2022-05-04 16:43:40 +01:00
J-Alves ca0fdbd8e0 fix(sptool): update Optee FF-A manifest
Change the OPTEE FF-A manifest to comply with changes to the sp pkg [1].
The sptool packs the image at the default offset of 0x4000, if it is not
provided in the arguments.

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

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I647950410114f7fc24926696212bb7f8101390ac
2022-05-04 15:38:48 +01:00
J-Alves f4ec47613f feat(sptool): delete c version of the sptool
Change-Id: I224762ef66624c78dd87729dac80b2c956ee50ba
Signed-off-by: J-Alves <joao.alves@arm.com>
2022-05-04 15:37:47 +01:00
J-Alves 822c72791f feat(sptool): use python version of sptool
Change-Id: I567ef0b977c69c38323740a592dd9451e261a407
Signed-off-by: J-Alves <joao.alves@arm.com>
2022-05-04 15:37:47 +01:00
J-Alves 2e82874cc9 feat(sptool): python version of the sptool
To cope with the changes/design decisions in the implementation of
boot protocol, from FF-A v1.1 specification in the S-EL2 SPM, we have
changed the format of the sp pkg header.
These changes need to be reflected in the sptool, used for packaging
the SP binary, and the SP's FF-A manifest. Now the SP pkg can
contain the boot information blob as defined by the FF-A specification.
To cater for these changes, bring to the TF-A project an equivalent to
the tool used in the Hafnium project.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I046f5d6e3c2ef0ba6c87f65302e127dedef34c28
2022-05-04 15:36:56 +01:00
Manish Pandey b7bd9863dc Merge changes from topic "hm/make-refactor" into integration
* changes:
  docs(prerequisites): use LLVM utilities to build with clang
  build(make): use clang binutils to compile
2022-05-04 14:17:38 +02:00
Manish Pandey 8ac22f79c4 Merge "feat(allwinner): add SMCCC SOCID support" into integration 2022-05-04 14:16:36 +02:00
Marc Bonnici 7affa25cad feat(spmc/lsp): add logical partition framework
Introduce a framework to support running logical
partitions alongside the SPMC in EL3  as per the
v1.1 FF-A spec.

The DECLARE_LOGICAL_PARTITION macro has been added to
simplify the process to define a Logical Partition.
The partitions themselves are statically allocated
with the descriptors placed in RO memory.

It is assumed that the MAX_EL3_LP_DESCS_COUNT will
be defined by the platform.

Change-Id: I1c2523e0ad2d9c5d36aeeef6b8bcb1e80db7c443
Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
2022-05-04 12:07:33 +01:00
Manish Pandey a150486c97 refactor(mt6795): remove mediatek's mt6795 platform
Mediatek's mt6795 platform was deprecated in 2.5 release and as per [1]
a platform which has been marked deprecated should be removed from repo
after 2 release cycle.

[1] https://trustedfirmware-a.readthedocs.io/en/latest/plat/deprecated.html?highlight=deprecated

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ic427a3071316a13f34a726a1eb086b679e1671a1
2022-05-04 12:23:29 +02:00
Manish Pandey 15e5414861 refactor(sgm775): remove Arm sgm775 platform
Arm's sgm775 platform was deprecated in 2.5 release and as per [1] a
platform which has been marked deprecated should be removed from repo
after 2 release cycle.

[1] https://trustedfirmware-a.readthedocs.io/en/latest/plat/deprecated.html?highlight=deprecated

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I3cce6f330a1def725188eefd558bd0e4ec559725
2022-05-04 11:15:29 +01:00
J-Alves a96a07bfb6 refactor(sptool): use SpSetupActions in sp_mk_generator.py
The "sp_mk_generator.py" is responsible for processing the SP layout
file, which contains information about the SPs to be deployed on top of
the SPM, to generate the "sp_gen.mk" file which appends information
specific to each SP that shall help with packing all SPs into a fip
binary.
Before this patch the "sp_mk_generator.py" was a monolithic script,
which has now been broken down into functions for each identified
configuration action.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I8ee7487f2e07d53e508d17d0fe4510e22957f5ca
2022-05-04 10:11:24 +01:00
J-Alves b1e6a41572 feat(sptool): add python SpSetupActions framework
Developed python framework to help with SPs configuration. The framework
allows for functions (dubbed "actions" in the framework) to be defined
that should process the "sp_layout.json" file.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I278cd5a7aa0574168473e28f3b0fe231d7b548ee
2022-05-04 10:11:24 +01:00
Sandrine Bailleux 6dc0f1f329 Merge "build(commitlint): make the scope optional" into integration 2022-05-04 08:29:23 +02:00
Andre Przywara 436cd754f2 feat(allwinner): add SMCCC SOCID support
The Allwinner SID device holds a 16-bit SoC identifier, which we already
use in our code.

Export this number through the generic SMCCC SOCID interface, to allow
an architectural identification of an Allwinner SoC. This enables access
to this information from non-secure world, simplifies generic drivers
(ACPI comes to mind), and gives easy and precise access to the SoC ID
from userland in OSes like Linux.

Change-Id: I91753046b2ae5408ca7bc0b864fcd97d24c8267c
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-05-04 02:30:08 +02:00
André Przywara 3e0a087f30 Merge changes from topic "allwinner-idle" into integration
* changes:
  feat(allwinner): provide CPU idle states to the rich OS
  feat(allwinner): simplify CPU_SUSPEND power state encoding
  feat(allwinner): choose PSCI states to avoid translation
  feat(fdt): add the ability to supply idle state information
  fix(allwinner): improve DTB patching error handling
  refactor(allwinner): patch the DTB after setting up PSCI
  refactor(allwinner): move DTB change code into allwinner/common
2022-05-04 02:10:02 +02:00
Lauren Wehrmeister 1ced6cad52 Merge changes from topic "refactor-hw-config-load" into integration
* changes:
  docs(fvp): update loading addresses of HW_CONFIG
  docs(fconf): update device tree binding for FCONF
  feat(fvp): update HW_CONFIG DT loading mechanism
  refactor(st): update set_config_info function call
  refactor(fvp_r): update set_config_info function call
  refactor(arm): update set_config_info function call
  feat(fconf): add NS load address in configuration DTB nodes
2022-05-03 17:06:49 +02:00
Sandrine Bailleux 7cb76fdf1c docs(maintainers): update measured boot code owners
Propose myself as a code owner of the measured boot module.

Also do a couple of updates along the way:

 - Add the measured boot bindings document to the list of measured
   boot files.

 - Fix the list of FVP files. plat/arm/board/fvp/fvp_measured_boot.c
   does not exist anymore. It has been replaced by
   plat/arm/board/fvp/fvp_measured_{bl1,bl2,common}_boot.c files.

Change-Id: Ifb34f4f7c704b1db966b44428bbffd48c5e3c42b
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2022-05-03 14:59:48 +02:00