project/bcm63xx/atf.git
5 years agorcar_gen3: drivers: ddr: Clean up printouts
Marek Vasut [Mon, 21 Jan 2019 22:11:33 +0000 (23:11 +0100)]
rcar_gen3: drivers: ddr: Clean up printouts

Clean up the NOTICE() and FATAL_MSG() outputs, so that they contain
proper newlines and BL2 prefixes.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agorcar_gen3: drivers: cpld: fix power-off on reset
Sergii Boryshchenko [Thu, 30 Nov 2017 12:53:52 +0000 (14:53 +0200)]
rcar_gen3: drivers: cpld: fix power-off on reset

Method cpld_reset_cpu of bl31 is called from the Linux kernel and uses
GPIO6, GPIO2 pins as SPI bus lines to control the CPLD device. But in the
kernel GPIO6_8 pin are initialized to work in interrupt mode instead of
the input/output mode. This leads to the fact that the SPI bus becomes
non-functional. In this patch we switch the GPIO6_8 pin back to the
input-output mode.

Signed-off-by: Sergii Boryshchenko <sergii.boryshchenko@globallogic.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agorcar_gen3: plat: Add missing cpu_on_check() implementation
Marek Vasut [Sat, 5 Jan 2019 15:21:14 +0000 (16:21 +0100)]
rcar_gen3: plat: Add missing cpu_on_check() implementation

The ATF code fails to build with PMIC_ROHM_BD9571=0, add the missing
function into the PWRC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agorcar_gen3: plat: Allow E3 auto-detection
Marek Vasut [Sat, 5 Jan 2019 12:57:16 +0000 (13:57 +0100)]
rcar_gen3: plat: Allow E3 auto-detection

Allow auto-detecting E3 when RCAR_LSI is set to RCAR_AUTO.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agorcar_gen3: plat: Drop unused macro
Marek Vasut [Mon, 21 Jan 2019 22:12:13 +0000 (23:12 +0100)]
rcar_gen3: plat: Drop unused macro

The macro is not used, drop it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoRevert "rcar_gen3: plat: Enable programmable CPU reset address"
Marek Vasut [Tue, 29 Jan 2019 05:06:08 +0000 (06:06 +0100)]
Revert "rcar_gen3: plat: Enable programmable CPU reset address"

This reverts commit d48536e2f92d47ebb92cf12b35133c3be2d0e459,
which misbehaves on R-Car H3 ES2.0. Until the reason for that
misbehavior is understood, revert the commit.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agoMerge pull request #1780 from pmanish87/master
Antonio Niño Díaz [Mon, 28 Jan 2019 12:04:28 +0000 (12:04 +0000)]
Merge pull request #1780 from pmanish87/master

Make device tree pre-processing similar to U-boot/Linux

5 years agoMerge pull request #1773 from grandpaul/rpi3-gpio-driver
Antonio Niño Díaz [Mon, 28 Jan 2019 12:04:13 +0000 (12:04 +0000)]
Merge pull request #1773 from grandpaul/rpi3-gpio-driver

Rpi3 gpio driver

5 years agoMerge pull request #1784 from antonio-nino-diaz-arm/an/includes-arm
Antonio Niño Díaz [Mon, 28 Jan 2019 10:53:29 +0000 (10:53 +0000)]
Merge pull request #1784 from antonio-nino-diaz-arm/an/includes-arm

plat/arm: Cleanup of includes and drivers

5 years agoMerge pull request #1778 from JoelHutton/jh/multiconsole
Antonio Niño Díaz [Mon, 28 Jan 2019 09:21:53 +0000 (09:21 +0000)]
Merge pull request #1778 from JoelHutton/jh/multiconsole

multi_console: Check functions are not NULL

5 years agomulti_console: Check functions are not NULL
Joel Hutton [Tue, 15 Jan 2019 15:40:18 +0000 (15:40 +0000)]
multi_console: Check functions are not NULL

