Commit graph

14774 commits

Author SHA1 Message Date
Gabriel Fernandez
703a581e25 feat(stm32mp1-fdts): remove RTC clock configuration
RTC clock configuration is done now in OPTEE.
Note: The RTC clock source can only be configured once.
TF-A, configuring the RTC clock source will have no effect in OPTEE.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Change-Id: I111ba96b27d0de0c45086ba8ef947dd2e6785672
2024-06-11 14:02:10 +02:00
Yann Gautier
1be399b813 refactor(st-clock): move stm32mp1_clk_rcc_regs_*lock
Those functions are only used on MP1, they should not be in STM32 clock
core. Move them to MP13 driver (they are already in MP15 driver).
Redefine new clk_stm32_rcc_regs_*lock() functions in clock core. This
change avoid sparse warning:
drivers/st/clk/clk-stm32-core.c:46:6: warning: symbol
 'stm32mp1_clk_rcc_regs_lock' was not declared. Should it be static?
drivers/st/clk/clk-stm32-core.c:51:6: warning: symbol
 'stm32mp1_clk_rcc_regs_unlock' was not declared. Should it be static?

Change-Id: I9f255acaa843e41fc14267c1a8091f93bd029796
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2024-06-11 14:02:10 +02:00
Gabriel Fernandez
d9a7ddeb25 refactor(st-clock): driver size optimization
Re-ordering structures to avoid gaps and minimize data.
Reduce type of gate_refcounts[], uint8_t is enough.
Re-ordering structures to avoid gaps and minimize data.
Use an unsigned char to define a clock ops type.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Change-Id: I6b793dc34abdd6ef013609fc0f122da5d1824a34
2024-06-11 14:02:10 +02:00
Yann Gautier
698bba5e74 refactor(st-clock): remove BL32 support on STM32MP13
TF-A BL32 (SP_MIN) is not supported on STM32MP13. Only OP-TEE is used
as BL32. Remove the code under IMAGE_BL32 flag in STM32MP13 driver.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I6cc9f230782c44129b205e66a44cdb4bcb5f95c3
2024-06-11 14:02:10 +02:00
Gabriel Fernandez
f2aebab859 feat(st-clock): don't gate/ungate an oscillator if it is not wired
If the oscillator is not present, the gating will fail.

Change-Id: If9119460a4bcd42053537f1975afe5fe1df05752
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
2024-06-11 14:02:10 +02:00
Gabriel Fernandez
c6d50c9f93 feat(dt-bindings): add missing SPIx bus clocks
Add SPI1, SPI2, SPI3, SPI4, SPI5 bus clocks.

Change-Id: I075447adc63944cdd97862f836c22e4210bdb047
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
2024-06-11 14:02:10 +02:00
Gabriel Fernandez
66d7c8bf8e feat(stm32mp1-fdts): remove PLL1 settings
TF-A BL2 always boot at 650MHz using an algorithm to calculate PLL1
settings, without reading DT. Remove the corresponding nodes.

Change-Id: I0003337d8d37df7b2a70a84b5475f4278c4c4669
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
2024-06-11 14:02:10 +02:00
Gabriel Fernandez
ae1e503763 feat(st-clock): update with new bindings
Code alignment with MP13 driver.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Change-Id: Ifb0597721a865f463cf41c5cd7be3ca75a1da80c
2024-06-11 14:02:10 +02:00
Gabriel Fernandez
4391e5edea feat(stm32mp1-fdts): new RCC DT bindings for STM32MP1
RCC bindings alignment with MP13 RCC bindings

Change-Id: I02c89accd51e4214cd009d4a9433d8d9b6aeba25
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
2024-06-11 14:02:10 +02:00
Gabriel Fernandez
52b253bfa2 feat(dt-bindings): new RCC DT bindings
RCC bindings alignment with MP13 RCC bindings:
- merge of 'st,clksrc' and 'st,pkcs' nodes into 'st,clksrc'
- no ordering requirements on 'st,clksrc' node
- use DIV() macro for 'st,clkdiv' node
- no ordering requirements on 'st,clkdiv' node
- new pll binding

