project/bcm63xx/atf.git
7 years agoMerge pull request #885 from antonio-nino-diaz-arm/an/console-flush
davidcunado-arm [Wed, 12 Apr 2017 21:23:44 +0000 (22:23 +0100)]
Merge pull request #885 from antonio-nino-diaz-arm/an/console-flush

Implement console_flush()

7 years agoMerge pull request #892 from rockchip-linux/fixes-a-typo
davidcunado-arm [Fri, 7 Apr 2017 14:54:14 +0000 (15:54 +0100)]
Merge pull request #892 from rockchip-linux/fixes-a-typo

rockchip/rk3399: the printf changed to tf_printf for console output

7 years agoMerge pull request #891 from vwadekar/tegra186-platform-support-v4
davidcunado-arm [Fri, 7 Apr 2017 12:43:37 +0000 (13:43 +0100)]
Merge pull request #891 from vwadekar/tegra186-platform-support-v4

Tegra186 platform support v4

7 years agorockchip/rk3399: changed printf/tf_printf for console output
Caesar Wang [Thu, 6 Apr 2017 00:40:24 +0000 (08:40 +0800)]
rockchip/rk3399: changed printf/tf_printf for console output

The printf() isn't used by the firmware itself, just by the tools under
the ./tools/ folder. Then tf_printf will unconditionally print.
Remove the unused print_dram_status_info() function.

Change-Id: Ie699ccb54a5be9a2cbbd7b8d4193b57075a2f57a
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
7 years agoMerge pull request #888 from douglas-raillard-arm/dr/fix_ULL_issue
davidcunado-arm [Thu, 6 Apr 2017 14:23:52 +0000 (15:23 +0100)]
Merge pull request #888 from douglas-raillard-arm/dr/fix_ULL_issue

Fix ARM_BL31_IN_DRAM build

7 years agoMerge pull request #889 from paulkocialkowski/integration
davidcunado-arm [Thu, 6 Apr 2017 09:55:17 +0000 (10:55 +0100)]
Merge pull request #889 from paulkocialkowski/integration

rockchip: Remove unused rockchip_pd_pwr_down_wfi function

7 years agoMerge pull request #886 from dp-arm/dp/stack-protector
davidcunado-arm [Thu, 6 Apr 2017 09:20:47 +0000 (10:20 +0100)]
Merge pull request #886 from dp-arm/dp/stack-protector

Add support for GCC stack protection

7 years agoMerge pull request #882 from douglas-raillard-arm/dr/review_juno_errata
davidcunado-arm [Wed, 5 Apr 2017 21:39:22 +0000 (22:39 +0100)]
Merge pull request #882 from douglas-raillard-arm/dr/review_juno_errata

Enable all A53 and A57 errata workarounds for Juno

7 years agoTegra186: move TSA macros to tegra_def.h
Varun Wadekar [Thu, 15 Dec 2016 19:54:51 +0000 (11:54 -0800)]
Tegra186: move TSA macros to tegra_def.h

This patch moves the TSA block's macros from memctrl_v2.h to
tegra_def.h in the Tegra186 tree.

Change-Id: I8b45dd3905c5d1f33ffb36d8b2de72aeb06674aa
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: drivers: memctrl: move chip specific defines to tegra_def.h
Varun Wadekar [Tue, 13 Dec 2016 00:14:57 +0000 (16:14 -0800)]
Tegra: drivers: memctrl: move chip specific defines to tegra_def.h

This patch moves the chip specific memory controller driver defines to
the appropriate tegra_def.h files, for future compatibility.

Change-Id: I3179fb771d8b32e913ca29bd94af95f4b2fc1961
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: move platform specific MCE defines to tegra_def.h
Varun Wadekar [Mon, 12 Dec 2016 22:24:17 +0000 (14:24 -0800)]
Tegra186: move platform specific MCE defines to tegra_def.h

This patch moves the MCE's configurable parameters to tegra_def.h for
the Tegra186 SoC, to allow forward compatiblity.

Change-Id: If8660c1c09908a4064dbb67d5ca4fb78389cab13
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: no SID override for AON
Mustafa Yigit Bilgen [Thu, 17 Nov 2016 23:08:39 +0000 (15:08 -0800)]
Tegra: memctrl_v2: no SID override for AON

Remove stream ID overrides for AON. AON drives its own stream ID when
accesing IOVA memory. However, it needs to use a physical stream ID when
accesing GSC memory. Overriding stream ids prevents AON from accessing
GSC memory, so remove them to allow AON to access GSCs.

Change-Id: Ia2b11014d9780c4546b5e781621ae4cd413735cc
Signed-off-by: Mustafa Yigit Bilgen <mbilgen@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: memctrl_v2: remove APE overrides for chip verification
Vivek Aseeja [Mon, 22 Aug 2016 20:44:08 +0000 (13:44 -0700)]
Tegra186: memctrl_v2: remove APE overrides for chip verification

This patch reverts the APE overrides added for chip verification.

Change-Id: Ib85560934d63f6e41e95ef6898a341f24761a517
Signed-off-by: Vivek Aseeja <vaseeja@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: use MSB of wake_time
Krishna Sitaraman [Thu, 18 Aug 2016 22:41:21 +0000 (15:41 -0700)]
Tegra186: use MSB of wake_time

This patch updates wake time of the cpu to use the MSBs and zero
out the LSB's. Only 24 out of 32 bits are currently passed
through the PSCI interface. Previously all the LSB's were used.

Change-Id: Ie2d9d1bf6e3003dd47526a124f64e6ad555d2371
Signed-off-by: Krishna Sitaraman <ksitaraman@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: Update API for reset vector ARI
Krishna Sitaraman [Fri, 2 Sep 2016 23:53:04 +0000 (16:53 -0700)]
Tegra186: Update API for reset vector ARI

The TEGRA_ARI_COPY_MISCREG_AA64_RST ARI should be called with
request_lo/hi set to zero. MTS automatically takes the reset
vector from MISCREG_AA64_RST register and does not need it to
be passed as parameters.  This patch updates the API and the
caller function accordingly.

