project/bcm63xx/atf.git
5 years agospd: trusty : fix defects flagged by MISRA scan
Anthony Zhou [Tue, 19 Sep 2017 08:36:22 +0000 (16:36 +0800)]
spd: trusty : fix defects flagged by MISRA scan

Main Fixes:

Use int32_t replace int [Rule 4.6]

Added explicit casts (e.g. 0U) to integers in order for them to be
  compatible with whatever operation they're used in [Rule 10.1]

Force operands of an operator to the same type category [Rule 10.4]

Fixed if statement conditional to be essentially boolean [Rule 14.4]

Voided non c-library functions whose return types are not used
[Rule 17.7]

Change-Id: I98caa330c371757eb2dfb9438448cb99115ed907
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra: memctrl_v2: allow CPU accesses to TZRAM
Steven Kao [Wed, 6 Sep 2017 05:32:21 +0000 (13:32 +0800)]
Tegra: memctrl_v2: allow CPU accesses to TZRAM

This patch enables CPU access configuration register to allow
accesses to the TZRAM aperture on chips after Tegra186.

Change-Id: I0898582f8bd6fd35360ecf8ca5cee21fe35f7aab
Signed-off-by: Steven Kao <skao@nvidia.com>
5 years agoTegra: lib: debug: fix MISRA violation Rule 21.6
Anthony Zhou [Fri, 8 Sep 2017 07:53:40 +0000 (15:53 +0800)]
Tegra: lib: debug: fix MISRA violation Rule 21.6

MISRA Rule 21.6, The standard library input/output functions
shall not be used.

This patch removes headers that are not really needed.

Change-Id: I746138ce7ee95d7ca985d020f89b2738d997a7a2
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra: memctrl_v2: pack TZDRAM base to RSVD55_SCRATCH
Harvey Hsieh [Mon, 18 Sep 2017 11:22:01 +0000 (19:22 +0800)]
Tegra: memctrl_v2: pack TZDRAM base to RSVD55_SCRATCH

This patch saves the TZDRAM_BASE value to secure RSVD55
scratch register. The warmboot code uses this register to
restore the settings on exiting System Suspend.

Change-Id: Id76175c2a7d931227589468511365599e2908411
Signed-off-by: Harvey Hsieh <hhsieh@nvidia.com>
5 years agoTegra: enable -nostdlib flag
Varun Wadekar [Thu, 7 Sep 2017 00:17:12 +0000 (17:17 -0700)]
Tegra: enable -nostdlib flag

This patch enables the '-nostdlib' flag to instruct the compiler
to not use the standard system libraries and startup files.

Change-Id: Ibf34856f7579ed686280cee19c35d08448cf921c
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: mce: get the "right" uncore command/response bits
Varun Wadekar [Wed, 6 Sep 2017 17:48:27 +0000 (10:48 -0700)]
Tegra186: mce: get the "right" uncore command/response bits

This patch corrects the logic to read the uncore command/response bits
from the command/response values. The previous logic tapped into incorrect
bits leading to garbage counter values.

Change-Id: Ib8327ca3cb3d2086bb268e9a5366865cdf35b493
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: mce: use udelay() to calculate timeouts
Varun Wadekar [Fri, 1 Sep 2017 00:14:22 +0000 (17:14 -0700)]
Tegra186: mce: use udelay() to calculate timeouts

This patch modifies the timeout loop to use udelay() instead of
mdelay(). This helps with the boot time on some platforms which
issue a lot of MCE calls and every mdelay adds up increasing the
boot time by a lot.

Change-Id: Ic50081b73e1cbc2714361235b5c396e294b8f752
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: fix MISRA Rule 8.3 violation
Anthony Zhou [Tue, 29 Aug 2017 09:00:56 +0000 (17:00 +0800)]
Tegra186: fix MISRA Rule 8.3 violation

MISRA Rule 8.3, All declarations of an object or function
shall use the same names and type qualifiers.

This patch removes unused function(s).

Change-Id: I90865c003d46f1dc08bfb5f4fe8a327ea42a2bb7
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoHelper function to read ID_AFR0_EL1 system register
Varun Wadekar [Wed, 23 Jan 2019 17:41:28 +0000 (09:41 -0800)]
Helper function to read ID_AFR0_EL1 system register

This patch provides helper function to read the ID_AFR0_EL1
system register for platforms.

Change-Id: Id5491b18e3bf9f619d98d6cc8efd9d2cf5918c9d
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: memctrl_v2: platform handlers to program MSS
Puneet Saxena [Fri, 4 Aug 2017 11:49:55 +0000 (17:19 +0530)]
Tegra: memctrl_v2: platform handlers to program MSS

Introduce platform handlers to program the MSS settings.
This allows the current driver to scale to future chips.

Change-Id: I40a27648a1a3c73b1ce38dafddc1babb6f0b0d9b
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
5 years agoMerge pull request #1768 from bryanodonoghue/integration+linaro_warp7-tbb
Antonio Niño Díaz [Wed, 23 Jan 2019 14:46:46 +0000 (14:46 +0000)]
Merge pull request #1768 from bryanodonoghue/integration+linaro_warp7-tbb

Integration+linaro warp7 tbb

5 years agoMerge pull request #1772 from glneo/clear-proxy-queue
Antonio Niño Díaz [Tue, 22 Jan 2019 15:03:01 +0000 (15:03 +0000)]
Merge pull request #1772 from glneo/clear-proxy-queue

TI K3 Clear proxy receive queue on transmit

5 years agoMerge pull request #1775 from glneo/uart-baud-rate
Antonio Niño Díaz [Tue, 22 Jan 2019 12:51:01 +0000 (12:51 +0000)]
Merge pull request #1775 from glneo/uart-baud-rate

ti: k3: common: Allow customizing UART baud rate using build options

5 years agoMerge pull request #1774 from glneo/error-message
Antonio Niño Díaz [Tue, 22 Jan 2019 12:50:51 +0000 (12:50 +0000)]
Merge pull request #1774 from glneo/error-message

ti: k3: drivers: sec_proxy: Switch error messages

