firmware_FMap: Added support for testing intel CSE RW FMAP scheme

CSE RW FMAP adds  new section to RW_SECTION_A and RW_SECTION_B regions
called ME_RW_A and ME_RW_B respectively. Expected FMAP tree used in
the test is updated with these new sections if new scheme is used.

BUG=b:169304792
Branch=None
TEST= Ran the test with both type of images

Signed-off-by: Appukuttan <appukuttan.vk@intel.com>
Change-Id: Ibda32d5d1e84ab13467c938f48510bc71aff08ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2506974
Reviewed-by: Appukuttan Vk <appukuttan.vk@intel.corp-partner.google.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Tested-by: Appukuttan Vk <appukuttan.vk@intel.corp-partner.google.com>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
diff --git a/server/site_tests/firmware_FMap/firmware_FMap.py b/server/site_tests/firmware_FMap/firmware_FMap.py
index b7d8024..7f14f82 100644
--- a/server/site_tests/firmware_FMap/firmware_FMap.py
+++ b/server/site_tests/firmware_FMap/firmware_FMap.py
@@ -39,6 +39,14 @@
   'RW_VPD': {},
 }
 
+INTEL_CSE_RW_A = {
+   'ME_RW_A': {},
+}
+
+INTEL_CSE_RW_B = {
+   'ME_RW_B': {},
+}
+
 EXPECTED_FMAP_TREE_EC = {
   'WP_RO': {
     'EC_RO': {
@@ -109,6 +117,15 @@
             self.run_cmd(
                 'flashrom -p %s -r -i FMAP:%s' % (target, fmap))
             lines = self.run_cmd('dump_fmap -p %s' % fmap)
+            # Change the expected FMAP Tree if separate CBFS is used for CSE RW
+            command = "dump_fmap -F %s | grep ME_RW_A" % fmap
+            if (target in TARGET_BIOS) and  self.run_cmd(command):
+                self._EXPECTED_FMAP_TREE[target]['RW_SECTION_A'].update(
+                                                          INTEL_CSE_RW_A)
+                self._EXPECTED_FMAP_TREE[target]['RW_SECTION_B'].update(
+                                                          INTEL_CSE_RW_B)
+                logging.info("DUT uses INTEL CSE LITE FMAP Scheme")
+
             self.faft_client.system.remove_dir(tmpdir)
 
             # The above output is formatted as: