Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42830 )
Change subject: soc/amd/picasso: Add console & timestamp buffers to psp_verstage ......................................................................
soc/amd/picasso: Add console & timestamp buffers to psp_verstage
Create areas for console & timestamp data in psp_verstage and pass it to the x86 to save for use later.
BUG=b:159220781 TEST=Build & Boot trembyle
Signed-off-by: Martin Roth martin@coreboot.org Change-Id: I41c8d7a1565e761187e941d7d6021805a9744d06 --- M src/soc/amd/picasso/memlayout_psp_verstage.ld M src/soc/amd/picasso/psp_verstage/psp_verstage.c 2 files changed, 15 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/42830/1
diff --git a/src/soc/amd/picasso/memlayout_psp_verstage.ld b/src/soc/amd/picasso/memlayout_psp_verstage.ld index fe70f08..764c3e3 100644 --- a/src/soc/amd/picasso/memlayout_psp_verstage.ld +++ b/src/soc/amd/picasso/memlayout_psp_verstage.ld @@ -15,6 +15,8 @@ #define VBOOT_WORK_START 0x24000 #define VBOOT_WORK_SIZE 12K #define FMAP_CACHE_SIZE 2K +#define PSP_CONSOLE_SIZE CONFIG_PRERAM_CBMEM_CONSOLE_SIZE +#define PSP_TIMESTAMP_SIZE 0x100
/* * The temp stack can be made much smaller if needed - even 256 bytes @@ -53,6 +55,8 @@ _everstage = _verstage + VERSTAGE_SIZE;
REGION(vboot2_work, VERSTAGE_START + VERSTAGE_SIZE, VBOOT_WORK_SIZE, 64) + PRERAM_CBMEM_CONSOLE(., PSP_CONSOLE_SIZE) + TIMESTAMP(., PSP_TIMESTAMP_SIZE)
FMAP_CACHE(., FMAP_SIZE)
diff --git a/src/soc/amd/picasso/psp_verstage/psp_verstage.c b/src/soc/amd/picasso/psp_verstage/psp_verstage.c index bac0548..b13edb7 100644 --- a/src/soc/amd/picasso/psp_verstage/psp_verstage.c +++ b/src/soc/amd/picasso/psp_verstage/psp_verstage.c @@ -108,15 +108,20 @@ } printk(BIOS_DEBUG, "\nMaximum buffer size: %d bytes\n", max_buffer_size);
- retval = vb2api_relocate(_vboot2_work, _vboot2_work, buffer_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); + /* 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, buffer_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)_etimestamp - (uintptr_t)_vboot2_work) }
if (buffer_size > max_buffer_size) { - printk(BIOS_ERR, "Error: Workbuf is larger than max buffer size.\n"); + printk(BIOS_ERR, "Error: Buffer is larger than max buffer size.\n"); post_code(POSTCODE_WORKBUF_BUFFER_SIZE_ERROR); return POSTCODE_WORKBUF_BUFFER_SIZE_ERROR; }