Change-Id: Ie3e3402d93951102239d988ca9f0cdf94f290d2f
Signed-off-by: Krishna Sitaraman <ksitaraman@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: clean CPU wake times from L2 cache
Mustafa Yigit Bilgen [Sat, 3 Sep 2016 02:30:22 +0000 (19:30 -0700)]
Tegra186: clean CPU wake times from L2 cache

When entering C7, ATF disables caches and flushes the L1 cache. However,
wake_time[cpu] can still remain in the L2 cache, causing later reads to it
to fetch from DRAM. This will read stale values.

Fix this by aligning wake_time[cpu] to cache lines, and explicitly cleaning it
before disabling caches.

Change-Id: Id73d095b479677595a6b3dd0abb240a1fef5f311
Signed-off-by: Mustafa Yigit Bilgen <mbilgen@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: update t18x_ari.h to v3.0
Krishna Sitaraman [Thu, 28 Jul 2016 20:56:36 +0000 (13:56 -0700)]
Tegra186: update t18x_ari.h to v3.0

This patch updates the ARI header to version 3.0

Change-Id: I7cfe0c61c80a6b78625232135dd63393602d32fe
Signed-off-by: Krishna Sitaraman <ksitaraman@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoMerge pull request #881 from davidcunado-arm/dc/update_userguide
davidcunado-arm [Wed, 5 Apr 2017 21:02:55 +0000 (22:02 +0100)]
Merge pull request #881 from davidcunado-arm/dc/update_userguide

Upgrade mbed TLS version

7 years agoMerge pull request #877 from soby-mathew/sm/build_opt_checks
davidcunado-arm [Wed, 5 Apr 2017 21:02:19 +0000 (22:02 +0100)]
Merge pull request #877 from soby-mathew/sm/build_opt_checks

Include all makefiles before build option checks

7 years agoTegra186: trampoline: update "System Suspend" exit criteria
Varun Wadekar [Mon, 8 Aug 2016 18:53:14 +0000 (11:53 -0700)]
Tegra186: trampoline: update "System Suspend" exit criteria

The TZRAM memory loses its state during "System Suspend". This patch
check if TZRAM base address contains valid data, to decide if the system
is exiting from "System Suspend". To enable TZDRAM encryption, the Memory
Controller's TZDRAM base/size registers would be populated by the BPMP
when the system "wakes up".

Change-Id: I5fc8ba1ae3bce12f0ece493f6f9f5f4d92a46344
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: Add smc handler for coresight clock gating
Krishna Sitaraman [Tue, 19 Jul 2016 23:36:13 +0000 (16:36 -0700)]
Tegra186: Add smc handler for coresight clock gating

This change adds function to invoke for MISC_CCPLEX ARI calls and
the corresponding smc handler. This can be used to enable/disable
Coresight clock gating.

Change-Id: I4bc17aa478a46c29bfe17fd74f839a383ee2b644
Signed-off-by: Krishna Sitaraman <ksitaraman@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: save TZDRAM settings to secure scratch registers
Harvey Hsieh [Fri, 29 Jul 2016 12:10:59 +0000 (20:10 +0800)]
Tegra: memctrl_v2: save TZDRAM settings to secure scratch registers

Save TZDRAM settings for SC7 resume firmware to restore.

SECURITY_BOM:     MC_SECURITY_CFG0_0 = SECURE_RSV55_SCRATCH_0
SECURITY_BOM_HI:  MC_SECURITY_CFG3_0 = SECURE_RSV55_SCRATCH_1
SECURITY_SIZE_MB: MC_SECURITY_CFG1_0 = SECURE_RSV54_SCRATCH_1

Change-Id: I78e891d9ebf576ff2a17ff87cf3aff4030ee11b8
Signed-off-by: Harvey Hsieh <hhsieh@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: mce: fix return value for enum features ari
Krishna Sitaraman [Wed, 27 Jul 2016 23:26:45 +0000 (16:26 -0700)]
Tegra186: mce: fix return value for enum features ari

This patch fixes the incorrect return value that was being passed
back for the ENUM_FEATURES ARI call.

Change-Id: I3842c6ce27ea24698608830cf4c12cfa7ff64421
Signed-off-by: Krishna Sitaraman <ksitaraman@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: mce: clear reserved fields for ARI calls
Krishna Sitaraman [Thu, 28 Jul 2016 20:54:29 +0000 (13:54 -0700)]
Tegra186: mce: clear reserved fields for ARI calls

This patch clears the unused or reserved ARI input registers
before issuing the actual ARI command.

Change-Id: I454b86566bfe088049a5c63527c1323d7b25248a
Signed-off-by: Krishna Sitaraman <ksitaraman@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoMerge pull request #876 from soby-mathew/sm/refactor_header
davidcunado-arm [Wed, 5 Apr 2017 20:07:05 +0000 (21:07 +0100)]
Merge pull request #876 from soby-mathew/sm/refactor_header

Re-factor header files for easier PSCI library integration

7 years agoMerge pull request #884 from vwadekar/tegra186-platform-support-v3
davidcunado-arm [Wed, 5 Apr 2017 19:25:18 +0000 (20:25 +0100)]
Merge pull request #884 from vwadekar/tegra186-platform-support-v3

Tegra186 platform support v3

7 years agorockchip: Remove unused rockchip_pd_pwr_down_wfi function
Paul Kocialkowski [Tue, 4 Apr 2017 17:15:56 +0000 (19:15 +0200)]
rockchip: Remove unused rockchip_pd_pwr_down_wfi function

The rockchip_pd_pwr_down_wfi function is currently unused, which may
trigger compiler warnings or errors. Remove it.

Change-Id: I7e1b0ae092e8855528ac2065ecefc8bd45305f31
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
7 years agoFix ARM_BL31_IN_DRAM build
Douglas Raillard [Wed, 8 Mar 2017 16:49:31 +0000 (16:49 +0000)]
Fix ARM_BL31_IN_DRAM build

