]> git.baikalelectronics.ru Git - arm-tf.git/log
arm-tf.git
5 years agoMerge "context: TPIDR_EL2 register not saved/restored" into integration
Manish Pandey [Tue, 24 Mar 2020 11:22:28 +0000 (11:22 +0000)]
Merge "context: TPIDR_EL2 register not saved/restored" into integration

5 years agoMerge "spmd: skip loading of secure partitions on pre-v8.4 platforms" into integration
Alexei Fedorov [Tue, 24 Mar 2020 11:06:08 +0000 (11:06 +0000)]
Merge "spmd: skip loading of secure partitions on pre-v8.4 platforms" into integration

5 years agospmd: skip loading of secure partitions on pre-v8.4 platforms
Olivier Deprez [Thu, 19 Mar 2020 08:27:11 +0000 (09:27 +0100)]
spmd: skip loading of secure partitions on pre-v8.4 platforms

When SPD=spmd and SPMD_SPM_AT_SEL2=0, that is SPMC sits at S-EL1
then there is no need for TF-A to load secure partitions individually.
In this configuration, SPMC handles secure partition loading at
S-EL1/EL0 levels.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I06a0d88a4811274a8c347ce57b56bb5f64e345df

5 years agoMerge changes from topic "static_analysis" into integration
Manish Pandey [Mon, 23 Mar 2020 17:37:48 +0000 (17:37 +0000)]
Merge changes from topic "static_analysis" into integration

* changes:
  io: io_stm32image: correct possible NULL pointer dereference
  plat/st: correctly check pwr-regulators node
  nand: stm32_fmc2_nand: correct xor_ecc.val assigned value
  plat/st: correct static analysis tool warning
  raw_nand: correct static analysis tool warning
  spi: stm32_qspi: correct static analysis issues

5 years agoio: io_stm32image: correct possible NULL pointer dereference
Yann Gautier [Wed, 18 Mar 2020 13:50:50 +0000 (14:50 +0100)]
io: io_stm32image: correct possible NULL pointer dereference

This issue was found with cppcheck in our downstream code:
[drivers/st/io/io_stm32image.c:234] -> [drivers/st/io/io_stm32image.c:244]:
 (warning) Either the condition 'buffer!=0U' is redundant or there is
 possible null pointer dereference: local_buffer.

Change-Id: Ieb615b7e485dc93bbeeed4cd8bf845eb84c14ac9
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agoplat/st: correctly check pwr-regulators node
Yann Gautier [Wed, 18 Mar 2020 13:35:27 +0000 (14:35 +0100)]
plat/st: correctly check pwr-regulators node

This warning was issued by cppcheck in our downstream code:
[plat/st/common/stm32mp_dt.c:629] -> [plat/st/common/stm32mp_dt.c:634]:
 (warning) Identical condition 'node<0', second condition is always false

The second test has to check variable pwr_regulators_node.

Change-Id: I4a20c4a3ac0ef0639c2df36309d90a61c02b511f
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agonand: stm32_fmc2_nand: correct xor_ecc.val assigned value
Yann Gautier [Wed, 18 Mar 2020 13:07:55 +0000 (14:07 +0100)]
nand: stm32_fmc2_nand: correct xor_ecc.val assigned value

The variable is wrongly set to 0L, whereas it is an unsigned int, it should
then be 0U.

Change-Id: I0b164c0ea598ec8a503f1693da2f3789f59da238
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agoplat/st: correct static analysis tool warning
Yann Gautier [Wed, 11 Mar 2020 16:17:51 +0000 (17:17 +0100)]
plat/st: correct static analysis tool warning

Correct the following sparse warnings:
plat/st/common/stm32mp_dt.c:103:5: warning:
 symbol 'fdt_get_node_parent_address_cells' was not declared.
 Should it be static?
plat/st/common/stm32mp_dt.c:123:5: warning:
 symbol 'fdt_get_node_parent_size_cells' was not declared.
 Should it be static?

As those 2 functions are only used by assert(), put them under
ENABLE_ASSERTIONS flag.

Change-Id: Iad721f12128df83a3de3f53e7920a9c1dce64c56
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agoraw_nand: correct static analysis tool warning
Yann Gautier [Wed, 11 Mar 2020 16:16:49 +0000 (17:16 +0100)]
raw_nand: correct static analysis tool warning

Correct the following warning given by sparse tool:
include/drivers/raw_nand.h:158:3: warning:
 symbol '__packed' was not declared. Should it be static?

Change-Id: I03bd9a8aee5cdc5212ce5225be8033f1a6e92bd9
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agospi: stm32_qspi: correct static analysis issues
Yann Gautier [Wed, 11 Mar 2020 16:09:21 +0000 (17:09 +0100)]
spi: stm32_qspi: correct static analysis issues

Sparse issue:
drivers/st/spi/stm32_qspi.c:445:5:
 warning: symbol 'stm32_qspi_init' was not declared. Should it be static?

Cppcheck issue:
[drivers/st/spi/stm32_qspi.c:175] -> [drivers/st/spi/stm32_qspi.c:187]:
 (style) Variable 'len' is reassigned a value before the old one has been
 used.
[drivers/st/spi/stm32_qspi.c:178]:
 (style) The scope of the variable 'timeout' can be reduced.

Change-Id: I575fb50766355a6717cbd193fc4a80ff1923014c
Signed-off-by: Yann Gautier <yann.gautier@st.com>
5 years agoMerge "allwinner: H6: Fix GPIO and CCU memory map addresses" into integration
Manish Pandey [Mon, 23 Mar 2020 15:35:16 +0000 (15:35 +0000)]
Merge "allwinner: H6: Fix GPIO and CCU memory map addresses" into integration

