Commit Graph

6763 Commits

Author SHA1 Message Date
Varun Wadekar d4b29105f4 include: move MHZ_TICKS_PER_SEC to utils_def.h
This patch moves the MHZ_TICKS_PER_SEC macro to utils_def.h
for other platforms to use.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: I6c4dc733f548d73cfdb3515ec9ad89a9efaf4407
2020-02-20 09:25:45 -08:00
Pritesh Raithatha 56e7d6a716 Tegra194: memctrl: lock mc stream id security config
This patch locks most of the stream id security config registers as
per HW guidance.

This patch keeps the stream id configs unlocked for the following
clients, to allow some platforms to still function, until they make
the transition to the latest guidance.

- ISPRA
- ISPFALR
- ISPFALW
- ISPWA
- ISPWA1
- ISPWB
- XUSB_DEVR
- XUSB_DEVW
- XUSB_HOSTR
- XUSB_HOSTW
- VIW
- VIFALR
- VIFALW

Change-Id: I66192b228a0a237035938f498babc0325764d5df
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
2020-02-20 09:25:45 -08:00
kalyani chidambaram 3414bad8f9 Tegra210: resume PMC hardware block for all platforms
The PMC hardware block resume handler was called for Tegra210
platforms, only if the sc7entry-fw was present on the device.
This would cause problems for devices that do not support this
firmware.

This patch fixes this logic and resumes the PMC block even if
the sc7entry-fw is not present on the device.

Change-Id: I6f0eb7878126f624ea98392f583ed45a231d27db
Signed-off-by: Kalyani Chidambaram <kalyanic@nvidia.com>
2020-02-20 09:25:45 -08:00
Varun Wadekar b20a8b92f9 Tegra: macro for legacy WDT FIQ handling
This patch adds the macro to enable legacy FIQ handling to the common
Tegra makefile. The default value of this macro is '0'. Platforms that
need this support should enable it from their makefiles.

This patch also helps fix violation of Rule 20.9.

Rule 20.9 "All identifiers used in the controlling expression of #if
           of #elif preprocessing directives shall be #define'd before
           evaluation"

Change-Id: I4f0c9917c044b5b1967fb5e79542cd3bf6e91f18
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-02-20 09:25:45 -08:00
Varun Wadekar 103ea3f44c Tegra186: enable higher performance non-cacheable load forwarding
This patch enables higher performance non-cacheable load forwarding for
Tegra186 platforms.

Change-Id: Ifceb304bfbd805f415bb6205c9679602ecb47b53
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-02-20 09:25:45 -08:00
Varun Wadekar 8baa16f820 Tegra210: enable higher performance non-cacheable load forwarding
This patch enables higher performance non-cacheable load forwarding for
Tegra210 platforms.

Change-Id: I11d0ffc09aca97d37386f283f2fbd2483d51fd28
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-02-20 09:25:45 -08:00
Varun Wadekar cd0ea1842f cpus: higher performance non-cacheable load forwarding
The CPUACTLR_EL1 register on Cortex-A57 CPUs supports a bit to enable
non-cacheable streaming enhancement. Platforms can set this bit only
if their memory system meets the requirement that cache line fill
requests from the Cortex-A57 processor are atomic.

This patch adds support to enable higher performance non-cacheable load
forwarding for such platforms. Platforms must enable this support by
setting the 'A57_ENABLE_NONCACHEABLE_LOAD_FWD' flag from their
makefiles. This flag is disabled by default.

Change-Id: Ib27e55dd68d11a50962c0bbc5b89072208b4bac5
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-02-20 09:25:45 -08:00
Sandrine Bailleux eda880ff8e Merge "intel: Fix Coverity Scan Defects" into integration 2020-02-20 09:53:26 +00:00
Abdul Halim, Muhammad Hadi Asyrafi a62b47b87a intel: Fix Coverity Scan Defects
Fix mailbox driver incompatible cast bug and control flow issue that
was flagged by Coverity Scan.