Some header files using the ULL() macro were not directly including
utils.h where the macro definition resides. As a consequence, a linker
script with values using this macro did not see the macro definition
and kept the "ULL(<value>)" call in the preprocessed file, which lead to
link error.

Files using ULL() macro now include utils.h directly.

Change-Id: I433a7f36bd21a156c20e69bc2a2bb406140ebdf9
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoMerge pull request #874 from dp-arm/dp/mbed-macros
davidcunado-arm [Fri, 31 Mar 2017 16:47:21 +0000 (17:47 +0100)]
Merge pull request #874 from dp-arm/dp/mbed-macros

mbedtls: Namespace TF specific macros

7 years agoJuno: Initialize stack protector canary from the trusted entropy source
dp-arm [Tue, 28 Feb 2017 14:43:15 +0000 (14:43 +0000)]
Juno: Initialize stack protector canary from the trusted entropy source

Change-Id: I7f3e4bfd46613c6311ba4015d56705414fd6feab
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
7 years agoJuno: Introduce juno_getentropy(void *buf, size_t len)
dp-arm [Mon, 27 Feb 2017 12:21:43 +0000 (12:21 +0000)]
Juno: Introduce juno_getentropy(void *buf, size_t len)

This function fills the buffer (first argument) with the specified
number of bytes (second argument) from the trusted entropy source.

This function will be used to initialize the stack protector canary.

Change-Id: Iff15aaf4778c13fa883ecb5528fcf9b8479d4489
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
7 years agoIntroduce MIN()/MAX() macros in utils.h
dp-arm [Tue, 21 Mar 2017 15:38:06 +0000 (15:38 +0000)]
Introduce MIN()/MAX() macros in utils.h

Change-Id: If88270bc9edb32634a793b1e1be6c4829f39b9c5
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
7 years agoAdd support for GCC stack protection
Douglas Raillard [Fri, 24 Feb 2017 18:14:15 +0000 (18:14 +0000)]
Add support for GCC stack protection

Introduce new build option ENABLE_STACK_PROTECTOR. It enables
compilation of all BL images with one of the GCC -fstack-protector-*
options.

A new platform function plat_get_stack_protector_canary() is introduced.
It returns a value that is used to initialize the canary for stack
corruption detection. Returning a random value will prevent an attacker
from predicting the value and greatly increase the effectiveness of the
protection.

A message is printed at the ERROR level when a stack corruption is
detected.

To be effective, the global data must be stored at an address
lower than the base of the stacks. Failure to do so would allow an
attacker to overwrite the canary as part of an attack which would void
the protection.

FVP implementation of plat_get_stack_protector_canary is weak as
there is no real source of entropy on the FVP. It therefore relies on a
timer's value, which could be predictable.

Change-Id: Icaaee96392733b721fa7c86a81d03660d3c1bc06
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoRemove dead loops in assert() in C and ASM
Antonio Nino Diaz [Thu, 16 Feb 2017 16:49:18 +0000 (16:49 +0000)]
Remove dead loops in assert() in C and ASM

The desired behaviour is to call `plat_panic_handler()`, and to use
`no_ret` to do so from ASM.

Change-Id: I88b2feefa6e6c8f9bf057fd51ee0d2e9fb551e4f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoFlush console where necessary
Antonio Nino Diaz [Thu, 16 Feb 2017 16:17:19 +0000 (16:17 +0000)]
Flush console where necessary

Call console_flush() before execution either terminates or leaves an
exception level.

Fixes: ARM-software/tf-issues#123
Change-Id: I64eeb92effb039f76937ce89f877b68e355588e3
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoAdd and use plat_crash_console_flush() API
Antonio Nino Diaz [Fri, 17 Feb 2017 17:11:27 +0000 (17:11 +0000)]
Add and use plat_crash_console_flush() API

This API makes sure that all the characters sent to the crash console
are output before returning from it.

Porting guide updated.

Change-Id: I1785f970a40f6aacfbe592b6a911b1f249bb2735
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoAdd console_core_flush() in upstream platforms
Antonio Nino Diaz [Wed, 8 Feb 2017 15:58:12 +0000 (15:58 +0000)]
Add console_core_flush() in upstream platforms

It is needed to add placeholders for this function because, as this is
not a `plat_xxx()` function, there aren't weak definitions of it in any
file.

If `console_flush()` is used and there isn't an implementation of
`console_core_flush()` in any file, the compilation will fail.

Change-Id: I50eb56d085c4c9fbc85d40c343e86af6412f3020
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoAdd console_flush() to console API
Antonio Nino Diaz [Mon, 6 Feb 2017 16:03:41 +0000 (16:03 +0000)]
Add console_flush() to console API

This function ensures that console output is flushed, for example
before shutting down or use by another component

In line with other console APIs, console_flush() wraps
console_core_flush().

Also implement console_core_flush() for PL011.

Change-Id: I3db365065e4de04a454a5c2ce21be335a23a01e4
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoTegra: memctrl_v2: get chip revision using platform identifiers
Varun Wadekar [Tue, 19 Jul 2016 00:43:41 +0000 (17:43 -0700)]
Tegra: memctrl_v2: get chip revision using platform identifiers

This patch switches to the functions which identify the underlying
platform in order to calculate the chip SKU.

Change-Id: I20cf5623465289ccfab28d6578efcf762bfeb456
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: mce: read MCE's firmware version on "real" platforms
Varun Wadekar [Tue, 19 Jul 2016 00:42:02 +0000 (17:42 -0700)]
Tegra186: mce: read MCE's firmware version on "real" platforms

This patch runs the MCE firmware's version check only if the underlying
platform has the capability to the run the firmware. MCE firmware is not
running on simulation platforms, identified by v0.3 or v0.6, read from the
Tegra Chip ID value.

Change-Id: I3b1788b1ee2a0d4464017bb879ac5792cb7022b8
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: use helper functions to get major/minor version
Varun Wadekar [Tue, 19 Jul 2016 18:29:40 +0000 (11:29 -0700)]
Tegra186: use helper functions to get major/minor version

