diff options
author | Anson Huang <Anson.Huang@nxp.com> | 2019-11-22 11:17:03 +0800 |
---|---|---|
committer | Anson Huang <Anson.Huang@nxp.com> | 2019-12-13 10:41:23 +0800 |
commit | d5fca8923f5e390e55ed03212e3c9619c083eb3c (patch) | |
tree | 0d2e2b2724b3b74d1732d628e22af1e094b33d12 | |
parent | c8c1085323219563401454be45a56b53c8a41d47 (diff) |
Add NXP's i.MX8 SoCs system controller console support
NXP's i.MX8 SoCs with system controller inside support outputting
debug message to system controller's console via calling SCFW API,
since TF-A shares debug console with Linux kernel which will have
confliction if Linux kernel and TF-A's console are both enabled,
this patch adds support for switching TF-A debug console to system
controller to easy TF-A debug.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
-rw-r--r-- | lib/libc/putchar.c | 2 | ||||
-rw-r--r-- | plat/imx/common/imx_sip_handler.c | 10 | ||||
-rw-r--r-- | plat/imx/imx8qm/include/platform_def.h | 3 | ||||
-rw-r--r-- | plat/imx/imx8qx/include/platform_def.h | 3 |
4 files changed, 18 insertions, 0 deletions
diff --git a/lib/libc/putchar.c b/lib/libc/putchar.c index 037e28ac..1f985bc4 100644 --- a/lib/libc/putchar.c +++ b/lib/libc/putchar.c @@ -8,6 +8,8 @@ #include <drivers/console.h> +#pragma weak putchar + int putchar(int c) { int res; diff --git a/plat/imx/common/imx_sip_handler.c b/plat/imx/common/imx_sip_handler.c index 7484fdd9..b2df9f95 100644 --- a/plat/imx/common/imx_sip_handler.c +++ b/plat/imx/common/imx_sip_handler.c @@ -222,3 +222,13 @@ uint64_t imx_buildinfo_handler(uint32_t smc_fid, return ret; } + +#if SC_CONSOLE +int putchar(int c) +{ + if (ipc_handle) + sc_misc_debug_out(ipc_handle, (unsigned char)c); + + return c; +} +#endif diff --git a/plat/imx/imx8qm/include/platform_def.h b/plat/imx/imx8qm/include/platform_def.h index 138a4e1d..cf964187 100644 --- a/plat/imx/imx8qm/include/platform_def.h +++ b/plat/imx/imx8qm/include/platform_def.h @@ -64,6 +64,9 @@ #define MAX_XLAT_TABLES 8 #define MAX_MMAP_REGIONS 12 +/* enable it to make debug message to SC console */ +#define SC_CONSOLE 0 + #define DEBUG_CONSOLE 0 #define DEBUG_CONSOLE_A53 0 diff --git a/plat/imx/imx8qx/include/platform_def.h b/plat/imx/imx8qx/include/platform_def.h index 108627f6..c4415017 100644 --- a/plat/imx/imx8qx/include/platform_def.h +++ b/plat/imx/imx8qx/include/platform_def.h @@ -56,6 +56,9 @@ /* non-secure u-boot base */ #define PLAT_NS_IMAGE_OFFSET 0x80020000 +/* enable it to make debug message to SC console */ +#define SC_CONSOLE 0 + #define DEBUG_CONSOLE 0 #define DEBUG_CONSOLE_A35 0 |