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 2e3b12fd31..8c195781d1 100644 --- a/src/soc/amd/common/psp_verstage/include/psp_verstage.h +++ b/src/soc/amd/common/psp_verstage/include/psp_verstage.h @@ -59,7 +59,6 @@ void verstage_soc_i2c_init(void); void verstage_soc_spi_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); uint32_t get_bios_dir_addr(struct embedded_firmware *ef_table); diff --git a/src/soc/amd/common/psp_verstage/psp_verstage.c b/src/soc/amd/common/psp_verstage/psp_verstage.c index 30dc115131..7359a44e52 100644 --- a/src/soc/amd/common/psp_verstage/psp_verstage.c +++ b/src/soc/amd/common/psp_verstage/psp_verstage.c @@ -27,15 +27,6 @@ extern char _bss_start, _bss_end; 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) { subcode += PSP_VBOOT_ERROR_SUBCODE; @@ -142,51 +133,21 @@ static uint32_t update_boot_region(struct vb2_context *ctx) * Save workbuf (and soon memory console and timestamps) to the bootloader to pass * back to coreboot. */ -static uint32_t save_buffers(struct vb2_context **ctx) +static uint32_t save_buffers(void) { uint32_t retval; - uint32_t buffer_size = MIN_TRANSFER_BUFFER_SIZE; - uint32_t max_buffer_size; + uint32_t buffer_size; struct transfer_info_struct buffer_info = {0}; - /* - * 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 (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; - } - printk(BIOS_DEBUG, "\nMaximum buffer size: %d bytes\n", max_buffer_size); + buffer_size = + (uint32_t)((uintptr_t)_etransfer_buffer - (uintptr_t)_transfer_buffer); - /* Shrink workbuf if MP2 is in use and cannot be used to save buffer */ - if (max_buffer_size < VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE) { - retval = vb2api_relocate(_vboot2_work, _vboot2_work, MIN_WORKBUF_TRANSFER_SIZE, - ctx); - if (retval != VB2_SUCCESS) { - printk(BIOS_ERR, "Error shrinking workbuf. Error code %#x\n", retval); - buffer_size = VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE; - post_code(POSTCODE_WORKBUF_RESIZE_WARNING); - } - } else { - buffer_size = - (uint32_t)((uintptr_t)_etransfer_buffer - (uintptr_t)_transfer_buffer); - - buffer_info.console_offset = (uint32_t)((uintptr_t)_preram_cbmem_console - - (uintptr_t)_transfer_buffer); - buffer_info.timestamp_offset = (uint32_t)((uintptr_t)_timestamp - - (uintptr_t)_transfer_buffer); - buffer_info.fmap_offset = (uint32_t)((uintptr_t)_fmap_cache - - (uintptr_t)_transfer_buffer); - } - - if (buffer_size > max_buffer_size) { - printk(BIOS_ERR, "Buffer is larger than max buffer size.\n"); - post_code(POSTCODE_WORKBUF_BUFFER_SIZE_ERROR); - return POSTCODE_WORKBUF_BUFFER_SIZE_ERROR; - } + buffer_info.console_offset = (uint32_t)((uintptr_t)_preram_cbmem_console - + (uintptr_t)_transfer_buffer); + buffer_info.timestamp_offset = (uint32_t)((uintptr_t)_timestamp - + (uintptr_t)_transfer_buffer); + buffer_info.fmap_offset = (uint32_t)((uintptr_t)_fmap_cache - + (uintptr_t)_transfer_buffer); buffer_info.magic_val = TRANSFER_MAGIC_VAL; buffer_info.struct_bytes = sizeof(buffer_info); @@ -332,7 +293,7 @@ void Main(void) reboot_into_recovery(ctx, retval); post_code(POSTCODE_SAVE_BUFFERS); - retval = save_buffers(&ctx); + retval = save_buffers(); if (retval) reboot_into_recovery(ctx, retval); diff --git a/src/soc/amd/picasso/psp_verstage/chipset.c b/src/soc/amd/picasso/psp_verstage/chipset.c index 4bdb873b17..1cfcb0a558 100644 --- a/src/soc/amd/picasso/psp_verstage/chipset.c +++ b/src/soc/amd/picasso/psp_verstage/chipset.c @@ -14,11 +14,6 @@ uint32_t save_uapp_data(void *address, uint32_t size) return svc_save_uapp_data(UAPP_COPYBUF_CHROME_WORKBUF, address, size); } -uint32_t get_max_workbuf_size(uint32_t *size) -{ - return svc_get_max_workbuf_size(size); -} - uint32_t get_bios_dir_addr(struct embedded_firmware *ef_table) { return ef_table->bios1_entry;