5 years agoMerge pull request #1771 from glneo/core-shutdown
Antonio Niño Díaz [Tue, 22 Jan 2019 12:50:39 +0000 (12:50 +0000)]
Merge pull request #1771 from glneo/core-shutdown

TI K3 Core shutdown changes

5 years agoMerge pull request #1770 from antonio-nino-diaz-arm/an/spm-mm
Antonio Niño Díaz [Tue, 22 Jan 2019 10:17:41 +0000 (10:17 +0000)]
Merge pull request #1770 from antonio-nino-diaz-arm/an/spm-mm

Undeprecate MM-based SPM

5 years agoSPM: Rename folder of SPM based on MM
Antonio Nino Diaz [Mon, 21 Jan 2019 11:52:57 +0000 (11:52 +0000)]
SPM: Rename folder of SPM based on MM

This implementation is no longer deprecated.

Change-Id: I68552d0fd5ba9f08fad4345e4657e8e3c5362a36
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoSPM: Rename SPM_DEPRECATED flag to SPM_MM
Antonio Nino Diaz [Mon, 21 Jan 2019 11:53:29 +0000 (11:53 +0000)]
SPM: Rename SPM_DEPRECATED flag to SPM_MM

The SPM implementation based on MM is going to be kept for the
foreseeable future.

Change-Id: I11e96778a4f52a1aa803e7e048d9a7cb24a53954
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
5 years agoti: k3: common: Allow customizing UART baud rate using build options
Andreas Dannenberg [Mon, 14 Jan 2019 19:20:15 +0000 (13:20 -0600)]
ti: k3: common: Allow customizing UART baud rate using build options

To accommodate scenarios where we want to use a UART baud rate other than
the default 115,200 allow the associated compiler definition to be set
via the K3_USART_BAUD build option by updating the platform make file.

Since the platform make file now also contains the default value (still
115,200), go ahead and remove the redundant definition from the platform
header file.

Suggested-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
5 years agoti: k3: drivers: ti_sci: Clear receive queue before transmitting
Andrew F. Davis [Fri, 4 Jan 2019 18:49:16 +0000 (12:49 -0600)]
ti: k3: drivers: ti_sci: Clear receive queue before transmitting

Send and receive currently must be be serialized, any message already in
the receive queue when a new message is to be sent will cause a mismatch
with the expected response from this new message. Clear out all messages
from the response queue before sending a new request.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
5 years agoti: k3: drivers: sec_proxy: Allow clearing a Secure Proxy receive thread
Andrew F. Davis [Fri, 4 Jan 2019 18:44:00 +0000 (12:44 -0600)]
ti: k3: drivers: sec_proxy: Allow clearing a Secure Proxy receive thread

It can be needed to discard all messages in a receive queue. This
can be used during some error recovery situations.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
5 years agoti: k3: common: Use shutdown API for PSCI core poweroff
Andrew F. Davis [Thu, 3 Jan 2019 19:24:25 +0000 (13:24 -0600)]
ti: k3: common: Use shutdown API for PSCI core poweroff

To ensure WFI is reached before the PSC is trigger to power-down
a processor, the shutdonw API must be used.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
5 years agoti: k3: drivers: ti_sci: Add processor shutdown API
Andrew F. Davis [Thu, 3 Jan 2019 19:23:52 +0000 (13:23 -0600)]
ti: k3: drivers: ti_sci: Add processor shutdown API

This is a pseudo-API command consisting of a wait processor status
command and a set device state command queued back-to-back without
waiting for the System Firmware to ACK either message.

This is needed as the K3 power down specification states the System
Firmware must wait for a processor to be in WFI/WFE before powering
it down. The current implementation of System Firmware does not provide
such a command. Also given that with PSCI the core to be shutdown is the
core that is processing the shutdown request, the core cannot itself wait
for its own WFI/WFE status. To workaround this limitation, we submit
a wait processor status command followed by the actual shutdown command.
The shutdown command will not be processed until the wait command has
finished. In this way we can continue to WFI before the wait command
status has been met or timed-out and the shutdown command is processed.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
5 years agoti: k3: drivers: ti_sci: Add processor status wait API
Andrew F. Davis [Tue, 18 Dec 2018 19:21:12 +0000 (13:21 -0600)]
ti: k3: drivers: ti_sci: Add processor status wait API

This TI-SCI API can be used wait for a set of processor status flags to
be set or cleared. The flags are processor type specific. This command
will not return ACK until the specified status is met. NACK will be
returned after the timeout elapses or on error.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
5 years agoti: k3: drivers: sec_proxy: Switch error messages
Andrew F. Davis [Fri, 4 Jan 2019 18:39:54 +0000 (12:39 -0600)]
ti: k3: drivers: sec_proxy: Switch error messages

The logic is correct here, but the error messages are
reversed, switch them.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
5 years agoRemove reference to DISABLE_PEDANTIC
Antonio Nino Diaz [Mon, 21 Jan 2019 11:53:41 +0000 (11:53 +0000)]
Remove reference to DISABLE_PEDANTIC

