Commit Graph

8462 Commits

Author SHA1 Message Date
Pali Rohár 805f22babd Print newline after hex address in aarch64 el3_panic function
Make the aarch64's el3_panic() function print a newline character after
PC address, otherwise the output can get mangled in one line with output
from other firmware. Here is an example of how the output of el3_panic()
got mangled with Linux' console output:

    ERROR:   Unhandled External Abort received on 0x80000001 at EL3!
    ERROR:    exception reason=1 syndrome=0x92000210
    PANIC at PC : 0x0000000004027400[13438.473133] rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
    [13438.479255] rcu:     1-...0: (4 ticks this GP) idle=35e/1/0x4000000000000000 softirq=146459/146459 fqs=2625

The aarch32 version of this function already does this.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I9f0d032c6cd1e2be7a1837f9c8e8244d30633993
2021-03-04 11:05:31 +01:00
Olivier Deprez 6630681458 Merge "spmd: ensure SIMD context is saved/restored on SPMC entry/exit" into integration 2021-02-12 17:48:21 +00:00
Manish Pandey 305135716a Merge "nxp: added the makefile helper macros" into integration 2021-02-12 11:56:39 +00:00
Pankaj Gupta b749ae3d3e nxp: added the makefile helper macros
NXP specifc macro SET_NXP_MAKE_FLAG is added.

NXP has pool of multiple IPs. This macro helps:
- In soc.mk, this macro help the selected IP source files to be included
  for that SoC.
  -- The set of IPs required for one NXP SoC is different to the set of IPs
     required by another NXP SoC.

- For the same SoC,
  -- For one feature, the IP may be required in both BL2 and BL31.
  -- Without the above feature, that IP may be required in one.
     This macro help in selecting the inclusion of source and header files to:
     --- BL2 only
     --- BL31 only
     --- COMM (used by BL2 and BL31)

Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Change-Id: I2cdb13b89aa815fc5219cf8bfb9666d0a9f78765
2021-02-12 17:20:24 +05:30
Olivier Deprez bedb13f509 spmd: ensure SIMD context is saved/restored on SPMC entry/exit
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I8ed58ec5f97e05d91451020a2739464bb8e428b3
2021-02-12 10:54:08 +00:00
bipin.ravi d3e145b4cd Merge "plat/arm: juno: Refactor juno_getentropy()" into integration 2021-02-11 21:43:09 +00:00
Mark Dykes 7eff040062 Merge "bl32: Enable TRNG service build" into integration 2021-02-11 21:41:50 +00:00
Madhukar Pappireddy b2e5e56f05 Merge "plat/arm/rdn2: update TZC base address" into integration 2021-02-11 17:15:02 +00:00
Madhukar Pappireddy 94b0c3341e Merge changes from topic "mp/strto_libc" into integration
* changes:
  libc: Import strtoull from FreeBSD project
  libc: Import strtoll from FreeBSD project
  libc: Import strtoul from FreeBSD project
  libc: Import strtol from FreeBSD project
2021-02-11 16:04:54 +00:00
Madhukar Pappireddy edbe490baa Merge "morello: Modify morello_plat_info structure" into integration 2021-02-11 15:35:33 +00:00
Andre Przywara 543f0d8b08 plat/arm: juno: Refactor juno_getentropy()
Currently we use the Juno's TRNG hardware entropy source to initialise
the stack canary. The current function allows to fill a buffer of any
size, but we will actually only ever request 16 bytes, as this is what
the hardware implements. Out of this, we only need at most 64 bits for
the canary.

In preparation for the introduction of the SMCCC TRNG interface, we
can simplify this Juno specific interface by making it compatible with
the generic one: We just deliver 64 bits of entropy on each call.
This reduces the complexity of the code. As the raw entropy register
readouts seem to be biased, it makes sense to do some conditioning
inside the juno_getentropy() function already.
Also initialise the TRNG hardware, if not already done.

