Commit graph

1824 commits

Author SHA1 Message Date
Manish V Badarkhe
0c755a2c66 Merge changes from topic "mbedtls-config-cleanup" into integration
* changes:
  chore(qemu): remove duplicate define
  chore(imx): remove duplicate define
  chore(arm): remove duplicate defines
  chore(mbedtls): remove hash configs
2024-09-04 12:18:36 +02:00
Jimmy Brisson
48ee4995c5 chore(mbedtls): remove hash configs
After the upgrade to mbedtls 3.6.0, some of these configuation limitations
are no longer present.

Size chages:
build config | executable | Delta
-------------|------------|-------
tbb ecdsa    | bl1        |  -176
-------------|------------|-------
tbb rsa      | bl1        |  -192
             | bl2        | -4096
-------------|------------|-------
drtm         | romlib     |  -576
-------------|------------|-------
spm          | romlib     |  -576
-------------|------------|-------
mb384        | romlib     | -1016

Change-Id: I019bc59adc93cf95f6f28ace9579e7bf1e785b62
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2024-09-04 10:55:15 +02:00
Manish V Badarkhe
a12ff0393c Merge "fix(rpi3): use correct define for GPIO reg_clr" into integration 2024-08-28 16:53:09 +02:00
Madhukar Pappireddy
d76d27e978 Merge changes from topic "stm32mp2_bl2_updates" into integration
* changes:
  feat(stm32mp2): load fw-config file
  feat(stm32mp2): add fw-config compilation
  feat(stm32mp2-fdts): add fw-config files for STM32MP257F-EV1
  feat(stm32mp2-fdts): add fw-config file
  feat(stm32mp2-fdts): add clock tree for STM32MP257F-EV1
  feat(stm32mp2): enable DDR sub-system clock
  feat(stm32mp2): add fixed regulators support
  feat(stm32mp2): print board info
  feat(stm32mp2): display CPU info
  feat(stm32mp2): get chip ID
  feat(stm32mp2): add BL2 boot first steps
  feat(stm32mp2): add defines for the PWR peripheral
  feat(stm32mp2-fdts): add SD-card and eMMC support on STM32MP257F-EV1
  feat(stm32mp2-fdts): add sdmmc pins definition
  feat(stm32mp2-fdts): add sdmmc nodes in SoC DT file
  feat(stm32mp2-fdts): add io_policies
  feat(stm32mp2-fdts): remove pins-are-numbered
2024-08-22 18:38:03 +02:00
Madhukar Pappireddy
5eac9fea5e Merge changes from topic "nxp-drivers/add-linflex-clk" into integration
* changes:
  feat(nxp-clk): enable UART clock
  feat(nxp-clk): add PERIPH PLL enablement
2024-08-22 15:09:16 +02:00
Abhi.Singh
9876baf180 fix(rpi3): use correct define for GPIO reg_clr
Changed reg_clr to use the base address + RPI3_GPIO_GPCLR,
this corrects the reg_clr address.

Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
Change-Id: I9ca50905efd4c640f143783c5a00676b246a2e26
2024-08-21 11:53:27 -05:00
Ghennadi Procopciuc
e4462dae81 feat(nxp-clk): enable UART clock
Before this change, the internal oscillator clocked the UART with a
frequency of 48MHz. With the necessary support added, the UART clock
rate is increased to 125MHz by changing the clock source from FIRC to
PERIPH PLL PHI3.

Change-Id: I3160dc6860ebf441c9bea8eaf9d8d12de48bd647
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-08-20 16:28:56 +03:00
Ghennadi Procopciuc
8653352ad7 feat(nxp-clk): add PERIPH PLL enablement
Peripheral PLL is one of the platform's PLLs, providing a clock for
peripherals such as UART, QSPI, uSDHC, SPI and CAN. Its source can be
either the FIRC or FXOSC oscillators. It has eight outputs (PHIs) and
their frequencies can be controlled programmatically using output
dividers. An additional output clocks the PERIPH DFS using the VCO
frequency of the PERIPH PLL.

