Attention is currently required from: Zheng Bao.
Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/78281?usp=email
to review the following change.
Change subject: amdfwtool: Use macro to get the table relative address ......................................................................
amdfwtool: Use macro to get the table relative address
TEST=Identical test on amd/chausie
Change-Id: Iece4ba65e0476543a8d472168d93801714330dde Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M util/amdfwtool/amdfwtool.c 1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/78281/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 99b0f9a..b81b1bb 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -934,7 +934,7 @@ uint32_t current_table_save;
current_table_save = ctx->current_table; - ctx->current_table = (char *)pspdir - ctx->rom; + ctx->current_table = BUFF_TO_RUN_MODE(*ctx, pspdir, AMD_ADDR_REL_BIOS); count = pspdir->header.num_entries; assert_fw_entry(count, MAX_PSP_ENTRIES, ctx); pspdir->entries[count].type = (uint8_t)ab; @@ -1012,7 +1012,7 @@ level = PSP_BOTH_AB; } current_table_save = ctx->current_table; - ctx->current_table = (char *)pspdir - ctx->rom; + ctx->current_table = BUFF_TO_RUN_MODE(*ctx, pspdir, AMD_ADDR_REL_BIOS); adjust_current_pointer(ctx, 0, TABLE_ALIGNMENT);
for (i = 0, count = 0; fw_table[i].type != AMD_FW_INVALID; i++) { @@ -1157,7 +1157,7 @@ uint32_t current_table_save;
current_table_save = ctx->current_table; - ctx->current_table = (char *)pspdir - ctx->rom; + ctx->current_table = BUFF_TO_RUN_MODE(*ctx, pspdir, AMD_ADDR_REL_BIOS);
/* If there is an entry of "type", replace it. */ for (index = 0; index < count; index++) { @@ -1313,7 +1313,7 @@ level = BDT_BOTH;
current_table_save = ctx->current_table; - ctx->current_table = (char *)biosdir - ctx->rom; + ctx->current_table = BUFF_TO_RUN_MODE(*ctx, biosdir, AMD_ADDR_REL_BIOS); adjust_current_pointer(ctx, 0, TABLE_ALIGNMENT);
for (i = 0, count = 0; fw_table[i].type != AMD_BIOS_INVALID; i++) {