summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block
diff options
context:
space:
mode:
authorMartin Roth <gaumless@gmail.com>2022-10-17 16:19:45 -0600
committerMartin Roth <martin.roth@amd.corp-partner.google.com>2022-10-28 21:37:24 +0000
commit530b111c42e5d87d95f84d92228817186b655500 (patch)
treea3d79a3a474bac4d070e63122a61165215753141 /src/soc/amd/common/block
parent300338fccfaf046be4ba728fd1b5431fd1057faa (diff)
soc/amd/common: Add coreboot post codes to STB
Adding coreboot's postcodes to the smart trace buffer lets us see the entire boot flow in one place. Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: I8eb9f777b303622c144203eb53e2e1bf3314afaa Reviewed-on: https://review.coreboot.org/c/coreboot/+/68546 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r--src/soc/amd/common/block/include/amdblocks/stb.h1
-rw-r--r--src/soc/amd/common/block/stb/Kconfig6
-rw-r--r--src/soc/amd/common/block/stb/stb.c6
3 files changed, 13 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/stb.h b/src/soc/amd/common/block/include/amdblocks/stb.h
index 51b01948f8..c8851f89a3 100644
--- a/src/soc/amd/common/block/include/amdblocks/stb.h
+++ b/src/soc/amd/common/block/include/amdblocks/stb.h
@@ -7,6 +7,7 @@
#define AMD_STB_PMI_0 0x30600
+#define AMD_STB_COREBOOT_POST_PREFIX 0xBA000000
#define AMD_STB_COREBOOT_MARKER 0xBAADF00D
struct stb_entry_struct {
diff --git a/src/soc/amd/common/block/stb/Kconfig b/src/soc/amd/common/block/stb/Kconfig
index 8935e92556..fe2b5b7a1a 100644
--- a/src/soc/amd/common/block/stb/Kconfig
+++ b/src/soc/amd/common/block/stb/Kconfig
@@ -14,4 +14,10 @@ config WRITE_STB_BUFFER_TO_CONSOLE
points through the boot process. Note that this will prevent the
entries from being stored if the Spill-to-DRAM feature is enabled.
+config ADD_POSTCODES_TO_STB
+ bool "Add coreboot postcodes to STB"
+ default y
+ help
+ Add coreboot's postcodes to the smart trace buffer
+
endif
diff --git a/src/soc/amd/common/block/stb/stb.c b/src/soc/amd/common/block/stb/stb.c
index 074a4ed714..0cea5c3d67 100644
--- a/src/soc/amd/common/block/stb/stb.c
+++ b/src/soc/amd/common/block/stb/stb.c
@@ -18,6 +18,12 @@ static uint32_t stb_read32(uint32_t reg)
return smn_read32(STB_CFG_SMN_ADDR + reg);
}
+void soc_post_code(uint8_t value)
+{
+ if (CONFIG(ADD_POSTCODES_TO_STB))
+ stb_write32(AMD_STB_PMI_0, AMD_STB_COREBOOT_POST_PREFIX | value);
+}
+
void write_stb_to_console(void)
{
int i;