Commit graph

16413 commits

Author SHA1 Message Date
Yann Gautier
9020b9ac1b Merge "feat(rockchip): update uart baudrate for rk3399" into integration 2025-02-24 09:18:31 +01:00
XiaoDong Huang
036935a814 feat(rk3576): support rk3576
rk3576 is an Octa-core soc with Cortex-a53/a72 inside.
This patch supports the following functions:
1. basic platform setup
2. power up/off cpus
3. suspend/resume cpus
4. suspend/resume system
5. reset system
6. power off system

Change-Id: I67a019822bd4af13e4a3cdd09cf06202f4922cc4
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2025-02-24 15:07:43 +08:00
Olivier Deprez
02f0e6e4f9 Merge "fix(rme): map DEVICE0_BASE as EL3_PAS" into integration 2025-02-21 11:51:57 +01:00
Joanna Farley
49d02511d7 Merge changes from topic "versal2-pm-support" into integration
* changes:
  feat(versal2): extended SMCCC payload for EEMI
  feat(versal2): add support for platform management
  feat(versal2): add dependency macro for PM
2025-02-21 10:42:57 +01:00
Senthil Nathan Thangaraj
0cc5e21055 feat(versal2): extended SMCCC payload for EEMI
Until Versal, the extended SMCCC payload was supported only for
QUERY_DATA, while other APIs used the legacy SMCCC format.

In Versal Gen 2, all EEMI APIs are supported with extended SMCCC
payload only, enabling a simplified and efficient pass-through
implementation.

Also, set TFA_NO_PM to 0 to enable power management by default.

Change-Id: I937be3c78ebe87c62f8697a0a82cdcd21c185f56
Signed-off-by: Senthil Nathan Thangaraj <senthilnathan.thangaraj@amd.com>
2025-02-21 07:31:47 +01:00
Senthil Nathan Thangaraj
414cf08b76 feat(versal2): add support for platform management
Add support for PM functionality through EEMI interface for
Versal Gen 2. Add support of PM APIs in PSCI ops. Add
TFA_NO_PM flag to disable PM functionality. Enable wakeup for
new peripherals

Change-Id: I1bf67dc46af91ee113c627d32ae6ecc1dad386c2
Signed-off-by: Naman Trivedi <naman.trivedimanojbhai@amd.com>
Signed-off-by: Senthil Nathan Thangaraj <senthilnathan.thangaraj@amd.com>
2025-02-20 22:23:12 -08:00
Sona Mathew
41ae047352 fix(rmm): add support for BRBCR_EL2 register for feat_brbe
Currently BRBE is being disabled for Realm world in EL3 by
switching the SBRBE bit in mdcr_el3 register to 0b00.
The patch removes the switching of SBRBE bits, and adds
context switch of BRBCR_EL2 register.

Change-Id: I66ca13edefc37e40fa265fd438b0b66f7d09b4bb
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2025-02-20 21:13:32 -06:00
Senthil Nathan Thangaraj
aec66c38c7 feat(versal2): add dependency macro for PM
The pm_api_sys.c file has dependency on the PLAT_ARM_GICR_BASE macro.
Add the macro to fix compilation error when PM is enabled.

Change-Id: Ibd77dd38b4a2a55614064c4ed0b1096acc658a5c
Signed-off-by: Naman Trivedi <naman.trivedimanojbhai@amd.com>
Signed-off-by: Senthil Nathan Thangaraj <senthilnathan.thangaraj@amd.com>
2025-02-20 11:41:18 -08:00
Boyan Karatotev
36eeb59f9e perf(cpus): inline the cpu_get_rev_var call
Similar to the cpu_rev_var_xy functions, branching far away so early in
the reset sequence incurs significant slowdowns. Inline the function.

Change-Id: Ifc349015902cd803e11a1946208141bfe7606b89
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-20 17:28:59 +00:00
Boyan Karatotev
7791ce21a6 perf(cpus): inline cpu_rev_var checks
We strive to apply errata as close to reset as possible with as few
things enabled as possible. Importantly, the I-cache will not be
enabled. This means that repeated branches to these tiny functions must
be re-fetched all the way from memory each time which has glacial speed.
Cores are allowed to fetch things ahead of time though as long as
execution is fairly linear. So we can trade a little bit of space (3 to
7 instructions per erratum) to keep things linear and not have to go to
memory.

