project/bcm63xx/atf.git
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 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 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 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 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>
7 years agoTegra186: update SYSCNT_FREQ to 31.25MHz
Varun Wadekar [Mon, 4 Jan 2016 18:57:45 +0000 (10:57 -0800)]
Tegra186: update SYSCNT_FREQ to 31.25MHz

The System Counter Frequency has been updated to 31.25MHz after
some experiments as the previous value was too high.

Change-Id: I79986ee1c0c88700a3a2b1dbff2d3f00c0c412b9
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: relocate bl31.bin to the SYSRAM
Varun Wadekar [Mon, 30 Nov 2015 20:05:04 +0000 (12:05 -0800)]
Tegra186: relocate bl31.bin to the SYSRAM

Tegra186 has an on-die, 320KB, "System RAM" memory. Out of the total
size, 256KB are allocated for the CPU TrustZone binaries - EL3 monitor
and Trusted OS.

This patch changes the base address for bl31.bin to the SysRAM base
address. The carveout is too small for the Trusted OS, so we relocate
only the monitor binary.

Change-Id: Ib4b667ff2a7a619589851338f9d0bfb02078c575
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: implement prepare_system_off handler
Varun Wadekar [Tue, 14 Mar 2017 21:25:35 +0000 (14:25 -0700)]
Tegra186: implement prepare_system_off handler

This patch issues the 'System Off' ARI to power off the entire
system from the 'prepare_system_off' handler.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: power on/off secondary CPUs
Varun Wadekar [Mon, 14 Sep 2015 04:01:39 +0000 (09:31 +0530)]
Tegra186: power on/off secondary CPUs

This patch add code to power on/off the secondary CPUs on the Tegra186
chip. The MCE block is the actual hardware that takes care of the
power on/off sequence. We pass the constructed CPU #, depending on the
MIDR_IMPL field, to the MCE CPU handlers.

This patch also programs the reset vector addresses to allow the
CPUs to power on through the monitor and then jump to the linux
world.

Change-Id: Idc164586cda91c2009d66f3e09bf4464de9662db
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: SiP calls to interact with the MCE driver
Varun Wadekar [Wed, 9 Sep 2015 06:03:08 +0000 (11:33 +0530)]
Tegra186: SiP calls to interact with the MCE driver

This patch adds the new SiP SMC calls to allow the NS world to
interact with the MCE hardware block on Tegra186 chips.

Change-Id: I79c6b9f76d68a87abd57a940613ec070562d2eac
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: mce: driver for the CPU complex power manager block
Varun Wadekar [Tue, 14 Mar 2017 21:24:35 +0000 (14:24 -0700)]
Tegra186: mce: driver for the CPU complex power manager block

The CPU Complex (CCPLEX) Power Manager (Denver MCE, or DMCE) is an
offload engine for BPMP to do voltage related sequencing and for
hardware requests to be handled in a better latency than BPMP-firmware.

There are two interfaces to the MCEs - Abstract Request Interface (ARI)
and the traditional NVGINDEX/NVGDATA interface.

MCE supports various commands which can be used by CPUs - ARM as well
as Denver, for power management and reset functionality. Since the
linux kernel is the master for all these scenarios, each MCE command
can be issued by a corresponding SMC. These SMCs have been moved to
SiP SMC space as they are specific to the Tegra186 SoC.

Change-Id: I67bee83d2289a8ab63bc5556e5744e5043803e51
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra186: platform support for Tegra "T186" SoC
Varun Wadekar [Tue, 25 Aug 2015 11:33:14 +0000 (17:03 +0530)]
Tegra186: platform support for Tegra "T186" SoC

Tegra186 is the newest SoC in the Tegra family which consists
of two CPU clusters - Denver and A57. The Denver cluster hosts
two next gen Denver15 CPUs while the A57 cluster hosts four ARM
Cortex-A57 CPUs. Unlike previous Tegra generations, all the six
cores on this SoC would be available to the system at the same
time and individual clusters can be powered down to conserve
power.

Change-Id: Id0c9919dbf5186d2938603e0b11e821b5892985e
Signed-off-by: Wayne Lin <wlin@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: memctrl_v2: Memory Controller Driver (v2)
Varun Wadekar [Sun, 20 Sep 2015 09:38:22 +0000 (15:08 +0530)]
Tegra: memctrl_v2: Memory Controller Driver (v2)

This patch adds driver for the Memory Controller (v2) in the newer
Tegra SoCs. The newer hardware uses ARM's SMMU hardware instead of
the proprietary block in the past.