Change-Id: I11b977ddc5417d52ac38709a9a7b61499eee481f
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-02-11 10:43:25 +00:00
Andre Przywara 0e14948e2a bl32: Enable TRNG service build
The Trusted Random Number Generator service is using the standard SMC
service dispatcher, running in BL31. For that reason we list the files
implementing the service in bl31.mk.
However when building for a 32-bit TF-A runtime, sp_min.mk is the
Makefile snippet used, so we have to add the files into there as well.

This fixes 32-bit builds of platforms that provide the TRNG service.

Change-Id: I8be61522300d36477a9ee0a9ce159a140390b254
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-02-11 10:43:25 +00:00
Vijayenthiran Subramaniam 4e8060d2f5 plat/arm/rdn2: update TZC base address
Update TZC base address to align with the recent changes in the platform
memory map.

Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Change-Id: I0d0ad528a2e236607c744979e1ddc5c6d426687a
2021-02-11 14:02:56 +05:30
bipin.ravi 04c1223104 Merge "services: TRNG: Fix -O0 compilation" into integration 2021-02-10 21:52:04 +00:00
Andre Przywara 323b6c6305 services: TRNG: Fix -O0 compilation
The code to check for the presence of the TRNG service relies on
toolchain garbage collection, which is not enabled with -O0.

Add #ifdef guards around the call to the TRNG service handler to
cover builds without optimisation as well.

Change-Id: I08ece2005ea1c8fa96afa13904a851dec6b24216
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-02-10 17:34:45 +00:00
Madhukar Pappireddy 925477ece4 Merge changes from topic "GIC-work" into integration
* changes:
  plat/arm: fvp: Protect GICR frames for fused/unused cores
  doc: Build option to protect GICR frame
  plat/arm: fvp: Do not map GIC region in BL1 and BL2
2021-02-10 00:56:08 +00:00
Manish V Badarkhe f98630fbbf plat/arm: fvp: Protect GICR frames for fused/unused cores
Currently, BLs are mapping the GIC memory region as read-write
for all cores on boot-up.

This opens up the security hole where the active core can write
the GICR frame of fused/inactive core. To avoid this issue, disable
the GICR frame of all inactive cores as below:

1. After primary CPU boots up, map GICR region of all cores as
   read-only.
2. After primary CPU boots up, map its GICR region as read-write
   and initialize its redistributor interface.
3. After secondary CPU boots up, map its GICR region as read-write
   and initialize its redistributor interface.
4. All unused/fused core's redistributor regions remain read-only and
   write attempt to such protected regions results in an exception.

As mentioned above, this patch offers only the GICR memory-mapped
region protection considering there is no facility at the GIC IP
level to avoid writing the redistributor area.

These changes are currently done in BL31 of Arm FVP and guarded under
the flag 'FVP_GICR_REGION_PROTECTION'.

As of now, this patch is tested manually as below:
1. Disable the FVP cores (core 1, 2, 3) with core 0 as an active core.
2. Verify data abort triggered by manually updating the ‘GICR_CTLR’
   register of core 1’s(fused) redistributor from core 0(active).

Change-Id: I86c99c7b41bae137b2011cf2ac17fad0a26e776d
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-02-09 15:55:26 +00:00
Manish V Badarkhe d30a6615d1 doc: Build option to protect GICR frame
Added a build option 'FVP_GICR_REGION_PROTECTION' to make
redistributor frame of fused/unused cores as read only.

Change-Id: Ie85f86e2465b93321a92a888ce8712a3144e4ccb
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-02-09 15:54:19 +00:00
Manish V Badarkhe e0cea7831f plat/arm: fvp: Do not map GIC region in BL1 and BL2
GIC memory region is not getting used in BL1 and BL2.
Hence avoid its mapping in BL1 and BL2 that freed some
page table entries to map other memory regions in the
future.

Retains mapping of CCN interconnect region in BL1 and BL2
overlapped with the GIC memory region.

Change-Id: I880dd0690f94b140e59e4ff0c0d436961b9cb0a7
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-02-09 15:44:33 +00:00
Sandrine Bailleux bb9ecd0d53 Merge "fdts: use scmi_dvfs clock index 1 for cores 4-7" into integration 2021-02-09 14:47:12 +00:00
Usama Arif a97c390b9f
fdts: use scmi_dvfs clock index 1 for cores 4-7
This allows Matterhorn cores to operate at their optimal OPPs.

