]> git.baikalelectronics.ru Git - arm-tf.git/log
arm-tf.git
4 years agodoc: stm32mp1: Improve OP-TEE related documentation
Jan Kiszka [Fri, 2 Oct 2020 08:07:00 +0000 (10:07 +0200)]
doc: stm32mp1: Improve OP-TEE related documentation

stm32mp15_optee_defconfig has been dropped from U-Boot as it became
identical to stm32mp15_trusted_defconfig.

Furthermore give a hint how OP-TEE is supposed to be installed.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Change-Id: Id8f0bd84a87e3a62072dd4405aadddcdd3511213

4 years agoMerge "Measured Boot Driver: Fix MISRA-C 2012 defects" into integration
Madhukar Pappireddy [Thu, 1 Oct 2020 18:18:32 +0000 (18:18 +0000)]
Merge "Measured Boot Driver: Fix MISRA-C 2012 defects" into integration

4 years agoMerge "Crypto library: Migrate support to MbedTLS v2.24.0" into integration
Olivier Deprez [Thu, 1 Oct 2020 13:21:14 +0000 (13:21 +0000)]
Merge "Crypto library: Migrate support to MbedTLS v2.24.0" into integration

4 years agoCrypto library: Migrate support to MbedTLS v2.24.0
Alexei Fedorov [Mon, 21 Sep 2020 11:23:54 +0000 (12:23 +0100)]
Crypto library: Migrate support to MbedTLS v2.24.0

This patch migrates the mbedcrypto dependency for TF-A
to mbedTLS repo v2.24.0 which is the latest release tag.
The relevant documentation is updated to reflect the
use of new version.

Change-Id: I116f44242e8c98e856416ea871d11abd3234dac1
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
4 years agoMerge changes from topic "stm32_exceptions" into integration
Manish Pandey [Wed, 30 Sep 2020 07:58:44 +0000 (07:58 +0000)]
Merge changes from topic "stm32_exceptions" into integration

* changes:
  stm32mp1: correct crash console GPIO alternate configuration
  stm32mp1: add plat_panic_handler function
  stm32mp1: update plat_report_exception
  Align AARCH32 version of debug.S with AARCH64

4 years agoMerge changes from topic "fpga_generic" into integration
André Przywara [Wed, 30 Sep 2020 00:13:29 +0000 (00:13 +0000)]
Merge changes from topic "fpga_generic" into integration

* changes:
  arm_fpga: Add platform documentation
  arm_fpga: Add post-build linker script
  arm_fpga: Add ROM trampoline
  arm_fpga: Add devicetree file
  arm_fpga: Remove SPE PMU DT node if SPE is not available
  arm_fpga: Adjust GICR size in DT to match number of cores
  fdt: Add function to adjust GICv3 redistributor size
  drivers: arm: gicv3: Allow detecting number of cores

4 years agoMerge "Workaround for Cortex A77 erratum 1508412" into integration
Madhukar Pappireddy [Tue, 29 Sep 2020 18:43:00 +0000 (18:43 +0000)]
Merge "Workaround for Cortex A77 erratum 1508412" into integration

4 years agoarm_fpga: Add platform documentation
Andre Przywara [Thu, 27 Aug 2020 11:13:30 +0000 (12:13 +0100)]
arm_fpga: Add platform documentation

As the Arm Ltd. FPGA port is now working for all existing images, add
some documentation file.

Change-Id: I9e2c532ed15bbc121bb54b3dfc1bdfee8f1443a6
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
4 years agoarm_fpga: Add post-build linker script
Andre Przywara [Wed, 16 Sep 2020 16:13:33 +0000 (17:13 +0100)]
arm_fpga: Add post-build linker script

For the Arm Ltd. FPGAs to run, we need to load several payloads into the
FPGA's memory:
- Some trampoline code at address 0x0, to jump to BL31's entry point.
- The actual BL31 binary at the beginning of DRAM.
- The (generic) DTB image to describe the hardware.
- The actual non-secure payloads (kernel, ramdisks, ...)

The latter is application specific, but the first three blobs are rather
generic.
Since the uploader tool supports ELF binaries, it seems helpful to
combine these three images into one .axf file, as this also simplifies
the command line.

Add a post-build linker script, that combines those three bits into one
ELF file, together with their specific load addresses.
Include a call to "ld" with this linker script in the platform Makefile,
so it will be build automatically. The result will be called "bl31.axf".

Change-Id: I4a90da16fa1e0e83b51d19e5b1daf61f5a0bbfca
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
4 years agoarm_fpga: Add ROM trampoline
Andre Przywara [Mon, 3 Aug 2020 12:06:38 +0000 (13:06 +0100)]
arm_fpga: Add ROM trampoline

The application cores of the FPGAs used in Arm Ltd. start execution at
address 0x0. This is the location of some (emulated) ROM area (which can
be written to by the uploading tool).
Since the arm_fpga port is configured to run from DRAM, we load BL31 to
the beginning of DRAM (mapped at 2GB). This requires some small
trampoline code in the "ROM" to jump to the BL31 entry point.

To avoid some extra magic binary, add a tiny assembly file with that
trivial jump instruction to the tree, so this binary can be created
alongside BL31.

Change-Id: I9e4439fc0f093fa24dd49a8377c9edb030fbb477
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
4 years agoarm_fpga: Add devicetree file
Andre Przywara [Mon, 3 Aug 2020 11:54:58 +0000 (12:54 +0100)]
arm_fpga: Add devicetree file