Change-Id: I637294b2da94f35e95dc1750dad36c129a276bb9
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-08-20 16:28:56 +03:00
Ghennadi Procopciuc
95ac568b61 feat(nxp-drivers): add Linflex flush callback
Implement a flush callback for the Linflex UART driver to avoid cases
where the BL31 stage reinitializes the console while there is ongoing TX
initiated by the BL2.

Change-Id: Ic49852f809198362de1f993474c7c45f1439dc98
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-08-20 07:57:47 +03:00
Manish V Badarkhe
26f2f24c69 Merge changes from topic "cot-dt2c" into integration
* changes:
  feat(arm): update documentation for cot-dt2c
  feat(arm): remove the bl2 static c file
  feat(arm): generate tbbr c file CoT dt2c
  feat(arm): makefile invoke CoT dt2c
  feat(auth): standalone CoT dt2c tool
  refactor(auth): separate bl1 and bl2 CoT
  refactor(st): align the NV counter naming
  refactor(fvp): align the NV counter naming
2024-08-14 18:52:20 +02:00
Peng Fan
66668c77cb fix(gicv3): wait rwp when gicr_ctrl.enablelpis from 1 to 0
Per GIC architecture version 3 and version 4, Where the GICR_CTRL.EnableLPIs
remains programmable:
- Software must observe GICR_CTLR.RWP==0 after clearing GICR_CTLR.EnableLPIs
  from 1 to 0 before writing GICR_PENDBASER or GICR_PROPBASER, otherwise
  behavior is UNPREDICTABLE.
- Software must observe GICR_CTLR.RWP==0 after clearing GICR_CTLR.EnableLPIs
  from 1 to 0 before setting GICR_CTLR.EnableLPIs to 1, otherwise behavior is
  UNPREDICTABLE.

After changing EnableLPIs from 1 to 0, wait RWP got cleared, otherwise
setting EnableLPIs from 0 to 1 may fail.

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Tested-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Change-Id: I6aaf96dc9984376de9399d0dac8a8504ba095149
2024-08-13 07:54:54 +02:00
Yann Gautier
5e0be8c024 feat(stm32mp2): enable DDR sub-system clock
Create a DDR helper files, and add a function to enable DDR clocks
in RCC_DDRCPCFGR register.
Call this ddr_sub_system_clk_init() just before clock driver init,
as it needs to be done before enabling DDR PLL clock (PLL2).

Change-Id: I365d6aa034363d0c036ce2d9f944f077ba86e193
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2024-08-12 15:54:52 +02:00
Madhukar Pappireddy
7322e855ec Merge changes from topic "nxp-s32g2/add-xbar-clk" into integration
* changes:
  feat(nxp-clk): enable the XBAR clock
  feat(nxp-clk): add dependencies for the XBAR clock
  feat(nxp-clk): add CGM0 instance
  feat(nxp-clk): add DFS module enablement
  feat(nxp-clk): add clock objects for ARM DFS
  refactor(nxp-clk): organize early clocks in groups
2024-08-09 16:33:51 +02:00
Ghennadi Procopciuc
b8ad8800b2 feat(nxp-clk): enable the XBAR clock
Enable the XBAR clock, which is the primary system clock.

Change-Id: Idaafbb8894472b10e1ed8a35b25967c82106e667
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-08-09 08:15:17 +03:00
Ghennadi Procopciuc
5692f881f5 feat(nxp-clk): add dependencies for the XBAR clock
Add all clock modules required to enable the XBAR clock, including the
DFS, its output dividers and MC_CGM muxes.

Change-Id: Ib9cf82c0e40b76863637ed7602c3a09411d17615
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-08-09 08:15:17 +03:00
Ghennadi Procopciuc
9dbca85ddf feat(nxp-clk): add CGM0 instance
Introduce the MC_CGM0 instance responsible for XBAR and other peripheral
clocks.

Change-Id: Icf1e9ce6e71e4ff446835d1e7b6522bfb6f2b4b6
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-08-09 08:15:17 +03:00
Ghennadi Procopciuc
4cd04c50eb feat(nxp-clk): add DFS module enablement
Implement enable and set_module_rate callbacks for DFS modules.