Signed-off-by: Usama Arif <usama.arif@arm.com>
Change-Id: I2e1b784da10154a1f1f65dd0e3a39213e7683116
2021-02-09 14:10:45 +00:00
Manoj Kumar 42ea8d6731 morello: Modify morello_plat_info structure
The structure has been modified to specify the memory
size in bytes instead of Gigabytes.

Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Change-Id: I3384677d79af4f3cf55d3c353b6c20bb827b5ae7
2021-02-08 11:08:02 +05:30
Madhukar Pappireddy 8098d54409 Merge "ddr: stm32mp1_ddr: correct SELFREF_TO_X32 mask" into integration 2021-02-05 18:33:33 +00:00
Lauren Wehrmeister 8c7f156f96 Merge "rainier: remove cpu workaround for errata 1542419" into integration 2021-02-05 16:26:15 +00:00
André Przywara 6080aac977 Merge "Add TRNG Firmware Interface service" into integration 2021-02-05 12:22:29 +00:00
Jimmy Brisson 7dfb99118e Add TRNG Firmware Interface service
This adds the TRNG Firmware Interface Service to the standard
service dispatcher. This includes a method for dispatching entropy
requests to platforms and includes an entropy pool implementation to
avoid dropping any entropy requested from the platform.

Change-Id: I71cadb3cb377a507652eca9e0d68714c973026e9
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-02-05 11:49:18 +00:00
Manoj Kumar 041d7c7ba9 rainier: remove cpu workaround for errata 1542419
This patch removes the Neoverse N1 CPU errata workaround for
bug 1542419 as the bug is not present in Rainier R0P0 core.

Change-Id: Icaca299b13ef830b2ee5129576aae655a6288e69
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
2021-02-05 11:14:58 +00:00
Yann Gautier edaaa98fc5 ddr: stm32mp1_ddr: correct SELFREF_TO_X32 mask
In DDR controller PWRTMG register, the mask for field SELFREF_TO_X32 is
wrong. This field is from bit 16 to 23.

Change-Id: Id336fb08c88f0a153df186dd819e41af72febb88
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2021-02-04 14:17:32 +01:00
Madhukar Pappireddy d56b957c21 libc: Import strtoull from FreeBSD project
From commit: 21571b1d140ae7bb44e94c0afba2ec61456b275b
The coding guidelines[1] in TF-A forbid the use of ato*() functions
in favour of strto*(). However, the TF-A libc does not provide an
implementation of strto*(), making this rule impossible to satisfy.

Also made small changes to fit into TF-A project. Added the source
files to the libc makefile

[1] https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#libc-functions-that-are-banned-or-to-be-used-with-caution

Change-Id: I2e94a0b227ec39f6f4530dc50bb477999d27730f
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2021-02-03 10:36:33 -06:00
Madhukar Pappireddy 587c15565f libc: Import strtoll from FreeBSD project
From commit: 21571b1d140ae7bb44e94c0afba2ec61456b275b
The coding guidelines[1] in TF-A forbid the use of ato*() functions
in favour of strto*(). However, the TF-A libc does not provide an
implementation of strto*(), making this rule impossible to satisfy.

Also made small changes to fit into TF-A project. Added the source
files to the libc makefile

[1] https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#libc-functions-that-are-banned-or-to-be-used-with-caution

Change-Id: I9cb581574d46de73c3d6917ebf78935fc5ac075a
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2021-02-03 10:36:33 -06:00
Madhukar Pappireddy 15c1c14735 libc: Import strtoul from FreeBSD project
From commit: 21571b1d140ae7bb44e94c0afba2ec61456b275b
The coding guidelines[1] in TF-A forbid the use of ato*() functions
in favour of strto*(). However, the TF-A libc does not provide an
implementation of strto*(), making this rule impossible to satisfy.

Also made small changes to fit into TF-A project. Added the source
files to the libc makefile

[1] https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#libc-functions-that-are-banned-or-to-be-used-with-caution

