Commit Graph

3557 Commits

Author SHA1 Message Date
Olivier Deprez 994421a6de Merge changes from topics "af/fvp_gicv4", "af/gicv4", "af/gic_extended" into integration
* changes:
  FVP: Add support for GICv4 extension
  TF-A: Add GICv4 extension for GIC driver
  TF-A GICv3 driver: Add extended PPI and SPI range
2020-04-07 12:52:46 +00:00
Alexei Fedorov e6e10ecc42 FVP: Add support for GICv4 extension
This patch adds support for GICv4 extension for FVP platform.

Change-Id: Ia389b61266af669b1ca9b999a8b76476cab214f4
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
2020-04-07 11:48:00 +01:00
Manish V Badarkhe 9dfe46c21b Increase maximum size of BL2 image
Increased the maximum size of BL2 image in order to
accommodate the BL2 image when TF-A build with no compiler
optimization for ARM platform.

Note: As of now, "no compiler optimization" build works
only when TRUSTED_BOOT_BOARD option is set to 0.

This change is verified using below CI configuration:
1. juno-no-optimize-default:juno-linux.uboot
2. fvp-no-optimize-default,fvp-default:fvp-tftf-fip.tftf-aemv8a-debug

Change-Id: I5932621237f8acd1b510682388f3ba78eae90ea4
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2020-04-07 09:33:13 +02:00
Max Shvetsov a39493cb02 stingray: Fix board configuration typo.
Default board configuration was set to bcm958742k which is not present
in current codebase. This causes a default platform build to fail.
Changing to bcm958742t.

Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com>
Change-Id: Ie24f94ef0ef316ff56fe142df5de45d70ba93c28
2020-04-06 11:32:38 +01:00
Alexei Fedorov 6e2b866ac7 Merge "arm_fpga: adapt to new way of including gicv3 files" into integration 2020-04-03 19:04:45 +00:00
Manish Pandey 3e58803646 arm_fpga: adapt to new way of including gicv3 files
with commit a6ea06f5, the way platform includes gicv3 files has been
modified, this patch adapts to new method of including gicv3 files
for arm_fpga platform.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ic5ccae842b39b7db06d4f23c5738b174c42edf63
2020-04-03 20:02:56 +01:00
Manish Pandey 926cd70a0c Merge changes from topic "brcm_initial_support" into integration
* changes:
  doc: brcm: Add documentation file for brcm stingray platform
  drivers: Add SPI Nor flash support
  drivers: Add iproc spi driver
  drivers: Add emmc driver for Broadcom platforms
  Add BL31 support for Broadcom stingray platform
  Add BL2 support for Broadcom stingray platform
  Add bl31 support common across Broadcom platforms
  Add bl2 setup code common across Broadcom platforms
  drivers: Add support to retrieve plat_toc_flags
2020-04-03 13:53:48 +00:00
Sheetal Tigadoli 49dec7f7f2 drivers: Add SPI Nor flash support
Add SPI Nor flash support

Change-Id: I0cde3fdb4dcad5bcaf445b3bb48e279332bd28af
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
2020-04-03 17:12:42 +05:30
Sheetal Tigadoli e3ee7b7dc8 drivers: Add iproc spi driver
Add iproc spi driver

Change-Id: I652efab1efd9c487974dae9cb9d98b9b8e3759c4
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
2020-04-03 17:12:42 +05:30
Sheetal Tigadoli bffde63de7 drivers: Add emmc driver for Broadcom platforms
Add emmc driver for Broadcom platforms

