Commit graph

12224 commits

Author SHA1 Message Date
Yann Gautier
f771a34463 feat(docs): allow verbose build
If V=1 is set (or directly Q="") in the 'make doc' command line, the
sphinx command that builds the documentation is displayed.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: I4961c124cc52d0183371f1d4bbc0e440f5ae6e63
2023-03-21 11:47:16 +01:00
Olivier Deprez
5fdb2e5471 Merge changes I924ea85d,I22e128c4,I7a5cfaac into integration
* changes:
  feat(mt8195): add support for SMC from OP-TEE
  feat(mediatek): add SMC handler for EMI MPU
  feat(mediatek): add SiP service for OP-TEE
2023-03-21 10:46:41 +01:00
Bo-Chen Chen
ccc61e1002 feat(mt8195): add support for SMC from OP-TEE
- Add MTK_SIP_SMC_FROM_S_EL1_TABLE to handle the SMC call from OP-TEE.
- Register optee SMC ID for EMI MPU.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Signed-off-by: Ming Huang <ming.huang@mediatek.com>
Signed-off-by: jason-ch chen <Jason-ch.Chen@mediatek.com>
Change-Id: I924ea85d29d4113e92d8f3d411c0fb77daa0c205
2023-03-21 10:51:55 +08:00
Bo-Chen Chen
c842cc0e5d feat(mediatek): add SMC handler for EMI MPU
EMI MPU will handle the SMC call from optee, so we need to add this
patch to support it.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Signed-off-by: jason-ch chen <Jason-ch.Chen@mediatek.com>
Change-Id: I22e128c4246814cbd5855f51a26e4e11ccfe3a6b
2023-03-21 10:49:17 +08:00
Bo-Chen Chen
621eaab5cc feat(mediatek): add SiP service for OP-TEE
Add SiP service for the SMC call from the secure world.

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Signed-off-by: jason-ch chen <Jason-ch.Chen@mediatek.com>
Change-Id: I7a5cfaac5c46ea65be793c3d291e4332cc0b2e54
2023-03-21 10:48:25 +08:00
Bipin Ravi
e550fa127f Merge changes from topics "qemu", "qemu_sbsa" into integration
* changes:
  feat(qemu): add A76/N1 cpu support for virt
  feat(qemu): add "neoverse-n1" cpu support
  feat(qemu): make coherent memory section optional
  refactor(qemu): make use of setup_page_tables()
2023-03-20 22:21:24 +01:00
Manish Pandey
7419b7a72e Merge changes from topic "feat_state_part3" into integration
* changes:
  refactor(cpufeat): enable FEAT_VHE for FEAT_STATE_CHECKED
  refactor(mpam): enable FEAT_MPAM for FEAT_STATE_CHECKED
  feat(libc): add support for fallthrough statement
  refactor(spe): enable FEAT_SPE for FEAT_STATE_CHECKED
  refactor(cpufeat): rename ENABLE_SPE_FOR_LOWER_ELS to ENABLE_SPE_FOR_NS
  fix(spe): drop SPE EL2 context switch code
2023-03-20 18:25:00 +01:00
Manish Pandey
a59cddf2b9 Merge changes from topic "bk/errata_refactor" into integration
* changes:
  chore(fvp): add the aarch32 cortex A57 to the build
  chore(cpus): remove redundant asserts
  refactor(cpus): shorten errata flag defines
2023-03-20 16:45:08 +01:00
Andre Przywara
ea735bf556 refactor(cpufeat): enable FEAT_VHE for FEAT_STATE_CHECKED
At the moment we only support FEAT_VHE to be either unconditionally
compiled in, or to be not supported at all.

Add support for runtime detection (ENABLE_FEAT_VHE=2), by splitting
is_armv8_1_vhe_present() into an ID register reading function and a
second function to report the support status. That function considers
both build time settings and runtime information (if needed), and is
used before we access VHE related registers.
Also move the context saving code from assembly to C, and use the new
is_feat_vhe_supported() function to guard its execution.

Enable VHE in its runtime detection version for all FVP builds.

Change-Id: Ib397cd0c83e8c709bd6fed603560e39901fa672b
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-03-20 13:37:37 +00:00
Andre Przywara
9448f2b88e refactor(mpam): enable FEAT_MPAM for FEAT_STATE_CHECKED
At the moment we only support FEAT_MPAM to be either unconditionally
compiled in, or to be not supported at all.

