Attention is currently required from: Bao Zheng, Jason Glenesk, Raul Rangel, Martin Roth, Marshall Dawson, Paul Menzel, Zheng Bao.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59308 )
Change subject: amdfwtool: Upgrade "relative address" to four address modes
......................................................................
Patch Set 10:
(3 comments)
Patchset:
PS10:
the patch seems to need to be rebased; at least the submit button is grayed out for me
File util/amdfwtool/amdfwtool.c:
https://review.coreboot.org/c/coreboot/+/59308/comment/ab5efc9d_d69a56fe
PS10, Line 353: 0
it would probably be good to add some defines for these values and use those here and also in the rest of the code
https://review.coreboot.org/c/coreboot/+/59308/comment/90a572a9_613b046d
PS10, Line 371: mode, table
i would swap the order of table and mode; having the table first would be more what i'd expect there
--
To view, visit https://review.coreboot.org/c/coreboot/+/59308
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I29a03f4381cd0507e2b2e3b359111e3375a73de1
Gerrit-Change-Number: 59308
Gerrit-PatchSet: 10
Gerrit-Owner: Bao Zheng <fishbaozi(a)gmail.com>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Kangheui Won <khwon(a)chromium.org>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Zheng Bao
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Bao Zheng <fishbaozi(a)gmail.com>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Martin Roth <martinroth(a)google.com>
Gerrit-Attention: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Zheng Bao
Gerrit-Comment-Date: Tue, 14 Dec 2021 23:46:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Jason Glenesk, Raul Rangel, Felix Held.
Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/60124 )
Change subject: soc/amd/common/block/psp: move psp_notify_dram to psp_gen1.c
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/60124
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I97b29fdc4a71d6493ec63fa60f580778f026ec0b
Gerrit-Change-Number: 60124
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Comment-Date: Tue, 14 Dec 2021 23:38:30 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Raul Rangel.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59550 )
Change subject: rules.h, thread.h, lib/cbfs: Add ENV_STAGE_SUPPORTS_COOP
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/59550
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1197406d1d36391998b08e3076146bb2fff59d00
Gerrit-Change-Number: 59550
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Comment-Date: Tue, 14 Dec 2021 22:46:01 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60124 )
Change subject: soc/amd/common/block/psp: move psp_notify_dram to psp_gen1.c
......................................................................
soc/amd/common/block/psp: move psp_notify_dram to psp_gen1.c
The MBOX_BIOS_CMD_DRAM_INFO PSP mailbox command is only available on the
first generation of PSP mailbox interface and not on the second
generation. The second generation of the PSP mailbox interface was
introduced with the AMD family 17h SoCs on which the DRAM is already
initialized before the x86 cores are released from reset.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I97b29fdc4a71d6493ec63fa60f580778f026ec0b
---
M src/soc/amd/common/block/include/amdblocks/psp.h
M src/soc/amd/common/block/psp/psp.c
M src/soc/amd/common/block/psp/psp_def.h
M src/soc/amd/common/block/psp/psp_gen1.c
4 files changed, 27 insertions(+), 25 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/60124/1
diff --git a/src/soc/amd/common/block/include/amdblocks/psp.h b/src/soc/amd/common/block/include/amdblocks/psp.h
index e749d75..c9986ca 100644
--- a/src/soc/amd/common/block/include/amdblocks/psp.h
+++ b/src/soc/amd/common/block/include/amdblocks/psp.h
@@ -51,6 +51,8 @@
#define PSPSTS_INVALID_NAME 8
#define PSPSTS_INVALID_BLOB 9
+/* PSP gen1-only. SoCs with PSP gen2 already have the DRAM initialized when
+ the x86 cores are released from reset. */
int psp_notify_dram(void);
int psp_notify_smm(void);
diff --git a/src/soc/amd/common/block/psp/psp.c b/src/soc/amd/common/block/psp/psp.c
index b955459..66f7d59 100644
--- a/src/soc/amd/common/block/psp/psp.c
+++ b/src/soc/amd/common/block/psp/psp.c
@@ -56,29 +56,6 @@
}
/*
- * Notify the PSP that DRAM is present. Upon receiving this command, the PSP
- * will load its OS into fenced DRAM that is not accessible to the x86 cores.
- */
-int psp_notify_dram(void)
-{
- int cmd_status;
- struct mbox_default_buffer buffer = {
- .header = {
- .size = sizeof(buffer)
- }
- };
-
- printk(BIOS_DEBUG, "PSP: Notify that DRAM is available... ");
-
- cmd_status = send_psp_command(MBOX_BIOS_CMD_DRAM_INFO, &buffer);
-
- /* buffer's status shouldn't change but report it if it does */
- psp_print_cmd_status(cmd_status, &buffer.header);
-
- return cmd_status;
-}
-
-/*
* 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.
diff --git a/src/soc/amd/common/block/psp/psp_def.h b/src/soc/amd/common/block/psp/psp_def.h
index 4d3aca5..5baa064 100644
--- a/src/soc/amd/common/block/psp/psp_def.h
+++ b/src/soc/amd/common/block/psp/psp_def.h
@@ -8,7 +8,6 @@
#include <amdblocks/psp.h>
/* x86 to PSP commands */
-#define MBOX_BIOS_CMD_DRAM_INFO 0x01
#define MBOX_BIOS_CMD_SMM_INFO 0x02
#define MBOX_BIOS_CMD_SX_INFO 0x03
#define MBOX_BIOS_CMD_SX_INFO_SLEEP_TYPE_MAX 0x07
@@ -19,7 +18,8 @@
#define MBOX_BIOS_CMD_S3_DATA_INFO 0x08
#define MBOX_BIOS_CMD_NOP 0x09
#define MBOX_BIOS_CMD_ABORT 0xfe
-/* x86 to PSP commands, v1 */
+/* x86 to PSP commands, v1-only */
+#define MBOX_BIOS_CMD_DRAM_INFO 0x01
#define MBOX_BIOS_CMD_SMU_FW 0x19
#define MBOX_BIOS_CMD_SMU_FW2 0x1a
diff --git a/src/soc/amd/common/block/psp/psp_gen1.c b/src/soc/amd/common/block/psp/psp_gen1.c
index 55070f2..37257ba 100644
--- a/src/soc/amd/common/block/psp/psp_gen1.c
+++ b/src/soc/amd/common/block/psp/psp_gen1.c
@@ -170,3 +170,26 @@
cbfs_unmap(blob);
return cmd_status;
}
+
+/*
+ * Notify the PSP that DRAM is present. Upon receiving this command, the PSP
+ * will load its OS into fenced DRAM that is not accessible to the x86 cores.
+ */
+int psp_notify_dram(void)
+{
+ int cmd_status;
+ struct mbox_default_buffer buffer = {
+ .header = {
+ .size = sizeof(buffer)
+ }
+ };
+
+ printk(BIOS_DEBUG, "PSP: Notify that DRAM is available... ");
+
+ cmd_status = send_psp_command(MBOX_BIOS_CMD_DRAM_INFO, &buffer);
+
+ /* buffer's status shouldn't change but report it if it does */
+ psp_print_cmd_status(cmd_status, &buffer.header);
+
+ return cmd_status;
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/60124
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I97b29fdc4a71d6493ec63fa60f580778f026ec0b
Gerrit-Change-Number: 60124
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60122 )
Change subject: drivers/spi/spi-generic: document SPI_CNTRLR_DEDUCT_CMD_LEN better
......................................................................
drivers/spi/spi-generic: document SPI_CNTRLR_DEDUCT_CMD_LEN better
This should make it a bit clearer what the differences between
SPI_CNTRLR_DEDUCT_OPCODE_LEN and SPI_CNTRLR_DEDUCT_CMD_LEN and the
corresponding functionality in spi_crop_chunk are.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I809adebb182fc0866b93372b5b486117176da388
---
M src/drivers/spi/spi-generic.c
M src/include/spi-generic.h
2 files changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/60122/1
diff --git a/src/drivers/spi/spi-generic.c b/src/drivers/spi/spi-generic.c
index 9796663..e6ec7bd 100644
--- a/src/drivers/spi/spi-generic.c
+++ b/src/drivers/spi/spi-generic.c
@@ -98,6 +98,10 @@
if (deduct_opcode_len)
cmd_len--;
+ /* Subtract command length from useable buffer size. If
+ deduct_opcode_len is set, only subtract the number command bytes
+ after the opcode. If the adjusted cmd_len is larger than ctrlr_max
+ return 0 to inidicate an error. */
if (deduct_cmd_len) {
if (ctrlr_max >= cmd_len) {
ctrlr_max -= cmd_len;
diff --git a/src/include/spi-generic.h b/src/include/spi-generic.h
index 77a3c09..acb22ec 100644
--- a/src/include/spi-generic.h
+++ b/src/include/spi-generic.h
@@ -111,7 +111,8 @@
enum {
/* Deduct the command length from the spi_crop_chunk() calculation for
- sizing a transaction. */
+ sizing a transaction. If SPI_CNTRLR_DEDUCT_OPCODE_LEN is set, only
+ the bytes after the command byte will be deducted. */
SPI_CNTRLR_DEDUCT_CMD_LEN = 1 << 0,
/* Remove the opcode size from the command length used in the
spi_crop_chunk() calculation. Controllers which have a dedicated
--
To view, visit https://review.coreboot.org/c/coreboot/+/60122
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I809adebb182fc0866b93372b5b486117176da388
Gerrit-Change-Number: 60122
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60121 )
Change subject: drivers/spi/spi-generic: fix edge case in spi_crop_chunk
......................................................................
drivers/spi/spi-generic: fix edge case in spi_crop_chunk
In the case of deduct_cmd_len being set and the adjusted cmd_len >=
ctrlr_max, ctrlr_max wasn't being adjusted and still had the value of
ctrlr->max_xfer_size. Handle this edge case (which we should never run
into) by setting ctrlr_max to 0 and printing a warning to the console.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I9941b2947bb0a44dfae8ee69f509795dfb0cb241
---
M src/drivers/spi/spi-generic.c
1 file changed, 8 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/21/60121/1
diff --git a/src/drivers/spi/spi-generic.c b/src/drivers/spi/spi-generic.c
index 116daf9..9796663 100644
--- a/src/drivers/spi/spi-generic.c
+++ b/src/drivers/spi/spi-generic.c
@@ -98,8 +98,14 @@
if (deduct_opcode_len)
cmd_len--;
- if (deduct_cmd_len && (ctrlr_max > cmd_len))
- ctrlr_max -= cmd_len;
+ if (deduct_cmd_len) {
+ if (ctrlr_max >= cmd_len) {
+ ctrlr_max -= cmd_len;
+ } else {
+ ctrlr_max = 0;
+ printk(BIOS_WARNING, "%s: Command longer than buffer\n", __func__);
+ }
+ }
return MIN(ctrlr_max, buf_len);
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/60121
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9941b2947bb0a44dfae8ee69f509795dfb0cb241
Gerrit-Change-Number: 60121
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange
Attention is currently required from: Jason Glenesk, Raul Rangel, Marshall Dawson.
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60120 )
Change subject: soc/amd/common/block/spi/fch_spi_ctrl: improve printk messages
......................................................................
soc/amd/common/block/spi/fch_spi_ctrl: improve printk messages
Replace FCH_SC with FCH SPI in the printk messages to make those a bit
clearer and also remove an unneeded line break in another printk call.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I6ff02163e6a48a2cc8b7fe89b15826e154715d29
---
M src/soc/amd/common/block/spi/fch_spi_ctrl.c
1 file changed, 3 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/60120/1
diff --git a/src/soc/amd/common/block/spi/fch_spi_ctrl.c b/src/soc/amd/common/block/spi/fch_spi_ctrl.c
index 33e1139..f790247 100644
--- a/src/soc/amd/common/block/spi/fch_spi_ctrl.c
+++ b/src/soc/amd/common/block/spi/fch_spi_ctrl.c
@@ -98,7 +98,7 @@
spi_write8(SPI_CMD_TRIGGER, SPI_CMD_TRIGGER_EXECUTE);
if (wait_for_ready()) {
- printk(BIOS_ERR, "FCH_SC Error: Timeout executing command\n");
+ printk(BIOS_ERR, "FCH SPI Error: Timeout executing command\n");
return -1;
}
@@ -121,8 +121,7 @@
const uint8_t *bufout = dout;
if (CONFIG(SOC_AMD_COMMON_BLOCK_SPI_DEBUG))
- printk(BIOS_DEBUG, "%s(%zx, %zx)\n", __func__, bytesout,
- bytesin);
+ printk(BIOS_DEBUG, "%s(%zx, %zx)\n", __func__, bytesout, bytesin);
/* First byte is cmd which cannot be sent through FIFO */
cmd = bufout[0];
@@ -136,7 +135,7 @@
* and followed by other SPI commands.
*/
if (bytesout + bytesin > SPI_FIFO_DEPTH) {
- printk(BIOS_WARNING, "FCH_SC: Too much to transfer, code error!\n");
+ printk(BIOS_WARNING, "FCH SPI: Too much to transfer, code error!\n");
return -1;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/60120
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6ff02163e6a48a2cc8b7fe89b15826e154715d29
Gerrit-Change-Number: 60120
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-MessageType: newchange