Change-Id: I126a6dfccd41062cb0b856f2c2fb1f724730b95e
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
2020-04-03 17:12:42 +05:30
Sheetal Tigadoli 3942d3a8ea Add BL31 support for Broadcom stingray platform
Change-Id: Icfef5b6923dc292e637001045a334c499d346fe9
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
2020-04-03 17:12:42 +05:30
Sheetal Tigadoli f29d1e0c72 Add BL2 support for Broadcom stingray platform
Change-Id: I5daa3f2b4b9d85cb857547a588571a9aa8ad05c2
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
2020-04-03 17:12:42 +05:30
Sheetal Tigadoli 9a40c0fba6 Add bl31 support common across Broadcom platforms
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
Change-Id: Ic1a392a633b447935fa3a7528326c97845f5b1bc
2020-04-03 17:12:38 +05:30
Sandrine Bailleux 33f1dd9c19 Merge "uniphier: define PLAT_XLAT_TABLES_DYNAMIC only for BL2" into integration 2020-04-03 11:39:41 +00:00
Olivier Deprez 8a53445ebc Merge changes from topic "sb/fconf" into integration
* changes:
  Check for out-of-bound accesses in the platform io policies
  Check for out-of-bound accesses in the CoT description
2020-04-03 11:36:30 +00:00
Sheetal Tigadoli 717448d622 Add bl2 setup code common across Broadcom platforms
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
Change-Id: Iabeaee35c22608c93945c8295bf70947b0f6049a
2020-04-03 10:53:15 +05:30
Mark Dykes cb2e35b58a Merge changes from topic "macro-cleanup" into integration
* changes:
  plat: remove redundant =1 from -D option
  Pass more -D options to BL*_CPPFLAGS instead of BL*_CFLAGS
2020-04-02 21:54:17 +00:00
Olivier Deprez 57477bc766 Merge "Fix coverity defects found on the FPGA port." into integration 2020-04-02 14:38:01 +00:00
Sandrine Bailleux afe62624c3 Check for out-of-bound accesses in the platform io policies
The platform io policies array is now always accessed through a fconf getter.
This gives us an ideal spot to check for out-of-bound accesses.

Remove the assertion in plat_get_image_source(), which is now redundant.

Change-Id: Iefe808d530229073b68cbd164d927b8b6662a217
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2020-04-02 15:57:55 +02:00
Javier Almansa Sobrino 535c824e38 Fix coverity defects found on the FPGA port.
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I397b642eff8a09b201f497f8d2ba39e2460c0dba
2020-04-02 14:11:12 +01:00
Sandrine Bailleux ea7fc9d116 Merge changes from topic "xlat" into integration
* changes:
  xlat_tables_v2: fix assembler warning of PLAT_RO_XLAT_TABLES
  linker_script: move bss section to bl_common.ld.h
  linker_script: replace common read-only data with RODATA_COMMON
  linker_script: move more common code to bl_common.ld.h
2020-04-02 11:41:33 +00:00
Masahiro Yamada 46e2c853d6 uniphier: define PLAT_XLAT_TABLES_DYNAMIC only for BL2
This is not used in BL31 or Bl32 for this platform.

Pass it to BL2_CPPFLAGS instead of defining it for all BL images.

This will produce slightly smaller BL31 and Bl32.

Change-Id: I66ec5179f8dc5b112e65547335e7dd0a0f4074cd
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-04-02 15:16:31 +09:00
Masahiro Yamada 1dc1756946 plat: remove redundant =1 from -D option
As GCC manual says, -D option defines a macro as 1, if =<value> is omitted.

  -D <name>
      Predefine <name> as a macro, with definition 1.

The same applied with Clang, too.

In the context of -D option, =1 is always redundant.

