]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(spmd): fail safe if SPM fails to initialize
authorOlivier Deprez <olivier.deprez@arm.com>
Wed, 16 Nov 2022 15:46:23 +0000 (16:46 +0100)
committerOlivier Deprez <olivier.deprez@arm.com>
Thu, 9 Mar 2023 08:33:28 +0000 (09:33 +0100)
The spmd_setup function is made fail safe in that a failure in the
SPMC manifest parsing, SPMD or SPMC initialization returns a success
code to the standard services initialization routine (std_svc_setup).
This permits continuing the boot process and initialize services
beyond the SPMD to succeed for the system to operate in the normal
world. It operates in a degraded mode for the secure world.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ida0ac91c17925279a79f112d190f9ad038f518e7

services/std_svc/spmd/spmd_main.c

index 3c207ad970db42681e3098f6810f3707c13cf9ff..e85109dfa77aaec6cae8b4bfa510c45aec6cc488 100644 (file)
@@ -513,15 +513,15 @@ int spmd_setup(void)
 
                rc = spmc_setup();
                if (rc != 0) {
-                       ERROR("SPMC initialisation failed 0x%x.\n", rc);
+                       WARN("SPMC initialisation failed 0x%x.\n", rc);
                }
-               return rc;
+               return 0;
        }
 
        spmc_ep_info = bl31_plat_get_next_image_ep_info(SECURE);
        if (spmc_ep_info == NULL) {
                WARN("No SPM Core image provided by BL2 boot loader.\n");
-               return -EINVAL;
+               return 0;
        }
 
        /* Under no circumstances will this parameter be 0 */
@@ -533,8 +533,8 @@ int spmd_setup(void)
         */
        spmc_manifest = (void *)spmc_ep_info->args.arg0;
        if (spmc_manifest == NULL) {
-               ERROR("Invalid or absent SPM Core manifest.\n");
-               return -EINVAL;
+               WARN("Invalid or absent SPM Core manifest.\n");
+               return 0;
        }
 
        /* Load manifest, init SPMC */
@@ -543,7 +543,7 @@ int spmd_setup(void)
                WARN("Booting device without SPM initialization.\n");
        }
 
-       return rc;
+       return 0;
 }
 
 /*******************************************************************************