Signed-off-by: Abdul Halim, Muhammad Hadi Asyrafi <muhammad.hadi.asyrafi.abdul.halim@intel.com>
Change-Id: I3f34e98d24e40139d31cf7d5b9b973cd2d981065
2020-02-20 13:56:35 +08:00
Manish Pandey 6019642947 Merge "Update docs with PMU security information" into integration 2020-02-19 17:30:37 +00:00
Sandrine Bailleux 522338b931 Merge changes I72846d86,I70c3d873,If675796a,I0dbf8091,Ie4f3ac83, ... into integration
* changes:
  rcar_gen3: plat: Minor coding style fix for rcar_version.h
  rcar_gen3: plat: Update IPL and Secure Monitor Rev.2.0.6
  rcar_gen3: drivers: ddr: Update DDR setting for H3, M3, M3N
  rcar_gen3: drivers: ddr: Update DDR setting for H3, M3, M3N
  rcar_gen3: drivers: board: Add new board revision for M3ULCB
  rcar_gen3: drivers: ddr: Update DDR setting for H3, M3, M3N
  rcar_gen3: plat: Update IPL and Secure Monitor Rev.2.0.5
  rcar_gen3: plat: Change fixed destination address of BL31 and BL32
2020-02-19 15:29:23 +00:00
Sandrine Bailleux 6cec570246 Merge "TBBR: Reduce size of hash buffers when possible" into integration 2020-02-19 15:17:56 +00:00
Sandrine Bailleux 564074c284 Merge "TBBR: Reduce size of ECDSA key buffers" into integration 2020-02-19 15:17:48 +00:00
Manish Pandey b296bb10aa Merge "corstone700: fdts: using DDR memory and XIP rootfs" into integration 2020-02-19 11:25:52 +00:00
Manish Pandey 9c87e59e8e Merge changes I5ca7a004,Ibcb336a2 into integration
* changes:
  board/rdn1edge: use CREATE_SEQ helper macro to compare chip count
  build_macros: add create sequence helper function
2020-02-18 21:54:25 +00:00
Vijayenthiran Subramaniam 9b229b4495 board/rdn1edge: use CREATE_SEQ helper macro to compare chip count
Use CREATE_SEQ helper macro to create sequence of valid chip counts
instead of manually creating the sequence. This allows a scalable
approach to increase the valid chip count sequence in the future.

Change-Id: I5ca7a00460325c156b9e9e52b2bf656a2e43f82d
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
2020-02-18 21:53:45 +00:00
Vijayenthiran Subramaniam 8c7b944adb build_macros: add create sequence helper function
Add `CREATE_SEQ` function to generate sequence of numbers starting from
1 to allow easy comparison of a user defined macro with non-zero
positive numbers.

Change-Id: Ibcb336a223d958154b1007d08c428fbaf1e48664
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
2020-02-18 21:53:36 +00:00
Rui Silva d983b7a167 corstone700: fdts: using DDR memory and XIP rootfs
This patch allows to use DDR address in memory node because on FPGA we
typically use DDR instead of shared RAM.

This patch also modifies the kernel arguments to allow the rootfs to be
mounted from a direct mapping of the QSPI NOR flash using the physmap
driver in the kernel. This allows to support CRAMFS XIP.

Change-Id: I4e2bc6a1f48449c7f60e00f5f1a698df8cb2ba89
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
2020-02-18 21:48:43 +00:00
Manish Pandey 8a10c6c274 Merge changes from topic "corstone700" into integration
* changes:
  corstone700: set UART clocks to 32MHz
  corstone700: clean-up as per coding style guide
  Corstone700: add support for mhuv2 in arm TF-A
2020-02-18 21:47:38 +00:00
Mark Dykes 76ce1028b0 Merge "coverity: fix MISRA violations" into integration 2020-02-18 19:19:00 +00:00
Mark Dykes d3b1bfc10f Merge "FVP: Fix BL31 load address and image size for RESET_TO_BL31=1" into integration 2020-02-18 17:02:50 +00:00
Zelalem 2fe75a2de0 coverity: fix MISRA violations
Fixes for the following MISRA violations:
- Missing explicit parentheses on sub-expression
- An identifier or macro name beginning with an
  underscore, shall not be declared
- Type mismatch in BL1 SMC handlers and tspd_main.c