Add support for runtime detection (ENABLE_MPAM_FOR_LOWER_ELS=2), by
splitting get_mpam_version() into an ID register reading
function and a second function to report the support status. That
function considers both build time settings and runtime information (if
needed), and is used before we access MPAM related registers.
Also move the context saving code from assembly to C, and use the new
is_feat_mpam_supported() function to guard its execution.

ENABLE_MPAM_FOR_LOWER_ELS defaults to 0, so add a stub enable function
to cover builds with compiler optimisations turned off. The unused
mpam_enable() function call will normally be optimised away (because it
would never be called), but with -O0 the compiler will leave the symbol
in the object file.

Change-Id: I531d87cb855a7c43471f861f625b5a6d4bc61313
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-03-20 13:37:36 +00:00
Andre Przywara
023f1bed1d feat(libc): add support for fallthrough statement
Modern C compilers warn about unannotated switch/case fallthrough code,
and require either a comment with some magic words, or an explicit
compiler attribute.
Since some TF-A static analysis CI check suggests having a "fallthrough;"
statement instead of a comment, introduce a macro that implements that
statement, and emits the proper compiler attribute.

Change-Id: Ib34e615fb48d0f4a340aabfad4472e08d5c70248
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-03-20 13:37:36 +00:00
Andre Przywara
6437a09a2d refactor(spe): enable FEAT_SPE for FEAT_STATE_CHECKED
At the moment we only support FEAT_SPE to be either unconditionally
compiled in, or to be not supported at all.

Add support for runtime detection (ENABLE_SPE_FOR_NS=2), by splitting
is_armv8_2_feat_spe_present() into an ID register reading function and
a second function to report the support status. That function considers
both build time settings and runtime information (if needed), and is
used before we access SPE related registers.

Previously SPE was enabled unconditionally for all platforms, change
this now to the runtime detection version.

Change-Id: I830c094107ce6a398bf1f4aef7ffcb79d4f36552
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-03-20 13:37:36 +00:00
Andre Przywara
90118bb5c1 refactor(cpufeat): rename ENABLE_SPE_FOR_LOWER_ELS to ENABLE_SPE_FOR_NS
At the moment we hardcode the SPE functionality to be available on the
non-secure side only, by setting MDCR_EL2.E2PB accordingly.

This should be reflected in the feature selection symbol, so rename that
to ENABLE_SPE_FOR_NS, to make it clearer that SPE is not supported in
the secure world.

Change-Id: I3f9b48eab1a45d6ccfcbb9c90a11eeb66867ad9a
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-03-20 13:37:36 +00:00
Andre Przywara
16e3ddba1f fix(spe): drop SPE EL2 context switch code
At the moment we hardcode the SPE functionality to be available on the
non-secure side only, by setting MDCR_EL3.NSPB accordingly.
This also means that the secure world cannot use SPE, so there is no
need to context switch the PMSCR_EL2 register.

Drop the SPE bits from the EL2 context switch code. If any of the other
EL2 worlds wish to start using SPE, this can be brought back.

Change-Id: Ie0fedb2aeb722a2c9db316051fbbe57ca0e3c0c9
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-03-20 13:37:36 +00:00
André Przywara
3ca0e7fdaf Merge "feat(qemu): combine TF-A artefacts into ROM file" into integration 2023-03-20 11:18:37 +01:00
Manish Pandey
c41b8e90f7 Merge "feat(tcr2): support FEAT_TCR2" into integration 2023-03-17 14:44:41 +01:00
Madhukar Pappireddy
2519ee5ffe Merge "feat(ufs): adds timeout and error handling" into integration 2023-03-17 14:34:41 +01:00
Joanna Farley
2a9da687a0 Merge "docs: disable PDF output for documentation generation" into integration 2023-03-16 20:22:27 +01:00
Mark Brown
d333160366 feat(tcr2): support FEAT_TCR2
Arm v8.9 introduces FEAT_TCR2, adding extended translation control
registers. Support this, context switching TCR2_EL2 and disabling
traps so lower ELs can access the new registers.

Change the FVP platform to default to handling this as a dynamic option so
the right decision can be made by the code at runtime.

