Commit Graph

6619 Commits

Author SHA1 Message Date
Steven Kao 33a8ba6a38 Tegra194: support for boot params wider than 32-bits
The previous bootloader is not able to pass boot params wider than
32-bits due to an oversight in the scratch register being used. A
new secure scratch register #75 has been assigned to pass the higher
bits.

This patch adds support to parse the higher bits from scratch #75
and use them in calculating the base address for the location of
the boot params.

Scratch #75 format
====================
31:16 - bl31_plat_params high address
15:0 - bl31_params high address

Change-Id: Id53c45f70a9cb370c776ed7c82ad3f2258576a80
Signed-off-by: Steven Kao <skao@nvidia.com>
2020-01-23 09:01:42 -08:00
Puneet Saxena 34a6610aeb Tegra194: memctrl: set reorder depth limit for PCIE blocks
HW bug in third party PCIE IP - PCIE datapath hangs when there are
more than 28 outstanding requests on data backbone for x1 controller.

Suggested SW WAR is to limit reorder_depth_limit to 16 for
PCIE 1W/2AW/3W clients.

Change-Id: Id5448251c35d2a93f66a8b5835ae4044f5cef067
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
2020-01-23 09:01:25 -08:00
Pritesh Raithatha eb41fee452 Tegra194: memctrl: program MC_TXN_OVERRIDE reg for PTCR, MPCORE and MIU
-PTCR is ISO client so setting it to FORCE_NON_COHERENT.
-MPCORER, MPCOREW and MIU0R/W to MIU7R/W clients itself will provide
ordering so no need to override from mc.
-MIU0R/W to MIU7R/W clients registers are not implemented in tegrasim
so skipping it for simulation.
-All the clients need to set CGID_TAG_ADR to maintain request ordering
within a 4K boundary.

Change-Id: Iaa3189a1f3e40fb4cef28be36bc4baeb5ac8f9ca
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
2020-01-23 09:01:10 -08:00
Pritesh Raithatha 90dce0f9c0 Tegra194: memctrl: set CGID_TAG_ADR instead of CGID_TAG_DEFAULT
- All SoC clients should use CGID_TAG_ADR to improve perf
- Remove tegra194_txn_override_cfgs array that is not getting used.

Change-Id: I9130ef5ae8659ed5f9d843ab9a0ecf58b5ce9c74
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
2020-01-23 09:00:50 -08:00
Puneet Saxena 1296da6d85 Tegra194: memctrl: update mss reprogramming as HW PROD settings
Memory clients are divided in to ISO/NonISO/Order/Unordered/Low
BW/High BW. Based on the client types, HW team recommends, different
memory ordering settings, IO coherency settings and SMMU register settings
for optimized performance of the MC clients.

For example ordered ISO clients should be set as strongly ordered and
should bypass SCF and directly access MC hence set as
FORCE_NON_COHERENT. Like this there are multiple recommendations
for all of the MC clients.

This change sets all these MC registers as per HW spec file.

Change-Id: I8a8a0887cd86bf6fe8ac7835df6c888855738cd9
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2020-01-23 09:00:23 -08:00
Arto Merilainen a0cacc955a Tegra194: memctrl: Disable PVARDC coalescer
Due to a hardware bug PVA may perform memory transactions which
cause coalescer faults. This change works around the issue by
disabling coalescer for PVA0RDC and PVA1RDC.

Change-Id: I27d1f6e7bc819fb303dae98079d9277fa346a1d3
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
2020-01-23 08:59:26 -08:00
Puneet Saxena 21e22fe301 Tegra194: memctrl: force seswr/rd transactions as passsthru & coherent
Force memory transactions from seswr and sesrd as coherent_snoop from
no-override. This is necessary as niso clients should use coherent
path.

Presently its set as FORCE_COHERENT_SNOOP. Once SE+TZ is enabled
with SMMU, this needs to be replaced by FORCE_COHERENT.

Change-Id: I8b50722de743b9028129b4715769ef93deab73b5
Signed-off-by: Puneet Saxena <puneets@nvidia.com>
2020-01-23 08:59:12 -08:00
Vignesh Radhakrishnan 1a7a1dcd13 Tegra194: Request CG7 from last core in cluster
- SC7 requires all the cluster groups to be in CG7 state, else
  is_sc7_allowed will get denied
