Commit graph

16371 commits

Author SHA1 Message Date
Yann Gautier
23828430f3 Merge "feat(intel): add FDT support for Altera products" into integration 2025-02-24 17:10:17 +01:00
Jit Loon Lim
29d1e29d7c feat(intel): add FDT support for Altera products
Support FDT for Agilex5 platform
1. Created wrapper file socfpga_dt.c
2. Added in Agilex5 dts file
3. Implemented fdt_check_header
4. Implemented gic configuration
5. Implemented dram configuration

Remove init of FDT as Agilex5 has no plan to roll
out FDT at the moment.

Change-Id: If3990ed9524c6da5b3cb8966b63bc4a95d01fcda
Signed-off-by: Jit Loon Lim <jit.loon.lim@altera.com>
2025-02-24 22:48:04 +08:00
Soby Mathew
0690c237a4 Merge "fix(rmm): add support for BRBCR_EL2 register for feat_brbe" into integration 2025-02-24 15:14:07 +01:00
Boyan Karatotev
839739e234 docs(ras): document RAS considerations with powerdown
RAS errors can cause problems for powerdown. On cpus like the A510,
receiving a RAS error after executing the powerdown `wfi` will deadlock
the core. The TRM suggests disabling the generation of interrupts.
However, which interrupts to disable is not apparent for generic code as
the meaning of each error record is *heavily* IMPDEF, despite the
standard format. Iterating over the list and disabling all is not
desirable as this might disable errors for components that do not have
an effect on the core that is powering down.

As such, leave this for the platform port to handle. Leave a note in the
porting guide so this is not missed.

Change-Id: I43c3f6f909fafc449d3b4e748b015b05338d9618
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-24 09:43:53 +00:00
Boyan Karatotev
21d068bedb refactor(cpus): declare runtime errata correctly
There errata don't have a workaround in the cpu file. So calling the
wrappers is redundant. We can simply register them with the framework.

Change-Id: I316daeee603e86c9f2bdccf91e1b10f7ec6c3f9d
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-24 09:36:11 +00:00
Boyan Karatotev
89dba82dfa perf(cpus): make reset errata do fewer branches
Errata application is painful for performance. For a start, it's done
when the core has just come out of reset, which means branch predictors
and caches will be empty so a branch to a workaround function must be
fetched from memory and that round trip is very slow. Then it also runs
with the I-cache off, which means that the loop to iterate over the
workarounds must also be fetched from memory on each iteration.

We can remove both branches. First, we can simply apply every erratum
directly instead of defining a workaround function and jumping to it.
Currently, no errata that need to be applied at both reset and runtime,
with the same workaround function, exist. If the need arose in future,
this should be achievable with a reset + runtime wrapper combo.

Then, we can construct a function that applies each erratum linearly
instead of looping over the list. If this function is part of the reset
function, then the only "far" branches at reset will be for the checker
functions. Importantly, this mitigates the slowdown even when an erratum
is disabled.

The result is ~50% speedup on N1SDP and ~20% on AArch64 Juno on wakeup
from PSCI calls that end in powerdown. This is roughly back to the
baseline of v2.9, before the errata framework regressed on performance
(or a little better). It is important to note that there are other
slowdowns since then that remain unknown.

Change-Id: Ie4d5288a331b11fd648e5c4a0b652b74160b07b9
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-24 09:36:11 +00:00
Boyan Karatotev
b07c317f67 perf(cpus): inline the init_cpu_data_ptr function
Similar to the reset function inline, inline this too to not do a costly
branch with no extra cost.

Change-Id: I54cc399e570e9d0f373ae13c7224d32dbdfae1e5
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-24 09:36:11 +00:00
Boyan Karatotev
0d020822ae perf(cpus): inline the reset function
Similar to the cpu_rev_var and cpu_ger_rev_var functions, inline the
call_reset_handler handler. This way we skip the costly branch at no
extra cost as this is the only place where this is called.

While we're at it, drop the options for CPU_NO_RESET_FUNC. The only cpus
that need that are virtual cpus which can spare the tiny bit of
performance lost. The rest are real cores which can save on the check
for zero.

Now is a good time to put the assert for a missing cpu in the
get_cpu_ops_ptr function so that it's a bit better encapsulated.

Change-Id: Ia7c3dcd13b75e5d7c8bafad4698994ea65f42406
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-02-24 09:36:10 +00:00
Yann Gautier
dae7d72984 Merge "feat(rockchip): increase FDT Buffer for Rockchip Devices" into integration 2025-02-24 09:18:52 +01:00
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