The FPGA images used in Arm Ltd. focus on CPU cores, so they share a
common platform, with a minimal set of peripherals (interconnect, GIC,
UART).
This allows to support most platforms with a single devicetree file.
The topology and number of CPU cores differ, but those will added at
runtime, in BL31. Other adjustments (GICR size, SPE node, command line)
are also done at this point.

Add the common devicetree file to TF-A's build system, so it can be
build together with BL31. At runtime, the resulting .dtb file should be
uploaded to the address given with FPGA_PRELOADED_DTB_BASE at build time.

Change-Id: I3206d6131059502ec96896e95329865452c9d83e
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
4 years agoarm_fpga: Remove SPE PMU DT node if SPE is not available
Andre Przywara [Mon, 3 Aug 2020 11:55:28 +0000 (12:55 +0100)]
arm_fpga: Remove SPE PMU DT node if SPE is not available

The Statistical Profiling Extension (SPE) is an architectural feature we
can safely detect at runtime. However it still relies on one piece of
platform-specific information: the interrupt line it is connected
to. This requires SPE to be described in a devicetree node.

Since SPE support varies with the CPU cores found on an FPGA image, we
should detect the presence of SPE at runtime, and remove a potentially
existing SPE PMU node from the DT.

This allows to always have the SPE node in a generic devicetree file,
without risking exposing it on a CPU without this feature.

Change-Id: I73d83ea8509b03fe7bba20b9cce8d1335035fa31
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
4 years agoarm_fpga: Adjust GICR size in DT to match number of cores
Andre Przywara [Mon, 24 Aug 2020 17:34:50 +0000 (18:34 +0100)]
arm_fpga: Adjust GICR size in DT to match number of cores

The size of a GICv3 redistributor region depends on the number of
cores in the system. For the ARM FPGA port, we detect the topology at
runtime, and adjust the CPU DT nodes accordingly.
Now the size of the GICR region must also be adjusted, or Linux will
fail to initialise the GICv3.

Use the newly introduced function to overwrite the GICR size entry in
the GICv3 reg property. We count the number of existing cores by
iterating over the GICR frames until we find the LAST bit set in TYPER.

Change-Id: Ib69565600859de9b1b15ceb8495172cd26d16fce
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
4 years agofdt: Add function to adjust GICv3 redistributor size
Andre Przywara [Mon, 24 Aug 2020 17:28:44 +0000 (18:28 +0100)]
fdt: Add function to adjust GICv3 redistributor size

We now have code to detect the CPU topology at runtime, and can also
populate the CPU nodes in a devicetree accordingly. This is used by the
ARM FPGA port, for instance.
But also a GICv3 compatible interrupt controller provides MMIO frames
per core, so the size of this region needs to be adjusted in the DT,
to match the number of cores as well.

Provide a generic function to find the GICv3 interrupt controller in
the DT, then adjust the "reg" entry to match the number of detected
cores. Since the size of the GICR frame per cores differs between
GICv4 and GICv3, this size is supplied as a parameter to the function.
The caller should determine the applicable value by either hardcoding
it or by observing GICR_TYPER.VLPIS.

Change-Id: Ic2a6445c2c5381a36bf24263f52fcbefad378c05
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
4 years agodrivers: arm: gicv3: Allow detecting number of cores
Andre Przywara [Mon, 7 Sep 2020 13:53:58 +0000 (14:53 +0100)]
drivers: arm: gicv3: Allow detecting number of cores

A GICv3 interrupt controller will be instantiated for a certain number
of cores. This will result in the respective number of GICR frames. The
last frame will have the "Last" bit set in its GICR_TYPER register.

For platforms with a topology unknown at build time (the Arm FPGAs, for
instance), we need to learn the number of used cores at runtime, to size
the GICR region in the devicetree accordingly.

Add a generic function that iterates over all GICR frames until it
encounters one with the "Last" bit set. It returns the number of cores
the GICv3 has been configured for.

Change-Id: I79f033c50dfc1c275aba7122725868811abcc4f8
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
4 years agoMerge changes I1ecbe5a1,Ib5945c37,Ic6b79648 into integration
Manish Pandey [Tue, 29 Sep 2020 12:17:21 +0000 (12:17 +0000)]
Merge changes I1ecbe5a1,Ib5945c37,Ic6b79648 into integration

* changes:
  plat/arm: Add platform support for Morello
  fdts: add device tree sources for morello platform
  lib/cpus: add support for Morello Rainier CPUs

4 years agoMerge "arm_fpga: Add support for unknown MPIDs" into integration
André Przywara [Mon, 28 Sep 2020 18:25:03 +0000 (18:25 +0000)]
Merge "arm_fpga: Add support for unknown MPIDs" into integration

4 years agoplat/arm: Add platform support for Morello
Chandni Cherukuri [Tue, 22 Sep 2020 13:26:25 +0000 (18:56 +0530)]
plat/arm: Add platform support for Morello

This patch adds support for Morello platform.
It is an initial port which includes only BL31 support
as the System Control Processor (SCP) is expected to take
the role of primary bootloader.

Change-Id: I1ecbe5a14a2d487b2ecea3c1ca227f08473ed2dd
Co-authored-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Signed-off-by: Anurag Koul <anurag.koul@arm.com>
4 years agofdts: add device tree sources for morello platform
Manoj Kumar [Fri, 31 Jul 2020 11:32:36 +0000 (12:32 +0100)]
fdts: add device tree sources for morello platform

Change-Id: Ib5945c37983505f327a195bdb8b91ed1b7b90921
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
4 years agolib/cpus: add support for Morello Rainier CPUs
Manoj Kumar [Thu, 9 Jul 2020 08:56:02 +0000 (09:56 +0100)]
lib/cpus: add support for Morello Rainier CPUs