Change-Id: I487489a1ea3eb51e734741619c1e65dab1420bc4
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-04-02 14:14:10 +09:00
Masahiro Yamada 9cefb4b194 Pass more -D options to BL*_CPPFLAGS instead of BL*_CFLAGS
Commit d5e97a1d2c ("Build: define IMAGE_AT_EL1 or IMAGE_AT_EL3
globally for C files") does not have commit 848a7e8ce1 ("Build:
introduce per-BL CPPFLAGS and ASFLAGS") as an ancestor because
they were pulled almost at the same time.

This is a follow-up conversion to be consistent with commit
11a3c5ee73 ("plat: pass -D option to BL*_CPPFLAGS instead of
BL*_CFLAGS").

With this change, the command line option, IMAGE_AT_EL3, will be
passed to .S files as well.

I remove the definition in include/lib/cpus/aarch64/cpu_macros.S

Otherwise, the following error would happen.

  include/lib/cpus/aarch64/cpu_macros.S:29:0: error: "IMAGE_AT_EL3" redefined [-Werror]

Change-Id: I943c8f22356483c2ae3c57b515c69243a8fa6889
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-04-02 14:13:05 +09:00
Masahiro Yamada a7739bc7b1 linker_script: move bss section to bl_common.ld.h
Move the bss section to the common header. This adds BAKERY_LOCK_NORMAL
and PMF_TIMESTAMP, which previously existed only in BL31. This is not
a big deal because unused data should not be compiled in the first
place. I believe this should be controlled by BL*_SOURCES in Makefiles,
not by linker scripts.

I investigated BL1, BL2, BL2U, BL31 for plat=fvp, and BL2-AT-EL3,
BL31, BL31 for plat=uniphier. I did not see any more  unexpected
code addition.

The bss section has bigger alignment. I added BSS_ALIGN for this.

Currently, SORT_BY_ALIGNMENT() is missing in sp_min.ld.S, and with this
change, the BSS symbols in SP_MIN will be sorted by the alignment.
This is not a big deal (or, even better in terms of the image size).

Change-Id: I680ee61f84067a559bac0757f9d03e73119beb33
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-04-02 13:38:24 +09:00
Masahiro Yamada 0a0a7a9ac8 linker_script: replace common read-only data with RODATA_COMMON
The common section data are repeated in many linker scripts (often
twice in each script to support SEPARATE_CODE_AND_RODATA). When you
add a new read-only data section, you end up with touching lots of
places.

After this commit, you will only need to touch bl_common.ld.h when
you add a new section to RODATA_COMMON.

Replace a series of RO section with RODATA_COMMON, which contains
6 sections, some of which did not exist before.

This is not a big deal because unneeded data should not be compiled
in the first place. I believe this should be controlled by BL*_SOURCES
in Makefiles, not by linker scripts.

When I was working on this commit, the BL1 image size increased
due to the fconf_populator. Commit c452ba159c ("fconf: exclude
fconf_dyn_cfg_getter.c from BL1_SOURCES") fixed this issue.

I investigated BL1, BL2, BL2U, BL31 for plat=fvp, and BL2-AT-EL3,
BL31, BL31 for plat=uniphier. I did not see any more  unexpected
code addition.

Change-Id: I5d14d60dbe3c821765bce3ae538968ef266f1460
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-04-02 13:30:17 +09:00
Masahiro Yamada 9fb288a03e linker_script: move more common code to bl_common.ld.h
These are mostly used to collect data from special structure,
and repeated in many linker scripts.

To differentiate the alignment size between aarch32/aarch64, I added
a new macro STRUCT_ALIGN.

While I moved the PMF_SVC_DESCS, I dropped #if ENABLE_PMF conditional.
As you can see in include/lib/pmf/pmf_helpers.h, PMF_REGISTER_SERVICE*
are no-op when ENABLE_PMF=0. So, pmf_svc_descs and pmf_timestamp_array
data are not populated.

Change-Id: I3f4ab7fa18f76339f1789103407ba76bda7e56d0
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-04-02 12:33:18 +09:00
Varun Wadekar adb20a1755 Tegra: enable EHF for watchdog timer interrupts
This patch enables the Exception Handling Framework to service the WDT
interrupts on all Tegra platforms.

Verified that the watchdog timer interrupt fires after migrating to
the EHF.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: I6b2e33da7841aa064e3a8f825c26fadf168cd0d5
2020-04-01 14:53:24 -07:00
Manish Pandey 7c49d39828 Merge changes from topic "rpi_cpu_off" into integration
* changes:
  rpi: Implement PSCI CPU_OFF
  rpi: rpi3_pwr_domain_on(): Use MMIO accessor
  rpi: move plat_helpers.S to common
2020-04-01 16:42:07 +00:00
Andrei Warkentin 2e5f84432d rpi: Implement PSCI CPU_OFF
We simulate the PSCI CPU_OFF operation by reseting the core via RMR.
For secondaries, that already puts them in the holding pen waiting for a
"warm boot" request as part of PSCI CPU_ON. For the BSP, we have to add
logic to distinguish a regular boot from a CPU_OFF state, where, like the
secondaries, the BSP needs to wait foor a "warm boot" request as part
of CPU_ON.

Testing done:

- ACS suite now passes more tests (since it repeatedly
calls code on secondaries via CPU_ON).

- Linux testing including offlining/onlineing CPU0, e.g.
"echo 0 > /sys/devices/system/cpu/cpu0/online".

Change-Id: Id0ae11a0ee0721b20fa2578b54dadc72dcbd69e0
Link: https://developer.trustedfirmware.org/T686
Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
[Andre: adapt to unified plat_helpers.S, smaller fixes]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-04-01 15:58:57 +01:00
Andre Przywara af2a4877a7 rpi: rpi3_pwr_domain_on(): Use MMIO accessor
When writing to arbitrary locations in memory using a constructed
pointer, there is no guarantee that the compiler does not optimise away
the access, since it cannot detect any dependency.

One typical solution is to use the "volatile" keyword, but using MMIO
accessors in usually the better answer, to avoid torn writes.

Replace the usage of an array with such an MMIO accessor function in
rpi3_pwr_domain_on(), to make sure the write is really happening.

Change-Id: Ia18163c95e92f1557471089fd18abc6dc7fee0c7
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-04-01 15:56:26 +01:00
Andre Przywara 07aa0c7e0e rpi: move plat_helpers.S to common
The plat_helpers.S file was almost identical between its RPi3 and RPi4
versions. Unify the two files, moving it into the common/ directory.

This adds a plat_rpi_get_model() function, which can be used to trigger
RPi4 specific action, detected at runtime. We use that to do the RPi4
specific L2 cache initialisation.

Change-Id: I2295704fd6dde7c76fe83b6d98c7bf998d4bf074
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-04-01 15:56:26 +01:00
Masahiro Yamada 664e15c2bd uniphier: support read-only xlat tables
BL2 for this platform uses mmap_add_dynamic_region(), but BL31 and
BL32 (TSP) only use static mapping. So, BL31 and BL32 can make the
tables read-only after enabling MMU.

Enable ALLOW_RO_XLAT_TABLES by default.

Change-Id: Ib59c44697163629119888bb6abd47fa144f09ba3
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-04-01 16:40:16 +02:00
Masahiro Yamada 2765ffdc99 uniphier: use enable_mmu() in common function
Currently, enable_mmu_el1() or enable_mmu_el3() is kept outside the
common function because the appropriate one must be chosen.

Use enable_mmu() and move it to the common function.

Change-Id: If2fb651691a7b6be05674f5cf730ae067ba95d4b
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-04-01 16:40:16 +02:00
Mark Dykes 0edfd3772a Merge "plat: imx: imx8qx: provide debug uart num as build param" into integration 2020-03-31 21:27:39 +00:00
Mark Dykes 4ed750a4cb Merge "plat: pass -D option to BL*_CPPFLAGS instead of BL*_CFLAGS" into integration 2020-03-31 18:49:48 +00:00
Olivier Deprez 8eceb1c9c4 Merge "Create separate header for ARM specific SMCCC defines" into integration 2020-03-31 14:16:40 +00:00
Manish Pandey 27c5e15ee4 Merge "TF-A GICv3 driver: Introduce makefile" into integration 2020-03-31 11:22:38 +00:00
Sandrine Bailleux 93b2434f67 Merge "Tegra: fixup GIC init from the 'on_finish' handler" into integration 2020-03-31 07:42:46 +00:00
Sandrine Bailleux 3be86517ed Merge "Tegra186: increase memory mapped regions" into integration 2020-03-31 07:38:26 +00:00
Masahiro Yamada 11a3c5ee73 plat: pass -D option to BL*_CPPFLAGS instead of BL*_CFLAGS
-D is a preprocessor flag that defines a macro. So, adding it to
BL*_CPPFLAGS makes more sense. You can reference it not only from
.c files but also from .S files.

Change-Id: Ib4f2f27a3ed3eae476a6a32da7ab5225ad0649de
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-03-31 16:08:21 +09:00
Manish Pandey 0a81158f0d Merge "plat/sgm775: Add support for dynamic config using fconf" into integration 2020-03-30 21:41:50 +00:00
Madhukar Pappireddy ebe1f2cfd7 plat/sgm775: Add support for dynamic config using fconf
1. Necessary changes to platform makefile to include fw_config
device tree and package it in fip.bin

2. Removed hw_config node from fw_config dts as there is no
HW_CONFIG device tree source for sgm775

3. Added mbedtls_heap related properties for TBBR functionality

Change-Id: I26b940c65b17ad2fb5537141f8649785bb0fd4ad
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2020-03-30 16:14:55 -05:00
Olivier Deprez e97841eba4 Merge "Flush dcache when storing timestamp" into integration 2020-03-30 15:29:00 +00:00
Olivier Deprez de8f9cd4cd Merge changes from topic "ddr_map" into integration
* changes:
  stm32mp1: use stm32mp_get_ddr_ns_size() function
  stm32mp1: set XN attribute for some areas in BL2
  stm32mp1: dynamically map DDR later and non-cacheable during its test
  stm32mp1: add a function to get non-secure DDR size
2020-03-30 15:27:32 +00:00
Manish V Badarkhe 53adebad8b Create separate header for ARM specific SMCCC defines
Moved SMCCC defines from plat_arm.h to new <smccc_def.h> header
and include this header in all ARM platforms.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I4cbc69c7b9307461de87b7c7bf200dd9b810e485
2020-03-30 12:21:38 +00:00
Alexei Fedorov a6ea06f563 TF-A GICv3 driver: Introduce makefile
This patch moves all GICv3 driver files into new added
'gicv3.mk' makefile for the benefit of the generic driver
which can evolve in the future without affecting platforms.
The patch adds GICv3 driver configuration flags
'GICV3_IMPL', 'GICV3_IMPL_GIC600_MULTICHIP' and
'GICV3_OVERRIDE_DISTIF_PWR_OPS' described in
'GICv3 driver options' section of 'build-option.rst'
document.

NOTE: Platforms with GICv3 driver need to be modified to
include 'drivers/arm/gic/v3/gicv3.mk' in their makefiles.

Change-Id: If055f6770ff20f5dee5a3c99ae7ced7cdcac5c44
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
2020-03-30 10:54:01 +00:00
Aditya Angadi 5c215de249 plat/arm/sgi: fix the incorrect check for SCMI channel ID
Use ARRAY_SIZE macro instead of sizeof operator to obtain the maximum
number of SCMI channels supported on the platform.

Change-Id: Id922bb548af98ac99b4ac0c34e38e589e5a80b2d
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
2020-03-27 21:24:27 +00:00
Manish Pandey 527ac2e7e5 Merge changes from topic "os/bl31-fpga-port" into integration
* changes:
  plat/arm/board/arm_fpga: Compile with additional CPU libraries
  plat/arm/board/arm_fpga: Enable position-independent execution
  plat/arm/board/arm_fpga: Enable port for alternative cluster configurations
  plat/arm/board/arm_fpga: Initialize the Generic Interrupt Controller
  plat/arm/board/arm_fpga: Initialize the System Counter
  plat/arm/board/arm_fpga: Add PSCI implementation for FPGA images
  plat/arm/board/arm_fpga: Use preloaded BL33 alternative boot flow
  plat/arm/board/arm_fpga: Enable basic BL31 port for an FPGA image
2020-03-27 17:54:21 +00:00
Zelalem f27b6924d6 Flush dcache when storing timestamp
On DynamIQ CPU FVPs, stats test cases are failing when
hardware-assisted coherency is enabled due to a corrupt
timestamp value. Investigation of the issue indicates that
on these models the timestamp value is stored in cache
instead of memory. This patch flushes the dcache when the
timestamp is stored to make sure it is stored in memory.

Change-Id: I05cd54ba5991a5a96dd07f1e08b5212273201411
Signed-off-by: Zelalem <zelalem.aweke@arm.com>
2020-03-27 09:41:12 -05:00