]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
plat: tc0: OP-TEE as S-EL1 SP with SPMC at S-EL2
authorArunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Tue, 17 Nov 2020 15:05:01 +0000 (15:05 +0000)
committerArunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Mon, 14 Dec 2020 18:02:33 +0000 (18:02 +0000)
This patch adds support to enable OP-TEE as S-EL1 SP with SPMC at S-EL2
     - create SPMC manifest file with OP-TEE as SP
     - add support for ARM_SPMC_MANIFEST_DTS build option
     - add optee entry with ffa as method in tc0.dts

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: Ia9b5c22c6f605d3886914bbac8ac45e8365671cb

fdts/tc0.dts
plat/arm/board/tc0/fdts/tc0_spmc_optee_sp_manifest.dts [new file with mode: 0644]
plat/arm/board/tc0/fdts/tc0_tb_fw_config.dts
plat/arm/board/tc0/include/platform_def.h
plat/arm/board/tc0/platform.mk

index 763c813cf134b62ad3ee8ba96ade5d8b38c41a27..2a1c1cd3df4ebad58a182e50d4b41106915a6a9d 100644 (file)
                        };
                };
        };
+
+       ffa {
+               compatible = "arm,ffa";
+               conduit = "smc";
+               mem_share_buffer = "tx";
+       };
+
+       firmware {
+               optee {
+                     compatible = "linaro,optee-tz";
+                     method = "ffa";
+               };
+       };
 };
diff --git a/plat/arm/board/tc0/fdts/tc0_spmc_optee_sp_manifest.dts b/plat/arm/board/tc0/fdts/tc0_spmc_optee_sp_manifest.dts
new file mode 100644 (file)
index 0000000..a58b911
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2020, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+/dts-v1/;
+
+#define        AFF     00
+
+#include "fvp-defs.dtsi"
+#undef POST
+#define        POST \
+       };
+
+/ {
+       compatible = "arm,ffa-core-manifest-1.0";
+       #address-cells = <2>;
+       #size-cells = <1>;
+
+       attribute {
+               spmc_id = <0x8000>;
+               maj_ver = <0x1>;
+               min_ver = <0x0>;
+               exec_state = <0x0>;
+               load_address = <0x0 0xfd000000>;
+               entrypoint = <0x0 0xfd000000>;
+               binary_size = <0x80000>;
+       };
+
+       /*
+        * temporary: This entry is added based on v2.4 hafnium and will be
+        * removed when rebased to upstream master.
+        */
+       chosen {
+              linux,initrd-start = <0>;
+              linux,initrd-end = <0>;
+       };
+
+       hypervisor {
+               compatible = "hafnium,hafnium";
+               vm1 {
+                       is_ffa_partition;
+                       debug_name = "op-tee";
+                       load_address = <0xfd280000>;
+               };
+       };
+
+       cpus {
+               #address-cells = <0x2>;
+               #size-cells = <0x0>;
+
+               CPU_0
+
+               /*
+                * SPMC (Hafnium) requires secondary core nodes are declared
+                * in descending order.
+                */
+               CPU_3
+               CPU_2
+               CPU_1
+       };
+
+       /*
+        * temporary: This device-memory region is added based on v2.4 hafnium
+        * and will be removed when rebased to upstream master. As first
+        * Secure Partition no longer maps device memory.
+        */
+       device-memory@21000000 {
+               device_type = "device-memory";
+               reg = <0x0 0x21000000 0x5f000000>;
+       };
+
+       /* 32MB of TC0_TZC_DRAM1_BASE */
+       memory@fd000000 {
+               device_type = "memory";
+               reg = <0x0 0xfd000000 0x2000000>;
+       };
+};
index 3df94bf92b7d6e1219c011bb5068413e8bd655f8..de5f95d5e29152f36b44d6962fa5610c7695b456 100644 (file)
 
        secure-partitions {
                compatible = "arm,sp";
+#if OPTEE_SP_FW_CONFIG
+               op-tee {
+                      uuid = <0x486178e0 0xe7f811e3 0xbc5e0002 0xa5d5c51b>;
+                      load-address = <0xfd280000>;
+               };
+#else
                cactus-primary {
                        uuid = <0xb4b5671e 0x4a904fe1 0xb81ffb13 0xdae1dacb>;
                        load-address = <0xfe000000>;
@@ -43,5 +49,6 @@
                        uuid = <0x79b55c73 0x1d8c44b9 0x859361e1 0x770ad8d2>;
                        load-address = <0xfe200000>;
                };
+#endif
        };
 };
index 72a035f0ab50f1a491b3529852fa04f99e4681da..2ff2699b3e812975568d3d26391e93b2ed7c9b10 100644 (file)
  * little space for growth.
  */
 #if TRUSTED_BOARD_BOOT
-# define PLAT_ARM_MAX_BL2_SIZE         0x1E000
+# define PLAT_ARM_MAX_BL2_SIZE         0x20000
 #else
 # define PLAT_ARM_MAX_BL2_SIZE         0x14000
 #endif
index 5d2cc38c463cfb58df1f9d1c773b8811157b8ce2..6cc5f461839d0b4d87c7f668a1bcdc2940939fbd 100644 (file)
@@ -86,8 +86,12 @@ $(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
 $(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
 
 ifeq (${SPD},spmd)
-FDT_SOURCES            +=      ${TC0_BASE}/fdts/${PLAT}_spmc_manifest.dts
-TC0_TOS_FW_CONFIG      :=      ${BUILD_PLAT}/fdts/${PLAT}_spmc_manifest.dtb
+ifeq ($(ARM_SPMC_MANIFEST_DTS),)
+ARM_SPMC_MANIFEST_DTS  :=      ${TC0_BASE}/fdts/${PLAT}_spmc_manifest.dts
+endif
+
+FDT_SOURCES            +=      ${ARM_SPMC_MANIFEST_DTS}
+TC0_TOS_FW_CONFIG      :=      ${BUILD_PLAT}/fdts/$(notdir $(basename ${ARM_SPMC_MANIFEST_DTS})).dtb
 
 # Add the TOS_FW_CONFIG to FIP and specify the same to certtool
 $(eval $(call TOOL_ADD_PAYLOAD,${TC0_TOS_FW_CONFIG},--tos-fw-config,${TC0_TOS_FW_CONFIG}))