5 years agoMerge changes from topic "tegra-downstream-03192020" into integration
Manish Pandey [Mon, 23 Mar 2020 15:24:02 +0000 (15:24 +0000)]
Merge changes from topic "tegra-downstream-03192020" into integration

* changes:
  Tegra194: move cluster and CPU counter to header file.
  Tegra: gicv2: initialize target masks
  spd: tlkd: support new TLK SMCs for RPMB service
  Tegra210: trigger CPU0 hotplug power on using FC
  Tegra: memctrl: cleanup streamid override registers
  Tegra: memctrl_v2: remove support to secure TZSRAM
  Tegra: include platform headers from individual makefiles
  Tegra210: rename ENABLE_WDT_LEGACY_FIQ_HANDLING macro
  Tegra194: SiP function ID to read SMMU_PER registers
  Tegra: memctrl: map video memory as uncached
  Tegra: remove support for USE_COHERENT_MEM
  Tegra: remove circular dependency with common_def.h
  Tegra: include missing stdbool.h
  Tegra: remove support for SEPARATE_CODE_AND_RODATA=0

5 years agoMerge "plat/arm/sgi: mark remote chip shared ram as non-cacheable" into integration
Manish Pandey [Mon, 23 Mar 2020 12:00:57 +0000 (12:00 +0000)]
Merge "plat/arm/sgi: mark remote chip shared ram as non-cacheable" into integration

5 years agoMerge changes I8ca411d5,Ib5f5dd81,I0488e22c into integration
Manish Pandey [Mon, 23 Mar 2020 11:28:28 +0000 (11:28 +0000)]
Merge changes I8ca411d5,Ib5f5dd81,I0488e22c into integration

* changes:
  plat: imx: imx8qm: apply clk/pinmux configuration for DEBUG_CONSOLE
  plat: imx: imx8qm: provide debug uart num as build param
  plat: imx: imx8_iomux: fix shift-overflow errors

5 years agoallwinner: H6: Fix GPIO and CCU memory map addresses
Andre Przywara [Tue, 17 Mar 2020 00:07:31 +0000 (00:07 +0000)]
allwinner: H6: Fix GPIO and CCU memory map addresses

The base address for both the GPIO and the clock unit of the H6 memory map
have been typo-ed. Fix them to match the Linux DT and the manual.

The H6 code use neither of them, so this doesn't change or fix anything
in the real world, but should be corrected anyway.

The issue was found and reported by Github user "armlabs".

Change-Id: Ic6fdfb732ce1cfc54cbb927718035624a06a9e08
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
5 years agoTegra194: move cluster and CPU counter to header file.
Anthony Zhou [Mon, 11 Mar 2019 07:50:32 +0000 (15:50 +0800)]
Tegra194: move cluster and CPU counter to header file.

MISRA rules request that the cluster and CPU counter be unsigned
values and have a suffix 'U'. If the define located in the makefile,
this cannot be done.

This patch moves the PLATFORM_CLUSTER_COUNT and PLATFORM_MAX_CPUS_PER_CLUSTER
macros to tegra_def.h as a result.

Change-Id: I9ef0beb29485729de204b4ffbb5241b039690e5a
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
5 years agoTegra: gicv2: initialize target masks
Varun Wadekar [Fri, 5 Oct 2018 18:24:54 +0000 (11:24 -0700)]
Tegra: gicv2: initialize target masks

This patch initializes the target masks in the GICv2 driver
data, for all PEs. This will allow platforms to set the PE
target for SPIs.

Change-Id: I7bf2ad79c04c2555ab310acba17823fb157327a3
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agospd: tlkd: support new TLK SMCs for RPMB service
Mustafa Yigit Bilgen [Mon, 3 Dec 2018 23:53:38 +0000 (15:53 -0800)]
spd: tlkd: support new TLK SMCs for RPMB service

This patch adds support to handle following TLK SMCs:
{TLK_SET_BL_VERSION, TLK_LOCK_BL_INTERFACE, TLK_BL_RPMB_SERVICE}

These SMCs need to be supported in ATF in order to forward them to
TLK. Otherwise, these functionalities won't work.

Brief:
TLK_SET_BL_VERSION: This SMC is issued by the bootloader to supply its
version to TLK. TLK can use this to prevent rollback attacks.

TLK_LOCK_BL_INTERFACE: This SMC is issued by bootloader before handing off
execution to the OS. This allows preventing sensitive SMCs being used
by the OS.

TLK_BL_RPMB_SERVICE: bootloader issues this SMC to sign or verify RPMB
frames.

Tested by: Tests TLK can receive the new SMCs issued by bootloader

Change-Id: I57c2d189a5f7a77cea26c3f8921866f2a6f0f944
Signed-off-by: Mustafa Yigit Bilgen <mbilgen@nvidia.com>
5 years agoTegra210: trigger CPU0 hotplug power on using FC
sumitg [Fri, 8 Feb 2019 10:44:06 +0000 (16:14 +0530)]
Tegra210: trigger CPU0 hotplug power on using FC

Hotplug poweron is not working for boot CPU as it's being
triggerred using PMC and not with Flow Controller. This is
happening because "cpu_powergate_mask" is only getting set
for non-boot CPU's as the boot CPU's first bootup follows
different code path. The patch is marking a CPU as ON within
"cpu_powergate_mask" when turning its power domain on
during power on. This will ensure only first bootup on all
CPU's is using PMC and subsequent hotplug poweron will be
using Flow Controller.

