Commit graph

7961 commits

Author SHA1 Message Date
Kunlong Wang
a3c218afd6 feat(mt8196): enable vcore dvfsrc feature
This patch will enable vcore dvfsrc.
- VCORE DVFS is the feature to change VCORE/DDR Freq for power saving
- When there are no requests for using Vcore/DRAM, Vcore DVFS will
- lower the voltage and frequency of Vcore/DRAM to achieve power saving.

Signed-off-by: Kunlong Wang <kunlong.wang@mediatek.corp-partner.google.com>
Change-Id: I972eb2da1b8526f4ce2927cd662a6fc3ef2f2401
2025-02-10 11:21:10 +08:00
Boyan Karatotev
593ae35435 feat(cpus): add ENABLE_ERRATA_ALL flag
Now that all errata flags are all conveniently in a single list we can
make sweeping decisions about their values. The first use-case is to
enable all errata in TF-A. This is useful for CI runs where it is
impractical to list every single one. This should help with the long
standing issue of errata not being built or tested.

Also add missing CPUs with errata to `ENABLE_ERRATA_ALL` to enable all
errata builds in CI.

Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I2b456d304d7bf3215c7c4f4fd70b56ecbcb09979
2025-02-06 17:25:48 +01:00
Govindraj Raja
efff459bdb Merge "fix(mt8196): remove CPU_IDLE_SRAM_BASE entry from plat_mmap" into integration 2025-02-06 16:20:51 +01:00
Govindraj Raja
372fdde8c8 Merge "feat(mediatek): update mtk_sip_def.h" into integration 2025-02-06 16:19:56 +01:00
Manish Pandey
8b68a617bc Merge changes from topic "RDV3-hafnium-support" into integration
* changes:
  feat(rdv3): enable the support to fetch dynamic config
  feat(rdv3): add dts files to enable hafnium as BL32
  feat(rdv3): define SPMC manifest base address
  feat(arm): add a macro for SPMC manifest base address
  feat(rdv3): add carveout for BL32 image
  feat(rdv3): introduce platform handler for Group0 interrupt
  feat(neoverse-rd): use larger stack size when S-EL2 spmc is enabled
  fix(neoverse-rd): set correct SVE vector lengths
2025-02-06 12:55:47 +01:00
Joanna Farley
5e941e78e0 Merge "fix(versal2): update DDR address map" into integration 2025-02-06 09:27:45 +01:00
Joanna Farley
90e36ad849 Merge "feat(versal2): update platform version to versal2" into integration 2025-02-06 09:25:09 +01:00
Gavin Liu
83f37d9981 fix(mt8196): remove CPU_IDLE_SRAM_BASE entry from plat_mmap
This region is defined in LPM driver. Prefer managing this region in
LPM driver and remove it from plat_mmap and platform_def.h.

Change-Id: I57bfaad88a28d4f29e2b132ba080bc7d5b8248d8
Signed-off-by: Gavin Liu <gavin.liu@mediatek.com>
2025-02-06 14:21:03 +08:00
Yidi Lin
ead26026ff feat(mediatek): update mtk_sip_def.h
Update missing SiP SCM ID definitions. Those definitons are required
when linking to the proprietary library.

Change-Id: I6b912cee9bcceac774ff2228a1e335073a1d5ea7
Signed-off-by: Yidi Lin <yidilin@chromium.org>
2025-02-06 13:51:05 +08:00
Govindraj Raja
cea1549c95 Merge "fix(mt8196): add whole-archive option to prebuilt library" into integration 2025-02-05 21:20:19 +01:00
Yidi Lin
22d74da7cd feat(mt8196): add reset and poweroff function for PSCI call
Add reset and poweroff function for PSCI call.

Change-Id: I65b9e341b74f568f968f3c464a64ea754284cb8c
Signed-off-by: Yidi Lin <yidilin@chromium.org>
2025-02-05 23:56:28 +08:00
Wenzhen Yu
6fac00a490 feat(mt8196): refactor LPM header include paths to use lpm_v2
These changes align the project with the latest directory structure
and ensure consistency in header references.

