Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/22787
Change subject: amd/common/psp: Add BootDone command
......................................................................
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(a)gmail.com>
---
M src/soc/amd/common/block/psp/psp.c
1 file changed, 31 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/22787/1
diff --git a/src/soc/amd/common/block/psp/psp.c b/src/soc/amd/common/block/psp/psp.c
index 5aedfc1..f4aca79 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>
@@ -203,6 +204,33 @@
}
/*
+ * 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)
+{
+ struct mbox_default_buffer buffer;
+ int cmd_status;
+
+ printk(BIOS_DEBUG, "PSP: Notify that POST is finishing... ");
+
+ buffer.header.size = sizeof(struct mbox_default_buffer);
+ buffer.header.status = 0; /* PSP does not report status for this cmd */
+
+ 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)
@@ -256,3 +284,6 @@
}
return r;
}
+
+BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY,
+ psp_notify_boot_done, NULL);
--
To view, visit https://review.coreboot.org/22787
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8258a9e2f2627bf24342f927a3e7f49b49dc1d88
Gerrit-Change-Number: 22787
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/22776 )
Change subject: intel/sandybridge: Make timC training more robust.
......................................................................
Patch Set 2:
I'll test it on my platform.
Do you know why it has training errors ? Did you change one of the other timings until no more training erros occur ? Could try to change reg_c14_offset to see if it fixes the problem ?
--
To view, visit https://review.coreboot.org/22776
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9986616e86560c4980ccd8e3e549af53caa15c71
Gerrit-Change-Number: 22776
Gerrit-PatchSet: 2
Gerrit-Owner: Tobias Diedrich <ranma+coreboot(a)tdiedrich.de>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tobias Diedrich <ranma+coreboot(a)tdiedrich.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 08 Dec 2017 18:25:25 +0000
Gerrit-HasComments: No