Commit Graph

7163 Commits

Author SHA1 Message Date
Varun Wadekar 42080d4892 Tegra: remove circular dependency with common_def.h
This patch stops including common_def.h from platform_def.h to
fix a circular depoendency between them.

This means platform_def.h now has to define the linker macros:
* PLATFORM_LINKER_FORMAT
* PLATFORM_LINKER_ARCH

Change-Id: Icd540b1bd32fb37e0e455e9146c8b7f4b314e012
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-21 19:00:05 -07:00
Varun Wadekar a5bfcad851 Tegra: include missing stdbool.h
This patch includes the missing stdbool.h header from flowctrl.h
and bpmp_ivc.c files.

Change-Id: If60d19142b1cb8ae663fbdbdf1ffe45cbbdbc1b2
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-21 19:00:05 -07:00
Kalyani Chidambaram 2bf1085d58 Tegra: remove support for SEPARATE_CODE_AND_RODATA=0
Tegra platforms will not be supporting SEPARATE_CODE_AND_RODATA=0.

This patch uses the common macros provided by bl_common.h as a result
and adds a check to assert if SEPARATE_CODE_AND_RODATA set is not set
to '1'.

Change-Id: I376ea60c00ad69cb855d89418bdb80623f14800e
Signed-off-by: Kalyani Chidambaram <kalyanic@nvidia.com>
2020-03-21 19:00:05 -07:00
Mark Dykes 577aca8662 Merge "Bug fix: Protect TSP prints with lock" into integration 2020-03-20 19:18:46 +00:00
Olivier Deprez 7f164a83a9 context: TPIDR_EL2 register not saved/restored
TPIDR_EL2 is missing from the EL2 state register save/restore
sequence. This patch adds it to the context save restore routines.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I35fc5ee82f97b72bcedac57c791312e7b3a45251
2020-03-20 16:15:28 +00:00
Manish Pandey 6e7b203613 Merge "fvp: use two instances of Cactus at S-EL1" into integration 2020-03-20 15:46:18 +00:00
Manish Pandey 1d88b8fa8b Merge "spmc: manifest changes to support two sample cactus secure partitions" into integration 2020-03-20 09:51:50 +00:00
Manish Pandey a16c4d3a3f Merge "docs: remove uefi-tools in hikey and hikey960" into integration 2020-03-20 09:30:02 +00:00
Madhukar Pappireddy 76a7fc23c1 Changelog updates for recent commits
Change-Id: I09191a51dd9ee673c54b422ba4eb35c46c6dc30e
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2020-03-20 02:33:04 -05:00
Madhukar Pappireddy ae7b922d87 Bug fix: Protect TSP prints with lock
CPUs use console to print debug/info messages. This critical section
must be guarded by locks to avoid overlaps in messages from multiple
CPUs.

Change-Id: I786bf90072c1ed73c4f53d8c950979d95255e67e
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2020-03-20 01:46:21 -05:00
Manish Pandey 6cdd55d1c5 Merge "el3_entrypoint_common: avoid overwriting arg3" into integration 2020-03-19 22:35:13 +00:00
Manish Pandey 161dbc4364 fvp: use two instances of Cactus at S-EL1
To demonstrate communication between SP's two instances of Cactus at
S-EL1 has been used.
This patch replaces Ivy SP with cactus-secondary SP which aligns with
changes in tf-a-tests repository.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Iee84f1f7f023b7c4f23fbc13682a42614a7f3707
2020-03-19 21:12:36 +00:00
Olivier Deprez 3d5ed6dee2 spmc: manifest changes to support two sample cactus secure partitions
When using the SPM Dispatcher, the SPMC sits as a BL32 component
(BL32_IMAGE_ID). The SPMC manifest is passed as the TOS fw config
component (TOS_FW_CONFIG_ID). It defines platform specific attributes
(memory range and physical CPU layout) as well as the attributes for
each secure partition (mostly load address). This manifest is passed
to the SPMC on boot up. An SP package contains the SP dtb in the SPCI
defined partition manifest format. As the SPMC manifest was enriched
it needs an increase of tos_fw-config max-size in fvp_fw_config dts.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ia1dce00c6c4cbaa118fa56617980d32e2956a94e
2020-03-19 18:15:19 +01:00
Sandrine Bailleux f097fb70c3 Merge changes from topic "tegra-downstream-03122020" into integration
* changes:
  Tegra: assembly version of the 'plat_core_pos_by_mpidr' handler
  Tegra194: reset power state info for CPUs
  tlkd: remove system off/reset handlers
  Tegra186: system resume from TZSRAM memory
  Tegra186: disable PROGRAMMABLE_RESET_ADDRESS
  Tegra210: SE: switch SE clock source to CLK_M
  Tegra: increase platform assert logging level to VERBOSE
  spd: trusty: disable error messages seen during boot
  Tegra194: enable dual execution for EL2 and EL3
  Tegra: aarch64: calculate core position from one place
  Tegra194: Update t194_nvg.h to v6.7