Signed-off-by: Mark Brown <broonie@kernel.org>
Change-Id: I297452acd8646d58bac64fc15e05b06a543e5148
2023-03-16 16:45:31 +00:00
Sandrine Bailleux
279e28ed35 docs: disable PDF output for documentation generation
Change-Id: I827deeb8008f0bf5f44c1f9d4afcce21ef102bba
2023-03-16 16:55:26 +01:00
Madhukar Pappireddy
13a6f2501a Merge "fix(nxp-drivers): use semicolon instead of comma" into integration 2023-03-16 15:55:06 +01:00
Boyan Karatotev
d5efb1e303 chore(fvp): add the aarch32 cortex A57 to the build
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I80921b501ad9a97ddf23c371642a0a5e3f56cd99
2023-03-16 11:04:47 +00:00
Boyan Karatotev
7c25a3a161 chore(cpus): remove redundant asserts
get_cpu_ops_ptr asserts that it didn't get 0 for a cpu_ops pointer. Its
callers don't need to do the same.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I547ac592949f74e153ef161015326f64aead2f28
2023-03-16 11:04:47 +00:00
Boyan Karatotev
e444763d65 refactor(cpus): shorten errata flag defines
The cpu-ops makefile has errata flag definition and flag processing done
per flag in separate parts in the file. Rework this to make a list and
do this in a much more concise way.

To ensure no flags were missed, a bash script [1] was used to verify all
errata flags made it across. Only the first few flags with different
naming were checked manually.

[1]:
sed -n "s/CPU_FLAG_LIST += ERRATA_\(.*\)/\1/p" lib/cpus/cpu-ops.mk > \
	/tmp/new
git checkout origin/master
sed -n "s/ERRATA_\([[:alnum:]_-]*\)\s*?=0/\1/p" lib/cpus/cpu-ops.mk > \
	/tmp/old
diff /tmp/old /tmp/new

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I3b88af46838cc26f42d2c66b31f96c0855fa406c
2023-03-16 11:04:47 +00:00
Sandrine Bailleux
579ea67d99 Merge changes from topic "mb/secure-evlog-cpy" into integration
* changes:
  feat(fvp): copy the Event Log to TZC secured DRAM area
  feat(arm): carveout DRAM1 area for Event Log
2023-03-16 09:37:18 +01:00
Elyes Haouas
50b8ea115f fix(nxp-drivers): use semicolon instead of comma
Use semicolon insted of comma at the end of line.

Change-Id: Id820f4419fdd7cf522fd8bb07395789d25f40c2e
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-03-16 07:43:11 +02:00
Chen Baozi
6b66693685 feat(qemu): add A76/N1 cpu support for virt
Add support to "cortex-a76" and "neoverse-n1" cpu for "qemu" ('virt')
platform.

Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Change-Id: I77a3e0bb8397a2fb45a2caa7d93ba38e39297f93
2023-03-16 03:17:24 +02:00
Manish V Badarkhe
d632452c20 Merge "fix(tc): unify TC ROM start addresses" into integration 2023-03-15 21:06:19 +01:00
Manish V Badarkhe
40858762d4 Merge "test(tc): test for AP/RSS NV counter interface" into integration 2023-03-15 18:49:35 +01:00
Manish V Badarkhe
bde9280dcc Merge "style(hooks): adds Arm copyright style fix" into integration 2023-03-15 17:51:42 +01:00
Maksims Svecovs
6bb49c876c style(hooks): adds Arm copyright style fix
Adds a check to pre-commit hook that makes sure "Arm" is written in a
correct case and not "arm" or "ARM". Same as a copyright-year check, the
hook will fix the issue and prompt user to stage the fix.

Change-Id: I39db148d6621d542193f3ee703bddc23c7e8dc27
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
2023-03-15 13:32:00 +00:00
Manish V Badarkhe
3e8b6f4327 Merge "feat(morello): implement methods to retrieve soc-id information" into integration 2023-03-15 14:27:47 +01:00
Joanna Farley
3e833f8363 Merge "fix(versal_net): fix irq for IPI0" into integration 2023-03-15 13:14:26 +01:00
Manish Pandey
a4c69581ae Merge "refactor(build): distinguish BL2 as TF-A entry point and BL2 running at EL3" into integration 2023-03-15 12:45:26 +01:00
Arvind Ram Prakash
42d4d3baac refactor(build): distinguish BL2 as TF-A entry point and BL2 running at EL3
BL2_AT_EL3 is an overloaded macro which has two uses:
	1. When BL2 is entry point into TF-A(no BL1)
	2. When BL2 is running at EL3 exception level
These two scenarios are not exactly same even though first implicitly
means second to be true. To distinguish between these two use cases we
introduce new macros.
BL2_AT_EL3 is renamed to RESET_TO_BL2 to better convey both 1. and 2.
Additional macro BL2_RUNS_AT_EL3 is added to cover all scenarious where
BL2 runs at EL3 (including four world systems).

BREAKING CHANGE: BL2_AT_EL3 renamed to RESET_TO_BL2 across the
repository.

