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>
This commit is contained in:
Karthikeyan Ramasubramanian 2023-03-08 10:24:50 -07:00 committed by Paul Fagerburg
parent 742b65bdf6
commit 225b4b3279
1 changed files with 16 additions and 1 deletions

View File

@ -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 main(int argc, char **argv)
{ {
int c; int c;
@ -2593,7 +2605,10 @@ int main(int argc, char **argv)
integrate_firmwares(&ctx, amd_romsig, amd_fw_table); 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; ctx.current_table = 0;
/* If the tool is invoked with command-line options to keep the signed PSP /* If the tool is invoked with command-line options to keep the signed PSP