This patch uses helper functions to read the chips's major and minor
version values.

Change-Id: I5b2530a31af5ab3778a8aa63380def4e9f9ee6ec
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: memmap all UART controllers
Varun Wadekar [Tue, 12 Jul 2016 17:04:28 +0000 (10:04 -0700)]
Tegra186: memmap all UART controllers

This patch adds all the UART controllers to the memory map.

Change-Id: I035e55ca7bff0a96115102f2295981f9e3a5da6b
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: implement plat_get_syscnt_freq2()
Varun Wadekar [Thu, 2 Jun 2016 21:26:13 +0000 (14:26 -0700)]
Tegra186: implement plat_get_syscnt_freq2()

Commit f3d3b316f82faa88e42f3d09c97cd9e52ac92599 replaced
plat_get_syscnt_freq by plat_get_syscnt_freq2 on all the
upstream platforms. This patch modifies the Tegra186 code
which is not present usptream, yet.

Change-Id: Ieda6168050a7769680a3a94513637fed03463a2d
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: smmu: disable TCU prefetch for all the 64 contexts
Varun Wadekar [Thu, 21 Apr 2016 00:14:15 +0000 (17:14 -0700)]
Tegra: smmu: disable TCU prefetch for all the 64 contexts

This patch disables TCU prefetch for all the contexts in order
to improve SMMU performance.

Change-Id: I82ca49a0e396d9f064f5c62a5f00c4b2101d8459
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: handlers to get BL31 arguments from previous bootloader
Varun Wadekar [Mon, 23 May 2016 18:47:34 +0000 (11:47 -0700)]
Tegra186: handlers to get BL31 arguments from previous bootloader

This patch overrides the default handlers to get BL31 arguments from the
previous bootloader. The previous bootloader stores the pointer to the
arguments in PMC secure scratch register #53.

BL31 is the first component running on the CPU, as there isn't a previous
bootloader. We set the RESET_TO_BL31 flag to enable the path which assumes
that there are no input parameters passed by the previous bootloader.

Change-Id: Idacc1df292a70c9c1cb4d5c3a774bd796175d5e8
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: delete 'Video Memory Carveout' handling
Varun Wadekar [Wed, 1 Jun 2016 19:48:13 +0000 (12:48 -0700)]
Tegra186: delete 'Video Memory Carveout' handling

This patch removes duplicate code from the platform's SiP handler
routine for processing Video Memory Carveout region requests and
uses the common SiP handler instead.

Change-Id: Ib307de017fd88d5ed3c816288327cae750a67806
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: TZRAM aperture configuration settings
Varun Wadekar [Wed, 25 May 2016 23:35:04 +0000 (16:35 -0700)]
Tegra: memctrl_v2: TZRAM aperture configuration settings

This patch enables the configuration settings for the TZRAM
aperture by programming the base/size of the aperture and
restricting access to it. We allow only the CPU to read/write
by programming the access configuration registers to 0.

Change-Id: Ie16ad29f4c5ec7aafa972b0a0230b4790ad5619e
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: modify the return type for `plat_get_syscnt_freq()`
Varun Wadekar [Fri, 29 Apr 2016 23:21:36 +0000 (16:21 -0700)]
Tegra186: modify the return type for `plat_get_syscnt_freq()`

Commit c073fda1c692d7c74415d26fb483d6336330fcc0 upstream changed the
return type for `plat_get_syscnt_freq()` from uint64_t to unsigned
long long.

This patch modifies the return type for the Tegra186 platform.

Change-Id: Ic9e5c364b90972265576e271582a4347e5eaa6eb
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: Enable ECC and Parity Protection for A02p SKUs
Varun Wadekar [Wed, 18 May 2016 20:39:16 +0000 (13:39 -0700)]
Tegra186: Enable ECC and Parity Protection for A02p SKUs

This patch enables ECC and Parity Protection for Cortex-A57 CPUs during boot,
for Tegra186 A02p SKUs.

Change-Id: I8522a6cb61f5e4fa9e0471f558a0c3ee8078370e
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: mce: Uncore Perfmon ARI Programming
Varun Wadekar [Fri, 29 Apr 2016 17:40:02 +0000 (10:40 -0700)]
Tegra186: mce: Uncore Perfmon ARI Programming

Uncore perfmon appears to the CPU as a set of uncore perfmon registers
which can be read and written using the ARI interface. The MCE code
sequence handles reads and writes to these registers by manipulating
the underlying T186 uncore hardware.

To access an uncore perfmon register, CPU software writes the ARI
request registers to specify

* whether the operation is a read or a write,
* which uncore perfmon register to access,
* the uncore perfmon unit, group, and counter number (if necessary),
* the data to write (if the operation is a write).

It then initiates an ARI request to run the uncore perfmon sequence in
the MCE and reads the resulting value of the uncore perfmon register
and any status information from the ARI response registers.

The NS world's MCE driver issues MCE_CMD_UNCORE_PERFMON_REQ command
for the EL3 layer to start the entire sequence. Once the request
completes, the NS world would receive the command status in the X0
register and the command data in the X1 register.

Change-Id: I20bf2eca2385f7c8baa81e9445617ae711ecceea
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: implement `get_target_pwr_state` handler
Varun Wadekar [Sat, 9 Apr 2016 07:36:42 +0000 (00:36 -0700)]
Tegra186: implement `get_target_pwr_state` handler

This patch implements the `get_target_pwr_state` handler for Tegra186
SoCs. The SoC port uses this handler to find out the cluster/system
state during CPU_SUSPEND, CPU_OFF and SYSTEM_SUSPEND calls.

The MCE firmware controls the power state of the CPU/CLuster/System,
so we query it to get the state and act accordingly.

Change-Id: I86633d8d79aec7dcb405d2301ac69910f93110fe
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: mce: add the mce_update_cstate_info() helper function
Varun Wadekar [Fri, 24 Mar 2017 00:32:20 +0000 (17:32 -0700)]
Tegra186: mce: add the mce_update_cstate_info() helper function