Signed-off-by: Wenzhen Yu <wenzhen.yu@mediatek.com>
Change-Id: I7f3c42cbd9a803064bbfed67cd8f309638da8441
2025-02-05 21:38:22 +08:00
Gavin Liu
0d8c101cd9 refactor(mediatek): update API calls to MTK GIC v3 driver
Updated the code to call the API of MTK GIC v3.

Change-Id: I1bb1771dda4d5532b1b818864f823dbb7a38094d
Signed-off-by: Gavin Liu <gavin.liu@mediatek.com>
2025-02-05 21:37:34 +08:00
Nishant Sharma
37cc7fa539 feat(rdv3): enable the support to fetch dynamic config
To enable the support to load Hafnium as BL32, BL31 needs firmware
configuration info to get BL32 manifest load location. The load address
of BL32 is passed via firmware config info.

Add the support to get the address using fconf framework from dynamic
config info.

Signed-off-by: Nishant Sharma <nishant.sharma@arm.com>
Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com>
Change-Id: I3a2a5706789ed290dc7f4a67e62e03751b930c02
2025-02-05 10:58:38 +00:00
Nishant Sharma
4d9b8281f3 feat(rdv3): add dts files to enable hafnium as BL32
On RD-V3 platform and variants, Hafnium is used as SPMC running at
S-EL2 and manage SP running at S-EL0. Hafnium is loaded and configured
as BL32 image. SP is loaded by SP load framework and configured by
Hafnium.

Add the dts files needed to enable load and configuration of hafnium and
SP.

Signed-off-by: Nishant Sharma <nishant.sharma@arm.com>
Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com>
Change-Id: I7de72052323ff9106d7bedbaaf5ece3272e9a6cd
2025-02-05 10:58:38 +00:00
Rakshit Goyal
12973bcc89 feat(rdv3): define SPMC manifest base address
ARM_SPMC_MANIFEST_BASE defines the base address of the SPMC manifest
used by BL32. In the non-RESET_TO_BL31 case, it is defined relative to
the top of Trusted SRAM. However, for RESET_TO_BL31, the
PLAT_ARM_SPMC_MANIFEST_BASE macro can be used to set it to a different
location which is then used to populate ARM_SPMC_MANIFEST_BASE.

As the RD-V3 platform and its variants have a different SRAM layout
compared to that defined in arm_def.h, define the
PLAT_ARM_SPMC_MANIFEST_BASE macro to an address suitable for this
platform and its variants.

Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com>
Change-Id: I36e1eb21ab3d1c68bddb52c62198fcdfc40d8993
2025-02-05 10:58:38 +00:00
Rakshit Goyal
eab1ed54bf feat(arm): add a macro for SPMC manifest base address
In RESET_TO_BL31, the SPMC manifest base address that is utilized by
bl32_image_ep_info has to be statically defined as DT is not available.
Common arm code sets this to the top of SRAM using macros but it can be
different for some platforms. Hence, introduce the macro
PLAT_ARM_SPMC_MANIFEST_BASE that could be re-defined by platform as per
their use-case. Platforms that utilize arm_def.h would use the existing
value from arm common code.

Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com>
Change-Id: I4491749ad2b5794e06c9bd11ff61e2e64f21a948
2025-02-05 10:58:32 +00:00
Manish V Badarkhe
c0893d3fff Merge "fix(arm): create build directory before key generation" into integration 2025-02-05 11:46:46 +01:00
Gavin Liu
8f7d9bfa0a fix(mt8196): add whole-archive option to prebuilt library
Added `-Wl,--whole-archive` option to the LDLIBS in the platfrom.mk to
ensure that the symbols within the library are not stripped during the
linking process.

Change-Id: I35c728d3ccc98489183285a96f703e02dc7505d3
Signed-off-by: Gavin Liu <gavin.liu@mediatek.com>
2025-02-05 09:58:23 +08:00
Govindraj Raja
0c370e2d59 Merge "feat(mt8196): add SMMU driver for PM" into integration 2025-02-04 18:14:07 +01:00
Jerry Wang
6fb8d8cf84 fix(rdn2): correct RD-N2 StMM uuid format
Edk2 converts StMM GUID to UUID format, which is used in FF-A and linux
kernel. StMM manifest currently provides GUID format. Correcting this to
UUID format.

