diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2024-07-30 15:08:48 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-07-31 20:07:03 +0000 |
commit | 9c366417dfca97cb3aacfaf684ceafc18d6419e6 (patch) | |
tree | 3dbb34ca53fdfe7d989c1d7bdd6b1444bd368c08 /src | |
parent | ad8d0eff746bf2612b1f043cee43b6f1dcd408aa (diff) |
soc/amd/common/psp_smm: add/improve comments to buffers and flags
Since it's not exactly obvious what 'c2p_buffer', 'p2c_buffer' and
'smm_flag' are used for, add comments to those.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I4ec092a92fe9f0686ffb7103e441802fc05381f4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83698
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/amd/common/block/psp/psp_smm.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/soc/amd/common/block/psp/psp_smm.c b/src/soc/amd/common/block/psp/psp_smm.c index 2112e868f6..114cf12add 100644 --- a/src/soc/amd/common/block/psp/psp_smm.c +++ b/src/soc/amd/common/block/psp/psp_smm.c @@ -14,15 +14,28 @@ #define C2P_BUFFER_MAXSIZE 0xc00 /* Core-to-PSP buffer */ #define P2C_BUFFER_MAXSIZE 0xc00 /* PSP-to-core buffer */ +/* + * When sending PSP mailbox commands to the PSP from the SMI handler after the boot done + * command was sent, the corresponding data buffer needs to be placed in this core to PSP (C2P) + * buffer. + */ struct { u8 buffer[C2P_BUFFER_MAXSIZE]; } __aligned(32) c2p_buffer; +/* + * When the PSP sends mailbox commands to the host, it will update the PSP to core (P2C) buffer + * and then send an SMI to the host to process the request. + */ struct { u8 buffer[P2C_BUFFER_MAXSIZE]; } __aligned(32) p2c_buffer; -static uint32_t smm_flag; /* Non-zero for SMM, clear when not */ +/* + * When sending PSP mailbox commands to the PSP from the SMI handler, the SMM flag needs to be + * set for the PSP to accept it. Otherwise it should be cleared. + */ +static uint32_t smm_flag; static void set_smm_flag(void) { |