tegra/trusty: Setup tegra specific trusty args in platform code
authorArve Hjønnevåg <arve@android.com>
Thu, 22 Feb 2018 01:36:44 +0000 (17:36 -0800)
committerArve Hjønnevåg <arve@android.com>
Thu, 22 Feb 2018 01:36:44 +0000 (17:36 -0800)
Fixes tegra build with SPD=trusty. Not tested.

Change-Id: I851a2b00b8b1cc65112b6088980a811d8eda1a99

plat/nvidia/tegra/common/tegra_bl31_setup.c
services/spd/trusty/trusty.c

index d5d3d530d477716437c265a53fba8a2b1507ab17..d89ad7b94b329f6e29d71e0252a446b4d808f2db 100644 (file)
@@ -24,6 +24,9 @@
 #include <tegra_def.h>
 #include <tegra_private.h>
 
+/* length of Trusty's input parameters (in bytes) */
+#define TRUSTY_PARAMS_LEN_BYTES        (4096*2)
+
 extern void zeromem16(void *mem, unsigned int length);
 
 /*******************************************************************************
@@ -58,6 +61,8 @@ static entry_point_info_t bl33_image_ep_info, bl32_image_ep_info;
 static plat_params_from_bl2_t plat_bl31_params_from_bl2 = {
        .tzdram_size = (uint64_t)TZDRAM_SIZE
 };
+static unsigned long bl32_mem_size;
+static unsigned long bl32_boot_params;
 
 /*******************************************************************************
  * This variable holds the non-secure image entry address
@@ -147,8 +152,11 @@ void bl31_early_platform_setup(bl31_params_t *from_bl2,
        assert(from_bl2->bl33_ep_info);
        bl33_image_ep_info = *from_bl2->bl33_ep_info;
 
-       if (from_bl2->bl32_ep_info)
+       if (from_bl2->bl32_ep_info) {
                bl32_image_ep_info = *from_bl2->bl32_ep_info;
+               bl32_mem_size = from_bl2->bl32_ep_info->args.arg0;
+               bl32_boot_params = from_bl2->bl32_ep_info->args.arg2;
+       }
 
        /*
         * Parse platform specific parameters - TZDRAM aperture base and size
@@ -234,6 +242,15 @@ void bl31_early_platform_setup(bl31_params_t *from_bl2,
                "Denver" : "ARM", read_mpidr());
 }
 
+#ifdef SPD_trusty
+void plat_trusty_set_boot_args(aapcs64_params_t *args)
+{
+       args->arg0 = bl32_mem_size;
+       args->arg1 = bl32_boot_params;
+       args->arg2 = TRUSTY_PARAMS_LEN_BYTES;
+}
+#endif
+
 /*******************************************************************************
  * Initialize the gic, configure the SCR.
  ******************************************************************************/
index 7836ebadcfff099d77e56a505603436d804614bb..1d6d0748f04728b1f8a4fecf4a8e213d4445c5a0 100644 (file)
@@ -21,9 +21,6 @@
 /* macro to check if Hypervisor is enabled in the HCR_EL2 register */
 #define HYP_ENABLE_FLAG                0x286001
 
-/* length of Trusty's input parameters (in bytes) */
-#define TRUSTY_PARAMS_LEN_BYTES        (4096*2)
-
 struct trusty_stack {
        uint8_t space[PLATFORM_STACK_SIZE] __aligned(16);
        uint32_t end;