Change-Id: I7a92abf260da95acb0846b27c2997b59b059efc4
Signed-off-by: Zelalem <zelalem.aweke@arm.com>
2020-02-18 10:47:46 -06:00
Mark Dykes 98ab180565 Merge changes I4e95678f,Ia7c28704,I1bb04bb4,I93d96dca,I50aef5dd into integration
* changes:
  Fix boot failures on some builds linked with ld.lld.
  trusty: generic-arm64-smcall: Support gicr address
  trusty: Allow gic base to be specified with GICD_BASE
  trusty: Allow getting trusty memsize from BL32_MEM_SIZE instead of TSP_SEC_MEM_SIZE
  Fix clang build if CC is not in the path.
2020-02-18 16:24:33 +00:00
Alexei Fedorov 6227cca9e8 FVP: Fix BL31 load address and image size for RESET_TO_BL31=1
When TF-A is built with RESET_TO_BL31=1 option, BL31 is the
first image to be run and should have all the memory allocated
to it except for the memory reserved for Shared RAM at the start
of Trusted SRAM.
This patch fixes FVP BL31 load address and its image size for
RESET_TO_BL31=1 option. BL31 startup address should be set to
0x400_1000 and its maximum image size to the size of Trusted SRAM
minus the first 4KB of shared memory.
Loading BL31 at 0x0402_0000 as it is currently stated in
'\docs\plat\arm\fvp\index.rst' causes EL3 exception when the
image size gets increased (i.e. building with LOG_LEVEL=50)
but doesn't exceed 0x3B000 not causing build error.