This flag was removed in 79eb1aff7850 ("Remove `DISABLE_PEDANTIC` build
option").

Change-Id: Ic3584a4c5f0100ed9e57b068ec672b0baae8cfab
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoMerge pull request #1764 from vwadekar/tf2.0-tegra-downstream-rebase-1.7.19
Antonio Niño Díaz [Mon, 21 Jan 2019 14:02:32 +0000 (14:02 +0000)]
Merge pull request #1764 from vwadekar/tf2.0-tegra-downstream-rebase-1.7.19

Tf2.0 tegra downstream rebase 1.7.19

5 years agoMerge pull request #1767 from Yann-lms/updates_stm32mp1
Antonio Niño Díaz [Mon, 21 Jan 2019 11:37:06 +0000 (11:37 +0000)]
Merge pull request #1767 from Yann-lms/updates_stm32mp1

Updates for STM32MP1

5 years agoTegra: memctrl: clean MC INT status before exit to bootloader
Harvey Hsieh [Mon, 21 Aug 2017 07:01:53 +0000 (15:01 +0800)]
Tegra: memctrl: clean MC INT status before exit to bootloader

This patch cleans the Memory controller's interrupt status
register, before exiting to the non-secure world during
cold boot. This is required as we observed that the MC's
arbitration bit is set before exiting the secure world.

Change-Id: Iacd01994d03b3b9cbd7b8a57fe7ab5b04e607a9f
Signed-off-by: Harvey Hsieh <hhsieh@nvidia.com>
5 years agoTegra: use 'PLATFORM_MAX_CPUS_PER_CLUSTER' to calculate core position
Varun Wadekar [Wed, 23 Aug 2017 23:02:06 +0000 (16:02 -0700)]
Tegra: use 'PLATFORM_MAX_CPUS_PER_CLUSTER' to calculate core position

This patch updates the plat_my_core_pos() and platform_get_core_pos() helper
functions to use the `PLATFORM_MAX_CPUS_PER_CLUSTER` macro to calculate the
core position.

core_pos = CoreId + (ClusterId * PLATFORM_MAX_CPUS_PER_CLUSTER)

Change-Id: Ic49f2fc7ded23bf9484c8fe104025df8884b9faf
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: memctrl_v2: pack TZDRAM base into SCRATCH54_LO
Harvey Hsieh [Wed, 9 Aug 2017 08:24:40 +0000 (16:24 +0800)]
Tegra: memctrl_v2: pack TZDRAM base into SCRATCH54_LO

This patch moves the TZDRAM base address to SCRATCH55_LO due
to security concerns. The HI and LO address bits are packed
into SCRATCH55_LO for the warmboot firmware to restore.
SCRATCH54_HI is still being used for backward compatibility,
but would be removed eventually.

The scratch registers are populated as:
* RSV55_0 = CFG1[12:0] | CFG0[31:20]
* RSV55_1 = CFG3[1:0]
* RSV54_1 = CFG1[12:0]

Change-Id: Idc20d165d8117488010fcc8dfd946f7ad475da58
Signed-off-by: Harvey Hsieh <hhsieh@nvidia.com>
5 years agoTegra: bpmp: Increase timeout to 2ms
Peter De Schrijver [Thu, 15 Jun 2017 02:21:50 +0000 (05:21 +0300)]
Tegra: bpmp: Increase timeout to 2ms

To deal with upcoming EMC periodic compensation, increase the BPMP timeout
to 2ms.

Change-Id: I8572c031168defd15504d905c4d625f44dd7fa3d
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
5 years agoTegra: remove duplicate code from CPU's power on path
Varun Wadekar [Tue, 15 Aug 2017 22:38:01 +0000 (15:38 -0700)]
Tegra: remove duplicate code from CPU's power on path

This patch removes duplicate code from the CPU's power on path. The removed
code is already present as part of PSCI's power on logic.

Change-Id: I4d18a605b219570c6bf997b9e6be6e7853ebf5cd
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: enable 'WARMBOOT_ENABLE_DCACHE_EARLY' flag
Varun Wadekar [Fri, 4 Aug 2017 00:17:00 +0000 (17:17 -0700)]
Tegra: enable 'WARMBOOT_ENABLE_DCACHE_EARLY' flag

This patch enables the 'WARMBOOT_ENABLE_DCACHE_EARLY' flag to enable
D-cache early, during the CPU warmboot sequence. This flag is applicable
for platforms like Tegra, which do not require interconnect programming to
enable cache coherency.

Change-Id: Id39471cf0922799960d8f1de6e5e0d605a53f7ca
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra210_B01: SC7: Select RNG mode based on ECID
Samuel Payne [Fri, 16 Jun 2017 04:12:45 +0000 (21:12 -0700)]
Tegra210_B01: SC7: Select RNG mode based on ECID

If ECID is valid, we can use force instantiation
otherwise, we should use reseed for random data
generation for RNG operations in SE context save
DNI because we are not keeping software save
sequence in main.

Change-Id: I73d650e6f45db17b780834b8de4c10501e05c8f3
Signed-off-by: Samuel Payne <spayne@nvidia.com>
5 years agoTegra: trusty: pass profiling base to Trusted OS
Varun Wadekar [Thu, 3 Jan 2019 00:30:01 +0000 (16:30 -0800)]
Tegra: trusty: pass profiling base to Trusted OS

* Previous boot loader passes Shared DRAM address
  to be used by Trusted OS to dump its boot timing records
* This patch adds support to pass the parameter
  to Trusted OS during cold boot

Change-Id: I9f95bb6de80b1bbd2d2d6ec42619f895d911b8ed
Signed-off-by: Akshay Sharan <asharan@nvidia.com>
5 years agoTegra210B01: SE/SE2 and PKA1 context save (SW)
Marvin Hsu [Tue, 11 Apr 2017 03:00:48 +0000 (11:00 +0800)]
Tegra210B01: SE/SE2 and PKA1 context save (SW)

This change ports the software based SE context save routines.
The software implements the context save sequence for SE/SE2 and
PKA1. The context save routine is intended to be invoked from
the ATF SC7 entry.

Change-Id: I9aa156d6e7e22a394bb10cb0c3b05fc303f08807
Signed-off-by: Marvin Hsu <marvinh@nvidia.com>
5 years agoTegra: memctrl: assert if dynamic memmap fails
Varun Wadekar [Thu, 3 Aug 2017 18:40:34 +0000 (11:40 -0700)]
Tegra: memctrl: assert if dynamic memmap fails

This patch adds an assert in case the dynamic memmap routine fails.

Change-Id: Idd20debbb8944340f5928c6f2cfea973a63a7b1c
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: set PLAT_LOG_LEVEL_ASSERT macro to LOG_LEVEL_INFO
Varun Wadekar [Thu, 3 Aug 2017 18:38:32 +0000 (11:38 -0700)]
Tegra: set PLAT_LOG_LEVEL_ASSERT macro to LOG_LEVEL_INFO

This patch enables prints from asserts() for release/debug builds
on all Tegra platforms.

Change-Id: Ie256437a325a7c5015a10f55aba2287a91b57bca
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra210: increase number of dynamic memory mappings
Varun Wadekar [Thu, 3 Aug 2017 18:19:01 +0000 (11:19 -0700)]
Tegra210: increase number of dynamic memory mappings

This patch increases the MAX_MMAP_REGIONS build flag to allow
Tegra210 platforms to dynamically map multiple memory apertures
at the same time. This takes care of scenarios when we get multiple
requests to memmap memory apertures at the same time.

Change-Id: If4fe23b454e7d588e35acfbf024b9ccbb3daccc7
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: lib: library for profiling the cold boot path
Varun Wadekar [Fri, 21 Jul 2017 20:34:16 +0000 (13:34 -0700)]
Tegra: lib: library for profiling the cold boot path

The non secure world would like to profile the boot path for
the EL3 and S-EL1 firmwares. To allow it to do that, a non-secure
DRAM region (4K) is allocated and the base address is passed to
the EL3 firmware.

This patch adds a library to allow the platform code to store the
tag:timestamp pair to the shared memory. The tegra platform code
then uses the `record` method to add timestamps.

Original change by Akshay Sharan <asharan@nvidia.com>

Change-Id: Idbbef9c83ed84a508b04d85a6637775960dc94ba
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: sanity check non-secure DRAM address
Varun Wadekar [Thu, 20 Jul 2017 16:43:28 +0000 (09:43 -0700)]
Tegra: sanity check non-secure DRAM address

This patch fixes the logic to validate if a non-secure memory address
overlaps the TZDRAM memory aperture.

Change-Id: I68af7dc6acc705d7b0ee9161c4002376077b46b1
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: fix defects flagged by MISRA Rule 10.3
Anthony Zhou [Wed, 26 Jul 2017 09:16:54 +0000 (17:16 +0800)]
Tegra: fix defects flagged by MISRA Rule 10.3

MISRA Rule 10.3, the value of an expression shall not be assigned to
an object with a narrower essential type or of a different essential
type category.

The essential type of a enum member is anonymous enum, the enum member
should be casted to the right type when using it.

Both UL and ULL suffix equal to uint64_t constant in compiler
aarch64-linux-gnu-gcc, to avoid confusing, only keep U and ULL suffix
in platform code. So in some case, cast a constant to uint32_t is
necessary.

Change-Id: I1aae8cba81ef47481736e7f95f53570de7013187
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra210: save TZSRAM context from the "_wfi" handler
Harvey Hsieh [Thu, 15 Jun 2017 23:28:43 +0000 (16:28 -0700)]
Tegra210: save TZSRAM context from the "_wfi" handler

This patch saves the TZSRAM context and takes the SoC into System Suspend
from the "_wfi" handler. This helps us save the entire CPU context from
the TZSRAM, before entering System Suspend. In the previous implementation
we missed saving some part of the state machine context leading to an assert
on System Suspend exit.

Change-Id: I4895a8b4a5e3c3e983c245746ea388e42da8229c
Signed-off-by: Harvey Hsieh <hhsieh@nvidia.com>
5 years agoTegra210: se: enable entropy/SE clocks before system suspend
Samuel Payne [Mon, 12 Jun 2017 17:15:43 +0000 (10:15 -0700)]
Tegra210: se: enable entropy/SE clocks before system suspend

This patch enables clocks to the SE and Entropy block and gets them
out of reset, before starting the context save operation.

Change-Id: Ic196be8fb833dfd04c0e8d460c07058429999613
Signed-off-by: Samuel Payne <spayne@nvidia.com>
5 years agoTegra: smmu: add a hook to get number of devices
Steven Kao [Tue, 25 Jul 2017 03:29:46 +0000 (11:29 +0800)]
Tegra: smmu: add a hook to get number of devices

This patch adds a hook to get the number of smmu devices and
removes the NUM_SMMU_DEVICES macro.

Change-Id: Ia8dba7e9304224976b5da688b9e4b5438f11cc41
Signed-off-by: Steven Kao <skao@nvidia.com>
5 years agoTegra: common: fix defects flagged by MISRA scan
Anthony Zhou [Fri, 7 Jul 2017 06:29:51 +0000 (14:29 +0800)]
Tegra: common: fix defects flagged by MISRA scan

Macro assert(e) request 'e' is a bool type, if useing other
type, MISRA report a "The Essential Type Model" violation,
Add a judgement to fix the defects, if 'e' is not bool type.

Remove unused code [Rule 2.5]
Fix the essential type model violation [Rule 10.6, 10.7]
Use local parameter to raplace function parameter [Rule 17.8]

Change-Id: Ifce932addbb0a4b063ef6b38349d886c051d81c0
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra: read-modify-write ACTLR_ELx registers
Steven Kao [Wed, 14 Jun 2017 06:02:23 +0000 (14:02 +0800)]
Tegra: read-modify-write ACTLR_ELx registers

This patch changes direct writes to ACTLR_ELx registers to use
read-modify-write instead.

Change-Id: I6e0eaa6974583f3035cb3724088f3f1c849da229
Signed-off-by: Steven Kao <skao@nvidia.com>
5 years agoTegra186: enable erratas for Cortex-A57 CPUs
Varun Wadekar [Tue, 25 Jul 2017 20:29:52 +0000 (13:29 -0700)]
Tegra186: enable erratas for Cortex-A57 CPUs

This patch enables the following erratas for Cortex-A57 CPUs:

- ERRATA_A57_806969
- ERRATA_A57_813419
- ERRATA_A57_813420
- ERRATA_A57_826974
- ERRATA_A57_826977
- ERRATA_A57_828024
- ERRATA_A57_829520
- ERRATA_A57_833471

Change-Id: Ib18b7654607b967b70082f683686a16f52637442
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: fix defects flagged by MISRA scan
Anthony Zhou [Wed, 28 Jun 2017 08:49:16 +0000 (16:49 +0800)]
Tegra186: fix defects flagged by MISRA scan

Main fixes:

Remove unused type conversion

Fix invalid use of function pointer [Rule 1.3]

Fix variable essential type doesn't match [Rule 10.3]

Voided non c-library functions whose return types are not used
 [Rule 17.7]

Change-Id: I23994c9d4d6a240080933d848d2b03865acaa833
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra210: se: disable SMMU before suspending SE block
Samuel Payne [Mon, 12 Jun 2017 23:38:23 +0000 (16:38 -0700)]
Tegra210: se: disable SMMU before suspending SE block

This patch disables SMMU hardware before suspending the SE
block, for the context save operation to complete. The NS
word will re-enable SMMU when we exit System Suspend.

Change-Id: I4d5cd982ea6780db5c38b124550d847e3928c60d
Signed-off-by: Samuel Payne <spayne@nvidia.com>
5 years agoTegra: common: drivers: fix MISRA defects
Anthony Zhou [Wed, 28 Jun 2017 08:35:54 +0000 (16:35 +0800)]
Tegra: common: drivers: fix MISRA defects

Main fixes:

Add suffix U for constant [Rule 10.1]

Match the operands type [Rule 10.4]

Use UL replace U for that constant define that need do "~"
operation [Rule 12.4]

Voided non c-library functions whose return types are not used
 [Rule 17.7]

Change-Id: Ia1e814ca3890eab7904be9c79030502408f30936
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra: pm: fix MISRA defects
Anthony Zhou [Wed, 22 Mar 2017 06:42:42 +0000 (14:42 +0800)]
Tegra: pm: fix MISRA defects

Main fixes:

* Use int32_t replace int, use uint32_t replace unsign int
  [Rule 4.6]
* Add function define to header file [Rule 8.4]
* Added curly braces ({}) around if statements in order to
  make them compound [Rule 15.6]
* Voided non c-library functions whose return types are not used
  [Rule 17.7]

Change-Id: Ifa3ba4e75046697cfede885096bee9a30efe6519
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra186: reduce complexity for the 'get_target_pwr_state' handler
Varun Wadekar [Wed, 24 May 2017 15:47:15 +0000 (08:47 -0700)]
Tegra186: reduce complexity for the 'get_target_pwr_state' handler

This patch reduces the code complexity for the platform's 'get_target_pwr_state'
handler, by reducing the number of 'if' conditions and adding helper functions
to calculate power state for the cluster/system.

Tested with 'pmccabe'

Change-Id: I32fa4c814bd97f620f2003fa39f1bfceae563771
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: fix MISRA defects in tegra_bl31_setup.c
Varun Wadekar [Wed, 2 Jan 2019 18:48:18 +0000 (10:48 -0800)]
Tegra: fix MISRA defects in tegra_bl31_setup.c

Main fixes:

Add parentheses to avoid implicit operator precedence [Rule 12.1]

Fixed if statement conditional to be essentially boolean [Rule 14.4]

Added curly braces ({}) around if statements in order to
make them compound [Rule 15.6]

Voided non c-library functions whose return types are not used [Rule 17.7]

Bug 200272157

Change-Id: Ic3ab5a3de95aeb6d2265df940f7fb35ea0f19ab0
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra: gpcdma: driver for general purpose DMA
Varun Wadekar [Wed, 28 Jun 2017 21:38:19 +0000 (14:38 -0700)]
Tegra: gpcdma: driver for general purpose DMA

This patch adds the driver for the general purpose DMA hardware
block on newer Tegra SoCs. The GPCDMA is a special purpose DMA
used to speed up memory copy operations to/from DRAM and TZSRAM.

This patch introduces a macro 'USE_GPC_DMA' to allow platforms
to override CPU based memory operations.

Change-Id: I3170d409c83b77e785437b1002a8d70188fabbeb
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra210: SE: remove logic to enable atomic save/restore
Samuel Payne [Thu, 15 Jun 2017 20:57:47 +0000 (13:57 -0700)]
Tegra210: SE: remove logic to enable atomic save/restore

This patch removes the logic to set the bit that enables atomic context
save/restore when we enter System suspend. The bootrom enables this bit
during cold boot and exit from System Suspend, so we can remove this
setting from the driver.

Change-Id: Id4e08d5048155c970f5e31d9c9dd676c07182ade
Signed-off-by: Samuel Payne <spayne@nvidia.com>
5 years agoTegra186: sip_calls: fix defects flagged by MISRA scan
Anthony Zhou [Tue, 28 Feb 2017 06:47:44 +0000 (14:47 +0800)]
Tegra186: sip_calls: fix defects flagged by MISRA scan

Main fixes:

Added explicit casts (e.g. 0U) to integers in order for them to be
compatible with whatever operation they're used in [Rule 10.1]

Convert object type to match the type of function parameters
[Rule 10.3]

Force operands of an operator to the same type category [Rule 10.4]

Expressions resulting from the expansion of macro parameters
shall be enclosed in parentheses[Rule 20.7]

Change-Id: Ibdae1d18d299562ca2b96b2318b914601c9926b1
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agodocs: warp7: Update WaRP7 description for TBB
Bryan O'Donoghue [Fri, 26 Oct 2018 15:06:28 +0000 (16:06 +0100)]
docs: warp7: Update WaRP7 description for TBB

This patch updates the WaRP7 build descriptions for booting WaRP7 in
Trusted Board Boot mode. TBB is the only mode we really intend to support
for this board so rather than maintain documentation for the old way of
doing it, this patch updates the description for TBB mode only.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
5 years agowarp7: Enable Trusted Board Boot for WaRP7
Bryan O'Donoghue [Fri, 26 Oct 2018 13:19:43 +0000 (14:19 +0100)]
warp7: Enable Trusted Board Boot for WaRP7

This patch enables Trusted Board Boot for warp7. A subsequent patch
contains build/run instructions.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Jun Nie <jun.nie@linaro.org>
5 years agostm32mp1: set ETZPC controlled peripherals and GPIOZ as non-secure
Yann Gautier [Fri, 18 Jan 2019 10:13:15 +0000 (11:13 +0100)]
stm32mp1: set ETZPC controlled peripherals and GPIOZ as non-secure

Change-Id: I604b38ffa40e04c6e2aaede28e9f61335bbffdc0
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agostm322mp1: add BSEC service
Yann Gautier [Thu, 17 Jan 2019 13:53:24 +0000 (14:53 +0100)]
stm322mp1: add BSEC service

This service, called with SMC from Non secure world, allows access to
some configurations saved in OTP fuses.

Change-Id: I92ba5614b2cb4a03260119e2cf74f2cd626a3431
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Mathieu Belou <mathieu.belou@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
5 years agostm32mp1: add BSEC driver
Yann Gautier [Thu, 17 Jan 2019 13:52:47 +0000 (14:52 +0100)]
stm32mp1: add BSEC driver

The BSEC (Boot and Security and OTP control) is intended to control an OTP
(one time programmable) fuse box, used for on-chip non-volatile storage
for device configuration and security parameters.

Change-Id: I38c44684c7b9c6a1f24ec0ae3fe99cec481d5a51
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Mathieu Belou <mathieu.belou@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
5 years agostm32mp1: add support for SiP services
Yann Gautier [Thu, 17 Jan 2019 13:51:25 +0000 (14:51 +0100)]
stm32mp1: add support for SiP services

Change-Id: I9c8241d8cd9d95b647c612dd66dd554d5965c2ac
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Mathieu Belou <mathieu.belou@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
5 years agostm32mp1: update device tree and gpio functions
Yann Gautier [Thu, 17 Jan 2019 18:17:47 +0000 (19:17 +0100)]
stm32mp1: update device tree and gpio functions

Change fdt_check_status function to fdt_get_status.
Update GPIO defines.
Move some functions in gpio driver, instead of dt helper file.
Add GPIO bank helper functions.
Use only one status field in dt_node_info structure including both status
and secure status.

Change-Id: I34f93408dd4aac16ae722f564bc3f7d6ae978cf4
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
5 years agostm32mp1: update platform files
Yann Gautier [Thu, 17 Jan 2019 13:41:46 +0000 (14:41 +0100)]
stm32mp1: update platform files

Move print_reset_reason function to bl2_plat_setup.c
Put __unused attribute for unused bl2_el3_early_platform_setup args.
Rename dt_dev_info to dt_uart_info.
Put MMU configuration earlier.
Remove unused macros.
Use U() or ULL() macros where needed.
Use device tree to configure GIC.
Use GIC helper function.

Change-Id: I34620c421cc6967a668bca318f7689fd74fa78a6
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
5 years agodrivers: st: update drivers code
Yann Gautier [Thu, 17 Jan 2019 13:35:22 +0000 (14:35 +0100)]
drivers: st: update drivers code

Reword some traces.
Use uintptr_t where required.
Reduce scope of variables.
Improve io_stm32image algo.
Complete some IP registers definitions.
Add failure on supported DDR (stm32mp1_ddr_init()).
Fix cache flush on cache disable (stm32mp1_ddr_setup).

Change-Id: Ie02fa71e02b9d69abc807fd5b7df233e5be6668c
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agodrivers: st: pmic: update stpmic1 driver
Yann Gautier [Thu, 17 Jan 2019 13:27:50 +0000 (14:27 +0100)]
drivers: st: pmic: update stpmic1 driver

Change-Id: I4a1b281925e0a3a1e2a34b3e363537e4a7f13823
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
5 years agostm32mp1: update device tree files
Yann Gautier [Thu, 17 Jan 2019 18:16:03 +0000 (19:16 +0100)]
stm32mp1: update device tree files

The drivers are also updated to reflect the changes.
Set RCC as non-secure.

Change-Id: I568fa1f418355830ad1d4d1cdcdb910fb362231b
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agostm32mp1: rename stpmu1 to stpmic1
Yann Gautier [Wed, 16 Jan 2019 17:31:00 +0000 (18:31 +0100)]
stm32mp1: rename stpmu1 to stpmic1

This is the correct name of the IP.
Rename stm32mp1_pmic files to stm32mp_pmic.

Change-Id: I238a7d1f9a1d099daf7788dc9ebbd3146ba2f15f
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agodrivers: st: move i2c driver in its own folder
Yann Gautier [Thu, 17 Jan 2019 08:34:18 +0000 (09:34 +0100)]
drivers: st: move i2c driver in its own folder

The driver could be used for other devices than PMIC.

Change-Id: I4569e7c0028e52e1ff2fe9d38f11de11e95d1897
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agowarp7: Define DTB overlay address in memory map
Bryan O'Donoghue [Thu, 29 Nov 2018 15:59:14 +0000 (15:59 +0000)]
warp7: Define DTB overlay address in memory map

This patch defines the expected DTB overlay address in the memory map for
this platform. Its important that all points in the boot process agree on
this memory map even if not all elements utilize it.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
5 years agowarp7: io_storage: Remove DTB from FIP
Bryan O'Donoghue [Thu, 29 Nov 2018 14:46:05 +0000 (14:46 +0000)]
warp7: io_storage: Remove DTB from FIP

Recently upstreamed changes to OP-TEE mean that it is possible for OP-TEE
to provide a DTB overlay directly to subsequent boot stages thus negating
the requirement to bundle a DTB in the FIP.

This patch switches off the dependency on the DTB in the FIP descriptor
instead we will provide the necessary data as an overlay from OP-TEE.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
5 years agoMerge pull request #1762 from antonio-nino-diaz-arm/an/fix-readme
Antonio Niño Díaz [Fri, 18 Jan 2019 09:19:00 +0000 (09:19 +0000)]
Merge pull request #1762 from antonio-nino-diaz-arm/an/fix-readme

readme: Update list of supported platforms

5 years agoreadme: Update list of supported platforms
Antonio Nino Diaz [Thu, 17 Jan 2019 12:16:07 +0000 (12:16 +0000)]
readme: Update list of supported platforms

Change-Id: I13b7b16a13f51bcb83098d7c55701f9ee03859a8
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoMerge pull request #1760 from igoropaniuk/rpi3_preloaded_dtb_fix
Antonio Niño Díaz [Thu, 17 Jan 2019 11:05:40 +0000 (11:05 +0000)]
Merge pull request #1760 from igoropaniuk/rpi3_preloaded_dtb_fix

rpi3: fix RPI3_PRELOADED_DTB_BASE usage

5 years agoMerge pull request #1754 from Anson-Huang/master
Antonio Niño Díaz [Thu, 17 Jan 2019 11:05:14 +0000 (11:05 +0000)]
Merge pull request #1754 from Anson-Huang/master

Add i.MX8 SoC SRTC/cpu-freq SIP runtime service support

5 years agoMerge pull request #1733 from vwadekar/tf2.0-tegra-downstream-rebase-1.3.19
Antonio Niño Díaz [Thu, 17 Jan 2019 11:04:47 +0000 (11:04 +0000)]
Merge pull request #1733 from vwadekar/tf2.0-tegra-downstream-rebase-1.3.19

Tegra downstream rebase 1.3.19

5 years agoimx: add cpu-freq SIP runtime service support
Anson Huang [Tue, 15 Jan 2019 02:56:36 +0000 (10:56 +0800)]
imx: add cpu-freq SIP runtime service support

On i.MX8QM/i.MX8QX with system controller inside, the CPU's clock
rate is managed by SCFW(system controller firmware) and can ONLY be
changed from secure world, so SIP runtime service is needed for
setting CPU's clock rate, this patch adds cpu-freq SIP runtime service
support.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
5 years agoimx: add imx8qm/imx8qx SRTC SIP runtime service support
Anson Huang [Tue, 15 Jan 2019 02:34:04 +0000 (10:34 +0800)]
imx: add imx8qm/imx8qx SRTC SIP runtime service support

On i.MX8QM/i.MX8QX with system controller inside, the SRTC is
managed by SCFW(system controller firmware) and some functions
like setting SRTC's time etc. can ONLY be requested from secure
world, so SIP runtime service is needed for such kind of operations,
this patch adds SRTC SIP runtime service support for i.MX8QM and
i.MX8QX.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
5 years agoSupport for NXP's i.MX8 SoCs timer IPC
Anson Huang [Tue, 15 Jan 2019 02:22:06 +0000 (10:22 +0800)]
Support for NXP's i.MX8 SoCs timer IPC

NXP's i.MX8 SoCs have system controller (M4 core) which takes
control of timer management, including watchdog, srtc and system
counter etc., other clusters like Cortex-A35 can send out command
via MU (Message Unit) to system controller for timer operation.

This patch adds timer IPC(inter-processor communication) support.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
5 years agorpi3: fix RPI3_PRELOADED_DTB_BASE usage
Igor Opaniuk [Wed, 16 Jan 2019 21:59:41 +0000 (23:59 +0200)]
rpi3: fix RPI3_PRELOADED_DTB_BASE usage

In case if `RPI3_PRELOADED_DTB_BASE` isn't defined explicitly with
proper pre-loaded DTB address, `add_define` macro defined in
`make_helpers/build_macros.mk` still supplies this definition to the
compiler like `-DRPI3_PRELOADED_DTB_BASE`, and it's obviously is set to
default value 1.

This simply leads to the wrong `MAP_NS_DTB` region definition (base_va
is set `0x1` instead of `0x00010000`) in `plat/rpi3/rpi3_common.c`:

Which causes aligment check to fail in `mmap_add_region_check()`:
VERBOSE: base_pa: 0x00000001, base_va: 0x00000001, size: 0x00010000
...
ERROR:   mmap_add_region_check() failed. error -22

Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
5 years agoTegra186: mce: remove unused type conversions
Anthony Zhou [Mon, 26 Jun 2017 12:33:34 +0000 (20:33 +0800)]
Tegra186: mce: remove unused type conversions

This patch removes unused type conversions as all the relevant macros
now use U()/ULL(), making these explicit typecasts unnecessary.

Change-Id: I01fb534649db2aaf186406b1aef6897662b44fe3
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra210: Enable ECC reporting for B01 SKUs
Sam Payne [Mon, 8 May 2017 19:42:49 +0000 (12:42 -0700)]
Tegra210: Enable ECC reporting for B01 SKUs

This patch enables L2 error correction and parity protection
for Tegra210 on boot and exit from suspend. The previous bootloader
sets the boot parameter, indicating ECC reporting, only for B01 SKUs.

Change-Id: I6927884d375a64c69e2f1e9aed85f95c5e3cb17c
Signed-off-by: Sam Payne <spayne@nvidia.com>
5 years agoTegra210: skip the BTB invalidate workaround for B01 SKUs
Harvey Hsieh [Mon, 24 Apr 2017 11:35:51 +0000 (19:35 +0800)]
Tegra210: skip the BTB invalidate workaround for B01 SKUs

This patch skips the BTB invalidate workaround for Tegra210-B01 chips, as
they have already been fixed in the hardware. To allow the .S file to
include macros, add proper guards to tegra_platform.h.

Change-Id: I0826d3c54faeffc9cb0709331f47cbdf25d4b653
Signed-off-by: Harvey Hsieh <hhsieh@nvidia.com>
5 years agoTegra186: memctrl_v2: Set MC clients ordering as per client needs
Krishna Reddy [Thu, 25 May 2017 18:04:33 +0000 (11:04 -0700)]
Tegra186: memctrl_v2: Set MC clients ordering as per client needs

Set MC Clients ordering as per the clients needs(ordered, BW, ISO/non-ISO)
based on the latest info received from HW team as a part of BW issues debug.

SMMU Client config register are obsolete from T186. Clean up the unnecessary
register definitions and programming of these registers.
Cleanup unnecessary macros as well.

Change-Id: I0d28ae8842a33ed534f6a15bfca3c9926b3d46b2
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
5 years agoTegra210: memmap all the IRAM memory banks
Varun Wadekar [Mon, 12 Jun 2017 23:47:16 +0000 (16:47 -0700)]
Tegra210: memmap all the IRAM memory banks

This patch memmaps all the IRAM memory banks during boot. The BPMP
firmware might place the channels in any of the IRAMs, so it is better
to map all the banks to avoid surprises.

Change-Id: Ia009a65d227ee50fbb23e511ce509daf41b877ee
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: bpmp: fix check to see if Atomics block is powered on
Varun Wadekar [Mon, 12 Jun 2017 23:45:23 +0000 (16:45 -0700)]
Tegra: bpmp: fix check to see if Atomics block is powered on

This patch fixes the logic to check if Atomics hardware block is powered
on during boot

Reported by: Peter De Schrijver <pdeschrijver@nvidia.com>

Change-Id: I4a6521bcee37225d1402321151c48fa631776b8a
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra210: increase MAX_XLAT_TABLES and MAX_MMAP_REGIONS
Varun Wadekar [Wed, 31 May 2017 21:03:00 +0000 (14:03 -0700)]
Tegra210: increase MAX_XLAT_TABLES and MAX_MMAP_REGIONS

This patch updates the macros to include the newly added IRAM
memory apertures.

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

5 years agoTegra186: setup: fix defects flagged by MISRA scan
Anthony Zhou [Tue, 21 Mar 2017 07:58:50 +0000 (15:58 +0800)]
Tegra186: setup: fix defects flagged by MISRA scan

Main fixes:

Added explicit casts (e.g. 0U) to integers in order for them to be
compatible with whatever operation they're used in [Rule 10.1]

Force operands of an operator to the same type category [Rule 10.4]

Added curly braces ({}) around if statements in order to
make them compound [Rule 15.6]

Change-Id: I4840c3122939f736113d61f1462af3bd7b0b5085
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra186: PM: fix MISRA defects in plat_psci_handlers.c
Anthony Zhou [Fri, 3 Mar 2017 08:23:08 +0000 (16:23 +0800)]
Tegra186: PM: fix MISRA defects in plat_psci_handlers.c

Main fixes:

Added explicit casts (e.g. 0U) to integers in order for them to be
compatible with whatever operation they're used in [Rule 10.1]

convert object type to match the type of function parameters
[Rule 10.3]

Force operands of an operator to the same type category [Rule 10.4]

Fix implicit widening of composite assignment [Rule 10.6]

Change-Id: I5840a07f37beefc3326ac56d0b4a4701602bd8a8
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra186: mce: remove unwanted print messages
Varun Wadekar [Wed, 17 May 2017 23:15:43 +0000 (16:15 -0700)]
Tegra186: mce: remove unwanted print messages

This patch removes unwanted error prints from the MCE command
handler, to reduce the code complexity for this function.

Tested with 'pmccabe'

Change-Id: I375d289db1df9e119eeb1830210974457c8905a4
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: remove support for Quasi System power off (SC8) state
Varun Wadekar [Wed, 17 May 2017 21:35:33 +0000 (14:35 -0700)]
Tegra186: remove support for Quasi System power off (SC8) state

This patch removes support for the SC8 power state as the feature is no
longer required for Tegra186 projects.

Change-Id: I622a5ddcffe025b9b798801d09bbb856853befd7
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: sip_calls: fix defects flagged by MISRA scan
Anthony Zhou [Wed, 1 Mar 2017 04:47:37 +0000 (12:47 +0800)]
Tegra: sip_calls: fix defects flagged by MISRA scan

Main fixes:

* Expressions resulting from the expansion of macro parameters
  shall be enclosed in parentheses [Rule 20.7]
* Added explicit casts (e.g. 0U) to integers in order for them
  to be compatible with whatever operation they're used in [Rule
  10.1]