This patch adds CPU support for the Rainier CPU which is
derived from Neoverse N1 r4p0 CPU and implements the
Morello capability architecture.

Change-Id: Ic6b796481da5a66504ecb0648879446edf4c69fb
Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
4 years agoMeasured Boot Driver: Fix MISRA-C 2012 defects
Alexei Fedorov [Mon, 28 Sep 2020 13:47:54 +0000 (14:47 +0100)]
Measured Boot Driver: Fix MISRA-C 2012 defects

This patch fixes MISRA C-2012 Pointers and Arrays
Rule 18.4 defects reported by Coverity scan:
"misra_c_2012_rule_18_4_violation: Using arithmetic on pointer "

Change-Id: I06753b28467c473e346b9871c1657284fc43a3f3
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
4 years agoWorkaround for Cortex A77 erratum 1508412
laurenw-arm [Tue, 14 Jul 2020 19:18:34 +0000 (14:18 -0500)]
Workaround for Cortex A77 erratum 1508412

Cortex A77 erratum 1508412 is a Cat B Errata present in r0p0 and r1p0.
The workaround is a write sequence to several implementation defined
registers based on A77 revision.

This errata is explained in this SDEN:
https://static.docs.arm.com/101992/0010/Arm_Cortex_A77_MP074_Software_Developer_Errata_Notice_v10.pdf

Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: I217993cffb3ac57c313db8490e7b8a7bb393379b

4 years agoarm_fpga: Add support for unknown MPIDs
Javier Almansa Sobrino [Thu, 20 Aug 2020 17:48:09 +0000 (18:48 +0100)]
arm_fpga: Add support for unknown MPIDs

This patch allows the system to fallback to a default CPU library
in case the MPID does not match with any of the supported ones.

This feature can be enabled by setting SUPPORT_UNKNOWN_MPID build
option to 1 (enabled by default only on arm_fpga platform).

This feature can be very dangerous on a production image and
therefore it MUST be disabled for Release images.

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I0df7ef2b012d7d60a4fd5de44dea1fbbb46881ba

4 years agoMerge changes from topic "stm32_drivers_update" into integration
Manish Pandey [Fri, 25 Sep 2020 08:30:53 +0000 (08:30 +0000)]
Merge changes from topic "stm32_drivers_update" into integration

* changes:
  clk: stm32mp1: fix rcc mckprot status
  drivers: st: add missing includes in ETZPC header
  mmc: st: clear some flags before sending a command
  mmc: st: correct retries management
  nand: raw_nand: fix timeout issue in nand_wait_ready
  mtd: spi_nor: change message level on macronix detection
  gpio: stm32_gpio: check GPIO node status after checking DT
  crypto: stm32_hash: fix issue when restarting computation

4 years agoMerge changes from topic "tc0_architecture_change" into integration
Olivier Deprez [Fri, 25 Sep 2020 07:08:36 +0000 (07:08 +0000)]
Merge changes from topic "tc0_architecture_change" into integration

* changes:
  plat: tc0: enable TZC
  fdts: tc0: update MHUv2 interrupt number

4 years agoMerge "plat/arm/css/sgi: Map flash used for mem_protect" into integration
Manish Pandey [Thu, 24 Sep 2020 21:53:38 +0000 (21:53 +0000)]
Merge "plat/arm/css/sgi: Map flash used for mem_protect" into integration

4 years agoMerge "plat/arm: Introduce and use libc_asm.mk makefile" into integration
Olivier Deprez [Thu, 24 Sep 2020 14:39:24 +0000 (14:39 +0000)]
Merge "plat/arm: Introduce and use libc_asm.mk makefile" into integration

4 years agoplat/arm/css/sgi: Map flash used for mem_protect
Sami Mujawar [Thu, 30 Apr 2020 14:50:34 +0000 (15:50 +0100)]
plat/arm/css/sgi: Map flash used for mem_protect

The SGI platform defines the macro PLAT_ARM_MEM_PROT_ADDR which
indicates that the platform has mitigation for cold reboot attacks.

However, the flash memory used for the mem_protect region was not
mapped. This results in a crash when an OS calls PSCI MEM_PROTECT.

To fix this map the flash region used for mem_protect.

Change-Id: Ia494f924ecfe2ce835c045689ba8f942bf0941f4
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoMerge "Select the Log Level for the Event Log Dump on Measured Boot at build time...
Alexei Fedorov [Thu, 24 Sep 2020 10:11:21 +0000 (10:11 +0000)]
Merge "Select the Log Level for the Event Log Dump on Measured Boot at build time." into integration

4 years agoplat: tc0: enable TZC
Usama Arif [Tue, 18 Aug 2020 11:30:37 +0000 (12:30 +0100)]
plat: tc0: enable TZC

Change-Id: Ic2bb8482f0b602f6b7850d4fa553448bc4931edc
Signed-off-by: Usama Arif <usama.arif@arm.com>
4 years agoclk: stm32mp1: fix rcc mckprot status
Etienne Carriere [Wed, 5 Feb 2020 09:03:27 +0000 (10:03 +0100)]
clk: stm32mp1: fix rcc mckprot status

MCKPROT hardening in RCC mandates that both bits RCC[TZEN] and
RCC[MCKPROT] are enabled. This change fixes stm32mp1_rcc_is_mckprot()
to check both bits, not RCC[MCKPROT] only.

This change also updates stm32mp1_rcc_is_secure() for consistency.

Change-Id: If1f07babdcb5677906ddbf974d9dc17255d4e174
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agodrivers: st: add missing includes in ETZPC header
Yann Gautier [Mon, 7 Sep 2020 11:46:04 +0000 (13:46 +0200)]
drivers: st: add missing includes in ETZPC header

