project/bcm63xx/atf.git
5 years agoMerge pull request #1783 from thloh85-intel/integration_v2
Antonio Niño Díaz [Mon, 4 Feb 2019 18:14:58 +0000 (18:14 +0000)]
Merge pull request #1783 from thloh85-intel/integration_v2

plat: intel: Add BL2 support for Stratix 10 SoC

5 years agoMerge pull request #1803 from sandrine-bailleux-arm/sb/arm-bl33-fixes
Antonio Niño Díaz [Mon, 4 Feb 2019 11:27:35 +0000 (11:27 +0000)]
Merge pull request #1803 from sandrine-bailleux-arm/sb/arm-bl33-fixes

Fixes related to BL33 image on Arm platforms

5 years agoMerge pull request #1796 from grandpaul/rpi3-sdhost-driver
Antonio Niño Díaz [Mon, 4 Feb 2019 11:26:00 +0000 (11:26 +0000)]
Merge pull request #1796 from grandpaul/rpi3-sdhost-driver

RPi3 SDHost driver

5 years agoplat: intel: Add BL2 support for Stratix 10 SoC
Loh Tien Hock [Mon, 4 Feb 2019 08:17:24 +0000 (16:17 +0800)]
plat: intel: Add BL2 support for Stratix 10 SoC

This adds BL2 support for Intel Stratix 10 SoC FPGA.
Functionality includes:
- Release and setup peripherals from reset
- Calibrate DDR
- ECC DDR Scrubbing
- Load FIP (bl31 and bl33)

Signed-off-by: Loh Tien Hock <tien.hock.loh@intel.com>
5 years agoMerge pull request #1800 from sandrine-bailleux-arm/sb/load-img-v2
Antonio Niño Díaz [Fri, 1 Feb 2019 11:43:17 +0000 (11:43 +0000)]
Merge pull request #1800 from sandrine-bailleux-arm/sb/load-img-v2

Remove dead code related to LOAD_IMAGE_V2=0

5 years agoMerge pull request #1802 from oscardagrach/master
Antonio Niño Díaz [Fri, 1 Feb 2019 11:42:09 +0000 (11:42 +0000)]
Merge pull request #1802 from oscardagrach/master

hikey960: EDMAC: leave channel 0 as secure

5 years agoArm platforms: Fix max size of BL33 image
Sandrine Bailleux [Thu, 31 Jan 2019 14:06:21 +0000 (15:06 +0100)]
Arm platforms: Fix max size of BL33 image

The BL33 image must not go past the end of DRAM.

Change-Id: I56668ab760d82332d69a8904d125d9a055aa91d5
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
5 years agoArm platforms: Rename PLAT_ARM_NS_IMAGE_OFFSET
Sandrine Bailleux [Thu, 31 Jan 2019 14:01:32 +0000 (15:01 +0100)]
Arm platforms: Rename PLAT_ARM_NS_IMAGE_OFFSET

PLAT_ARM_NS_IMAGE_OFFSET is in fact not an offset relative to some base
address, it is an absolute address. Rename it to avoid any confusion.

Change-Id: I1f7f5e8553cb267786afe7e5f3cd4d665b610d3f
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
5 years agomaintainers: Add maintainter for Raspberry Pi 3 platform.
Ying-Chun Liu (PaulLiu) [Thu, 31 Jan 2019 21:27:32 +0000 (05:27 +0800)]
maintainers: Add maintainter for Raspberry Pi 3 platform.

This patch adds myself to co-maintainer list of Raspberry Pi 3
platform.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
5 years agorpi3: Enable SDHost driver in BL2
Ying-Chun Liu (PaulLiu) [Tue, 29 Jan 2019 20:20:38 +0000 (04:20 +0800)]
rpi3: Enable SDHost driver in BL2

This patch inits SDHost in BL2 earlysetup. BL2 can start operating mmc
commands to read/write MMC raw blocks.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
5 years agorpi3: Add SDHost driver
Ying-Chun Liu (PaulLiu) [Tue, 29 Jan 2019 20:17:32 +0000 (04:17 +0800)]
rpi3: Add SDHost driver

This commit adds SDHost driver for RaspberryPi3. SDHost driver uses the
GPIO driver to connect the SDCard and SDHost. By using this driver it is
able to read/write raw blocks on SDCard.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
5 years agoMerge pull request #1801 from sandrine-bailleux-arm/sb/doc
Antonio Niño Díaz [Thu, 31 Jan 2019 17:03:17 +0000 (17:03 +0000)]
Merge pull request #1801 from sandrine-bailleux-arm/sb/doc