- As a WAR while requesting CC6, request CG7 as well
- CG7 request will not be honored if it is not last core in Cluster
  group
- This is just to satisfy MCE for now as CG7 is going to be defeatured

Change-Id: Ibf2f8a365a2e46bd427abd563da772b6b618350f
Signed-off-by: Vignesh Radhakrishnan <vigneshr@nvidia.com>
2020-01-23 08:58:53 -08:00
steven kao d11f5e0509 Tegra194: toggle SE clock during context save/restore
This patch adds support to toggle SE clock, using the bpmp_ipc
interface, to enable SE context save/restore. The SE sequence mostly
gets called during System Suspend/Resume.

Change-Id: I9cee12a9e14861d5e3c8c4f18b4d7f898b6ebfa7
Signed-off-by: steven kao <skao@nvidia.com>
2020-01-23 08:58:38 -08:00
Varun Wadekar fdc8021a04 Tegra: bpmp: fix header file paths
This patch fixes the header file paths to include debug.h
from the right location.

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: If303792d2169158f436ae6aa5b6d7a4f88e28f7b
2020-01-23 08:58:17 -08:00
Mark Dykes 4302e045fd Merge "Revert "Changes necessary to support SEPARATE_NOBITS_REGION feature"" into integration 2020-01-23 16:11:27 +00:00
Mark Dykes 0908c31a3e Merge "Revert "plat/arm: Add support for SEPARATE_NOBITS_REGION"" into integration 2020-01-23 16:09:42 +00:00
Mark Dykes 3c6ec8f122 Revert "plat/arm: Add support for SEPARATE_NOBITS_REGION"
This reverts commit d433bbdd45.

Change-Id: I46c69dce704a1ce1b50452dd4d62425c4a67f7f0
2020-01-23 16:09:05 +00:00
Alexei Fedorov 5117a53532 Merge "Errata workarounds N1 1043202, 1315703 default off" into integration 2020-01-23 13:36:35 +00:00
laurenw-arm dbafda7cda Errata workarounds N1 1043202, 1315703 default off
Setting errata workarounds for N1 1043202 and 1315703 to 0 since
they should be turned off by default.

Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
Change-Id: I116673a4ddcf64436e90d70133f035a133989ed9
2020-01-23 10:57:53 +00:00
Andrew Walbran 61cbd41d79 qemu: Implement qemu_system_off via semihosting.
This makes the PSCI SYSTEM_OFF call work on QEMU. It assumes that QEMU has
semihosting enabled, but that is already assumed by the image loader.

Signed-off-by: Andrew Walbran <qwandor@google.com>
Change-Id: I0fb7cf7909262b675c3143efeac07f4d60730b03
2020-01-23 10:53:45 +00:00
Andrew Walbran 74464d5b51 qemu: Support ARM_LINUX_KERNEL_AS_BL33 to pass FDT address.
This lets the Linux kernel or any other image which expects an FDT in x0 be
loaded directly as BL33 without a separate bootloader on QEMU.

Signed-off-by: Andrew Walbran <qwandor@google.com>
Change-Id: Ia8eb4710a3d97cdd877af3b8aae36a2de7cfc654
2020-01-23 10:53:44 +00:00
Manish Pandey a74185b1e7 Merge "spm-mm: correcting instructions to build SPM for FVP" into integration 2020-01-23 10:40:24 +00:00
Manish Pandey 09035d109d spm-mm: correcting instructions to build SPM for FVP
Out of two possible implementation of Secure Partition Manager(SPM)
currently only Management mode (MM) design is supported and the support
for SPM based on SPCI Alpha 1 prototype has been removed.

Earlier both implementation used common build flag "ENABLE_SPM" but it
has since been decoupled and MM uses a separate build FLAG "SPM_MM".

Instructions to build it for FVP was still using "ENABLE_SPM", which has
beend corrected in this patch.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I505b98173d6051816436aa602ced6dbec4efc776
2020-01-23 10:10:59 +00:00
Venkatesh Yadav Abbarapu 31ce893ec2 xilinx: versal: PLM to ATF handover
Parse the parameter structure the PLM populates, to populate the
bl32 and bl33 image structures.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I317072d1086f6cc6f90883c1b8b6d086ff57b443
2020-01-23 03:01:22 -07:00
Venkatesh Yadav Abbarapu 4d9f825a56 xilinx: common: Move ATF handover to common file
ATF handover can be used by Xilinx platforms, so move it to common
file from platform specific files.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Change-Id: I5f0839351f534619de581d1953c8427a079487e0
2020-01-23 02:51:33 -07:00
Mark Dykes 3b5454efac Revert "Changes necessary to support SEPARATE_NOBITS_REGION feature"
This reverts commit 76d84cbc60.