Depending on compiler, the issue about bool or uint*_t not defined can
appear.
Correct this by adding stdbool.h and stdint.h includes in etzpc.h.

Change-Id: If1419dc511efbe682459fa4a776481fa52a38aa3
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agommc: st: clear some flags before sending a command
Yann Gautier [Fri, 12 Jun 2020 12:14:26 +0000 (14:14 +0200)]
mmc: st: clear some flags before sending a command

The ICR static flags are cleared before sending a command.
The SDMMC_DCTRLR register is set to 0 if no data is expected on a given
command or on the next command in case of CMD55.

Change-Id: I5ae172a484218f53160e98b3684967c6960475a6
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agommc: st: correct retries management
Yann Gautier [Fri, 12 Jun 2020 10:17:17 +0000 (12:17 +0200)]
mmc: st: correct retries management

The retries number should be 3.
A warning message is added in mmc_block_read(), and the code is refactored.

Change-Id: I577c7dd91c451c7580b1660042cb5fe26ee3fa12
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agonand: raw_nand: fix timeout issue in nand_wait_ready
Lionel Debieve [Wed, 26 Aug 2020 14:17:02 +0000 (16:17 +0200)]
nand: raw_nand: fix timeout issue in nand_wait_ready

nand_wait_ready is called with a millisecond delay
but the timeout used a micro second. Fixing the conversion
in the timeout call.
The prototype of the function is also changed to use an unsigned int
parameter.

Change-Id: Ia3281be7980477dfbfdb842308d35ecd8b926fb8
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agomtd: spi_nor: change message level on macronix detection
Lionel Debieve [Mon, 27 Apr 2020 07:50:48 +0000 (09:50 +0200)]
mtd: spi_nor: change message level on macronix detection

Change the detection message from WARN to INFO when macronix
NOR is detected.

Change-Id: I488696f1fb75b823e85decfcd6cd32e7b36a6c2e
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agogpio: stm32_gpio: check GPIO node status after checking DT
Yann Gautier [Fri, 4 Sep 2020 11:25:27 +0000 (13:25 +0200)]
gpio: stm32_gpio: check GPIO node status after checking DT

The call to fdt_get_status(node) has to be done after the DT is found
to be valid.

Fixes: 1fc2130c5 stm32mp1: update device tree and gpio functions
Change-Id: I70f803aae3dde128a9e740f54c8837b64cb1a244
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agocrypto: stm32_hash: fix issue when restarting computation
Lionel Debieve [Fri, 31 Jan 2020 15:17:37 +0000 (16:17 +0100)]
crypto: stm32_hash: fix issue when restarting computation

While restarting a new hash computation, STR register
is not cleared. It needs to be written before each
computation.

Change-Id: If65902dd21f9c139ec5da3ca87721232f73710db
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agoMerge "libc: Import strtok_r from FreeBSD project" into integration
Lauren Wehrmeister [Wed, 23 Sep 2020 14:16:39 +0000 (14:16 +0000)]
Merge "libc: Import strtok_r from FreeBSD project" into integration

4 years agofdts: tc0: update MHUv2 interrupt number
Usama Arif [Tue, 18 Aug 2020 11:56:44 +0000 (12:56 +0100)]
fdts: tc0: update MHUv2 interrupt number

This is as part of the architecture change in TC0.

Change-Id: I470241f67938e7998941d26f0e8bc05073234152
Signed-off-by: Usama Arif <usama.arif@arm.com>
4 years agoSelect the Log Level for the Event Log Dump on Measured Boot at build time.
Javier Almansa Sobrino [Fri, 18 Sep 2020 15:47:07 +0000 (16:47 +0100)]
Select the Log Level for the Event Log Dump on Measured Boot at build time.

Builds in Debug mode with Measured Boot enabled might run out of trusted
SRAM. This patch allows to change the Log Level at which the Measured Boot
driver will dump the event log, so the latter can be accessed even on
Release builds if necessary, saving space on RAM.

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I133689e313776cb3f231b774c26cbca4760fa120

4 years agoMerge "plat: marvell: ap807: implement workaround for errata-id 3033912" into integration
Manish Pandey [Tue, 22 Sep 2020 10:55:51 +0000 (10:55 +0000)]
Merge "plat: marvell: ap807: implement workaround for errata-id 3033912" into integration

4 years agoMerge "SPMC: adjust the number of EC context to max number of PEs" into integration
Manish Pandey [Tue, 22 Sep 2020 09:50:31 +0000 (09:50 +0000)]
Merge "SPMC: adjust the number of EC context to max number of PEs" into integration

4 years agostm32mp1: correct crash console GPIO alternate configuration
Yann Gautier [Tue, 25 Feb 2020 16:51:52 +0000 (17:51 +0100)]
stm32mp1: correct crash console GPIO alternate configuration

If GPIO port for UART TX is less than 8, the register GPIO_AFRL should
be used to set the alternate. GPIO_AFRH is used if GPIO port is greater
or equal to 8. The macro GPIO_TX_ALT_SHIFT is removed and the GPIO port
number is tested against GPIO_ALT_LOWER_LIMIT (=8) in
plat_crash_console_init() function.

Change-Id: Ibb62223ed6bce589bbcab59a5e986b2677e6d118
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agostm32mp1: add plat_panic_handler function
Yann Gautier [Tue, 15 Sep 2020 10:29:53 +0000 (12:29 +0200)]
stm32mp1: add plat_panic_handler function

The STM32MP1 implementation of this function will call
plat_report_exception(). It displays more information about the panic
if DEBUG is enabled.
The LR register is also filled with R6 content, which hold the faulty
address. This allows debugger to reconstruct the backtrace.

Change-Id: I6710e8e2ab6658b05c5bbad2f3c545f07f355afb
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agostm32mp1: update plat_report_exception
Yann Gautier [Tue, 15 Sep 2020 10:24:46 +0000 (12:24 +0200)]
stm32mp1: update plat_report_exception

In case DEBUG is enabled, plat_report_exception will now display extra
information of the cause of the exception.

Change-Id: I72cc9d180959cbf31c13821dd051eaf4462b733e
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agoAlign AARCH32 version of debug.S with AARCH64
Yann Gautier [Thu, 17 Sep 2020 13:15:27 +0000 (15:15 +0200)]
Align AARCH32 version of debug.S with AARCH64

Re-order code (put panic and report_exception at the end of the file).
Export asm_print_* functions.
Add asm_print_line_dec macro, and asm_print_newline func.
Align comments in both AARCH32 and AARCH64 files.
Add blank lines in AARCH64 files to align with AARCH32.

Change-Id: I8e299a27c1390f71f04e260cd4a0e59b2384eb19
Signed-off-by: Yann Gautier <yann.gautier@st.com>
4 years agoMerge "n1sdp: add support for remote chip pcie." into integration
Manish Pandey [Mon, 21 Sep 2020 12:10:07 +0000 (12:10 +0000)]
Merge "n1sdp: add support for remote chip pcie." into integration

4 years agoMerge "build_macros.mk: include assert and define loop macros" into integration
Olivier Deprez [Mon, 21 Sep 2020 08:28:50 +0000 (08:28 +0000)]
Merge "build_macros.mk: include assert and define loop macros" into integration

4 years agoMerge "defaults.mk: default KEY_SIZE to 2048 in case of RSA algorithm" into integration
Olivier Deprez [Mon, 21 Sep 2020 08:28:28 +0000 (08:28 +0000)]
Merge "defaults.mk: default KEY_SIZE to 2048 in case of RSA algorithm" into integration

4 years agolibc: Import strtok_r from FreeBSD project
Madhukar Pappireddy [Wed, 16 Sep 2020 23:58:49 +0000 (18:58 -0500)]
libc: Import strtok_r from FreeBSD project

From commit: 21571b1d140ae7bb44e94c0afba2ec61456b275b
Made small changes to fit into TF-A project

Change-Id: I991f653a7ace04f9c84bcda78ad8d7114ea18e93
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
4 years agoMerge changes from topic "ehf_common" into integration
Manish Pandey [Fri, 18 Sep 2020 14:20:02 +0000 (14:20 +0000)]
Merge changes from topic "ehf_common" into integration

* changes:
  plat: tegra: Use generic ehf defines
  ehf: use common priority level enumuration

4 years agoMerge "spmd: remove assert for SPMC PC value" into integration
Mark Dykes [Thu, 17 Sep 2020 19:48:27 +0000 (19:48 +0000)]
Merge "spmd: remove assert for SPMC PC value" into integration

4 years agoMerge "doc: Recommend using C rather than assembly language" into integration
Madhukar Pappireddy [Wed, 16 Sep 2020 18:00:21 +0000 (18:00 +0000)]
Merge "doc: Recommend using C rather than assembly language" into integration

4 years agon1sdp: add support for remote chip pcie.
Sayanta Pattanayak [Fri, 31 Jul 2020 07:46:13 +0000 (13:16 +0530)]
n1sdp: add support for remote chip pcie.

Remote chip  ITS, SMMU, PCIe nodes are added for enabling remote
chip PCIe hierarchy.

Change-Id: I5b3ca733715defa38e413588ccd13d0688cba271
Signed-off-by: Sayanta Pattanayak <sayanta.pattanayak@arm.com>
Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com>
4 years agoMerge "SPE: Fix feature detection" into integration
Madhukar Pappireddy [Tue, 15 Sep 2020 21:21:24 +0000 (21:21 +0000)]
Merge "SPE: Fix feature detection" into integration

4 years agoMerge changes from topic "cot-parser" into integration
Madhukar Pappireddy [Tue, 15 Sep 2020 16:53:56 +0000 (16:53 +0000)]
Merge changes from topic "cot-parser" into integration

* changes:
  plat/arm: fvp: Increase BL2 maximum size
  lib: fconf: Implement a parser to populate CoT

4 years agoMerge "doc: Correct CPACR.FPEN usage" into integration
Mark Dykes [Tue, 15 Sep 2020 16:44:09 +0000 (16:44 +0000)]
Merge "doc: Correct CPACR.FPEN usage" into integration

4 years agoSPMC: adjust the number of EC context to max number of PEs
Olivier Deprez [Tue, 15 Sep 2020 15:23:47 +0000 (17:23 +0200)]
SPMC: adjust the number of EC context to max number of PEs

According to [1] and in context of FF-A v1.0 a secure partition must
have either one EC (migratable UP) or a number of ECs equal to the
number of PEs (pinned MP). Adjust the SPMC manifest such that the
number of ECs is equal to the number of PEs.

[1] https://trustedfirmware-a.readthedocs.io/en/latest/components/
secure-partition-manager.html#platform-topology

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ie8c7d96ae7107cb27f5b97882d8f476c18e026d4

4 years agoplat/arm: fvp: Increase BL2 maximum size
Manish V Badarkhe [Fri, 4 Sep 2020 14:01:30 +0000 (15:01 +0100)]
plat/arm: fvp: Increase BL2 maximum size

Increased BL2 maximum size when CoT descriptors are placed
in device tree.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I6466d2841e189e7f15eb4f1a8db070542893cb5b