While we're at it, optimise the the cpu_rev_var_{ls, hs, range}
functions to take up less space. Dropping the moves allows for a bit of
assembly magic that produces the same result in 2 and 3 instructions
respectively.

Change-Id: I51608352f23b2244ea7a99e76c10892d257f12bf
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-20 17:28:59 +00:00
Boyan Karatotev
b62673c645 refactor(cpus): register DSU errata with the errata framework's wrappers
The existing DSU errata workarounds hijack the errata framework's inner
workings to register with it. However, that is undesirable as any change
to the framework may end up missing these workarounds. So convert the
checks and workarounds to macros and have them included with the
standard wrappers.

The only problem with this is the is_scu_present_in_dsu weak function.
Fortunately, it is only needed for 2 of the errata and only on 3 cores.
So drop it, assuming the default behaviour and have the callers handle
the exception.

Change-Id: Iefa36325804ea093e938f867b9a6f49a6984b8ae
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-20 17:28:17 +00:00
Olivier Deprez
74dd541f91 Merge "fix(simd): fix base register in fpregs_context_*" into integration 2025-02-20 17:33:31 +01:00
Manish V Badarkhe
99b2ae269e Merge changes from topic "jw/gic-lca-support" into integration
* changes:
  fix(rdn2): add LCA multichip data for RD-N2-Cfg2
  fix(rdv3): add LCA multichip data for RD-V3-Cfg2
  feat(gic): add support for local chip addressing
2025-02-20 17:17:35 +01:00
Boyan Karatotev
b54771678d refactor(cpus): convert checker functions to standard helpers
The library check_erratum_ls already incorporates the check. The return
of ERRATA_MISSING is handled in the errata_report.c functions.

Change-Id: Ic1dff2bc5235195f7cfce1709cd42467f88b3e4c
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-20 09:24:46 +00:00
Boyan Karatotev
52e89e9e1d refactor(cpus): convert the Cortex-A65 to use the errata framework
Result was verified by manually stepping through the reset function with
a debugger.

Change-Id: I91cd6111ccf95d6b7ee2364ac2126cb98ee4bb15
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-20 09:24:46 +00:00
Boyan Karatotev
5cba510ee3 fix(cpus): declare reset errata correctly
The errata in this patch are declared as runtime, but are never called
explicitly. This means that they are never called! Convert them to reset
errata so that they are called at reset. Their SDENs entries have been
checked and confirm that this is how they should be implemented.

Also, drop the the MIDR check on the a57 erratum as it's not needed -
the erratum is already called from a cpu-specific function.

Change-Id: I22c3043ab454ce94b3c122c856e5804bc2ebb18b
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-20 09:24:45 +00:00
Govindraj Raja
722efeaa8c Merge "refactor(cpufeat): add FGT2 and Debugv8p9 to realm state" into integration 2025-02-19 19:13:39 +01:00
Govindraj Raja
d0472d9950 Merge "fix(cpus): fix a typo in errata doc" into integration 2025-02-19 18:32:00 +01:00
Govindraj Raja
845213ed0d fix(cpus): fix a typo in errata doc
Commit@af5ae9a73f67dc8c9ed493846d031b052b0f22a0
Adding a Cortex-A720-AE erratum 3699562 has a typo in CPU name
for the errata, it is for Cortex-A720-AE but had incorrectly
mentioned as Cortex-A715_AE.

Change-Id: I2332a3fcaf56a7aaab5a04e3d40428cc746d2d46
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2025-02-19 09:37:35 -06:00
Manish Pandey
b478432d81 Merge "fix(psci): check if a core is the last one in a requested power level" into integration 2025-02-19 13:18:28 +01:00
Sona Mathew
8c52ca8c17 refactor(cpufeat): add FGT2 and Debugv8p9 to realm state
Enable FEAT_FGT2 and FEAT_Debugv8p9 in Realm state as well.