Change-Id: I78359da780dc840213b6e99954e45e34428d4fff
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: public interfaces to get the chip's major/minor versions
Varun Wadekar [Fri, 10 Mar 2017 17:53:37 +0000 (09:53 -0800)]
Tegra: public interfaces to get the chip's major/minor versions

This patch opens up the interfaces to read the chip's major/minor versions
for all Tegra drivers to use.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoMove plat/common source file definitions to generic Makefiles
dp-arm [Tue, 7 Mar 2017 11:02:47 +0000 (11:02 +0000)]
Move plat/common source file definitions to generic Makefiles

These source file definitions should be defined in generic
Makefiles so that all platforms can benefit. Ensure that the
symbols are properly marked as weak so they can be overridden
by platforms.

NOTE: This change is a potential compatibility break for
non-upstream platforms.

Change-Id: I7b892efa9f2d6d216931360dc6c436e1d10cffed
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
7 years agofirmware-design: Fix typo in ToC header flags specification
dp-arm [Thu, 16 Mar 2017 09:31:35 +0000 (09:31 +0000)]
firmware-design: Fix typo in ToC header flags specification

Fixes ARM-software/tf-issues#463

Change-Id: I73e0c5fbd87004953df8b1fa19319ad562ecc867
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
7 years agoMerge pull request #857 from Andre-ARM/a53-855873
davidcunado-arm [Mon, 20 Mar 2017 12:25:08 +0000 (12:25 +0000)]
Merge pull request #857 from Andre-ARM/a53-855873

ARM Cortex-A53 erratum 855873 workaround

7 years agoplat/tegra: Enable Cortex-A53 erratum 855873 workaround
Andre Przywara [Mon, 7 Nov 2016 10:53:14 +0000 (10:53 +0000)]
plat/tegra: Enable Cortex-A53 erratum 855873 workaround

The NVidia Tegra 210 SoC contains Cortex-A53 CPUs which are affected by
erratum 855873.

Enable the workaround that TF provides to fix this erratum.

Change-Id: I6cef4ac60ae745e9ce299ee22c93b9d2c4f6c5f2
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
7 years agoplat/mediatek: Enable Cortex-A53 erratum 855873 workaround
Andre Przywara [Mon, 7 Nov 2016 10:53:14 +0000 (10:53 +0000)]
plat/mediatek: Enable Cortex-A53 erratum 855873 workaround

The Mediatek 8173 SoC contains Cortex-A53 CPUs which are affected by
erratum 855873.

Enable the workaround that TF provides to fix this erratum.

Change-Id: I6e1c7822c320d81bdd46b8942d1d755883dac1f5
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
7 years agoAdd workaround for ARM Cortex-A53 erratum 855873
Andre Przywara [Thu, 6 Oct 2016 15:54:53 +0000 (16:54 +0100)]
Add workaround for ARM Cortex-A53 erratum 855873

ARM erratum 855873 applies to all Cortex-A53 CPUs.
The recommended workaround is to promote "data cache clean"
instructions to "data cache clean and invalidate" instructions.
For core revisions of r0p3 and later this can be done by setting a bit
in the CPUACTLR_EL1 register, so that hardware takes care of the promotion.
As CPUACTLR_EL1 is both IMPLEMENTATION DEFINED and can be trapped to EL3,
we set the bit in firmware.
Also we dump this register upon crashing to provide more debug
information.

Enable the workaround for the Juno boards.

Change-Id: I3840114291958a406574ab6c49b01a9d9847fec8
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
7 years agoReplace ASM signed tests with unsigned
Douglas Raillard [Tue, 7 Mar 2017 16:36:14 +0000 (16:36 +0000)]
Replace ASM signed tests with unsigned

ge, lt, gt and le condition codes in assembly provide a signed test
whereas hs, lo, hi and ls provide the unsigned counterpart. Signed tests
should only be used when strictly necessary, as using them on logically
unsigned values can lead to inverting the test for high enough values.
All offsets, addresses and usually counters are actually unsigned
values, and should be tested as such.

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.

Change-Id: I58b7e98d03e3a4476dfb45230311f296d224980a
Signed-off-by: Douglas Raillard <douglas.raillard@arm.com>
7 years agoMerge pull request #861 from soby-mathew/sm/aarch32_fixes
davidcunado-arm [Sat, 18 Mar 2017 12:16:27 +0000 (12:16 +0000)]
Merge pull request #861 from soby-mathew/sm/aarch32_fixes

Misc AArch32 fixes

7 years agoMerge pull request #858 from soby-mathew/sm/gic_driver_data_fix
davidcunado-arm [Fri, 17 Mar 2017 13:31:05 +0000 (13:31 +0000)]
Merge pull request #858 from soby-mathew/sm/gic_driver_data_fix

Flush the GIC driver data after init

7 years agoMerge pull request #860 from jeenu-arm/hw-asstd-coh
davidcunado-arm [Fri, 17 Mar 2017 12:34:37 +0000 (12:34 +0000)]
Merge pull request #860 from jeenu-arm/hw-asstd-coh

Patches for platforms with hardware-assisted coherency

7 years agoMerge pull request #856 from antonio-nino-diaz-arm/an/dynamic-xlat
davidcunado-arm [Thu, 16 Mar 2017 12:42:32 +0000 (12:42 +0000)]
Merge pull request #856 from antonio-nino-diaz-arm/an/dynamic-xlat

Introduce version 2 of the translation tables library

7 years agoMerge pull request #864 from vwadekar/enable-errata-tegra210
davidcunado-arm [Fri, 10 Mar 2017 13:21:09 +0000 (14:21 +0100)]
Merge pull request #864 from vwadekar/enable-errata-tegra210

Tegra210: enable errata for Cortex-A57 and Cortex-A53 CPUs

7 years agoMerge pull request #862 from vwadekar/spd-trusty-tlkd-changes
davidcunado-arm [Thu, 9 Mar 2017 09:39:00 +0000 (10:39 +0100)]
Merge pull request #862 from vwadekar/spd-trusty-tlkd-changes

SPD changes for Trusty and TLKD

7 years agoARM platforms: Enable xlat tables lib v2
Antonio Nino Diaz [Thu, 23 Feb 2017 17:22:58 +0000 (17:22 +0000)]
ARM platforms: Enable xlat tables lib v2

Modify ARM common makefile to use version 2 of the translation tables
library and include the new header in C files.

Simplify header dependencies related to this library to simplify the
change.

The following table contains information about the size increase in
bytes for BL1 after applying this patch. The code has been compiled for
different configurations of FVP in AArch64 mode with compiler GCC 4.9.3
20150413. The sizes have been calculated with the output of `nm` by
adding the size of all regions and comparing the total size before and
after the change. They are sumarized in the table below:

                               text   bss   data  total
        Release                +660   -20    +88   +728
        Debug                  +740   -20   +242   +962
        Debug (LOG_LEVEL=50)  +1120   -20   +317  +1417

Change-Id: I539e307f158ab71e3a8b771640001fc1bf431b29
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoApply workaround for errata 813419 of Cortex-A57
Antonio Nino Diaz [Fri, 24 Feb 2017 11:39:22 +0000 (11:39 +0000)]
Apply workaround for errata 813419 of Cortex-A57

TLBI instructions for EL3 won't have the desired effect under specific
circumstances in Cortex-A57 r0p0. The workaround is to execute DSB and
TLBI twice each time.

Even though this errata is only needed in r0p0, the current errata
framework is not prepared to apply run-time workarounds. The current one
is always applied if compiled in, regardless of the CPU or its revision.

This errata has been enabled for Juno.

The `DSB` instruction used when initializing the translation tables has
been changed to `DSB ISH` as an optimization and to be consistent with
the barriers used for the workaround.

Change-Id: Ifc1d70b79cb5e0d87e90d88d376a59385667d338
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoAdd dynamic region support to xlat tables lib v2
Antonio Nino Diaz [Mon, 27 Feb 2017 17:23:54 +0000 (17:23 +0000)]
Add dynamic region support to xlat tables lib v2

Added APIs to add and remove regions to the translation tables
dynamically while the MMU is enabled. Only static regions are allowed
to overlap other static ones (for backwards compatibility).

A new private attribute (MT_DYNAMIC / MT_STATIC) has been added to
flag each region as such.

The dynamic mapping functionality can be enabled or disabled when
compiling by setting the build option PLAT_XLAT_TABLES_DYNAMIC to 1
or 0. This can be done per-image.

TLB maintenance code during dynamic table mapping and unmapping has
also been added.

Fixes ARM-software/tf-issues#310

Change-Id: I19e8992005c4292297a382824394490c5387aa3b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoImprove debug output of the translation tables
Antonio Nino Diaz [Mon, 13 Feb 2017 11:35:49 +0000 (11:35 +0000)]
Improve debug output of the translation tables

