Commit Graph

4612 Commits

Author SHA1 Message Date
Konstantin Porotchkin 5a9f00f707 plat/marvell: comphy: Add support for SFI on Lane 4
Add static configuration for SFI+ 10Gbps interface on SERDES
Lane 4.
This is just a copy of Lane 2 static values, not optimized.
Board-to-board iperf test shows up to 6Gbps transfer speed.

Change-Id: I024d2ac132f7fa6c342a64367f3dca2123a27e97
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
2018-12-04 14:09:44 +02:00
Konstantin Porotchkin d03f7a3122 doc: marvell: Update build manual with new memory layouts
Add description for memory layouts used by EspressoBin v7 (DDR4)

Change-Id: I199d8b52580b26e560f14b503a6e99d32de4f284
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/61279
Reviewed-by: Stefan Chulski <stefanc@marvell.com>
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
2018-12-04 14:09:44 +02:00
Christine Gharzuzi 5cf6fafe22 fix: a3900: pm: fix number of CPU power switches.
- Number of open power switches for CPUs should be three
  and now two.

- This patch updates the value of open power switches from
  0xfd (two power-switches) to 0xfc (three power-switches).

Change-Id: I2783ab7f04bbbb6da78eeedcabe4636f9a774512
Signed-off-by: Christine Gharzuzi <chrisg@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Konstantin Porotchkin c35442690c svc: Update the EEPROM AVS values processing
Add support for SVC test builds for tuning AVS values.
Update the SVC procedure and add EEPROM access.
Add support for AP807 AVS values (10 bits wide).

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Christine Gharzuzi 1020e0d326 ble: ap807: Switch to PLL mode and update CPU frequency
- Update CPU frequency on AP807 to 2GHz for SAR 0x0.
- Increase AVS to 0.88V for 2GHz clock

Change-Id: Ic945b682ab2f8543e34294bfc56c3eae2c5e0c8e
Signed-off-by: Christine Gharzuzi <chrisg@marvell.com>
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Igal Liberman 55df84f974 mvebu: cp110: avoid pcie power on/off sequence when called from Linux
In Armada 8K DB boards, PCIe initialization can be executed only once
because PCIe reset performed during chip power on and it cannot be
executed via GPIO later.
This means that power on can be executed only once, when it's called
from the bootloader.
Power on:
	Read bit 21 of the mode, it marks if the caller is
	the bootloader or the Linux Kernel.
Power off:
	Check if the comphy was already configured to PCIe, if yes,
	check if the caller is bootloader, if both conditions are true
	(PCIe mode and called by Linux) - skip the power-off.

In addition, fix incorrect documentation describing mode fields -
PCIe width is 3 bits, not 2.

NOTE: with this patch, please use LK4.14.76 (LK4.4.120 may not work
with it).

Change-Id: I4b929011f97a0a1869a51ba378687e78b3eca4ff
Signed-off-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Grzegorz Jaszczyk 9cb6751d59 plat: marvell: a3700: do not power off cpu due to errata ref #13
Do not power off the CPU1 since there is no way to wake it up
(wake-up is causing CPU0 reset as well duo to HW bug). Quote from errata
Ref #13 [In power saving mode, both cores must be powered off]:
"When Core 0 is on and Core 1 is in power-off state, a Core 1
wake-up resets Core 0 as well and puts Core 0 back to ROM".

To overcome described HW bug instead of powering the CPU off, let it
reach WFI instruction, which is invoked by generic psci_do_cpu_off
function after platform handler finishes. This will put the core in low
power state and give a chance to wake it up.

Before this change, after running secondary kernel via kexec, only one
core was up, now both cores are up.

Change-Id: I87f144867550728055d9b8a2edb84a14539acab7
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Grzegorz Jaszczyk 0529106c4b mvebu: cp110: fix phy selector configuration for XFI1
Extended phy selector configuration about XFI1 mode.

