summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/common/psp_verstage/include/psp_verstage.h1
-rw-r--r--src/soc/amd/common/psp_verstage/psp_verstage.c15
-rw-r--r--src/soc/amd/picasso/psp_verstage/svc.c5
3 files changed, 18 insertions, 3 deletions
diff --git a/src/soc/amd/common/psp_verstage/include/psp_verstage.h b/src/soc/amd/common/psp_verstage/include/psp_verstage.h
index f7cb1c94b0..65897257ab 100644
--- a/src/soc/amd/common/psp_verstage/include/psp_verstage.h
+++ b/src/soc/amd/common/psp_verstage/include/psp_verstage.h
@@ -56,6 +56,7 @@ uint32_t verstage_soc_early_init(void);
void verstage_soc_init(void);
uintptr_t *map_spi_rom(void);
+uint32_t get_max_workbuf_size(uint32_t *size);
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);
diff --git a/src/soc/amd/common/psp_verstage/psp_verstage.c b/src/soc/amd/common/psp_verstage/psp_verstage.c
index 58f17e14f1..f6cc5e95b8 100644
--- a/src/soc/amd/common/psp_verstage/psp_verstage.c
+++ b/src/soc/amd/common/psp_verstage/psp_verstage.c
@@ -25,6 +25,14 @@ static struct mem_region_device boot_dev =
void __weak verstage_mainboard_early_init(void) {}
void __weak verstage_mainboard_init(void) {}
+uint32_t __weak get_max_workbuf_size(uint32_t *size)
+{
+ /* This svc only exists in picasso and deprecated for later platforms.
+ * Provide sane default function here for those platforms.
+ */
+ *size = (uint32_t)((uintptr_t)_etransfer_buffer - (uintptr_t)_transfer_buffer);
+ return 0;
+}
static void reboot_into_recovery(struct vb2_context *ctx, uint32_t subcode)
{
@@ -133,10 +141,11 @@ static uint32_t save_buffers(struct vb2_context **ctx)
struct transfer_info_struct buffer_info = {0};
/*
- * This should never fail, but if it does, we should still try to
- * save the buffer. If that fails, then we should go to recovery mode.
+ * This should never fail on picasso, but if it does, we should still
+ * try to save the buffer. If that fails, then we should go to
+ * recovery mode.
*/
- if (svc_get_max_workbuf_size(&max_buffer_size)) {
+ if (get_max_workbuf_size(&max_buffer_size)) {
post_code(POSTCODE_DEFAULT_BUFFER_SIZE_NOTICE);
printk(BIOS_NOTICE, "Notice: using default transfer buffer size.\n");
max_buffer_size = MIN_TRANSFER_BUFFER_SIZE;
diff --git a/src/soc/amd/picasso/psp_verstage/svc.c b/src/soc/amd/picasso/psp_verstage/svc.c
index a20c2a618f..28e6bafa95 100644
--- a/src/soc/amd/picasso/psp_verstage/svc.c
+++ b/src/soc/amd/picasso/psp_verstage/svc.c
@@ -149,6 +149,11 @@ uint32_t svc_write_postcode(uint32_t postcode)
return retval;
}
+uint32_t get_max_workbuf_size(uint32_t *size)
+{
+ return svc_get_max_workbuf_size(size);
+}
+
uint32_t svc_get_max_workbuf_size(uint32_t *size)
{
uint32_t retval = 0;