diff options
author | Marshall Dawson <marshalldawson3rd@gmail.com> | 2017-12-08 12:46:11 -0700 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2017-12-20 16:36:32 +0000 |
commit | d1cc3c213f94c6a75cf4613bf302c7a8f8c06b14 (patch) | |
tree | 8bdcdf729bd15b33bc952ed31e4df3a2bbf0d08a /src/soc/amd | |
parent | 66dd399ac2fb57321ba3095515b11d40ca7c5614 (diff) |
amd/common/psp: Add BootDone command
After the PSP receives the MboxBiosCmdBootDone, it will no longer honor
any command where the command-response buffer exists outside of SMM
memory. Add the command and automatically execute it before booting
the payload.
BUG=b:69971683
TEST=Boot Kahlee and observe console log
Change-Id: I8258a9e2f2627bf24342f927a3e7f49b49dc1d88
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/22787
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/amd')
-rw-r--r-- | src/soc/amd/common/block/psp/psp.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/psp/psp.c b/src/soc/amd/common/block/psp/psp.c index bb0a5fe8bd..a1a0e5baec 100644 --- a/src/soc/amd/common/block/psp/psp.c +++ b/src/soc/amd/common/block/psp/psp.c @@ -18,6 +18,7 @@ #include <region_file.h> #include <timer.h> #include <device/pci_def.h> +#include <bootstate.h> #include <console/console.h> #include <amdblocks/psp.h> @@ -185,6 +186,34 @@ int psp_notify_dram(void) } /* + * Notify the PSP that the system is completing the boot process. Upon + * receiving this command, the PSP will only honor commands where the buffer + * is in SMM space. + */ +static void psp_notify_boot_done(void *unused) +{ + int cmd_status; + struct mbox_default_buffer buffer = { + .header = { + .size = sizeof(buffer) + } + }; + + printk(BIOS_DEBUG, "PSP: Notify that POST is finishing... "); + + cmd_status = send_psp_command(MBOX_BIOS_CMD_BOOT_DONE, &buffer); + + /* buffer's status shouldn't change but report it if it does */ + if (rd_resp_sts(&buffer)) + printk(BIOS_DEBUG, "buffer status=0x%x ", + rd_resp_sts(&buffer)); + if (cmd_status) + printk(BIOS_DEBUG, "%s\n", status_to_string(cmd_status)); + else + printk(BIOS_DEBUG, "OK\n"); +} + +/* * Tell the PSP to load a firmware blob from a location in the BIOS image. */ static int psp_load_blob(int type, void *addr) @@ -238,3 +267,6 @@ int psp_load_named_blob(int type, const char *name) } return r; } + +BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, + psp_notify_boot_done, NULL); |