Change-Id: I867af7af3d9f5e568101f79b9ebea578e5cb2a4b
2020-01-22 21:52:44 +00:00
Mark Dykes 29d13744cb Merge "plat/arm: Add support for SEPARATE_NOBITS_REGION" into integration 2020-01-22 21:50:44 +00:00
Mark Dykes aa386f7a2f Merge "Changes necessary to support SEPARATE_NOBITS_REGION feature" into integration 2020-01-22 21:50:19 +00:00
Anthony Steinhauser f461fe346b Prevent speculative execution past ERET
Even though ERET always causes a jump to another address, aarch64 CPUs
speculatively execute following instructions as if the ERET
instruction was not a jump instruction.
The speculative execution does not cross privilege-levels (to the jump
target as one would expect), but it continues on the kernel privilege
level as if the ERET instruction did not change the control flow -
thus execution anything that is accidentally linked after the ERET
instruction. Later, the results of this speculative execution are
always architecturally discarded, however they can leak data using
microarchitectural side channels. This speculative execution is very
reliable (seems to be unconditional) and it manages to complete even
relatively performance-heavy operations (e.g. multiple dependent
fetches from uncached memory).

This was fixed in Linux, FreeBSD, OpenBSD and Optee OS:
679db70801
29fb48ace4
3a08873ece
abfd092aa1

It is demonstrated in a SafeSide example:
https://github.com/google/safeside/blob/master/demos/eret_hvc_smc_wrapper.cc
https://github.com/google/safeside/blob/master/kernel_modules/kmod_eret_hvc_smc/eret_hvc_smc_module.c

Signed-off-by: Anthony Steinhauser <asteinhauser@google.com>
Change-Id: Iead39b0b9fb4b8d8b5609daaa8be81497ba63a0f
2020-01-22 21:42:51 +00:00
Deepika Bhavnani 7949041f58 Ignore the ctags file
Signed-off-by: Deepika Bhavnani <deepika.bhavnani@arm.com>
Change-Id: Ic78bda00aba0e350095c3dcd59f688f4a27ed1d4
2020-01-22 16:08:27 +00:00
Sandrine Bailleux d81e38f66e Merge "FDT helper functions: Fix MISRA issues" into integration 2020-01-22 11:57:20 +00:00
Soby Mathew f44d291f23 Merge changes from topic "add-versal-soc-support" into integration
* changes:
  plat: xilinx: Move pm_client.h to common directory
  plat: xilinx: versal: Make silicon default build target
  xilinx: versal: Wire silicon default setup
  versal: Increase OCM memory size for DEBUG builds
  plat: xilinx: versal: Dont set IOU switch clock
  arm64: versal: Adjust cpu clock for versal virtual
  xilinx: versal: Add support for PM_GET_OPERATING_CHARACTERISTIC EEMI call
  plat: versal: Add Get_ChipID API
  plat: xilinx: versal: Add load Pdi API support
  xilinx: versal: Add feature check API
  xilinx: versal: Implement set wakeup source for client
  plat: xilinx: versal: Add GET_CALLBACK_DATA function
  xilinx: versal: Add PSCI APIs for system shutdown & reset
  xilinx: versal: Add PSCI APIs for suspend/resume
  xilinx: versal: Remove no_pmc ops to ON power domain
  xilinx: versal: Add set wakeup source API
  xilinx: versal: Add client wakeup API
  xilinx: versal: Add query data API
  xilinx: versal: Add request wakeup API
  xilinx: versal: Add PM_INIT_FINALIZE API for versal
  xilinx: versal: Add support of PM_GET_TRUSTZONE_VERSION API
  xilinx: versal: enable ipi mailbox service
  xilinx: move ipi mailbox svc to xilinx common
  plat: xilinx: versal: Implement PM IOCTL API
  xilinx: versal: Implement power down/restart related EEMI API
  xilinx: versal: Add SMC handler for EEMI API
  xilinx: versal: Implement PLL related PM APIs
  xilinx: versal: Implement clock related PM APIs
  xilinx: versal: Implement pin control related PM APIs
  xilinx: versal: Implement reset related PM APIs
  xilinx: versal: Implement device related PM APIs
  xilinx: versal: Add support for suspend related APIs
  xilinx: versal: Add get_api_version support
  xilinx: Add support to send PM API to PMC using IPI for versal
  plat: xilinx: versal: Move versal_def.h to include directory
  plat: xilinx: versal: Move versal_private.h to include directory
  plat: xilinx: zynqmp: Use GIC framework for warm restart
