summaryrefslogtreecommitdiff
path: root/bl2
diff options
context:
space:
mode:
authorJuan Castillo <juan.castillo@arm.com>2015-09-25 15:41:14 +0100
committerJuan Castillo <juan.castillo@arm.com>2015-10-28 09:13:40 +0000
commit40fc6cd1416b94eacb96d56015a8989fc053d9fe (patch)
tree7e01145c33d2b25da097472ba917a447f5e9df57 /bl2
parent8d91ecfe3c04ed8a56a9b59768757ce853904420 (diff)
Add optional platform error handler API
This patch adds an optional API to the platform port: void plat_error_handler(int err) __dead2; The platform error handler is called when there is a specific error condition after which Trusted Firmware cannot continue. While panic() simply prints the crash report (if enabled) and spins, the platform error handler can be used to hand control over to the platform port so it can perform specific bookeeping or post-error actions (for example, reset the system). This function must not return. The parameter indicates the type of error using standard codes from errno.h. Possible errors reported by the generic code are: -EAUTH : a certificate or image could not be authenticated (when Trusted Board Boot is enabled) -ENOENT : the requested image or certificate could not be found or an IO error was detected -ENOMEM : resources exhausted. Trusted Firmware does not use dynamic memory, so this error is usually an indication of an incorrect array size A default weak implementation of this function has been provided. It simply implements an infinite loop. Change-Id: Iffaf9eee82d037da6caa43b3aed51df555e597a3
Diffstat (limited to 'bl2')
-rw-r--r--bl2/bl2_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c
index 404744b7..f8a2372f 100644
--- a/bl2/bl2_main.c
+++ b/bl2/bl2_main.c
@@ -219,7 +219,7 @@ void bl2_main(void)
e = load_bl30();
if (e) {
ERROR("Failed to load BL3-0 (%i)\n", e);
- panic();
+ plat_error_handler(e);
}
/* Perform platform setup in BL2 after loading BL3-0 */
@@ -235,14 +235,14 @@ void bl2_main(void)
e = load_bl31(bl2_to_bl31_params, bl31_ep_info);
if (e) {
ERROR("Failed to load BL3-1 (%i)\n", e);
- panic();
+ plat_error_handler(e);
}
e = load_bl32(bl2_to_bl31_params);
if (e) {
if (e == -EAUTH) {
ERROR("Failed to authenticate BL3-2\n");
- panic();
+ plat_error_handler(e);
} else {
WARN("Failed to load BL3-2 (%i)\n", e);
}
@@ -251,7 +251,7 @@ void bl2_main(void)
e = load_bl33(bl2_to_bl31_params);
if (e) {
ERROR("Failed to load BL3-3 (%i)\n", e);
- panic();
+ plat_error_handler(e);
}
/* Flush the params to be passed to memory */