Change-Id: Ic9d6034ac04adbabd8fc782aea94ce252439f136
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-08-09 08:15:17 +03:00
Manish Pandey
92fead00f9 Merge "fix(gicv3): incorrect impdef power down sequence" into integration 2024-08-08 22:54:08 +02:00
Ghennadi Procopciuc
d3869455a6 refactor(nxp-clk): organize early clocks in groups
This reduces the length of the s32cc_init_early_clks function and offers
space for more early clocks to be added.

Change-Id: I0d11b97779433a6b15cd76c36aefbb7b92381067
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-08-07 13:38:22 +03:00
Xialin Liu
ac106f208f feat(arm): remove the bl2 static c file
There is no need for the bl2 static c file for
CCA and Duaroot CoT, remove them from the repo

Change-Id: I251d085034dae0f6b3c6cefdbb129a9e1dd0530b
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01:00
Xialin Liu
3146a70af2 refactor(auth): separate bl1 and bl2 CoT
Separate the bl1 and bl2 CoT into individual C files for the
upcoming tool, i.e. the CoT device tree-to-source file generator.

Change-Id: I0d24791991b3539c7aef9a562920dc62fecdc69a
Signed-off-by: Xialin Liu <Xialin.Liu@ARM.com>
2024-08-07 08:46:30 +01:00
Madhukar Pappireddy
9babc7c2d6 Merge changes from topic "enable_a53_clk" into integration
* changes:
  feat(nxp-clk): enable the A53 clock
  feat(nxp-clk): add ARM PLL ODIV enablement
  feat(nxp-clk): add ARM PLL enablement
  feat(nxp-clk): set rate for clock muxes
2024-08-06 18:23:58 +02:00
Manish Pandey
0cd2056c78 Merge "fix(nxp-sfp): shift gpio register offsets by 2" into integration 2024-08-06 16:04:22 +02:00
Madhukar Pappireddy
b1925dcfd9 fix(gicv3): incorrect impdef power down sequence
The GICR_WAKER.Sleep and GICR_WAKE.Quiescent functionality is solely
about flushing out the LPI cache and ensuring that the contents are
consistent with external memory.

Hence, as shown in GIC-700 TRM version r3p0, software must poll for
Quiescent bit only if LPIs are supported.

Change-Id: I7d69b208428e24d8a3ff30e81bd1a8ee3d0bda6e
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2024-08-06 09:02:47 -05:00
Ryan Everett
0bc36c839f refactor(mbedtls): rewrite psa crt verification
This new version uses fewer internal functions
in favour of calling equivalent mbedtls APIs.

Change-Id: I0c2c20a74687211f2d554501f57898da07b01739
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-08-01 16:39:13 +01:00
Ghennadi Procopciuc
7004f6782e feat(nxp-clk): enable the A53 clock
Enable the A53 clock at 1GHz, the maximum frequency on S32G2 SoCs.

Change-Id: Ife96792faf8f3f46965bdcf4df75fcca5e39dc6e
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-19 08:40:48 +03:00
Ghennadi Procopciuc
84e82085a1 feat(nxp-clk): add ARM PLL ODIV enablement
Enable the PLL dividers using their memory-mapped interface. Otherwise,
the clock will not be propagated to downstream clock modules.

Change-Id: I39115cb2cb754cee87d7b6b4aa7502c3f1ef37ce
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-19 08:40:14 +03:00
Ghennadi Procopciuc
b5101c452e feat(nxp-clk): add ARM PLL enablement
Add the low-level implementation to enable the ARM PLL oscillator, which
is disabled by default when booting the SoC. It will be used by PLL
diviers, for which support will be added later.

Change-Id: I964fa7374ea9a08c695009176eade01003c1d6c2
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-19 08:39:38 +03:00
Ghennadi Procopciuc
64e0c2260f feat(nxp-clk): set rate for clock muxes
The clock muxes will simply pass the set rate request to the clock
module connected to its source, as they do not alter the frequency.

Change-Id: I5fda8fffa0f46a4be96deac4d6a5a880c9f86ccf
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-19 08:23:18 +03:00
Ghennadi Procopciuc
65739db28b feat(nxp-clk): set rate for clock fixed divider
Add set rate support for fixed divider clock modules of whose role is to
reduce the source frequency by a factor.