Change-Id: Id3ca30608dde2091145123512c42c6958a378d91
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
2024-06-11 14:02:10 +02:00
Yann Gautier
f655922788 feat(stm32mp1): always boot at 650MHz
Switching to higher CPU frequencies requires a dedicated chip version
(STM32MP1xxD or STM32MP1xxF), and increase CPU voltage. To avoid
re-configuring I2C and PMIC before and after applying clock tree,
always boot at 650MHz, which is the frequency for nominal voltage.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id05a3ee17e7dd57e2d64dc06f8f1e7f9cb21e110
2024-06-11 14:02:10 +02:00
Gabriel Fernandez
6583da67d6 refactor(st-clock): remove LSEDRV_MEDIUM_HIGH for STM32MP13
Remove useless LSEDRV_MEDIUM_HIGH definition in clk-stm32mp13.c.
It's already defined in include/dt-bindings/clock/stm32mp13-clksrc.h.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Change-Id: Ie3fa4711930f922fa0733ba7c76d72ec9639e9a5
2024-06-11 14:01:34 +02:00
Patrick Delaunay
039b7d4673 fix(st-clock): display proper PLL number for STM32MP13
The PLL clk_id does not start at 0, but it is in the enum listing all
clocks. To have a better display of the PLL number, start at PLL1,
by changing pll->clk_id in messages with pll->clk_id - _CK_PLL1 + 1.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ic09195ae6fe5f8d3a87e69962425f7c826f3670b
2024-06-11 11:45:38 +02:00
Yann Gautier
f4a2bb986b fix(st-clock): do not reconfigure LSE
If LSE oscillator is already ON, which is the case when returning from
low-power state or if we are on VBAT, it mustn't be reconfigured.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Ie75f2b0b42aeb3d95e2266e1fca811a2f2b3e29f
2024-06-11 11:45:38 +02:00
Lionel Debieve
d594239d4e feat(stm32mp1-fdts): move RNG1 to CSI to improve random generation
LSI was too slow to provide enough random numbers (limited
to 6ms for 16 bytes production). Switch to CSI that allow
to get the RNG fifo ready in less than 50µs.

Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com>
Change-Id: I76d1fe58e2f4d5416a96f48123ae36bd82d8a8ee
2024-06-11 11:45:38 +02:00
Patrick Delaunay
caa1295779 refactor(st-clock): remove unused clk function in API
Remove the unused functions in stm32mp clk API:
- stm32mp_stgen_get_counter (change to static, no more exported)
- stm32mp_stgen_restore_counter

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ib6ca72723eac3e133f1ca0dee504ef344c72e0bf
2024-06-11 11:45:38 +02:00
Patrick Delaunay
3b3a9afdeb refactor(st-clock): support deactivated STGEN in stm32mp_stgen_config
Update function stm32mp_stgen_config() to support deactivated STGEN
when frequency is 0, for example on STOP2 exit for STM32MP25.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id371c4602a614bbfa0ecc7ce2d2e0ac5261e1d52
2024-06-11 11:45:38 +02:00
Pascal Paillet
bfe8a12eea feat(st-clock): add function to restore generic timer rate
Add a function to restore the CPU generic timer rate from STGEN content.
After wake-up from LPLV-Stop2, STGEN content is not lost, but generic timer
has been reset.

Signed-off-by: Pascal Paillet <p.paillet@st.com>
Change-Id: I6f91dbd051f76383e9ff1d6bb86225d373dbf33a
2024-06-11 11:45:38 +02:00
André Przywara
1e34c3bca2 Merge "fix(allwinner): remove unneeded header inclusion" into integration 2024-06-10 18:41:43 +02:00
Manish V Badarkhe
2941e5b146 Merge changes from topic "mb/refactor-cot" into integration
* changes:
  refactor(juno): add explicit entry for HW_CONFIG in BL2 CoT file
  refactor(auth): remove HW_CONFIG reference from BL1 CoT file
2024-06-10 17:27:25 +02:00
Manish V Badarkhe
59b163157c Merge "refactor(fdts): remove unused nodes from CoT device tree" into integration 2024-06-10 17:26:49 +02:00
Andre Przywara
8bb8f02d44 fix(allwinner): remove unneeded header inclusion
Nothing in sunxi_bl31_setup.c uses any functionality provided by the
fdt_wrappers file, so remove its inclusion from the header list.

Change-Id: I47031a58add2f85e757e75d8578f4e8e21ef65ea
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-06-10 15:56:29 +01:00
Madhukar Pappireddy
a681e767aa Merge "fix(imx): disable DRAM retention by default on i.MX8MQ" into integration 2024-06-10 15:42:52 +02:00
Joanna Farley
4328ca595f Merge changes from topic "xlnx_fix_cpu_pwrdwn_handling" into integration
* changes:
  fix(xilinx): handle power down event if SGI not registered
  fix(xilinx): register for idle callback
