Commit Graph

5388 Commits

Author SHA1 Message Date
Alexei Fedorov 9fc59639e6 Add support for Branch Target Identification
This patch adds the functionality needed for platforms to provide
Branch Target Identification (BTI) extension, introduced to AArch64
in Armv8.5-A by adding BTI instruction used to mark valid targets
for indirect branches. The patch sets new GP bit [50] to the stage 1
Translation Table Block and Page entries to denote guarded EL3 code
pages which will cause processor to trap instructions in protected
pages trying to perform an indirect branch to any instruction other
than BTI.
BTI feature is selected by BRANCH_PROTECTION option which supersedes
the previous ENABLE_PAUTH used for Armv8.3-A Pointer Authentication
and is disabled by default. Enabling BTI requires compiler support
and was tested with GCC versions 9.0.0, 9.0.1 and 10.0.0.
The assembly macros and helpers are modified to accommodate the BTI
instruction.
This is an experimental feature.
Note. The previous ENABLE_PAUTH build option to enable PAuth in EL3
is now made as an internal flag and BRANCH_PROTECTION flag should be
used instead to enable Pointer Authentication.
Note. USE_LIBROM=1 option is currently not supported.

Change-Id: Ifaf4438609b16647dc79468b70cd1f47a623362e
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
2019-05-24 14:44:45 +01:00
Sandrine Bailleux ced1711297 Merge changes from topic "pb/sphinx-doc" into integration
* changes:
  doc: Use proper note and warning annotations
  doc: Refactor contributor acknowledgements
  doc: Reorganise images and update links
  doc: Set correct syntax highlighting style
  doc: Add minimal glossary
  doc: Remove per-page contents lists
  doc: Make checkpatch ignore rst files
  doc: Format security advisory titles and headings
  doc: Reformat platform port documents
  doc: Normalise section numbering and headings
  doc: Reword document titles
2019-05-23 13:14:00 +00:00
Sandrine Bailleux 1665bcd0cf Merge "drivers: scmi: scmi_sq: Modify wrong payload length" into integration 2019-05-23 09:09:52 +00:00
Masahisa Kojima 292bc55193 drivers: scmi: scmi_sq: Modify wrong payload length
Payload length of the get dram mapping information message is 0.
The mbx_mem->len parameter should be 4, it only contains
message header.

Fixes: b67d202 ("plat/synquacer: enable SCMI support")
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Change-Id: If1cd4c855da2dc5dc4b6da3bea152b8441971de7
2019-05-23 14:41:35 +09:00
Paul Beesley e1c5026ac7 doc: Use proper note and warning annotations
The documentation contains plenty of notes and warnings. Enable
special rendering of these blocks by converting the note prefix
into a .. note:: annotation.

Change-Id: I34e26ca6bf313d335672ab6c2645741900338822
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:28:17 +01:00
Paul Beesley f94102ba96 doc: Refactor contributor acknowledgements
- Make the list of contributors into an actual list
- Use note syntax for the note
- Remove the Individuals heading since there are none

This file could be considered for removal as it is a legacy
document, as its note explains.

Change-Id: Idf984bc192af7a0ec367a6642ab99ccccf5df1a8
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:28:17 +01:00
Paul Beesley a2c320a83e doc: Reorganise images and update links
Change-Id: I679d1499376a524bef1cfc33df995b0a719b5ac8
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:28:17 +01:00
Paul Beesley 29c0252959 doc: Set correct syntax highlighting style
Several code blocks do not specify a language for syntax
highlighting. This results in Sphinx using a default highlighter
which is Python.

This patch adds the correct language to each code block that doesn't
already specify it.

Change-Id: Icce1949aabfdc11a334a42d49edf55fa673cddc3
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:28:17 +01:00
Paul Beesley 8f62ca7b30 doc: Add minimal glossary
One of the current issues with the documentation is that terms and
abbreviations are frequently redefined. For example, we might have
a sentence like "... the SCP (System Control Processor) will ...".

These definitions might be repeated several times across pages, or
even within the same document. Equally, some of these abbreviations
are missed and are never expanded.

Sphinx provides a :term: keyword that takes some text and,
if that text is defined in a glossary document, links to its glossary
entry. Using this functionality will prevent repeated definitions
and will make the docs more maintainable by using a single
definition source.

The glossary added in this patch was created from a quick scrub of
the source code - there may be missing entries. The SDEI abbreviation
was used as an example.

Note that a global_substitutions file was created. This file contains
the RST 'replace' statements that convert plain text terms into linked
terms (by adding the ':term:' keyword to them). An example is:

.. |TF-A| replace:: :term:`TF-A`

The 'rst_prolog' variable in conf.py is used to inject this list of
replacements into each page. Terms must be surrounded with the pipe
character to be turned into links - this means that we can still
prevent certain terms from being linked if we don't want them to be.