This patch adds a helper function to the MCE driver to allow its
clients to issue UPDATE_CSTATE_INFO requests, without having to
setup the CPU context struct.

We introduced a struct to encapsulate the request parameters, that
clients can pass on to the MCE driver. The MCE driver gets the
parameters from the struct and programs the hardware accordingly.

Change-Id: I02bce57506c4ccd90da82127805d6b564375cbf1
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoMerge pull request #875 from vwadekar/tegra186-platform-support-v2
davidcunado-arm [Thu, 30 Mar 2017 20:43:56 +0000 (21:43 +0100)]
Merge pull request #875 from vwadekar/tegra186-platform-support-v2

Tegra186 platform support v2

7 years agoEnable all A53 and A57 errata workarounds for Juno
Douglas Raillard [Tue, 28 Feb 2017 17:56:15 +0000 (17:56 +0000)]
Enable all A53 and A57 errata workarounds for Juno

Juno platform Makefile is responsible for enabling all the relevant
errata. As the Juno platform port does not know which revision of Juno
the TF
is compiled for, the revision of the cores are unknown and so all errata
up to this date are needed on at least one revision of Juno.

Change-Id: I38e1d6efc17e703f2bd55e0714f8d8fa4778f696
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoMerge pull request #880 from Summer-ARM/sq/tcr-memory-attribution
davidcunado-arm [Wed, 29 Mar 2017 16:54:54 +0000 (17:54 +0100)]
Merge pull request #880 from Summer-ARM/sq/tcr-memory-attribution

Add support to change xlat_tables to non-cacheable

7 years agoUpgrade mbed TLS version
David Cunado [Wed, 29 Mar 2017 08:41:39 +0000 (09:41 +0100)]
Upgrade mbed TLS version

This patch updates the User Guide to recommend the latest version
of mbed TLS library to use with ARM Trusted Firmware.

 - Upgrade mbed TLS library:   2.2.1 -> 2.4.2

Change-Id: Ifb5386fec0673d6dbfdaa474233e397afc279c85

7 years agoMerge pull request #870 from douglas-raillard-arm/dr/remove_asm_signed_test
davidcunado-arm [Wed, 29 Mar 2017 08:58:20 +0000 (09:58 +0100)]
Merge pull request #870 from douglas-raillard-arm/dr/remove_asm_signed_test

Replace ASM signed tests with unsigned

7 years agoMerge pull request #879 from Summer-ARM/sq/mt-support
davidcunado-arm [Tue, 28 Mar 2017 17:15:20 +0000 (18:15 +0100)]
Merge pull request #879 from Summer-ARM/sq/mt-support

ARM platforms: Add support for MT bit in MPIDR

7 years agoMerge pull request #878 from vwadekar/tegra-memctrlv2-coverity-fix
davidcunado-arm [Tue, 28 Mar 2017 16:40:40 +0000 (17:40 +0100)]
Merge pull request #878 from vwadekar/tegra-memctrlv2-coverity-fix

Tegra: memctrl_v2: fix logic to calculate TZRAM_ADDR_HI bits

7 years agoAdd support to change xlat_tables to non-cacheable
Summer Qin [Thu, 16 Mar 2017 17:16:34 +0000 (17:16 +0000)]
Add support to change xlat_tables to non-cacheable

This patch adds an additional flag `XLAT_TABLE_NC` which marks the
translation tables as Non-cacheable for MMU accesses.

Change-Id: I7c28ab87f0ce67da237fadc3627beb6792860fd4
Signed-off-by: Summer Qin <summer.qin@arm.com>
7 years agoTegra186: reset CPU power state info while onlining
Varun Wadekar [Fri, 29 Apr 2016 18:25:46 +0000 (11:25 -0700)]
Tegra186: reset CPU power state info while onlining

This patch resets the CPU power state info when we online any CPU. The
NS world software would re-init the CPU power state after the CPU gets
online anyways. This allows us to maintain proper CPU/cluster power
states in the MCE firmware at all times.

Change-Id: Ib24054f53df720a4f88d67b2cb5a2e036e475e14
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: fix recursion in included headers (tegra_def.h/platform_def.h)
Varun Wadekar [Tue, 26 Apr 2016 18:34:54 +0000 (11:34 -0700)]
Tegra186: fix recursion in included headers (tegra_def.h/platform_def.h)

This patch fixes the "Recursion in included headers" error flagged by
Coverity.

Fixes coverity errors "31858: Recursion in included headers" and
"31857: Recursion in included headers"

Change-Id: Icf8838434b1808b396e743e47f59adc452546364
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: fix logic to calculate TZRAM_ADDR_HI bits
Varun Wadekar [Tue, 26 Apr 2016 18:14:46 +0000 (11:14 -0700)]
Tegra: memctrl_v2: fix logic to calculate TZRAM_ADDR_HI bits

This patch fixes the logic to calculate the higher bits for TZRAM's base/end
addresses.

Fixes coverity error "31853: Wrong operator used (CONSTANT_EXPRESSION_RESULT)"

Change-Id: Iff62ef18cba59cd41ad63a5c71664872728356a8
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoInclude all makefiles before build option checks
Soby Mathew [Tue, 14 Feb 2017 10:05:07 +0000 (10:05 +0000)]
Include all makefiles before build option checks

At present, the build option checks are done prior to inclusion of
BL makefiles. This meant if the BL makefiles modified any of the options
then these checks were bypassed. This patch corrects this problem.

Change-Id: I0b591392a74d6d456d2b19bbe292f42b5aeae048
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoRe-factor header files for easier PSCI library integration
Soby Mathew [Mon, 13 Feb 2017 12:46:28 +0000 (12:46 +0000)]
Re-factor header files for easier PSCI library integration

This patch re-factors the following headers to make it easier to
integrate the PSCI library with an AArch32 Secure Payload :

  *  bl_common.h : The entry point information and the param
     header data structures are factored out into separate
     headers ep_info.h and param_headers.h
  *  psci.h : The PSCI library interfaces are factored out
     into the new header psci_lib.h
  *  context_mgmt.h : The header file is modified to not include
     arch.h when compiled for AArch32 mode.