2024-06-10 09:18:49 +02:00
André Przywara
fe4df8bdae Merge "feat(rockchip): add RK3566/RK3568 Socs support" into integration 2024-06-07 12:55:56 +02:00
shengfei Xu
9fd9f1d024 feat(rockchip): add RK3566/RK3568 Socs support
RK3566/RK3568 is a Quad-core soc and Cortex-a55 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

Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: I8b98a4d07664de26bd6078f63664cbc3d9c1c68c
2024-06-07 11:59:46 +02:00
Jay Buddhabhatti
c3ffa4c5ba fix(xilinx): handle power down event if SGI not registered
Currently, if SGI is not registered by Linux and power down event from
firmware is received then it's not getting handled in TF-A and core power
down is not happening. Because of that subsystem restart or force power
down without Linux boot is not happening. So, handle power down event in
TF-A if Linux not registered SGI.

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Change-Id: I0c23792daba6ae47004ae99e232c77e17230bcfb
2024-06-07 02:41:00 -07:00
Soby Mathew
85b9401bc0 Merge "fix(gpt): fix RME GPT library bug" into integration 2024-06-07 11:39:27 +02:00
Jay Buddhabhatti
a3b0a3422c fix(xilinx): register for idle callback
Currently, only Linux registering for getting idle callback during
subsystem restart or force power down. Because of that if Linux boot
hang or someone wants to do subsystem restart before Linux boot then
it's not working. So, register for idle callback in TF-A to get idle
callback during subsystem restart or force power down to do ARM
specific steps for proper power down of core.

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Change-Id: If7c01f79be6958678243be844bcfdc50d59b0fb8
2024-06-07 02:38:11 -07:00
Bipin Ravi
c7d5e45d8f Merge changes from topics "ck/tf-a-build-fixes", "ck/tf-a-romlib-build-fixes" into integration
* changes:
  build(romlib): don't timestamp generated wrappers
  build(romlib): de-duplicate ROMLib wrapper sources
  fix(build): fix incorrectly-escaped armlink preprocessor definitions
2024-06-06 23:50:32 +02:00
Madhukar Pappireddy
3967fa5e93 Merge "fix(nuvoton): fix MMU mapping settings" into integration 2024-06-06 15:42:43 +02:00
Joanna Farley
ab4e9c0b7f Merge "feat(xilinx): remove PM_IOCTL and PM_QUERY_DATA APIs" into integration 2024-06-06 14:54:21 +02:00
AlexeiFedorov
6350aea2f1 fix(gpt): fix RME GPT library bug
This patch fixes fill_l1_tbl() function bug
for RME_GPT_MAX_BLOCK build option set to 0
disabling filling L1 tables with Contiguous
descriptors.

Change-Id: I3eedd6c1bb55b7c207bb3630d1ab2fda8f72eb17
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-06-06 13:03:33 +01:00
Ronak Jain
924f8ce2e9 feat(xilinx): remove PM_IOCTL and PM_QUERY_DATA APIs
Today, the PM_IOCTL and PM_QUERY_DATA APIs are there to maintain
backward compatibility. Now, the usage of these APIs on the Linux
side and the firmware side is updated. Hence remove the deprecated
PM_IOCTL and PM_QUERY_DATA EEMI API from the TF-A to make TF-A pass
through.

Note: Only use the newer kernel to access the deprecated features in
this patch. Otherwise, the system may not function correctly.

Change-Id: I23effb7ff62e7f83563c2b422ea64a0289fd880f
Signed-off-by: Ronak Jain <ronak.jain@amd.com>
2024-06-06 01:47:16 -07:00
rutigl
0a1df64117 fix(nuvoton): fix MMU mapping settings
MAP_DEVICE0 for internal (register) space access settings
flag MT_NS was changed to MT_SECURE to enable access
to the TSGEN register, otherwise it brings to MCR violation,
because access to the TSGEN register is locked and enabled
for secure only

Change-Id: Id2fe90d30342706c58064161360d8be6e0d5616b
Signed-off-by: Margarita Glushkin <rutigl@gmail.com>
2024-06-06 09:24:13 +02:00
Manish V Badarkhe
0909b52273 refactor(fdts): remove unused nodes from CoT device tree
Since the CoT device tree is intended solely for BL2, remove the
nodes that are not handled by BL2.

Change-Id: I977eec902f16de59743e97d15148d63934b7b863
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-06-05 14:04:00 +01:00
Manish V Badarkhe
3e2aa0d854 refactor(juno): add explicit entry for HW_CONFIG in BL2 CoT file
Add an explicit entry for HW_CONFIG in the BL2 CoT file for the Juno
platform, as the HW_CONFIG node has been removed from the common CoT
file.

Change-Id: I8a1a22dd1023895cfc5730101fad20a80390ce17
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-06-05 12:42:40 +01:00
Manish V Badarkhe
7962c1c2c2 refactor(auth): remove HW_CONFIG reference from BL1 CoT file
Remove the 'HW_CONFIG' reference from the BL1 CoT file, as BL1
does not play any role in loading the hw_config image. This
reference was incorrectly added to the BL1 CoT file.