Change-Id: I1309770bbb5fdbfb0127b6f12ee78974d1d6b19f
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Peng Fan 46f9b2c3a2 drivers: add tzc380 support
Add tzc380 support.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
2018-12-04 18:06:41 +08:00
Yann Gautier 1d7bcaa636 drivers: st: mmc: improve error cases in send_cmd function
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-12-04 10:38:41 +01:00
Yann Gautier ba7f9bfd8e stm32mp: check stm32_sdmmc2_mmc_init return
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-12-04 10:38:41 +01:00
Yann Gautier 77614a9949 drivers: mmc: check mmc_reset_to_idle return
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-12-04 10:38:41 +01:00
Soby Mathew 41771df849
Merge pull request #1699 from chandnich/sgi-mt-support
Add support to implement multi-threaded platforms for SGI
2018-12-03 13:29:33 +00:00
Chandni Cherukuri 699223a282 plat/arm/sgi: Use platform specific functions to get platform ids
Add two new functions 'plat_arm_sgi_get_platform_id' and
'plat_arm_sgi_get_config_id' which will be implemented by all the
SGI platforms. These functions can be used to determine the part
number and configuration id of the SGI platforms.

In BL2, these functions are used to populate the 'system-id' node.
In BL31, these functions are used to populate the 'sgi_plat_info_t'
structure with the part number and configuration id of the platform.

Change-Id: I3bacda933527724a3b4074ad4ed5b53a81ea4689
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2018-12-03 18:35:50 +05:30
Soby Mathew 500db01352
Merge pull request #1701 from chandnich/psci-ops
remove weak implemention of 'plat_arm_psci_override_pm_ops'
2018-11-30 16:25:27 +00:00
Ryan Grachek 87f6740c6b hikey960: initialize EDMAC and channels
This is needed to utilize the DMA controller on the hikey960

Signed-off-by: Ryan Grachek <ryan@edited.us>
2018-11-29 13:11:45 -06:00
Antonio Niño Díaz 37e8ab5323
Merge pull request #1688 from JoelHutton/jh/variant_1_mitigations
Initial Spectre V1 mitigations (CVE-2017-5753).
2018-11-29 16:05:50 +01:00
Antonio Niño Díaz 3af48da771
Merge pull request #1698 from hzhuang1/rm_emmc_delay
Rm emmc delay
2018-11-29 16:05:17 +01:00
Antonio Niño Díaz 051cf88962
Merge pull request #1679 from pangupta/master
ccn: Introduce API to set and read value of node register
2018-11-29 16:05:05 +01:00
Chandni Cherukuri 89f2e58985 plat/arm: remove weak implemention of 'plat_arm_psci_override_pm_ops' function
In order to allow Arm platforms to override the default list of PSCI
callbacks, remove the existing weak implementation of
'plat_arm_psci_override_pm_ops' function and let all the Arm platforms
implement their own 'plat_arm_psci_override_pm_ops' function.

For platforms that support SCMI protocol, the function
'css_scmi_override_pm_ops' can be additionally used as well to
override the default PSCI callbacks.

Change-Id: If7c27468bd51a00ea9c2a3716b5894163f5a9f3c
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2018-11-29 15:05:59 +05:30
Antonio Niño Díaz 9345d9a0d9
Merge pull request #1693 from jeenu-arm/ehf-doc
EHF and RAS documentation
2018-11-28 11:55:53 +01:00
Antonio Niño Díaz 48e32a131c
Merge pull request #1696 from satheesbalya-arm/sb1/sb1_2406_romlib_juno
romlib: Add juno support for romlib
2018-11-27 09:06:15 +01:00
Antonio Niño Díaz 3b83c957b6
Merge pull request #1695 from satheesbalya-arm/sb1/sb1_2641_romlib_phase2
romlib: Allow patching of romlib functions
2018-11-27 09:05:50 +01:00
Chandni Cherukuri a83d4bd765 plat/arm/sgi: allow value of PLAT_MAX_PWR_LVL to be platform specific
For platforms with multi-threaded CPUs, the number of power domains
supported would be more than the value currently defined by
PLAT_MAX_PWR_LVL. So move the PLAT_MAX_PWR_LVL macro to platform
specific code and let the platform define the number of power domain
levels.