Change-Id: I8a29a2c5b1a829db0c396407c3517c9e66caaa93
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-16 16:52:34 +03:00
Ghennadi Procopciuc
44e2130ab9 feat(nxp-clk): add A53 clock objects
These objects are needed to allow early enablement of the A53 core
clock.

Change-Id: I44d81975c8eba8cc6cfd18aeb6c9b324edaa3f01
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-16 16:52:34 +03:00
Ghennadi Procopciuc
de950ef04f feat(nxp-clk): set rate for PLL divider objects
Add implementation for ARM PLL divider rate set mechanism.

Change-Id: I78f4418bcbb5ea0a6ef64675e44bd074d2230ea3
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-16 16:52:34 +03:00
Ghennadi Procopciuc
7ad4e2312f feat(nxp-clk): set rate for PLL objects
Add implementation for ARM PLL rate set mechanism.

Change-Id: Ic859567bd67747f173d425158cdc581801f7446c
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-16 16:52:34 +03:00
Madhukar Pappireddy
c970c1c38f Merge changes from topic "add_s32cc_pll" into integration
* changes:
  feat(nxp-clk): set parent for ARM PLL and MC_CGM muxes
  feat(nxp-clk): add MC_CGM clock objects
  feat(nxp-clk): add set_parent callback
  feat(nxp-clk): add clock objects for ARM PLL
  feat(nxp-clk): add FXOSC clock enablement
2024-07-11 18:10:59 +02:00
Madhukar Pappireddy
f3eaa1bb12 Merge changes from topic "st_mp2_clk_reset" into integration
* changes:
  feat(st-reset): add stm32mp2_reset driver
  feat(st-clock): add STM32MP2 clock driver
  fix(dt-bindings): update STM32MP2 clock and reset bindings
  feat(st-reset): add system reset management
2024-07-11 04:27:32 +02:00
Ghennadi Procopciuc
83af45042d feat(nxp-clk): set parent for ARM PLL and MC_CGM muxes
Set the parent for ARM PLL and MC_CGM muxes as part of the early clocks
enablement.

Change-Id: If88186caad520c3f7bb1fb602de526d940037a1c
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-08 12:03:16 +03:00
Ghennadi Procopciuc
3fa91a9450 feat(nxp-clk): add MC_CGM clock objects
The MC_CGM1 clock objects will participate in A53 clocking.

Change-Id: I7309b630d72ac0ad66df7c299b678454220e0581
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-08 12:03:16 +03:00
Ghennadi Procopciuc
12e7a2cd2f feat(nxp-clk): add set_parent callback
On S32CC SoCs, the set_parent operation will be used on clock modules
that are mux instances in order to establish the clock source. This will
be used for PLLs and MC_CGM muxes.

Change-Id: I7228d379500ea790459b858da8fc0bdcbed4fd62
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-08 12:03:16 +03:00
Ghennadi Procopciuc
a8be748a28 feat(nxp-clk): add clock objects for ARM PLL
Add all the clock objects needed to describe the ARM PLL, which can be
powered by either FXOSC or FIRC oscillators.

Change-Id: I2585ed38178ca1d5c5485adb38af1b3b8d94f1f6
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-08 12:03:16 +03:00
Ghennadi Procopciuc
8ab3435749 feat(nxp-clk): add FXOSC clock enablement
Add the low-level implementation to enable the FXOSC oscillator, which
is disabled by default when booting the SoC. It will be used by PLLs,
for which support will be added later.

Change-Id: Ie784e4e29b8b4453b39d37594c311af940bebf92
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-08 12:03:16 +03:00
Madhukar Pappireddy
638e3aa5a2 Merge changes from topic "add_s32cc_fxosc_clk" into integration
* changes:
  feat(s32g274a): enable BL2 early clocks
  feat(nxp-clk): implement set_rate for oscillators
  feat(nxp-clk): add oscillator clock objects
  feat(nxp-clk): add minimal set of S32CC clock ids
2024-07-05 16:41:27 +02:00
Manish V Badarkhe
a5b97052d8 Merge changes from topic "dpe_target_locality" into integration
* changes:
  feat(tc): provide target_locality info of AP FW components
  refactor(tc): rename DPE header
