diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2018-12-01 15:28:03 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-12-05 13:30:56 +0000 |
commit | 8b04dc730ddcf6c80c556e89e1e17a64fdf39db7 (patch) | |
tree | e1bfa793d3fc91eebc4d8977f3024da6c4961c75 /src/drivers/smmstore/store.c | |
parent | dbcf293211df0d698c0d14b8668f55dd8be36ed3 (diff) | |
download | coreboot-8b04dc730ddcf6c80c556e89e1e17a64fdf39db7.tar.xz |
drivers/smmstore: Allow using raw FMAP regions
Use a raw fmap region SMMSTORE for the SMMSTORE mechanism, while
keeping the initial option to use a cbfsfile.
TESTED on Asus P5QC, (although it looks like the tianocore patches
using it might need some love as they can't seem to save properly).
Change-Id: I8c2b9b3a0ed16b2d37e6a97e33c671fb54df8de0
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/29991
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/drivers/smmstore/store.c')
-rw-r--r-- | src/drivers/smmstore/store.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/drivers/smmstore/store.c b/src/drivers/smmstore/store.c index 4463bad84a..409949a8d1 100644 --- a/src/drivers/smmstore/store.c +++ b/src/drivers/smmstore/store.c @@ -15,6 +15,7 @@ #include <boot_device.h> #include <cbfs.h> +#include <fmap.h> #include <commonlib/region.h> #include <console/console.h> #include <smmstore.h> @@ -57,15 +58,25 @@ static int lookup_store(struct region_device *rstore) { struct cbfsf file; - if (cbfs_locate_file_in_region(&file, - CONFIG_SMMSTORE_REGION, CONFIG_SMMSTORE_FILENAME, NULL) < 0) { - printk(BIOS_WARNING, "smm store: " - "Unable to find SMM store file in region '%s'\n", - CONFIG_SMMSTORE_REGION); - return -1; - } + if (IS_ENABLED(CONFIG_SMMSTORE_IN_CBFS)) { + if (cbfs_locate_file_in_region(&file, + CONFIG_SMMSTORE_REGION, + CONFIG_SMMSTORE_FILENAME, NULL) < 0) { + printk(BIOS_WARNING, "smm store: " + "Unable to find SMM store file in region '%s'\n", + CONFIG_SMMSTORE_REGION); + return -1; + } - cbfs_file_data(rstore, &file); + cbfs_file_data(rstore, &file); + } else { + if (fmap_locate_area_as_rdev_rw(CONFIG_SMMSTORE_REGION, rstore)) { + printk(BIOS_WARNING, + "smm store: Unable to find SMM store FMAP region '%s'\n", + CONFIG_SMMSTORE_REGION); + return -1; + } + } return 0; } |