Maximilian Brune has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/87292?usp=email )
Change subject: util/amdfwtool/amdfwtool.c: Remove APOB_NV src address check ......................................................................
util/amdfwtool/amdfwtool.c: Remove APOB_NV src address check
The current approach has two problems: - Just because the source address is 0 does not mean it is no specifically set. A bunch of mainboards specifiy their APOB_NV base address at 0 in their FMAP files. - There is no AMD SOC that has support for this binary, but doesn't give AMDFWTOOL the base address. It would also not work considering that AMD common/block/apob code gets the region from the FMAP.
Therefore just remove the check since no mainboard will ever enter the else branch.
tested: binary identical for at least 1 mainboard on each SOC generation.
Signed-off-by: Maximilian Brune maximilian.brune@9elements.com Change-Id: Ic85d6b25c95ab12dbcc72d17158591891dd04e97 --- M util/amdfwtool/amdfwtool.c 1 file changed, 5 insertions(+), 18 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/87292/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 73a13c3..d60cd66 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -1410,24 +1410,11 @@ biosdir->entries[count].address_mode = SET_ADDR_MODE_BY_TABLE(biosdir); break; case AMD_BIOS_APOB_NV: - if (fw_table[i].src) { - /* If source is given, use that and its size */ - biosdir->entries[count].source = fw_table[i].src; - biosdir->entries[count].address_mode = - SET_ADDR_MODE(biosdir, AMD_ADDR_REL_BIOS); - biosdir->entries[count].size = fw_table[i].size; - } else { - /* Else reserve size bytes within amdfw.rom */ - adjust_current_pointer(ctx, 0, ERASE_ALIGNMENT); - biosdir->entries[count].source = RUN_CURRENT(*ctx); - biosdir->entries[count].address_mode = - SET_ADDR_MODE(biosdir, AMD_ADDR_REL_BIOS); - biosdir->entries[count].size = ALIGN_UP( - fw_table[i].size, ERASE_ALIGNMENT); - memset(BUFF_CURRENT(*ctx), 0xff, - biosdir->entries[count].size); - adjust_current_pointer(ctx, biosdir->entries[count].size, 1); - } + /* If source is given, use that and its size */ + biosdir->entries[count].source = fw_table[i].src; + biosdir->entries[count].address_mode = + SET_ADDR_MODE(biosdir, AMD_ADDR_REL_BIOS); + biosdir->entries[count].size = fw_table[i].size; break; case AMD_BIOS_BIN: /* Don't make a 2nd copy, point to the same one */