summaryrefslogtreecommitdiffstats
path: root/src/sbefw/core/sbeConsole.H
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2018-08-29 06:12:10 -0500
committerSachin Gupta <sgupta2m@in.ibm.com>2018-11-13 00:04:40 -0600
commitcf61dc391d030f8071a9bfdf6a030d2713c9ecb8 (patch)
treecd68d324f198469abb8b590cb78e613cbb87ca08 /src/sbefw/core/sbeConsole.H
parent41ac7c13db4a0073e933251a6ed6530316ff51de (diff)
downloadtalos-sbe-cf61dc391d030f8071a9bfdf6a030d2713c9ecb8.tar.gz
talos-sbe-cf61dc391d030f8071a9bfdf6a030d2713c9ecb8.zip
SBE logs on serial console
Print relevant information of SBE on serial console cmvc-prereq: 1071648 Change-Id: I17c38a06efef37defaefa3ef041635ed5b101270 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65446 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/sbefw/core/sbeConsole.H')
-rw-r--r--src/sbefw/core/sbeConsole.H34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/sbefw/core/sbeConsole.H b/src/sbefw/core/sbeConsole.H
index fe9b5734..d8b85670 100644
--- a/src/sbefw/core/sbeConsole.H
+++ b/src/sbefw/core/sbeConsole.H
@@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -34,16 +35,34 @@
_SBE_MSG_CONSOLE(msg); \
_SBE_MSG_CONSOLE("\n\r"); \
SBE_UART_UNLOCK;
+
#define SBE_MSG_CONSOLE_2(msg1, msg2) \
SBE_UART_LOCK; \
_SBE_MSG_CONSOLE(msg1); \
- _SBE_MSG_CONSOLE(" "); \
_SBE_MSG_CONSOLE(msg2); \
_SBE_MSG_CONSOLE("\n\r"); \
SBE_UART_UNLOCK;
+
+#define SBE_MSG_CONSOLE_3(msg1, msg2, msg3) \
+ SBE_UART_LOCK; \
+ _SBE_MSG_CONSOLE(msg1); \
+ _SBE_MSG_CONSOLE(msg2); \
+ _SBE_MSG_CONSOLE(msg3); \
+ _SBE_MSG_CONSOLE("\n\r"); \
+ SBE_UART_UNLOCK;
+
+#define SBE_MSG_CONSOLE_4(msg1, msg2, msg3, msg4) \
+ SBE_UART_LOCK; \
+ _SBE_MSG_CONSOLE(msg1); \
+ _SBE_MSG_CONSOLE(msg2); \
+ _SBE_MSG_CONSOLE(msg3); \
+ _SBE_MSG_CONSOLE(msg4); \
+ _SBE_MSG_CONSOLE("\n\r"); \
+ SBE_UART_UNLOCK;
+
#define SBE_MSG_CONSOLE_HELPER_CALL(count, ...) SBE_MSG_CONSOLE_ ## count(__VA_ARGS__)
#define SBE_MSG_CONSOLE_HELPER(count, ...) SBE_MSG_CONSOLE_HELPER_CALL(count, __VA_ARGS__)
-#define SBE_MSG_CONSOLE(...) SBE_MSG_CONSOLE_HELPER(VARG_COUNT(__VA_ARGS__), __VA_ARGS__)
+#define SBE_MSG_CONSOLE(...) SBE_MSG_CONSOLE_CHECK(__VA_ARGS__)
#ifndef SBE_CONSOLE_SUPPORT
@@ -52,6 +71,7 @@
#define SBE_UART_LOCK
#define SBE_UART_UNLOCK
#define _SBE_MSG_CONSOLE(msg)
+#define SBE_MSG_CONSOLE_CHECK(...)
#else
@@ -60,11 +80,16 @@
#define SBE_UART_LOCK uartLock()
#define SBE_UART_UNLOCK uartUnLock()
+#define SBE_MSG_CONSOLE_CHECK(...) \
+ if(SBE_GLOBAL->sbeUartActive) \
+ { \
+ SBE_MSG_CONSOLE_HELPER(VARG_COUNT(__VA_ARGS__), __VA_ARGS__) \
+ }
// SBE messages
#define SBE_CONSOLE_WELCOME_MSG ("\n\r--== Welcome to SBE - CommitId[" STRINGIFY(SBE_COMMIT_ID) "] ==--")
-#define _SBE_MSG_CONSOLE(msg) \
- sbeMsgConsole(msg)
+#define _SBE_MSG_CONSOLE(msg) sbeMsgConsole(msg)
+
#define LPC_IO_SPACE 0xD0010000
#define LPC_MAX_IO_SPACE (64*1024)
@@ -73,6 +98,7 @@ void uartDisable(void);
void uartLock(void);
void uartUnLock(void);
void sbeMsgConsole(char const *msg);
+void sbeMsgConsole(uint32_t num);
//
/** UART Register Offsets */
enum
OpenPOWER on IntegriCloud