Commit graph

11164 commits

Author SHA1 Message Date
Shruti Gupta
20155112c5 docs(spm): add threat model for el3 spmc
Threat model for EL3 SPMC.
The mitigations are based on the guidance
provided in FF-A v1.1 EAC0 spec.

Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: I7f4c9370b6eefe6d1a7d1afac27e8b3a7b476072
2022-10-27 11:40:02 +01:00
Shruti Gupta
4090ac33f4 docs(spm): add design documentation
Add documentation how to build EL3 SPMC,
briefly describes all FF-A interfaces,
SP boot flow, SP Manifest, Power Management,
Boot Info Protocol, Runtime model and state
transition and Interrupt Handling.

Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: I630df1d50a4621b344a09e462563eacc90109de4
2022-10-27 11:39:53 +01:00
Manish V Badarkhe
9dedc1ab21 Merge changes from topic "morello-dt-fix" into integration
* changes:
  fix(morello): dts: remove #a-c and #s-c from memory node
  fix(morello): dts: fix GICv3 compatible string
  fix(morello): dts: fix DT node naming
  fix(morello): dts: fix SCMI shmem/mboxes grouping
  fix(morello): dts: use documented DPU compatible string
  fix(morello): dts: fix DP SMMU IRQ ordering
  fix(morello): dts: fix SMMU IRQ ordering
  fix(morello): dts: add model names
  fix(morello): dts: fix stdout-path target
2022-09-14 12:35:29 +02:00
Joanna Farley
febefa4dbb Merge changes from topic "xilinx-pm-misc-changes" into integration
* changes:
  fix(xilinx): update define for ZynqMP specific functions
  fix(xilinx): remove unnecessary header include
  fix(xilinx): include missing header
2022-09-14 12:01:37 +02:00
Joanna Farley
77135473c5 Merge changes from topic "xilinx-misc-changes" into integration
* changes:
  chore(zynqmp): fix comment style in zynqmp_def.h
  chore(versal): add missing dot at the end of sentence
  fix(zynqmp): remove additional 0x in %p print
  fix(versal): fix Misra-C violations in bl31_setup and pm_svc_main
2022-09-14 11:52:29 +02:00
Rajan Vaja
24b5b53a59 fix(xilinx): update define for ZynqMP specific functions
Instead of exclude code for Versal, define only for ZynqMP.
For new platforms this code should be excluded so instead of
excluding for all platform, define only for ZynqMP.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I45798dadc0f374c5794f517f7d0158675a75caa9
2022-09-14 10:15:16 +02:00
Rajan Vaja
0ee2dc118c fix(xilinx): remove unnecessary header include
Platform specific IPI header inclusion is not required
in common IPI source file. So remove inclusion of the same.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I6686757f00370c6ec42b5ee2c44ea5cd13da70c0
2022-09-14 10:12:42 +02:00
Rajan Vaja
28ba140021 fix(xilinx): include missing header
pm_ipi.h needs some definitions from stddef.h so include it.
Currently it is working because required file is included
indirectly due to other includes.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: Ic4a6c469c3152e21eaeb365ba96f3a29f14593bf
2022-09-14 10:12:16 +02:00
Michal Simek
f114fd3b10 chore(zynqmp): fix comment style in zynqmp_def.h
Add missing space in one line comment to follow common coding style.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: Idebf8f34bf48444ee20a68ac3e6fd7f5a41bf8b0
2022-09-14 09:35:58 +02:00
Michal Simek
8f4b37f12e chore(versal): add missing dot at the end of sentence
Add missing dot at the end of sentence.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I356e65fd8c572c12795e3492dd02d73f48cb4b67
2022-09-14 09:34:46 +02:00
Michal Simek
05a6107ff1 fix(zynqmp): remove additional 0x in %p print
%p is already printing value in hex that's why 0x prefix is not needed.
Origin message looks like this
"NOTICE:  Can't read DT at 0x0x100000"
and after fixing
"NOTICE:  Can't read DT at 0x100000"

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: If83c485a61441f6105d8cbd797f04060dfce2817
2022-09-14 09:31:33 +02:00
Michal Simek
68ffcd1bb2 fix(versal): fix Misra-C violations in bl31_setup and pm_svc_main
Fix some Misra-C violations. The similar fixes were done by commit
eb0d2b1772 ("fix(zynqmp): resolve misra R15.6 warnings") and commit
dd1fe7178b ("fix(zynqmp): resolve misra R14.4 warnings").

