psp_verstage: move svc to platform-specific dir

Since there are some differences between picasso PSP svc and cezanne PSP
svc, each platform should have their own svc wrapper.

Moreover cezanne PSP will drop unused parameters from
update_psp_bios_dir and save_uapp_data so make wrapper around it.

BUG=b:182477057
BRANCH=none
TEST=build psp_verstage and boot on zork

Signed-off-by: Kangheui Won <khwon@chromium.org>
Change-Id: I69f998865fc3184ea8900a431924a315c5ee9133
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52307
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Kangheui Won 2021-04-14 09:35:28 +10:00 committed by Martin Roth
parent e20bc464fb
commit a767eb4ed9
6 changed files with 19 additions and 5 deletions

View File

@ -16,7 +16,6 @@ verstage-y += printk.c
verstage-y += psp_verstage.c
verstage-y += psp.c
verstage-y += reset.c
verstage-y += svc.c
verstage-y += timer.c
verstage-y += vboot_crypto.c

View File

@ -56,4 +56,7 @@ uint32_t verstage_soc_early_init(void);
void verstage_soc_init(void);
uintptr_t *map_spi_rom(void);
uint32_t update_psp_bios_dir(uint32_t *psp_dir_offset, uint32_t *bios_dir_offset);
uint32_t save_uapp_data(void *address, uint32_t size);
#endif /* PSP_VERSTAGE_H */

View File

@ -113,8 +113,7 @@ static uint32_t update_boot_region(struct vb2_context *ctx)
return POSTCODE_BDT1_COOKIE_MISMATCH_ERROR;
}
if (svc_update_psp_bios_dir((void *)&psp_dir_addr,
(void *)&bios_dir_addr, DIR_OFFSET_SET)) {
if (update_psp_bios_dir((void *)&psp_dir_addr, (void *)&bios_dir_addr)) {
printk(BIOS_ERR, "Error: Updated BIOS Directory could not be set.\n");
return POSTCODE_UPDATE_PSP_BIOS_DIR_ERROR;
}
@ -179,8 +178,7 @@ static uint32_t save_buffers(struct vb2_context **ctx)
memcpy(_transfer_buffer, &buffer_info, sizeof(buffer_info));
retval = svc_save_uapp_data(UAPP_COPYBUF_CHROME_WORKBUF, (void *)_transfer_buffer,
buffer_size);
retval = save_uapp_data((void *)_transfer_buffer, buffer_size);
if (retval) {
printk(BIOS_ERR, "Error: Could not save workbuf. Error code 0x%08x\n", retval);
return POSTCODE_WORKBUF_SAVE_ERROR;

View File

@ -3,5 +3,7 @@
verstage-generic-ccopts += -I$(src)/soc/amd/picasso/psp_verstage/include
verstage-generic-ccopts += -I$(src)/vendorcode/amd/fsp/picasso/include
verstage-y += svc.c
verstage-y += $(top)/src/vendorcode/amd/fsp/picasso/bl_uapp/bl_uapp_startup.S
verstage-y += $(top)/src/vendorcode/amd/fsp/picasso/bl_uapp/bl_uapp_end.S

View File

@ -4,6 +4,7 @@
#include <assert.h>
#include <bl_uapp/bl_syscall_public.h>
#include <psp_verstage.h>
#include <stddef.h>
void svc_exit(uint32_t status)
@ -95,6 +96,12 @@ uint32_t svc_unmap_spi_rom(void *spi_rom_addr)
return retval;
}
uint32_t update_psp_bios_dir(uint32_t *psp_dir_offset, uint32_t *bios_dir_offset)
{
return svc_update_psp_bios_dir(psp_dir_offset, bios_dir_offset,
DIR_OFFSET_SET);
}
uint32_t svc_update_psp_bios_dir(uint32_t *psp_dir_offset,
uint32_t *bios_dir_offset, enum dir_offset_operation operation)
{
@ -105,6 +112,11 @@ uint32_t svc_update_psp_bios_dir(uint32_t *psp_dir_offset,
return retval;
}
uint32_t save_uapp_data(void *address, uint32_t size)
{
return svc_save_uapp_data(UAPP_COPYBUF_CHROME_WORKBUF, address, size);
}
uint32_t svc_save_uapp_data(enum uapp_copybuf type, void *address,
uint32_t size)
{