Change-Id: I8c3b92751d1ce226c966f7c81fedd83f0846865e
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2021-02-03 10:36:33 -06:00
Madhukar Pappireddy 015240d9d3 libc: Import strtol from FreeBSD project
From commit: 21571b1d140ae7bb44e94c0afba2ec61456b275b
The coding guidelines[1] in TF-A forbid the use of ato*() functions
in favour of strto*(). However, the TF-A libc does not provide an
implementation of strto*(), making this rule impossible to satisfy.

Also made small changes to fit into TF-A project. Added the source
files to the libc makefile

[1] https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#libc-functions-that-are-banned-or-to-be-used-with-caution

Change-Id: Ica95bf5da722913834fe90bf3fe743aa34e01e80
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2021-02-03 10:36:33 -06:00
Lauren Wehrmeister d5105d994c Merge changes from topic "RD_INFRA_POWER_MODING" into integration
* changes:
  plat/arm/board: enable AMU for RD-N2
  plat/arm/board: enable AMU for RD-V1
  plat/arm/sgi: allow all PSCI callbacks on RD-V1
2021-02-03 16:09:51 +00:00
Manish Pandey 6d0dcc7d96 Merge "plat/arm:juno: fix parallel build issue for romlib config" into integration 2021-02-03 15:10:50 +00:00
Manish Pandey 9bc3007d3b Merge "product/tc0: Enable Theodul DSU in TC platform" into integration 2021-02-03 14:50:43 +00:00
Avinash Mehta e5da15e045 product/tc0: Enable Theodul DSU in TC platform
Increase the core count and add respective entries in DTS.
Add Klein assembly file to cpu sources for core initialization.
Add SCMI entries for cores.

Signed-off-by: Avinash Mehta <avinash.mehta@arm.com>
Change-Id: I14dc1d87df6dcc8d560ade833ce1f92507054747
2021-02-03 10:10:58 +00:00
Zelalem 5e508f06a0 plat/arm:juno: fix parallel build issue for romlib config
When building TF-A with USE_ROMLIB=1 and -j make options, the build fails with the following error:
make[1]: *** No rule to make target '/build/juno/debug/romlib/romlib.bin', needed by 'bl1_romlib.bin'.
This patch fixes that issue.

Signed-off-by: Zelalem <zelalem.aweke@arm.com>
Change-Id: I0cca416f3f50f400759164e0735c2d6b520ebf84
2021-02-02 11:24:56 -06:00
Madhukar Pappireddy 96edbe0341 Merge "Fix exception handlers in BL31: Use DSB to synchronize pending EA" into integration 2021-02-02 16:32:32 +00:00
Manish Pandey 477e28de58 Merge changes from topic "marvell-armada-docs" into integration
* changes:
  docs: marvell: Replace ESPRESSObin-Ultra TF-A build example by full example how to build production release of Marvell firmware image
  docs: marvell: Fix description of flash-image.bin image
  docs: marvell: Add information into CLOCKSPRESET option how to identify CPU frequency
  docs: marvell: Reformat DDR_TOPOLOGY option and mention EspressoBin-Ultra board
  docs: marvell: Move Supported Marvell platforms to PLAT build option
2021-02-02 12:15:50 +00:00
Manish Pandey 6803d98945 Merge changes from topic "marvell-a3k-separate-flash-and-uart" into integration
* changes:
  plat: marvell: armada: a3k: Do not use 'echo -e' in Makefile
  docs: marvell: Update info about BOOTDEV=SATA
2021-02-02 11:17:54 +00:00
Manish Pandey 72645d5b60 Merge changes from topic "marvell-a3k-separate-flash-and-uart" into integration
* changes:
  docs: marvell: Update info about WTMI_IMG option
  plat: marvell: armada: a3k: Remove unused variable WTMI_SYSINIT_IMG from Makefile
  plat: marvell: armada: Show informative build messages and blank lines
  plat: marvell: armada: Move definition of mrvl_flash target to common marvell_common.mk file
  plat: marvell: armada: a3k: Use $(Q) instead of @
  plat: marvell: armada: a3k: Add a new target mrvl_uart which builds UART image
  plat: marvell: armada: a3k: Build UART image files directly in $(BUILD_UART) subdirectory
  plat: marvell: armada: a3k: Build intermediate files in $(BUILD_PLAT) directory
  plat: marvell: armada: a3k: Correctly set DDR_TOPOLOGY and CLOCKSPRESET for WTMI
  plat: marvell: armada: a3k: Allow use of the system Crypto++ library
  docs: marvell: Update info about WTP and MV_DDR_PATH parameters
  plat: marvell: armada: a3k: Add checks that WTP, MV_DDR_PATH and CRYPTOPP_PATH are correctly defined
  docs: marvell: Update mv-ddr-marvell and A3700-utils-marvell branches