Change-Id: I9c1d9abce65844eaa1f41ab4f98d3c258ab7a8d2
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-06-05 10:20:36 +01:00
Olivier Deprez
416aa42e55 Merge "feat(fvp): fdts: add stdout-path to the Foundation FVPs" into integration 2024-06-04 14:32:33 +02:00
Chris Kay
ae4795261a build(romlib): don't timestamp generated wrappers
The Makefile rule for the libwrappers object files places a dependency
on a timestamp file. This timestamp file is created by the recipe that
generates the libwrappers sources, and was presumably introduced to
indicate to Make that all of the source files are generated
simultaneously by that rule.

Instead, we can use a grouped target rule, which uses `&:` instead of
`:`. This communicates to Make that all of the targets listed are
generated at once.

To demonstrate, the following two Makefile rules differ in their
behaviour:

    a.x b.x c.x: # targets may be updated independently
        ... # generate a.x, b.x and c.x

    a.x b.x c.x &: # all targets are updated at once
        ... # generate a.x, b.x and c.x

While both recipes do generate all three files, only the second rule
communicates this fact to Make. As such, Make can reason that if one of
the files is up to date then all of them are, and avoid re-running the
rule for any generated file that it has not already run it for.

Change-Id: I10b49eb72b5276c7f9bd933900833b03a61cff2f
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-06-04 11:09:02 +00:00
Chris Kay
d9db846766 build(romlib): de-duplicate ROMLib wrapper sources
The `romlib_generator.py` script may generate duplicate wrapper sources,
which is undesirable when using them to generate Makefile rules as Make
will warn about duplicated targets.

This change sorts the wrapper sources returned from this script, which
has the effect of also de-duplicating them.

Change-Id: I109607ef94f77113a48cc0d6e07877efd1971dbc
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-06-04 11:08:53 +00:00
Chris Kay
df52e2600d fix(build): fix incorrectly-escaped armlink preprocessor definitions
Preprocessor definitions that are passed to armlink are currently not
correctly escaped, resulting in the shell trying to parse the
parentheses contained in some of the preprocessor definitions:

```
  LD      build/tegra/t210/release/bl31/bl31.elf
/bin/sh: 1: Syntax error: "(" unexpected
```

This change ensures that these preprocessor definitions are adequately
escaped for the shell.

Change-Id: I9d2c60fa60c0aa00770417a68f900e9fb84b4669
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-06-04 11:06:38 +00:00
Soby Mathew
20307efa5e Merge "docs(gpt): update GPT library documentation" into integration 2024-06-03 15:26:05 +02:00
AlexeiFedorov
c944952bc3 docs(gpt): update GPT library documentation
This patch updates GPT library design documentation
with the changes introduced by patches which add
support for large GPT mappings and configuration of
memory size protected by bitlock.

Change-Id: I1f97fa8f003deb07a5f32b7237c1927581a788c8
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
2024-06-03 12:13:06 +01:00
Manish V Badarkhe
a13449da37 Merge "feat(stm32mp15): remove OP-TEE shared mem" into integration 2024-06-03 09:50:20 +02:00
Manish V Badarkhe
6d5048f025 Merge "feat(tc): add default SLC policy for the gpu" into integration 2024-06-03 09:39:10 +02:00
Manish V Badarkhe
adf19215f9 Merge "feat(tc): support full-HD resolution for the FVP model" into integration 2024-06-03 09:39:01 +02:00
Vincent Stehlé
2faccaba80 feat(fvp): fdts: add stdout-path to the Foundation FVPs
Add an `stdout-path' property into the `chosen' node of the Foundation
FVPs Devicetrees.

This gives a default console to the Linux kernel when "console=" is not
specified on the kernel command line, which is useful when booting with
U-Boot in UEFI for example.

Change-Id: I27d5f7f9416bd42b7401b1a57ae64bfee2524204
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
2024-05-31 11:06:08 +02:00
Lauren Wehrmeister
aff731af1c Merge "chore(errata-abi): minor variable rename" into integration 2024-05-30 18:58:11 +02:00
Govindraj Raja
5dd9068853 chore(errata-abi): minor variable rename
'cpu_partnumber' variable part of 'em_cpu_list' actually contains the
cpu midr value and not the actual part number. The part number is
extracted from midr value in 'non_arm_interconnect_errata' function.

So 'cpu_partnumber' is misleading and the actual value is midr, thus
rename it to 'cpu_midr'.

Change-Id: I4bfe71ce24542d508e2bcf39a1097724d14c4511
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-05-30 10:39:24 -05:00