diff options
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r-- | src/soc/amd/common/block/psp/psp_gen2.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/psp/psp_gen2.c b/src/soc/amd/common/block/psp/psp_gen2.c index 59e62551c1..ef71d5b42a 100644 --- a/src/soc/amd/common/block/psp/psp_gen2.c +++ b/src/soc/amd/common/block/psp/psp_gen2.c @@ -1,11 +1,28 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include <console/console.h> +#include <cpu/x86/msr.h> #include <device/mmio.h> #include <timer.h> #include <amdblocks/psp.h> #include <soc/iomap.h> #include "psp_def.h" +#define PSP_MAILBOX_OFFSET 0x10570 + +void *soc_get_mbox_address(void) +{ + uintptr_t psp_mmio; + + psp_mmio = rdmsr(MSR_PSP_ADDR).lo; + if (!psp_mmio) { + printk(BIOS_WARNING, "PSP: MSR_PSP_ADDR uninitialized\n"); + return 0; + } + + return (void *)(psp_mmio + PSP_MAILBOX_OFFSET); +} + static u16 rd_mbox_sts(struct pspv2_mbox *mbox) { union { |