bundle_firmware: remove cbfs-files node support

Medium term, fmap.dts is on the way out, so drop this feature before
people start using it.

BUG=chromium:595715
BRANCH=none
TEST=none

Change-Id: Ib61cd4fcf0c354a1c531bb00e32d7a6d7121ed3d
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/333711
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index 2179e29..61d6d5f 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -738,75 +738,6 @@
         self._tools.Run('cbfstool', [bootstub, 'add', '-f', file,
                                 '-n', cbfs_name, '-t', 'raw', '-c', 'lzma'])
 
-  def _ProcessCbfsFileProperty(self, cb_copy, node):
-    """Add files to CBFS in RW regions using a specification in fmap.dts
-
-    rw-a-boot {
-      ...
-      cbfs-files {
-       ecfoo = "add -n ecrw-copy -f ec.RW.bin -t raw -A sha256";
-      };
-    };
-
-    Adds a file called "ecrw-copy" of raw type to FW_MAIN_A with the
-    content of ec.RW.bin in the build root, with a SHA256 hash.
-    The dts property name ("ecfoo") is ignored but should be unique,
-    all cbfstool commands that start with "add" are allowed, as is "remove".
-    The second and third argument need to be "-n <cbfs file name>".
-    """
-    try:
-      cbfs_config = self.fdt.GetProps(node + '/cbfs-files')
-    except CmdError:
-      cbfs_config = None
-
-    # Ignore first character of node string,
-    # so both /flash/foo and flash/foo work.
-    region = node[1:].split('/')[1]
-    part_sections = region.split('-', 1)
-    fmap_dst = self._FmapNameByPath(part_sections)
-
-    if cbfs_config != None:
-      # remove all files slated for addition, in case they already exist
-      for val in cbfs_config.itervalues():
-        f = val.split(' ')
-        command = f[0]
-        if command[:3] != 'add' and command != 'remove':
-          raise CmdError("'%s' doesn't add or remove a file", f)
-        if f[1] != '-n':
-          raise CmdError("second argument in '%s' must be '-n'", f)
-        cbfsname = f[2]
-        try:
-          # Calling through shell isn't strictly necessary here, but we still
-          # do it to keep operation more similar to the invocation in the next
-          # loop.
-          self._tools.Run('sh', [ '-c',
-            ' '.join(['cbfstool', cb_copy, 'remove', '-r', fmap_dst,
-                                       '-n', cbfsname]) ])
-        except CmdError:
-          pass # the most likely error is that the file doesn't already exist
-
-      # Compact the CBFS image after removing the files so all the non-empty
-      # files are at the beginning of the region.
-      self._tools.Run('sh', [ '-c',
-        ' '.join(['cbfstool', cb_copy, 'compact', '-r', fmap_dst]) ])
-
-      # now add the files
-      for val in cbfs_config.itervalues():
-        f = val.split(' ')
-        command = f[0]
-        cbfsname = f[2]
-        args = f[3:]
-        if command == 'remove':
-          continue
-        # Call through shell so variable expansion can happen. With a change
-        # to the ebuild this enables specifying filename arguments to
-        # cbfstool as -f romstage.elf${COREBOOT_VARIANT} and have that be
-        # resolved to romstage.elf.serial when appropriate.
-        self._tools.Run('sh', [ '-c',
-            ' '.join(['cbfstool', cb_copy, command, '-r', fmap_dst,
-                      '-n', cbfsname] + args)],
-                      self._tools.Filename(self._GetBuildRoot()))
-
   def _CreateCorebootStub(self, pack, coreboot):
     """Create a coreboot boot stub and add pack properties.
 
@@ -845,12 +776,6 @@
     if self.rocbfs_files:
       self._AddCbfsFiles(bootstub, self.rocbfs_files)
 
-    # As a final step, do whatever is requested in /flash/ro-boot/cbfs-files.
-    # It's done after creating the copy for the RW regions so that ro-boot's
-    # cbfs-files property has no side-effects on the RW regions.
-    node = self.fdt.GetFlashNode('ro', 'boot')
-    self._ProcessCbfsFileProperty(os.path.abspath(bootstub), node)
-
 
   def _PackOutput(self, msg):
     """Helper function to write output from PackFirmware (verbose level 2).
@@ -992,10 +917,6 @@
         cb_copy, 'add', '-f', self.pdrw_fname, '-t', 'raw',
         '-n', 'pdrw', '-A', 'sha256', '-r', fmap_dst ])
 
-    # Check if there's an advanced CBFS configuration request
-    node = self.fdt.GetFlashNode(*part_sections)
-    self._ProcessCbfsFileProperty(cb_copy, node)
-
     # Parse the file list to obtain the last entry. If its empty use its
     # offset as the size of the CBFS to hash.
     stdout = self._tools.Run('cbfstool',