Signed-off-by: Michal Simek <michal.simek@amd.com>
Change-Id: I3ffa92724a09871f7f99c9ac6c326994c165e9bd
2022-09-14 09:26:23 +02:00
Joanna Farley
28a28511c4 Merge "fix(zynqmp): ensure memory write finish with dsb()" into integration 2022-09-14 09:14:34 +02:00
Bipin Ravi
959256766e Merge "fix(cpus): workaround for Cortex-A710 2216384" into integration 2022-09-13 20:59:43 +02:00
Tanmay Shah
ac6c135c83 fix(zynqmp): ensure memory write finish with dsb()
GICD reg write must complete before core goes to idle
mode. Achieve this with dsb() barrier instruction in IPI
ISR

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Change-Id: I5af42ca901567ee5e54a5434ebe3e673a92cb9be
2022-09-13 11:19:01 -07:00
Joanna Farley
207bda950d Merge changes Id49d94f6,I35316310 into integration
* changes:
  feat(versal): add infrastructure to handle multiple interrupts
  fix(versal): add SGI register call version check
2022-09-13 10:24:37 +02:00
Joanna Farley
1790036de3 Merge "docs(porting-guide): correct typo of "bits" to "bytes"" into integration 2022-09-13 09:37:39 +02:00
Tanmay Shah
e497421d7f feat(versal): add infrastructure to handle multiple interrupts
Only one hardcode interrupt handler is supported as of now.
This is IPI interrupt between APU and PMC processor.
This patch adds infrastructure to register multiple interrupt
handlers. This infrastructure was used and tested for two
interrupts and so, interrupt id and handler container size is
2 which is defined by MAX_INTR_EL3. Interrupt id is not used
as container index due to size constraints. User is expected to
adjust MAX_INTR_EL3 based on how many interrupts are handled in
TF-A

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Change-Id: Id49d94f6773fbb6874ccf89c0d12572efc7e678e
2022-09-13 09:22:47 +02:00
Tanmay Shah
5897e13544 fix(versal): add SGI register call version check
PM_FEATURE_CHECK is supported only for platform
management API. PM_LOAD_PDI command is not intended
for platform management. This patch removes version
check of PM_LOAD_PDI and adds version check of command
that is used for SGI registartion.

Signed-off-by: Tanmay Shah <tanmay.shah@xilinx.com>
Change-Id: I353163109b639acab73120f405a811770e8831a0
2022-09-13 09:22:36 +02:00
Joanna Farley
69034793b6 Merge "chore: use tabs for indentation" into integration 2022-09-13 09:18:57 +02:00
Jorge Troncoso
b0f473f500 chore: use tabs for indentation
This patch changes the definition of image_info_t to follow the TF-A
coding style documented at
https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-style.html

Signed-off-by: Jorge Troncoso <jatron@google.com>
Change-Id: I17af22b4ba60b41cf0b5fa84ac47beeb1536edcc
2022-09-12 15:12:01 -07:00
Max Yu
5c60b8c8ce docs(porting-guide): correct typo of "bits" to "bytes"
The CACHE_WRITEBACK_GRANULE is documented to be in bits, but
specifying the value in bits broke a build. Further investigation
suggests that the value should in fact be in bytes. See
https://github.com/ARM-software/arm-trusted-firmware/blob/master/include/arch/aarch64/
smccc_helpers.h#L101
and
https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Common-Type-Attributes.html

Change-Id: I9a2b2fbe18d5a58a8f9aeb2726a0623f3484c88e
Signed-off-by: Max Yu <maxlyu@google.com>
2022-09-12 22:35:14 +02:00
Manish Pandey
ad6a2e6da1 Merge "fix(mmc): resolve the build error" into integration 2022-09-12 10:42:27 +02:00
Jayanth Dodderi Chidanand
ccf8392ccb fix(mmc): resolve the build error
Adding the header file plat/common/common_def.h to
resolve the "SIZE_128" undeclared identifier error.

Change-Id: I399edf4248776f6dd9f93e000b8672cadc71509d
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2022-09-09 17:28:04 +01:00
Manish Pandey
1309c6c805 Merge changes from topic "fix_fip_in_emmc_boot" into integration
* changes:
  fix(st): add max size for FIP in eMMC boot part
  feat(mmc): get boot partition size
2022-09-08 13:40:36 +02:00
Manish V Badarkhe
51558209ef Merge "fix(cpus): workaround for Cortex-A78C erratum 2376749" into integration 2022-09-08 13:27:11 +02:00
Akram Ahmad
5d3c1f5890 fix(cpus): workaround for Cortex-A78C erratum 2376749
Cortex-A78C erratum 2376749 is a Cat B erratum that applies
to revisions r0p1 and r0p2 of the A78C and is currently open.
The workaround is to set CPUACTLR2_EL1[0] to 1 to force
PLDW/PFRM ST to behave like PLD/PRFM LD and not cause
invalidations to other PE caches.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN2004089/latest

