Commit Graph

6903 Commits

Author SHA1 Message Date
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
Jimmy Brisson da3b47e925 Add Matterhorn CPU lib
Also update copyright statements

Change-Id: Iba0305522ac0f2ddc4da99127fd773f340e67300
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2020-02-18 09:00:04 -06:00
Jimmy Brisson f4744720a0 Add CPULib for Klein Core
Change-Id: I686fd623b8264c85434853a2a26ecd71e9eeac01
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
2020-02-18 08:57:32 -06: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
XiaoDong Huang 11a0a46a89 rockchip: fix definition of struct param_ddr_usage
In extreme cases, the number of secure regions is one more than
non-secure regions. So array "s_base" and "s_top"s size
in struct param_ddr_usage need to be adjust to "DDR_REGION_NR_MAX + 1".

Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: Ifc09da2c8f8afa1aebcc78f8fbc21ac95abdece2
2020-02-17 08:53:39 +08: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
Louis Mayencourt b890b36d1d tools: Small improvement to print_memory_map script
This patch:
- Add the __COHERENT_RAM_START__ and __COHERENT_RAM_END__ symbols.
- Improve how the symbols are found with a regex.
- Add a build option to revert the memory layout output.

Change-Id: I54ec660261431bc98d78acb0f80e3d95bc5397ac
Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
2020-02-14 16:31:19 +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
Xi Chen 95d3c46a2f mediatek: mt8183: protect 4GB~8GB dram memory
The offset there is the virtual address space on the bus side (1-9GB for 8GB RAM),
and that emi_mpu_set_region_protection will translate to the physical memory space (0-8GB).

8GB is 33-bit (the memory bus width is 33-bit on this platform),
so 0x23FFFFFFFUL-EMI_PHY_OFFSET = 0x1_FFFF_FFFF.

Change-Id: I7be4759ed7546f7e15a5868b6f08988928c34075
Signed-off-by: Xi Chen <xixi.chen@mediatek.com>
2020-02-14 14:16:59 +08: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
Samuel Holland e382c88e2a allwinner: Implement PSCI system suspend using SCPI
If an SCP firmware is present and able to communicate via SCPI, then use
that to implement CPU and system power state transitions, including CPU
hotplug and system suspend. Otherwise, fall back to the existing CPU
power control implementation.

The last 16 KiB of SRAM A2 are reserved for the SCP firmware, and the
SCPI shared memory is at the very end of this region (and therefore the
end of SRAM A2). BL31 continues to start at the beginning of SRAM A2
(not counting the ARISC exception vector area) and fills up to the
beginning of the SCP firmware.

Because the SCP firmware is not loaded adjacent to the ARISC exception
vector area, the jump instructions used for exception handling cannot be
included in the SCP firmware image, and must be initialized here before
turning on the SCP.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: I37b9b9636f94d4125230423726f3ac5e9cdb551c
2020-02-12 21:41:39 -06:00
Samuel Holland 50cabf6d22 allwinner: Add a msgbox driver for use with SCPI
The function names follow the naming convention used by the existing
ARM SCPI client.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: I543bae7d46e206eb405dbedfcf7aeba88a12ca48
2020-02-12 21:18:21 -06:00
Samuel Holland 57b3663239 allwinner: Reserve and map space for the SCP firmware
The SCP firmware is allocated the last 16KiB of SRAM A2. This includes
the SCPI shared memory area, which must be mapped as MT_DEVICE to
prevent problems with cache coherency between the AP CPUs and the SCP.
For simplicity, map the whole SCP region as MT_DEVICE.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: Ie39eb5ff281b8898a3c1d9748dc08755f528e2f8
2020-02-12 21:18:21 -06:00
Samuel Holland ae3fe6e3e6 allwinner: Adjust SRAM A2 base to include the ARISC vectors
The ARISC vector area consists of 0x4000 bytes before the beginning of
usable SRAM. Still, it is technically a part of SRAM A2, so include it
in the memory definition. This avoids the confusing practice of
subtracting from the beginning of the SRAM region when referencing the
ARISC vectors.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: Iae89e01aeab93560159562692e03e88306e2a1bf
2020-02-12 21:18:21 -06:00
Samuel Holland 98367c8061 arm/css/scpi: Don't panic if the SCP fails to respond
Instead, pass back the error to the calling function. This allows
platform code to fall back to another PSCI implementation if
scpi_wait_ready() or a later SCPI command fails.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: Ib4411e63c2512857f09ffffe1c405358dddeb4a6
2020-02-12 21:16:46 -06: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
Sandrine Bailleux 78fcbd65be Merge "intel: Change boot source selection" into integration 2020-02-12 15:54:02 +00:00
Sandrine Bailleux c83d66ec63 Merge changes Ib68092d1,I816ea14e into integration
* changes:
  plat: marvell: armada: scp_bl2: allow loading up to 8 images
  plat: marvell: armada: add support for loading MG CM3 images