No functional changes are introduced by this patch.

Change-Id: I5e21a843c0af2ba8e47dee4e577cf95929be8cd4
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
7 years agoARM platforms: Add support for MT bit in MPIDR
Summer Qin [Tue, 28 Feb 2017 16:46:17 +0000 (16:46 +0000)]
ARM platforms: Add support for MT bit in MPIDR

This patch modifies some of the functions in ARM platform layer to cater
for the case when multi-threading `MT` is set in MPIDR. A new build flag
`ARM_PLAT_MT` is added, and when enabled, the functions accessing MPIDR
now assume that the `MT` bit is set for the platform and access the bit
fields accordingly.

Also, a new API plat_arm_get_cpu_pe_count is added when `ARM_PLAT_MT` is
enabled, returning the PE count within the physical cpu corresponding to
`mpidr`.

Change-Id: I04ccf212ac3054a60882761f4087bae299af13cb
Signed-off-by: Summer Qin <summer.qin@arm.com>
7 years agoMerge pull request #873 from dp-arm/dp/makefile-reorg
davidcunado-arm [Mon, 27 Mar 2017 10:44:05 +0000 (11:44 +0100)]
Merge pull request #873 from dp-arm/dp/makefile-reorg

Move plat/common source file definitions to generic Makefiles

7 years agoMerge pull request #872 from dp-arm/dp/fix-typo
davidcunado-arm [Fri, 24 Mar 2017 22:53:50 +0000 (22:53 +0000)]
Merge pull request #872 from dp-arm/dp/fix-typo

firmware-design: Fix typo in ToC header flags specification

7 years agoTegra: memctrl_v2: program Video Memory carveout size in MBs
Varun Wadekar [Mon, 25 Apr 2016 16:01:46 +0000 (09:01 -0700)]
Tegra: memctrl_v2: program Video Memory carveout size in MBs

This patch fixes the programming logic for the Video memory carveout's
size. The Memory Controller expects the size in terms of MBs instead
of bytes.

Change-Id: Ia8261b737448bae9a435fe21ab336126785d4279
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: no stream ID override for Security Engine
Varun Wadekar [Tue, 19 Apr 2016 21:22:13 +0000 (14:22 -0700)]
Tegra: memctrl_v2: no stream ID override for Security Engine

This patch removes stream ID override for the Security Engine
hardware block as its stream ID is programmed by the NS world
driver.

Original change by Mallikarjun Kasoju <mkasoju@nvidia.com>

Change-Id: Ia6523c1a1bb0a82bdeb878feb55670813899bdac
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: reset power state info during CPU_ON
Varun Wadekar [Sat, 9 Apr 2016 07:40:45 +0000 (00:40 -0700)]
Tegra186: reset power state info during CPU_ON

This patch resets the power state info for CPUs when onlining,
as we set deepest power when offlining a core but that may not
be requested by non-secure sw which controls idle states. It
will re-init this info from non-secure software when the core
come online.

Original change by Prashant Gaikwad <pgaikwad@nvidia.com>

Change-Id: Id6c2fa2b821c7705aafbb561a62348c36fd3abd8
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: enable support for simulation environment
Varun Wadekar [Sat, 2 Apr 2016 22:41:20 +0000 (15:41 -0700)]
Tegra186: enable support for simulation environment

The Tegra simulation environment has limited capabilities. This patch
checks the chip's major and minor versions to decide the features to
enable/disable - MCE firmware version checking is disabled and limited
Memory Controller settings are enabled

Change-Id: I258a807cc3b83cdff14a9975b4ab4f9d1a9d7dcf
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: check MCE firmware version during boot
Varun Wadekar [Mon, 28 Mar 2016 23:00:02 +0000 (16:00 -0700)]
Tegra186: check MCE firmware version during boot

This patch checks that the system is running with the supported MCE
firmware during boot. In case the firmware version does not match the
interface header version, then the system halts.

Change-Id: Ib82013fd1c1668efd6f0e4f36cd3662d339ac076
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: fix programming sequence for SC7/SC8 entry
Varun Wadekar [Mon, 28 Mar 2016 22:11:43 +0000 (15:11 -0700)]
Tegra186: fix programming sequence for SC7/SC8 entry

This patch fixes the programming sequence for 'System Suspend' and
'Quasi power down' state entry. The device needs to update the
required power state before querying the MCE firmware to see the
entry to that power state is allowed.

Original change by Allen Yu <alleny@nvidia.com>

Change-Id: I65e03754322188af913fabf41f29d1c3595afd85
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: program default core wake mask during CPU_SUSPEND
Varun Wadekar [Mon, 28 Mar 2016 22:05:03 +0000 (15:05 -0700)]
Tegra186: program default core wake mask during CPU_SUSPEND

This patch programs the default CPU wake mask during CPU_SUSPEND. This
reduces the CPU_SUSPEND latency as the system has to send one less SMC
before issuing the actual suspend request.

Original change by Krishna Sitaraman <ksitaraman@nvidia.com>

Change-Id: I1f9351dde4ab30936070e9f42c2882fa691cbe46
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: clear the system cstate for offline core
Varun Wadekar [Mon, 28 Mar 2016 21:43:03 +0000 (14:43 -0700)]
Tegra186: clear the system cstate for offline core

This patch clears the system cstate when offlining a CPU core as we
need to update the sytem cstate to SC7 only when we enter system
suspend.

Original change by Prashant Gaikwad <pgaikwad@nvidia.com>

Change-Id: I1cff9bbab4db7d390a491c8939aea5db6c6b5c59
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: enable APE overrides for chip verification
Varun Wadekar [Mon, 28 Mar 2016 21:28:09 +0000 (14:28 -0700)]
Tegra: memctrl_v2: enable APE overrides for chip verification

This patch enables overrides for APE domains to allow the chip verification
software harness (MODS) to execute its test cases.