2020-03-19 11:09:37 +00:00
Varun Wadekar 0ac1bf7218 Tegra: assembly version of the 'plat_core_pos_by_mpidr' handler
The 'plat_core_pos_by_mpidr' handler gets called very early during boot
and the compiler generated code overwrites the caller's registers.

This patch converts the 'plat_core_pos_by_mpidr' handler into an assembly
function and uses registers x0-x3, to fix this anomaly.

Change-Id: I8d974e007a0bad039defaf77b11a180d899ead3c
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-18 17:47:42 -07:00
Varun Wadekar 89121c2764 Tegra194: reset power state info for CPUs
We set deepest power state when offlining a core but that may not be
requested by non-secure sw which controls idle states. It will re-init
this info from non-secure software when the core come online.

This patch resets the power state in the non-secure world context
to allow it to start with a clean slate.

Change-Id: Iafd92cb2a49571aa6eeb9580beaaff4ba55a87dc
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-18 17:47:36 -07:00
Varun Wadekar 0600cf6300 tlkd: remove system off/reset handlers
TLK does not participate in the system off/reset process and so
has no use for the SYSTEM_OFF/RESET notifications.

This patch removes the system off/reset handlers as a result.

Change-Id: Icf1430b1400cea88000e6d54426eb604a43cbe6c
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-18 17:47:32 -07:00
Varun Wadekar 2139c9c8bf Tegra186: system resume from TZSRAM memory
TZSRAM loses power during System suspend, so the entire contents
are copied to TZDRAM before Sysem Suspend entry. The warmboot code
verifies and restores the contents to TZSRAM during System Resume.

This patch removes the code that sets up CPU vector to point to
TZSRAM during System Resume as a result. The trampoline code can
also be completely removed as a result.

Change-Id: I2830eb1db16efef3dfd96c4e3afc41a307588ca1
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-18 17:47:27 -07:00
Varun Wadekar 8336c94dc4 Tegra186: disable PROGRAMMABLE_RESET_ADDRESS
This patch disables the code to program reset vector for secondary
CPUs to a different entry point, than cold boot. The cold boot entry
point has the ability to differentiate between a cold boot and a warm
boot, that is controlled by the PROGRAMMABLE_RESET_ADDRESS macro. By
reusing the same entry point, we can lock the CPU reset vector during
cold boot.

Change-Id: Iad400841d57c139469e1d29b5d467197e11958c4
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-18 17:47:22 -07:00
Leo He 35aa1c1e51 Tegra210: SE: switch SE clock source to CLK_M
In SE suspend, switch SE clock source to CLK_M,
to make sure SE clock is on when saving SE context

Change-Id: I57c559825a3ec8e0cc35f7a389afc458a5eed0cb
Signed-off-by: Leo He <leoh@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-18 17:47:17 -07:00
Varun Wadekar 61c418ba75 Tegra: increase platform assert logging level to VERBOSE
This patch increases the assert logging level for all Tegra platforms
to VERBOSE, to print the actual assertion condition to the console,
improving debuggability.

