drivers/smmstore: Use lookup_store() for memory-mapped reads

The smmstore_lookup_region() function was using
fmap_locate_area_as_rdev_rw() directly, which only provides
direct SPI access. This bypassed the optimized lookup_store()
function that uses incoherent_rdev to enable memory-mapped
reads via the read-only device while keeping direct SPI writes
via the read-write device.

Change smmstore_lookup_region() to call lookup_store() instead,
enabling memory-mapped reads for the public API and matching
the behavior of the internal implementation.

This improves read performance for EFI options and other
consumers of the SMMSTORE region device. It also fixes an issue
where direct SPI reads were crossing 4k page boundaries on older
platforms (Broadwell and earlier) causing them to fail and the
fallback option to be used, leading to a disconnect between the
user-selected option and device beahvior.

TEST=build/boot google/guado, verify all CFR options work properly
and no errors in cbmem.

Change-Id: I34947be932ede19a3fe896fe0da6373035fe6db7
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90717
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Matt DeVillier 2026-01-09 09:59:31 -06:00
commit 95ad028274

View file

@ -134,7 +134,7 @@ int smmstore_lookup_region(struct region_device *rstore)
if (!done) {
done = 1;
if (fmap_locate_area_as_rdev_rw(SMMSTORE_REGION, &rdev)) {
if (lookup_store(&rdev)) {
printk(BIOS_WARNING,
"smm store: Unable to find SMM store FMAP region '%s'\n",
SMMSTORE_REGION);