Original change by Harvey Hsieh <hhsieh@nvidia.com>

Change-Id: I09b22376068c5b65d89c2a53154ccb2c60d955bd
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: mce: enable LATIC for chip verification
Varun Wadekar [Mon, 28 Mar 2016 20:44:35 +0000 (13:44 -0700)]
Tegra186: mce: enable LATIC for chip verification

This patch adds a new interface to allow for making an ARI call that
will enable LATIC for the chip verification software harness.

LATIC allows some MINI ISMs to be read in the CCPLEX. The ISMs are
used for various measurements relevant ot particular locations in
Silicon. They are small counters which can be polled to determine
how fast a particular location in the Silicon is.

Original change by Guy Sotomayor <gsotomayor@nvidia.com>

Change-Id: Ifb49b8863a009d4cdd5d1ba38a23b5374500a4b3
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: save/restore BL31 context to/from TZDRAM
Varun Wadekar [Fri, 18 Mar 2016 20:07:33 +0000 (13:07 -0700)]
Tegra186: save/restore BL31 context to/from TZDRAM

This patch adds support to save the BL31 state to the TZDRAM
before entering system suspend. The TZRAM loses state during
system suspend and so we need to copy the entire BL31 code to
TZDRAM before entering the state.

In order to restore the state on exiting system suspend, a new
CPU reset handler is implemented which gets copied to TZDRAM
during boot. TO keep things simple we use this same reset handler
for booting secondary CPUs too.

Change-Id: I770f799c255d22279b5cdb9b4d587d3a4c54fad7
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: re-configure MSS' client settings
Varun Wadekar [Sat, 12 Mar 2016 01:18:51 +0000 (17:18 -0800)]
Tegra186: re-configure MSS' client settings

This patch reprograms MSS to make ROC deal with ordering of
MC traffic after boot and system suspend exit. This is needed
as device boots with MSS having all control but POR wants ROC
to deal with the ordering. Performance is expected to improve
with ROC but since no one has really tested the performance,
keep the option configurable for now by introducing a platform
level makefile variable.

Change-Id: I2e782fea138ccf9d281eb043a6b2c3bb97c839a7
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoMerge pull request #865 from vwadekar/tegra186-platform-support-v1
davidcunado-arm [Thu, 23 Mar 2017 14:03:09 +0000 (14:03 +0000)]
Merge pull request #865 from vwadekar/tegra186-platform-support-v1

Tegra186 platform support v1

7 years agoTegra186: implement support for System Suspend
Varun Wadekar [Thu, 3 Mar 2016 21:52:52 +0000 (13:52 -0800)]
Tegra186: implement support for System Suspend

This patch adds the chip level support for System Suspend entry
and exit. As part of the entry sequence we first query the MCE
firmware to check if it is safe to enter system suspend. Once
we get a green light, we save hardware block settings and enter
the power state. As expected, all the hardware settings are
restored once we exit the power state.

Change-Id: I6d192d7568d6a555eb10efdfd45f6d79c20f74ea
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: memctrl_v2: restore video memory settings
Varun Wadekar [Thu, 3 Mar 2016 21:22:39 +0000 (13:22 -0800)]
Tegra186: memctrl_v2: restore video memory settings

The memory controller loses its settings when the device enters system
suspend state.

This patch adds a handler to restore the Video Memory settings in the
memory controller, which would be called after exiting the system suspend
state.

Change-Id: I1ac12426d7290ac1452983d3c9e05fabbf3327fa
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: smmu: driver for the smmu hardware block
Varun Wadekar [Thu, 3 Mar 2016 21:09:08 +0000 (13:09 -0800)]
Tegra186: smmu: driver for the smmu hardware block

This patch adds a device driver for the SMMU hardware block on
Tegra186 SoCs. We use the generic ARM SMMU-500 IP block on
Tegra186. The driver only supports saving the SMMU settings
before entering system suspend. The MC driver and the NS world
clients take care of programming their own settings.

Change-Id: Iab5a90310ee10f6bc8745451ce50952ab3de7188
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agombedtls: Namespace TF specific macros
dp-arm [Tue, 7 Mar 2017 10:08:42 +0000 (10:08 +0000)]
mbedtls: Namespace TF specific macros

These macros are not part of mbed TLS so they should not be prefixed
with `MBEDTLS_` to avoid potential collision in the future. Use the
`TBBR_` suffix to highlight that they only used in TF.

`MBEDTLS_KEY_ALG` was not modified because that is documented and used
by platforms to select the key algorithm.

Change-Id: Ief224681715c481691c80810501830ce16e210b0
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
7 years agoTegra: replace ASM signed tests with unsigned
Douglas Raillard [Mon, 20 Mar 2017 10:38:29 +0000 (10:38 +0000)]
Tegra: replace ASM signed tests with unsigned

Replace the occurrences of signed condition codes where it was
unnecessary by an unsigned test as the unsigned tests allow the full
range of unsigned values to be used without inverting the result with
some large operands.

This reverts commit ee2c909947e0a9c4a2562689a7bfc863bc4794f9.

Change-Id: Ibaa5e8dfae6ad65bada3cda5f683d181fee37e53
Acked-by: Varun Wadekar <vwadekar@nvidia.com>
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoTegra186: implement quasi power off (SC8) state
Varun Wadekar [Mon, 29 Feb 2016 18:24:30 +0000 (10:24 -0800)]
Tegra186: implement quasi power off (SC8) state

This patch adds support for the SC8 system power off state. This
state keeps the sensor subsystem powered ON while powering down
the remaining parts of the SoC. The CPUs and DRAM are powered down
as part of this state entry and perform a cold boot when exiting SC8.

Change-Id: Iba65c661a7fe077a0d696f114bab3b4595e19a0d
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: disable DCO operations for PSCI_CPU_OFF
Varun Wadekar [Fri, 26 Feb 2016 19:09:21 +0000 (11:09 -0800)]
Tegra186: disable DCO operations for PSCI_CPU_OFF