Signed-off-by: Akram Ahmad <Akram.Ahmad@arm.com>
Change-Id: I3b29f4b7f167bf499d5d11ffef91a94861bd1383
2022-09-08 13:25:42 +02:00
Manish Pandey
bbdf2591ba Merge changes Idde51a13,Ife8f1e84 into integration
* changes:
  feat(mediatek): add smcc call for MSDC
  refactor(mediatek): refactor plat_sip_calls.h for mt8192/mt8195/mt8186
2022-09-08 12:44:24 +02:00
Bo-Chen Chen
4dbe24cf7d feat(mediatek): add smcc call for MSDC
Some registers of MSDC need to be set in ATF, so we add MSDC drivers.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: Idde51a136ad08dbaece0bdaa804b934fca7046b6
2022-09-08 18:02:02 +08:00
Bo-Chen Chen
3bdd9a24e9 refactor(mediatek): refactor plat_sip_calls.h for mt8192/mt8195/mt8186
- MTK_SIP_KERNEL_DFD can be moved to mtk_sip_def.h.
- Remove unused MTK_SIP_* definations which are already defined in
  mtk_sip_def.h.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: Ife8f1e842d986691488548632426f194199d42b9
2022-09-08 18:01:49 +08:00
Madhukar Pappireddy
045b500e9f Merge "feat(ti-k3): add support for J784S4 SoCs" into integration 2022-09-08 00:18:24 +02:00
Madhukar Pappireddy
8a858913b1 Merge changes from topic "stm32mp15-dt-updates" into integration
* changes:
  refactor(stm32mp15-fdts): remove timers15 node
  refactor(stm32mp15-fdts): remove unused secure-status properties
  refactor(stm32mp15-fdts): remove RCC secure-status
2022-09-07 15:38:06 +02:00
Manish V Badarkhe
f1f2384b3b Merge "refactor(renesas): remove mbedtls_common makefile inclusion" into integration 2022-09-07 13:08:42 +02:00
Manish V Badarkhe
a8ec6a50d2 refactor(renesas): remove mbedtls_common makefile inclusion
Renesas platform does not support crypto, but mbedtls_common.mk
is still included in its makefile. Therefore, this inclusion
was removed to avoid un-necessary compilation of mbedTLS source.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: Ib6978255e39a7f5d5013952841930ae68b12c318
2022-09-07 12:25:31 +02:00
Yann Gautier
e7cb4a86b8 fix(st): add max size for FIP in eMMC boot part
When putting FIP binary in eMMC boot partition (with STM32MP_EMMC_BOOT),
the FIP max size should be precised. If it is not, an assert fails in
io_block driver, as cur->size will be zero.
For this length, we then use the size of the eMMC boot partition minus
STM32MP_EMMC_BOOT_FIP_OFFSET.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I48b7635cff64f52d4b337a4c8c3becd9a0be72e8
2022-09-07 09:36:48 +02:00
Yann Gautier
f462c1249a feat(mmc): get boot partition size
The boot partition size of an eMMC is given in ext_csd register, at
offset 226 (BOOT_SIZE_MULT), which has to be multiplied by 128kB.
Add a helper function mmc_boot_part_size() to get this eMMC boot
partition size.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I0e8e0fc9632f147fa1b1b3374accb78439025403
2022-09-07 09:36:48 +02:00
Jayanth Dodderi Chidanand
b781fcf139 fix(cpus): workaround for Cortex-A710 2216384
Cortex-A710 erratum 2216384 is a Cat B erratum that applies to revisions
r0p0, r1p0, and r2p0, and is fixed in r2p1. The workaround is to set
CPUACTLR5_EL1[17] to 1 and applying an instruction patching sequence.
Setting this bit, along with these instructions will prevent the
deadlock, and thereby avoids the reset of the processor.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN1775101/latest

Change-Id: I2821591c23f854c12111288ad1fd1aef45db6add
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2022-09-06 22:43:04 +01:00
Manish V Badarkhe
810bb3d0f4 Merge changes I366740a9,I533abdd6,I6aa3b6dc into integration
* changes:
  fix(n1sdp): mapping Run-time UART to IOFPGA UART0
  fix(n1sdp): add numa node id for pcie controllers
  fix(n1sdp): replace non-inclusive terms from dts file