Change-Id: I2d67bb1bebd15e6a7d69ea5e7b6fda9c972f9d86
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
5 years agorpi3: Enable GPIO in BL2
Ying-Chun Liu (PaulLiu) [Mon, 21 Jan 2019 19:27:55 +0000 (03:27 +0800)]
rpi3: Enable GPIO in BL2

This patch inits the GPIO in BL2 earlysetup. So BL2 can start operating
GPIO pins.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
5 years agorpi3: Add GPIO driver
Ying-Chun Liu (PaulLiu) [Thu, 20 Dec 2018 19:32:10 +0000 (03:32 +0800)]
rpi3: Add GPIO driver

This commit adds GPIO driver for RaspberryPi3. The GPIO driver for RPi3
also provides the way to do pinmux selections.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
5 years agofvp: pwrc: Move to drivers/ folder
Antonio Nino Diaz [Wed, 23 Jan 2019 21:50:09 +0000 (21:50 +0000)]
fvp: pwrc: Move to drivers/ folder

Change-Id: I670ea80e0331c2d4b2ccfa563a45469a43f6902d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoplat/arm: sds: Move to drivers/ folder
Antonio Nino Diaz [Wed, 23 Jan 2019 19:06:55 +0000 (19:06 +0000)]
plat/arm: sds: Move to drivers/ folder

Change-Id: Ia601d5ad65ab199e747fb60af4979b7db477d249
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoplat/arm: scp: Move to drivers/ folder
Antonio Nino Diaz [Wed, 23 Jan 2019 18:55:03 +0000 (18:55 +0000)]
plat/arm: scp: Move to drivers/ folder

Change-Id: Ida5dae39478654405d0ee31a6cbddb4579e76a7f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoplat/arm: scpi: Move to drivers/ folder
Antonio Nino Diaz [Fri, 25 Jan 2019 14:23:49 +0000 (14:23 +0000)]
plat/arm: scpi: Move to drivers/ folder

Change-Id: Icc59cdaf2b56f6936e9847f1894594c671db2e94
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoplat/arm: mhu: Move to drivers/ folder
Antonio Nino Diaz [Wed, 23 Jan 2019 21:08:43 +0000 (21:08 +0000)]
plat/arm: mhu: Move to drivers/ folder

Change-Id: I656753a1825ea7340a3708b950fa6b57455e9056
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoplat/arm: scmi: Move to drivers/ folder
Antonio Nino Diaz [Wed, 23 Jan 2019 20:37:32 +0000 (20:37 +0000)]
plat/arm: scmi: Move to drivers/ folder

Change-Id: I8989d2aa0258bf3b50a856c5b81532d578600124
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoplat/arm: Move dynamic xlat enable logic to makefile
Antonio Nino Diaz [Wed, 23 Jan 2019 16:23:07 +0000 (16:23 +0000)]
plat/arm: Move dynamic xlat enable logic to makefile

The PLAT_XLAT_TABLES_DYNAMIC build option, defined in platform_def.h
in Arm platforms, is checked by several headers, affecting their
behaviour. To avoid issues around the include ordering of the headers,
the definition should be moved to the platform's makefile.

Change-Id: I0e12365c8d66309122e8a20790e1641a4f480a10
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoplat/arm: Sanitise includes
Antonio Nino Diaz [Fri, 25 Jan 2019 14:30:04 +0000 (14:30 +0000)]
plat/arm: Sanitise includes

Use full include paths like it is done for common includes.