User Guide: Move ARM_PLAT_MT doc to Arm build flags

5 years agoUser Guide: Move ARM_PLAT_MT doc to Arm build flags
Sandrine Bailleux [Thu, 31 Jan 2019 12:12:41 +0000 (13:12 +0100)]
User Guide: Move ARM_PLAT_MT doc to Arm build flags

ARM_PLAT_MT build flag is specific to Arm platforms so should not
be classified as a common build option.

Change-Id: I79e411958846759a5b60d770e53f44bbec5febe6
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
5 years agoRemove dead code related to LOAD_IMAGE_V2=0
Sandrine Bailleux [Wed, 30 Jan 2019 15:27:16 +0000 (16:27 +0100)]
Remove dead code related to LOAD_IMAGE_V2=0

Commit ed51b51f7a9163a ("Remove build option LOAD_IMAGE_V2") intended
to remove all code related to LOAD_IMAGE_V2=0 but missed a few things.

Change-Id: I16aaf52779dd4af1e134e682731328c5f1e5d622
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
5 years agohikey960: EDMAC: leave channel 0 as secure
Ryan Grachek [Fri, 11 Jan 2019 14:33:00 +0000 (08:33 -0600)]
hikey960: EDMAC: leave channel 0 as secure

Channel 0 is used to communicate with LPM3, a coprocessor
for power management. Leave it as secure.

Signed-off-by: Ryan Grachek <ryan@edited.us>
5 years agoMerge pull request #1798 from pbeesley-arm/pb/fix-code-style
Antonio Niño Díaz [Thu, 31 Jan 2019 13:32:31 +0000 (13:32 +0000)]
Merge pull request #1798 from pbeesley-arm/pb/fix-code-style

doc: Fix broken code blocks in coding guidelines

5 years agodoc: Fix broken code blocks in coding guidelines
Paul Beesley [Thu, 31 Jan 2019 11:39:01 +0000 (11:39 +0000)]
doc: Fix broken code blocks in coding guidelines

Sections 2.2, 2.3 and 2.4 contained example code blocks that were not
being formatted properly due to missing newlines.

Change-Id: I0dbce90c931cf69e4f47d2ccbcc8bc0e20f8fd66
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
5 years agoMerge pull request #1797 from antonio-nino-diaz-arm/an/remove-smccc-v2
Antonio Niño Díaz [Thu, 31 Jan 2019 10:23:06 +0000 (10:23 +0000)]
Merge pull request #1797 from antonio-nino-diaz-arm/an/remove-smccc-v2

Remove support for the SMC Calling Convention 2.0

5 years agoMerge pull request #1745 from svenauhagen/bugfix/a8k
Antonio Niño Díaz [Thu, 31 Jan 2019 10:22:50 +0000 (10:22 +0000)]
Merge pull request #1745 from svenauhagen/bugfix/a8k

Armada8k GPIO Register macro fix

5 years agoMerge pull request #1793 from marex/arm/master/fixes-v2.0.0
Antonio Niño Díaz [Thu, 31 Jan 2019 10:22:36 +0000 (10:22 +0000)]
Merge pull request #1793 from marex/arm/master/fixes-v2.0.0

Arm/master/fixes v2.0.0

5 years agoMerge pull request #1792 from satheesbalya-arm/sb1/sb1_2159_v84_xlat
Antonio Niño Díaz [Thu, 31 Jan 2019 09:24:08 +0000 (09:24 +0000)]
Merge pull request #1792 from satheesbalya-arm/sb1/sb1_2159_v84_xlat

lib/xlat_tables: Add support for ARMv8.4-TTST

5 years agoMerge pull request #1795 from pbeesley-arm/pb/code-style
Antonio Niño Díaz [Thu, 31 Jan 2019 09:23:40 +0000 (09:23 +0000)]
Merge pull request #1795 from pbeesley-arm/pb/code-style

Move coding guidelines into docs directory

5 years agoMerge pull request #1753 from Yann-lms/emmc_ret
Antonio Niño Díaz [Thu, 31 Jan 2019 09:20:45 +0000 (09:20 +0000)]
Merge pull request #1753 from Yann-lms/emmc_ret

mmc: correctly check ret in mmc_fill_device_info

5 years agoRemove support for the SMC Calling Convention 2.0
Antonio Nino Diaz [Wed, 30 Jan 2019 16:01:49 +0000 (16:01 +0000)]
Remove support for the SMC Calling Convention 2.0

This reverts commit 2f370465241c ("Add support for the SMC Calling
Convention 2.0").

SMCCC v2.0 is no longer required for SPM, and won't be needed in the
future. Removing it makes the SMC handling code less complicated.

The SPM implementation based on SPCI and SPRT was using it, but it has
been adapted to SMCCC v1.0.

Change-Id: I36795b91857b2b9c00437cfbfed04b3c1627f578
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
5 years agolib/xlat_tables: Add support for ARMv8.4-TTST
Sathees Balya [Fri, 25 Jan 2019 11:36:01 +0000 (11:36 +0000)]
lib/xlat_tables: Add support for ARMv8.4-TTST

ARMv8.4-TTST (Small Translation tables) relaxes the lower limit on the
size of translation tables by increasing the maximum permitted value
of the T1SZ and T0SZ fields in TCR_EL1, TCR_EL2, TCR_EL3, VTCR_EL2 and
VSTCR_EL2.

This feature is supported in AArch64 state only.

This patch adds support for this feature to both versions of the
translation tables library. It also removes the static build time
checks for virtual address space size checks to runtime assertions.

Change-Id: I4e8cebc197ec1c2092dc7d307486616786e6c093
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
5 years agoMerge pull request #1791 from antonio-nino-diaz-arm/an/rk-gic
Antonio Niño Díaz [Wed, 30 Jan 2019 09:53:07 +0000 (09:53 +0000)]
Merge pull request #1791 from antonio-nino-diaz-arm/an/rk-gic

rockchip: Fix GICv2 interrupts

5 years agoMerge pull request #1789 from Anson-Huang/lpm
Antonio Niño Díaz [Wed, 30 Jan 2019 09:52:48 +0000 (09:52 +0000)]
Merge pull request #1789 from Anson-Huang/lpm

Add power optimization for i.MX8QM/i.MX8QX

5 years agoMerge pull request #1788 from laroche/rpi3_duplicate_initialization
Antonio Niño Díaz [Tue, 29 Jan 2019 13:44:10 +0000 (13:44 +0000)]
Merge pull request #1788 from laroche/rpi3_duplicate_initialization

rpi3: Remove duplicate initialization for BL32_IMAGE_ID and mark one more function as static.

5 years agoMerge pull request #1786 from laroche/static_vars_functions
Antonio Niño Díaz [Tue, 29 Jan 2019 13:43:46 +0000 (13:43 +0000)]
Merge pull request #1786 from laroche/static_vars_functions

Change some vars and functions to be static.

5 years agoMerge pull request #1794 from Andre-ARM/fiptool-fix
Antonio Niño Díaz [Tue, 29 Jan 2019 13:43:29 +0000 (13:43 +0000)]
Merge pull request #1794 from Andre-ARM/fiptool-fix

tools/fiptool: Fix UUID parsing in blob handling

5 years agodoc: Add details on #include ordering
Paul Beesley [Tue, 22 Jan 2019 11:36:41 +0000 (11:36 +0000)]
doc: Add details on #include ordering

This patch adds more details on #include directive use, including (pun
not intended) the desired ordering, grouping and variants (<> or "").

Change-Id: Ib024ffc4d3577c63179e1bbc408f0d0462026312
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
5 years agodoc: Reorder coding guidelines document
Paul Beesley [Mon, 21 Jan 2019 16:11:28 +0000 (16:11 +0000)]
doc: Reorder coding guidelines document

This patch attempts to make the guidelines clearer by reordering
the sections and grouping similar topics.

Change-Id: I1418d6fc060d6403fe3e1978f32fd54b8793ad5b
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
5 years agodoc: Link coding guidelines to user guide
Paul Beesley [Mon, 21 Jan 2019 12:06:24 +0000 (12:06 +0000)]
doc: Link coding guidelines to user guide

Adds a link from user-guide.rst to coding-guidelines.rst and merges
the information about using checkpatch from both files into the user
guide document.

Change-Id: Iffbb4225836a042d20024faf28b8bdd6b2c4043e
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
5 years agodoc: Clarify ssize_t use in coding guidelines
Paul Beesley [Mon, 21 Jan 2019 12:02:09 +0000 (12:02 +0000)]
doc: Clarify ssize_t use in coding guidelines