4 years agolib: fconf: Implement a parser to populate CoT
Manish V Badarkhe [Thu, 23 Jul 2020 09:43:57 +0000 (10:43 +0100)]
lib: fconf: Implement a parser to populate CoT

Implemented a parser which populates the properties of
the CoT descriptors as per the binding document [1].
'COT_DESC_IN_DTB' build option is disabled by default and can
be enabled in future for all Arm platforms by making necessary
changes in the memory map.
Currently, this parser is tested only for FVP platform.

[1]:
https://trustedfirmware-a.readthedocs.io/en/latest/components/cot-binding.html

Change-Id: I2f911206087a1a2942aa728de151d2ac269d27cc
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
4 years agoMerge "doc: add description of "owner" field in SP layout file." into integration
Madhukar Pappireddy [Tue, 15 Sep 2020 14:33:27 +0000 (14:33 +0000)]
Merge "doc: add description of "owner" field in SP layout file." into integration

4 years agoMerge changes from topic "sami/834_fiptool_pack_issue_win_v1" into integration
Manish Pandey [Tue, 15 Sep 2020 14:05:34 +0000 (14:05 +0000)]
Merge changes from topic "sami/834_fiptool_pack_issue_win_v1" into integration

* changes:
  Update makefile to build fiptool for Windows
  Fix fiptool packaging issue on windows

4 years agodoc: add description of "owner" field in SP layout file.
Manish Pandey [Wed, 12 Aug 2020 16:06:25 +0000 (17:06 +0100)]
doc: add description of "owner" field in SP layout file.

Change-Id: Iedaa83ed546eb2476849a8d53f6e05b847a48b23
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
4 years agoMerge "fdts: corstone700: add NXP isp1763 node to device tree" into integration
Manish Pandey [Tue, 15 Sep 2020 06:32:12 +0000 (06:32 +0000)]
Merge "fdts: corstone700: add NXP isp1763 node to device tree" into integration

4 years agoMerge "rockchip: don't crash if we get an FDT we can't parse" into integration
Mark Dykes [Mon, 14 Sep 2020 21:49:38 +0000 (21:49 +0000)]
Merge "rockchip: don't crash if we get an FDT we can't parse" into integration

4 years agoSPE: Fix feature detection
Andre Przywara [Fri, 11 Sep 2020 08:18:09 +0000 (09:18 +0100)]
SPE: Fix feature detection

Currently the feature test for the SPE extension requires the feature
bits in the ID_AA64DFR0 register to read exactly 0b0001.
However the architecture guarantees that any values greater than 0
indicate the presence of a feature, which is what we are after in
our spe_supported() function.

Change the comparison to include all values greater than 0.

This fixes SPE support in non-secure world on implementations which
include the Scalable Vector Extension (SVE), for instance on Zeus cores.

Change-Id: If6cbd1b72d6abb8a303e2c0a7839d508f071cdbe
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
4 years agobuild_macros.mk: include assert and define loop macros
Leonardo Sandoval [Thu, 10 Sep 2020 17:18:27 +0000 (12:18 -0500)]
build_macros.mk: include assert and define loop macros

Loop macros make it easier for developers to include new variables to
assert or define and also help code code readability on makefiles.

Change-Id: I0d21d6e67b3eca8976c4d856ac8ccc02c8bb5ffa
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
4 years agoUpdate makefile to build fiptool for Windows
Sami Mujawar [Thu, 30 Apr 2020 11:41:57 +0000 (12:41 +0100)]
Update makefile to build fiptool for Windows

Although support for building fiptool on a Windows host was present,
the binary was not built when the top level makefile was invoked.

This patch makes the necessary changes to the to support building of
fiptool on a Windows host PC from the main makefile.

Change-Id: I0c01ba237fa3010a027a1b324201131210cf4d7c
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoFix fiptool packaging issue on windows
Sami Mujawar [Thu, 30 Apr 2020 11:40:22 +0000 (12:40 +0100)]
Fix fiptool packaging issue on windows

Windows does not have a standard getopt implementation. To address
this an equivalent implementation has been provided in win_posix.c
However, the implementation has an issue with option processing as
described below.

Long option names may be abbreviated if the abbreviation is unique
or an exact match for some defined option.
Since some options can be substring of other options e.g. "scp-fw"
option is a substring of "scp-fwu-cfg", we need to identify if an
option is abbreviated and also check for uniqueness. Otherwise if
a user passes --scp-fw as an option, the "scp-fwu-cfg" option may
get selected, resulting in an incorrectly packaged FIP.

This issue has been be fixed by:
  - First searching for an exact match.
  - If exact match was not found search for a abbreviated match.
By doing this an incorrect option selection can be avoided.

Change-Id: I22f4e7a683f3df857f5b6f0783bf9b03a64a0bcc
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agodoc: Correct CPACR.FPEN usage
Peng Fan [Fri, 21 Aug 2020 02:47:17 +0000 (10:47 +0800)]
doc: Correct CPACR.FPEN usage

To avoid trapping from EL0/1, FPEN bits need to be set 0x3, not
clearing.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Change-Id: Ic34e9aeb876872883c5f040618ed6d50f21dacd0

4 years agoMerge "libc: Import strlcat from FreeBSD project" into integration
Mark Dykes [Fri, 11 Sep 2020 18:44:19 +0000 (18:44 +0000)]
Merge "libc: Import strlcat from FreeBSD project" into integration

4 years agoMerge "libc: Add support for vsnprintf()" into integration
Mark Dykes [Fri, 11 Sep 2020 18:42:23 +0000 (18:42 +0000)]
Merge "libc: Add support for vsnprintf()" into integration