Change-Id: Ib9cdde3af328ffdd8718b1ba404265757f2e542b
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2025-02-18 14:25:50 -06:00
Chris Morgan
ab99dce4b7 feat(rockchip): increase FDT Buffer for Rockchip Devices
Modify the FDT buffer for Rockchip devices to 384KiB. This is done to
allow us to pass mainline devicetrees with symbols through Arm Trusted
Firmware. 384KiB was chosen as 512KiB is very near the maximum
supported with the current reserved memory. As of kernel version 6.13,
the largest devicetree with symbols enabled is 215KiB, and the largest
Rockchip devicetree with symbols enabled is 176KiB
(rk3588-evb1-v10.dtb).

Change-Id: Iea9343d7a30ee26cad3ee5cc848980a93873ae34
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
2025-02-18 17:22:03 +01:00
Olivier Deprez
0035ab76e5 Merge "feat(qemu): add hob support for qemu platforms" into integration 2025-02-18 17:18:23 +01:00
Olivier Deprez
a229e41a86 Merge changes from topic "nxp-clk/add_usdhc_clock" into integration
* changes:
  feat(s32g274a): enable sdhc clock
  feat(nxp-clk): add clock modules for uSDHC
  feat(nxp-clk): get MC_CGM divider's parent
  feat(nxp-clk): get MC_CGM divider's rate
  feat(nxp-clk): set MC_CGM divider's rate
  feat(nxp-clk): enable MC_CGM dividers
  feat(nxp-clk): get parent for the fixed dividers
  feat(nxp-clk): set the rate for partition objects
  feat(nxp-clk): add clock objects for CGM dividers
  feat(nxp-clk): add base address for PERIPH_DFS
2025-02-18 15:23:50 +01:00
Manish Pandey
dd9be1160a Merge "fix(spmd): prevent SIMD context loss" into integration 2025-02-18 12:59:04 +01:00
Ghennadi Procopciuc
47b3a8251f feat(s32g274a): enable sdhc clock
The uSDHC module clock must be enabled to use the SD/eMMC storage from
where the BL2 is expected to load images for the next boot stages.

Change-Id: Ib1cc7d5dda7a4283a29716f5b3d776048bd5b7ba
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2025-02-18 09:59:04 +02:00
Ghennadi Procopciuc
cf6d73d4c3 feat(nxp-clk): add clock modules for uSDHC
One of the uSDHC module's clock lines is attached to the CGM_MUX 14
 divider, which is connected to PERIPH_DFS3. The other one is attached
 to XBAR_DIV3.

Change-Id: I23f468a3e5f7daa832c0841b55211a048284a7f0
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2025-02-18 09:59:04 +02:00
Ghennadi Procopciuc
15869048b2 feat(nxp-clk): get MC_CGM divider's parent
The parent of the MC_CGM divider will always be the MC_CGM mux
identified based on s32cc_cgm_div.parent.

Change-Id: Ie13b16e0ee56f35d61374efbe158f166b99960b7
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2025-02-18 09:59:04 +02:00
Ghennadi Procopciuc
ad412c0d82 feat(nxp-clk): get MC_CGM divider's rate
The MC_CGM divider's frequency is obtained based on the state of the
settings found in its registers. If the divider is disabled, the
intended rate (s32cc_cgm_div.freq) will be returned.

Change-Id: I41698990952b530021de26eb51f74aca50176575
Co-developed-by: Florin Buica <florin.buica@nxp.com>
Signed-off-by: Florin Buica <florin.buica@nxp.com>
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2025-02-18 09:59:04 +02:00
Ghennadi Procopciuc
f99078a6a0 feat(nxp-clk): set MC_CGM divider's rate
The MC_CGM divider's frequency is saved as part of the object metadata.
No checks are performed on the requested frequency. It will be validated
during the enablement process.