2021-02-02 10:43:10 +00:00
Pali Rohár ff46a41dc2 docs: marvell: Replace ESPRESSObin-Ultra TF-A build example by full example how to build production release of Marvell firmware image
ESPRESSObin-Ultra TF-A build example was now just a copy+paste of previous
mentioned example. It produced debug binary with custom log level, which
was not described. So rather replace this duplicate build example by a full
example with all steps how to build production release of Marvell firmware
image for EspressoBin with 1GHz CPU and 1GB DDR4 RAM.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: Ief1b8bc96a3035ebd8421bd68dca5eb5c8d8fd52
2021-02-02 10:26:34 +01:00
Pali Rohár f60f1e848d docs: marvell: Fix description of flash-image.bin image
Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I192acab2a7f42cd80069faeac2d7823a05558dc6
2021-02-02 10:26:34 +01:00
Pali Rohár 23abf07ce4 docs: marvell: Add information into CLOCKSPRESET option how to identify CPU frequency
Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I5310c30051703bbf9f377762a00eb6a8188c6fa1
2021-02-02 10:26:34 +01:00
Pali Rohár 9c3fffdc86 docs: marvell: Reformat DDR_TOPOLOGY option and mention EspressoBin-Ultra board
Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I96c2d9d5bc6c69a1a66a29bf586a23375d63ab5a
2021-02-02 10:26:34 +01:00
Pali Rohár 24e6e10b99 docs: marvell: Move Supported Marvell platforms to PLAT build option
Reformat list of boards, remove unsupported OcteonTX2 and mention
supported Turris MOX board.

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I22cea7f77fd078554c7f0ed4108781626209e563
2021-02-02 10:25:49 +01:00
André Przywara 9192f34e65 Merge changes from topic "sunxi-split-psci" into integration
* changes:
  allwinner: Leave CPU power alone during BL31 setup
  allwinner: psci: Invert check in .validate_ns_entrypoint
  allwinner: psci: Drop MPIDR check from .pwr_domain_on
  allwinner: psci: Drop .get_node_hw_state callback
2021-01-30 01:49:07 +00:00
Pranav Madhu f7bab27616 plat/arm/board: enable AMU for RD-N2
AMU counters are used for monitoring the CPU performance. RD-N2 platform
has architected AMU available for each core. Enable the use of AMU by
non-secure OS for supporting the use of counters for processor
performance control (ACPI CPPC).

Change-Id: I5cc749cf63c18fc5c7563dd754c2f42990a97e23
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2021-01-29 22:32:54 +05:30
Pranav Madhu c9bf2cf5e3 plat/arm/board: enable AMU for RD-V1
AMU counters are used for monitoring the CPU performance. RD-V1 platform
has architected AMU available for each core. Enable the use of AMU by
non-secure OS for supporting the use of counters for processor
performance control (ACPI CPPC).

Change-Id: I4003d21407953f65b3ce99eaa8f496d6052546e0
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2021-01-29 22:32:54 +05:30
Pranav Madhu 92264f86a3 plat/arm/sgi: allow all PSCI callbacks on RD-V1
Some of the PSCI platform callbacks were restricted on RD-V1 platform
because the idle was not functional. Now that it is functional, remove
all the restrictions on the use PSCI platform callbacks.

Change-Id: I4cb97cb54de7ee166c30f28df8fea653b6b425c7
Signed-off-by: Pranav Madhu <pranav.madhu@arm.com>
2021-01-29 22:32:54 +05:30