4 years agolibc: Add support for vsnprintf()
Madhukar Pappireddy [Wed, 9 Sep 2020 00:00:00 +0000 (19:00 -0500)]
libc: Add support for vsnprintf()

It uses the existing implementation of snprintf() function

Change-Id: Ie59418564c2e415222e819cf322c34e9a4d1f336
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
4 years agoMerge "Workaround for Neoverse N1 erratum 1868343" into integration
Madhukar Pappireddy [Fri, 11 Sep 2020 14:56:35 +0000 (14:56 +0000)]
Merge "Workaround for Neoverse N1 erratum 1868343" into integration

4 years agoMerge "tc0: increase SCP_BL2 size to 128 kB" into integration
Manish Pandey [Fri, 11 Sep 2020 14:01:50 +0000 (14:01 +0000)]
Merge "tc0: increase SCP_BL2 size to 128 kB" into integration

4 years agoMerge "SPM: Get rid of uint32_t array representation of UUID" into integration
Manish Pandey [Fri, 11 Sep 2020 10:47:48 +0000 (10:47 +0000)]
Merge "SPM: Get rid of uint32_t array representation of UUID" into integration

4 years agoMerge "tools: Set the tool's default binary name" into integration
Mark Dykes [Thu, 10 Sep 2020 19:00:20 +0000 (19:00 +0000)]
Merge "tools: Set the tool's default binary name" into integration

4 years agoWorkaround for Neoverse N1 erratum 1868343
johpow01 [Wed, 5 Aug 2020 17:27:12 +0000 (12:27 -0500)]
Workaround for Neoverse N1 erratum 1868343

Neoverse N1 erratum 1868343 is a Cat B erratum, present in older
revisions of the Neoverse N1 processor core.  The workaround is to
set a bit in the CPUACTLR_EL1 system register, which delays instruction
fetch after branch misprediction. This workaround will have a small
impact on performance.

SDEN can be found here:
https://documentation-service.arm.com/static/5f2c130260a93e65927bc92f

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: I37da2b3b2da697701b883bff9a1eff2772352844

4 years agodefaults.mk: default KEY_SIZE to 2048 in case of RSA algorithm
Leonardo Sandoval [Thu, 18 Jun 2020 22:32:55 +0000 (17:32 -0500)]
defaults.mk: default KEY_SIZE to 2048 in case of RSA algorithm

According to the documentation [1], KEY_SIZE defaults to 2048 when RSA
algorithm is chosen, so set this value on the make's defaults file.

[1] https://trustedfirmware-a.readthedocs.io/en/latest/getting_started/build-options.html

Change-Id: I030f98363198a752bc0dd03528f748de527d48d8
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
4 years agoMerge "plat/arm: rdn1edge: Correct mismatched parenthesis in makefile" into integration
Manish Pandey [Thu, 10 Sep 2020 14:40:16 +0000 (14:40 +0000)]
Merge "plat/arm: rdn1edge: Correct mismatched parenthesis in makefile" into integration

4 years agoMerge "Addition of standard APIs in qtiseclib interface" into integration
Madhukar Pappireddy [Thu, 10 Sep 2020 14:28:35 +0000 (14:28 +0000)]
Merge "Addition of standard APIs in qtiseclib interface" into integration

4 years agotc0: increase SCP_BL2 size to 128 kB
Usama Arif [Mon, 7 Sep 2020 17:11:22 +0000 (18:11 +0100)]
tc0: increase SCP_BL2 size to 128 kB

The size of debug binaries of SCP has increased beyond the current
limit of 80kB set in platform. Hence, increase it to 128kB.

Change-Id: I5dbcf87f8fb35672b39abdb942c0691fb339444a
Signed-off-by: Usama Arif <usama.arif@arm.com>
4 years agoplat: tegra: Use generic ehf defines
Sandeep Tripathy [Wed, 26 Aug 2020 14:24:41 +0000 (19:54 +0530)]
plat: tegra: Use generic ehf defines

Use common ehf file for generic frameworks like SDEI, RAS and
extend plat specific defines using 'PLAT_EHF_DESC'.

Signed-off-by: Sandeep Tripathy <sandeep.tripathy@broadcom.com>
Change-Id: I8a8161c6030f8d226a8bdf0301e7fe6139f019a4

4 years agoplat/arm: rdn1edge: Correct mismatched parenthesis in makefile
Anders Dellien [Thu, 10 Sep 2020 08:49:42 +0000 (09:49 +0100)]
plat/arm: rdn1edge: Correct mismatched parenthesis in makefile

This fixes build errors for rdn1edge

Change-Id: I63f7ebff68679e1e859f8786d4def4960c0f2ddf
Signed-off-by: Anders Dellien <anders.dellien@arm.com>
4 years agoSPM: Get rid of uint32_t array representation of UUID
Ruari Phipps [Mon, 10 Aug 2020 14:53:45 +0000 (15:53 +0100)]
SPM: Get rid of uint32_t array representation of UUID

UUID's in the device tree files were stored in little endian. So
to keep all entries in these files RFC 4122 compliant, store them in
big endian then convert it to little endian when they are read so they
can be used in the UUID data structure.

Signed-off-by: Ruari Phipps <ruari.phipps@arm.com>
Change-Id: I5674159b82b245104381df10a4e3291160d9b3b5

4 years agolibc: Import strlcat from FreeBSD project
Madhukar Pappireddy [Fri, 4 Sep 2020 19:04:23 +0000 (14:04 -0500)]
libc: Import strlcat from FreeBSD project

From commit: 21571b1d140ae7bb44e94c0afba2ec61456b275b
Made small changes to fit into TF-A project

