Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50447 )
Change subject: soc/amd/common/block/psp: factor out soc_get_psp_base_address ......................................................................
soc/amd/common/block/psp: factor out soc_get_psp_base_address
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: Ib73ac92e69f1be5852a1406ba714acb6a8a04989 --- M src/soc/amd/common/block/psp/psp_gen2.c 1 file changed, 9 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/50447/1
diff --git a/src/soc/amd/common/block/psp/psp_gen2.c b/src/soc/amd/common/block/psp/psp_gen2.c index ef71d5b..9198aeb 100644 --- a/src/soc/amd/common/block/psp/psp_gen2.c +++ b/src/soc/amd/common/block/psp/psp_gen2.c @@ -10,17 +10,17 @@
#define PSP_MAILBOX_OFFSET 0x10570
+static uintptr_t soc_get_psp_base_address(void) +{ + uintptr_t psp_mmio = rdmsr(MSR_PSP_ADDR).lo; + if (!psp_mmio) + printk(BIOS_WARNING, "PSP: MSR_PSP_ADDR uninitialized\n"); + return psp_mmio; +} + 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); + return (void *)(soc_get_psp_base_address() + PSP_MAILBOX_OFFSET); }
static u16 rd_mbox_sts(struct pspv2_mbox *mbox)