build: Add support for enabling sysfw traces
authorLokesh Vutla <lokeshvutla@ti.com>
Wed, 28 Aug 2019 08:59:46 +0000 (14:29 +0530)
committerAndreas Dannenberg <dannenberg@ti.com>
Thu, 29 Aug 2019 18:17:27 +0000 (13:17 -0500)
Sysfw provides a provision for enabling sysfw traces while booting.
This has to be enabled in board-cfg. In order to ease debug, enable
the sysfw trace support with the help of a build option. Use the
option to enable it:

$ make ENABLE_TRACE=1

Reported-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Makefile
README.md
soc/am65x/evm/board-cfg.c
soc/j721e/evm/board-cfg.c

index 644e98acf284adaf7fda2c903d13fae4d71e6f4e..9ad08a6976b59086bf3772dae1ef0560de409a80 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -88,6 +88,9 @@ CFLAGS ?= \
        -Isoc/${SOC}/${CONFIG} \
        -Iinclude
 
+ifdef ENABLE_TRACE
+CFLAGS += -DENABLE_TRACE
+endif
 
 SOURCES ?= \
        board-cfg.c \
index 043c7a8a17181ccab90cac09c2041b9869957a0c..9107026c410232f828c0507284a5e438beabef89 100644 (file)
--- a/README.md
+++ b/README.md
@@ -111,6 +111,7 @@ The following flags further modify the build steps:
 * BIN_DIR - Choose where the final output sysfw-{soc}-{configuration}.itb needs
   to be generated to.
 * KEY - Choose key to use for the signing system firmware image
+* ENABLE_TRACE=1 - Choose to enable sysfw traces while booting.
 
 
 Building SYSFW Image for High-Security(HS) devices
index 5cec0e4c7b656597d80abcd8c2438151a85e446b..f007e69e6e3626dac9ee07854e6bc078096175e5 100644 (file)
@@ -78,5 +78,16 @@ const struct boardcfg am65_boardcfg_data = {
                        .magic = BOARDCFG_DBG_CFG_MAGIC_NUM,
                        .size = sizeof(struct boardcfg_dbg_cfg),
                },
+#ifdef ENABLE_TRACE
+               .trace_dst_enables = BOARDCFG_TRACE_DST_UART0 |
+                                    BOARDCFG_TRACE_DST_ITM |
+                                    BOARDCFG_TRACE_DST_MEM,
+               .trace_src_enables = BOARDCFG_TRACE_SRC_PM |
+                                    BOARDCFG_TRACE_SRC_RM |
+                                    BOARDCFG_TRACE_SRC_SEC |
+                                    BOARDCFG_TRACE_SRC_BASE |
+                                    BOARDCFG_TRACE_SRC_USER |
+                                    BOARDCFG_TRACE_SRC_SUPR,
+#endif
        },
 };
index eba2588ac1ca777adb7e6adba3e43df238b5c16c..df76a506620bffee5eabc743294d778f121f1367 100644 (file)
@@ -78,5 +78,16 @@ const struct boardcfg j721e_boardcfg_data = {
                        .magic = BOARDCFG_DBG_CFG_MAGIC_NUM,
                        .size = sizeof(struct boardcfg_dbg_cfg),
                },
+#ifdef ENABLE_TRACE
+               .trace_dst_enables = BOARDCFG_TRACE_DST_UART0 |
+                                    BOARDCFG_TRACE_DST_ITM |
+                                    BOARDCFG_TRACE_DST_MEM,
+               .trace_src_enables = BOARDCFG_TRACE_SRC_PM |
+                                    BOARDCFG_TRACE_SRC_RM |
+                                    BOARDCFG_TRACE_SRC_SEC |
+                                    BOARDCFG_TRACE_SRC_BASE |
+                                    BOARDCFG_TRACE_SRC_USER |
+                                    BOARDCFG_TRACE_SRC_SUPR,
+#endif
        },
 };