This patch disables the DCO operations when we turn OFF a
CPU. DCO operations are still ON when a CPU enters a power
down suspend state.

Change-Id: I954a800209ffcc9ab43a77f04040608cbbbd9055
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: register FIQ interrupt sources
Varun Wadekar [Tue, 29 Dec 2015 02:12:59 +0000 (18:12 -0800)]
Tegra186: register FIQ interrupt sources

This patch registers all the FIQ interrupt sources during platform
setup. Currently we support AON and TOP watchdog timer interrupts.

Change-Id: Ibccd866f00d6b08b574f765538525f95b49c5549
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: set NO_OVERRIDE for APE clients
Varun Wadekar [Wed, 17 Feb 2016 23:31:25 +0000 (15:31 -0800)]
Tegra: memctrl_v2: set NO_OVERRIDE for APE clients

For all APE clients (APER, APEW, APEDMAR, APEDMAW) set NO_OVERRIDE
for MC_SID_CFG as ACAST/ADAST will be setup with the required SIDs
ie. 0x7F & 0x1E.

Original change by Nitin Kumbhar <nkumbhar@nvidia.com>

Change-Id: Idec981b3537cc95dac6ec37cdaa38bc45b16d232
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: implement MC txn override WAR
Varun Wadekar [Wed, 17 Feb 2016 23:07:49 +0000 (15:07 -0800)]
Tegra: memctrl_v2: implement MC txn override WAR

This patch sets the Memory Controller's TXN_OVERRIDE registers
for most write clients to CGID_ADR. This ensures ordering is maintained.
In some cases WAW ordering problems could occur. There are different
settings for Tegra version A01 v A02.

Original changes by Alex Waterman <alexw@nvidia.com>

Change-Id: I82ea02afa43a24250ed56985757b83e78e71178c
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: check GPU state before VPR programming
Varun Wadekar [Wed, 17 Feb 2016 18:10:50 +0000 (10:10 -0800)]
Tegra: memctrl_v2: check GPU state before VPR programming

The GPU is the real consumer of the video protected memory region
and it needs to be in reset to pick up the new region.

This patch checks if the GPU is in reset before we program the new
video protected memory region settings.

Change-Id: I44f553bfcf07b1975abad53b245954be966c8aeb
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: no SID override for SCE block
Varun Wadekar [Wed, 17 Feb 2016 18:01:28 +0000 (10:01 -0800)]
Tegra: memctrl_v2: no SID override for SCE block

This patch fixes the incorrect override settings for the SCE
hardware block.

Original change by Pekka Pessi <ppessi@nvidia.com>

Change-Id: I33db55d6004331988b52ca70157aab1409f4829f
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: fix per-cpu wake times for CPU power states
Varun Wadekar [Tue, 9 Feb 2016 22:55:44 +0000 (14:55 -0800)]
Tegra186: fix per-cpu wake times for CPU power states

This patch fixes the logic used to calculate the CPU index for
storing the per-cpu wake times. We use the MIDR register to
calculate the CPU index now. This allows us to store values for
Denver/A57 CPUs properly.

Change-Id: I9df0377afd4b92bbdaea495c0df06a9780a99d09
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: add Video memory carveout settings
Varun Wadekar [Wed, 3 Feb 2016 17:51:25 +0000 (09:51 -0800)]
Tegra186: add Video memory carveout settings

This patch supports the TEGRA_SIP_NEW_VIDEOMEM_REGION SiP call to
program new video memory carveout settings from the NS world.

Change-Id: If9ed818fe71e6cb7461f225090105a4d8883b7a2
Signed-off-by: Wayne Lin <wlin@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: support for C6/C7 CPU_SUSPEND states
Varun Wadekar [Tue, 19 Jan 2016 03:03:19 +0000 (19:03 -0800)]
Tegra186: support for C6/C7 CPU_SUSPEND states

This patch adds support for the C6 and C7 CPU_SUSPEND states. C6 is
an idle state while C7 is a powerdown state.

The MCE block takes care of the entry/exit to/from these core power
states and hence we call the corresponding MCE handler to process
these requests. The NS driver passes the tentative time that the
core is expected to stay in this state as part of the power_state
parameter, which we store in a per-cpu array and pass it to the
MCE block.

Change-Id: I152acb11ab93d91fb866da2129b1795843dfa39b
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: secure the on-chip TZSRAM memory
Varun Wadekar [Wed, 30 Dec 2015 23:15:08 +0000 (15:15 -0800)]
Tegra: memctrl_v2: secure the on-chip TZSRAM memory

This patch programs the Memory controller's control registers
to disable non-secure accesses to the TZRAM. In case these
registers are already programmed by the BL2/BL30, then the
driver just bails out.

Change-Id: Ia1416988050e3d067296373060c717a260499122
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: support for the latest platform port handlers
Varun Wadekar [Sat, 9 Jan 2016 01:38:51 +0000 (17:38 -0800)]
Tegra186: support for the latest platform port handlers

This patch adds support for the newer platform handler functions. Commit
I6db74b020b141048b6b8c03e1bef7ed8f72fd75b merges the upstream code which
has already moved all the upstream supported platforms over to these
handler functions.

Change-Id: I621eff038f3c0dc1b90793edcd4dd7c71b196045
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: implement prepare_system_reset handler
Varun Wadekar [Thu, 7 Jan 2016 22:36:12 +0000 (14:36 -0800)]
Tegra186: implement prepare_system_reset handler

This patch implements the 'prepare_system_reset' handler to
issue the 'system reset' command to the MCE.

Change-Id: I83d8d0b4167aac5963d640fe77d5754dc7ef05b1
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: implement CPU_OFF handler
Varun Wadekar [Tue, 5 Jan 2016 23:17:41 +0000 (15:17 -0800)]
Tegra186: implement CPU_OFF handler

This patch implements the CPU_OFF handler for powering down
a CPU using the MCE driver.

Change-Id: I8d455005d0b547cc61cc7778bfe9eb84b7e5480c
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>