Change-Id: Ide9c8c64be16a66b66f129735cebfc4d1f1772c5
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2025-02-18 09:59:04 +02:00
Ghennadi Procopciuc
2710bdadc4 feat(nxp-clk): enable MC_CGM dividers
Add the enablement mechanism for the MC_CGM dividers. The division
factor is established by dividing the parent's rate by the rate of the
divider's output.

Change-Id: Iadb84f4f47531a67b0b1509b94e1f2b962631a77
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2025-02-18 09:59:04 +02:00
Ghennadi Procopciuc
35988a9db0 feat(nxp-clk): get parent for the fixed dividers
Fixed dividers contribute to the Linflex and QSPI clocks.

Change-Id: Idb4e6fe883e117b2bb9260b6eeb6e15d75ce887e
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2025-02-18 09:59:02 +02:00
Ghennadi Procopciuc
8501b1fc60 feat(nxp-clk): set the rate for partition objects
Only the partition block link can set the frequency, while the other two
should not be able to because none of them participate in the clock
generation. In the first case, the request will be propagated to the
parent object of the partition link.

Change-Id: Ic237972008eb51c62e92f03f657698a8a1ca4b0e
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2025-02-18 09:53:50 +02:00
Ghennadi Procopciuc
63d536fe18 feat(nxp-clk): add clock objects for CGM dividers
The CGM dividers are controllable dividers attached to a CGM mux. Its
divison factor can be controlled through the MC_CGM's registers.

Change-Id: Id2786a46c5a1d389ca32a4839c7158949aec3b0a
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2025-02-18 09:53:50 +02:00
Ghennadi Procopciuc
29f8a952cb feat(nxp-clk): add base address for PERIPH_DFS
The PERIPH_DFS module is used to clock the SD and QSPI modules.

Change-Id: I440fd806d71acab641f0003a7f2a5ce720b469c6
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2025-02-18 09:53:50 +02:00
Olivier Deprez
472beb3fe3 Merge "fix(libc): remove __Nonnull type specifier" into integration 2025-02-17 14:29:13 +01:00
AlexeiFedorov
b577248061 fix(rme): map DEVICE0_BASE as EL3_PAS
To pass SMMUv3 Realm Page 0 address to RMM
in Boot Manifest, BL31 needs to read SMMU_ROOT_IDR0
register. BL31 at EL3 runs in Root mode, but
CoreSight and peripherals at DEVICE0_BASE
(0x2000_0000) including SMMUv3 at 0x2B40_0000 are
mapped as MT_SECURE which results in RAZ access
to all SMMUv3 registers after enabling MMU.
This patch changes MT_SECURE mapping to EL3_PAS
resulting in MT_SECURE (ENABLE_RME = 0), and
MT_ROOT (ENABLE_RME = 1).

Change-Id: I3d9ae7c86e4836dd6722fa64116a14d8c8aed8da
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2025-02-17 13:53:37 +01:00
Joanna Farley
7a6230c18c Merge changes from topic "xlnx_fix_plat_ret_dt_tl" into integration
* changes:
  fix(versal2): pass tl address to bl32
  fix(xilinx): runtime console to handle dt failure
  refactor(xilinx): refactor console to support transfer list
  chore(xilinx): propagate error code
  feat(versal2): retrieve DT address from transfer list
  chore(versal2): move xfer-list file paths
  fix(versal2): update transfer list as optional
2025-02-17 13:21:11 +01:00
Maheedhar Bollapalli
1fb3446ed2 fix(versal2): pass tl address to bl32
Pass transfer list address to BL32 as an argument during boot time.

Change-Id: Ic63649b9c41cfae2365ec5911dcab63a7dd005ff
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-02-17 06:11:11 +00:00
Maheedhar Bollapalli
0791be8813 fix(xilinx): runtime console to handle dt failure
If the Device Tree is missing or parsing fails in the runtime
console, the console still gets registered with zeroed DT values,
leading to a panic due to the absence of a console type.
Added fallback option and check for zero base address.