Change-Id: I083f673f37495d2e53c704a43a0892231b6eb281
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
5 years agodoc: Add AAPCS link to coding guidelines
Paul Beesley [Mon, 21 Jan 2019 11:57:42 +0000 (11:57 +0000)]
doc: Add AAPCS link to coding guidelines

Change-Id: Id0e6d272b6d3d37eab785273f9c12c093191f3fc
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
5 years agodoc: Add Coding Guidelines document
Paul Beesley [Thu, 17 Jan 2019 15:44:37 +0000 (15:44 +0000)]
doc: Add Coding Guidelines document

This content has been imported and adapted from the TF GitHub wiki
article 'ARM-Trusted-Firmware-Coding-Guidelines'.

The aim is to increase the visibility of the coding guidelines by
including them as part of the documentation that is within the TF
repository.

Additionally, the documentation can then be linked to by other
documents in the docs/ directory without worrying about broken links
to, for example, the external wiki.

Change-Id: I9d8cd6b5117b707c1a113baeba7fc5e1b4bf33bc
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
5 years agotools/fiptool: Fix UUID parsing in blob handling
Andre Przywara [Tue, 29 Jan 2019 09:25:14 +0000 (09:25 +0000)]
tools/fiptool: Fix UUID parsing in blob handling

Commit 033648652f ("Make TF UUID RFC 4122 compliant") changed the scanf
parsing string to handle endianness correctly.
However that changed the number of items sscanf handles, without
adjusting the sanity check just below.

Increase the expected return value from 11 to 16 to let fiptool handle
UUIDs given as blob parameters correctly again.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
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 agoimx: power optimization for i.mx8qx
Anson Huang [Thu, 24 Jan 2019 08:50:02 +0000 (16:50 +0800)]
imx: power optimization for i.mx8qx

Current implementation of i.MX8QX power management related
features does NOT optimize power number, all system resources
like CCI, DDR, and A cluster etc. are kept in STBY mode (powered
ON) when system suspend or CPU hotplug.

To lower the power number, OFF mode should be adopted for those
system resources whenever they can be OFF, A cluster will be OFF
if the CPUs in the cluster are all off line, DDR/MU/DB can be OFF
if system suspend, IRQ steer can be OFF if the wakeup source is
belonged to system controller partition, so wakeup source runtime
check is used to determine if IRQ steer can be OFF before system
suspend.

If resources are powered off for suspend, they should be restored
properly after system resume.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
5 years agoimx: power optimization for i.mx8qm
Anson Huang [Thu, 24 Jan 2019 08:09:52 +0000 (16:09 +0800)]
imx: power optimization for i.mx8qm

Current implementation of i.MX8QM power management related
features does NOT optimize power number, all system resources
like CCI, DDR, and A cluster etc. are kept in STBY mode (powered
ON) when system suspend or CPU hotplug.

To lower the power number, OFF mode should be adopted for those
system resources whenever they can be OFF, A cluster will be OFF
if the CPUs in the cluster are all off line, DDR/MU/DB can be OFF
if system suspend, IRQ steer can be OFF if the wakeup source is
belonged to system controller partition, so wakeup source runtime
check is used to determine if IRQ steer can be OFF before system
suspend.

If resources are powered off for suspend, they should be restored
properly after system resume.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
5 years agorpi3: mark one more function as static
Florian La Roche [Mon, 28 Jan 2019 19:39:51 +0000 (20:39 +0100)]
rpi3: mark one more function as static

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
5 years agorpi3: remove duplicate initialization for BL32_IMAGE_ID
Florian La Roche [Mon, 28 Jan 2019 19:27:46 +0000 (20:27 +0100)]
rpi3: remove duplicate initialization for BL32_IMAGE_ID

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
5 years agorockchip: Fix GICv2 interrupts
Antonio Nino Diaz [Mon, 28 Jan 2019 14:35:40 +0000 (14:35 +0000)]
rockchip: Fix GICv2 interrupts

After the removal of deprecated interfaces in TF 2.0 the migration to
the new GIC driver interfaces was done incorrectly in rk3328 and rk3368:
2d6f1f01b141 ("rockchip: Migrate to new interfaces").

In the GICv2 driver it is mandated that all interrupts are Group 0
interrupts. This patch simply moves all Group 1 interrupts to Group 0.

Change-Id: I224c0135603eb5b81bd512976361500c0d129a91
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.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 agoChange some vars and functions to be static.
Florian La Roche [Sun, 27 Jan 2019 13:30:12 +0000 (14:30 +0100)]
Change some vars and functions to be static.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
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>