Change-Id: I477e1d0f843b44b799c216670e028fcb3509fb72
Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
2023-03-15 11:43:14 +00:00
Anand Saminathan
2c5bce3833 feat(ufs): adds timeout and error handling
Adds a common function to poll for interrupt status which reports errors
and returns error codes

Signed-off-by: Anand Saminathan <anans@google.com>
Change-Id: Ie5df036dc979e984871de4ae7e974b994296ca4c
2023-03-15 09:53:12 +00:00
Chandni Cherukuri
cc266bcd8c feat(morello): implement methods to retrieve soc-id information
Added silicon revision in the platform information SDS structure.

Implemented platform functions to retrieve the soc-id information
for the morello SoC platform. SoC revision, which is same as
silicon revision, is fetched from the morello_plat_info structure
and SoC version is populated with the part number from SSC_VERSION
register, and is reflected in bits[0:15] of soc-id.

Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Change-Id: I8e0c5b2bc21e393e6d638858cc2ea9f4638f04b9
2023-03-15 10:33:08 +05:30
Trung Tran
95bbfbc6e0 fix(versal_net): fix irq for IPI0
Currently isr is not called when IPI0 interrupt occurs.
fix irq number and enable GIC interrupt properly to invoke
registered isr on IPI0 interrupt.

Signed-off-by: Trung Tran <trung.tran@amd.com>
Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Change-Id: Id0408b3a560b25234886a9fa01c4ed248d1d1532
2023-03-14 12:25:03 -07:00
Bipin Ravi
4c985e8674 Merge "fix(cpus): workaround for Neoverse V1 errata 2743233" into integration 2023-03-14 19:53:19 +01:00
Manish V Badarkhe
17628eb585 Merge "fix(rss): fix msg deserialization bugs in comms" into integration 2023-03-14 15:19:21 +01:00
Manish V Badarkhe
b742b6089b Merge "fix(pmu): switch FVP PMUv3 SPIs to PPI" into integration 2023-03-14 14:25:10 +01:00
Varun Wadekar
7683c2a7c7 Merge "fix(tegra): append major revision to the chip_id value" into integration 2023-03-13 17:52:15 +01:00
Madhukar Pappireddy
7a23f0538e Merge "fix(ti): do not take system power reference in bl31_platform_setup()" into integration 2023-03-13 17:01:08 +01:00
Madhukar Pappireddy
7b25a5a515 Merge "style: fix functions definitions" into integration 2023-03-13 15:20:26 +01:00
Manish Pandey
23b74991e3 Merge changes I9430f5fa,I23680085 into integration
* changes:
  feat(build): add support for new binutils versions
  build(makefile): add helper to detect linker options
2023-03-13 14:17:57 +01:00
Elyes Haouas
2535e2047f style: fix functions definitions
This is to fix old style functions definitions.

Change-Id: I094b1497dcf948d4d8de4d57d93878aa092ea053
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-03-13 12:34:40 +01:00
Manish Pandey
521d4fe676 Merge "style: remove useless trailing semicolon and line continuations" into integration 2023-03-13 12:34:21 +01:00
Marco Felsch
1f49db5f25 feat(build): add support for new binutils versions
Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces
of a new warning when linking the bl*.elf in the form:

  ld.bfd: warning: stm32mp1_helper.o: missing .note.GNU-stack section implies executable stack
  ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
  ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions
  ld.bfd: warning: bl32.elf has a LOAD segment with RWX permissions

These new warnings are enbaled by default to secure elf binaries:
 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107
 - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0d38576a34ec64a1b4500c9277a8e9d0f07e6774

Fix it in a similar way to what the Linux kernel does, see:
https://lore.kernel.org/all/20220810222442.2296651-1-ndesaulniers@google.com/

Following the reasoning there, we set "-z noexecstack" for all linkers
(although LLVM's LLD defaults to it) and optional add
--no-warn-rwx-segments since this a ld.bfd related.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617
2023-03-13 10:55:50 +01:00
Marco Felsch
a5f09cf705 build(makefile): add helper to detect linker options
This is a small helper to check for possible linker options. If the
linker supports the requested option it is returned and if not nothing
will be returned, e.g.:

  TF_LDFLAGS += $(call ld_option, --no-warn-rwx-segments)

can be called unconditional.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Change-Id: I236800852ece49948ff53a0b91fddba53c8f0f95
2023-03-13 10:55:50 +01:00
Joanna Farley
404e835c33 Merge "docs(zynqmp): add ddr address usage" into integration 2023-03-13 09:51:19 +01:00