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/+/63344
to review the following change.
Change subject: amdfwtool: Add a flag to record the second gen instead of romsig ......................................................................
amdfwtool: Add a flag to record the second gen instead of romsig
This is for future feature combo, which gets the soc id from fw.cfg in a loop instead of the command line, and the romsig is not set until fw.cfg is processed.
Change-Id: Id50311034b46aa1791dcc10b107de4af6c86b927 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M util/amdfwtool/amdfwtool.c M util/amdfwtool/amdfwtool.h 2 files changed, 25 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/63344/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 23273e6..4d23a75 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -1471,6 +1471,27 @@ return false; }
+static bool is_second_gen(enum platform platform_type) +{ + switch (platform_type) { + case PLATFORM_STONEYRIDGE: + case PLATFORM_RAVEN: + case PLATFORM_PICASSO: + return false; + break; + case PLATFORM_RENOIR: + case PLATFORM_LUCIENNE: + case PLATFORM_CEZANNE: + case PLATFORM_SABRINA: + return true; + break; + case PLATFORM_UNKNOWN: + default: + fprintf(stderr, "Error: Invalid SOC name.\n\n"); + return false; + } +} + int main(int argc, char **argv) { int c; @@ -1702,6 +1723,8 @@ } }
+ cb_config.second_gen = is_second_gen(soc_id) ? EFS_SECOND_GEN : EFS_BEFORE_SECOND_GEN; + if (needs_ish(soc_id)) cb_config.need_ish = true;
@@ -1822,7 +1845,7 @@
if (cb_config.need_ish) ctx.address_mode = ADDRESS_MODE_2_REL_TAB; - else if (amd_romsig->efs_gen.gen == EFS_SECOND_GEN) + else if (cb_config.second_gen == EFS_SECOND_GEN) ctx.address_mode = ADDRESS_MODE_1_REL_BIOS; else ctx.address_mode = ADDRESS_MODE_0_PHY; diff --git a/util/amdfwtool/amdfwtool.h b/util/amdfwtool/amdfwtool.h index 3af4e94..936ef14 100644 --- a/util/amdfwtool/amdfwtool.h +++ b/util/amdfwtool/amdfwtool.h @@ -276,6 +276,7 @@ bool load_mp2_fw; bool multi_level; bool s0i3; + uint8_t second_gen; bool have_mb_spl; bool recovery_ab; bool need_ish;