summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangheui Won <khwon@chromium.org>2021-07-14 02:42:43 +0000
committerRaul Rangel <rrangel@chromium.org>2021-07-14 20:45:10 +0000
commit275ade9539cd315cf72c4126ebcce714dc3102ee (patch)
tree200557efc51e6e53b89e6bd153c0766757fd230a
parenta0112c12c8d17eac5f04309db2a78fee44dc2428 (diff)
Revert "amdfwtool: Use relative address for EFS gen2"
This reverts commit 0fc87e31e0b9ad15dd199fe96189a2ade6abf240. Reason for revert: Breaks psp_verstage in guybrush BUG=b:182477057 Signed-off-by: Kangheui Won <khwon@chromium.org> Change-Id: Ie50cba4aaf31425ef8fee848c098a826f55c98da Reviewed-on: https://review.coreboot.org/c/coreboot/+/56131 Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--util/amdfwtool/amdfwtool.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c
index b4d1c0c5c6..4ec9edf006 100644
--- a/util/amdfwtool/amdfwtool.c
+++ b/util/amdfwtool/amdfwtool.c
@@ -343,12 +343,11 @@ amd_bios_entry amd_bios_table[] = {
typedef struct _context {
char *rom; /* target buffer, size of flash device */
uint32_t rom_size; /* size of flash device */
- uint32_t abs_address; /* produce absolute or relative address */
uint32_t current; /* pointer within flash & proxy buffer */
} context;
#define RUN_BASE(ctx) (0xFFFFFFFF - (ctx).rom_size + 1)
-#define RUN_OFFSET(ctx, offset) ((ctx).abs_address ? RUN_BASE(ctx) + (offset) : (offset))
+#define RUN_OFFSET(ctx, offset) (RUN_BASE(ctx) + (offset))
#define RUN_CURRENT(ctx) RUN_OFFSET((ctx), (ctx).current)
#define BUFF_OFFSET(ctx, offset) ((void *)((ctx).rom + (offset)))
#define BUFF_CURRENT(ctx) BUFF_OFFSET((ctx), (ctx).current)
@@ -1537,6 +1536,8 @@ int main(int argc, char **argv)
romsig_offset = ctx.current = dir_location - rom_base_address;
else
romsig_offset = ctx.current = AMD_ROMSIG_OFFSET;
+ printf(" AMDFWTOOL Using firmware directory location of 0x%08x\n",
+ RUN_CURRENT(ctx));
amd_romsig = BUFF_OFFSET(ctx, romsig_offset);
amd_romsig->signature = EMBEDDED_FW_SIGNATURE;
@@ -1555,13 +1556,6 @@ int main(int argc, char **argv)
fprintf(stderr, "WARNING: No SOC name specified.\n");
}
- if (amd_romsig->efs_gen.gen == EFS_SECOND_GEN)
- ctx.abs_address = 0;
- else
- ctx.abs_address = 1;
- printf(" AMDFWTOOL Using firmware directory location of %s address: 0x%08x\n",
- ctx.abs_address == 1 ? "absolute" : "relative", RUN_CURRENT(ctx));
-
integrate_firmwares(&ctx, amd_romsig, amd_fw_table);
ctx.current = ALIGN(ctx.current, 0x10000U); /* TODO: is it necessary? */