The printed output has been improved in two ways:

- Whenever multiple invalid descriptors are found, only the first one
  is printed, and a line is added to inform about how many descriptors
  have been omitted.

- At the beginning of each line there is an indication of the table
  level the entry belongs to. Example of the new output:
  `[LV3] VA:0x1000 PA:0x1000 size:0x1000 MEM-RO-S-EXEC`

Change-Id: Ib6f1cd8dbd449452f09258f4108241eb11f8d445
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoSimplify translation tables headers dependencies
Antonio Nino Diaz [Mon, 20 Feb 2017 14:22:22 +0000 (14:22 +0000)]
Simplify translation tables headers dependencies

The files affected by this patch don't really depend on `xlat_tables.h`.
By changing the included file it becomes easier to switch between the
two versions of the translation tables library.

Change-Id: Idae9171c490e0865cb55883b19eaf942457c4ccc
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoAdd version 2 of xlat tables library
Antonio Nino Diaz [Wed, 8 Mar 2017 14:40:23 +0000 (14:40 +0000)]
Add version 2 of xlat tables library

The folder lib/xlat_tables_v2 has been created to store a new version
of the translation tables library for further modifications in patches
to follow. At the moment it only contains a basic implementation that
supports static regions.

This library allows different translation tables to be modified by
using different 'contexts'. For now, the implementation defaults to
the translation tables used by the current image, but it is possible
to modify other tables than the ones in use.

Added a new API to print debug information for the current state of
the translation tables, rather than printing the information while
the tables are being created. This allows subsequent debug printing
of the xlat tables after they have been changed, which will be useful
when dynamic regions are implemented in a patch to follow.

The common definitions stored in `xlat_tables.h` header have been moved
to a new file common to both versions, `xlat_tables_defs.h`.

All headers related to the translation tables library have been moved to
a the subfolder `xlat_tables`.

Change-Id: Ia55962c33e0b781831d43a548e505206dffc5ea9
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
7 years agoTegra210: enable errata for Cortex-A57 and Cortex-A53 CPUs
Varun Wadekar [Mon, 6 Mar 2017 17:15:15 +0000 (09:15 -0800)]
Tegra210: enable errata for Cortex-A57 and Cortex-A53 CPUs

This patch enables the following erratas for the Tegra210 SoC:

* Cortex-A57
=============
- A57_DISABLE_NON_TEMPORAL_HINT
- ERRATA_A57_826974
- ERRATA_A57_826977
- ERRATA_A57_828024
- ERRATA_A57_829520
- ERRATA_A57_833471

* Cortex-A53
=============
- A53_DISABLE_NON_TEMPORAL_HINT
- ERRATA_A53_826319
- ERRATA_A53_836870

Tegra210 uses Cortex-A57 revision: r1p1 and Cortex-A53 revision: r0p2.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoMerge pull request #852 from dp-arm/dp/fiptool-embed-image
davidcunado-arm [Tue, 7 Mar 2017 13:44:44 +0000 (14:44 +0100)]
Merge pull request #852 from dp-arm/dp/fiptool-embed-image

fiptool: Embed a pointer to an image within the image descriptor

7 years agospd: trusty: support for AARCH64 mode
Varun Wadekar [Thu, 23 Feb 2017 18:34:06 +0000 (10:34 -0800)]
spd: trusty: support for AARCH64 mode

This patch removes support for running Trusty in the AARCH32 mode as
all platforms use it in only AARCH64 mode.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agospd: trusty: save context starting from the stack end
Varun Wadekar [Fri, 17 Feb 2017 02:14:37 +0000 (18:14 -0800)]
spd: trusty: save context starting from the stack end

This patch uses the stack end to start saving the CPU context
during world switch. The previous logic, used the stack start
to save the context, thus overwriting the other members of the
context.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agospd: trusty: add SET_ROT_PARAMS handling
Varun Wadekar [Thu, 29 Sep 2016 23:08:16 +0000 (16:08 -0700)]
spd: trusty: add SET_ROT_PARAMS handling

If Trusty is not running on the device, then Verified Boot is
not supported and the NS layer will fail gracefully later during
boot. This patch just returns success for the case when Trusty is
not running on the device and the bootloader issues SET_ROT_PARAMS
call during boot, so that we can at least boot non-Android images.

