From bccaab86582957483b0b7e50ead308ed1bff815d Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 12 Aug 2016 12:42:04 -0500 Subject: lib/fmap: provide RW region device support Explicitly provide a RW view of an FMAP region. This is required for platforms which have separate implementations of a RO boot device and a RW boot device. BUG=chrome-os-partner:56151 Change-Id: Ibafa3dc534f53a3d90487f3190c0f8a2e82858c2 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/16203 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/lib/fmap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/lib/fmap.c') diff --git a/src/lib/fmap.c b/src/lib/fmap.c index bf99037f54..9602134d94 100644 --- a/src/lib/fmap.c +++ b/src/lib/fmap.c @@ -80,6 +80,16 @@ int fmap_locate_area_as_rdev(const char *name, struct region_device *area) return boot_device_ro_subregion(&ar, area); } +int fmap_locate_area_as_rdev_rw(const char *name, struct region_device *area) +{ + struct region ar; + + if (fmap_locate_area(name, &ar)) + return -1; + + return boot_device_rw_subregion(&ar, area); +} + int fmap_locate_area(const char *name, struct region *ar) { struct region_device fmrd; -- cgit v1.2.3