Change-Id: Ie94728e5ea74d3d9935e0af9a2a601cbafe5ad3d
Signed-off-by: Jerry Wang <Jerry.Wang4@arm.com>
2025-02-04 14:04:35 +01:00
Manish V Badarkhe
697290a916 Merge changes from topic "us_tc_trng" into integration
* changes:
  feat(tc): get entropy with PSA Crypto API
  feat(psa): add interface with RSE for retrieving entropy
  fix(psa): guard Crypto APIs with CRYPTO_SUPPORT
  feat(tc): enable trng
  feat(tc): initialize the RSE communication in earlier phase
2025-02-04 13:19:10 +01:00
Rohit Mathew
6823f5f520 feat(rdv3): add carveout for BL32 image
Add and map the carveout for loading Hafnium as BL32 image. Also define
PLAT_ARM_SP_MAX_SIZE as 3 MB for secure partitions.

Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
Signed-off-by: Nishant Sharma <nishant.sharma@arm.com>
Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com>
Change-Id: I2845eb6807a127c9f6b92de2dabc9a58d25bd4d4
2025-02-04 11:49:19 +00:00
Nishant Sharma
4593b93239 feat(rdv3): introduce platform handler for Group0 interrupt
This patch introduces a handler for RD-V3 variants to handle Group0
secure interrupts. Currently, it is empty but serves as a placeholder
for future Group0 interrupt sources.

Signed-off-by: Nishant Sharma <nishant.sharma@arm.com>
Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com>
Change-Id: Ifa418094f6075a6cdc33e63eec1825103bbf6d68
2025-02-04 11:49:19 +00:00
Nishant Sharma
82f46593de feat(neoverse-rd): use larger stack size when S-EL2 spmc is enabled
Larger stack size is needed when S-EL2 SPMC is enabled. This is required
because BL31 xlat map framework makes more nested calls when this
feature is enabled.

Signed-off-by: Nishant Sharma <nishant.sharma@arm.com>
Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com>
Change-Id: Ib3f2abf38b576ba96402dab4ba995d8b648b4cc7
2025-02-04 11:49:19 +00:00
Rakshit Goyal
842ba2f221 fix(neoverse-rd): set correct SVE vector lengths
Affected platforms: RD-N2, RD-V1, RD-V1-MC, RD-V3 and their
configurations.

Previously, the SVE vector lengths for these platforms were
being taken from the default configuration. This commit updates
their respective platform.mk files to specify the correct vector
lengths.

Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com>
Change-Id: I8919257e2cec5c0e819424ff44a623dc3ab1a368
2025-02-04 11:49:19 +00:00
Olivier Deprez
aacdfdfe2b Merge "fix(tc): enable Last-level cache (LLC) for tc4" into integration 2025-02-04 11:58:30 +01:00
Olivier Deprez
a0883e9e74 Merge "refactor(bl32): flush before console switch state" into integration 2025-02-04 11:34:06 +01:00
Leo Yan
8f0235fb8f feat(tc): get entropy with PSA Crypto API
The PSA Crypto API is available with sending messages to RSE.  Change
to invoke PSA Crypto API for getting entropy.

Change-Id: I4b2dc4eb99606c2425b64949d9c3f5c576883758
Signed-off-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Icen Zeyada <Icen.Zeyada2@arm.com>
2025-02-04 10:28:18 +00:00
Leo Yan
2ae197acd6 feat(tc): enable trng
Enable the trng on the platform, which can be used by other features.
`rng-seed` has been removed and enabled `FEAT_RNG_TRAP` to trap to EL3
when accessing system registers RNDR and RNDRRS

Change-Id: Ibde39115f285e67d31b14863c75beaf37493deca
Signed-off-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Icen Zeyada <Icen.Zeyada2@arm.com>
2025-02-04 10:26:00 +00:00
Olivier Deprez
895d973d41 Merge "fix(morello): remove stray white-space in 'morello/platform.mk'" into integration 2025-02-04 11:20:13 +01:00
Yong Wu
86dd08d838 feat(mt8196): add SMMU driver for PM
Add MediaTek SMMU power driver. This driver tracks the reference
counter for power domain access on SMMU hardware, including
Multimedia SMMU and APU SMMU. The PM get/put commands may come from
linux(EL1) and hypervisor(EL2).