Change-Id: I40fc249983df80fb8cc5be5e4ce94c99d5b5f17d
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agotlkd: execute standard SMC calls on the boot CPU
Varun Wadekar [Wed, 8 Jun 2016 04:21:59 +0000 (21:21 -0700)]
tlkd: execute standard SMC calls on the boot CPU

This patch checks if standard SMC calls, meant for TLK, are issued
only on the boot CPU. TLK is UP Trusted OS stack and so we need this
check to avoid the NS world calling into TLK from any other CPU.

The previous check tied TLK to CPU0, but the boot CPU can be other
than CPU0 in some scenarios.

Change-Id: I75eaafa32471ce19e9920433c2f97b6b5fc02d86
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agospd: trusty: pass boot params to the Trusted OS
Wayne Lin [Tue, 24 May 2016 22:28:42 +0000 (15:28 -0700)]
spd: trusty: pass boot params to the Trusted OS

This patch passes the boot parameters, provided by the previous
bootloader, to the Trusted OS via X0, X1 and X2.

Original change by: Wayne Lin <wlin@nvidia.com>

Change-Id: I2039612a8a8226158babfd505ce8c31c4212319c
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agospd: trusty: only process one function ID at a time
Anthony Zhou [Wed, 20 Apr 2016 02:16:48 +0000 (10:16 +0800)]
spd: trusty: only process one function ID at a time

In multi-guest trusty environment, all guest's SMCs will be
forwarded to Trusty. This change only allows 1 guest's SMC
to be forwarded at a time and returns 'busy' status to all
other requests.

Change-Id: I2144467d11e3680e28ec816adeec2766bca114d4
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agospd: trusty: pass VMID via X7
Anthony Zhou [Fri, 30 Oct 2015 22:03:41 +0000 (06:03 +0800)]
spd: trusty: pass VMID via X7

According to the ARM DEN0028A spec, hypervisor ID(VMID) should be stored
in x7 (or w7). This patch gets this value from the context and passes it
to Trusty. In order to do so, introduce new macros to pass five to eight
parameters to the Trusted OS.

Change-Id: I101cf45d0712e1e880466b2274f9a48af755c9fa
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoMerge pull request #863 from vwadekar/tegra-changes-from-downstream-v4
davidcunado-arm [Sat, 4 Mar 2017 00:56:46 +0000 (00:56 +0000)]
Merge pull request #863 from vwadekar/tegra-changes-from-downstream-v4

Tegra changes from downstream v4

7 years agoMerge pull request #854 from rockchip-linux/pm_plat
davidcunado-arm [Fri, 3 Mar 2017 23:29:01 +0000 (23:29 +0000)]
Merge pull request #854 from rockchip-linux/pm_plat

rockchip: plat_pm.c: Change callbacks implement for our SOCs.

7 years agoTegra: enable SEPARATE_CODE_AND_RODATA build flag
Varun Wadekar [Tue, 28 Feb 2017 16:23:59 +0000 (08:23 -0800)]
Tegra: enable SEPARATE_CODE_AND_RODATA build flag

This patch enables the SEPARATE_CODE_AND_RODATA build flag for all
Tegra platforms, to allow setting proper MMU attributes for the RO
data and the code.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agorockchip: Change the callback implement of power domain for rk3368
tony.xie [Fri, 3 Mar 2017 08:22:12 +0000 (16:22 +0800)]
rockchip: Change the callback implement of power domain for rk3368

Change-Id: I6d39b4cac9b34b1f841e9bbddaf9c49785ba0c5e
Signed-off-by: tony.xie <tony.xie@rock-chips.com>
7 years agoTegra210: assert if afflvl0/1 have incorrect state-ids
Harvey Hsieh [Wed, 28 Dec 2016 13:53:18 +0000 (21:53 +0800)]
Tegra210: assert if afflvl0/1 have incorrect state-ids

The linux kernel v3.10 does not use System Suspend function ID, whereas
v4.4 uses it. This means affinity levels 0/1 will have different state id
values during System Suspend entry. This patch updates the assert criteria
to check both the state id values.

Change-Id: I07fcaf99501cc9622e40d0a2c1eb4a4a160be10a
Signed-off-by: Harvey Hsieh <hhsieh@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: SiP: 64-bit address for Video Memory base
Harvey Hsieh [Tue, 11 Oct 2016 10:59:52 +0000 (18:59 +0800)]
Tegra: SiP: 64-bit address for Video Memory base

This patch allows the NS world to pass 64-bit base address for
the Video Memory carveout region.