Change-Id: I87010ed9cfa4a60011a9b4a431b98cb4bb7baa28
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:28:15 +01:00
Paul Beesley 57354abb20 doc: Remove per-page contents lists
These are no longer needed as there will always be a table of contents
rendered to the left of every page.

Some of these lists can be quite long and, when opening a page, the
reader sees nothing but a huge list of contents! After this patch,
the document contents are front-and-centre and the contents are
nicely rendered in the sidebar without duplication.

Change-Id: I444754d548ec91d00f2b04e861de8dde8856aa62
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:23:06 +01:00
Paul Beesley 1ef35512cf doc: Make checkpatch ignore rst files
Previously checkpatch was invoked with options to make it ignore
Markdown (md) files as this was the dominant format for TF-A
documents. Now that rst is being used everywhere this option needs
updating.

Change-Id: I59b5a0bcc45d2386df4f880b8d333baef0bbee77
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:23:06 +01:00
Paul Beesley 267f8085f2 doc: Format security advisory titles and headings
Required so that the advisory documents are all valid RST files (with a
header) and that they all integrate into the document tree.

Change-Id: I68ca2b0b9e648e24b460deb772c471a38518da26
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:23:06 +01:00
Paul Beesley 24dba2b39f doc: Reformat platform port documents
The platform port documents are not very standardised right now and
they don't integrate properly into the document tree so:

1) Make sure each port has a proper name and title (incl. owner)
2) Correct use of headings, subheadings, etc in each port
3) Resolve any naming conflicts between documents

Change-Id: I4c2da6f57172b7f2af3512e766ae9ce3b840b50f
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:22:44 +01:00
Paul Beesley 83993177d9 doc: Normalise section numbering and headings
Required work to make all documents sit at the correct levels within
the document tree and any derived content like the table of contents
and the categories in the sidebar.

Change-Id: I4885fbe30864a87c8822ee67482b71fb46a8fbc6
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:20:39 +01:00
Paul Beesley 8aa050554b doc: Reword document titles
This patch attempts to standardise the document titles as well as
adding titles to documents that were missing one. The aim is to
remove needless references to "TF-A" or "Trusted Firmware" in the
title of every document and to make sure that the title matches
with the document content.

Change-Id: I9b93ccf43b5d57e8dc793a5311b8ed7c4dd245cc
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-22 11:20:39 +01:00
Sandrine Bailleux b27c7d6f05 Merge "rcar_gen3: drivers: qos: update QoS setting" into integration 2019-05-22 08:01:02 +00:00
Sandrine Bailleux c8f8579ad2 Merge changes Icf1ea76c,I9ca3f278 into integration
* changes:
  imx8: Replace PLAT_IMX8* with automatic PLAT_imx8*
  plat: imx8mq: Implement IMX_SIP_GET_SOC_INFO
2019-05-22 07:06:39 +00:00
Sandrine Bailleux 8d8ec6b226 Merge "Rework smc_unknown return code path in smc_handler" into integration 2019-05-22 06:22:03 +00:00
Yoshifumi Hosoya 197822e2aa rcar_gen3: drivers: qos: update QoS setting
Update M3 Ver.3.0 QoS setting rev.0.03.

Change-Id: I892521d456c606ac3d30f2b2ac6b4e16faa5fc48
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-05-22 01:06:38 +02:00
Sandrine Bailleux 38eecf145c Merge "doc: Move content out of readme and create new index page" into integration 2019-05-21 14:57:07 +00:00
Sandrine Bailleux 6d95ccda41 Merge "doc: Move documents into subdirectories" into integration 2019-05-21 14:56:08 +00:00
Paul Beesley 9f1622b018 doc: Move content out of readme and create new index page
Previously the readme.rst file served as the entrypoint for the
documentation. With a Sphinx build the top-level document is set
to be index.rst as it contains the primary document index.

This patch moves some content from readme.rst into index.rst and
splits the license information out into license.rst.

Change-Id: I5c50250b81136fe36aa9ceedaae302b44ec11e47
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-21 15:05:58 +01:00
Paul Beesley 40d553cfde doc: Move documents into subdirectories
This change creates the following directories under docs/
in order to provide a grouping for the content:

- components
- design
- getting_started
- perf
- process

In each of these directories an index.rst file is created
and this serves as an index / landing page for each of the
groups when the pages are compiled. Proper layout of the
top-level table of contents relies on this directory/index
structure.

Without this patch it is possible to build the documents
correctly with Sphinx but the output looks messy because
there is no overall hierarchy.