Change-Id: Ie9e86e6f9a777d41508a93d2ce286f31307932c2
Signed-off-by: sumitg <sumitg@nvidia.com>
5 years agoTegra: memctrl: cleanup streamid override registers
Pritesh Raithatha [Mon, 7 Jan 2019 06:32:09 +0000 (12:02 +0530)]
Tegra: memctrl: cleanup streamid override registers

Streamid override registers are passed to memctrl to program bypass
streamid for all the registers. There is no reason to bypass SMMU
for any of the client so need to remove register list and do not
set streamid_override_cfg.

Some Tegra186 platforms don't boot due to SDMMC failure so keep SDMMC
bypass as of now. Will revisit once these issues are fixed.

Change-Id: I3f67e2a0e1b53160e2218f3acace7da45532f934
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
5 years agoTegra: memctrl_v2: remove support to secure TZSRAM
Varun Wadekar [Thu, 24 Jan 2019 00:54:12 +0000 (16:54 -0800)]
Tegra: memctrl_v2: remove support to secure TZSRAM

This patch removes support to secure the on-chip TZSRAM memory for
Tegra186 and Tegra194 platforms as the previous bootloader does that
for them.

Change-Id: I50c7b7f9694285fe31135ada09baed1cfedaaf07
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: include platform headers from individual makefiles
Varun Wadekar [Fri, 18 Jan 2019 00:36:23 +0000 (16:36 -0800)]
Tegra: include platform headers from individual makefiles

This patch modifies PLAT_INCLUDES to include individual Tegra SoC
headers from the platform's makefile.

Change-Id: If5248667f4e58ac18727d37a18fbba8e53f2d7b5
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra210: rename ENABLE_WDT_LEGACY_FIQ_HANDLING macro
Varun Wadekar [Tue, 29 Jan 2019 01:00:32 +0000 (17:00 -0800)]
Tegra210: rename ENABLE_WDT_LEGACY_FIQ_HANDLING macro

This patch renames 'ENABLE_WDT_LEGACY_FIQ_HANDLING' macro to
'ENABLE_TEGRA_WDT_LEGACY_FIQ_HANDLING', to indicate that this
is a Tegra feature.

Change-Id: I5c4431e662223ee80efbfd5ec2513f8b1cadfc50
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra194: SiP function ID to read SMMU_PER registers
Varun Wadekar [Mon, 10 Dec 2018 21:28:25 +0000 (13:28 -0800)]
Tegra194: SiP function ID to read SMMU_PER registers

This patch introduces SiP function ID, 0xC200FF00, to read SMMU_PER
error records from all supported SMMU blocks.

The register values are passed over to the client via CPU registers
X1 - X3, where