Change-Id: I7e47cc1f5425bd39c6763755b801517013e1e0cd
Signed-off-by: Harvey Hsieh <hhsieh@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: increase ADDR_SPACE_SIZE to 35 bits
Steven Kao [Thu, 24 Nov 2016 11:24:37 +0000 (19:24 +0800)]
Tegra: increase ADDR_SPACE_SIZE to 35 bits

This patch increases the ADDR_SPACE_SIZE macro (virtual address)
to 35 bits, to support max memory of 32G, for all Tegra platforms.

Change-Id: I8e6861601d3a667d7428988c7596b0adebfa0548
Signed-off-by: Steven kao <skao@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: init the console only if the platform supports it
Damon Duan [Mon, 7 Nov 2016 11:37:50 +0000 (19:37 +0800)]
Tegra: init the console only if the platform supports it

Some platforms might want to keep the uart console disabled
during boot. This patch checks if the platform supports a
console, before calling console_init().

Change-Id: Icc9c59cb979d91fd0a72e4732403b3284bdd2dfc
Signed-off-by: Damon Duan <danield@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra210: new TZDRAM base address
Varun Wadekar [Thu, 1 Sep 2016 21:59:32 +0000 (14:59 -0700)]
Tegra210: new TZDRAM base address

This patch modifies the TZDRAM base address to the new aperture
allocated by the bootloader.

Change-Id: Id158d15b1ec9aa681136d258e90fbba930aebf92
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra210: set core power state during cluster power down
Varun Wadekar [Thu, 1 Sep 2016 21:56:17 +0000 (14:56 -0700)]
Tegra210: set core power state during cluster power down

This patch sets the core power state during cluster power down,
so that the 'get_target_pwr_state' handler can calculate the
proper states for all the affinity levels.

Change-Id: If4adb001011208916427ee1623c6c923bed99985
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: calculate proper power state for affinity levels
Varun Wadekar [Thu, 1 Sep 2016 21:51:59 +0000 (14:51 -0700)]
Tegra: calculate proper power state for affinity levels

This patch fixes the 'tegra_soc_get_target_pwr_state' handler used to
calculate the proper state for each of the affinity levels.

Change-Id: Id16bd15b96f0fc633ffeac2d7a390592fbd0454b
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: fix logic to calculate GICD_ISPENDR register address
Varun Wadekar [Tue, 23 Aug 2016 21:01:19 +0000 (14:01 -0700)]
Tegra: fix logic to calculate GICD_ISPENDR register address

This patch uses GICD_BASE to calculate the GICD_ISPENDR regsiter address
in the platform's 'plat_crash_print_regs' routine.

Reported by: Seth Eatinger <seatinger@nvidia.com>

Change-Id: Ic7be29abc781f475ad25b59582ae60a0a2497377
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: uninit and re-init console across System Suspend
Varun Wadekar [Tue, 2 Aug 2016 05:16:21 +0000 (22:16 -0700)]
Tegra: uninit and re-init console across System Suspend

This patch removes the console_init() from runtime_setup() as we already
initialize it earlier and disables/enables it across "System Suspend".

Change-Id: I992d3ca56ff4797faf83e8d7fa52c0ef3e1c3367
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoTegra: support for silicon/simulation platforms
Varun Wadekar [Wed, 20 Jul 2016 17:28:51 +0000 (10:28 -0700)]
Tegra: support for silicon/simulation platforms

This patch adds support to identify the underlying platform
on which we are running. The currently supported platforms
are actual silicon and simulation platforms.

Change-Id: Iadf96e79ec663b3dbd1a18e9bb95ffcdb82fc8af
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
7 years agoMerge pull request #859 from Summer-ARM/sq/update-doc
danh-arm [Thu, 2 Mar 2017 17:03:12 +0000 (17:03 +0000)]
Merge pull request #859 from Summer-ARM/sq/update-doc

Update LOAD_IMAGE_V2 user guide documentation

7 years agoAArch32: Enable override of plat_set_my_stack/plat_get_my_stack
Soby Mathew [Tue, 14 Feb 2017 10:21:55 +0000 (10:21 +0000)]
AArch32: Enable override of plat_set_my_stack/plat_get_my_stack

This patch makes the default MP definitions of plat_get_my_stack()
and plat_set_my_stack() as weak so that they can be overridden by
the AArch32 Secure Payload if it requires.

Change-Id: I3b6ddff5750443a776505e3023ff2934227592b6
Signed-off-by: Soby Mathew <soby.mathew@arm.com>