diff options
author | Felix Held <felix.held@amd.corp-partner.google.com> | 2020-04-15 17:05:38 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2020-04-16 23:17:41 +0000 |
commit | 7d304186057cc6c66e5469fadd003e3a62b8eb63 (patch) | |
tree | 168d0e7939c8fd45fa41cba0906f82a93a2db802 /src/soc/amd/common/block/psp/psp.c | |
parent | 90b8339b8d4338c14cfd791bf4d5058aa515da34 (diff) |
soc/amd/common/psp: refactor psp_print_cmd_status parameters
psp_print_cmd_status only needs data from the mbox buffer header and not
the whole buffer. This avoids type casts when the buffer type isn't
mbox_default_buffer.
BUG=b:153677737
Change-Id: I8688b66fefe89fc4f3ce2207d4360ceb2dbaef12
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40412
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd/common/block/psp/psp.c')
-rw-r--r-- | src/soc/amd/common/block/psp/psp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/soc/amd/common/block/psp/psp.c b/src/soc/amd/common/block/psp/psp.c index 479c28bc33..5f33c82e19 100644 --- a/src/soc/amd/common/block/psp/psp.c +++ b/src/soc/amd/common/block/psp/psp.c @@ -39,19 +39,19 @@ static const char *status_to_string(int err) } } -static u32 rd_resp_sts(struct mbox_default_buffer *buffer) +static u32 rd_resp_sts(struct mbox_buffer_header *header) { - return read32(&buffer->header.status); + return read32(&header->status); } /* * Print meaningful status to the console. Caller only passes a pointer to a - * buffer if it's expected to contain its own status. + * buffer header if it's expected to contain its own status. */ -void psp_print_cmd_status(int cmd_status, struct mbox_default_buffer *buffer) +void psp_print_cmd_status(int cmd_status, struct mbox_buffer_header *header) { - if (buffer && rd_resp_sts(buffer)) - printk(BIOS_DEBUG, "buffer status=0x%x ", rd_resp_sts(buffer)); + if (header && rd_resp_sts(header)) + printk(BIOS_DEBUG, "buffer status=0x%x ", rd_resp_sts(header)); if (cmd_status) printk(BIOS_DEBUG, "%s\n", status_to_string(cmd_status)); @@ -77,7 +77,7 @@ int psp_notify_dram(void) 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); + psp_print_cmd_status(cmd_status, &buffer.header); return cmd_status; } @@ -101,7 +101,7 @@ static void psp_notify_boot_done(void *unused) cmd_status = send_psp_command(MBOX_BIOS_CMD_BOOT_DONE, &buffer); /* buffer's status shouldn't change but report it if it does */ - psp_print_cmd_status(cmd_status, &buffer); + psp_print_cmd_status(cmd_status, &buffer.header); } BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, |