* Fix implicit widening of composite assignment [Rule 10.6]

Change-Id: Ia83c3ab6e4c8c03c19c950978a7936ebfc290590
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: secondary: fix MISRA defects
Anthony Zhou [Tue, 21 Mar 2017 07:50:09 +0000 (15:50 +0800)]
Tegra186: secondary: fix MISRA defects

Main fixes:

Added explicit casts (e.g. 0U) to integers in order for them to be
compatible with whatever operation they're used in [Rule 10.1]

Force operands of an operator to the same type category [Rule 10.4]

Voided non c-library functions whose return types are not used [Rule 17.7]

Change-Id: I758e7ef6d45dd2edf4cd5580e2af15219246e75c
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra: Passing EKS size as boot arg to trusty
Varun Wadekar [Fri, 28 Dec 2018 21:50:20 +0000 (13:50 -0800)]
Tegra: Passing EKS size as boot arg to trusty

* EKS blob size was not passed by as a boot parameter
  earlier. Its being passed now
* If EKS value sent by bootloader is non-zero
  update the boot parameter from default value to the argument
  passed by bootloader

Change-Id: I65a3091bd2c1c908cc9e81c0aab6489cab02c098
Signed-off-by: Akshay Sharan <asharan@nvidia.com>
5 years agoTegra210B01: initialize DRBG on boot and resume
Sam Payne [Mon, 15 May 2017 18:10:37 +0000 (11:10 -0700)]
Tegra210B01: initialize DRBG on boot and resume