Change-Id: I5f5e0222685ba015ab7db2ecbd46d906f5ab9116
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-02-17 06:11:10 +00:00
Maheedhar Bollapalli
4c5cf47f98 refactor(xilinx): refactor console to support transfer list
Refactor console to support DTB console in case of transfer list.
Simplify logic where SOC specific macros are moved to platform headers
or makefile where XLNX_DT_CFG macro describe if system is DT driven or not.

Change-Id: Id45c03a950b62e83e91a50e0485eacdb233ba745
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-02-17 06:11:10 +00:00
Maheedhar Bollapalli
c5c108b1aa chore(xilinx): propagate error code
Propagate error instead of making own error code.

Change-Id: I9300ad342e98ca0e730b091510d9d62747b81a5f
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-02-17 06:11:10 +00:00
Maheedhar Bollapalli
ea453871ef feat(versal2): retrieve DT address from transfer list
On versal2 platform, unlike current static DT address passing
mechanism, DT address is retrieved from transfer list dynamically.

Change-Id: I44b9a0753809652f26bc1b7e061f5364229ba352
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-02-17 06:11:10 +00:00
Maheedhar Bollapalli
c41edd807d chore(versal2): move xfer-list file paths
Only Versal Gen 2 platform supports transfer list.
Move transfer list files to versal2 common path.

Change-Id: I2795270a77e2af5e012c82c7b5916fa1f90f0497
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-02-17 06:11:10 +00:00
Maheedhar Bollapalli
5cb9125e96 fix(versal2): update transfer list as optional
Updated transfer list feature as optional and user should explicitly
provide build time argument to enable transfer list.
In TL optional case TL address range is utilized as default dtb
address range. Updated default DT address to transfer list address.

Change-Id: Ieeaacb3e6fda4ad1da9330708e19d776bffb06c1
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-02-17 06:10:55 +00:00
Manish V Badarkhe
7ce483e17c fix(libc): remove __Nonnull type specifier
Clang's nullability completeness checks were triggered after adding
the _Nonnull specifier to one function. Removing it prevents Clang
from flagging atexit() for missing a nullability specifier.

 include/lib/libc/stdlib.h:25:25: error: pointer is missing a
 nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
 [-Werror,-Wnullability-completeness]
    25 | extern int atexit(void (*func)(void));

This change ensures compliance with the C standard while preventing
unexpected build errors.

Change-Id: I2f881c55b36b692d22c3db22149c6402c32e8c3e
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2025-02-16 23:05:07 +00:00
Govindraj Raja
0715f858b6 Merge changes I3d7a5a92,I5b2d035e into integration
* changes:
  fix(mt8196): remove EC_SUSPEND_PIN initial setting
  fix(mt8196): remove SPM support for ES chip
2025-02-13 16:58:33 +01:00
Manish V Badarkhe
26f789db98 Merge "fix(neoverse-rd): initialize CNTFRQ_EL0 for RESET_TO_BL31" into integration 2025-02-13 16:49:23 +01:00
Manish V Badarkhe
e0be63c880 Merge changes I712712d7,I1932500e,I75dda77e,I12f3b8a3,Ia72e5900 into integration
* changes:
  refactor(rse)!: remove rse_comms_init
  refactor(arm): switch to rse_mbx_init
  refactor(rse): put MHU code in a dedicated file
  refactor(tc): add plat_rse_comms_init
  refactor(arm)!: rename PLAT_MHU_VERSION flag
2025-02-13 16:03:10 +01:00
Lokesh B V
94a4383a2b fix(neoverse-rd): initialize CNTFRQ_EL0 for RESET_TO_BL31
When RESET_TO_BL31 was enabled, CNTFRQ_EL0 was left uninitialized,
leading to incorrect system counter frequency settings. This
impacted timer-dependent components, such as SMMUv3, causing
initialization failures and unpredictable behavior.

To fix this, CNTFRQ_EL0 is now explicitly set using
plat_get_syscnt_freq2(), ensuring the correct system timer
frequency and proper initialization of dependent components.

Signed-off-by: Lokesh B V <Lokesh.BV@Arm.com>
Change-Id: I808b17d25c87c4dce1bc2c8171a800b69b5c2908
2025-02-13 18:56:18 +05:30