X1 = SMMU_PER[instance #1] | SMMU_PER[instance #0]
X2 = SMMU_PER[instance #3] | SMMU_PER[instance #2]
X3 = SMMU_PER[instance #5] | SMMU_PER[instance #4]

Change-Id: Id56263f558838ad05f6021f8432e618e99e190fc
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: memctrl: map video memory as uncached
Ken Chang [Fri, 28 Dec 2018 00:44:12 +0000 (08:44 +0800)]
Tegra: memctrl: map video memory as uncached

Memmap video memory as uncached normal memory by adding flag
'MT_NON_CACHEABLE' in mmap_add_dynamic_region().
This improves the time taken for clearing the non-overlapping video
memory:

test conditions: 32MB memory size, EMC running at 1866MHz, t186
1) without MT_NON_CACHEABLE: 30ms ~ 40ms
<3>[  133.852885]  vpr-heap: update vpr base to 0x00000000c6000000, size=e000000
<3>[  133.860471] _tegra_set_vpr_params[120]: begin
<3>[  133.896481] _tegra_set_vpr_params[123]: end
<3>[  133.908944]  vpr-heap: update vpr base to 0x00000000c6000000, size=c000000
<3>[  133.916397] _tegra_set_vpr_params[120]: begin
<3>[  133.956369] _tegra_set_vpr_params[123]: end
<3>[  133.970394]  vpr-heap: update vpr base to 0x00000000c6000000, size=a000000
<3>[  133.977934] _tegra_set_vpr_params[120]: begin
<3>[  134.013874] _tegra_set_vpr_params[123]: end
<3>[  134.025666]  vpr-heap: update vpr base to 0x00000000c6000000, size=8000000
<3>[  134.033512] _tegra_set_vpr_params[120]: begin
<3>[  134.065996] _tegra_set_vpr_params[123]: end
<3>[  134.075465]  vpr-heap: update vpr base to 0x00000000c6000000, size=6000000
<3>[  134.082923] _tegra_set_vpr_params[120]: begin
<3>[  134.113119] _tegra_set_vpr_params[123]: end
<3>[  134.123448]  vpr-heap: update vpr base to 0x00000000c6000000, size=4000000
<3>[  134.130790] _tegra_set_vpr_params[120]: begin
<3>[  134.162523] _tegra_set_vpr_params[123]: end
<3>[  134.172413]  vpr-heap: update vpr base to 0x00000000c6000000, size=2000000
<3>[  134.179772] _tegra_set_vpr_params[120]: begin
<3>[  134.209142] _tegra_set_vpr_params[123]: end

2) with MT_NON_CACHEABLE: 10ms ~ 18ms
<3>[  102.108702]  vpr-heap: update vpr base to 0x00000000c6000000, size=e000000
<3>[  102.116296] _tegra_set_vpr_params[120]: begin
<3>[  102.134272] _tegra_set_vpr_params[123]: end
<3>[  102.145839]  vpr-heap: update vpr base to 0x00000000c6000000, size=c000000
<3>[  102.153226] _tegra_set_vpr_params[120]: begin
<3>[  102.164201] _tegra_set_vpr_params[123]: end
<3>[  102.172275]  vpr-heap: update vpr base to 0x00000000c6000000, size=a000000
<3>[  102.179638] _tegra_set_vpr_params[120]: begin
<3>[  102.190342] _tegra_set_vpr_params[123]: end
<3>[  102.197524]  vpr-heap: update vpr base to 0x00000000c6000000, size=8000000
<3>[  102.205085] _tegra_set_vpr_params[120]: begin
<3>[  102.216112] _tegra_set_vpr_params[123]: end
<3>[  102.224080]  vpr-heap: update vpr base to 0x00000000c6000000, size=6000000
<3>[  102.231387] _tegra_set_vpr_params[120]: begin
<3>[  102.241775] _tegra_set_vpr_params[123]: end
<3>[  102.248825]  vpr-heap: update vpr base to 0x00000000c6000000, size=4000000
<3>[  102.256069] _tegra_set_vpr_params[120]: begin
<3>[  102.266368] _tegra_set_vpr_params[123]: end
<3>[  102.273400]  vpr-heap: update vpr base to 0x00000000c6000000, size=2000000
<3>[  102.280672] _tegra_set_vpr_params[120]: begin
<3>[  102.290929] _tegra_set_vpr_params[123]: end

Change-Id: I5f604064ce7b8b73ea9ad5860156ae5e2c6cc42a
Signed-off-by: Ken Chang <kenc@nvidia.com>
5 years agoTegra: remove support for USE_COHERENT_MEM
Kalyani Chidambaram [Tue, 18 Dec 2018 21:51:18 +0000 (13:51 -0800)]
Tegra: remove support for USE_COHERENT_MEM

This patch removes the support for 'USE_COHERENT_MEM' as
Tegra platforms no longer support the feature.

Change-Id: If1c80fc4e5974412572b3bc1fdf9e70b1ee5d4ec
Signed-off-by: Kalyani Chidambaram <kalyanic@nvidia.com>
5 years agoTegra: remove circular dependency with common_def.h
Varun Wadekar [Fri, 21 Dec 2018 18:55:42 +0000 (10:55 -0800)]
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>
5 years agoTegra: include missing stdbool.h
Varun Wadekar [Fri, 21 Dec 2018 18:53:53 +0000 (10:53 -0800)]
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>
5 years agoTegra: remove support for SEPARATE_CODE_AND_RODATA=0
Kalyani Chidambaram [Wed, 19 Dec 2018 19:06:14 +0000 (11:06 -0800)]
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>
5 years agoMerge "Bug fix: Protect TSP prints with lock" into integration
Mark Dykes [Fri, 20 Mar 2020 19:18:46 +0000 (19:18 +0000)]
Merge "Bug fix: Protect TSP prints with lock" into integration

5 years agocontext: TPIDR_EL2 register not saved/restored
Olivier Deprez [Fri, 20 Mar 2020 13:22:05 +0000 (14:22 +0100)]
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

5 years agoMerge "fvp: use two instances of Cactus at S-EL1" into integration
Manish Pandey [Fri, 20 Mar 2020 15:46:18 +0000 (15:46 +0000)]
Merge "fvp: use two instances of Cactus at S-EL1" into integration

5 years agoMerge "spmc: manifest changes to support two sample cactus secure partitions" into...
Manish Pandey [Fri, 20 Mar 2020 09:51:50 +0000 (09:51 +0000)]
Merge "spmc: manifest changes to support two sample cactus secure partitions" into integration

5 years agoMerge "docs: remove uefi-tools in hikey and hikey960" into integration
Manish Pandey [Fri, 20 Mar 2020 09:30:02 +0000 (09:30 +0000)]
Merge "docs: remove uefi-tools in hikey and hikey960" into integration

5 years agoBug fix: Protect TSP prints with lock
Madhukar Pappireddy [Fri, 20 Mar 2020 06:46:21 +0000 (01:46 -0500)]
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>
5 years agoMerge "el3_entrypoint_common: avoid overwriting arg3" into integration
Manish Pandey [Thu, 19 Mar 2020 22:35:13 +0000 (22:35 +0000)]
Merge "el3_entrypoint_common: avoid overwriting arg3" into integration

5 years agofvp: use two instances of Cactus at S-EL1
Manish Pandey [Thu, 19 Mar 2020 21:06:18 +0000 (21:06 +0000)]
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

5 years agospmc: manifest changes to support two sample cactus secure partitions
Olivier Deprez [Fri, 28 Feb 2020 11:12:08 +0000 (12:12 +0100)]
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

5 years agoMerge changes from topic "tegra-downstream-03122020" into integration
Sandrine Bailleux [Thu, 19 Mar 2020 11:09:37 +0000 (11:09 +0000)]
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

5 years agoTegra: assembly version of the 'plat_core_pos_by_mpidr' handler
Varun Wadekar [Tue, 27 Nov 2018 23:47:26 +0000 (15:47 -0800)]
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>
5 years agoTegra194: reset power state info for CPUs
Varun Wadekar [Fri, 16 Nov 2018 04:44:40 +0000 (20:44 -0800)]
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>
5 years agotlkd: remove system off/reset handlers
Varun Wadekar [Mon, 5 Nov 2018 23:12:55 +0000 (15:12 -0800)]
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>
5 years agoTegra186: system resume from TZSRAM memory
Varun Wadekar [Fri, 9 Nov 2018 17:08:16 +0000 (09:08 -0800)]
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>
5 years agoTegra186: disable PROGRAMMABLE_RESET_ADDRESS
Varun Wadekar [Thu, 9 Aug 2018 22:11:23 +0000 (15:11 -0700)]
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>
5 years agoTegra210: SE: switch SE clock source to CLK_M
Leo He [Thu, 12 Jul 2018 09:36:12 +0000 (17:36 +0800)]
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>
5 years agoTegra: increase platform assert logging level to VERBOSE
Varun Wadekar [Tue, 16 Oct 2018 23:05:41 +0000 (16:05 -0700)]
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>
5 years agospd: trusty: disable error messages seen during boot
Varun Wadekar [Tue, 16 Oct 2018 22:39:55 +0000 (15:39 -0700)]
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>
5 years agoTegra194: enable dual execution for EL2 and EL3
Kalyani Chidambaram [Wed, 12 Sep 2018 21:59:08 +0000 (14:59 -0700)]
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>
5 years agoTegra: aarch64: calculate core position from one place
Kalyani Chidambaram [Thu, 4 Oct 2018 00:00:17 +0000 (17:00 -0700)]
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>
5 years agoTegra194: Update t194_nvg.h to v6.7
Kalyani Chidambaram [Wed, 19 Sep 2018 22:51:46 +0000 (15:51 -0700)]
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>
5 years agoMerge changes from topic "rpix-multi-console" into integration
Sandrine Bailleux [Wed, 18 Mar 2020 16:44:40 +0000 (16:44 +0000)]
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

5 years agoMerge "Implement SMCCC_ARCH_SOC_ID SMC call" into integration
Manish Pandey [Wed, 18 Mar 2020 13:55:33 +0000 (13:55 +0000)]
Merge "Implement SMCCC_ARCH_SOC_ID SMC call" into integration

5 years agoMerge "FVP: In BL31/SP_MIN, map only the needed DRAM region statically" into integration
Olivier Deprez [Wed, 18 Mar 2020 10:38:39 +0000 (10:38 +0000)]
Merge "FVP: In BL31/SP_MIN, map only the needed DRAM region statically" into integration

5 years agoMerge "board/rddaniel: add NSAID sources for TZC400 driver" into integration
Manish Pandey [Tue, 17 Mar 2020 22:04:01 +0000 (22:04 +0000)]
Merge "board/rddaniel: add NSAID sources for TZC400 driver" into integration

5 years agoFVP: In BL31/SP_MIN, map only the needed DRAM region statically
Madhukar Pappireddy [Fri, 13 Mar 2020 18:00:17 +0000 (13:00 -0500)]
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>
5 years agorpi: docs: Update maintainers file to new RPi directory scheme
Andre Przywara [Fri, 24 Jan 2020 10:46:17 +0000 (10:46 +0000)]
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

5 years agorpi: console: Autodetect Mini-UART vs. PL011 configuration
Andre Przywara [Wed, 11 Mar 2020 15:18:03 +0000 (15:18 +0000)]
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>
5 years agorpi3: build: Include GPIO driver in all BL stages
Andre Przywara [Wed, 11 Mar 2020 16:33:53 +0000 (16:33 +0000)]
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

5 years agorpi: Allow using PL011 UART for RPi3/RPi4
Andre Przywara [Tue, 10 Mar 2020 12:34:56 +0000 (12:34 +0000)]
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

5 years agorpi3: console: Use same "clock-less" setup scheme as RPi4
Andre Przywara [Tue, 10 Mar 2020 12:33:16 +0000 (12:33 +0000)]
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

5 years agorpi3: gpio: Simplify GPIO setup
Andre Przywara [Wed, 11 Mar 2020 16:10:40 +0000 (16:10 +0000)]
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>
5 years agoImplement SMCCC_ARCH_SOC_ID SMC call
Manish V Badarkhe [Sat, 22 Feb 2020 08:43:00 +0000 (08:43 +0000)]
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

5 years agoplat: imx: imx8qm: apply clk/pinmux configuration for DEBUG_CONSOLE
Igor Opaniuk [Mon, 16 Mar 2020 21:07:16 +0000 (23:07 +0200)]
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

5 years agoplat: imx: imx8qm: provide debug uart num as build param
Igor Opaniuk [Mon, 16 Mar 2020 20:55:42 +0000 (22:55 +0200)]
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

5 years agoplat: imx: imx8_iomux: fix shift-overflow errors
Igor Opaniuk [Mon, 16 Mar 2020 20:49:16 +0000 (22:49 +0200)]
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

5 years agoMerge "fconf: Add namespace guidance inside documentation" into integration
Mark Dykes [Mon, 16 Mar 2020 18:35:36 +0000 (18:35 +0000)]
Merge "fconf: Add namespace guidance inside documentation" into integration

5 years agodocs: remove uefi-tools in hikey and hikey960
Haojian Zhuang [Sat, 14 Mar 2020 02:24:41 +0000 (10:24 +0800)]
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

5 years agoMerge "SPMD: Add support for SPCI_ID_GET" into integration
Sandrine Bailleux [Fri, 13 Mar 2020 14:29:50 +0000 (14:29 +0000)]
Merge "SPMD: Add support for SPCI_ID_GET" into integration

5 years agoMerge "Add a .gitreview file for convenience" into integration
Sandrine Bailleux [Fri, 13 Mar 2020 12:11:52 +0000 (12:11 +0000)]
Merge "Add a .gitreview file for convenience" into integration

5 years agoMerge "juno/sgm: Maximize space allocated to SCP_BL2" into integration
Sandrine Bailleux [Fri, 13 Mar 2020 08:06:04 +0000 (08:06 +0000)]
Merge "juno/sgm: Maximize space allocated to SCP_BL2" into integration

5 years agoMerge "Mention COT build option in trusted-board-boot-build.rst" into integration
Mark Dykes [Thu, 12 Mar 2020 18:04:09 +0000 (18:04 +0000)]
Merge "Mention COT build option in trusted-board-boot-build.rst" into integration

5 years agoMerge "Update cryptographic algorithms in TBBR doc" into integration
Mark Dykes [Thu, 12 Mar 2020 18:03:05 +0000 (18:03 +0000)]
Merge "Update cryptographic algorithms in TBBR doc" into integration

5 years agoSPMD: Add support for SPCI_ID_GET
Max Shvetsov [Thu, 12 Mar 2020 15:16:40 +0000 (15:16 +0000)]
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>
5 years agoMention COT build option in trusted-board-boot-build.rst
Sandrine Bailleux [Tue, 3 Mar 2020 12:03:36 +0000 (13:03 +0100)]
Mention COT build option in trusted-board-boot-build.rst

Since commit 3bff910dc16ad5ed97d470064b25481d3674732b ("Introduce COT
build option"), it is now possible to select a different Chain of Trust
than the TBBR-Client one.

Make a few adjustments in the documentation to reflect that. Also make
some minor improvements (fixing typos, better formatting, ...)  along
the way.

Change-Id: I3bbadc441557e1e13311b6fd053fdab6b10b1ba2
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
5 years agoUpdate cryptographic algorithms in TBBR doc
Sandrine Bailleux [Tue, 3 Mar 2020 12:00:10 +0000 (13:00 +0100)]
Update cryptographic algorithms in TBBR doc

The TBBR documentation has been written along with an early
implementation of the code. At that time, the range of supported
encryption and hash algorithms was failry limited. Since then, support
for other algorithms has been added in TF-A but the documentation has
not been updated.

Instead of listing them all, which would clutter this document while
still leaving it at risk of going stale in the future, remove specific
references to the original algorithms and point the reader at the
relevant comprehensive document for further details.

Change-Id: I29dc50bc1d53b728091a1fbaa1c3970fb999f7d5
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
5 years agoMerge changes from topic "mp/enhanced_pal_hw" into integration
Mark Dykes [Thu, 12 Mar 2020 15:54:28 +0000 (15:54 +0000)]
Merge changes from topic "mp/enhanced_pal_hw" into integration

* changes:
  plat/arm/fvp: populate pwr domain descriptor dynamically
  fconf: Extract topology node properties from HW_CONFIG dtb
  fconf: necessary modifications to support fconf in BL31 & SP_MIN
  fconf: enhancements to firmware configuration framework

5 years agojuno/sgm: Maximize space allocated to SCP_BL2
Chris Kay [Thu, 12 Mar 2020 13:50:26 +0000 (13:50 +0000)]
juno/sgm: Maximize space allocated to SCP_BL2

To accommodate the increasing size of the SCP_BL2 binary, the base
address of the memory region allocated to SCP_BL2 has been moved
downwards from its current (mostly) arbitrary address to the beginning
of the non-shared trusted SRAM.

Change-Id: I086a3765bf3ea88f45525223d765dc0dbad6b434
Signed-off-by: Chris Kay <chris.kay@arm.com>
5 years agoMerge "Use Speculation Barrier instruction for v8.5 cores" into integration
Mark Dykes [Thu, 12 Mar 2020 14:32:13 +0000 (14:32 +0000)]
Merge "Use Speculation Barrier instruction for v8.5 cores" into integration

5 years agoMerge "locks: bakery: add a DMB to the 'read_cache_op' macro" into integration
Soby Mathew [Thu, 12 Mar 2020 13:23:00 +0000 (13:23 +0000)]
Merge "locks: bakery: add a DMB to the 'read_cache_op' macro" into integration

5 years agoboard/rddaniel: add NSAID sources for TZC400 driver
Aditya Angadi [Thu, 12 Mar 2020 05:26:18 +0000 (10:56 +0530)]
board/rddaniel: add NSAID sources for TZC400 driver

Add CLCD, HDLCD, PCI and VIRTIO devices as source interfaces for TZC
filter unit to enable DMA for these devices.

Change-Id: Ifad2e56b18605311936e03cfcccda573cac7e60a
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
5 years agoMerge "n1sdp: Enable the NEOVERSE_N1_EXTERNAL_LLC flag" into integration
Manish Pandey [Thu, 12 Mar 2020 10:09:31 +0000 (10:09 +0000)]
Merge "n1sdp: Enable the NEOVERSE_N1_EXTERNAL_LLC flag" into integration

5 years agoMerge "Changelog: Add dualroot CoT entries" into integration
Sandrine Bailleux [Thu, 12 Mar 2020 09:37:43 +0000 (09:37 +0000)]
Merge "Changelog: Add dualroot CoT entries" into integration

5 years agoMerge changes from topic "tegra-downstream-03102020" into integration
Sandrine Bailleux [Thu, 12 Mar 2020 07:58:24 +0000 (07:58 +0000)]
Merge changes from topic "tegra-downstream-03102020" into integration

* changes:
  Tegra210: Remove "unsupported func ID" error msg
  Tegra210: support for secure physical timer
  spd: tlkd: secure timer interrupt handler
  Tegra: smmu: export handlers to read/write SMMU registers
  Tegra: smmu: remove context save sequence
  Tegra: bpmp: fixup TEGRA_CLK_SE values for Tegra186/Tegra194
  Tegra194: memctrl: lock some more MC SID security configs
  Tegra194: add SE support to generate SHA256 of TZRAM
  Tegra194: store TZDRAM base/size to scratch registers
  Tegra194: fix warnings for extra parentheses

5 years agoplat/arm/fvp: populate pwr domain descriptor dynamically
Madhukar Pappireddy [Fri, 21 Feb 2020 20:01:44 +0000 (14:01 -0600)]
plat/arm/fvp: populate pwr domain descriptor dynamically

The motivation behind this patch and following patches is to extract
information about the platform in runtime rather than depending on
compile time macros such as FVP_CLUSTER_COUNT. This partially enables
us to use a single binary for a family of platforms which all have
similar hardware capabilities but differ in configurations.

we populate the data structure describing the power domain hierarchy
of the platform dynamically by querying the number of clusters and cpus
using fconf getter APIs. Compile time macro such as FVP_CLUSTER_COUNT
is still needed as it determines the size of related data structures.

Note that the cpu-map node in HW_CONFIG dts represents a logical
hierarchy of power domains of CPU. However, in reality, the power
domains may not have been physically built in such hierarchy.

Change-Id: Ibcbb5ca7b2c969f8ad03ab2eab289725245af7a9
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
5 years agoTegra210: Remove "unsupported func ID" error msg
Kalyani Chidambaram [Fri, 21 Sep 2018 17:36:59 +0000 (10:36 -0700)]
Tegra210: Remove "unsupported func ID" error msg

The platform sip is reporting a "unsupported function ID" if the
smc function id is not pmc command. When actually the smc function id
could be specific to the tegra sip handler.
This patch removes the error reported.

Change-Id: Ia3c8545d345746c5eea6d75b9e6957ca23ae9ca3
Signed-off-by: Kalyani Chidambaram <kalyanic@nvidia.com>
5 years agoTegra210: support for secure physical timer
Varun Wadekar [Fri, 10 Aug 2018 17:17:31 +0000 (10:17 -0700)]
Tegra210: support for secure physical timer

This patch enables on-chip timer1 interrupts for Tegra210 platforms.

Change-Id: Ic7417dc0e69264d7c28aa012fe2322cd30838f3e
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agospd: tlkd: secure timer interrupt handler
Varun Wadekar [Fri, 10 Aug 2018 16:55:25 +0000 (09:55 -0700)]
spd: tlkd: secure timer interrupt handler

This patch adds an interrupt handler for TLK. On receiving an
interrupt, the source of the interrupt is determined and the
interrupt is marked complete. The IRQ number is passed to
TLK along with a special SMC function ID. TLK issues an SMC
to notify completion of the interrupt handler in the S-EL1
world.

Change-Id: I76f28cee6537245c5e448d2078f86312219cea1a
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: smmu: export handlers to read/write SMMU registers
Varun Wadekar [Mon, 10 Dec 2018 21:20:49 +0000 (13:20 -0800)]
Tegra: smmu: export handlers to read/write SMMU registers

This patch exports the SMMU register read/write handlers for platforms.

Change-Id: If92f0d3ce820e4997c090b48be7614407bb582da
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra: smmu: remove context save sequence
Pritesh Raithatha [Fri, 3 Aug 2018 10:18:15 +0000 (15:48 +0530)]
Tegra: smmu: remove context save sequence

SMMU and MC registers are saved as part of the System Suspend sequence.
The register list includes some NS world SMMU registers that need to be
saved by NS world software instead. All that remains as a result are
the MC registers.

This patch moves code to MC file as a result and renames all the
variables and defines to use the MC prefix instead of SMMU. The
Tegra186 and Tegra194 platform ports are updated to provide the MC
context register list to the parent driver. The memory required for
context save is reduced due to removal of the SMMU registers.

Change-Id: I83a05079039f52f9ce91c938ada6cd6dfd9c843f
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
5 years agoTegra: bpmp: fixup TEGRA_CLK_SE values for Tegra186/Tegra194
Varun Wadekar [Thu, 13 Sep 2018 15:47:43 +0000 (08:47 -0700)]
Tegra: bpmp: fixup TEGRA_CLK_SE values for Tegra186/Tegra194

This patch fixes the SE clock ID being used for Tegra186 and Tegra194
SoCs. Previous assumption, that both SoCs use the same clock ID, was
incorrect.

Change-Id: I1ef0da5547ff2e14151b53968cad9cc78fee63bd
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
5 years agoTegra194: memctrl: lock some more MC SID security configs
Pritesh Raithatha [Thu, 23 Aug 2018 06:17:23 +0000 (11:47 +0530)]
Tegra194: memctrl: lock some more MC SID security configs

The platform code already contains the initial set of MC SID
security configs to be locked during boot. This patch adds some
more configs to the list. Since the reset value of these registers
is already as per expectations, there is no need to change it.

MC SID security configs
- PTCR,
- MIU6R, MIU6W, MIU7R, MIU7W,
- MPCORER, MPCOREW,
- NVDEC1SRD, NVDEC1SRD1, NVDEC1SWR.

Change-Id: Ia9a1f6a6b6d34fb2787298651f7a4792a40b88ab
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
5 years agoTegra194: add SE support to generate SHA256 of TZRAM
Jeetesh Burman [Fri, 6 Jul 2018 14:33:38 +0000 (20:03 +0530)]
Tegra194: add SE support to generate SHA256 of TZRAM

The BL3-1 firmware code is stored in TZSRAM on Tegra194 platforms. This
memory loses power when we enter System Suspend and so its contents are
stored to TZDRAM, before entry. This opens up an attack vector where the
TZDRAM contents might be tampered with when we are in the System Suspend
mode. To mitigate this attack the SE engine calculates the hash of entire
TZSRAM and stores it in PMC scratch, before we copy data to TZDRAM. The
WB0 code will validate the TZDRAM and match the hash with the one in PMC
scratch.

This patch adds driver for the SE engine, with APIs to calculate the hash
and store to PMC scratch registers.

Change-Id: I04cc0eb7f54c69d64b6c34fc2ff62e4cfbdd43b2
Signed-off-by: Jeetesh Burman <jburman@nvidia.com>
5 years agoTegra194: store TZDRAM base/size to scratch registers
Jeetesh Burman [Fri, 6 Jul 2018 14:28:30 +0000 (19:58 +0530)]
Tegra194: store TZDRAM base/size to scratch registers

This patch saves the TZDRAM base and size values to secure scratch
registers, for the WB0. The WB0 reads these values and uses them to
verify integrity of the TZDRAM aperture.

Change-Id: I2f5fd11c87804d20e2698de33be977991c9f6f33
Signed-off-by: Jeetesh Burman <jburman@nvidia.com>
5 years agoTegra194: fix warnings for extra parentheses
kalyani chidambaram [Tue, 24 Jul 2018 20:58:27 +0000 (13:58 -0700)]
Tegra194: fix warnings for extra parentheses

armclang displays warnings for extra parentheses, leading to
build failures as warnings are treated as errors.
This patch removes the extra parentheses to fix this issue.

Change-Id: Id2fd6a3086590436eecabc55502f40752a018131
Signed-off-by: Kalyani Chidambaram <kalyanic@nvidia.com>
5 years agofconf: Extract topology node properties from HW_CONFIG dtb
Madhukar Pappireddy [Fri, 27 Dec 2019 18:02:34 +0000 (12:02 -0600)]
fconf: Extract topology node properties from HW_CONFIG dtb

Create, register( and implicitly invoke) fconf_populate_topology()
function which extracts the topology related properties from dtb into
the newly created fconf based configuration structure 'soc_topology'.
Appropriate libfdt APIs are added to jmptbl.i file for use with USE_ROMLIB
build feature.

A new property which describes the power domain levels is added to the
HW_CONFIG device tree source files.

This patch also fixes a minor bug in the common device tree file
fvp-base-gicv3-psci-dynamiq-common.dtsi
As this file includes fvp-base-gicv3-psci-common.dtsi, it is necessary
to delete all previous cluster node definitons because DynamIQ based
models have upto 8 CPUs in each cluster. If not deleted, the final dts
would have an inaccurate description of SoC topology, i.e., cluster0
with 8 or more core nodes and cluster1 with 4 core nodes.

Change-Id: I9eb406da3ba4732008a66c01afec7c9fa8ef59bf
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
5 years agofconf: necessary modifications to support fconf in BL31 & SP_MIN
Madhukar Pappireddy [Mon, 27 Jan 2020 19:37:51 +0000 (13:37 -0600)]
fconf: necessary modifications to support fconf in BL31 & SP_MIN

Necessary infrastructure added to integrate fconf framework in BL31 & SP_MIN.
Created few populator() functions which parse HW_CONFIG device tree
and registered them with fconf framework. Many of the changes are
only applicable for fvp platform.

This patch:
1. Adds necessary symbols and sections in BL31, SP_MIN linker script
2. Adds necessary memory map entry for translation in BL31, SP_MIN
3. Creates an abstraction layer for hardware configuration based on
   fconf framework
4. Adds necessary changes to build flow (makefiles)
5. Minimal callback to read hw_config dtb for capturing properties
   related to GIC(interrupt-controller node)
6. updates the fconf documentation

Change-Id: Ib6292071f674ef093962b9e8ba0d322b7bf919af
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
5 years agoUse Speculation Barrier instruction for v8.5 cores
Madhukar Pappireddy [Tue, 10 Mar 2020 23:04:59 +0000 (18:04 -0500)]
Use Speculation Barrier instruction for v8.5 cores

Change-Id: Ie1018bfbae2fe95c699e58648665baa75e862000
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
5 years agoMerge "Fix crash dump for lower EL" into integration
Mark Dykes [Wed, 11 Mar 2020 15:39:32 +0000 (15:39 +0000)]
Merge "Fix crash dump for lower EL" into integration

5 years agoMerge "TF-A GICv3 driver: Separate GICD and GICR accessor functions" into integration
Mark Dykes [Wed, 11 Mar 2020 15:38:45 +0000 (15:38 +0000)]
Merge "TF-A GICv3 driver: Separate GICD and GICR accessor functions" into integration

5 years agofconf: enhancements to firmware configuration framework
Madhukar Pappireddy [Fri, 6 Dec 2019 21:46:42 +0000 (15:46 -0600)]
fconf: enhancements to firmware configuration framework

A populate() function essentially captures the value of a property,
defined by a platform, into a fconf related c structure. Such a
callback is usually platform specific and is associated to a specific
configuration source.
For example, a populate() function which captures the hardware topology
of the platform can only parse HW_CONFIG DTB. Hence each populator
function must be registered with a specific 'config_type' identifier.
It broadly represents a logical grouping of configuration properties
which is usually a device tree source file.

Example:
> TB_FW: properties related to trusted firmware such as IO policies,
 base address of other DTBs, mbedtls heap info etc.
> HW_CONFIG: properties related to hardware configuration of the SoC
 such as topology, GIC controller, PSCI hooks, CPU ID etc.

This patch modifies FCONF_REGISTER_POPULATOR macro and fconf_populate()
to register and invoke the appropriate callbacks selectively based on
configuration type.

Change-Id: I6f63b1fd7a8729c6c9137d5b63270af1857bb44a
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>