Change-Id: I60f83c4e3d87059b0549b2ed8c68367be3bfbbc5
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
2025-02-04 10:39:57 +08:00
Govindraj Raja
a726d56074 Merge "feat(mt8196): enable appropriate errata" into integration 2025-02-03 16:49:02 +01:00
Leo Yan
a3f9617964 feat(tc): initialize the RSE communication in earlier phase
Move the RSE MHU channel initialization to the platform setup phase,
this allows the services (e.g. TRNG service) to talk to RSE during the
service init function.

Change-Id: Id0ff6e49117008463f11b2dc3c585daca00f609c
Signed-off-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Icen Zeyada <Icen.Zeyada2@arm.com>
2025-02-03 14:50:40 +00:00
Manish V Badarkhe
db69d11829 fix(arm): create build directory before key generation
Arm ROTPK generation may start before the build directory is
created, causing errors like:

 00:45:53.235 Can't open "/home/buildslave/workspace/tf-a-coverity/
 trusted-firmware-a/build/rd1ae/debug/arm_rotpk.bin" for writing,
 No such file or directory

This patch ensures the build directory is created beforehand to
prevent such issues.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I73f7d5af00efc738e95ea79c5cacecdb6a2d20c6
2025-02-03 09:37:50 +00:00
Joanna Farley
fdbd18b56c Merge "fix(zynqmp): fix length of clock name" into integration 2025-02-03 10:00:35 +01:00
Olivier Deprez
56d8842052 Merge "feat(tc): enable stack protector" into integration 2025-02-03 08:35:29 +01:00
Douglas Anderson
0d11e62e67 feat(mt8196): enable appropriate errata
Booting mt8196 and grepping the logs for "errat" showed:

  WARNING: BL31: cortex_a720: CPU workaround for erratum 2792132 was missing!
  WARNING: BL31: cortex_a720: CPU workaround for erratum 2844092 was missing!
  WARNING: BL31: cortex_a720: CPU workaround for erratum 2926083 was missing!
  WARNING: BL31: cortex_a720: CPU workaround for erratum 2940794 was missing!
  WARNING: BL31: cortex_x4: CPU workaround for erratum 2726228 was missing!
  WARNING: BL31: cortex_x4: CPU workaround for erratum 2740089 was missing!
  WARNING: BL31: cortex_x4: CPU workaround for erratum 2763018 was missing!
  WARNING: BL31: cortex_x4: CPU workaround for erratum 2816013 was missing!
  WARNING: BL31: cortex_x4: CPU workaround for erratum 2897503 was missing!
  WARNING: BL31: cortex_x4: CPU workaround for erratum 2923985 was missing!
  WARNING: BL31: cortex_x4: CPU workaround for erratum 3076789 was missing!

Set defines so that all the errata are fixed. Now the above shows:

  INFO:    BL31: cortex_a720: CPU workaround for erratum 2792132 was applied
  INFO:    BL31: cortex_a720: CPU workaround for erratum 2844092 was applied
  INFO:    BL31: cortex_a720: CPU workaround for erratum 2926083 was applied
  INFO:    BL31: cortex_a720: CPU workaround for erratum 2940794 was applied
  INFO:    BL31: cortex_x4: CPU workaround for erratum 2726228 was applied
  INFO:    BL31: cortex_x4: CPU workaround for erratum 2740089 was applied
  INFO:    BL31: cortex_x4: CPU workaround for erratum 2763018 was applied
  INFO:    BL31: cortex_x4: CPU workaround for erratum 2816013 was applied
  INFO:    BL31: cortex_x4: CPU workaround for erratum 2897503 was applied
  INFO:    BL31: cortex_x4: CPU workaround for erratum 2923985 was applied
  INFO:    BL31: cortex_x4: CPU workaround for erratum 3076789 was applied