DRBG must be initialized to guarantee SRK has a random
value during suspend. This patch add a sequence to generate
an SRK on boot and during resume for SE1 and SE2. This SRK
value is not saved to PMC scratch, and should be overwitten
during atomic suspend.

Change-Id: Id5e2dc74a1b462dd6addaec1709fec46083a6e1c
Signed-off-by: Sam Payne <spayne@nvidia.com>
5 years agoTegra210: bpmp: power management interface
Varun Wadekar [Fri, 5 May 2017 16:20:59 +0000 (09:20 -0700)]
Tegra210: bpmp: power management interface

This patch adds the driver to communicate with the BPMP processor
for power management use cases. BPMP controls the entry into cluster
and system power states. The Tegra210 platform port queries the BPMP
to calculate the target state for the cluster. In case BPMP does not
allow CCx entry, the core enters a power down state.

Change-Id: I9c40aef561607a0b02c49b7f8118570eb9105cc9
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: mce: fix trivial MISRA defects
Anthony Zhou [Mon, 8 May 2017 12:17:08 +0000 (20:17 +0800)]
Tegra186: mce: fix trivial MISRA defects

This patch fixes MISRA defects for the MCE driver.

* Using logical NOT for bool type function
* Using MPIDR_AFFLVL_MASK << MPIDR_AFFINITY_BITS replace
  MPIDR_CLUSTER_MASK

Change-Id: I97e96f172a3c1158646a15a184c273c53a103d63
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra: topology: fix MISRA defects for Rule 4.6
Anthony Zhou [Mon, 8 May 2017 12:34:11 +0000 (20:34 +0800)]
Tegra: topology: fix MISRA defects for Rule 4.6

This patch uses int32_t to replace ints, to fix Rule 4.6 of the
MISRA standard.

Change-Id: I20ac6185929eced684b43da3ef1f8cd5fbddc83d
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>