summaryrefslogtreecommitdiff
path: root/src/soc/intel
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2017-02-07 11:33:56 -0600
committerAaron Durbin <adurbin@chromium.org>2017-02-08 15:12:31 +0100
commit7d14af815492d7d886244086ad24dde3d9805381 (patch)
treeadc7ec129d126ce3e440dfe48a962a2c9ea5fe4c /src/soc/intel
parent96a4317fa9543a0d07e34bae3d40da810554411f (diff)
soc/intel/apollolake: dump CSE status
Dump the CSE status registers for potential debugging purposes. Explicitly call out manufacturing mode of the part since it's important shipping devices ensure manufacturing mode is locked down. Intel is planning on writing a common driver so a complete status -> string dumps was not done because (surprise surprise) not all the fields are equal with previous implementations. BUG=chrome-os-partner:62177 BRANCH=reef TEST=Booted and noted dump of CSE status registers. Change-Id: I71d15722bb193877f1569c1d3e7f441302f5bd14 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/18303 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/intel')
-rw-r--r--src/soc/intel/apollolake/Makefile.inc1
-rw-r--r--src/soc/intel/apollolake/cse.c57
2 files changed, 58 insertions, 0 deletions
diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 5a65f43485..df93f0bd4d 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -57,6 +57,7 @@ smm-y += uart_early.c
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
ramstage-y += cpu.c
ramstage-y += chip.c
+ramstage-y += cse.c
ramstage-y += elog.c
ramstage-y += flash_ctrlr.c
ramstage-y += dsp.c
diff --git a/src/soc/intel/apollolake/cse.c b/src/soc/intel/apollolake/cse.c
new file mode 100644
index 0000000000..b8ab1f0a1a
--- /dev/null
+++ b/src/soc/intel/apollolake/cse.c
@@ -0,0 +1,57 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2017 Google, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <arch/io.h>
+#include <bootstate.h>
+#include <console/console.h>
+#include <soc/pci_devs.h>
+#include <stdint.h>
+
+#define PCI_ME_HFSTS1 0x40
+#define PCI_ME_HFSTS2 0x48
+#define PCI_ME_HFSTS3 0x60
+#define PCI_ME_HFSTS4 0x64
+#define PCI_ME_HFSTS5 0x68
+#define PCI_ME_HFSTS6 0x6c
+
+static uint32_t dump_status(int index, int reg_addr)
+{
+ uint32_t reg = pci_read_config32(CSE_DEV, reg_addr);
+
+ printk(BIOS_DEBUG, "CSE FWSTS%d: 0x%08x\n", index, reg);
+
+ return reg;
+}
+
+static void dump_cse_state(void *unused)
+{
+ uint32_t fwsts1;
+
+ fwsts1 = dump_status(1, PCI_ME_HFSTS1);
+ dump_status(2, PCI_ME_HFSTS2);
+ dump_status(3, PCI_ME_HFSTS3);
+ dump_status(4, PCI_ME_HFSTS4);
+ dump_status(5, PCI_ME_HFSTS5);
+ dump_status(6, PCI_ME_HFSTS6);
+
+ /* Minimal decoding is done here in order to call out most important
+ pieces. Manufacturing mode needs to be locked down prior to shipping
+ the product so it's called out explicitly. */
+ printk(BIOS_DEBUG, "ME: Manufacturing Mode : %s\n",
+ (fwsts1 & (1 << 0x4)) ? "YES" : "NO");
+}
+
+BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, dump_cse_state, NULL);
+BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, dump_cse_state, NULL);