Change-Id: I209784c2574b99c3c275ac60adf73896e0cdd078
Signed-off-by: Douglas Anderson <dianders@chromium.org>
2025-02-01 01:01:33 +01:00
Govindraj Raja
6ef685a913 Merge changes I58637b8d,I4bb1a50a,Iadac6549,I758e933f into integration
* changes:
  feat(mt8196): turn on APU smpu protection
  feat(mt8196): enable APU spmi operation
  feat(mt8196): add Mediatek MMinfra stub implementation
  feat(mt8196): enable cirq for MediaTek MT8196
2025-01-31 17:15:55 +01:00
Leo Yan
d1de6b2b57 feat(tc): enable stack protector
Enable the compiler's stack protector for detecting stack overflow
issues.

Though TC platform can generate RNG from RSE via MHU channel, the
stack protector canary is used prior to MHU channel initialization.

Thus, currently here simply returns a value of the combination of a
timer's value and a compile-time constant.

Signed-off-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Icen Zeyada <Icen.Zeyada2@arm.com>
Change-Id: I68fcc7782637b2b6b4dbbc81bc15df8c5ce0040b
2025-01-31 13:45:28 +01:00
Olivier Deprez
a2c5171461 Merge "fix(intel): update debug messages to appropriate class" into integration 2025-01-31 12:02:18 +01:00
Olivier Deprez
5cef096e4c Merge "fix(intel): update warm reset routine and bootscratch register usage" into integration 2025-01-31 12:01:35 +01:00
Olivier Deprez
de5943f94c Merge changes from topic "Id18b0341353ffc00e44e2d3c643ccdd05cc20c4f" into integration
* changes:
  fix(rk3399): fix unquoted .incbin for clang
  fix(rk3399): mark INCBIN-generated sections as SHF_ALLOC
2025-01-31 11:52:13 +01:00
Olivier Deprez
3ce41dc7cc Merge "fix(rdv3): add console name to checksum calculation on RD-V3" into integration 2025-01-31 10:36:12 +01:00
Peter Robinson
f535068c84 fix(zynqmp): fix length of clock name
The CLK_NAME_LEN variable is set to 15 but with more
hardening we get the following error for the
pss_alt_ref_clk name so bump the length slightly
to take all the requirements into account.

plat/xilinx/zynqmp/pm_service/pm_api_clock.c:2248:25: error: initializer-string for array of ‘char’ is too long [-Werror=unterminated-string-initialization]
2248 |                 .name = "pss_alt_ref_clk",
     |                         ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Fixes: caae497df ("zynqmp: pm: Add clock control EEMI API and ioctl functions")
Change-Id: I399271dd257c6e40a2d319c47f2588a958a5491b
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2025-01-30 20:28:45 +01:00
Manish Pandey
a2ea98598c Merge "fix(versal-net): remove_redundant_lock_defs" into integration 2025-01-30 16:32:41 +01:00
Karl Li
5de1ace54a feat(mt8196): turn on APU smpu protection
1. Turn on APU SMPU protection on MT8196.
2. Remove unused header file.

Change-Id: I58637b8dda4bf68253bc2329580963a8bd9cca8b
Signed-off-by: Karl Li <karl.li@mediatek.com>
2025-01-30 23:32:30 +08:00
Karl Li
823a57e11c feat(mt8196): enable APU spmi operation
Enable APU spmi operation after spmi module ready

Change-Id: I4bb1a50a635e8798b049295dbbf98967daff5997
Signed-off-by: Karl Li <karl.li@mediatek.com>
2025-01-30 23:30:59 +08:00
Yong Wu
4794746eec feat(mt8196): add Mediatek MMinfra stub implementation
Implement stub functions for the MMinfra (Multimedia Infrastructure)
driver to ensure that the build can pass when a prebuilt library is
not available.

Change-Id: Iadac654950c868d3743b13a1d6f7ab5d1015fb86
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
2025-01-30 23:30:09 +08:00
ot_chhao.chang
49d8c11285 feat(mt8196): enable cirq for MediaTek MT8196
- Add CIRQ related information.

Signed-off-by: ot_chhao.chang <ot_chhao.chang@mediatek.com>
Change-Id: I758e933f9d53f7bfb16e3d7feb1c7f53516b1da6
2025-01-30 23:28:17 +08:00