Change-Id: I3c9f4443ec98571a56a6edf775f2c8d74d7f429f
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-21 15:05:56 +01:00
Sandrine Bailleux 12b67439e9 Merge "doc: Add minimal Sphinx support" into integration 2019-05-21 13:42:17 +00:00
Sandrine Bailleux 62a72942d1 Merge "romlib: Improve compilation flags definition" into integration 2019-05-21 12:33:18 +00:00
Paul Beesley 653279b015 doc: Add minimal Sphinx support
Add the essentials for supporting a Sphinx documentation build:

- A makefile under docs/ to invoke Sphinx with the desired output
  format
- A Sphinx master configuration file (conf.py)
- A single, top-level index page (index.rst)
- The TF.org logo that is integrated in the the sidebar of the
  rendered output

Change-Id: I85e67e939658638337ca7972936a354878083a25
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-05-21 12:31:25 +01:00
Sandrine Bailleux b189a20613 Merge "Fix docs references to header files" into integration 2019-05-21 08:55:31 +00:00
John Tsichritzis ce8dc18773 Fix docs references to header files
Change-Id: I5c06e777d93ac653a853997c2b7c1c9d09b1e49c
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
2019-05-21 09:38:11 +01:00
Madhukar Pappireddy cc485e27ac Rework smc_unknown return code path in smc_handler
The intention of this patch is to leverage the existing el3_exit() return
routine for smc_unknown return path rather than a custom set of instructions.
In order to leverage el3_exit(), the necessary counteraction (i.e., saving the
system registers apart from GP registers) must be performed. Hence a series of
instructions which save system registers( like SPSR_EL3, SCR_EL3 etc) to stack
are moved to the top of group of instructions which essentially decode the OEN
from the smc function identifier and obtain the specific service handler in
rt_svc_descs_array. This ensures that the control flow for both known and
unknown smc calls will be similar.

Change-Id: I67f94cfcba176bf8aee1a446fb58a4e383905a87
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2019-05-21 08:19:37 +00:00
Sandrine Bailleux af9ae7cfa1 Merge "Update docs for FVP v11.6" into integration 2019-05-21 08:17:16 +00:00
Louis Mayencourt 2b929c986b romlib: Improve compilation flags definition
* Optimization flags were only provided for debug build.
* Set optimisation level to -O1
* Remove CFLAGS which is never used for romlib
* Remove the ignored -g flag from LDFLAGS

Change-Id: Id4b69026d8a322ed4cb0acf06c350f13d31571ad
Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
2019-05-21 07:11:55 +00:00
John Tsichritzis 532a67dd16 Update docs for FVP v11.6
Change-Id: I33c1bf49aa10867e1a2ca4c167112b99bf756dda
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
2019-05-20 14:07:15 +01:00
Leonard Crestez f56afc1f59 imx8: Replace PLAT_IMX8* with automatic PLAT_imx8*
Platform defines are already provided by the build system so let's not
duplicate them.

Change-Id: Icf1ea76c3c3213e27b447c95e2b22b961fa7693e
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
2019-05-20 11:28:51 +03:00
Leonard Crestez 72196cbb66 plat: imx8mq: Implement IMX_SIP_GET_SOC_INFO
The manual documents that 0x3036006c should contains the soc revision
for imx8mq but this always reports A0. Work around this by parsing the
ROM header and checking if OCOTP register 0x40 is stuck at 0xff0055aa.

Determining this inside TF-A makes life easier for OS, see for example
this linux discussion: https://lkml.org/lkml/2019/5/3/465

The soc revision can also be useful inside TF-A itself, for example for
the non-upstream DDR DVFS "busfreq" feature is affected by 8mq erratas.

The clock for OCOTP block can be disabled by OS so only initialize soc
revision once at boot time.

Change-Id: I9ca3f27840229ce8a28b53870e44da29f63c73aa
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
2019-05-20 11:24:54 +03:00
Soby Mathew 482fc9c888 Merge changes from topic "sami/550_fix_n1sdp_issues_v1" into integration
* changes:
  N1SDP: Initialise CNTFRQ in Non Secure CNTBaseN
  N1SDP: Fix DRAM2 start address
  Add option for defining platform DRAM2 base
  Disable speculative loads only if SSBS is supported
2019-05-16 08:33:56 +00:00
Soby Mathew d8b11091b6 Merge "plat: imx8mq: Remove duplicated linker symbols" into integration 2019-05-15 16:00:40 +00:00
Soby Mathew 519a7db252 Merge "drivers: ufs: Extend the delay after reset to wait for some slower chips" into integration 2019-05-15 15:58:17 +00:00
Soby Mathew eefdb4fb21 Merge "Remove .arch directives from spinlock.S" into integration 2019-05-15 15:54:32 +00:00
Soby Mathew acc18c1fca Merge "SMMUv3: Abort DMA transactions" into integration 2019-05-15 15:54:16 +00:00
Sami Mujawar 603b372e53 N1SDP: Initialise CNTFRQ in Non Secure CNTBaseN
N1SDP exhibits the behavior similar to Juno wherein CNTBaseN.CNTFRQ
can be written but does not reflect the value of the CNTFRQ register
in CNTCTLBase frame. This doesn't follow ARM ARM in that the value
updated in CNTCTLBase.CNTFRQ is not reflected in CNTBaseN.CNTFRQ.