Change-Id: I07fd7fe1037857f6b299c35367c104fb51fa5cfa
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
4 years agoMerge "libc: memset: improve performance by avoiding single byte writes" into integration
Mark Dykes [Wed, 9 Sep 2020 18:36:08 +0000 (18:36 +0000)]
Merge "libc: memset: improve performance by avoiding single byte writes" into integration

4 years agoMerge "mediatek: Add jedec info" into integration
Madhukar Pappireddy [Wed, 9 Sep 2020 17:03:28 +0000 (17:03 +0000)]
Merge "mediatek: Add jedec info" into integration

4 years agoMerge "plat/arm: Add dependencies to configuration files" into integration
Manish Pandey [Wed, 9 Sep 2020 09:52:33 +0000 (09:52 +0000)]
Merge "plat/arm: Add dependencies to configuration files" into integration

4 years agoMerge "plat: Fix build issue for qemu and rpi3 platforms" into integration
Olivier Deprez [Wed, 9 Sep 2020 09:44:13 +0000 (09:44 +0000)]
Merge "plat: Fix build issue for qemu and rpi3 platforms" into integration

4 years agoMerge "Fix: fixing coverity issue for SPM Core." into integration
Olivier Deprez [Wed, 9 Sep 2020 09:04:37 +0000 (09:04 +0000)]
Merge "Fix: fixing coverity issue for SPM Core." into integration

4 years agoAddition of standard APIs in qtiseclib interface
Saurabh Gorecha [Mon, 7 Sep 2020 09:22:20 +0000 (14:52 +0530)]
Addition of standard APIs in qtiseclib interface

Follwing APIs wrappers are exposed to qtiseclib
* strcmp
* memset
* memmove

Change-Id: I79d50f358239cfda607d5f1a53314aa3b8f430cb
Signed-off-by: Saurabh Gorecha <sgorecha@codeaurora.org>
4 years agoMerge "Enabling DPU in dts file for TC0" into integration
Madhukar Pappireddy [Tue, 8 Sep 2020 14:22:45 +0000 (14:22 +0000)]
Merge "Enabling DPU in dts file for TC0" into integration

4 years agoEnabling DPU in dts file for TC0
Avinash Mehta [Wed, 22 Jul 2020 15:40:07 +0000 (16:40 +0100)]
Enabling DPU in dts file for TC0

This change replaces hdlcd with DPU in dts file for TC0

Change-Id: If25dfd3ddffc07279ab487f65e1bb82b27a26604
Signed-off-by: Avinash Mehta <avinash.mehta@arm.com>
4 years agoMerge "doc: Improve contribution guidelines" into integration
joanna.farley [Mon, 7 Sep 2020 16:49:21 +0000 (16:49 +0000)]
Merge "doc: Improve contribution guidelines" into integration

4 years agoFix: fixing coverity issue for SPM Core.
Max Shvetsov [Tue, 25 Aug 2020 10:50:18 +0000 (11:50 +0100)]
Fix: fixing coverity issue for SPM Core.

spmd_get_context_by_mpidr was using potentially negative value as an
array index. plat_core_pos_by_mpidr could return -1 on failure which is
utilized by some platforms.

Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com>
Change-Id: I7f8827e77f18da389c9cafdc1fc841aba9f03120

4 years agofdts: corstone700: add NXP isp1763 node to device tree
Rui Miguel Silva [Wed, 15 Jul 2020 09:08:55 +0000 (10:08 +0100)]
fdts: corstone700: add NXP isp1763 node to device tree

Add USB IP node as the MPS3 board has the NXP isp1763 host controller.

Change-Id: I47c57e4c8345d244c46895b52fcaecc1c6f1b504
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: lakshmi Kailasanathan <lakshmi.Kailasanathan@arm.com>
4 years agoplat: Fix build issue for qemu and rpi3 platforms
Manish V Badarkhe [Thu, 3 Sep 2020 15:54:47 +0000 (16:54 +0100)]
plat: Fix build issue for qemu and rpi3 platforms

Coverity build periodically throws below errors(non-consistently)
for 'QEMU' and 'RPI3' platforms.

/bin/sh: 1: cannot create build/qemu/debug/rot_key.pem: Directory
nonexistent
plat/qemu/qemu/platform.mk:86: recipe for target 'build/qemu/debug/
rot_key.pem' failed
make: *** [build/qemu/debug/rot_key.pem] Error 2

/bin/sh: 1: cannot create /work/workspace/workspace/tf-coverity/build
/rpi3/debug/rot_key.pem: Directory nonexistent
plat/rpi/rpi3/platform.mk:214: recipe for target '/work/workspace/
workspace/tf-coverity/build/rpi3/debug/rot_key.pem' failed
make: *** [/work/workspace/workspace/tf-coverity/build/rpi3/debug/
rot_key.pem] Error 2

Issue seems to be occurred when 'ROT key' is generated before creating
the platform build folder(for e.g.build/qemu/debug).

Changes are made to fix this issue by adding orderly dependancy of
the platform folder for the 'ROT key' creation which ensures that
platform folder is created before generating 'ROT key'.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I20c82172dde84e4c7f2373c0bd095d353f845d38

4 years agotools: Set the tool's default binary name
Manish V Badarkhe [Sat, 5 Sep 2020 03:40:41 +0000 (04:40 +0100)]
tools: Set the tool's default binary name

This patch: fafd3ec9c assumes that tools must build from
the main makefile folder.
This assumption leads to the error when somebody wants to
build a tool from the tool's folder.
Hence changes are done to provide the default binary name
in the tool's makefile.

Change-Id: Iae570a7f8d322151376b6feb19e739300eecc3fc
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>