<p>Marshall Dawson has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22056">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">WIP soc/amd/common: Add PSP command to load fw blobs<br><br>An upcoming PSP firmware change will allow coreboot to load the two<br>SMU firmware blobs (one runs in SRAM and the other in DRAM).  The<br>traditional method is for the PSP to control most of the process,<br>e.g. loading the SRAM version prio to releasing the x86 reset.<br><br>Add a new command that can instruct the PSP to load the firmware blob<br>from a location in the flash.<br><br>The definition for commands 19 and 1a differ from others in that they<br>do not use a command/response buffer.  Instead, the PSP will look in<br>the command/response pointer registers directly for the blob's<br>address.<br><br>BUG=b:66339938<br><br>Change-Id: I8431af341930f45ac74f471628b4dc4ede7735f4<br>Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com><br>---<br>M src/soc/amd/common/block/include/amdblocks/psp.h<br>M src/soc/amd/common/block/psp/psp.c<br>2 files changed, 30 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/22056/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/amd/common/block/include/amdblocks/psp.h b/src/soc/amd/common/block/include/amdblocks/psp.h<br>index 42b9fb7..d52a4e6 100644<br>--- a/src/soc/amd/common/block/include/amdblocks/psp.h<br>+++ b/src/soc/amd/common/block/include/amdblocks/psp.h<br>@@ -31,6 +31,8 @@<br> #define MBOX_BIOS_CMD_CLEAR_S3_STS 0x07<br> #define MBOX_BIOS_CMD_C3_DATA_INFO 0x08<br> #define MBOX_BIOS_CMD_NOP          0x09<br>+#define MBOX_BIOS_CMD_SMU_FW       0x19<br>+#define MBOX_BIOS_CMD_SMU_FW2      0x1a<br> #define MBOX_BIOS_CMD_ABORT        0xfe<br> <br> /* generic PSP interface status */<br>@@ -78,6 +80,7 @@<br> #define PSPSTS_SEND_ERROR   4<br> #define PSPSTS_INIT_TIMEOUT 5<br> #define PSPSTS_CMD_TIMEOUT  6<br>+#define PSPSTS_INVALID_BLOB 7<br> <br> #if !defined(__SIMPLE_DEVICE__)<br> #include <device/device.h><br>@@ -93,5 +96,6 @@<br> <br> /* BIOS-to-PSP functions return 0 if successful, else negative value */<br> int psp_notify_dram(void);<br>+int psp_load_blob(u32 type, void *addr);<br> <br> #endif /* __AMD_PSP_H__ */<br>diff --git a/src/soc/amd/common/block/psp/psp.c b/src/soc/amd/common/block/psp/psp.c<br>index 788de2c..0f83c31 100644<br>--- a/src/soc/amd/common/block/psp/psp.c<br>+++ b/src/soc/amd/common/block/psp/psp.c<br>@@ -199,3 +199,29 @@<br> <br>      return cmd_status;<br> }<br>+<br>+/*<br>+ * Tell the PSP to load a firmware blob from a location in the BIOS image.<br>+ */<br>+int psp_load_blob(u32 type, void *addr)<br>+{<br>+      int cmd_status;<br>+<br>+   /* only two types currently supported */<br>+     if (type != MBOX_BIOS_CMD_SMU_FW && type != MBOX_BIOS_CMD_SMU_FW2) {<br>+         printk(BIOS_ERR, "BUG: Invalid PSP blob type %x\n", type);<br>+         return PSPSTS_INVALID_BLOB;<br>+  }<br>+<br>+ printk(BIOS_DEBUG, "PSP: Load blob type %x from @%p... ", type, addr);<br>+<br>+  /* Blob commands use the buffer registers as data, not pointer to buf */<br>+     cmd_status = send_psp_command(type, addr);<br>+<br>+        if (cmd_status)<br>+              printk(BIOS_DEBUG, "%s\n", status_to_string(cmd_status));<br>+  else<br>+         printk(BIOS_DEBUG, "OK\n");<br>+<br>+     return cmd_status;<br>+}<br></pre><p>To view, visit <a href="https://review.coreboot.org/22056">change 22056</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/22056"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I8431af341930f45ac74f471628b4dc4ede7735f4 </div>
<div style="display:none"> Gerrit-Change-Number: 22056 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Marshall Dawson <marshalldawson3rd@gmail.com> </div>