2024-07-05 15:14:06 +02:00
Chris Webb
21a77e0892 fix(guid-partition): fix unaligned access in load_mbr_header()
load_mbr_header() casts an unaligned pointer to (mbr_entry_t *) then
dereferences struct members with non-trivial alignment requirements.

This causes a bl2 with BOOT_DEVICE=emmc to hang when compiled with clang
18.1.5, although it works when compiled with gcc 14.1.0. Presumably gcc's
-mstrict-align papers over the undefined behaviour whereas clang's doesn't.

Replace the unaligned cast with a safe memcpy() into an mbr_entry_t.

Signed-off-by: Chris Webb <chris@arachsys.com>
Change-Id: Iefd4dac7e390ddf369b8dacdbaf14e599118f91d
2024-07-04 12:33:15 +01:00
Tamas Ban
3201faf356 feat(tc): provide target_locality info of AP FW components
The target_locality attribute is meant to specify that
a certain SW component is expected to run and thereby
send DPE commands from a given security domain. The DPE
service must be capable of determining the locality of
a client on his own. RSE determines the client's locality
based on the MHU channel used for communication.

If the expected locality (specified by the parent component)
is not matching with the determined locality by DPE
service then command fails.

The goal is to protect against spoofing when a
context_handle is stolen and used by a component
that should not have access.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I96d255de231611cfed10eef4335a47b91c2c94de
2024-07-03 15:03:20 +02:00
Ghennadi Procopciuc
66af5425a6 feat(s32g274a): enable BL2 early clocks
s32cc_init_early_clks will be used to increase the frequency of the
clocks which have a performance impact on BL2 boot. This set includes
A53, XBAR, DDR and Linflex clocks. For now, it will only contain the
frequency set for FXOSC. More clock management will be added in the next
commits.

Change-Id: Ie85465884de02f5082185f91749f190f40249c2e
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-02 19:41:59 +03:00
Ghennadi Procopciuc
d937351987 feat(nxp-clk): implement set_rate for oscillators
The set_rate callback will now be applied to FIRC, FXOSC, and SIRC
oscillators. It is a prerequisite for the upcoming commits that will
utilize this capability.

Change-Id: I82d1545c63b3e15497c1c002ff9ec0d7bf990aa0
Signed-off-by: Ciprian Costea <ciprianmarian.costea@nxp.com>
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-02 17:02:49 +03:00
Ghennadi Procopciuc
7c36209b29 feat(nxp-clk): add oscillator clock objects
The oscillator clock objects will be used to describe the FIRC, FXOSC,
and SIRC clocks, all of which are oscillators on S32CC SoCs.

Change-Id: Icf235cc9b8f1d95d2c0051ce9a7655fd120289b8
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-01 21:24:56 +03:00
Ghennadi Procopciuc
086ee20fe7 feat(nxp-clk): add minimal set of S32CC clock ids
The clock IDs are organized into categories, which are determined based
on the first 2 MSB bits for each ID. Currently, there are two big
categories: hardware and software-defined clocks.

The first category refers to clock IDs understood by the S32CC PLL muxes
and MC_CGM module muxes and is immutable. The last category of the
clocks includes software-defined IDs for clocks to allow an easy
representation of the hierarchy.

Change-Id: Idc079feb3ca5f92d8bf337ef09efad006e267088
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
2024-07-01 21:24:56 +03:00
Madhukar Pappireddy
c4d9fbec5e Merge changes from topic "add_s32cc_clk_skeleton" into integration
* changes:
  feat(s32g274a): use s32cc clock driver
  feat(nxp-drivers): add clock skeleton for s32cc
2024-07-01 15:29:52 +02:00
Leo Yan
e2e8a397f8 fix(mhu): fix compilation error with ENABLE_ASSERTIONS=0 option
After disabling assertion with -DENABLE_ASSERTIONS=0, the build reports
error:

drivers/arm/mhu/mhu_wrapper_v3_x.c: In function 'mhu_get_max_message_size':
drivers/arm/mhu/mhu_wrapper_v3_x.c:448:31: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
         enum mhu_v3_x_error_t err;
                               ^~~

This commit fixes the building failure by making the variable 'err' as
__maybe_unused.

Change-Id: I338e6df03d2f0805c83e96d8e3a4abae41e68678
Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-06-28 16:25:09 +01:00