aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Niño Díaz <antonio.ninodiaz@arm.com>2018-11-15 16:36:12 +0100
committerGitHub <noreply@github.com>2018-11-15 16:36:12 +0100
commit0a650ee451a7da61e63b33a28c44f3830474f9c8 (patch)
tree501128d1bdda68e1fcba248f6c2fa5c16dc43c08
parent35c4b414be0841b7da63ceb1b5eb6ccfed5dc686 (diff)
parent6d5c61de74c6c2356707f041537e3c66def2b1bc (diff)
downloadplatform_external_arm-trusted-firmware-0a650ee451a7da61e63b33a28c44f3830474f9c8.tar.gz
platform_external_arm-trusted-firmware-0a650ee451a7da61e63b33a28c44f3830474f9c8.tar.bz2
platform_external_arm-trusted-firmware-0a650ee451a7da61e63b33a28c44f3830474f9c8.zip
Merge pull request #1680 from pbatard/rpi3-runtime-uart
rpi3: add RPI3_RUNTIME_UART build option
-rw-r--r--docs/plat/rpi3.rst4
-rw-r--r--plat/rpi3/platform.mk5
-rw-r--r--plat/rpi3/rpi3_common.c7
3 files changed, 14 insertions, 2 deletions
diff --git a/docs/plat/rpi3.rst b/docs/plat/rpi3.rst
index db475646b..ea8171fa0 100644
--- a/docs/plat/rpi3.rst
+++ b/docs/plat/rpi3.rst
@@ -231,6 +231,10 @@ The following build options are supported:
``RPI3_DIRECT_LINUX_BOOT=1``. This option allows to specify the location of a
DTB in memory.
+- ``RPI3_RUNTIME_UART``: Indicates whether the UART should be used at runtime
+ or disabled. ``-1`` (default) disables the runtime UART. Any other value
+ enables the default UART (currently UART1) for runtime messages.
+
- ``BL32``: This port can load and run OP-TEE. The OP-TEE image is optional.
Please use the code from `here <https://github.com/OP-TEE/optee_os>`__.
Build the Trusted Firmware with option ``BL32=tee-header_v2.bin
diff --git a/plat/rpi3/platform.mk b/plat/rpi3/platform.mk
index 36c1ee2b4..07d2bf1e0 100644
--- a/plat/rpi3/platform.mk
+++ b/plat/rpi3/platform.mk
@@ -109,6 +109,10 @@ RPI3_BL33_IN_AARCH32 := 0
# Assume that BL33 isn't the Linux kernel by default
RPI3_DIRECT_LINUX_BOOT := 0
+# UART to use at runtime. -1 means the runtime UART is disabled.
+# Any other value means the default UART will be used.
+RPI3_RUNTIME_UART := -1
+
# BL32 location
RPI3_BL32_RAM_LOCATION := tdram
ifeq (${RPI3_BL32_RAM_LOCATION}, tsram)
@@ -126,6 +130,7 @@ $(eval $(call add_define,RPI3_BL32_RAM_LOCATION_ID))
$(eval $(call add_define,RPI3_BL33_IN_AARCH32))
$(eval $(call add_define,RPI3_DIRECT_LINUX_BOOT))
$(eval $(call add_define,RPI3_PRELOADED_DTB_BASE))
+$(eval $(call add_define,RPI3_RUNTIME_UART))
# Verify build config
# -------------------
diff --git a/plat/rpi3/rpi3_common.c b/plat/rpi3/rpi3_common.c
index 18ff1c82e..c7e8b3a75 100644
--- a/plat/rpi3/rpi3_common.c
+++ b/plat/rpi3/rpi3_common.c
@@ -96,6 +96,10 @@ static console_16550_t rpi3_console;
void rpi3_console_init(void)
{
+ int console_scope = CONSOLE_FLAG_BOOT;
+#if RPI3_RUNTIME_UART != -1
+ console_scope |= CONSOLE_FLAG_RUNTIME;
+#endif
int rc = console_16550_register(PLAT_RPI3_UART_BASE,
PLAT_RPI3_UART_CLK_IN_HZ,
PLAT_RPI3_UART_BAUDRATE,
@@ -109,8 +113,7 @@ void rpi3_console_init(void)
panic();
}
- console_set_scope(&rpi3_console.console,
- CONSOLE_FLAG_BOOT | CONSOLE_FLAG_RUNTIME);
+ console_set_scope(&rpi3_console.console, console_scope);
}
/*******************************************************************************