From 470861206100f8f1aab63fda5359c31b3583cd2b Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Fri, 1 Mar 2019 10:45:13 +0800 Subject: fmap: Add FMAP_AREA_PRESERVE When updating firmware, we may need to preserve some sections like VPD, calibration data, ... etc. The logic can be hard-coded in updater as a list of known names, but a better solution is to have that directly declared inside FMAP area flags. To do that, the first step is to apply the changes in flash map (http://crosreview.com/1493767). A new FMAP_AREA_PRESERVE is now defined and will be set in future with new syntax in FMD parser. BUG=chromium:936768 TEST=make; boots an x86 image. Change-Id: Idba5c8d4a4c5d272f22be85d2054c6c0ce020b1b Signed-off-by: Hung-Te Lin Reviewed-on: https://review.coreboot.org/c/31676 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- payloads/libpayload/include/fmap_serialized.h | 1 + src/commonlib/include/commonlib/fmap_serialized.h | 1 + util/cbfstool/flashmap/fmap.c | 1 + util/cbfstool/flashmap/fmap.h | 1 + 4 files changed, 4 insertions(+) diff --git a/payloads/libpayload/include/fmap_serialized.h b/payloads/libpayload/include/fmap_serialized.h index 1e83760442..53a09af7a8 100644 --- a/payloads/libpayload/include/fmap_serialized.h +++ b/payloads/libpayload/include/fmap_serialized.h @@ -48,6 +48,7 @@ enum fmap_flags { FMAP_AREA_STATIC = 1 << 0, FMAP_AREA_COMPRESSED = 1 << 1, FMAP_AREA_RO = 1 << 2, + FMAP_AREA_PRESERVE = 1 << 3, }; /* Mapping of volatile and static regions in firmware binary */ diff --git a/src/commonlib/include/commonlib/fmap_serialized.h b/src/commonlib/include/commonlib/fmap_serialized.h index 1e83760442..53a09af7a8 100644 --- a/src/commonlib/include/commonlib/fmap_serialized.h +++ b/src/commonlib/include/commonlib/fmap_serialized.h @@ -48,6 +48,7 @@ enum fmap_flags { FMAP_AREA_STATIC = 1 << 0, FMAP_AREA_COMPRESSED = 1 << 1, FMAP_AREA_RO = 1 << 2, + FMAP_AREA_PRESERVE = 1 << 3, }; /* Mapping of volatile and static regions in firmware binary */ diff --git a/util/cbfstool/flashmap/fmap.c b/util/cbfstool/flashmap/fmap.c index 733f468390..f1d2fb9e0c 100644 --- a/util/cbfstool/flashmap/fmap.c +++ b/util/cbfstool/flashmap/fmap.c @@ -59,6 +59,7 @@ const struct valstr flag_lut[] = { { FMAP_AREA_STATIC, "static" }, { FMAP_AREA_COMPRESSED, "compressed" }, { FMAP_AREA_RO, "ro" }, + { FMAP_AREA_PRESERVE, "preserve" }, }; /* returns size of fmap data structure if successful, <0 to indicate error */ diff --git a/util/cbfstool/flashmap/fmap.h b/util/cbfstool/flashmap/fmap.h index 6e2091fc4f..e360011328 100644 --- a/util/cbfstool/flashmap/fmap.h +++ b/util/cbfstool/flashmap/fmap.h @@ -49,6 +49,7 @@ enum fmap_flags { FMAP_AREA_STATIC = 1 << 0, FMAP_AREA_COMPRESSED = 1 << 1, FMAP_AREA_RO = 1 << 2, + FMAP_AREA_PRESERVE = 1 << 3, }; /* Mapping of volatile and static regions in firmware binary */ -- cgit v1.2.3