2020-01-22 11:12:07 +00:00
Norbert Werner 67878cb0e5 Xilinx zynqmp: add missing pin control group for ethernet 0.
Signed-off-by: Norbert Werner <opensource@lab-w.org>
Change-Id: I3264515e5901689328861964ff664ff08b6e852c
2020-01-22 10:36:23 +00:00
Masahiro Yamada c3fc368a5a xlat_tables_v2: simplify end address checks in mmap_add_region_check()
Use end_va and end_pa defined at the beginning of this function.

Change-Id: I0e8b3b35fceb87b5d35397eb892d4fe92ba90b4c
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-01-22 18:35:43 +09:00
Sandrine Bailleux c9c0b66f9a Merge "Set lld as the default linker for Clang builds" into integration 2020-01-22 07:58:48 +00:00
Andre Przywara feb358b651 FDT helper functions: Fix MISRA issues
Moving the FDT helper functions to the common/ directory exposed the file
to MISRA checking, which is mandatory for common code.

Fix the complaints that the test suite reported.

Change-Id: Ica8c8a95218bba5a3fd92a55407de24df58e8476
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-01-22 07:52:18 +00:00
Madhukar Pappireddy d433bbdd45 plat/arm: Add support for SEPARATE_NOBITS_REGION
In order to support SEPARATE_NOBITS_REGION for Arm platforms, we need to load
BL31 PROGBITS into secure DRAM space and BL31 NOBITS into SRAM. Hence mandate
the build to require that ARM_BL31_IN_DRAM is enabled as well.

Naturally with SEPARATE_NOBITS_REGION enabled, the BL31 initialization code
cannot be reclaimed to be used for runtime data such as secondary cpu stacks.

Memory map for BL31 NOBITS region also has to be created.

Change-Id: Ibd480f82c1dc74e9cbb54eec07d7a8fecbf25433
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2020-01-21 20:12:05 -06:00
Madhukar Pappireddy 76d84cbc60 Changes necessary to support SEPARATE_NOBITS_REGION feature
Since BL31 PROGBITS and BL31 NOBITS sections are going to be
in non-adjacent memory regions, potentially far from each other,
some fixes are needed to support it completely.

1. adr instruction only allows computing the effective address
of a location only within 1MB range of the PC. However, adrp
instruction together with an add permits position independent
address of any location with 4GB range of PC.

2. Since BL31 _RW_END_ marks the end of BL31 image, care must be
taken that it is aligned to page size since we map this memory
region in BL31 using xlat_v2 lib utils which mandate alignment of
image size to page granularity.

Change-Id: Ic745c5a130fe4239fa2742142d083b2bdc4e8b85
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2020-01-21 19:24:18 -06:00
Manish Pandey e5eaf885cc Merge "Replace dts includes with C preprocessor syntax" into integration 2020-01-21 21:06:16 +00:00
Olivier Deprez 22eaa8702a Merge "cert_create: Remove some unused header files inclusions" into integration 2020-01-21 15:26:21 +00:00
Manish Pandey b449642a2c Merge "allwinner: Clean up MMU setup" into integration 2020-01-21 10:08:29 +00:00
Sandrine Bailleux 004c922852 Merge changes Ib1ed9786,I6c4855c8 into integration
* changes:
  plat: imx: Correct the SGIs that used for secure interrupt
  plat: imx8mm: Add the support for opteed spd on imx8mq/imx8mm