2022-09-06 17:49:10 +02:00
Manish V Badarkhe
0a549c50b5 Merge "fix(gpt): correct the GPC enable sequence" into integration 2022-09-06 17:24:17 +02:00
Manish Pandey
945f0ad996 Merge "fix(errata): workaround for Cortex-A510 erratum 2347730" into integration 2022-09-06 14:49:53 +02:00
Manish Pandey
7805999e64 Merge changes from topic "st-nand-updates" into integration
* changes:
  feat(stm32mp1): allow to override MTD base offset
  feat(stm32mp1): manage second NAND OTP on STM32MP13
  feat(stm32mp1): add define for external scratch buffer for nand devices
  feat(mtd): add platform function to allow using external buffer
  feat(libc): introduce __maybe_unused
2022-09-05 16:42:34 +02:00
Manish Pandey
04f28f895f Merge changes from topic "mt8188" into integration
* changes:
  feat(mt8188): add pinctrl support
  feat(mt8188): add RTC support
  feat(mt8188): add pmic and pwrap support
  refator(mediatek): move pmic.[c|h] to common folder
  refator(mediatek): move common definitions of pmic wrap to common folder
  feat(mt8188): add IOMMU enable control in SiP service
  feat(mt8188): add display port control in SiP service
  fix(mediatek): use uppercase for definition
  feat(mediatek): move dp drivers to common folder
  feat(mediatek): move mtk_cirq.c drivers to cirq folder
  feat(mt8188): initialize GIC
  feat(mt8188): initialize systimer
  feat(mt8188): initialize platform for MediaTek MT8188
  refator(mediatek): remove unused files
  refator(mediatek): move drivers folder in common to plat/mediatek
  feat(mediatek): support coreboot BL31 loading
2022-09-05 15:54:11 +02:00
Jianguo Zhang
ec4cfb91fc feat(mt8188): add pinctrl support
Add pinctrl support for MT8188.

TEST=build pass
BUG=b:236331724

Signed-off-by: Jianguo Zhang <jianguo.zhang@mediatek.corp-partner.google.com>
Change-Id: Id4ac8f67009621fff8f15f3ab2d8f200343c8356
2022-09-05 18:12:24 +08:00
Song Fan
af5d8e0795 feat(mt8188): add RTC support
TEST=build pass.
BUG=b:233720142

Signed-off-by: Song Fan <ot_song.fan@mediatek.corp-partner.google.com>
Change-Id: I348eff0f53341593f74a63780e2e8298cbc3ec88
2022-09-05 18:12:24 +08:00
Hui Liu
e9310c34b0 feat(mt8188): add pmic and pwrap support
Add PWRAP and PMIC driver to support power-off.

TEST=build pass.
BUG=b:233720142

Signed-off-by: Hui Liu <hui.liu@mediatek.corp-partner.google.com>
Change-Id: Id9951134925f6cb5f8d304a7b8e7901837809bd9
2022-09-05 18:12:24 +08:00
Bo-Chen Chen
80fa75842d refator(mediatek): move pmic.[c|h] to common folder
These two files are identical on MT8192 and MT8195. They can also be
used on MT8188. So move them to common/drivers/pmic/.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: I8c12d15f1da79ab5767ac02b3ab70e8508155ee8
2022-09-05 18:12:24 +08:00
Bo-Chen Chen
ca93b018dc refator(mediatek): move common definitions of pmic wrap to common folder
Some definitions can be shared among mt8192, mt8195, and
mt8186, so move them to pmic_wrap_init_common.h.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: I992b61a47a84039fe8c246e2ff75721c57ee41a5
2022-09-05 18:12:24 +08:00
Chengci Xu
be457248c6 feat(mt8188): add IOMMU enable control in SiP service
Add SiP service for multimedia & infra master to enable/disable
MM & INFRA IOMMU in secure world

TEST=build pass
BUG=b:236339614

Signed-off-by: Chengci Xu <chengci.xu@mediatek.corp-partner.google.com>
Change-Id: I4eb1fda6044cf2cb6c22c005cb2fa550906b71e9
2022-09-05 18:12:24 +08:00
Rex-BC Chen
a4e502319d feat(mt8188): add display port control in SiP service
MTK display port mute/unmute control registers need to be
set in secure world.

TEST=build pass
BUG=b:236331724

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: I0aa0675f07c80aab4349493bfbb0782bf0bbef58
2022-09-05 18:12:21 +08:00
Rex-BC Chen
810d568141 fix(mediatek): use uppercase for definition
Use uppercase for definition.
s/eDP_SEC_BASE/EDP_SEC_BASE/.
s/eDP_SEC_SIZE/EDP_SEC_SIZE/.

TEST=build pass for mt8195
BUG=b:233720142

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: I390055500a6347b67fefde36a7f103438ba2d5ff
2022-09-05 13:53:14 +08:00