diff options
author | Karthikeyan Ramasubramanian <kramasub@google.com> | 2023-03-08 10:24:50 -0700 |
---|---|---|
committer | Paul Fagerburg <pfagerburg@chromium.org> | 2023-03-15 17:30:12 +0000 |
commit | 225b4b3279aa0bbbb2528a26751d5cb0f52d24de (patch) | |
tree | db7a25efb237f3575e86271d35ffdccf5ef040a7 /util | |
parent | 742b65bdf6e0fc6dd46b30c8c91eae5d1efff828 (diff) |
amdfwtool: Remove the initial alignment on newer SoCs
On newer SoCs the initial alignment is not required. So skip initial
alignment. This saves 64 KiB flash space on each firmware slots. This
also saves ~5 ms while loading amdfw.rom
BUG=b:240696002
TEST=Build and boot to OS in Skyrim.
Change-Id: I27cbfde2d7d58b62a4c0039c60babc3fb3bd95fa
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73654
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/amdfwtool/amdfwtool.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index ac5aa19698..72a06cbea5 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -2181,6 +2181,18 @@ void open_process_config(char *config, amd_cb_config *cb_config, int debug) } } +static bool is_initial_alignment_required(enum platform soc_id) +{ + switch (soc_id) { + case PLATFORM_MENDOCINO: + case PLATFORM_PHOENIX: + case PLATFORM_GLINDA: + return false; + default: + return true; + } +} + int main(int argc, char **argv) { int c; @@ -2593,7 +2605,10 @@ int main(int argc, char **argv) integrate_firmwares(&ctx, amd_romsig, amd_fw_table); - adjust_current_pointer(&ctx, 0, 0x10000U); /* TODO: is it necessary? */ + if (is_initial_alignment_required(cb_config.soc_id)) { + /* TODO: Check for older platforms. */ + adjust_current_pointer(&ctx, 0, 0x10000U); + } ctx.current_table = 0; /* If the tool is invoked with command-line options to keep the signed PSP |