Change-Id: I21c0682e62b397860b2999031a0c9c5ce0d28eed
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2018-11-27 10:32:55 +05:30
Chandni Cherukuri bd3d7b4ac4 plat/arm/sgi: override weak implementation of plat_arm_get_cpu_pe_count
To support platforms which are based on multi-threaded CPUs, override
the weak implementation of plat_arm_get_cpu_pe_count function to return
the number of threads supported by the CPU used in the platform.

Change-Id: Ia680773f1277b17e2d3d2414d87943dcece33e89
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2018-11-27 10:32:55 +05:30
Chandni Cherukuri 0e27faf484 plat/arm/common: add an additional platform power level
For platforms using multi-threaded CPUs, there can be upto four
platform power domain levels. At present, there are three platform
power domain levels that are defined for the CSS platforms. Define a
fourth level 'ARM_PWR_LVL3' as well to provide support for an
additional platform power domain level.

Change-Id: I40cc17a10f4690a560776f504364fd7277a7e72a
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2018-11-27 10:32:55 +05:30
Chandni Cherukuri eff2f44430 plat/css: allow platforms to define the system power domain level
The CSS_SYSTEM_PWR_DMN_LVL macro that defines the system power domain
level is fixed at ARM_PWR_LVL2 for all CSS platforms. However, the
system power domain level can be different for CSS platforms that
use multi-threaded CPUs.

So, in preparation towards adding support for platforms that use
multi-threaded CPUs, refactor the definition of CSS_SYSTEM_PWR_DMN_LVL
such that CSS_SYSTEM_PWR_DMN_LVL is uniquely defined for each of the
CSS platform.

Change-Id: Ia837b13f6865e71da01780993c048b45b7f36d85
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
2018-11-27 10:32:55 +05:30
Jeenu Viswambharan 63eb2410c1 docs: Add RAS framework documentation
Change-Id: Ibf2b21b12ebc0af5815fc6643532a3be9100bf02
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-11-26 14:51:41 +00:00
Joel Hutton 9edd891279 Initial Spectre V1 mitigations (CVE-2017-5753).
Initial Spectre Variant 1 mitigations (CVE-2017-5753).
A potential speculative data leak was found in PSCI code, this depends
on a non-robust implementation of the `plat_get_core_pos_by_mpidr()`
function. This is considered very low-risk. This patch adds a macro to
mitigate this. Note not all code paths could be analyzed with current
tools.

Add a macro which makes a variable 'speculation safe', using the
 __builtin_speculation_safe_value function of GCC and llvm. This will be
available in GCC 9, and is planned for llvm, but is not currently in
mainline GCC or llvm. In order to implement this mitigation the compiler
must support this builtin. Support is indicated by the
__HAVE_SPECULATION_SAFE_VALUE flag.

The -mtrack-speculation option maintains a 'tracker' register, which
determines if the processor is in false speculation at any point. This
adds instructions and increases code size, but avoids the performance
impact of a hard barrier.

Without the -mtrack-speculation option, __builtin_speculation_safe_value
expands to a

    ISB
    DSB SY

sequence after a conditional branch, before the
speculation safe variable is used. With -mtrack-speculation a

    CSEL tracker, tracker, XZR, [cond];
    AND safeval,tracker;
    CSDB

sequence is added instead, clearing the vulnerable variable by
AND'ing it with the tracker register, which is zero during speculative
execution. [cond] are the status flags which will only be true during
speculative execution. For more information on
__builtin_speculation_safe_value and the -mtrack-speculation option see
https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/compiler-support-for-mitigations

The -mtracking option was not added, as the performance impact of the
mitigation is low, and there is only one occurence.