2020-02-12 15:51:42 +00:00
Louis Mayencourt 3c6fcf117a fconf: Move remaining arm platform to fconf
Change-Id: I011256ca60672a00b711c3f5725211be64bbc2b2
Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
2020-02-12 14:36:00 +00:00
Petre-Ionut Tudor 62c9be71d6 Update docs with PMU security information
This patch adds information on the PMU configuration registers
and security considerations related to the PMU.

Signed-off-by: Petre-Ionut Tudor <petre-ionut.tudor@arm.com>
Change-Id: I36b15060b9830a77d3f47f293c0a6dafa3c581fb
2020-02-12 13:08:20 +00:00
Olivier Deprez 3ac82b258e doc: debugfs remove references section and add topic to components index
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I8c2e6dc98f2f30a81f4f80cc0ca1232fed7a53c9
2020-02-12 11:26:36 +01:00
joanna.farley 572fcdd547 Merge "Fixes ROTPK hash generation for ECDSA encryption" into integration 2020-02-12 08:46:46 +00:00
Jacky Bai 97600cb586 plat: imx8m: Fix the rdc memory region slot's offset
Each memory region slot occupies 16bypte space, so
correct the the offset of config register address.

Change-Id: Ief8f21bb8ada78b5663768ee1e40f9e0eae57165
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
2020-02-12 15:11:36 +08:00
Masahiro Yamada 8eaffdf70b uniphier: make on-chip SRAM region configurable
The on-chip SRAM region will be changed in the next SoC. Make it
configurable. Also, split the mmap code into a new helper function
so that it can be re-used for another boot mode.

Change-Id: I89f40432bf852a58ebc9be5d9dec4136b8dc010b
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-02-12 13:36:58 +09:00
Masahiro Yamada eba319be6c uniphier: make I/O register region configurable
The I/O register region will be changed in the next SoC. Make it
configurable.

Change-Id: Iec0cbd1ef2d0703ebc7c3d3082edd73791bbfec9
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-02-12 13:36:58 +09:00
Masahiro Yamada 2cb260053d uniphier: extend boot device detection for future SoCs
The next SoC will have:
  - No boot swap
  - SD boot
  - No USB boot

Add new fields to handle this.

Change-Id: I772395f2c5dfc612e575b0cbd0657a5fa9611c25
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-02-12 13:36:58 +09:00
Masahiro Yamada eea5b880ee uniphier: make PSCI related base address configurable
The register base address will be changed in the next SoC. Make it
configurable.

Change-Id: Ibe07bd9db128b0f7e629916cb6ae21ba7984eca9
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-02-12 13:36:58 +09:00
Masahiro Yamada 1046c1cae2 uniphier: change block_addressing flag to bool
The flag, uniphier_emmc_block_addressing, is boolean logic, so
"bool' is more suitable.

uniphier_emmc_is_over_2gb() is not boolean - it returns 1 / 0
depending on the card density, or a negative value on failure.
Rename it to make it less confusing.

Change-Id: Ia646b1929147b644e0df07c46b54ab80548bc3bd
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-02-12 13:36:58 +09:00