Change-Id: Ie450baaf247f1577112f8d143b24e76c39d33e91
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
2020-02-18 10:16:51 +00:00
Sandrine Bailleux 0b4e59211b TBBR: Reduce size of hash buffers when possible
The TBBR implementation extracts hashes from certificates and stores
them in static buffers. TF-A supports 3 variants of SHA right now:
SHA-256, SHA-384 and SHA-512. When support for SHA-512 was added in
commit 9a3088a5f5 ("tbbr: Add build flag
HASH_ALG to let the user to select the SHA"), the hash buffers got
unconditionally increased from 51 to 83 bytes each. We can reduce that
space if we're using SHA-256 or SHA-384.

This saves some BSS space in both BL1 and BL2:
- BL1 with SHA-256: saving 168 bytes.
- BL1 with SHA-384: saving 80 bytes.
- BL2 with SHA-256: saving 384 bytes.
- BL2 with SHA-384: saving 192 bytes.

Change-Id: I0d02e5dc5f0162e82339c768609c9766cfe7e2bd
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2020-02-18 09:47:12 +01:00
Sandrine Bailleux 495599cd0a TBBR: Reduce size of ECDSA key buffers
The TBBR implementation extracts public keys from certificates and
stores them in static buffers. DER-encoded ECDSA keys are only 91 bytes
each but were each allocated 294 bytes instead. Reducing the size of
these buffers saves 609 bytes of BSS in BL2 (294 - 91 = 203 bytes for
each of the 3 key buffers in use).

Also add a comment claryfing that key buffers are tailored on RSA key
sizes when both ECDSA and RSA keys are used.

Change-Id: Iad332856e7af1f9814418d012fba3e1e9399f72a
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2020-02-18 09:46:55 +01:00
Vishnu Banavath 6aa138ded5 corstone700: set UART clocks to 32MHz
Adding support for 32MHz UART clock and selecting it as the
default UART clock

Change-Id: I9541eaff70424e85a3b5ee4820ca0e7efb040d2c
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
2020-02-17 17:04:46 +00:00
Avinash Mehta 93cf1f6454 corstone700: clean-up as per coding style guide
Running checkpatch.pl on the codebase and making required changes

Change-Id: I7d3f8764cef632ab2a6d3c355c68f590440b85b8
Signed-off-by: Avinash Mehta <avinash.mehta@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
2020-02-17 16:47:57 +00:00
Khandelwal c6fe43b726 Corstone700: add support for mhuv2 in arm TF-A
Note: This patch implements in-band messaging protocol only.
ARM has launched a next version of MHU i.e. MHUv2 with its latest
subsystems. The main change is that the MHUv2 is now a distributed IP
with different peripheral views (registers) for the sender and receiver.

Another main difference is that MHUv1 duplex channels are now split into
simplex/half duplex in MHUv2. MHUv2 has a configurable number of
communication channels. There is a capability register (MSG_NO_CAP) to
find out how many channels are available in a system.

The register offsets have also changed for STAT, SET & CLEAR registers
from 0x0, 0x8 & 0x10 in MHUv1 to 0x0, 0xC & 0x8 in MHUv2 respectively.

0x0    0x4  0x8  0xC             0x1F
------------------------....-----
| STAT |    |    | SET |    |   |
------------------------....-----
      Transmit Channel

0x0    0x4  0x8   0xC            0x1F
------------------------....-----
| STAT |    | CLR |    |    |   |
------------------------....-----
        Receive Channel

The MHU controller can request the receiver to wake-up and once the
request is removed, the receiver may go back to sleep, but the MHU
itself does not actively put a receiver to sleep.

So, in order to wake-up the receiver when the sender wants to send data,
the sender has to set ACCESS_REQUEST register first in order to wake-up
receiver, state of which can be detected using ACCESS_READY register.
ACCESS_REQUEST has an offset of 0xF88 & ACCESS_READY has an offset
of 0xF8C and are accessible only on any sender channel.

This patch adds necessary changes in a new file required to support the
latest MHUv2 controller. This patch also needs an update in DT binding
for ARM MHUv2 as we need a second register base (tx base) which would
be used as the send channel base.

Change-Id: I1455e08b3d88671a191c558790c503eabe07a8e6
Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
2020-02-17 16:13:38 +00:00
Marek Vasut 3b87c4b656 rcar_gen3: plat: Minor coding style fix for rcar_version.h
Use space after #define consistently, drop useless parenthesis,
no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I72846d8672cab09b128e3118f4b7042a5a9c0df5
2020-02-15 10:46:00 +01:00
Yoshifumi Hosoya 03360b3c0e rcar_gen3: plat: Update IPL and Secure Monitor Rev.2.0.6
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> # upstream update
Change-Id: I70c3d873b1d05075257034aee5e19c754be911e0
2020-02-15 10:46:00 +01:00
Chiaki Fujii cc4e7ad49e rcar_gen3: drivers: ddr: Update DDR setting for H3, M3, M3N
[IPL/DDR]
- Update H3, M3, M3N DDR setting rev.0.40.

Signed-off-by: Chiaki Fujii <chiaki.fujii.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> # upstream update
Change-Id: If675796a2314e769602af21bf5cc6b10962d4f29
2020-02-15 10:46:00 +01:00
Chiaki Fujii 1f420077b6 rcar_gen3: drivers: ddr: Update DDR setting for H3, M3, M3N
[IPL/DDR]
- Update H3, M3, M3N DDR setting rev.0.39.

Signed-off-by: Chiaki Fujii <chiaki.fujii.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> # upstream update
Change-Id: I0dbf8091f9de9bb6d2d4f94007a5813fff14789f
2020-02-15 10:46:00 +01:00
Yusuke Goda 0fdfe245f1 rcar_gen3: drivers: board: Add new board revision for M3ULCB
Board Revision[2:0]
 3'b000 Rev1.0
 3'b011 Rev3.0 [New]

Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> # upstream update
Change-Id: Ie4f3ac83cc20120ede21052f7452327049565e60
2020-02-15 10:46:00 +01:00
Chiaki Fujii ba63b5c93e rcar_gen3: drivers: ddr: Update DDR setting for H3, M3, M3N
[IPL/DDR]
- Update H3, M3, M3N DDR setting rev.0.38.

Signed-off-by: Chiaki Fujii <chiaki.fujii.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> # upstream update
Change-Id: I49cf8f778b849a6ee97bc9f6948c45b07dc467b1
2020-02-15 10:46:00 +01:00
Toshiyuki Ogasahara 2701a05836 rcar_gen3: plat: Update IPL and Secure Monitor Rev.2.0.5
Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> # upstream update
Change-Id: I8ef32a67f7984d8bcfcc3655988b559efa6e65ab
2020-02-15 10:46:00 +01:00
Toshiyuki Ogasahara 13856f3779 rcar_gen3: plat: Change fixed destination address of BL31 and BL32
This patch changes the destination address of BL31 and BL32 From
fixed address for getting from the each certificates.

Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> # upstream rework
Change-Id: Ide11776feff25e6fdd55ab28503a15b658b2e0d5
2020-02-15 10:45:55 +01:00
Mark Dykes 956059385c Merge "Fix topology description of cpus for DynamIQ based FVP" into integration 2020-02-14 19:12:44 +00:00
Sandrine Bailleux 7b3d0948da Merge "fconf: Move remaining arm platform to fconf" into integration 2020-02-14 14:39:44 +00:00
Sandrine Bailleux b3add9cbf1 Merge changes from topic "uniphier" into integration
* changes:
  uniphier: make I/O register region configurable
  uniphier: make PSCI related base address configurable
  uniphier: make counter control base address configurable
  uniphier: make UART base address configurable
  uniphier: make pinmon base address configurable
  uniphier: make NAND controller base address configurable
  uniphier: make eMMC controller base address configurable
2020-02-14 08:26:05 +00:00
Madhukar Pappireddy 0ad5b318f7 Fix topology description of cpus for DynamIQ based FVP
DynamIQ based designs have upto 8 CPUs in each cluster. This
patch fixes the device tree node which describes the topology
of the CPU for DynamIQ FVP Model.

Change-Id: I7146bc79029ce38314026d4853e5b6406863725c
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2020-02-13 15:45:06 -06:00
Alexei Fedorov 25d583a858 Merge "corstone700: adding support for stack protector for the FVP" into integration 2020-02-13 15:29:49 +00:00
Morten Borup Petersen 7f0daaa971 corstone700: adding support for stack protector for the FVP
Adding support for generating a semi-random number required for
enabling building TF-A with stack protector support.
TF-A for corstone-700 may now be built using ENABLE_STACK_PROTECTOR=all

Change-Id: I03e1be1a8d4e4a822cf286f3b9ad4da4337ca765
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
2020-02-13 10:29:47 +00:00
Sandrine Bailleux ce620fa9f2 Merge changes from topic "uniphier" into integration
* changes:
  uniphier: extend boot device detection for future SoCs
  uniphier: change block_addressing flag to bool
  uniphier: change the return value type of .is_usb_boot() to bool
2020-02-13 09:37:27 +00:00
Arve Hjønnevåg 4128659076 Fix boot failures on some builds linked with ld.lld.
Pad the .rodata section to 16 bytes as ld.lld does not apply the ALIGN
statement on the .data section to the LMA. Fixes boot failure on builds
where the .rodata section happens to not be 16 bytes aligned.

Change-Id: I4e95678f73d8b326c5fc749dc7d0ce84e2d603f5
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2020-02-12 19:09:00 +00:00
Arve Hjønnevåg 76776c2c67 trusty: generic-arm64-smcall: Support gicr address
Add SMC_GET_GIC_BASE_GICR option to SMC_FC_GET_REG_BASE and
SMC_FC64_GET_REG_BASE calls for returning the base address of the gic
redistributor added in gic version 3.

Bug: 122357256
Change-Id: Ia7c287040656515bab262588163e0c5fc8f13a21
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2020-02-12 19:07:18 +00:00
Arve Hjønnevåg 471e8fa7d1 trusty: Allow gic base to be specified with GICD_BASE
Some platforms define GICD_BASE instead of PLAT_ARM_GICD_BASE but the
meaning is the same.

Change-Id: I1bb04bb49fdab055b365b1d70a4d48d2058e49df
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2020-02-12 19:07:10 +00:00
Arve Hjønnevåg f01428b1cc trusty: Allow getting trusty memsize from BL32_MEM_SIZE instead of TSP_SEC_MEM_SIZE
Some platforms define BL32_MEM_SIZE instead of TSP_SEC_MEM_SIZE, but
the meaning is the same.

Change-Id: I93d96dca442e653435cae6a165b1955efe2d2b75
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2020-02-12 19:07:03 +00:00
Arve Hjønnevåg eff737c1d9 Fix clang build if CC is not in the path.
If CC points to clang the linker was set to ld.lld. Copy the diectory
name from CC is it has one.

Change-Id: I50aef5dddee4d2540b12b6d4e68068ad004446f7
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2020-02-12 19:06:29 +00:00
Mark Dykes 51d72d3adb Merge "doc: debugfs remove references section and add topic to components index" into integration 2020-02-12 16:44:26 +00:00