Change-Id: Ic9e66d1f4a5155e42e3e4055594974c230bfba3c
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
2018-11-26 13:22:14 +00:00
Jeenu Viswambharan e31d76fd16 docs: Add Exception Handling Framework documentation
Change-Id: I77d38758d18ba6dda1652b1b1e644fbfb14386cc
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-11-26 11:22:32 +00:00
Jeenu Viswambharan 90a9213bfb SDEI: Unconditionally resume Secure if it was interrupted
Secure world execution nearly always expect a controlled exit to
Non-secure world. SDEI interrupts, although targets EL3, occur on behalf
of Non-secure world, and may have higher priority than Secure world
interrupts. Therefore they might preempt Secure execution, and yield
execution to Non-secure SDEI handler. Upon completion of SDEI event
handling (regardless of whether it's COPLETE or COMPLETE_AND_RESUME), we
must resume Secure execution if it was preempted.

Change-Id: I6edd991032588588427ba2fe6c3d7668f7080e3d
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2018-11-26 11:22:32 +00:00
Antonio Niño Díaz 85397ec457
Merge pull request #1697 from antonio-nino-diaz-arm/an/arch
Synchronise arch.h and arch_helpers.h with TF-A-Tests
2018-11-26 11:51:57 +01:00
Antonio Nino Diaz 932b3ae232 Synchronise arch.h and arch_helpers.h with TF-A-Tests
The headers forked at some point in the past and have diverged a lot. In
order to make it easier to share code between TF-A-Tests and TF-A, this
patch synchronises most of the definitions in the mentioned headers.

This is not a complete sync, it has to be followed by more cleanup.

This patch also removes the read helpers for the AArch32 instructions
ats1cpr and ats1hr (they are write-only).

Change-Id: Id13ecd7aeb83bd2318cd47156d71a42f1c9f6ba2
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-11-26 09:06:52 +00:00
Haojian Zhuang b79de2dca8 hikey: remove delay after eMMC initialized
commit 386b14bf64124ebf0368eab33ef07603e0c3138a
Author: Haojian Zhuang <haojian.zhuang@linaro.org>
Date:   Wed Nov 21 09:19:49 2018 +0800

    mmc: poll eMMC status after EXT_CSD command

    EXT_CSD command needs to access data from eMMC device. Add the
    operation of polling eMMC device status. Make sure the command is
    finished.

    Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>

A hacked delay time can't fit each eMMC device. Since the above commit
enables the polling operation, remove the hacked delay time now.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-11-26 09:20:23 +08:00
Haojian Zhuang 9376864479 mmc: poll eMMC status after EXT_CSD command
EXT_CSD command needs to access data from eMMC device. Add the
operation of polling eMMC device status. Make sure the command is
finished.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-11-26 09:20:23 +08:00
Sathees Balya afa5cfea60 juno: Add romlib support
This patch adds support to build a combined BL1
and ROMLIB binary file with the right page
alignment in Juno. When USE_ROMLIB=1 is set for
Juno, it generates the combined file
bl1_romlib.bin which needs to be used instead of
bl1.bin

Change-Id: I407efbe48d3e522fa6ef855538a9587193cb1919
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
2018-11-23 11:52:01 +00:00
Pankaj Gupta 6f7dba4b24 ccn: Introduce API to set and read value of node register
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
2018-11-23 16:38:43 +05:30
Antonio Niño Díaz 98aab97484
Merge pull request #1681 from Andre-ARM/allwinner/fixes
allwinner: clock / power fixes
2018-11-23 10:18:23 +01:00
Antonio Niño Díaz 9165684996
Merge pull request #1691 from vijayenthiran-arm/sgi-dmc620-tzc
Add support for dmc620 tzc driver
2018-11-23 10:18:02 +01:00
Sathees Balya 582133a807 romlib: Add map file generation
Change-Id: I1f377d2d94c0fe8d2d9e62614f4a8e2dfcd9e745
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
2018-11-22 17:26:57 +00:00
Sathees Balya 032e3a6cd7 romlib: Add calloc_free register function
Register functions have to be added to the
jump table to allow patching in the
future

Change-Id: I57a885f7fc6290ea74a6096aea5b1867b2098eb7
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
2018-11-22 17:26:57 +00:00
Sathees Balya 6baf85b3e0 romlib: Allow patching of romlib functions
This change allows patching of functions in the
romlib. This can be done by adding "patch" at the
end of the jump table entry for the function that
needs to be patched in the file jmptbl.i.
Functions patched in the jump table list will be
built as part of the BL image and the romlib
version will not be used

Change-Id: Iefb200cb86e2a4b61ad3ee6180d3ecc39bad537f
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
2018-11-22 17:26:57 +00:00
Antonio Nino Diaz c4cdd9e464 Revert "aarch32: Apply workaround for errata 813419 of Cortex-A57"
This reverts commit 6f512a3dfd.

According to the 'Cortex-A57 MPCore Software Developers Errata Notice':

    This bug will only affect secure AArch64 EL3. If the above
    conditions occur, the CPU will not invalidate the targeted EL3 TLB
    entries and incorrect translations might occur.

For this reason it is not needed in AArch32.

Change-Id: I6f7b333817515499723e8f306145790ad6af9975
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-11-22 15:54:58 +00:00
Antonio Niño Díaz 5c04fc7899
Merge pull request #1689 from antonio-nino-diaz-arm/an/alloc-va
xlat v2: Support mapping regions with allocated VA
2018-11-22 15:21:47 +01:00
Antonio Niño Díaz 0668e5a877
Merge pull request #1687 from ldts/rcar_gen3/maintain_4
rcar-gen3: lock RPC hyper-flash access
2018-11-22 14:59:38 +01:00
Antonio Nino Diaz 9056f10806 xlat v2: Support mapping regions with allocated VA
Provide new APIs to add new regions without specifying the base VA.

- `mmap_add_region_alloc_va` adds a static region to mmap choosing as
  base VA the first possible address after all the currently mapped
  regions. It is aligned to an appropriate boundary in relation to the
  size and base PA of the requested region. No attempt is made to fill
  any unused VA holes.

- `mmap_add_dynamic_region_alloc_va` it adds a region the same way as
  `mmap_add_region_alloc_va` does, but it's dynamic instead of static.

- `mmap_add_alloc_va` takes an array of non const `mmap_region_t`,
  maps them in the same way as `mmap_add_region_alloc_va` and fills
  their `base_va` field. A helper macro has been created to help create
  the array, called `MAP_REGION_ALLOC_VA`.

Change-Id: I5ef3f82ca0dfd0013d2e8034aa22f13ca528ba37
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-11-22 13:29:45 +00:00
Vijayenthiran Subramaniam 9427c745e3 plat/arm/sgi: add secure memory support for sgi575 and sgiclarka
Remove the platform common plat_arm_security_setup function to allow
platform specific implementations of the security setup function
implemented in the board directory of the platform.

For use by secure software, configure region0 of DMC-620 trustzone
controller to protect the upper 16MB of memory of the first DRAM block
from non-secure accesses.

Change-Id: I9a8c19656702c4fa4f6917b3655b692d443bb568
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
2018-11-21 19:25:54 +05:30
Vijayenthiran Subramaniam 9d3b191a48 drivers/tzc-dmc620: add driver to setup DMC-620 TZC controller
ARM CoreLink DMC-620 Dynamic Memory Controller includes a TZC controller
to setup secure or non-secure regions of DRAM memory. The TZC controller
allows to setup upto eight such regions of memory in DRAM. This driver
provides helper functions to setup the TZC controller within DMC-620.

Change-Id: Iee7692417c2080052bdb7b1c2873a024bc5d1d10
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
2018-11-21 19:25:35 +05:30
Antonio Niño Díaz c385955764
Merge pull request #1690 from pbatard/rpi3-docfix
rpi3: fix bad formatting in rpi3.rst
2018-11-20 17:33:30 +01:00
Pete Batard 934bbea18b rpi3: fix bad formatting in rpi3.rst
d4fd0219 (pull request #1685) introduced unwanted formatting
such as bold/italic in the description for RPI3_USE_UEFI_MAP.
2018-11-20 16:28:16 +00:00