Change-Id: If3399bde63fa4261522cab984cc9c49cd2073358
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-18 17:47:13 -07:00
Varun Wadekar a1e12ded4f spd: trusty: disable error messages seen during boot
Platforms that do not support Trusty, usually see error
messages from the Trusty SPD, during boot. This can be
interpreted as a boot failure.

This patch lowers the logging level for those error messages
to avoid confusion.

Change-Id: I931baa2c6db0de1aee17383039bc29ed229a1f25
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-18 17:47:08 -07:00
Kalyani Chidambaram d55b8f6a89 Tegra194: enable dual execution for EL2 and EL3
This patch enables dual execution optimized translations for EL2 and EL3
CPU exception levels.

Change-Id: I28fe98bb05687400f247e94adf44a1f3a85c38b1
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-03-18 17:47:03 -07:00
Kalyani Chidambaram 3bab03eb4b Tegra: aarch64: calculate core position from one place
This patch updates 'plat_my_core_pos' handler to call
'plat_core_pos_from_mpidr' instead of implementing the same logic
at two places.

Change-Id: I1e56adaa10dc2fe3440e5507e0e260d8932e6657
Signed-off-by: Kalyani Chidambaram <kalyanic@nvidia.com>
2020-03-18 17:46:58 -07:00
Kalyani Chidambaram 0be136d293 Tegra194: Update t194_nvg.h to v6.7
This patch updates the t194_nvg.h header file received from the CPU
team to v6.7.

Change-Id: I5d25dfc60448e14b7085250946bd002fcb80a774
Signed-off-by: Kalyani Chidambaram <kalyanic@nvidia.com>
2020-03-18 17:46:52 -07:00
Sandrine Bailleux c979685271 Merge changes from topic "rpix-multi-console" into integration
* changes:
  rpi: docs: Update maintainers file to new RPi directory scheme
  rpi: console: Autodetect Mini-UART vs. PL011 configuration
  rpi3: build: Include GPIO driver in all BL stages
  rpi: Allow using PL011 UART for RPi3/RPi4
  rpi3: console: Use same "clock-less" setup scheme as RPi4
  rpi3: gpio: Simplify GPIO setup
2020-03-18 16:44:40 +00:00
Manish Pandey ea32cf5049 Merge "Implement SMCCC_ARCH_SOC_ID SMC call" into integration 2020-03-18 13:55:33 +00:00
Olivier Deprez cfb3f73344 Merge "FVP: In BL31/SP_MIN, map only the needed DRAM region statically" into integration 2020-03-18 10:38:39 +00:00
Manish Pandey 7a20da4380 Merge "board/rddaniel: add NSAID sources for TZC400 driver" into integration 2020-03-17 22:04:01 +00:00
Madhukar Pappireddy 493545b3c0 FVP: In BL31/SP_MIN, map only the needed DRAM region statically
Rather than creating entry in plat_arm_mmap array to map the
entire DRAM region in BL31/SP_MIN, only map a smaller region holding
HW_CONFIG DTB. Consequently, an increase in number of sub-translation
tables(level-2 and level-3) i.e., MAX_XLAT_TABLES is necessary to map
the new region in memory.

In order to accommodate the increased code size in BL31 i.e.,
PROGBITS, the max size of BL31 image is increased by 0x1000(4K).

Change-Id: I540b8ee550588e22a3a9fb218183d2ab8061c851
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2020-03-17 14:31:24 -05:00
Andre Przywara 9aaae8e671 rpi: docs: Update maintainers file to new RPi directory scheme
With the addition of the Raspberry Pi 4 port the directory structure
changed a bit, also the new port didn't have a separate entry.

Add a new entry for the RPi4 port and adjust the path names.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Change-Id: I04b60e729a19bb0cc3dd6ce6899ec6480356b1f1
2020-03-17 13:44:55 +00:00
Andre Przywara 9cc3fa1b8a rpi: console: Autodetect Mini-UART vs. PL011 configuration
The Raspberry Pi has two different UART devices pin-muxed to GPIO 14&15:
One ARM PL011 one and the 8250 compatible "Mini-UART".
A dtoverlay parameter in config.txt will tell the firmware to switch
between the two: it will setup the right clocks and will configure the
pinmuxes accordingly.