Hence enable the workaround (applied to Juno) for N1SDP that updates
the CNTFRQ register in the Non Secure CNTBaseN frame.

Change-Id: Id89ee1bca0f25c9d62f8f794f2c4f4e618cdf092
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2019-05-15 11:43:20 +01:00
Sami Mujawar 49d64e5d0e N1SDP: Fix DRAM2 start address
The default DRAM2 start address for Arm platforms
is 0x880000000. However, for N1SDP platform this is
0x8080000000.

Fix the DRAM2 start address by initialising
PLAT_ARM_DRAM2_BASE.

Without this fix there is a mismatch of the System
memory region view as seen by the BL31 runtime
firmware (PSCI) versus the view of the OS (which
is based on the description provided by UEFI. In
this case UEFI is correctly describing the DRAM2
start address).

This implicates in secondary cores failing to start
on some Operating Systems if the OS decides to place
the secondary start address in the mismatched region.

Change-Id: I57220e753219353dda429868b4c5e1a69944cc64
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2019-05-15 11:43:19 +01:00
Sami Mujawar 6bb6015f91 Add option for defining platform DRAM2 base
The default DRAM2 base address for Arm platforms
is 0x880000000. However, on some platforms the
firmware may want to move the start address to
a different value.

To support this introduce PLAT_ARM_DRAM2_BASE that
defaults to 0x880000000; but can be overridden by
a platform (e.g. in platform_def.h).

Change-Id: I0d81195e06070bc98f376444b48ada2db1666e28
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2019-05-15 11:42:39 +01:00
Sami Mujawar eca6e45336 Disable speculative loads only if SSBS is supported
Examine the ID_AA64PFR1_EL1 bits 7:4 to see if speculative
loads (SSBS) is implemented, before disabling speculative
loads.

Change-Id: I7607c45ed2889260d22a94f6fd9af804520acf67
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2019-05-14 15:57:10 +01:00
John Stultz cbebadf595 drivers: ufs: Extend the delay after reset to wait for some slower chips
We've seen issues with some THG based UFS chips, where
after reset the LUNs don't always enumerate properly.

After some debugging, we found that extending the mdelay
here seems to resolve the issue by giving the chips enough
time to complete reset.

Change-Id: I848f810b2438ed6ad3d33db614c61d2cef9ac400
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-05-13 17:11:07 -07:00
Jacky Bai b05631afdc plat: imx8mq: Remove duplicated linker symbols
Remove duplicated linker symbols, resue the symbols
defined in bl_common.h

Change-Id: I10de450eccc78c09b61a8ae7126bf4f4029fa682
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
2019-05-13 21:55:53 +08:00
Alexei Fedorov 02a85c1116 Remove .arch directives from spinlock.S
This patch removes .arch "arm8.1-a" and "armv8-a"
directives which overwrite ASFLAGS_aarch64 option based
on ARM_ARCH_MINOR passed to Makefile and cause
translation errors like
"selected processor does not support `bti jc'"
for armv8.5-a targets when BTI support is enabled.

Change-Id: Idca5b66ed1e5d86e2188b0c0f16c3819990957c4
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
2019-05-13 09:50:27 +01:00
Alexei Fedorov 1461ad9feb SMMUv3: Abort DMA transactions
For security DMA should be blocked at the SMMU by default
unless explicitly enabled for a device. SMMU is disabled
after reset with all streams bypassing the SMMU, and
abortion of all incoming transactions implements a default
deny policy on reset.
This patch also moves "bl1_platform_setup()" function from
arm_bl1_setup.c to FVP platforms' fvp_bl1_setup.c and
fvp_ve_bl1_setup.c files.

Change-Id: Ie0ffedc10219b1b884eb8af625bd4b6753749b1a
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
2019-05-10 16:09:19 +01:00
Soby Mathew c33aa45f44 Merge "Initialize platform for MediaTek mt8183" into integration 2019-05-10 10:42:18 +00:00
Antonio Niño Díaz 4c4ec95b81 Merge "maintainers: Step down as sub-maintainer" into integration 2019-05-10 08:57:32 +00:00
Antonio Niño Díaz 18113ba7f5 Merge "plat: imx8m: Implement IMX_SIP_BUILDINFO" into integration 2019-05-10 08:51:29 +00:00