Subrata Banik has uploaded this change for review.

View Change

util/ifdtool: Enable Read Access for SPI Padding Region

As per Intel Meteor Lake SPI programming doc, the BIOS region should
have a read access enabled for SPI padding region (aka region 9).

This patch ensures that BIOS region is able to read the SPI padding
region.

BUG=b:274356894
BRANCH=firmware-rex-15709.B
TEST=Able to flash screebo AP FW image using flashrom on DUT.

Without this patch:

> flashrom -p internal -r /tmp/bios.rom
flashrom 1.4.0-devel on Linux 6.1.67-09255-ge8ae3115f8b0 (x86_64)
...
...
Found Winbond flash chip "W25Q256JW_DTR" (32768 kB, Programmer-specific)
on internal.
Reading flash... Transaction error between offset 0x0072f000 and
0x0072f03f (= 0x0072f000 + 63)!
read_flash: failed to read (0x72f000..0x7fffff).
Read operation failed!
FAILED.
FAILED

With this patch:

> flashrom -p internal -r /tmp/bios.rom
flashrom 1.4.0-devel on Linux 6.1.68-09294-g001fdda5287d (x86_64)
...
...
Found Winbond flash chip "W25Q256JW_DTR" (32768 kB, Programmer-specific)
on internal.
Reading flash... done.
SUCCESS

Change-Id: I18c44aa9a0f890f01a889247da118b69a58936e8
Signed-off-by: Subrata Banik <subratabanik@google.com>
---
M util/ifdtool/ifdtool.c
1 file changed, 4 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/79902/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c
index 99a83e5..ca8f21e 100644
--- a/util/ifdtool/ifdtool.c
+++ b/util/ifdtool/ifdtool.c
@@ -1451,6 +1451,10 @@
fmba->flmstr5 |= (1 << REGION_EC) << rd_shift;
fmba->flmstr5 |= (1 << REGION_EC) << wr_shift;
}
+ if (check_region(frba, REGION_DEV_EXP2)) {
+ /* BIOS can read SPI padding region. */
+ fmba->flmstr1 |= (1 << REGION_DEV_EXP2) << rd_shift;
+ }
break;
case PLATFORM_DNV:
case PLATFORM_WBG:

To view, visit change 79902. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I18c44aa9a0f890f01a889247da118b69a58936e8
Gerrit-Change-Number: 79902
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subratabanik@google.com>
Gerrit-MessageType: newchange