To autodetect the user's choice, we read the pinmux register and check
its setting: ALT5 (0x2) means the Mini-UART is used, ALT0 (0x4) points
to the PL011.
Based on that we select the UART driver to initialise.

This will allow console output in any case.

Change-Id: I620d3ce68de6c6576599f2a405636020e1fd1376
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-03-17 13:44:55 +00:00
Andre Przywara 29e8c46066 rpi3: build: Include GPIO driver in all BL stages
So far the Raspberry Pi 3 build needs the GPIO driver just for BL2.
Upcoming changes will require some GPIO code in BL1 and BL31 also, so
move those driver files into the common source section.

This does not affect BL31 code size at all, and bl1.bin just increases
by 144 bytes, but doesn't affect the padded binary size at all.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Change-Id: I7639746dc241c1e69099d85d2671c65fa0108555
2020-03-17 13:44:55 +00:00
Andre Przywara 5e6d821cb3 rpi: Allow using PL011 UART for RPi3/RPi4
The Broadcom 283x SoCs feature multiple UARTs: the mostly used
"Mini-UART", which is an 8250 compatible IP, and at least one PL011.
While the 8250 is usually used for serial console purposes, it suffers
from a design flaw, where its clock depends on the VPU clock, which can
change at runtime. This will reliably mess up the baud rate.
To avoid this problem, people might choose to use the PL011 UART for
the serial console, which is pin-mux'ed to the very same GPIO pins.
This can be done by adding "miniuart-bt" to the "dtoverlay=" line in
config.txt.

To prepare for this situation, use the newly gained freedom of sharing
one console_t pointer across different UART drivers, to introduce the
option of choosing the PL011 for the console.

This is for now hard-coded to choose the Mini-UART by default.
A follow-up patch will introduce automatic detection.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Change-Id: I8cf2522151e09ff4ff94a6d396aec6fc4b091a05
2020-03-17 13:44:49 +00:00
Andre Przywara 795aefe5e8 rpi3: console: Use same "clock-less" setup scheme as RPi4
In the wake of the upcoming unification of the console setup code
between RPi3 and RPi4, extend the "clock-less" setup scheme to the
RPi3. This avoid programming any clocks or baud rate registers,
which makes the port more robust against GPU firmware changes.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Change-Id: Ida83a963bb18a878997e9cbd55f8ceac6a2e1c1f
2020-03-17 12:44:09 +00:00
Andre Przywara 0d92745e10 rpi3: gpio: Simplify GPIO setup
There is really no reason to use and pass around a struct when its only
member is the (fixed) base address.

Remove the struct and just use the base address on its own inside the
GPIO driver. Then set the base address automatically.

This simplifies GPIO setup for users, which now don't need to deal with
zeroing a struct and setting the base address anymore.

Change-Id: I3060f7859e3f8ef9a24cc8fb38307b5da943f127
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-03-17 12:44:09 +00:00
Manish V Badarkhe 0e753437e7 Implement SMCCC_ARCH_SOC_ID SMC call
Implemented SMCCC_ARCH_SOC_ID call in order to get below
SOC information:

1. SOC revision
2. SOC version

Implementation done using below SMCCC specification document:
https://developer.arm.com/docs/den0028/c

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: Ie0595f1c345a6429a6fb4a7f05534a0ca9c9a48b
2020-03-17 10:14:35 +00:00
Igor Opaniuk 98a69dfd4a plat: imx: imx8qm: apply clk/pinmux configuration for DEBUG_CONSOLE
Having DEBUG_CONSOLE enabled without enabling DEBUG_CONSOLE_A53
doesn't make sense (since UART pinmux/clock configuration is applied
for UART only when DEBUG_CONSOLE_A53 is enabled).

