summaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso/psp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/picasso/psp.c')
-rw-r--r--src/soc/amd/picasso/psp.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/soc/amd/picasso/psp.c b/src/soc/amd/picasso/psp.c
new file mode 100644
index 0000000000..d6eb7d31a3
--- /dev/null
+++ b/src/soc/amd/picasso/psp.c
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <console/console.h>
+#include <cpu/x86/msr.h>
+#include <amdblocks/psp.h>
+
+#define PSP_MAILBOX_OFFSET 0x10570
+#define MSR_CU_CBBCFG 0xc00110a2
+
+void *soc_get_mbox_address(void)
+{
+ uintptr_t psp_mmio;
+
+ psp_mmio = rdmsr(MSR_CU_CBBCFG).lo;
+ if (psp_mmio == 0xffffffff) {
+ printk(BIOS_WARNING, "PSP: MSR_CU_CBBCFG uninitialized\n");
+ return 0;
+ }
+
+ return (void *)(psp_mmio + PSP_MAILBOX_OFFSET);
+}