summaryrefslogtreecommitdiff
path: root/bl1/bl1_main.c
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2014-06-12 17:23:58 +0100
committerSoby Mathew <soby.mathew@arm.com>2014-07-25 12:18:33 +0100
commitb79af9344503b2d7b435451cfb8b1ab80b8afdf4 (patch)
treed10f1c88279c9c5d481c82d6302d3989abc9bb3c /bl1/bl1_main.c
parenta1a441775f64da2cbbd42c4f2c6f818f93278fca (diff)
Implement a leaner printf for Trusted Firmware
This patch implements a "tf_printf" which supports only the commonly used format specifiers in Trusted Firmware, which uses a lot less stack space than the stdlib printf function. Fixes ARM-software/tf-issues#116 Change-Id: I7dfa1944f4c1e634b3e2d571f49afe02d109a351
Diffstat (limited to 'bl1/bl1_main.c')
-rw-r--r--bl1/bl1_main.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/bl1/bl1_main.c b/bl1/bl1_main.c
index 897660cf..47ca546d 100644
--- a/bl1/bl1_main.c
+++ b/bl1/bl1_main.c
@@ -35,7 +35,6 @@
#include <debug.h>
#include <platform.h>
#include <platform_def.h>
-#include <stdio.h>
#include "bl1_private.h"
/*******************************************************************************
@@ -130,8 +129,8 @@ void bl1_main(void)
bl1_platform_setup();
/* Announce our arrival */
- printf(FIRMWARE_WELCOME_STR);
- printf("%s\n\r", build_message);
+ tf_printf(FIRMWARE_WELCOME_STR);
+ tf_printf("%s\n\r", build_message);
SET_PARAM_HEAD(&bl2_image_info, PARAM_IMAGE_BINARY, VERSION_1, 0);
SET_PARAM_HEAD(&bl2_ep, PARAM_EP, VERSION_1, 0);
@@ -150,7 +149,7 @@ void bl1_main(void)
* TODO: print failure to load BL2 but also add a tzwdog timer
* which will reset the system eventually.
*/
- printf("Failed to load boot loader stage 2 (BL2) firmware.\n");
+ tf_printf("Failed to load boot loader stage 2 (BL2) firmware.\n");
panic();
}
/*
@@ -165,12 +164,12 @@ void bl1_main(void)
bl1_plat_set_bl2_ep_info(&bl2_image_info, &bl2_ep);
bl2_ep.args.arg1 = (unsigned long)bl2_tzram_layout;
- printf("Booting trusted firmware boot loader stage 2\n");
+ tf_printf("Booting trusted firmware boot loader stage 2\n");
#if DEBUG
- printf("BL2 address = 0x%llx\n",
+ tf_printf("BL2 address = 0x%llx\n",
(unsigned long long) bl2_ep.pc);
- printf("BL2 cpsr = 0x%x\n", bl2_ep.spsr);
- printf("BL2 memory layout address = 0x%llx\n",
+ tf_printf("BL2 cpsr = 0x%x\n", bl2_ep.spsr);
+ tf_printf("BL2 memory layout address = 0x%llx\n",
(unsigned long long) bl2_tzram_layout);
#endif
bl1_run_bl2(&bl2_ep);
@@ -184,13 +183,13 @@ void bl1_main(void)
******************************************************************************/
void display_boot_progress(entry_point_info_t *bl31_ep_info)
{
- printf("Booting trusted firmware boot loader stage 3\n\r");
+ tf_printf("Booting trusted firmware boot loader stage 3\n\r");
#if DEBUG
- printf("BL31 address = 0x%llx\n", (unsigned long long)bl31_ep_info->pc);
- printf("BL31 cpsr = 0x%llx\n", (unsigned long long)bl31_ep_info->spsr);
- printf("BL31 params address = 0x%llx\n",
+ tf_printf("BL31 address = 0x%llx\n", (unsigned long long)bl31_ep_info->pc);
+ tf_printf("BL31 cpsr = 0x%llx\n", (unsigned long long)bl31_ep_info->spsr);
+ tf_printf("BL31 params address = 0x%llx\n",
(unsigned long long)bl31_ep_info->args.arg0);
- printf("BL31 plat params address = 0x%llx\n",
+ tf_printf("BL31 plat params address = 0x%llx\n",
(unsigned long long)bl31_ep_info->args.arg1);
#endif
return;