Enable DEBUG_CONSOLE_A53 if DEBUG_CONSOLE is enabled.

Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Change-Id: I8ca411d5544658b9bcc39e5340ec042c51088b96
2020-03-16 23:21:42 +02:00
Igor Opaniuk fc1596b347 plat: imx: imx8qm: provide debug uart num as build param
This removes hardcoded iomux/clk/addr configuration for debug uart,
provides possibility (as a workaround, till that information isn't
provided via DT) to set this configuration during compile time via
IMX_DEBUG_UART build flag.

Usage:
$ make PLAT=imx8qm IMX_DEBUG_UART=1 bl31

Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Change-Id: Ib5f5dd81ba0c8ad2b2dc5647ec75629072f511c5
2020-03-16 23:21:36 +02:00
Igor Opaniuk 965c07815f plat: imx: imx8_iomux: fix shift-overflow errors
This fixes shift overflow errors, when compiled with CONSOLE_DEBUG
support:

plat/imx/common/include/imx8_iomux.h:11:35: error: result of ‘1 << 31’
requires 33 bits to represent, but ‘int’ only has 32 bits
[-Werror=shift-overflow=]

Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Change-Id: I0488e22c30314ba27caabc5c767164baa1e8004c
2020-03-16 22:49:16 +02:00
Mark Dykes 5e9369e818 Merge "fconf: Add namespace guidance inside documentation" into integration 2020-03-16 18:35:36 +00:00
Louis Mayencourt a6de824f7e fconf: Clean Arm IO
Merge the previously introduced arm_fconf_io_storage into arm_io_storage. This
removes the duplicate io_policies and functions definition.

This patch:
- replace arm_io_storage.c with the content of arm_fconf_io_storage.c
- rename the USE_FCONF_BASED_IO option into ARM_IO_IN_DTB.
- use the ARM_IO_IN_DTB option to compile out io_policies moved in dtb.
- propagate DEFINES when parsing dts.
- use ARM_IO_IN_DTB to include or not uuid nodes in fw_config dtb.
- set the ARM_IO_IN_DTB to 0 by default for fvp. This ensure that the behavior
  of fvp stays the same as it was before the introduction of fconf.

Change-Id: Ia774a96d1d3a2bccad29f7ce2e2b4c21b26c080e
Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
2020-03-16 11:49:19 +00:00
Haojian Zhuang 3888c2d4da docs: remove uefi-tools in hikey and hikey960
Since uefi-tools isn't used any more in hikey and hikey960, update the
documents.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Change-Id: I0843d27610e241d442e58b6cd71967998730a35d
2020-03-14 10:24:41 +08:00
Sandrine Bailleux bb37363bd3 Merge "SPMD: Add support for SPCI_ID_GET" into integration 2020-03-13 14:29:50 +00:00
Sandrine Bailleux 6b354cf351 Merge "Add a .gitreview file for convenience" into integration 2020-03-13 12:11:52 +00:00
Louis Mayencourt 2fc18a25f5 plat/sgi: Bump bl1 RW limit
Increase bl1 RW limit to allow future development.

Change-Id: I3159b36dbaca798b4c4374c1415cd033d6586388
Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
2020-03-13 10:40:57 +00:00
Sandrine Bailleux 4c9ad0df66 Merge "juno/sgm: Maximize space allocated to SCP_BL2" into integration 2020-03-13 08:06:04 +00:00
Mark Dykes e820759f1c Merge "Mention COT build option in trusted-board-boot-build.rst" into integration 2020-03-12 18:04:09 +00:00
Mark Dykes bd2ad92902 Merge "Update cryptographic algorithms in TBBR doc" into integration 2020-03-12 18:03:05 +00:00
Max Shvetsov ac03ac5ebb SPMD: Add support for SPCI_ID_GET
This patch introduces the `SPCI_ID_GET` interface which will return the
ID of the calling SPCI component. Returns 0 for requests from the
non-secure world and the SPCI component ID as specified in the manifest
for secure world requests.

Change-Id: Icf81eb1d0e1d7d5c521571e04972b6e2d356e0d1
Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com>
Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
2020-03-12 16:59:29 +00:00