This cleanup was started in commit d40e0e08283a ("Sanitise includes
across codebase"), but it only cleaned common files and drivers. This
patch does the same to Arm platforms.

Change-Id: If982e6450bbe84dceb56d464e282bcf5d6d9ab9b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agoMerge pull request #1761 from satheesbalya-arm/sb1/sb1_2661_bl31_overlay
Antonio Niño Díaz [Fri, 25 Jan 2019 11:24:40 +0000 (11:24 +0000)]
Merge pull request #1761 from satheesbalya-arm/sb1/sb1_2661_bl31_overlay

plat/arm: Save BL2 descriptors to reserved memory.

5 years agoMerge pull request #1781 from dtwlin/m2
Antonio Niño Díaz [Fri, 25 Jan 2019 10:30:36 +0000 (10:30 +0000)]
Merge pull request #1781 from dtwlin/m2

spd: trusty: trusty_setup should bail on unknown image

5 years agoMerge pull request #1766 from Anson-Huang/master
Antonio Niño Díaz [Fri, 25 Jan 2019 10:29:52 +0000 (10:29 +0000)]
Merge pull request #1766 from Anson-Huang/master

Add more SIP runtime service for i.MX8

5 years agoMerge pull request #1777 from glneo/runtime-gicr
Antonio Niño Díaz [Fri, 25 Jan 2019 09:21:42 +0000 (09:21 +0000)]
Merge pull request #1777 from glneo/runtime-gicr

ti: k3: common: Add support for runtime detection of GICR base address

5 years agoMerge pull request #1779 from Anson-Huang/a53_errata
Antonio Niño Díaz [Fri, 25 Jan 2019 09:21:19 +0000 (09:21 +0000)]
Merge pull request #1779 from Anson-Huang/a53_errata

Enable necessary A53 erratas for i.MX8QM and i.MX8MQ

5 years agoMerge pull request #1776 from vwadekar/tf2.0-tegra-downstream-rebase-1.22.19
Antonio Niño Díaz [Fri, 25 Jan 2019 09:20:32 +0000 (09:20 +0000)]
Merge pull request #1776 from vwadekar/tf2.0-tegra-downstream-rebase-1.22.19

Tf2.0 tegra downstream rebase 1.22.19

5 years agospd: trusty: trusty_setup should bail on unknown image
David Lin [Thu, 24 Jan 2019 22:15:57 +0000 (14:15 -0800)]
spd: trusty: trusty_setup should bail on unknown image

When an unknown Trusty image is found, there's no point of still trying
to register the BL32 init handler. Instead, we just should bail out of
the trusty_setup() and allow the system to continue to boot.

Signed-off-by: David Lin <dtwlin@google.com>
5 years agoMake device tree pre-processing similar to U-boot/Linux
Manish Pandey [Mon, 21 Jan 2019 14:50:10 +0000 (14:50 +0000)]
Make device tree pre-processing similar to U-boot/Linux

Following changes are done to make DT pre-processing similar to that of
U-boot/Linux kernel.

1. Creating seperate CPPFLAGS for DT preprocessing so that compiler
options specific to it can be accommodated.
e.g: "-undef" compiler option avoids replacing "linux" string(used in
device trees) with "1" as "linux" is a pre-defined macro in gnu99
standard.

2. Replace CPP with PP for DT pre-processing, as CPP in U-boot/Linux is
exported as "${CROSS_COMPILE}gcc -E" while in TF-A it is exported as
"${CROSS_COMPILE}cpp".

Change-Id: If4c61a249d51614d9f53ae30b602036d50c02349
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
5 years agoimx: enable necessary errata for i.mx8qm
Anson Huang [Thu, 24 Jan 2019 02:58:58 +0000 (10:58 +0800)]
imx: enable necessary errata for i.mx8qm

NXP's i.MX8QM uses Cortex-A53 r0p4, enable necessary
erratas for it.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
5 years agoimx: enable necessary errata for i.mx8mq
Anson Huang [Thu, 24 Jan 2019 03:00:14 +0000 (11:00 +0800)]
imx: enable necessary errata for i.mx8mq

NXP's i.MX8MQ uses Cortex-A53 r0p4, enable necessary
erratas for it.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
5 years agoTegra186: remove RELOCATE_TO_BL31_BASE config
Varun Wadekar [Thu, 30 Nov 2017 01:16:48 +0000 (17:16 -0800)]
Tegra186: remove RELOCATE_TO_BL31_BASE config

This patch removes this unused config option from the Tegra186
platform makefiles.

Change-Id: Idcdf6854332a26599323a247289c2d3ce19f475f
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: memctrl_v2: remove usage of ENABLE_SMMU_DEVICE config
Varun Wadekar [Thu, 30 Nov 2017 01:14:24 +0000 (17:14 -0800)]
Tegra: memctrl_v2: remove usage of ENABLE_SMMU_DEVICE config

This patch removes the usage of this platform config, as it is always
enabled by all the supported platforms.

Change-Id: Ie7adb641adeb3604b177b6960b797722d60addfa
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: add 'late' platform setup handler
Dilan Lee [Fri, 27 Oct 2017 01:51:09 +0000 (09:51 +0800)]
Tegra: add 'late' platform setup handler

This patch adds a platform setup handler that gets called after
the MMU is enabled. Platforms wanting to make use of this handler
should declare 'plat_late_platform_setup' handler in their platform
files, to override the default weakly defined handler.

Change-Id: Ibc97a2e5a24608ddea856d0bd543a9d5876f604c
Signed-off-by: Dilan Lee <dilee@nvidia.com>
5 years agoTegra: spe: shared console for Tegra platforms
Varun Wadekar [Wed, 15 Nov 2017 23:48:51 +0000 (15:48 -0800)]
Tegra: spe: shared console for Tegra platforms

There are Tegra platforms which have limited UART ports and so
all the components have to share the console. The SPE helps out
by collecting all the logs in such cases and prints them on the
shared UART port.

This patch adds a driver to communicate with the SPE driver, which
in turn provides the console.

Change-Id: Ie750520b936b8bed0ab1d876f03fc0a3490a85a3
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: console driver compilation from platform makefiles
Varun Wadekar [Wed, 15 Nov 2017 23:46:38 +0000 (15:46 -0800)]
Tegra: console driver compilation from platform makefiles

This patch includes the console driver from individual platform
makefiles and removes it from tegra_common.mk. This allows future
platforms to include consoles of their choice.

Change-Id: I7506562bfac78421a80fb6782ac8472fbef6cfb0
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: smmu: change exit criteria for context size calculation
Varun Wadekar [Wed, 8 Nov 2017 22:03:16 +0000 (14:03 -0800)]
Tegra: smmu: change exit criteria for context size calculation

Tegra SoCs currently do not have a SMMU register at address 0xFFFFFFFF.
This patch changes the search criteria, to look for this marker, to
calculate the size of the saved context.

Change-Id: I15d91945ecb78267f91c45f37985dbb2327ca3ae
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: memctrl_v2: platform handler for TZDRAM setup
Steven Kao [Tue, 14 Nov 2017 10:52:05 +0000 (18:52 +0800)]
Tegra: memctrl_v2: platform handler for TZDRAM setup

The Tegra memctrl driver sets up the TZDRAM fence during boot and
system suspend exit. This patch provides individual platforms with
handlers to perform custom steps during TZDRAM setup.

Change-Id: Iee094d6ca189c6dd24f1147003c33c99ff3a953b
Signed-off-by: Steven Kao <skao@nvidia.com>
5 years agoTegra186: save system suspend entry marker to TZDRAM
Varun Wadekar [Fri, 10 Nov 2017 18:26:57 +0000 (10:26 -0800)]
Tegra186: save system suspend entry marker to TZDRAM

This patch adds support to save the system suspend entry and exit
markers to TZDRAM to help the trampoline code decide if the current
warmboot is actually an exit from System Suspend.

The Tegra186 platform handler sets the system suspend entry marker
before entering SC7 state and the trampoline flips the state back to
system resume, on exiting SC7.

Change-Id: I29d73f1693c89ebc8d19d7abb1df1e460eb5558e
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: helper functions for CPU rst handler and SMMU ctx offset
Varun Wadekar [Wed, 8 Nov 2017 22:45:08 +0000 (14:45 -0800)]
Tegra186: helper functions for CPU rst handler and SMMU ctx offset

This patch adds a helper function to get the SMMU context's offset
and uses another helper function to get the CPU trampoline offset.
These helper functions are used by the System Suspend entry sequence
to save the SMMU context and CPU reset handler to TZDRAM.

Change-Id: I95e2862fe37ccad00fa48ec165c6e4024df01147
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: bpmp: return error if BPMP init fails
Varun Wadekar [Wed, 23 Aug 2017 17:19:25 +0000 (10:19 -0700)]
Tegra: bpmp: return error if BPMP init fails

This patch returns error if BPMP initialization fails. The platform
code marks the cluster as "runnning" since we wont be able to get
it into the low power state without BPMP.

Change-Id: I86f51d478626240bb7b4ccede8907674290c5dc1
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: rename secure scratch register macros
Steven Kao [Mon, 23 Oct 2017 10:22:09 +0000 (18:22 +0800)]
Tegra: rename secure scratch register macros

This patch renames all the secure scratch registers to reflect their
usage.

This is a list of all the macros being renamed:

- SECURE_SCRATCH_RSV1_* -> SCRATCH_RESET_VECTOR_*
- SECURE_SCRATCH_RSV6 -> SCRATCH_SECURE_BOOTP_FCFG
- SECURE_SCRATCH_RSV11_* -> SCRATCH_SMMU_TABLE_ADDR_*
- SECURE_SCRATCH_RSV53_* -> SCRATCH_BOOT_PARAMS_ADDR_*
- SECURE_SCRATCH_RSV55_* -> SCRATCH_TZDRAM_ADDR_*

NOTE: Future SoCs will have to define these macros to
      keep the drivers functioning.

Change-Id: Ib3ba40dd32e77b92b47825f19c420e6fdfa8b987
Signed-off-by: Steven Kao <skao@nvidia.com>
5 years agoTegra: memctrl_v2: platform handler for TZDRAM settings
Varun Wadekar [Mon, 30 Oct 2017 21:35:17 +0000 (14:35 -0700)]
Tegra: memctrl_v2: platform handler for TZDRAM settings

The Tegra memctrl driver sets up the TZDRAM fence during boot and
system suspend exit. This patch provides individual platforms with
handlers to perform platform specific steps, e.g. enable encryption,
save base/size to secure scratch registers.

Change-Id: Ifaa2e0eac20b50f77ec734256544c36dd511bd63
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: secondary: fix MISRA violations for Rules 8.6, 11.1
Varun Wadekar [Wed, 25 Oct 2017 18:52:07 +0000 (11:52 -0700)]
Tegra186: secondary: fix MISRA violations for Rules 8.6, 11.1

This patch fixes the following MISRA violations:

Rule 8.6: Externally-linked object or function has "no" definition(s).
Rule 11.1: A cast shall not convert a pointer to a function to
any other type.

Change-Id: Ic1f6fc14c744e54ff782c6987dab9c9430410f5e
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: sanity check target cluster during core power on
Varun Wadekar [Tue, 17 Oct 2017 17:29:24 +0000 (10:29 -0700)]
Tegra186: sanity check target cluster during core power on

This patch sanity checks the target cluster value, during core power on,
by comparing it against the maximum number of clusters supported by the
platform.

Reported by: Rohit Khanna <rokhanna@nvidia.com>

Change-Id: Ia73ccf04bd246403de4ffff6e5c99e3b00fb98ca
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra186: setup: Fix MISRA Rule 8.4 violation
Anthony Zhou [Fri, 22 Sep 2017 08:52:02 +0000 (16:52 +0800)]
Tegra186: setup: Fix MISRA Rule 8.4 violation

MISRA Rule 8.4, A compatible declaration shall be visible when an
object or function with external linkage is defined.

This patch adds static for local array to fix this defect.

Change-Id: I8231448bf1bc0b1e59611d7645ca983b83d5c8e3
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra: bpmp_ipc: IPC driver to communicate with BPMP firmware
Varun Wadekar [Mon, 25 Sep 2017 20:27:45 +0000 (13:27 -0700)]
Tegra: bpmp_ipc: IPC driver to communicate with BPMP firmware

This patch adds the driver to communicate with the BPMP firmware on Tegra
SoCs, starting Tegra186. BPMP firmware is responsible for clock enable/
disable requests, module resets among other things.

MRQ is short for Message ReQuest. This is the general purpose, multi channel
messaging protocol that is widely used to communicate with BPMP. This is further
divided into a common high level protocol and a peer-specific low level protocol.
The higher level protocol specifies the peer identification, channel definition
and allocation, message structure, message semantics and message dispatch process
whereas the lower level protocol defines actual message transfer implementation
details. Currently, BPMP supports two lower level protocols - Token Mail Operations
(TMO), IVC Mail Operations (IMO).

This driver implements the IMO protocol. IMO is implemented using the IVC (Inter-VM
Communication) protocol which is a lockless, shared memory messaging queue management
protocol.

The IVC peer is expected to perform the following as part of establishing a connection
with BPMP.

1. Initialize the channels with tegra_ivc_init() or its equivalent.
2. Reset the channel with tegra_ivc_channel_reset. The peer should also ensure that
   BPMP is notified via the doorbell.
3. Poll until the channel connection is established [tegra_ivc_channel_notified() return
   0]. Interrupt BPMP with doorbell each time after tegra_ivc_channel_notified() return
   non zero.

The IPC driver currently supports reseting the GPCDMAand XUSB_PADCTL hardware blocks. In
future, more hardware blocks would be supported.

Change-Id: I52a4bd3a853de6c4fa410904b6614ff1c63df364
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: call 'early_init' handler earlier during boot
Varun Wadekar [Wed, 20 Sep 2017 22:09:38 +0000 (15:09 -0700)]
Tegra: call 'early_init' handler earlier during boot

This patch calls the 'early_init' handler earlier during boot. This
allows the platforms using Tegra186 onwards to init the BPMP interface
earlier.

Change-Id: I0d540df39de7864ce9051ebe11eca5432c462ebf
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
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 agoplat/arm: Save BL2 descriptors to reserved memory.
Sathees Balya [Thu, 15 Nov 2018 14:22:30 +0000 (14:22 +0000)]
plat/arm: Save BL2 descriptors to reserved memory.

On ARM platforms, the BL2 memory can be overlaid by BL31/BL32. The memory
descriptors describing the list of executable images are created in BL2
R/W memory, which could be possibly corrupted later on by BL31/BL32 due
to overlay. This patch creates a reserved location in SRAM for these
descriptors and are copied over by BL2 before handing over to next BL
image.

Also this patch increases the PLAT_ARM_MAX_BL2_SIZE for juno when TBBR
is enabled.

Fixes ARM-Software/tf-issues#626

Change-Id: I755735706fa702024b4032f51ed4895b3687377f
Signed-off-by: Sathees Balya <sathees.balya@arm.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 agoti: k3: common: Add support for runtime detection of GICR base address
Andrew F. Davis [Tue, 22 Jan 2019 18:39:31 +0000 (12:39 -0600)]
ti: k3: common: Add support for runtime detection of GICR base address

Valid addresses for GICR base are always a set calculable distance from
the GICD and is based on the number of cores a given instance of GICv3 IP
can support. The formula for the number of address bits is given by the
ARM GIC-500 TRM section 3.2 as 2^(18+log2(cores)) with the MSB set to
one for GICR instances. Holes in the GIC address space are also
guaranteed to safely return 0 on reads. This allows us to support runtime
detection of the GICR base address by starting from GIC base address plus
BIT(18) and walking until the GICR ID register (IIDR) is detected. We
stop searching after BIT(20) to prevent searching out into space if
something goes wrong. This can be extended out if we ever have a device
with 16 or more cores.

Signed-off-by: Andrew F. Davis <afd@ti.com>
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>