2020-01-21 09:06:47 +00:00
Sandrine Bailleux 3b3d406ebc Merge "docs: Add upcoming Change Log to Table of Contents" into integration 2020-01-21 08:01:16 +00:00
Manish Pandey 7b787899fb Merge changes from topic "tegra-downstream-01082020" into integration
* changes:
  Tegra194: platform handler for entering CPU standby state
  Tegra194: memctrl: force viw and vifalr/w transactions as non-coherent
  Tegra194: memctrl: fix bug in client order id reg value generation
  Tegra194: memctrl: enable mc coalescer
  Tegra194: update scratch registers used to read boot parameters
  Tegra194: implement system shutdown/reset handlers
  Tegra194: mce: support for shutdown and reboot
  Tegra194: request CG7 before checking if SC7 is allowed
  Tegra194: config to enable/disable strict checking mode
  Tegra194: remove unused platform configs
  Tegra194: restore XUSB stream IDs on System Resume
2020-01-20 23:05:41 +00:00
Samuel Holland ddb4c9e04c allwinner: Clean up MMU setup
Remove the general BL31 mmap region: it duplicates the existing static
mapping for the entire SRAM region. Use the helper definitions when
applicable to simplify the code and add the MT_EXECUTE_NEVER flag.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Change-Id: I7a6b79e50e4b5c698774229530dd3d2a89e94a6d
2020-01-20 22:47:20 +00:00
Manish Pandey 7b3ab4ebda Merge "plat: xilinx: zynqmp: Add checksum support for IPI data" into integration 2020-01-20 22:25:54 +00:00
Manish Pandey 7ae80e5e80 Merge "zynqmp: pm_service: Add support to query max divisor" into integration 2020-01-20 22:24:13 +00:00
Manish Pandey 24d7deb8a9 Merge "rpi3/4: Add support for offlining CPUs" into integration 2020-01-20 22:16:43 +00:00
Soby Mathew 0a910952f6 Merge changes from topic "ld/mtd_framework" into integration
* changes:
  doc: stm32mp1: Update build command line
  fdts: stm32mp1: remove second QSPI flash instance
  stm32mp1: Add support for SPI-NOR boot device
  stm32mp1: Add support for SPI-NAND boot device
  spi: stm32_qspi: Add QSPI support
  fdts: stm32mp1: update for FMC2 pin muxing
  stm32mp1: Add support for raw NAND boot device
  fmc: stm32_fmc2_nand: Add FMC2 driver support
  stm32mp1: Reduce MAX_XLAT_TABLES to 4
  io: stm32image: fix device_size type
  stm32mp: add DT helper for reg by name
  stm32mp1: add compilation flags for boot devices
  lib: utils_def: add CLAMP macro
  compiler_rt: Import popcountdi2.c and popcountsi2.c files
  Add SPI-NOR framework
  Add SPI-NAND framework
  Add SPI-MEM framework
  Add raw NAND framework
2020-01-20 10:52:15 +00:00
Lionel Debieve ac7764bbcb doc: stm32mp1: Update build command line
Add new flags for storage support that must be used in the build
command line. Add the complete build steps for an OP-TEE configuration.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Change-Id: I0c682f6eb0aab83aa929f4ba734d3151c264aeed
2020-01-20 11:32:59 +01:00
Lionel Debieve 46e9b7a091 fdts: stm32mp1: remove second QSPI flash instance
Remove second flash node as only one must be used
by QSPI NOR driver.

Change-Id: I48189f2fdf4e0455aabe7d4cd9b2f3d36bb9cfb5
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
2020-01-20 11:32:59 +01:00
Lionel Debieve b1b218fb1b stm32mp1: Add support for SPI-NOR boot device
STM32MP1 platform is able to boot from SPI-NOR devices.
These modifications add this support using the new
SPI-NOR framework.

Change-Id: I75ff9eba4661f9fb87ce24ced2bacbf8558ebe44
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
2020-01-20 11:32:59 +01:00
Lionel Debieve 5704422814 stm32mp1: Add support for SPI-NAND boot device
STM32MP1 platform is able to boot from SPI-NAND devices.
These modifications add this support using the new
SPI-NAND framework.

Change-Id: I0d5448bdc4bde153c1209e8043846c0f935ae5ba
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
2020-01-20 11:32:59 +01:00
Lionel Debieve 0581a88778 spi: stm32_qspi: Add QSPI support
Add QSPI support (limited to read interface).
Implements the memory map and indirect modes.
Low level driver based on SPI-MEM operations.

Change-Id: Ied698e6de3c17d977f8b497c81f2e4a0a27c0961
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
2020-01-20 11:32:59 +01:00