summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/intel/common/basecode/debug/debug_feature.c27
-rw-r--r--src/soc/intel/common/basecode/include/intelbasecode/debug_feature.h3
2 files changed, 29 insertions, 1 deletions
diff --git a/src/soc/intel/common/basecode/debug/debug_feature.c b/src/soc/intel/common/basecode/debug/debug_feature.c
index 64919346f8..d048abf81d 100644
--- a/src/soc/intel/common/basecode/debug/debug_feature.c
+++ b/src/soc/intel/common/basecode/debug/debug_feature.c
@@ -9,9 +9,22 @@
#define DEBUG_FEATURE_CTRL_SZ 64
#define SI_DESC_REGION_SZ 4096
+#define DEBUG_FEATURE_UNDEFINED 0xff
struct debug_feature_cntrl {
uint8_t cse_fw_update_disable; /* Byte location: 0xF00 */
- uint8_t reserved[63];
+
+ /*
+ * Supported CPU Trace Hub modes:
+ * 0: Disable, 1: Target Debugger Mode, 2: Host Debugger Mode
+ */
+ uint8_t cpu_tracehub_mode; /* Byte location: 0xF01 */
+
+ /*
+ * Supported PCH Trace Hub modes:
+ * 0: Disable, 1:Target Debugger Mode, 2:Host Debugger Mode
+ */
+ uint8_t pch_tracehub_mode; /* Byte location: 0xF02 */
+ uint8_t reserved[61];
};
static struct debug_feature_cntrl dbg_feature_cntrl;
@@ -20,6 +33,18 @@ _Static_assert(sizeof(struct debug_feature_cntrl) % 64 == 0
&& sizeof(struct debug_feature_cntrl) <= 256,
"sizeof(struct debug_feature_cntrl) must be a multiple of 64 bytes and up to 256 bytes");
+void debug_get_pch_cpu_tracehub_modes(uint8_t *cpu_tracehub_mode, uint8_t *pch_tracehub_mode)
+{
+ if (dbg_feature_cntrl.pch_tracehub_mode != DEBUG_FEATURE_UNDEFINED)
+ *pch_tracehub_mode = dbg_feature_cntrl.pch_tracehub_mode;
+
+ if (dbg_feature_cntrl.cpu_tracehub_mode != DEBUG_FEATURE_UNDEFINED)
+ *cpu_tracehub_mode = dbg_feature_cntrl.cpu_tracehub_mode;
+
+ printk(BIOS_DEBUG, "rt_debug: CPU Trace Hub Mode: %d PCH Trace Hub Mode: %d\n",
+ *pch_tracehub_mode, *cpu_tracehub_mode);
+}
+
bool is_debug_cse_fw_update_disable(void)
{
printk(BIOS_DEBUG, "rt_debug: dbg_feature_cntrl.cse_fw_update_disable=%d\n",
diff --git a/src/soc/intel/common/basecode/include/intelbasecode/debug_feature.h b/src/soc/intel/common/basecode/include/intelbasecode/debug_feature.h
index c8e23822d2..9a01590fcb 100644
--- a/src/soc/intel/common/basecode/include/intelbasecode/debug_feature.h
+++ b/src/soc/intel/common/basecode/include/intelbasecode/debug_feature.h
@@ -5,6 +5,9 @@
#include <types.h>
+/* Get cpu and pch tracehub modes defined in the OEM Section of descriptor region */
+void debug_get_pch_cpu_tracehub_modes(uint8_t *cpu_tracehub_mode, uint8_t *pch_trachub_mode);
+
/* Check if CSE firmware update is enabled or not */
bool is_debug_cse_fw_update_disable(void);