Drop cros_bundle_firmware and related files

BUG=chromium:595715
BRANCH=none
CQ-DEPEND=CL:419395
TEST=build still succeeds

Change-Id: I48289a937abf75a1dbf2bc66f2d1e69a6922348b
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/418783
Commit-Ready: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
diff --git a/host/cros_bundle_firmware b/host/cros_bundle_firmware
deleted file mode 100755
index d693e50..0000000
--- a/host/cros_bundle_firmware
+++ /dev/null
@@ -1,154 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This utility builds a firmware image for a tegra-based board.
-
-This utility uses a number of libraries for its activity.
-
-Hint: in order to run this outside the chroot you will need the following
-from the chroot:
-
-  /usr/bin:
-    gbb_utility
-    cbootimage
-    vbutil_firmware
-
-  /usr/lib:
-    liblzma.so.0*
-    libyaml-0.so.1*
-
-"""
-
-# Python imports
-import optparse
-import os
-import sys
-
-# Add the path to our own libraries
-base = os.path.dirname(sys.argv[0])
-sys.path.append(base)
-sys.path.append(os.path.join(base, 'lib'))
-
-import bundle_firmware
-from bundle_firmware import Bundle
-import cros_output
-from tools import Tools
-from tools import CmdError
-
-def _DoBundle(options, output, tools):
-  """The main part of the cros_bundle_firmware code.
-
-  This takes the supplied options and performs the firmware bundling.
-
-  Args:
-    options: Parser options.
-    output: cros_output object to use.
-    tools: Tools object to use.
-  """
-  tools.PrepareOutputDir(options.outdir, options.preserve)
-  if options.includedirs:
-    tools.search_paths += options.includedirs
-
-  bundle = Bundle(tools=tools, output=output,
-                  keydir=options.key,
-                  board=options.board, uboot=options.uboot,
-                  coreboot=options.coreboot,
-                  coreboot_elf=options.coreboot_elf,
-                  seabios=options.seabios,
-                  ecrw=options.ecrw,
-                  ecro=options.ecro, pdrw=options.pdrw, kernel=options.kernel,
-                  cbfs_files=options.cbfs_files,
-                  rocbfs_files=options.rocbfs_files)
-
-  try:
-    bundle.Start(options.output, options.show_map)
-
-  except (CmdError, ValueError) as err:
-    # For verbosity 4 we want to display all possible information
-    if options.verbosity >= 4:
-      raise
-    else:
-      output.Error(str(err))
-      sys.exit(1)
-
-def main():
-  """Main function for cros_bundle_firmware."""
-  parser = optparse.OptionParser()
-  parser.add_option('-b', '--board', dest='board', type='string',
-      action='store', help='Board name to use (e.g. tegra2_kaen)',
-      default='tegra2_seaboard')
-  parser.add_option('-C', '--coreboot', dest='coreboot', type='string',
-      action='store', help='Executable lowlevel init file (coreboot)')
-  parser.add_option('--coreboot-elf', type='string',
-      action='store', help='Elf file to use as Coreboot payload')
-  parser.add_option('--cbfs-files', dest='cbfs_files', type='string',
-      action='store',
-      help='Root directory of the files to be stored in RW and RO CBFS')
-  parser.add_option('--rocbfs-files', dest='rocbfs_files', type='string',
-      action='store',
-      help='Root directory of the files to be stored in RO CBFS')
-  parser.add_option('-e', '--ec', dest='ecrw', type='string',
-        action='store', help='EC binary file')
-  parser.add_option('--ecro', type='string',
-        action='store', help='EC read-only binary file')
-  parser.add_option('--force-efs', action='store_true',
-        help='Force early firmware selection')
-  parser.add_option('-F', '--flash', dest='flash_dest', type='string',
-      action='store', help='Create a flasher to flash the device (spi, mmc)')
-  parser.add_option('-k', '--key', dest='key', type='string', action='store',
-      help='Path to signing key directory (default to dev key)',
-      default='##/usr/share/vboot/devkeys')
-  parser.add_option('--kernel', dest='kernel', type='string',
-        action='store', help='Kernel file to ask U-Boot to boot')
-  parser.add_option('-I', '--includedir', dest='includedirs', type='string',
-      action='append', help='Include directory to search for files')
-  parser.add_option('-m', '--map', dest='show_map', action='store_true',\
-      help='Output a flash map summary')
-  parser.add_option('-M', '--method', type='string', default='tegra',
-      action='store', help='Set USB flash method (tegra/exynos)'
-      'output files')
-  parser.add_option('-o', '--output', dest='output', type='string',
-      action='store', help='Filename of final output image')
-  parser.add_option('-O', '--outdir', dest='outdir', type='string',
-      action='store', help='Path to directory to use for intermediate and '
-      'output files')
-  parser.add_option('-p', '--preserve', dest='preserve', action='store_true',\
-      help='Preserve temporary output directory even if option -O is not given')
-  parser.add_option('--pd', dest='pdrw', type='string',
-        action='store', help='PD binary file')
-  parser.add_option('-S', '--seabios', dest='seabios', type='string',
-        action='store', help='Legacy BIOS (SeaBIOS)')
-  parser.add_option('--servo', type='string', default='any',
-        action='store', help='Servo to use (none, any, or port number)')
-  parser.add_option('-u', '--uboot', dest='uboot', type='string',
-      action='store', help='Executable bootloader file (U-Boot)')
-  parser.add_option('-U', '--uboot-flasher', dest='uboot_flasher',
-      type='string', action='store', help='Executable bootloader file '
-      '(U-Boot) to use for flashing (defaults to the same as --uboot)')
-  parser.add_option('-v', '--verbosity', dest='verbosity', default=1,
-      type='int', help='Control verbosity: 0=silent, 1=progress, 3=full, '
-      '4=debug')
-  (options, args) = parser.parse_args(sys.argv)
-
-  if len(args) > 1:
-    parser.error("Unrecognized arguments '%s'" % ' '.join(args[1:]))
-
-  with cros_output.Output(options.verbosity) as output:
-    with Tools(output) as tools:
-      _DoBundle(options, output, tools)
-
-
-def _Test():
-  """Run any built-in tests."""
-  import doctest
-  assert doctest.testmod().failed == 0
-
-if __name__ == '__main__':
-  # If first argument is --test, run testing code.
-  if sys.argv[1:2] == ["--test"]:
-    _Test(*sys.argv[2:])
-  else:
-    main()
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
deleted file mode 100644
index 4eb0155..0000000
--- a/host/lib/bundle_firmware.py
+++ /dev/null
@@ -1,216 +0,0 @@
-# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This module builds a firmware image.
-
-This modules uses a few rudimentary other libraries for its activity.
-
-Here are the names we give to the various files we deal with. It is important
-to keep these consistent!
-
-  uboot     u-boot.bin (with no device tree)
-  fdt       the fdt blob
-  bct       the BCT file
-  signed    (uboot + fdt + bct) signed blob
-"""
-
-import glob
-import os
-import re
-
-import shutil
-import struct
-from tools import CmdError
-
-class Bundle:
-  """This class encapsulates the entire bundle firmware logic.
-
-  Sequence of events:
-    bundle = Bundle(tools.Tools(), cros_output.Output(), ...)
-    bundle.Start(...)
-  """
-
-  def __init__(self, tools, output, keydir,
-               board, uboot=None, coreboot=None,
-               coreboot_elf=None, seabios=None,
-               ecrw=None, ecro=None, pdrw=None,
-               kernel=None, cbfs_files=None,
-               rocbfs_files=None):
-    """Set up a new Bundle object.
-
-    Args:
-      tools: A tools.Tools object to use for external tools.
-      output: A cros_output.Output object to use for program output.
-    """
-    self._tools = tools
-    self._out = output
-
-    self._keydir = keydir
-
-    self._board = board
-    self.uboot_fname = uboot
-    self.coreboot_fname = coreboot
-    self.coreboot_elf = coreboot_elf
-    self.seabios_fname = seabios
-    self.ecrw_fname = ecrw
-    self.ecro_fname = ecro
-    self.pdrw_fname = pdrw
-    self.kernel_fname = kernel
-    self.cbfs_files = cbfs_files
-    self.rocbfs_files = rocbfs_files
-    self.cb_copy = None
-
-  def _AddCbfsFiles(self, cbfs_files, regions='COREBOOT'):
-    for dir, subs, files in os.walk(cbfs_files):
-      for file in files:
-        file = os.path.join(dir, file)
-        cbfs_name = file.replace(cbfs_files, '', 1).strip('/')
-        self._tools.Run('cbfstool', [self.cb_copy, 'add', '-f', file,
-                                '-n', cbfs_name, '-t', 'raw', '-c', 'lzma',
-                                '-r', regions])
-
-  def _PrepareCbfs(self, fmap_dst):
-    """Prepare CBFS in given FMAP section.
-
-    Add some of our additional RW files: payload and EC firmware.
-
-    If --coreboot-elf parameter was specified during cros_bumdle_firmware
-    invocation, add the parameter of this option as the payload to the new
-    CBFS instance.
-
-    Args:
-      fmap_dst: a string, fmap region to work with.
-    Raises:
-      CmdError if cbfs-files node has incorrect parameters.
-    """
-
-    # Add coreboot payload if so requested. Note that the some images use
-    # different payload for the rw sections, which is passed in as the value
-    # of the --uboot option in the command line.
-    if self.uboot_fname:
-      payload_fname = self.uboot_fname
-    elif self.coreboot_elf:
-      payload_fname = self.coreboot_elf
-    else:
-      payload_fname = None
-
-    if payload_fname:
-      self._tools.Run('cbfstool', [
-        self.cb_copy, 'add-payload', '-f', payload_fname,
-        '-n', 'fallback/payload', '-c', 'lzma' , '-r', fmap_dst])
-
-    if self.ecrw_fname:
-      self._tools.Run('cbfstool', [
-        self.cb_copy, 'add', '-f', self.ecrw_fname, '-t', 'raw',
-        '-n', 'ecrw', '-A', 'sha256', '-r', fmap_dst ])
-
-    if self.pdrw_fname:
-      self._tools.Run('cbfstool', [
-        self.cb_copy, 'add', '-f', self.pdrw_fname, '-t', 'raw',
-        '-n', 'pdrw', '-A', 'sha256', '-r', fmap_dst ])
-
-  def _BuildKeyblocks(self, slot):
-    """Compute vblocks and write them into their FMAP regions.
-       Works for the (VBLOCK_?,FW_MAIN_?) pairs
-
-    Args:
-      slot: 'A' or 'B'
-    """
-    region_in = 'FW_MAIN_' + slot
-    region_out = 'VBLOCK_' + slot
-
-    input_data = os.path.join(self._tools.outdir, 'input.%s' % region_in)
-    output_data = os.path.join(self._tools.outdir, 'vblock.%s' % region_out)
-    self._tools.Run('cbfstool', [
-      self.cb_copy, 'read', '-r', region_in, '-f', input_data])
-
-    # 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',
-        [ self.cb_copy, 'print', '-k', '-r', region_in ])
-    # Fields are tab separated in the following order.
-    # Name    Offset  Type    Metadata Size   Data Size     Total Size
-    last_entry = stdout.strip().splitlines()[-1].split('\t')
-    if last_entry[0] == '(empty)' and last_entry[2] == 'null':
-        size = int(last_entry[1], 16)
-        trunc_data = self._tools.ReadFile(input_data)
-        trunc_data = trunc_data[:size]
-        self._tools.WriteFile(input_data, trunc_data)
-        self._tools.Run('cbfstool', [
-          self.cb_copy, 'write',
-          '--force', '-u', '-i', '0',
-          '-r', region_in, '-f', input_data])
-        self._out.Info('truncated FW_MAIN_%s to %d bytes' %
-            (slot, size))
-
-    try:
-      prefix = self._keydir + '/'
-
-      self._tools.Run('vbutil_firmware', [
-          '--vblock', output_data,
-          '--keyblock', prefix + 'firmware.keyblock',
-          '--signprivate', prefix + 'firmware_data_key.vbprivk',
-          '--version', '1',
-          '--fv', input_data,
-          '--kernelkey', prefix + 'kernel_subkey.vbpubk',
-          '--flags', '0',
-        ])
-
-    except CmdError as err:
-      raise PackError('Cannot make key block: vbutil_firmware failed\n%s' %
-                      err)
-    self._tools.Run('cbfstool', [self.cb_copy, 'write',
-                    '-f', output_data, '-u', '-i', '0',
-                    '-r', 'VBLOCK_'+slot])
-
-  def Start(self, output_fname, show_map):
-    """This creates a firmware bundle according to settings provided.
-
-      - Checks options, tools, output directory.
-      - Creates GBB and image.
-
-    Args:
-      output_fname: Output filename for the image. If this is not None, then
-          the final image will be copied here.
-      show_map: Show a flash map, with each area's name and position
-
-    Returns:
-      Filename of the resulting image (not the output_fname copy).
-    """
-    self.cb_copy = output_fname
-
-    # Create a coreboot copy to use as a scratch pad.
-    shutil.copyfile(self._tools.Filename(self.coreboot_fname), self.cb_copy)
-
-    # Add files to to RO and RW CBFS if provided.
-    if self.cbfs_files:
-      self._AddCbfsFiles(self.cbfs_files,
-          'COREBOOT,FW_MAIN_A,FW_MAIN_B')
-
-    # Add files to to RO CBFS if provided.
-    if self.rocbfs_files:
-      self._AddCbfsFiles(self.rocbfs_files)
-
-    # Add payload to RO
-    self._tools.Run('cbfstool', [self.cb_copy, 'add-payload', '-f',
-        self.coreboot_elf, '-n', 'fallback/payload', '-c', 'lzma'])
-
-    # Fill in legacy region
-    if self.seabios_fname:
-        self._tools.Run('cbfstool', [self.cb_copy, 'write',
-                        '-f', self.seabios_fname,
-                        '--force',
-                        '-r', 'RW_LEGACY'])
-
-    # Prepare RW sections: add payload and ecrw/pdrw as configured
-    self._PrepareCbfs('FW_MAIN_A')
-    self._PrepareCbfs('FW_MAIN_B')
-
-    # Now that RW CBFSes are final, create the vblocks
-    self._BuildKeyblocks('A')
-    self._BuildKeyblocks('B')
-
-    if show_map:
-      self._tools.Run('cbfstool', [self.cb_copy, 'layout', '-w'])
-    self._out.Notice("Output image '%s'" % output_fname)
diff --git a/host/lib/exynos.py b/host/lib/exynos.py
deleted file mode 100644
index 68bf409..0000000
--- a/host/lib/exynos.py
+++ /dev/null
@@ -1,616 +0,0 @@
-# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This module supports creating Exynos bootprom images."""
-
-import hashlib
-import os
-import struct
-
-from tools import CmdError
-
-HASH_ALGO_LEN = 32
-HASH_LEN = 32
-HASH_SIGNATURE = 0xdead4eef
-HASH_VERSION = 1
-HASH_FLAGS = 0
-HASH_HEADER_LEN = 16
-
-
-class ExynosBl2(object):
-  """Class for processing Exynos SPL blob.
-
-  Second phase loader (SPL) is also called boot loader 2 (BL2), these terms
-  mean the same and are used in this class interchangeably.
-
-  SPL is a binary blob which is in fact a short program running from internal
-  SRAM. It initializes main DRAM and loads the actual boot loader after that.
-  The program is encapsulated using one of two methods - fixed or variable
-  size. Both methods provide rudimentary checksum protection.
-
-  SPL is supposed to know some details about the hardware it runs on. This
-  information is stored in the so called machine parameters structure in the
-  blob. Some of it is available at compile time, but most of it comes form the
-  platform specific flat device tree. SPL generated by u-boot make file
-  includes machine parameter structure with default configuration values, not
-  suitable to run on actual hardware.
-
-  This class provides the following services:
-
-  - check integrity of the passed in SPL blob, and determining its
-    the encapsulation method along the way.
-
-  - parse the passed in device tree and pack the retrieved information into
-    the machine parameters structure. The structure location in the blob is
-    identified by a 4 byte structure header signature.
-
-    Note that this method of finding the structure in the blob is quite
-    brittle: it would silently produce catastrophically wrong result if for
-    some reason, this same pattern is present anywhere in the blob above the
-    structure.
-
-  - update the checksum as appropriate for the detected format, and save the
-    modified SPL in a file.
-
-  Attributes:
-    _tools: A tools.Tools object to use for external tools, provided by the
-            caller
-    _out: A cros_output.Output object to use for console output, provided by
-            the caller
-    _spl_type: an enum defined below, describing type (fixed of variable size)
-            of the SPL being handled
-    _spl_data: a binary blob representing the SPL data being handled. It comes
-            as the value read from the u-boot makefile generated image and
-            goes as an enhanced image including the updated machine parameters
-            structure and possibly concatenated with the hash and revision
-            table.
-  """
-
-  VAR_SPL = 1
-  FIXED_SPL = 2
-
-  def __init__(self, tools, output):
-    """Set up a new object."""
-    self._tools = tools
-    self._out = output
-    self._spl_type = None
-    self.spl_source = 'straps'  # SPL boot according to board settings
-    self._spl_data = None  # SPL blob to configure
-
-  def _BootingUsingEFS(self, fdt, use_efs_memory):
-    """Check if we are booting using early-firmware-selection.
-
-    This is just a helper function to avoid using the same logic in many
-    places.
-
-    Args:
-      fdt: Device tree file to use.
-      use_efs_memory: True to use early-firmware-selection memory (i.e. IRAM),
-          False, to ignore it.
-
-    Returns:
-      True if EFS is enabled and we are configured to use EFS memory, else
-          False.
-    """
-    return (use_efs_memory and
-            fdt.GetInt('/chromeos-config', 'early-firmware-selection', 0))
-
-  def _GetAddress(self, fdt, use_efs_memory, name, config_node='/config',
-                  allow_none=False):
-    """Work out the correct address for a region of memory.
-
-    This deals with EFS and the memory map automatically.
-
-    Args:
-      fdt: Device tree file containing memory map.
-      use_efs_memory: True to return the address in EFS memory (i.e. SRAM),
-          False to use SDRAM
-      name: Name of the region to look up, e.g. 'u-boot'
-      config_node: Node containing configuration information
-      allow_none: True if it is OK to find nothing.
-
-    Returns:
-      Address to load that region, or None if none.
-    """
-    efs_suffix = ''
-    if self._BootingUsingEFS(fdt, use_efs_memory):
-      efs_suffix = ',efs'
-
-    # Use the correct memory section, and then find the offset in that.
-    default = 'none' if allow_none else None
-    memory = fdt.GetString(config_node, '%s-memory%s' % (name, efs_suffix),
-                           default)
-    if memory == 'none':
-      return None
-    base = fdt.GetIntList(memory, 'reg')[0]
-    offset = fdt.GetIntList(config_node, '%s-offset%s' % (name, efs_suffix))[0]
-    addr = base + offset
-    return addr
-
-  def GetUBootAddress(self, fdt, use_efs_memory):
-    """Work out the correct address for loading U-Boot.
-
-    This deals with EFS and the memory map automatically.
-
-    Args:
-      fdt: Device tree file containing memory map.
-      use_efs_memory: True to return the address in EFS memory (i.e. SRAM),
-          False to use SDRAM
-
-    Returns:
-      Address to load U-Boot
-    """
-    addr = self._GetAddress(fdt, use_efs_memory, 'u-boot')
-    self._out.Notice('EFS: Loading U-Boot to %x' % addr)
-    return addr
-
-  def _GetRWSPLDetails(self, fdt, use_efs_memory):
-    if not self._BootingUsingEFS(fdt, use_efs_memory):
-      return 0, 0, 0
-
-    memory = fdt.GetString('/chromeos-config', 'rw-spl-memory,efs')
-    base = fdt.GetIntList(memory, 'reg')[0]
-    offset, size = fdt.GetIntList('/chromeos-config', 'rw-spl-offset,efs')
-    addr = base + offset
-    return 1, addr, size
-
-  def _MpRevMap(self, _unused1, offset, fdt, pos):
-    """Add the revision map to the SPL blob.
-
-    Read the revison map table from the device tree, and place it in the SPL
-    blob.  If we detect that there wasn't already space allocated for the
-    revision map we'll append it to the end of the SPL blob.  If there was
-    already space for the revision map we'll overwrite the existing one.
-
-    The revision map could be anywhere in the SPL.  We store an offset from the
-    beginning of the machine params structure as the value in machine params
-    to allow us to find the map.  If the offset is 0 it means that there is no
-    revision map space allocated.
-
-    Args:
-      _unused1 - a single character string, machine parameter name
-      offset - If there's alreasy space for the revision map, this will be non-
-               zero and we can find it in the SPL data at "pos + offset".
-      fdt - the Fdt object representing the target device tree
-      pos - an int, offset of the machine parameter structure into data
-
-    Returns:
-      offset - The new location of the revision map.
-    """
-
-    rev_map = 'google,board-rev-map'
-    try:
-      rev_table =  fdt.GetIntList('/board-rev', rev_map)
-    except CmdError:
-      self._out.Info('No value for %s' % rev_map)
-      return 0
-
-    extra = struct.pack('%dB' % len(rev_table), *rev_table)
-
-    if offset:
-      self._spl_data = (self._spl_data[:pos + offset] +
-                        extra +
-                        self._spl_data[pos + offset + len(extra):])
-    else:
-      # offset of the revision table from machine param table
-      offset = len(self._spl_data) - pos
-      self._spl_data += extra
-    return offset
-
-  def _UpdateParameters(self, fdt, spl_load_offset, spl_load_size, pos,
-                        use_efs_memory, skip_sdram_init):
-    """Update the parameters in a BL2 blob.
-
-    We look at the list in the parameter block, extract the value of each
-    from the device tree, and write that value to the parameter block.
-
-    Args:
-      fdt: Device tree containing the parameter values.
-      spl_load_offset: Offset in boot media that SPL must start loading (bytes)
-      spl_load_size: Size of U-Boot image that SPL must load
-      pos: The position of the start of the parameter block.
-      use_efs_memory: True to return the address in EFS memory (i.e. SRAM),
-          False to use SDRAM
-      skip_sdram_init: True to skip SDRAM initialization.
-    """
-    version, size = struct.unpack('<2L', self._spl_data[pos + 4:pos + 12])
-    if version != 1:
-      raise CmdError("Cannot update machine parameter block version '%d'" %
-                     version)
-    if size < 0 or pos + size > len(self._spl_data):
-      raise CmdError('Machine parameter block size %d is invalid: '
-                     'pos=%d, size=%d, space=%d, len=%d' %
-                     (size, pos, size, len(self._spl_data)
-                      - pos, len(self._spl_data)))
-
-    #
-    # A dictionary of functions processing machine parameters. This is being
-    # introduced after more than 20 parameters have been already defined and
-    # are handled by the ugly if/elif/... construct below. It will be
-    # refactored eventually (one should hope), no new parameters' processing
-    # should be added there.
-    #
-    # The key of the dictionary is the parameter name, the value is a list.
-    # the first element of the list is the function to call to process the
-    # parameter, the rest of the elements are parameters to pass to the
-    # function.
-    #
-    # The first three parameters passed to the function are always prepended
-    # to those obtained from the list and are as follows:
-    #
-    # - the machine parameter name (one character string)
-    # - value read from the appropriate spot of the machine param structure,
-    #   as generated by the u-boot makefile, a - 32 bit int
-    # - fdt object representing the target FDT
-    #
-    # The function is expected to return a 32 bit value to plug into the
-    # machine parameters structure.
-    #
-    mp_router = {
-      't': [self._MpRevMap, pos]
-      }
-
-    # Move past the header and read the parameter list, which is terminated
-    # with \0.
-    pos += 12
-    param_list = struct.unpack('<%ds' % (len(self._spl_data) - pos),
-                               self._spl_data[pos:])[0]
-    param_len = param_list.find('\0')
-    param_list = param_list[:param_len]
-    pos += (param_len + 4) & ~3
-
-    # Use this to detect a missing value from the fdt.
-    not_given = 'not-given-invalid-value'
-
-    # Work through the parameters one at a time, adding each value
-    new_data = ''
-    upto = 0
-    for param in param_list:
-      value = struct.unpack('<1L', self._spl_data[pos + upto:pos + upto + 4])[0]
-
-      if param in mp_router:
-        value = mp_router[param][0](param, value, fdt, *mp_router[param][1:])
-      elif param == 'm':
-        mem_type = fdt.GetString('/dmc', 'mem-type', not_given)
-        if mem_type == not_given:
-          mem_type = 'ddr3'
-          self._out.Warning("No value for memory type: using '%s'" % mem_type)
-        mem_types = ['ddr2', 'ddr3', 'lpddr2', 'lpddr3']
-        if mem_type not in mem_types:
-          raise CmdError("Unknown memory type '%s'" % mem_type)
-        value = mem_types.index(mem_type)
-        self._out.Info('  Memory type: %s (%d)' % (mem_type, value))
-      elif param == 'M':
-        mem_manuf = fdt.GetString('/dmc', 'mem-manuf', not_given)
-        if mem_manuf == not_given:
-          mem_manuf = 'samsung'
-          self._out.Warning("No value for memory manufacturer: using '%s'" %
-                            mem_manuf)
-        mem_manufs = ['autodetect', 'elpida', 'samsung']
-        if mem_manuf not in mem_manufs:
-          raise CmdError("Unknown memory manufacturer: '%s'" % mem_manuf)
-        value = mem_manufs.index(mem_manuf)
-        self._out.Info('  Memory manufacturer: %s (%d)' % (mem_manuf, value))
-      elif param == 'f':
-        mem_freq = fdt.GetInt('/dmc', 'clock-frequency', -1)
-        if mem_freq == -1:
-          mem_freq = 800000000
-          self._out.Warning("No value for memory frequency: using '%s'" %
-                            mem_freq)
-        mem_freq /= 1000000
-        if mem_freq not in [533, 667, 800]:
-          self._out.Warning("Unexpected memory speed '%s'" % mem_freq)
-        value = mem_freq
-        self._out.Info('  Memory speed: %d' % mem_freq)
-      elif param == 'a':
-        arm_freq = fdt.GetInt('/dmc', 'arm-frequency', -1)
-        if arm_freq == -1:
-          arm_freq = 1700000000
-          self._out.Warning("No value for ARM frequency: using '%s'" %
-                            arm_freq)
-        arm_freq /= 1000000
-        value = arm_freq
-        self._out.Info('  ARM speed: %d' % arm_freq)
-      elif param == 'i':
-        i2c_addr = -1
-        lookup = fdt.GetString('/aliases', 'pmic', '')
-        if lookup:
-          i2c_addr, size = fdt.GetIntList(lookup, 'reg', 2)
-        if i2c_addr == -1:
-          self._out.Warning('No value for PMIC I2C address: using %#08x' %
-                            value)
-        else:
-          value = i2c_addr
-        self._out.Info('  PMIC I2C Address: %#08x' % value)
-      elif param == 's':
-        serial_addr = -1
-        lookup = fdt.GetString('/aliases', 'console', '')
-        if lookup:
-          serial_addr, size = fdt.GetIntList(lookup, 'reg', 2)
-        if serial_addr == -1:
-          self._out.Warning('No value for Console address: using %#08x' %
-                            value)
-        else:
-          value = serial_addr
-        self._out.Info('  Console Address: %#08x' % value)
-      elif param == 'v':
-        value = 31
-        self._out.Info('  Memory interleave: %#0x' % value)
-      elif param == 'u':
-        value = spl_load_size
-        self._out.Info('  U-Boot size: %#0x' % value)
-      elif param == 'S':
-        value = self.GetUBootAddress(fdt, use_efs_memory)
-        self._out.Info('  U-Boot start: %#0x' % value)
-      elif param == 'o':
-        value = spl_load_offset
-        self._out.Info('  U-Boot offset: %#0x' % value)
-      elif param == 'l':
-        load_addr = fdt.GetInt('/config', 'u-boot-load-addr', -1)
-        if load_addr == -1:
-          self._out.Warning("No value for U-Boot load address: using '%08x'" %
-                            value)
-        else:
-          value = load_addr
-        self._out.Info('  U-Boot load address: %#0x' % value)
-      elif param == 'b':
-        # These values come from enum boot_mode in U-Boot's cpu.h
-        # For EFS we select SPI as the boot source always. We could support
-        # eMMC if we want to add EFS support for eMMC.
-        if (self.spl_source == 'spi' or
-            self._BootingUsingEFS(fdt, use_efs_memory)):
-          value = 20
-        elif self.spl_source == 'straps':
-          value = 32
-        elif self.spl_source == 'emmc':
-          value = 4
-        elif self.spl_source == 'usb':
-          value = 33
-        else:
-          raise CmdError("Invalid boot source '%s'" % self.spl_source)
-        self._out.Info('  Boot source: %#0x' % value)
-      elif param in ['r', 'R']:
-        records = fdt.GetIntList('/board-rev', 'google,board-rev-gpios',
-                                 None, '0 0')
-        gpios = []
-        for i in range(1, len(records), 3):
-          gpios.append(records[i])
-        gpios.extend([0, 0, 0, 0])
-        if param == 'r':
-          value = gpios[0] + (gpios[1] << 16)
-          self._out.Info('  Board ID GPIOs: tit0=%d, tit1=%d' % (gpios[0],
-                                                                 gpios[1]))
-        else:
-          value = gpios[2] + (gpios[3] << 16)
-          self._out.Info('  Board ID GPIOs: tit2=%d, tit3=%d' % (gpios[2],
-                                                                 gpios[3]))
-      elif param == 'w':
-        records = fdt.GetIntList('/config', 'google,bad-wake-gpios',
-                                 3, '0 0xffffffff 0')
-        value = records[1]
-        self._out.Info('  Bad Wake GPIO: %#x' % value)
-      elif param == 'z':
-        compress = fdt.GetString('/flash/ro-boot', 'compress', 'none')
-        compress_types = ['none', 'lzo']
-        if compress not in compress_types:
-          raise CmdError("Unknown compression type '%s'" % compress)
-        value = compress_types.index(compress)
-        self._out.Info('  Compression type: %#0x' % value)
-      elif param == 'c':
-        rtc_type = 0
-        try:
-          rtc_alias = fdt.GetString('/aliases/', 'rtc')
-          rtc_compat = fdt.GetString(rtc_alias, 'compatible')
-          if rtc_compat == 'samsung,s5m8767-pmic':
-            rtc_type = 1
-          elif rtc_compat == 'maxim,max77802-pmic':
-            rtc_type = 2
-        except CmdError:
-          self._out.Warning('Failed to find rtc')
-        value = rtc_type
-      elif param == 'W':
-        try:
-          records = fdt.GetIntList('/chromeos-config/vboot-flag-write-protect',
-                                   'gpio', 3)
-          value = records[1]
-          self._out.Info('  Write Protect GPIO: %#x' % value)
-        except CmdError:
-          self._out.Warning('No value for write protect GPIO: using %#x' %
-                            value)
-      elif param in ['j', 'A', 'U']:
-        jump, addr, size = self._GetRWSPLDetails(fdt, use_efs_memory)
-        if param == 'j':
-          value = jump
-          self._out.Info('  Jump to RW SPL: %d' % value)
-        elif param == 'A':
-          value = addr
-          self._out.Info('  RW SPL addr: %#x' % value)
-        elif param == 'U':
-          value = size
-          self._out.Info('  RW SPL size: %#x' % value)
-      elif param == 'd':
-        value = 1 if skip_sdram_init else 0
-        self._out.Info('  Skip SDRAM init: %d' % value)
-      elif param == 'p':
-        addr = self._GetAddress(fdt, use_efs_memory, 'vboot-persist',
-                                '/chromeos-config', True)
-        if addr is None:
-          value = 0
-        else:
-          value = addr
-        self._out.Info('  Vboot persist addr: %x' % value)
-      elif param == 'D':
-        value = fdt.GetBool('/config', 'spl-debug')
-        self._out.Info('  SPL debug: %d' % value)
-      else:
-        self._out.Warning("Unknown machine parameter type '%s'" % param)
-        self._out.Info('  Unknown value: %#0x' % value)
-      new_data += struct.pack('<L', value)
-      upto += 4
-
-    # Put the data into our block.
-    self._spl_data = self._spl_data[:pos] + new_data + self._spl_data[
-      pos + len(new_data):]
-
-  def _UpdateChecksum(self):
-    """Update the BL2 size and checksum.
-
-    For the fixed size spl the checksum is a 4 byte sum of all the bytes in
-    the image before the last 4 bytes (which hold the checksum).
-
-    For the variable size SPL the first four bytes of the blob is the size of
-    the blob and the second four bytes is the sum of bytes in the rest of the
-    blob.
-
-    Raises:
-      CmdError if spl type is not set properly.
-    """
-
-    if self._spl_type == self.FIXED_SPL:
-      checksum = sum(ord(x) for x in self._spl_data[:-4])
-      checksum_offset = len(self._spl_data) - 4
-    elif self._spl_type == self.VAR_SPL:
-      # Data size could have changed (the rev table could have been added).
-      if len(self._spl_data) % 4:
-        # Bl1 expects data size to be divisible by 4
-        self._spl_data += '\0' * (4 - len(self._spl_data) % 4)
-      self._spl_data = struct.pack('<L',
-                                   len(self._spl_data)) + self._spl_data[4:]
-      checksum = sum(ord(x) for x in self._spl_data[8:])
-      checksum_offset = 4
-    else:
-      raise CmdError('SPL type not set')
-
-    self._spl_data = self._spl_data[:checksum_offset] + struct.pack(
-      '<L', checksum) + self._spl_data[checksum_offset+4:]
-
-  def _UpdateHash(self, digest):
-    """Update the BL2 hash.
-
-    The BL2 header may have a pointer to the hash block, but if not, then we
-    add it (at the end of SPL).
-
-    Args:
-      digest: The hash digest to write.
-
-    Raises:
-      CmdError if spl type is not variable size. We don't support this
-          function with fixed-sized SPL.
-    """
-    if self._spl_type != self.VAR_SPL:
-      raise CmdError('Hash is only supported for variable-size SPL')
-
-    # See if there is already a hash there.
-    hash_offset = struct.unpack('<L', self._spl_data[8:12])[0]
-    if not hash_offset:
-      hash_offset = len(self._spl_data)
-    algo = 'sha256'.ljust(HASH_ALGO_LEN, '\x00')
-    hash_block = algo + digest
-    hash_block_len = len(hash_block) + HASH_HEADER_LEN
-    hash_hdr = struct.pack('<4L', HASH_SIGNATURE, HASH_VERSION, hash_block_len,
-                           HASH_FLAGS)
-    self._spl_data = (self._spl_data[:hash_offset] + hash_hdr + hash_block +
-                      self._spl_data[hash_offset + hash_block_len:])
-
-    # Update the size and hash_offset.
-    self._spl_data = struct.pack('<LLL', len(self._spl_data), 0, hash_offset
-                                 ) + self._spl_data[12:]
-    self._out.Info('  Added hash: %s' % ''.
-                   join(['%02x' % ord(d) for d in digest]))
-
-  def _VerifyBl2(self, loose_check):
-    """Verify BL2 integrity.
-
-    Fixed size and variable size SPL have different formats. Determine format,
-    verify SPL integrity and save its type (fixed or variable size) for future
-    reference.
-
-    Args:
-      loose_check: a Boolean, if true - the variable size SPL blob could be
-                   larger than the size value in the header
-    Raises:
-      CmdError if SPL blob is of unrecognizable format.
-    """
-
-    data = self._spl_data  # Cache it to improve readability.
-    # Variable size format is more sophisticated, check it first.
-    try:
-      size = struct.unpack('<I', data[:4])[0]
-      if size == len(data) or (loose_check and (size < len(data))):
-        check_sum = sum(ord(x) for x in data[8:size])
-        # Compare with header checksum
-        if check_sum == struct.unpack('<I', data[4:8])[0]:
-          # this is a variable size SPL
-          self._out.Progress('Variable size BL2 detected')
-          self._spl_type = self.VAR_SPL
-          return
-
-      # This is not var size spl, let's see if it's the fixed size one.
-      # Checksum is placed at a fixed location in the blob, as defined in
-      # tools/mkexynosspl.c in the u--boot tree. There are two possibilities
-      # for blob sizes - 14K or 30K. The checksum is put in the last 4 bytes
-      # of the blob.
-      #
-      # To complicate things further the blob here could have come not from
-      # mkexynosspl directly, it could have been pulled out of a previously
-      # bundled image. I that case it the blob will be in a chunk aligned to
-      # the closest 16K boundary.
-      blob_size = ((len(data) + 0x3fff) & ~0x3fff) - 2 * 1024
-      if blob_size == len(data) or (loose_check and (blob_size < len(data))):
-        check_sum = sum(ord(x) for x in data[:blob_size - 4])
-        if check_sum == struct.unpack('<I', data[blob_size - 4:blob_size])[0]:
-          self._spl_type = self.FIXED_SPL
-          self._out.Progress('Fixed size BL2 detected')
-          return
-    except IndexError:
-      # This will be thrown if bl2 is too small
-      pass
-    raise CmdError('Unrecognizable bl2 format')
-
-  def Configure(self, fdt, spl_load_offset, spl_load_size, orig_bl2, name='',
-                loose_check=False, digest=None, use_efs_memory=True,
-                skip_sdram_init=False):
-    """Configure an Exynos BL2 binary for our needs.
-
-    We create a new modified BL2 and return its file name.
-
-    Args:
-      fdt: Device tree containing the parameter values.
-      spl_load_offset: Offset in boot media that SPL must start loading (bytes)
-      spl_load_size: Size of U-Boot image that SPL must load
-      orig_bl2: Filename of original BL2 file to modify.
-      name: a string, suffix to add to the generated file name
-      loose_check: if True - allow var size SPL blob to be larger, then the
-                   size value in the header. This is necessary for cases when
-                   SPL is pulled out of an image (and is padded).
-      digest: If not None, hash digest to add to this BL2 (a string of bytes).
-      use_efs_memory: True to return the address in EFS memory (i.e. SRAM),
-          False to use SDRAM
-      skip_sdram_init: True to skip SDRAM initialization.
-
-    Returns:
-      Filename of configured bl2.
-
-    Raises:
-      CmdError if machine parameter block could not be found.
-    """
-    bl2 = os.path.join(self._tools.outdir, 'updated-spl%s.bin' % name)
-    self._out.Info('Configuring BL2 %s' % bl2)
-    self._spl_data = self._tools.ReadFile(orig_bl2)
-    self._VerifyBl2(loose_check)
-
-    # Locate the parameter block
-    marker = struct.pack('<L', 0xdeadbeef)
-    pos = self._spl_data.rfind(marker)
-    if not pos:
-      raise CmdError("Could not find machine parameter block in '%s'" %
-                     orig_bl2)
-    self._UpdateParameters(fdt, spl_load_offset, spl_load_size,
-                           pos, use_efs_memory, skip_sdram_init)
-    if digest:
-      self._UpdateHash(digest)
-    self._UpdateChecksum()
-
-    self._tools.WriteFile(bl2, self._spl_data)
-    return bl2
diff --git a/host/lib/fdt.py b/host/lib/fdt.py
deleted file mode 100644
index ea02eee..0000000
--- a/host/lib/fdt.py
+++ /dev/null
@@ -1,734 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This library provides basic access to an fdt blob."""
-
-import binascii
-import doctest
-import optparse
-import os
-import re
-import shutil
-import struct
-import sys
-
-import cros_output
-from tools import Tools
-
-_base = os.path.dirname(sys.argv[0])
-
-
-class Fdt:
-  """Provides simple access to a flat device tree blob.
-
-  Properties:
-    fname: Filename of fdt
-  """
-
-  def __init__(self, tools, fname):
-    self.fname = fname
-    self.tools = tools
-    _, ext = os.path.splitext(fname)
-    self._is_compiled = ext == '.dtb'
-
-  def ExtractFromImage(self, fname):
-    """Extract an FDT from a Chrome OS firmware image (FDTMAP).
-
-    Args:
-      fname: Filename of image
-
-    Raises:
-      ValueError if no fdtmap is found in the image, or its crc32 is incorrect.
-    """
-    data = self.tools.ReadFile(fname)
-    pos = data.find('__FDTM__')
-    if pos == -1:
-      raise ValueError("No fdtmap found in image '%s'" % fname)
-    size, crc32 = struct.unpack('<LL', data[pos + 8:pos + 16])
-    fdt_data = data[pos + 16:pos + 16 + size]
-    check_crc32 = binascii.crc32(fdt_data) & 0xffffffff
-    if check_crc32 != crc32:
-      raise ValueError('Invalid CRC for FDTMAP')
-    self.tools.WriteFile(self.fname, fdt_data)
-
-  def GetProp(self, node, prop, default=None, typespec=None):
-    """Get a property from a device tree.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetProp('/lcd', 'width')
-    '1366'
-
-    >>> fdt.GetProp('/', 'fluffy')
-    Traceback (most recent call last):
-      ...
-    CmdError: Command failed: fdtget ../tests/test.dtb / fluffy
-    Error at 'fluffy': FDT_ERR_NOTFOUND
-    <BLANKLINE>
-
-    This looks up the given node and property, and returns the value as a
-    string,
-
-    If the node or property does not exist, this will return the default value.
-
-    Args:
-      node: Full path to node to look up.
-      prop: Property name to look up.
-      default: Default value to return if nothing is present in the fdt, or
-          None to raise in this case. This will be converted to a string.
-      typespec: Type character to use (None for default, 's' for string)
-
-    Returns:
-      string containing the property value.
-
-    Raises:
-      CmdError: if the property does not exist and no default is provided.
-    """
-    args = [self.fname, node, prop]
-    if default is not None:
-      args += ['-d', str(default)]
-    if typespec is not None:
-      args += ['-t%s' % typespec]
-    out = self.tools.Run('fdtget', args)
-    return out.strip()
-
-  def GetBool(self, node, prop):
-    """Get a boolean property from a device tree.
-
-    If the property is present then it is considered True, else False.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetBool('/flash/ro-gbb', 'hash-target')
-    False
-    >>> fdt.GetBool('/flash/ro-onestop', 'hash-target')
-    True
-
-    Args:
-      node: Full path to node to look up.
-      prop: Property name to look up.
-
-    Returns:
-      True if property is present, False if not.
-    """
-    value = self.GetProp(node, prop, '<none>')
-    return value != '<none>'
-
-  def PutBool(self, node, prop, bool_value):
-    """Write a boolean property to a device tree.
-
-    If the property is present then it is considered True, else False. At
-    present we can't actually support removing the property since fdtput
-    does not have this option.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetBool('/putbool-test', 'dead-silence')
-    False
-    >>> fdt.PutBool('/putbool-test', 'dead-silence', False)
-    >>> fdt.GetBool('/putbool-test', 'dead-silence')
-    False
-    >>> fdt.PutBool('/putbool-test', 'dead-silence', True)
-    >>> fdt.GetBool('/putbool-test', 'dead-silence')
-    True
-    >>> fdt.PutBool('/putbool-test', 'dead-silence', False)
-    Traceback (most recent call last):
-      ...
-    ValueError: ("Cannot set node '%s' property '%s' to False", \
-('/putbool-test', 'dead-silence'))
-    >>> fdt.GetBool('/putbool-test', 'dead-silence')
-    True
-
-    Args:
-      node: Full path to node to update.
-      prop: Property name to write.
-      bool_value: Boolean to write.
-
-    Raises:
-      ValueError: if the property is True and we try to set it to False.
-    """
-    if bool_value:
-      args = ['-p', self.fname, node, prop]
-      self.tools.Run('fdtput', args)
-    elif self.GetBool(node, prop):
-      raise ValueError("Cannot set node '%s' property '%s' to False",
-                       (node, prop))
-
-  def GetProps(self, node, convert_dashes=False):
-    """Get all properties from a node.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetProps('/')
-    {'compatible': 'nvidia,seaboard nvidia,tegra250', '#size-cells': '1', \
-'model': 'NVIDIA Seaboard', '#address-cells': '1', 'interrupt-parent': '1'}
-
-    Args:
-      node: node name to look in.
-      convert_dashes: True to convert - to _ in node names.
-
-    Returns:
-      A dictionary containing all the properties, indexed by node name.
-      The entries are simply strings - no decoding of lists or numbers is
-      done.
-
-    Raises:
-      CmdError: if the node does not exist.
-    """
-    out = self.tools.Run('fdtget', [self.fname, node, '-p'])
-    props = out.strip().splitlines()
-    props_dict = {}
-    for prop in props:
-      name = prop
-      if convert_dashes:
-        prop = re.sub('-', '_', prop)
-      props_dict[prop] = self.GetProp(node, name)
-    return props_dict
-
-  def DecodeIntList(self, node, prop, int_list_str, num_values=None):
-    """Decode a string into a list of integers.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.DecodeIntList('/', 'galveston', '1 2 3 4')
-    [1, 2, 3, 4]
-
-    >>> fdt.DecodeIntList('/', 'galveston', '1 2 3 4', 4)
-    [1, 2, 3, 4]
-
-    >>> fdt.DecodeIntList('/', 'galveston', '0xff', 1)
-    [255]
-
-    >>> fdt.DecodeIntList('/', 'galveston', '1 2 3 4', 3)
-    Traceback (most recent call last):
-      ...
-    ValueError: GetIntList of node '/' prop 'galveston' returns \
-'<type 'list'>', which has 4 elements, but 3 expected
-
-    This decodes a string containing a list of integers like '1 2 3' into
-    a list like [1 2 3].
-
-    Args:
-      node: Full path to node to report in any error raised.
-      prop: Property name to report in any error raised.
-      int_list_str: String to decode.
-      num_values: If not None, then the array is checked to make sure it
-          has this many values, and an error is raised if not.
-
-    Returns:
-      List of integers.
-
-    Raises:
-      ValueError: if the list is the wrong size.
-    """
-    int_list = int_list_str.split()
-    if num_values and num_values != len(int_list):
-      raise ValueError("GetIntList of node '%s' prop '%s' returns '%s'"
-                       ", which has %d elements, but %d expected" %
-                       (node, prop, list, len(int_list), num_values))
-    return [int(item, 0) for item in int_list]
-
-  def GetIntList(self, node, prop, num_values=None, default=None):
-    """Read a property and decode it into a list of integers.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetIntList('/flash@0/shared-dev-cfg@180000', 'reg')
-    [1572864, 262144]
-
-    >>> fdt.GetIntList('/flash/shared-dev-cfg', 'reg')
-    [1572864, 262144]
-
-    >>> fdt.GetIntList('/flash/shared-dev-cfg', 'reg', 3)
-    Traceback (most recent call last):
-      ...
-    ValueError: GetIntList of node '/flash/shared-dev-cfg' prop 'reg' returns \
-'<type 'list'>', which has 2 elements, but 3 expected
-
-    >>> fdt.GetIntList('/swaffham', 'bulbeck', 2)
-    Traceback (most recent call last):
-      ...
-    CmdError: Command failed: fdtget ../tests/test.dtb /swaffham bulbeck
-    Error at '/swaffham': FDT_ERR_NOTFOUND
-    <BLANKLINE>
-    >>> fdt.GetIntList('/lcd', 'bulbeck', 2, '5 6')
-    [5, 6]
-
-    This decodes a property containing a list of integers like '1 2 3' into
-    a list like [1 2 3].
-
-    Args:
-      node: Full path to node to look up.
-      prop: Property name to look up.
-      num_values: If not None, then the array is checked to make sure it
-          has this many values, and an error is raised if not.
-      default: Default value to return if nothing is present in the fdt, or
-          None to raise in this case. This will be converted to a string.
-
-    Returns:
-      List of integers.
-
-    Raises:
-      ValueError if the list is the wrong size.
-      CmdError: if the property does not exist.
-    """
-    return self.DecodeIntList(node, prop, self.GetProp(node, prop, default),
-                              num_values)
-
-  def GetInt(self, node, prop, default=None):
-    """Gets an integer from a device tree property.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetInt('/lcd', 'width')
-    1366
-    >>> fdt.GetInt('/lcd', 'rangiora')
-    Traceback (most recent call last):
-      ...
-    CmdError: Command failed: fdtget ../tests/test.dtb /lcd rangiora
-    Error at 'rangiora': FDT_ERR_NOTFOUND
-    <BLANKLINE>
-
-    >>> fdt.GetInt('/lcd', 'rangiora', 1366)
-    1366
-
-    Args:
-      node: Full path to node to look up.
-      prop: Property name to look up.
-      default: Default value to return if nothing is present in the fdt, or
-          None to raise in this case. This will be converted to a string.
-
-    Returns:
-      Value of property, as an integer.
-
-    Raises:
-      ValueError if the property cannot be converted to an integer.
-      CmdError: if the property does not exist.
-    """
-    value = self.GetIntList(node, prop, 1, default)[0]
-    return int(value)
-
-  def GetString(self, node, prop, default=None):
-    """Gets a string from a device tree property.
-
-    The 's' typespec is used to ask fdtget to convert the property to a
-    string even it is has embedded \0. This allows it to work with
-    compatible strings which contain a list.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetString('/display', 'compatible')
-    'nvidia,tegra250-display'
-    >>> fdt.GetString('/', 'compatible')
-    'nvidia,seaboard nvidia,tegra250'
-
-    Args:
-      node: Full path to node to look up.
-      prop: Property name to look up.
-      default: Default value to return if nothing is present in the fdt, or
-          None to raise in this case.
-
-    Returns:
-      Value of property, as a string.
-
-    Raises:
-      CmdError: if the property does not exist.
-    """
-    return self.GetProp(node, prop, default, typespec='s')
-
-  def GetFlashNode(self, section, part):
-    """Returns the node path to use for a particular flash section/path.
-
-    Args:
-      section: Section name to look at: ro, rw-a, etc.
-      part: Partition name to look at: gbb, vpd, etc.
-
-    Returns:
-      Full path to flash node
-    """
-    return '/flash/%s-%s' % (section, part)
-
-  def GetFlashPart(self, section, part):
-    """Returns the setup of the given section/part number in the flash map.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetFlashPart('ro', 'onestop')
-    [65536, 524288]
-
-    Args:
-      section: Section name to look at: ro, rw-a, etc.
-      part: Partition name to look at: gbb, vpd, etc.
-
-    Returns:
-      Tuple (position, size) of flash area in bytes.
-    """
-    return self.GetIntList(self.GetFlashNode(section, part), 'reg', 2)
-
-  def GetFlashPartSize(self, section, part):
-    """Returns the size of the given section/part number in the flash map.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetFlashPartSize('ro', 'onestop')
-    524288
-    >>> fdt.GetFlashPartSize('rw', 'b-onestop')
-    32768
-
-    Args:
-      section: Section name to look at: ro, rw-a, etc.
-      part: Partition name to look at: gbb, vpd, etc.
-
-    Returns:
-      Size of flash area in bytes.
-    """
-    size = self.GetInt(self.GetFlashNode(section, part), 'size', -1)
-    if size == -1:
-      size = self.GetFlashPart(section, part)[1]
-    return size
-
-  def GetFlashPartUsed(self, section, part):
-    """Returns the used part of the given section/part number in the flash map.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetFlashPartUsed('ro', 'onestop')
-    1234
-    >>> fdt.GetFlashPartUsed('rw-a', 'onestop')
-
-    Args:
-      section: Section name to look at: ro, rw-a, etc.
-      part: Partition name to look at: gbb, vpd, etc.
-
-    Returns:
-      Size of flash area in bytes.
-    """
-    size = self.GetInt(self.GetFlashNode(section, part), 'used', -1)
-    if size == -1:
-      return None
-    return size
-
-  def GetChildren(self, node):
-    """Returns a list of children of a given node.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetChildren('/amba')
-    ['interrupt-controller@50041000']
-
-    >>> fdt.GetChildren('/flash@0')
-    ['onestop-layout@0', 'firmware-image@0', 'verification-block@7df00', \
-'firmware-id@7ff00', 'readonly@0', 'bct@0', 'ro-onestop@10000', \
-'ro-gbb@90000', 'ro-data@b0000', 'ro-vpd@c0000', 'fmap@d0000', \
-'readwrite@100000', 'rw-vpd@100000', 'shared-dev-cfg@180000', \
-'shared-data@1c0000', 'shared-env@1ff000', 'readwrite-a@200000', \
-'rw-a-onestop@200000', 'readwrite-b@300000', 'rw-b-onestop@300000']
-
-    Args:
-      node: Node to return children from.
-
-    Returns:
-      List of children in the node.
-
-    Raises:
-      CmdError: if the node does not exist.
-    """
-    out = self.tools.Run('fdtget', [self.fname, '-l', node])
-    return out.strip().splitlines()
-
-  def GetLabel(self, node):
-    """Returns the label property of a given node.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetLabel('/flash/ro-onestop')
-    'ro-onestop'
-
-    >>> fdt.GetLabel('/go/hotspurs')
-    Traceback (most recent call last):
-      ...
-    CmdError: Command failed: fdtget ../tests/test.dtb /go/hotspurs label -ts
-    Error at '/go/hotspurs': FDT_ERR_NOTFOUND
-    <BLANKLINE>
-
-    Args:
-      node: Node to return label property from.
-
-    Returns:
-      The value of the label property from the node.
-
-    Raises:
-      CmdError: if the node or property does not exist.
-    """
-    return self.GetString(node, 'label')
-
-  def Copy(self, new_name):
-    """Make a copy of the FDT into another file, and return its object.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> our_copy = fdt.Copy(os.path.join(_base, '../tests/copy.dtb'))
-    >>> our_copy.PutString('/display', 'compatible', 'north')
-    >>> fdt.GetString('/display', 'compatible')
-    'nvidia,tegra250-display'
-    >>> our_copy.GetString('/display', 'compatible')
-    'north'
-
-    This copies the FDT into a supplied file, then creates an FDT object to
-    access the copy.
-
-    Args:
-      new_name: Filename to write copy to.
-
-    Returns:
-      An Fdt object for the copy.
-    """
-    shutil.copyfile(self.tools.Filename(self.fname),
-                    self.tools.Filename(new_name))
-    return Fdt(self.tools, new_name)
-
-  def InsertNodes(self, node_list):
-    """Insert a list of new nodes into the FDT.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> arg = [{'path': '/new-node/walrus', 'int': 123}]
-    >>> arg.append({'path': '/new-node/walrus', 'bool': True, 'str': 'fred'})
-    >>> arg.append({'path': '/new-node/seal', 'str': 'frankly'})
-    >>> arg.append({'path': '/new-node/seal', 'list': [1, 2, 3]})
-    >>> fdt.InsertNodes(arg)
-    >>> fdt.GetString('/new-node/walrus', 'str')
-    'fred'
-    >>> fdt.GetInt('/new-node/walrus', 'int')
-    123
-    >>> fdt.GetBool('/new-node/walrus', 'bool')
-    True
-    >>> fdt.GetString('/new-node/seal', 'str')
-    'frankly'
-    >>> fdt.GetIntList('/new-node/seal', 'list')
-    [1, 2, 3]
-    >>> arg = [{'path': '/new-node/dodgy', 'dict': {1: 'fred'}}]
-    >>> fdt.InsertNodes(arg)
-    Traceback (most recent call last):
-      ...
-    ValueError: Unrecognized type for prop 'dict', value '{1: 'fred'}'
-
-    Args:
-      node_list: A list of nodes, each a dictionary containing the properties
-          of the node. One of the properties must be 'path' which is the full
-          path to the node. Supported types for property values are string,
-          boolean, integer and integer list.
-
-    Raises:
-      ValueError: if an unrecognized type is provided.
-    """
-    for node_props in node_list:
-      path = node_props['path']
-      for prop, value in node_props.iteritems():
-        if isinstance(value, int):
-          self.PutInteger(path, prop, value)
-        elif isinstance(value, str):
-          self.PutString(path, prop, value)
-        elif isinstance(value, bool):
-          self.PutBool(path, prop, value)
-        elif isinstance(value, list):
-          self.PutIntList(path, prop, value)
-        else:
-          raise ValueError("Unrecognized type for prop '%s', value '%s'" %
-                           (prop, value))
-
-  def PutString(self, node, prop, value_str):
-    """Writes a string to a property in the fdt.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> our_copy = fdt.Copy(os.path.join(_base, '../tests/copy.dtb'))
-    >>> our_copy.PutString('/display', 'compatible', 'north')
-    >>> fdt.GetString('/display', 'compatible')
-    'nvidia,tegra250-display'
-    >>> our_copy.PutString('/display', 'compatible', 'south')
-    >>> our_copy.GetString('/display', 'compatible')
-    'south'
-
-    Args:
-      node: Full path to node to look up.
-      prop: Property name to look up.
-      value_str: String to write.
-    """
-    args = ['-p', '-t', 's', self.fname, node, prop, value_str]
-    self.tools.Run('fdtput', args)
-
-  def PutInteger(self, node, prop, value_int):
-    """Writes a string to a property in the fdt.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> our_copy = fdt.Copy(os.path.join(_base, '../tests/copy.dtb'))
-    >>> our_copy.PutString('/display', 'compatible', 'north')
-    >>> fdt.GetString('/display', 'compatible')
-    'nvidia,tegra250-display'
-    >>> our_copy.PutString('/display', 'compatible', 'south')
-    >>> our_copy.GetString('/display', 'compatible')
-    'south'
-
-    Args:
-      node: Full path to node to look up.
-      prop: Property name to look up.
-      value_int: Integer to write.
-    """
-    args = ['-p', '-t', 'i', self.fname, node, prop, str(value_int)]
-    self.tools.Run('fdtput', args)
-
-  def PutIntList(self, node, prop, int_list):
-    """Write a list of integers into an fdt property.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> fdt.GetIntList('/flash@0/shared-dev-cfg@180000', 'reg')
-    [1572864, 262144]
-
-    >>> fdt.PutIntList('/flash/shared-dev-cfg', 'victoria', [1, 2, 3])
-
-    >>> fdt.GetIntList('/flash/shared-dev-cfg', 'victoria', 3)
-    [1, 2, 3]
-
-    >>> fdt.PutIntList('/flash/shared-dev-cfg', 'victoria', [3])
-
-    >>> fdt.GetIntList('/flash/shared-dev-cfg', 'victoria', 1)
-    [3]
-
-    >>> fdt.PutIntList('/flash/shared-dev-cfg', 'victoria', [])
-
-    >>> fdt.GetIntList('/flash/shared-dev-cfg', 'victoria', 0)
-    []
-
-    Args:
-      node: Full path to node to look up.
-      prop: Property name to look up.
-      int_list: List of integers to write.
-    """
-    value_list = [str(s) for s in int_list]
-    args = ['-p', '-t', 'i', self.fname, node, prop]
-    args.extend(value_list)
-    self.tools.Run('fdtput', args)
-
-  def PutBytes(self, node, prop, bytes_list):
-    """Write a sequence of bytes into an fdt property.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> fdt = Fdt(tools, os.path.join(_base, '../tests/test.dtb'))
-    >>> out_copy = fdt.Copy(os.path.join(_base, '../tests/copy.dtb'))
-    >>> out_copy.PutBytes('/', 'foo', (0, 1, 2, 3))
-    >>> out_copy.GetProp('/', 'foo')
-    '66051'
-    >>> out_copy.PutBytes('/', 'foo2', (3, 2, 1, 0, 0, 1, 2, 3))
-    >>> out_copy.GetProp('/', 'foo2')
-    '50462976 66051'
-    >>> out_copy.PutBytes('/', 'foo3', (3, 2, 1))
-    >>> out_copy.GetProp('/', 'foo3')
-    '3 2 1'
-
-    Args:
-      node: Full path to the node to look up.
-      prop: Property name to look up.
-      bytes_list: List of bytes to write.
-    """
-    value_list = [str(s) for s in bytes_list]
-    args = ['-p', '-t', 'bi', self.fname, node, prop]
-    args.extend(value_list)
-    self.tools.Run('fdtput', args)
-
-  def Compile(self, arch_dts):
-    """Compile an fdt .dts source file into a .dtb binary blob.
-
-    >>> tools = Tools(cros_output.Output())
-    >>> tools.PrepareOutputDir(None)
-    >>> src_path = '../tests/dts'
-    >>> src = os.path.join(src_path, 'source.dts')
-    >>> fdt = Fdt(tools, src)
-
-    >>> fdt.Compile('')
-    >>> os.path.exists(os.path.join(tools.outdir, 'source.dtb'))
-    True
-    >>> if os.path.exists('../tests/source.dtb'):
-    ...   os.remove('../tests/source.dtb')
-
-    # Now check that search paths work
-    >>> fdt = Fdt(tools, '../tests/source.dts')
-    >>> fdt.Compile('') #doctest:+IGNORE_EXCEPTION_DETAIL
-    Traceback (most recent call last):
-      ...
-    CmdError: Command failed: dtc -I dts -o /tmp/tmpcYO7Fm/source.dtb -O \
-dtb -p 4096 ../tests/source.dts
-    DTC: dts->dtb  on file "../tests/source.dts"
-    FATAL ERROR: Couldn't open "tegra250.dtsi": No such file or directory
-    <BLANKLINE>
-    >>> tools.search_paths = ['../tests/dts']
-    >>> #fdt.Compile()
-
-    Args:
-      arch_dts: Architecture/SOC .dtsi include file.
-    """
-    if not self._is_compiled:
-      root, _ = os.path.splitext(self.fname)
-
-      # Upstream U-Boot requires that we invoke the C preprocessor
-      data = self.tools.ReadFile(self.fname)
-      fname = self.fname
-      search_list = []
-      if 'ARCH_CPU_DTS' in data or '#ifdef' in data:
-        fname = os.path.join(self.tools.outdir, os.path.basename(root) +
-                             '.dts')
-        args = ['-E', '-P', '-x', 'assembler-with-cpp', '-D__ASSEMBLY__']
-        args += ['-Ulinux']
-        args += ['-DARCH_CPU_DTS="%s"' % arch_dts]
-        args += ['-DCONFIG_CHROMEOS']
-        args += ['-o', fname, self.fname]
-        self.tools.Run('cc', args)
-        search_list.extend(['-i', os.path.dirname(self.fname)])
-
-      # If we don't have a directory, put it in the tools tempdir
-      out_fname = os.path.join(self.tools.outdir, os.path.basename(root) +
-                               '.dtb')
-      for path in self.tools.search_paths:
-        search_list.extend(['-i', path])
-      args = ['-I', 'dts', '-o', out_fname, '-O', 'dtb', '-p', '4096']
-      args.extend(search_list)
-      args.append(fname)
-      self.tools.Run('dtc', args)
-      self.fname = out_fname
-      self._is_compiled = True
-
-
-def main():
-  """Main function for cros_bundle_firmware.
-
-  This just lists out the children of the root node, along with all their
-  properties.
-  """
-  parser = optparse.OptionParser()
-  parser.add_option('-d', '--dt', dest='fdt', type='string', action='store',
-                    help='Path to fdt file to use (binary ,dtb)',
-                    default='u-boot.dtb')
-
-  (options, _) = parser.parse_args(sys.argv)
-  tools = Tools(cros_output.Output())
-  fdt = Fdt(tools, options.fdt)
-  children = fdt.GetChildren('/')
-  for child in children:
-    print '%s: %s\n' % (child, fdt.GetProps('/' + child))
-
-
-def _Test():
-  """Run any built-in tests."""
-  assert doctest.testmod().failed == 0
-
-if __name__ == '__main__':
-  # If first argument is --test, run testing code.
-  if sys.argv[1:2] == ['--test']:
-    _Test()
-  else:
-    main()
diff --git a/host/lib/fmap.py b/host/lib/fmap.py
deleted file mode 100644
index c314d8e..0000000
--- a/host/lib/fmap.py
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-"""Basic encode and decode function for flashrom memory map (FMAP) structure.
-
-Usage:
-  (decode)
-  obj = fmap_decode(blob)
-  print obj
-
-  (encode)
-  blob = fmap_encode(obj)
-  open('output.bin', 'w').write(blob)
-
-  The object returned by fmap_decode is a dictionary with names defined in
-  fmap.h. A special property 'FLAGS' is provided as a readable and read-only
-  tuple of decoded area flags.
-"""
-
-
-import logging
-import struct
-import sys
-
-
-# constants imported from lib/fmap.h
-FMAP_SIGNATURE = '__FMAP__'
-FMAP_VER_MAJOR = 1
-FMAP_VER_MINOR_MIN = 0
-FMAP_VER_MINOR_MAX = 1
-FMAP_STRLEN = 32
-FMAP_SEARCH_STRIDE = 4
-
-FMAP_FLAGS = {
-    'FMAP_AREA_STATIC': 1 << 0,
-    'FMAP_AREA_COMPRESSED': 1 << 1,
-}
-
-FMAP_HEADER_NAMES = (
-    'signature',
-    'ver_major',
-    'ver_minor',
-    'base',
-    'size',
-    'name',
-    'nareas',
-)
-
-FMAP_AREA_NAMES = (
-    'offset',
-    'size',
-    'name',
-    'flags',
-)
-
-
-# format string
-FMAP_HEADER_FORMAT = '<8sBBQI%dsH' % (FMAP_STRLEN)
-FMAP_AREA_FORMAT = '<II%dsH' % (FMAP_STRLEN)
-
-
-def _fmap_decode_header(blob, offset):
-  """ (internal) Decodes a FMAP header from blob by offset"""
-  header = {}
-  for (name, value) in zip(FMAP_HEADER_NAMES,
-                           struct.unpack_from(FMAP_HEADER_FORMAT,
-                                              blob,
-                                              offset)):
-    header[name] = value
-
-  if header['signature'] != FMAP_SIGNATURE:
-    raise struct.error('Invalid signature')
-  if (header['ver_major'] != FMAP_VER_MAJOR or
-      header['ver_minor'] < FMAP_VER_MINOR_MIN or
-      header['ver_minor'] > FMAP_VER_MINOR_MAX):
-    raise struct.error('Incompatible version')
-
-  # convert null-terminated names
-  header['name'] = header['name'].strip(chr(0))
-  return (header, struct.calcsize(FMAP_HEADER_FORMAT))
-
-
-def _fmap_decode_area(blob, offset):
-  """ (internal) Decodes a FMAP area record from blob by offset """
-  area = {}
-  for (name, value) in zip(FMAP_AREA_NAMES,
-                           struct.unpack_from(FMAP_AREA_FORMAT, blob, offset)):
-    area[name] = value
-  # convert null-terminated names
-  area['name'] = area['name'].strip(chr(0))
-  # add a (readonly) readable FLAGS
-  area['FLAGS'] = _fmap_decode_area_flags(area['flags'])
-  return (area, struct.calcsize(FMAP_AREA_FORMAT))
-
-
-def _fmap_decode_area_flags(area_flags):
-  """ (internal) Decodes a FMAP flags property """
-  return tuple([name for name in FMAP_FLAGS if area_flags & FMAP_FLAGS[name]])
-
-
-def _fmap_check_name(fmap, name):
-  """Checks if the FMAP structure has correct name.
-
-  Args:
-    fmap: A decoded FMAP structure.
-    name: A string to specify expected FMAP name.
-
-  Raises:
-    struct.error if the name does not match.
-  """
-  if fmap['name'] != name:
-    raise struct.error('Incorrect FMAP (found: "%s", expected: "%s")' %
-                       (fmap['name'], name))
-
-
-def _fmap_search_header(blob, fmap_name=None):
-  """Searches FMAP headers in given blob.
-
-  Uses same logic from vboot_reference/host/lib/fmap.c.
-
-  Args:
-    blob: A string containing FMAP data.
-    fmap_name: A string to specify target FMAP name.
-
-  Returns:
-    A tuple of (fmap, size, offset).
-  """
-  lim = len(blob) - struct.calcsize(FMAP_HEADER_FORMAT)
-  align = FMAP_SEARCH_STRIDE
-
-  # Search large alignments before small ones to find "right" FMAP.
-  while align <= lim:
-    align *= 2
-
-  while align >= FMAP_SEARCH_STRIDE:
-    for offset in xrange(align, lim + 1, align * 2):
-      if not blob.startswith(FMAP_SIGNATURE, offset):
-        continue
-      try:
-        (fmap, size) = _fmap_decode_header(blob, offset)
-        if fmap_name is not None:
-          _fmap_check_name(fmap, fmap_name)
-        return (fmap, size, offset)
-      except struct.error as e:
-        # Search for next FMAP candidate.
-        logging.debug('Continue searching FMAP due to exception %r', e)
-        pass
-    align /= 2
-  raise struct.error('No valid FMAP signatures.')
-
-
-def fmap_decode(blob, offset=None, fmap_name=None):
-  """ Decodes a blob to FMAP dictionary object.
-
-  Arguments:
-    blob: a binary data containing FMAP structure.
-    offset: starting offset of FMAP. When omitted, fmap_decode will search in
-            the blob.
-  """
-  fmap = {}
-
-  if offset is None:
-    (fmap, size, offset) = _fmap_search_header(blob, fmap_name)
-  else:
-    (fmap, size) = _fmap_decode_header(blob, offset)
-    if fmap_name is not None:
-      _fmap_check_name(fmap, fmap_name)
-  fmap['areas'] = []
-  offset = offset + size
-  for _ in range(fmap['nareas']):
-    (area, size) = _fmap_decode_area(blob, offset)
-    offset = offset + size
-    fmap['areas'].append(area)
-  return fmap
-
-
-def _fmap_encode_header(obj):
-  """ (internal) Encodes a FMAP header """
-  values = [obj[name] for name in FMAP_HEADER_NAMES]
-  return struct.pack(FMAP_HEADER_FORMAT, *values)
-
-
-def _fmap_encode_area(obj):
-  """ (internal) Encodes a FMAP area entry """
-  values = [obj[name] for name in FMAP_AREA_NAMES]
-  return struct.pack(FMAP_AREA_FORMAT, *values)
-
-
-def fmap_encode(obj):
-  """ Encodes a FMAP dictionary object to blob.
-
-  Arguments
-    obj: a FMAP dictionary object.
-  """
-  # fix up values
-  obj['nareas'] = len(obj['areas'])
-  # TODO(hungte) re-assign signature / version?
-  blob = _fmap_encode_header(obj)
-  for area in obj['areas']:
-    blob = blob + _fmap_encode_area(area)
-  return blob
-
-
-def main():
-  """Unit test."""
-  if len(sys.argv) > 1:
-    filename = sys.argv[1]
-  else:
-    filename = 'bin/example.bin'
-  logging.basicConfig(level=logging.DEBUG)
-  print 'Decoding FMAP from: %s' % filename
-  blob = open(filename).read()
-  obj = fmap_decode(blob)
-  print obj
-  blob2 = fmap_encode(obj)
-  obj2 = fmap_decode(blob2, 0)
-  print obj2
-  assert obj == obj2
-
-
-if __name__ == '__main__':
-  main()
diff --git a/host/tests/bundle_firmware_ut.py b/host/tests/bundle_firmware_ut.py
deleted file mode 100644
index e784f3f..0000000
--- a/host/tests/bundle_firmware_ut.py
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This contains tests for bundle_firmware using the unittest framework.
-
-It supports creating a few images so far, but the testing is very basic.
-"""
-
-import collections
-import os
-import shutil
-import unittest
-import tempfile
-
-from bundle_firmware import Bundle
-import bundle_firmware
-import cros_output
-from tools import Tools
-
-
-def GetFlagName(index):
-  """Returns the flag name for the given index value (0...n-1)."""
-  return bundle_firmware.gbb_flag_properties.keys()[index]
-
-def GetFlagValue(index):
-  """Returns the flag value for the given index value (0...n-1)."""
-  return bundle_firmware.gbb_flag_properties.values()[index]
-
-
-class TestBundleFirmware(unittest.TestCase):
-  """Unit test class for bundle_firmware.py."""
-
-  def setUp(self):
-    """Set up filenames for running the test.
-
-    A fake U-Boot binary is created ready for use in tests.
-    """
-    self._file_upto = 0         # How many files we have created
-    self.tmpdir = tempfile.mkdtemp()
-    self.output = cros_output.Output()
-    self.tools = Tools(self.output)
-    self.tools.PrepareOutputDir(None)
-    self.bundle = Bundle(self.tools, self.output)
-    self.uboot_fname = self.MakeRandomFile(500 * 1024)
-    self.bundle.SetDirs('##/usr/share/vboot/devkeys')
-    self.bundle.SetOptions(False, None)
-
-  def tearDown(self):
-    """Clean up after completion of tests."""
-    del self.bundle
-
-    # Delete the temporary directory created by the tools object.
-    self.tools.FinalizeOutputDir()
-    del self.tools
-    del self.output
-    shutil.rmtree(self.tmpdir)
-
-  def TmpName(self, file_num):
-    """Returns a suitable filename for the given temporary file number.
-
-    Args:
-      file_num: The temporary file number (0 is the first).
-
-    Returns:
-      The filenme of the file_num'th file.
-    """
-    return os.path.join(self.tmpdir, '%02d.bin' % file_num)
-
-  def MakeRandomFile(self, size):
-    """Make a file of the given size, and fill it with pseudo-random data.
-
-    The file will be created in the 'bin' directory.
-
-    Uses the contents of lorem.txt from here:
-      http://desktoppub.about.com/library/weekly/lorem.txt
-
-    Based on an algorithm here:
-
-      http://jessenoller.com/2008/05/30/making-re-creatable-
-          random-data-files-really-fast-in-python/
-
-    Args:
-      size: Size of file to create, in bytes.
-
-    Returns:
-      Absolute path to the created file.
-    """
-    fname = os.path.abspath(self.TmpName(self._file_upto))
-    self._file_upto += 1
-    with open(fname, 'wb') as fd:
-      seed = '1092384956781341341234656953214543219'
-      words = open('lorem.txt', 'r').read().split()
-
-      def _GetData():
-        """Continuously yield the next 1024 bytes of data."""
-        a = collections.deque(words)
-        b = collections.deque(seed)
-        while True:
-          yield ' '.join(list(a)[0:1024])
-          a.rotate(int(b[0]))
-          b.rotate(1)
-
-      get_data = _GetData()
-      upto = 0
-      while upto < size:
-        data = get_data.next()
-        todo = min(size - upto, len(data))
-        fd.write(data[:todo])
-        upto += todo
-
-    return fname
-
-  # pylint: disable=W0212,C6409
-  def test_NoBoard(self):
-    """With no board selected, it should fail."""
-    self.assertRaises(ValueError, self.bundle.SelectFdt, 'tegra-map.dts', True)
-
-  def assertRaisesContains(self, exception, match, func, *args):
-    try:
-      func(*args)
-    except Exception as e:
-      if not match in str(e):
-        self.fail('Unexpected exception thrown: %s' % str(e))
-    else:
-      self.fail('IOError not thrown')
-
-  def test_Flags(self):
-    bundle = self.bundle
-    self.assertEquals(0, bundle.DecodeGBBFlagsFromOptions(0, None))
-
-    # Make sure each flag works.
-    all = []
-    all_value = 0
-    for flag, value in bundle_firmware.gbb_flag_properties.iteritems():
-      self.assertEquals(value, bundle.DecodeGBBFlagsFromOptions(0, flag))
-      all.append(flag)
-      all_value |= value
-
-    # Nop.
-    self.assertEquals(23, bundle.DecodeGBBFlagsFromOptions(23, ''))
-    self.assertEquals(23, bundle.DecodeGBBFlagsFromOptions(23, None))
-
-    # Starting from 0, try turning on all flags.
-    self.assertEquals(all_value,
-                      bundle.DecodeGBBFlagsFromOptions(0, ','.join(all)))
-
-    # Starting from the value for all flags on, try turning off all flags.
-    all_off = ['-%s' % item for item in bundle_firmware.gbb_flag_properties]
-    self.assertEquals(0, bundle.DecodeGBBFlagsFromOptions(all_value,
-                                      ','.join(all_off)))
-
-    # Make sure + and - work. Start with a random flag.
-    start_value = GetFlagValue(2) | GetFlagValue(3)
-    expr = '+%s,+%s,-%s' % (GetFlagName(1), GetFlagName(4), GetFlagName(3))
-    expect_value = start_value | GetFlagValue(1) | GetFlagValue(4)
-    expect_value &= ~ GetFlagValue(3)
-    self.assertEquals(expect_value,
-                      bundle.DecodeGBBFlagsFromOptions(start_value, expr))
-
-    # Try hex value
-    self.assertEquals(0x69, bundle.DecodeGBBFlagsFromOptions(4, '69'))
-    self.assertEquals(0xc, bundle.DecodeGBBFlagsFromOptions(4, 'c'))
-    self.assertEquals(0xc, bundle.DecodeGBBFlagsFromOptions(4, '00c'))
-
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/host/tests/dts/chromeos.dtsi b/host/tests/dts/chromeos.dtsi
deleted file mode 100644
index 0088121..0000000
--- a/host/tests/dts/chromeos.dtsi
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/*
- * This file holds Chrome OS-specific options, kept within a chromeos-config
- */
-
-/ {
-	chromeos-config {
-		twostop;                /* Two-stop boot */
-		twostop-optional;       /* One-stop optimization enabled */
-		textbase = <0xe08000>;  /* Address where U-Boot loads */
-
-		/*
-		 * Device and offset for second-stage firmware, in SPI for now
-		 * second-stage = <&emmc 0x00000080 0>;
-		 */
-
-		/* Memory addresses for kernel, cros-system and gbb */
-		kernel = <0x00100000 0x00800000>;
-		cros-system-data = <0x00900000 0x8000>;
-		google-binary-block = <0x00908000 0x80000>;
-	};
-
-	config {
-		silent_console = <0>;
-	};
-
-	chosen {
-		bootargs = "";
-	};
-
-};
diff --git a/host/tests/dts/flashmap-ro-1mb.dtsi b/host/tests/dts/flashmap-ro-1mb.dtsi
deleted file mode 100644
index 1fc6812..0000000
--- a/host/tests/dts/flashmap-ro-1mb.dtsi
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/*
- * This is a sub-fmap embedded into twostop fmap. This sub-fmap defines
- * the layout of the R/O portion.
- *
- * The R/O blobs only consumes 1 MB space so that it could be possible to
- * squeeze the final image (R/O + R/W) into 2 MB space. As a result, even if
- * the target machine has a 4 MB flash chip and enables write-protect for the
- * first 2 MB space, only the first 1 MB will contain R/O blobs and the rest
- * 1 MB will be empty.
- */
-
-/ {
-	/*
-	 * Labels have been selected to be to compatible with existing tools,
-	 * even thought the terminology may be a little different on ARM.
-	 * Names will be capitalized and hyphen converted to underscore by
-	 * cros_bundle_firmware.
-	 */
-	flash@0 {
-                /* ---- Section: Read-only ---- */
-		ro-section@0 {
-                        label = "ro-section";
-			reg = <0x00000000 0x000f0000>;
-			read-only;
-		};
-
-		ro-boot@0 {
-			label = "boot-stub";
-			reg = <0x00000000 0x000aff00>; /* 703 KB */
-			read-only;
-			type = "blob signed";
-		};
-		ro-recovery@aff00 {
-			/* Deprecated section */
-			label = "recovery";
-			reg = <0x000aff00 0x00000000>;
-			read-only;
-		};
-		ro-firmware-id@aff00 {
-			label = "ro-frid";
-			reg = <0x000aff00 0x00000100>;
-			read-only;
-			type = "blobstring fwid";
-		};
-		ro-fmap@b0000 {
-			label = "fmap";
-
-			/* We encourage to align FMAP partition in as large
-			 * block as possible so that flashrom can find it soon.
-			 * For example, aligning to 512KB is better than to
-			 * 256KB. */
-
-			reg = <0x000b0000 0x00001000>;
-			read-only;
-			type = "fmap";
-			ver-major = <1>;
-			ver-minor = <0>;
-		};
-		ro-gbb@b1000 {
-			label = "gbb";
-
-			/* GBB offset must be aligned to 4K bytes */
-			reg = <0x000b1000 0x0003f000>;
-			read-only;
-			type = "blob gbb";
-		};
-		ro-data@f0000 {
-		        /* Currently unused, simply for padding */
-			label = "ro-data";
-			reg = <0x000f0000 0x00000000>;
-			read-only;
-		};
-
-                /* ---- Section: Vital-product data (VPD) ---- */
-		ro-vpd@f0000 {
-			label = "ro-vpd";
-
-			/* VPD offset must be aligned to 4K bytes */
-			reg = <0x000f0000 0x00010000>;
-			read-only;
-			type = "wiped";
-			wipe-value = [ff];
-		};
-	};
-};
diff --git a/host/tests/dts/flashmap-twostop-2mb.dtsi b/host/tests/dts/flashmap-twostop-2mb.dtsi
deleted file mode 100644
index e6fc41a..0000000
--- a/host/tests/dts/flashmap-twostop-2mb.dtsi
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
-* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
-* Use of this source code is governed by a BSD-style license that can be
-* found in the LICENSE file.
-*/
-
-/*
-* This is the flash map (fmap) for a twostop firmware. It defines all the areas
-* that Chrome OS expects to find in its firmware device. The device is split
-* into a number of top-level sections, and within each are several areas.
-*
-* Available flags for each entry are: read-only, compresed.
-* All sections will be marked static in the fmap.
-*/
-
-/* Use the small 1MB flash map when we only have 2MB of SPI flash */
-/include/ "flashmap-ro-1mb.dtsi"
-
-/ {
-	flash@0 {
-		#address-cells = <1>;
-		#size-cells = <1>;
-		compatible = "winbond,W25Q16BVSSIG", "cfi-flash",
-			"chromeos,flashmap";
-		reg = <0x00000000 0x00200000>;
-
-		/* ---- Section: Rewritable slot A ---- */
-		rw-a@100000 {
-			label = "rw-section-a";
-			/* Alignment: 4k (for updating) */
-			reg = <0x00100000 0x00078000>;
-			block-lba = <0x00000022>;
-		};
-		rw-a-vblock@100000 {
-			label = "vblock-a";
-			/* Alignment: 4k (for updating) and must be in start of
-			 * each RW_SECTION. */
-			reg = <0x00100000 0x00002000>;
-			type = "keyblock boot";
-			keyblock = "firmware.keyblock";
-			signprivate = "firmware_data_key.vbprivk";
-			version = <1>;
-			kernelkey = "kernel_subkey.vbpubk";
-			preamble-flags = <1>;
-		};
-		rw-a-boot@102000 {
-			/* Alignment: no requirement (yet). */
-			label = "fw-main-a";
-			reg = <0x00102000 0x00075000>;
-
-			/* There is not enough space for this, so remove it */
-			/* type = "blob boot"; */
-		};
-		rw-a-firmware-id@177f00 {
-			/* Alignment: no requirement. */
-			label = "rw-fwid-a";
-			reg = <0x00177f00 0x00000100>;
-			read-only;
-			type = "blobstring fwid";
-		};
-
-		/* ---- Section: Rewritable slot B ---- */
-		rw-b@178000 {
-			label = "rw-section-b";
-			/* Alignment: 4k (for updating) */
-			reg = <0x00178000 0x00078000>;
-			block-lba = <0x00000422>;
-		};
-		rw-b-vblock@178000 {
-			label = "vblock-b";
-			/* Alignment: 4k (for updating) and must be in start of
-			 * each RW_SECTION. */
-			reg = <0x00178000 0x00002000>;
-			type = "keyblock boot";
-			keyblock = "firmware.keyblock";
-			signprivate = "firmware_data_key.vbprivk";
-			version = <1>;
-			kernelkey = "kernel_subkey.vbpubk";
-			preamble-flags = <1>;
-		};
-		rw-b-boot@17a000 {
-			label = "fw-main-b";
-			/* Alignment: no requirement (yet). */
-			reg = <0x0017a000 0x00075000>;
-			/* There is not enough space for this, so remove it */
-			/* type = "blob boot"; */
-		};
-		rw-b-firmware-id@1eff00 {
-			label = "rw-fwid-b";
-			/* Alignment: no requirement. */
-			reg = <0x001eff00 0x00000100>;
-			read-only;
-			type = "blobstring fwid";
-		};
-
-		/* ---- Section: Rewritable VPD 32 KB ---- */
-		rw-vpd@1f0000 {
-			label = "rw-vpd";
-			/* Alignment: 4k (for updating) */
-			reg = <0x001f0000 0x00008000>;
-			type = "wiped";
-			wipe-value = [ff];
-		};
-
-		/* ---- Section: Rewritable shared 16 KB---- */
-		shared-section@1f8000 {
-			/* Alignment: 4k (for updating).
-			 * Anything in this range may be updated in recovery. */
-			label = "rw-shared";
-			reg = <0x001f8000 0x00004000>;
-		};
-		shared-data@1f8000 {
-			label = "shared-data";
-			/* Alignment: 4k (for random read/write).
-			 * RW firmware can put calibration data here. */
-			reg = <0x001f8000 0x00004000>;
-			type = "wiped";
-			wipe-value = [00];
-		};
-		/* ---- Section: Rewritable private 16 KB---- */
-		private-section@1fc000 {
-			/* Anything in this range will never be updated */
-			label = "rw-private";
-			reg = <0x001fc000 0x00004000>;
-		};
-		rw-environment@1fe000 {
-			label = "rw-environment";
-			/* Alignment: 4k, and must occupy bottom of U-Boot
-			 * firmware -- check CONFIG_ENV_OFFSET */
-			reg = <0x001fe000 0x00002000>;
-
-			/*
-			 * We could put the dev environment here, but U-Boot has
-			 * a default built in. Devs can 'saveenv' to set this
-			 * up.
-			 */
-			type = "wiped";
-			wipe-value = [00];
-		};
-	};
-};
diff --git a/host/tests/dts/skeleton.dtsi b/host/tests/dts/skeleton.dtsi
deleted file mode 100644
index b41d241..0000000
--- a/host/tests/dts/skeleton.dtsi
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Skeleton device tree; the bare minimum needed to boot; just include and
- * add a compatible value.  The bootloader will typically populate the memory
- * node.
- */
-
-/ {
-	#address-cells = <1>;
-	#size-cells = <1>;
-	chosen { };
-	aliases { };
-	memory { device_type = "memory"; reg = <0 0>; };
-};
diff --git a/host/tests/dts/source.dts b/host/tests/dts/source.dts
deleted file mode 100644
index c4c58c3..0000000
--- a/host/tests/dts/source.dts
+++ /dev/null
@@ -1,173 +0,0 @@
-/dts-v1/;
-
-/memreserve/ 0x1c000000 0x04000000;
-/include/ "tegra250.dtsi"
-/include/ "chromeos.dtsi"
-/include/ "flashmap-twostop-2mb.dtsi"
-
-/ {
-	model = "NVIDIA Seaboard";
-	compatible = "nvidia,seaboard", "nvidia,tegra250";
-
-	config {
-		odmdata = <0x300d8011>;
-		hwid = "ARM SEABOARD TEST 1176";
-		machine-arch-id = <3005>;
-
-		/* Chrome OS specific GPIO */
-		/*
-		 * Parameter 3 bits
-		 * bit 0: 1=output, 0=input
-		 * bit 1: 1=high, 0=low
-		 * bit 2: 1=active low, 0=active high
-		 */
-		write-protect-switch	= <&gpio 59 0>;
-		recovery-switch		= <&gpio 56 4>;
-		developer-switch	= <&gpio 168 0>;
-		/* Seaboard's lid-switch is ignored */
-		power-switch		= <&gpio 170 4>;
-	};
-
-	aliases {
-		console = "/serial@70006300";
-                usb0 = "/usb@0xc5008000";
-                usb1 = "/usb@0xc5000000";
-
-		sdmmc0 = "/sdhci@c8000600";
-		sdmmc1 = "/sdhci@c8000400";
-
-		i2c0 = "/i2c@0x7000d000";
-		i2c1 = "/i2c@0x7000c000";
-		i2c2 = "/i2c@0x7000c400";
-		i2c3 = "/i2c@0x7000c500";
-	};
-
-	memory {
-		device_type = "memory";
-		reg = <0x00000000 0x40000000>;
-	};
-
-	serial@70006300 {
-		status = "ok";
-		clock-frequency = <216000000>;
-	};
-
-	/*
-	 * Seaboard has a switch on GPIO67 which affects this UART. Until
-	 * pinmux support is added to the FDT it is not clear how to do this,
-	 * so this is a stop-gap.
-	 */
-	switch {
-		compatible = "nvidia,spi-uart-switch";
-		uart = <&uart3>;
-
-		/* Parameter 3 bit 0:1=output, 0=input; bit 1:1=high, 0=low */
-		gpios = <&gpio 67 1>; /* Port I = 8 bit = 3: 8 * 8 + 3 */
-	};
-
-	sdhci@c8000400 {
-		status = "ok";
-		width = <4>;	/* width of SDIO port */
-		removable = <1>;
-		/* Parameter 3 bit 0:1=output, 0=input; bit 1:1=high, 0=low */
-		cd-gpio = <&gpio 69 0>; /* card detect, gpio PI5 */
-		wp-gpio = <&gpio 57 0>; /* write protect, gpio PH1 */
-		power-gpio = <&gpio 70 3>; /* power enable, gpio PI6 */
-	};
-
-	emmc: sdhci@c8000600 {
-		status = "ok";
-		width = <4>;	/* width of SDIO port */
-		removable = <0>;
-	};
-
-	lcd {
-		compatible = "nvidia,tegra2-lcd";
-		width = <1366>;
-		height = <768>;
-		bits_per_pixel = <16>;
-		pwfm = <&pwfm2>;
-		display = <&display1>;
-                /* frame-buffer location = top of memory - carveout - fb */
-                frame-buffer = <0x2f680000>;
-
-		pixel_clock = <70600000>;
-
-		/* Timing: ref_to_sync, sync_width. back_porch, front_porch */
-		horiz_timing = <11 58 58 58>;
-		vert_timing = <1 4 4 4>;
-
-		/* Parameter 3 bit 0:1=output, 0=input; bit 1:1=high, 0=low */
-		backlight-enable = <&gpio 28 1>;	/* PD4 */
-		lvds-shutdown = <&gpio 10 1>;		/* PB2 */
-		backlight-vdd = <&gpio 176 1>;		/* PW0 */
-		panel-vdd = <&gpio 22 1>;		/* PC6 */
-
-		/*
-		 * Panel required timings
-		 * Timing 1: delay between panel_vdd-rise and data-rise
-		 * Timing 2: delay between data-rise and backlight_vdd-rise
-		 * Timing 3: delay between backlight_vdd and pwm-rise
-		 * Timing 4: delay between pwm-rise and backlight_en-rise
-		 */
-		panel-timings = <4 203 17 15>;
-	};
-
-	usb@0xc5000000 {
-		status = "ok";
-		host-mode = <1>;
-	};
-
-	usbphy: usbphy@0 {
-		compatible = "smsc,usb3315";
-		status = "ok";
-	};
-
-	usb@0xc5008000 {
-		status = "ok";
-		utmi = <&usbphy>;
-		host-mode = <0>;
-	};
-
-	flash@0x70008000 {
-		compatible = "hynix,HY27UF4G2B", "nand-flash";
-		controller = <&nand>;
-
-		/* How many bytes for data area */
-		page-data-bytes = <2048>;
-
-		/* How many ECC bytes to be generated for tag bytes */
-		tag-ecc-bytes = <4>;
-
-		/* How many tag bytes in spare area */
-		tag-bytes = <20>;
-
-		/* How many ECC bytes for data area */
-		data-ecc-bytes = <36>;
-
-		skipped-spare-bytes = <4>;
-
-		/*
-		 * How many bytes in spare area
-		 * spare area = skipped bytes + ECC bytes of data area
-		 * + tag bytes + ECC bytes of tag bytes
-		 */
-		page-spare-bytes = <64>;
-
-		/*
-		 * MAX_TRP_TREA:
-		 * non-EDO mode: value (in ns) = Max(tRP, tREA) + 6ns
-		 * EDO mode: value (in ns) = tRP timing
-		 *
-		 * Timing values: MAX_TRP_TREA, TWB, Max(tCS, tCH, tALS, tALH),
-		 *	TWHR, Max(tCS, tCH, tALS, tALH), TWH, TWP, TRH, TADL
-		 */
-		timing = <26 100 20 80 20 10 12 10 70>;
-	};
-
-	nand-controller@0x70008000 {
-		status = "ok";
-		wp-gpio = <&gpio 59 3>;		/* PH3 */
-		width = <8>;
-	};
-};
diff --git a/host/tests/dts/tegra-map.dts b/host/tests/dts/tegra-map.dts
deleted file mode 100644
index 16d120b..0000000
--- a/host/tests/dts/tegra-map.dts
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/*
- * This is a test flash map for Tegra devices.
- *
- * TODO: Use tabs instead of spaces
- */
-
-/dts-v1/;
-
-/ {
-        model = "NVIDIA Seaboard";
-        chromeos-config {
-                twostop;                /* Two-stop boot */
-                twostop-optional;       /* One-stop optimization enabled */
-                textbase = <0xe08000>;  /* Address where U-Boot loads */
-
-                /*
-                 * Device and offset for second-stage firmware, in SPI for now
-                 * second-stage = <&emmc 0x00000080 0>;
-                 */
-
-                /* Memory addresses for kernel, cros-system and gbb */
-                kernel = <0x00100000 0x00800000>;
-                cros-system-data = <0x00900000 0x8000>;
-                google-binary-block = <0x00908000 0x80000>;
-        };
-
-        config {
-                silent_console = <0>;
-        };
-
-        chosen {
-                bootargs = "";
-        };
-
-};
-
-/ {
-        flash@0 {
-                compatible = "winbond,W25Q16BVSSIG", "cfi-flash",
-                        "chromeos,flashmap";
-                reg = <0x00000000 0x00200000>;
-
-                #address-cells = <1>;
-                #size-cells = <1>;
-                /* ---- Section: Read-only ---- */
-                ro-section {
-                        label = "ro-section";
-                        reg = <0x00000000 0x000f0000>;
-                        read-only;
-                };
-
-                ro-boot {
-                        label = "boot-stub";
-                        reg = <0x00000000 0x000aff00>; /* 703 KB */
-                        read-only;
-                        type = "blob signed";
-                };
-                ro-recovery {
-                        /* Deprecated section */
-                        label = "recovery";
-                        reg = <0x000aff00 0x00000000>;
-                        read-only;
-                };
-                ro-firmware-id {
-                        label = "ro-frid";
-                        reg = <0x000aff00 0x00000100>;
-                        read-only;
-                        type = "blobstring fwid";
-                };
-                ro-fmap {
-                        label = "fmap";
-
-                        /* We encourage to align FMAP partition in as large
-                         * block as possible so that flashrom can find it soon.
-                         * For example, aligning to 512KB is better than to
-                         * 256KB. */
-
-                        reg = <0x000b0000 0x00001000>;
-                        read-only;
-                        type = "fmap";
-                        ver-major = <1>;
-                        ver-minor = <0>;
-                };
-                ro-gbb {
-                        label = "gbb";
-
-                        /* GBB offset must be aligned to 4K bytes */
-                        reg = <0x000b1000 0x0003f000>;
-                        read-only;
-                        type = "blob gbb";
-                };
-                ro-data {
-                        /* Currently unused, simply for padding */
-                        label = "ro-data";
-                        reg = <0x000f0000 0x00000000>;
-                        read-only;
-                };
-
-                /* ---- Section: Vital-product data (VPD) ---- */
-                ro-vpd {
-                        label = "ro-vpd";
-
-                        /* VPD offset must be aligned to 4K bytes */
-                        reg = <0x000f0000 0x00010000>;
-                        read-only;
-                        type = "wiped";
-                        wipe-value = [ff];
-                };
-
-                /* ---- Section: Rewritable slot A ---- */
-                rw-a {
-                        label = "rw-section-a";
-                        /* Alignment: 4k (for updating) */
-                        reg = <0x00100000 0x00078000>;
-                        block-lba = <0x00000022>;
-                };
-                rw-a-vblock {
-                        label = "vblock-a";
-                        /* Alignment: 4k (for updating) and must be in start of
-                         * each RW_SECTION. */
-                        reg = <0x00100000 0x00002000>;
-                        type = "keyblock boot";
-                        keyblock = "firmware.keyblock";
-                        signprivate = "firmware_data_key.vbprivk";
-                        version = <1>;
-                        kernelkey = "kernel_subkey.vbpubk";
-                        preamble-flags = <1>;
-                };
-                rw-a-boot {
-                        /* Alignment: no requirement (yet). */
-                        label = "fw-main-a";
-                        reg = <0x00102000 0x00075000>;
-
-                        /* There is not enough space for this, so remove it */
-                        /* type = "blob boot"; */
-                };
-                rw-a-firmware-id {
-                        /* Alignment: no requirement. */
-                        label = "rw-fwid-a";
-                        reg = <0x00177f00 0x00000100>;
-                        read-only;
-                        type = "blobstring fwid";
-                };
-
-                /* ---- Section: Rewritable slot B ---- */
-                rw-b {
-                        label = "rw-section-b";
-                        /* Alignment: 4k (for updating) */
-                        reg = <0x00178000 0x00078000>;
-                        block-lba = <0x00000422>;
-                };
-                rw-b-vblock {
-                        label = "vblock-b";
-                        /* Alignment: 4k (for updating) and must be in start of
-                         * each RW_SECTION. */
-                        reg = <0x00178000 0x00002000>;
-                        type = "keyblock boot";
-                        keyblock = "firmware.keyblock";
-                        signprivate = "firmware_data_key.vbprivk";
-                        version = <1>;
-                        kernelkey = "kernel_subkey.vbpubk";
-                        preamble-flags = <1>;
-                };
-                rw-b-boot@ {
-                        label = "fw-main-b";
-                        /* Alignment: no requirement (yet). */
-                        reg = <0x0017a000 0x00075000>;
-                        /* There is not enough space for this, so remove it */
-                        /* type = "blob boot"; */
-                };
-                rw-b-firmware-id {
-                        label = "rw-fwid-b";
-                        /* Alignment: no requirement. */
-                        reg = <0x001eff00 0x00000100>;
-                        read-only;
-                        type = "blobstring fwid";
-                };
-
-                /* ---- Section: Rewritable VPD 32 KB ---- */
-                rw-vpd {
-                        label = "rw-vpd";
-                        /* Alignment: 4k (for updating) */
-                        reg = <0x001f0000 0x00008000>;
-                        type = "wiped";
-                        wipe-value = [ff];
-                };
-
-                /* ---- Section: Rewritable shared 16 KB---- */
-                shared-section {
-                        /* Alignment: 4k (for updating).
-                         * Anything in this range may be updated in recovery. */
-                        label = "rw-shared";
-                        reg = <0x001f8000 0x00004000>;
-                };
-                shared-data {
-                        label = "shared-data";
-                        /* Alignment: 4k (for random read/write).
-                         * RW firmware can put calibration data here. */
-                        reg = <0x001f8000 0x00004000>;
-                        type = "wiped";
-                        wipe-value = [00];
-                };
-                /* ---- Section: Rewritable private 16 KB---- */
-                private-section {
-                        /* Anything in this range will never be updated */
-                        label = "rw-private";
-                        reg = <0x001fc000 0x00004000>;
-                };
-                rw-environment {
-                        label = "rw-environment";
-                        /* Alignment: 4k, and must occupy bottom of U-Boot
-                         * firmware -- check CONFIG_ENV_OFFSET */
-                        reg = <0x001fe000 0x00002000>;
-
-                        /*
-                         * We could put the dev environment here, but U-Boot has
-                         * a default built in. Devs can 'saveenv' to set this
-                         * up.
-                         */
-                        type = "wiped";
-                        wipe-value = [00];
-                };
-        };
-};
diff --git a/host/tests/dts/tegra250.dtsi b/host/tests/dts/tegra250.dtsi
deleted file mode 100644
index 4a35d53..0000000
--- a/host/tests/dts/tegra250.dtsi
+++ /dev/null
@@ -1,274 +0,0 @@
-/include/ "skeleton.dtsi"
-
-/ {
-	model = "NVIDIA Tegra 250";
-	compatible = "nvidia,tegra250";
-	interrupt-parent = <&intc>;
-
-	amba {
-		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <1>;
-		ranges;
-
-		intc: interrupt-controller@50041000 {
-			compatible = "nvidia,tegra250-gic", "arm,gic";
-			interrupt-controller;
-			#interrupt-cells = <1>;
-			reg = < 0x50041000 0x1000 >,
-			      < 0x50040100 0x0100 >;
-		};
-	};
-
-	pllp: clock0 {
-		compatible = "nvidia,tegra20-pll-sys";
-		#clock-cells = <1>;
-		clock-frequency = <216000000>;
-		clock-output-names = "pllp";
-	};
-
-	/* TBD: provides an easy way to find clocks for now */
-	clocks {
-		compatible = "board-clocks";
-		pllp = <&pllp>;
-	};
-
-	gpio: gpio@6000d000 {
-		compatible = "nvidia,tegra250-gpio", "ns16550";
-		reg = < 0x6000d000 0x1000 >;
-		interrupts = < 64 65 66 67 87 119 121 >;
-		#gpio-cells = <2>;
-		gpio-controller;
-	};
-
-	serial@70006000 {
-		compatible = "nvidia,tegra250-uart", "ns16550";
-		reg = <0x70006000 0x40>;
-		id = <0>;
-		reg-shift = <2>;
-		interrupts = < 68 >;
-		status = "disabled";
-	};
-
-	serial@70006040 {
-		compatible = "nvidia,tegra250-uart", "ns16550";
-		reg = <0x70006040 0x40>;
-		id = <1>;
-		reg-shift = <2>;
-		interrupts = < 69 >;
-		status = "disabled";
-	};
-
-	serial@70006200 {
-		compatible = "nvidia,tegra250-uart", "ns16550";
-		reg = <0x70006200 0x100>;
-		id = <2>;
-		reg-shift = <2>;
-		interrupts = < 78 >;
-		status = "disabled";
-	};
-
-	uart3: serial@70006300 {
-		compatible = "nvidia,tegra250-uart", "ns16550";
-		reg = <0x70006300 0x100>;
-		id = <3>;
-		reg-shift = <2>;
-		interrupts = < 122 >;
-		status = "disabled";
-	};
-
-	serial@70006400 {
-		compatible = "nvidia,tegra250-uart", "ns16550";
-		reg = <0x70006400 0x100>;
-		id = <4>;
-		reg-shift = <2>;
-		interrupts = < 123 >;
-		status = "disabled";
-	};
-
-	sdhci@c8000000 {
-		compatible = "nvidia,tegra250-sdhci";
-		reg = <0xc8000000 0x200>;
-		interrupts = <46>;
-                periph-id = <14>;	// PERIPH_ID_SDMMC1
-		status = "disabled";
-	};
-
-	sdhci@c8000200 {
-		compatible = "nvidia,tegra250-sdhci";
-		reg = <0xc8000200 0x200>;
-		interrupts = <47>;
-                periph-id = <9>;	// PERIPH_ID_SDMMC2
-		status = "disabled";
-	};
-
-	sdhci@c8000400 {
-		compatible = "nvidia,tegra250-sdhci";
-		reg = <0xc8000400 0x200>;
-		interrupts = <51>;
-                periph-id = <69>;	// PERIPH_ID_SDMMC3
-		status = "disabled";
-	};
-
-	sdhci@c8000600 {
-		compatible = "nvidia,tegra250-sdhci";
-		reg = <0xc8000600 0x200>;
-		interrupts = <63>;
-                periph-id = <15>;	// PERIPH_ID_SDMMC4
-		status = "disabled";
-	};
-
-	pwfm0: pwm@7000a000 {
-		compatible = "nvidia,tegra250-sdhci";
-		reg = <0x7000a000 0x4>;
-		status = "disabled";
-	};
-
-	pwfm1: pwm@7000a010 {
-		compatible = "nvidia,tegra250-sdhci";
-		reg = <0x7000a010 0x4>;
-		status = "disabled";
-	};
-
-	pwfm2: pwm@7000a020 {
-		compatible = "nvidia,tegra250-sdhci";
-		reg = <0x7000a020 0x4>;
-		status = "disabled";
-	};
-
-	pwfm3: pwm@7000a030 {
-		compatible = "nvidia,tegra250-sdhci";
-		reg = <0x7000a030 0x4>;
-		status = "disabled";
-	};
-
-	display1: display@0x54200000 {
-		compatible = "nvidia,tegra250-display";
-		reg = <0x54200000 0x40000>;
-		status = "disabled";
-	};
-
-/* This table has USB timing parameters for each Oscillator frequency we
- * support. There are four sets of values:
- *
- * 1. PLLU configuration information (reference clock is osc/clk_m and
- * PLLU-FOs are fixed at 12MHz/60MHz/480MHz).
- *
- *  Reference frequency     13.0MHz      19.2MHz      12.0MHz      26.0MHz
- *  ----------------------------------------------------------------------
- *      DIVN                960 (0x3c0)  200 (0c8)    960 (3c0h)   960 (3c0)
- *      DIVM                13 (0d)      4 (04)       12 (0c)      26 (1a)
- * Filter frequency (MHz)   1            4.8          6            2
- * CPCON                    1100b        0011b        1100b        1100b
- * LFCON0                   0            0            0            0
- *
- * 2. PLL CONFIGURATION & PARAMETERS for different clock generators:
- *
- * Reference frequency     13.0MHz         19.2MHz         12.0MHz     26.0MHz
- * ---------------------------------------------------------------------------
- * PLLU_ENABLE_DLY_COUNT   02 (0x02)       03 (03)         02 (02)     04 (04)
- * PLLU_STABLE_COUNT       51 (33)         75 (4B)         47 (2F)    102 (66)
- * PLL_ACTIVE_DLY_COUNT    05 (05)         06 (06)         04 (04)     09 (09)
- * XTAL_FREQ_COUNT        127 (7F)        187 (BB)        118 (76)    254 (FE)
- *
- * 3. Debounce values IdDig, Avalid, Bvalid, VbusValid, VbusWakeUp, and
- * SessEnd. Each of these signals have their own debouncer and for each of
- * those one out of two debouncing times can be chosen (BIAS_DEBOUNCE_A or
- * BIAS_DEBOUNCE_B).
- *
- * The values of DEBOUNCE_A and DEBOUNCE_B are calculated as follows:
- *    0xffff -> No debouncing at all
- *    <n> ms = <n> *1000 / (1/19.2MHz) / 4
- *
- * So to program a 1 ms debounce for BIAS_DEBOUNCE_A, we have:
- * BIAS_DEBOUNCE_A[15:0] = 1000 * 19.2 / 4  = 4800 = 0x12c0
- *
- * We need to use only DebounceA for BOOTROM. We don’t need the DebounceB
- * values, so we can keep those to default.
- *
- * a4. The 20 microsecond delay after bias cell operation.
- *  Reference frequency     13.0MHz      19.2MHz      12.0MHz      26.0MHz
- */
-	usbparams@0 {
-		compatible = "nvidia,tegra250-usbparams";
-		osc-frequency = <13000000>;
-		/* DivN, DivM, DivP, CPCON, LFCON, Delays      Debounce, Bias */
-		params = <0x3c0 0x0d 0x00 0xc 0  0x02 0x33 0x05 0x7f  0x7ef4 5>;
-	};
-
-	usbparams@1 {
-		compatible = "nvidia,tegra250-usbparams";
-		osc-frequency = <19200000>;
-		params = <0x0c8 0x04 0x00 0x3 0  0x03 0x4b 0x06 0xbb  0xbb80 7>;
-	};
-
-	usbparams@2 {
-		compatible = "nvidia,tegra250-usbparams";
-		osc-frequency = <12000000>;
-		params = <0x3c0 0x0c 0x00 0xc 0  0x02 0x2f 0x04 0x76  0x7530 5>;
-	};
-
-	usbparams@3 {
-		compatible = "nvidia,tegra250-usbparams";
-		osc-frequency = <26000000>;
-		params = <0x3c0 0x1a 0x00 0xc 0  0x04 0x66 0x09 0xfe  0xfde8 9>;
-	};
-
-	usb@0xc5008000 {
-		compatible = "nvidia,tegra250-usb";
-		reg = <0xc5008000 0x8000>;
-                periph-id = <59>;	// PERIPH_ID_USB3
-		status = "disabled";
-	};
-
-	usb@0xc5000000 {
-		compatible = "nvidia,tegra250-usb";
-		reg = <0xc5000000 0x8000>;
-                periph-id = <22>;	// PERIPH_ID_USBD
-		status = "disabled";
-	};
-
-	kbc@0x7000e200 {
-		compatible = "nvidia,tegra250-kbc";
-		reg = <0x7000e200 0x0078>;
-	};
-
-	i2c@0x7000c000 {
-		compatible = "nvidia,tegra250-i2c";
-		reg = <0x7000c000 0x006c>;
-		pinmux = <1>;
-		speed = <100000>;
-		periph-id = <12>;	// PERIPH_ID_I2C1
-	};
-
-	i2c@0x7000c400 {
-		compatible = "nvidia,tegra250-i2c";
-		reg = <0x7000c400 0x006c>;
-		pinmux = <2>;
-		speed = <100000>;
-		periph-id = <54>;	// PERIPH_ID_I2C2
-	};
-
-	i2c@0x7000c500 {
-		compatible = "nvidia,tegra250-i2c";
-		reg = <0x7000c500 0x006c>;
-		pinmux = <1>;
-		speed = <100000>;
-		periph-id = <67>;	// PERIPH_ID_I2C3
-	};
-
-	i2c@0x7000d000 {
-		compatible = "nvidia,tegra250-i2c";
-		reg = <0x7000d000 0x007c>;
-		pinmux = <1>;
-		speed = <100000>;
-		use-dvc-ctlr;
-		periph-id = <47>;	// PERIPH_ID_DVC_I2C
-	};
-
-	nand: nand-controller@0x70008000 {
-		compatible = "nvidia,tegra2-nand";
-		reg = <0x70008000 0x100>;
-		status = "disabled";
-	};
-};
diff --git a/host/tests/make-test.sh b/host/tests/make-test.sh
deleted file mode 100755
index 21c97c7..0000000
--- a/host/tests/make-test.sh
+++ /dev/null
@@ -1,388 +0,0 @@
-#!/bin/bash
-
-# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Script to make the test.dtb file
-
-dtc -O dtb -o test.dtb -p 1000 - <<EOF
-/dts-v1/;
-/ {
-    #address-cells = <0x00000001>;
-    #size-cells = <0x00000001>;
-    model = "NVIDIA Seaboard";
-    compatible = "nvidia,seaboard", "nvidia,tegra250";
-    interrupt-parent = <0x00000001>;
-    chosen {
-        bootargs = "";
-    };
-    aliases {
-        console = "/serial@70006300";
-        usb0 = "/usb@0xc5008000";
-        usb1 = "/usb@0xc5000000";
-        sdmmc0 = "/sdhci@c8000600";
-        sdmmc1 = "/sdhci@c8000400";
-    };
-    memory {
-        device_type = "memory";
-        reg = <0x00000000 0x616d6261>;
-    };
-    amba {
-        compatible = "simple-bus";
-        #address-cells = <0x00000001>;
-        #size-cells = <0x00000001>;
-        ranges;
-        interrupt-controller@50041000 {
-            compatible = "nvidia,tegra250-gic", "arm,gic";
-            interrupt-controller;
-            #interrupt-cells = <0x00000001>;
-            reg = <0x50041000 0x00001000 0x50040100 0x00000100>;
-            linux,phandle = <0x00000001>;
-            phandle = <0x00000001>;
-        };
-    };
-    gpio@6000d000 {
-        compatible = "nvidia,tegra250-gpio", "ns16550";
-        reg = <0x6000d000 0x000000b1>;
-        interrupts = <0x00000040 0x00000041 0x00000042 0x00000043 0x00000057
-            0x00000077 0x00000079>;
-        #gpio-cells = <0x00000002>;
-        gpio-controller;
-        linux,phandle = <0x00000002>;
-        phandle = <0x00000002>;
-    };
-    serial@70006000 {
-        compatible = "nvidia,tegra250-uart", "ns16550";
-        reg = <0x70006000 0x00000040>;
-        id = <0x00000000>;
-        reg-shift = <0x00000002>;
-        interrupts = <0x00000044>;
-        status = "disabled";
-    };
-    serial@70006040 {
-        compatible = "nvidia,tegra250-uart", "ns16550";
-        reg = <0x70006040 0x00000040>;
-        id = <0x00000001>;
-        reg-shift = <0x00000002>;
-        interrupts = <0x00000045>;
-        status = "disabled";
-    };
-    serial@70006200 {
-        compatible = "nvidia,tegra250-uart", "ns16550";
-        reg = <0x70006200 0x00000100>;
-        id = <0x00000002>;
-        reg-shift = <0x00000002>;
-        interrupts = <0x0000004e>;
-        status = "disabled";
-    };
-    serial@70006300 {
-        compatible = "nvidia,tegra250-uart", "ns16550";
-        reg = <0x70006300 0x00000100>;
-        id = <0x00000003>;
-        reg-shift = <0x00000002>;
-        interrupts = <0x0000007a>;
-        status = "ok";
-        clock-frequency = <0x0cdfe600>;
-        linux,phandle = <0x00000004>;
-        phandle = <0x00000004>;
-    };
-    serial@70006400 {
-        compatible = "nvidia,tegra250-uart", "ns16550";
-        reg = <0x70006400 0x00000100>;
-        id = <0x00000004>;
-        reg-shift = <0x00000002>;
-        interrupts = <0x0000007b>;
-        status = "disabled";
-    };
-    sdhci@c8000000 {
-        compatible = "nvidia,tegra250-sdhci";
-        reg = <0xc8000000 0x00000200>;
-        interrupts = <0x0000002e>;
-        periph-id = <0x0000000e>;
-        status = "disabled";
-    };
-    sdhci@c8000200 {
-        compatible = "nvidia,tegra250-sdhci";
-        reg = <0xc8000200 0x00000200>;
-        interrupts = <0x0000002f>;
-        periph-id = <0x00000009>;
-        status = "disabled";
-    };
-    sdhci@c8000400 {
-        compatible = "nvidia,tegra250-sdhci";
-        reg = <0xc8000400 0x00000200>;
-        interrupts = <0x00000033>;
-        periph-id = <0x00000045>;
-        status = "ok";
-        width = <0x00000004>;
-        removable = <0x00000001>;
-        cd-gpio = <0x00000002 0x00000045 0x00000000>;
-        wp-gpio = <0x00000002 0x00000039 0x00000000>;
-        power-gpio = <0x00000002 0x00000046 0x00000003>;
-    };
-    sdhci@c8000600 {
-        compatible = "nvidia,tegra250-sdhci";
-        reg = <0xc8000600 0x00000200>;
-        interrupts = <0x0000003f>;
-        periph-id = <0x0000000f>;
-        status = "ok";
-        width = <0x00000004>;
-        removable = <0x00000000>;
-    };
-    pwm@7000a000 {
-        compatible = "nvidia,tegra250-sdhci";
-        reg = <0x7000a000 0x00000004>;
-        status = "disabled";
-    };
-    pwm@7000a010 {
-        compatible = "nvidia,tegra250-sdhci";
-        reg = <0x7000a010 0x00000004>;
-        status = "disabled";
-    };
-    pwm@7000a020 {
-        compatible = "nvidia,tegra250-sdhci";
-        reg = <0x7000a020 0x00000004>;
-        status = "disabled";
-        linux,phandle = <0x00000005>;
-        phandle = <0x00000005>;
-    };
-    pwm@7000a030 {
-        compatible = "nvidia,tegra250-sdhci";
-        reg = <0x7000a030 0x00000004>;
-        status = "disabled";
-    };
-    display@0x54200000 {
-        compatible = "nvidia,tegra250-display";
-        reg = <0x54200000 0x00040000>;
-        status = "disabled";
-        linux,phandle = <0x00000006>;
-        phandle = <0x00000006>;
-    };
-    usbparams@0 {
-        compatible = "nvidia,tegra250-usbparams";
-        osc-frequency = <0x00c65d40>;
-        params = <0x000003c0 0x0000000d 0x00000000 0x0000000c 0x00000000
-                0x00000002 0x00000033 0x00000005 0x0000007f 0x00007ef4
-                0x00000005>;
-    };
-    usbparams@1 {
-        compatible = "nvidia,tegra250-usbparams";
-        osc-frequency = <0x0124f800>;
-        params = <0x000000c8 0x00000004 0x00000000 0x00000003 0x00000000
-        0x00000003 0x0000004b 0x00000006 0x000000bb 0x0000bb80 0x00000007>;
-    };
-    usbparams@2 {
-        compatible = "nvidia,tegra250-usbparams";
-        osc-frequency = <0x00b71b00>;
-        params = <0x000003c0 0x0000000c 0x00000000 0x0000000c 0x00000000
-        0x00000002 0x0000002f 0x00000004 0x00000076 0x00007530 0x00000005>;
-    };
-    usbparams@3 {
-        compatible = "nvidia,tegra250-usbparams";
-        osc-frequency = <0x018cba80>;
-        params = <0x000003c0 0x0000001a 0x00000000 0x0000000c 0x00000000
-        0x00000004 0x00000066 0x00000009 0x000000fe 0x0000fde8 0x00000009>;
-    };
-    usb@0xc5008000 {
-        compatible = "nvidia,tegra250-usb";
-        reg = <0xc5008000 0x00008000>;
-        periph-id = <0x0000003b>;
-        status = "ok";
-        utmi = <0x00000003>;
-        host-mode = <0x00000000>;
-    };
-    usb@0xc5000000 {
-        compatible = "nvidia,tegra250-usb";
-        reg = <0xc5000000 0x00008000>;
-        periph-id = <0x00000016>;
-        status = "ok";
-        host-mode = <0x00000001>;
-    };
-    kbc@0x7000e200 {
-        compatible = "nvidia,tegra250-kbc";
-        reg = <0x7000e200 0x00000078>;
-        keycode-plain = <0x00007773 0x617a00de 0x00000000 0x00000000
-        0x00000000 0x00000000 0x35347265 0x66647800 0x37367468
-        0x67766320 0x39387579 0x6a6e625c 0x2d306f69 0x6c6b2c6d
-        0x003d5d0d 0x00000000 0x00000000 0xdfdf0000 0x00000000
-        0x00dc00dd 0x00000000 0x00000000 0x5b70273b 0x2f2e0000
-        0x00000833 0x32000000 0x007f0000 0x00000000 0x00000071
-        0x00003100 0x1b600009 0x00000000>;
-        keycode-shift = <0x00005753 0x415a0000 0x00000000 0x00000000
-        0x00000000 0x00000000 0x25245245 0x46445800 0x265e5448
-        0x47564320 0x282a5559 0x4a4e427c 0x5f294f49 0x4c4b3c4d
-        0x002b7d0d 0x00000000 0x00000000 0x00000000 0x00000000
-        0x00000000 0x00000000 0x00000000 0x7b50223a 0x3f3e0000
-        0x00000823 0x40000000 0x007f0000 0x00000000 0x00000051
-        0x00002100 0x1b7e0009 0x00000000>;
-        keycode-fn = <0x00000000 0x00000000 0x00000000 0x00000000
-        0x00000000 0x00000000 0x00000000 0x00000000 0x37000000
-        0x00000000 0x39383400 0x31000000 0x002f3635 0x33320030
-        0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
-        0x00000000 0x00000000 0x00000000 0x0027002d 0x2b2e0000
-        0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
-        0x00000000 0x00000000 0x3f000000>;
-        keycode-ctrl = <0x00001713 0x011a0000 0x00000000 0x00000000
-        0x00000000 0x00000000 0x00001205 0x06041800 0x00001408
-        0x07160300 0x00001519 0x0a0e0200 0x00000f09 0x0c0b000d
-        0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
-        0x00000000 0x00000000 0x00000000 0x00100000 0x00000000
-        0x00000000 0x00000000 0x00000000 0x00000000 0x00000011
-        0x00000000 0x00000000 0x00000000>;
-    };
-    flash@0 {
-        #address-cells = <0x00000001>;
-        #size-cells = <0x00000001>;
-        compatible = "winbond,W25Q32BVSSIG", "cfi-flash", "chromeos,flashmap";
-        reg = <0x00000000 0x00400000>;
-        onestop-layout@0 {
-            label = "onestop-layout";
-            reg = <0x00000000 0x00080000>;
-        };
-        firmware-image@0 {
-            label = "firmware-image";
-            reg = <0x00000000 0x0007df00>;
-        };
-        verification-block@7df00 {
-            label = "verification-block";
-            reg = <0x0007df00 0x00002000>;
-        };
-        firmware-id@7ff00 {
-            label = "firmware-id";
-            reg = <0x0007ff00 0x00000100>;
-        };
-        readonly@0 {
-            label = "readonly";
-            reg = <0x00000000 0x00100000>;
-            read-only;
-        };
-        bct@0 {
-            label = "bct";
-            reg = <0x00000000 0x00010000>;
-            read-only;
-        };
-        ro-onestop@10000 {
-            label = "ro-onestop";
-            reg = <0x00010000 0x00080000>;
-            read-only;
-            type = "blob boot";
-            used = <1234>;
-            hash-target;
-        };
-        ro-gbb@90000 {
-            label = "gbb";
-            reg = <0x00090000 0x00020000>;
-            read-only;
-            type = "blob gbb";
-        };
-        ro-data@b0000 {
-            label = "ro-data";
-            reg = <0x000b0000 0x00010000>;
-            read-only;
-        };
-        ro-vpd@c0000 {
-            label = "ro-vpd";
-            reg = <0x000c0000 0x00010000>;
-            read-only;
-            type = "wiped";
-            wipe-value = [ffffffff];
-        };
-        fmap@d0000 {
-            label = "ro-fmap";
-            reg = <0x000d0000 0x00000400>;
-            read-only;
-            type = "fmap";
-            ver-major = <0x00000001>;
-            ver-minor = <0x00000000>;
-        };
-        readwrite@100000 {
-            label = "readwrite";
-            reg = <0x00100000 0x00100000>;
-        };
-        rw-vpd@100000 {
-            label = "rw-vpd";
-            reg = <0x00100000 0x00080000>;
-            type = "wiped";
-            wipe-value = [ffffffff];
-        };
-        shared-dev-cfg@180000 {
-            victoria;
-            label = "shared-dev-cfg";
-            reg = <0x00180000 0x00040000>;
-            type = "wiped";
-            wipe-value = "";
-        };
-        shared-data@1c0000 {
-            label = "shared-data";
-            reg = <0x001c0000 0x00030000>;
-            type = "wiped";
-            wipe-value = "";
-        };
-        shared-env@1ff000 {
-            label = "shared-env";
-            reg = <0x001ff000 0x00001000>;
-            type = "wiped";
-            wipe-value = "";
-        };
-        readwrite-a@200000 {
-            label = "readwrite-a";
-            reg = <0x00200000 0x00080000>;
-            block-lba = <0x00000022>;
-        };
-        rw-a-onestop@200000 {
-            label = "rw-a-onestop";
-            reg = <0x00200000 0x00080000>;
-            type = "blob boot";
-        };
-        readwrite-b@300000 {
-            label = "readwrite-b";
-            reg = <0x00300000 0x00080000>;
-            block-lba = <0x00000422>;
-        };
-        rw-b-onestop@300000 {
-            label = "rw-b-onestop";
-            size = <0x00008000>;
-            type = "blob boot";
-        };
-    };
-    config {
-        silent_console = <0x00000000>;
-        odmdata = <0x300d8011>;
-        hwid = "ARM SEABOARD TEST 1176";
-        machine-arch-id = <0x00000bbd>;
-        gpio_port_write_protect_switch = <0x0000003b>;
-        gpio_port_recovery_switch = <0x00000038>;
-        gpio_port_developer_switch = <0x000000a8>;
-        polarity_write_protect_switch = <0x00000001>;
-        polarity_recovery_switch = <0x00000000>;
-        polarity_developer_switch = <0x00000001>;
-    };
-    switch {
-        compatible = "nvidia,spi-uart-switch";
-        uart = <0x00000004>;
-        gpios = <0x00000002 0x00000043 0x00000001>;
-    };
-    lcd {
-        compatible = "nvidia,tegra2-lcd";
-        width = <0x00000556>;
-        height = <0x00000300>;
-        bits_per_pixel = <0x00000010>;
-        pwfm = <0x00000005>;
-        display = <0x00000006>;
-        frame-buffer = <0x1c022000>;
-        pixel_clock = <0x04354540>;
-        horiz_timing = <0x0000000b 0x0000003a 0x0000003a 0x0000003a>;
-        vert_timing = <0x00000001 0x00000004 0x00000004 0x00000004>;
-        gpios = <0x00000002 0x0000001c 0x00000003 0x00000002 0x0000000a
-            0x00000003 0x00000002 0x000000b0 0x00000003 0x00000002
-            0x00000016 0x00000003>;
-    };
-    usbphy@0 {
-        compatible = "smsc,usb3315";
-        status = "ok";
-        linux,phandle = <0x00000003>;
-        phandle = <0x00000003>;
-    };
-};
-EOF
diff --git a/host/tests/source.dts b/host/tests/source.dts
deleted file mode 100644
index c4c58c3..0000000
--- a/host/tests/source.dts
+++ /dev/null
@@ -1,173 +0,0 @@
-/dts-v1/;
-
-/memreserve/ 0x1c000000 0x04000000;
-/include/ "tegra250.dtsi"
-/include/ "chromeos.dtsi"
-/include/ "flashmap-twostop-2mb.dtsi"
-
-/ {
-	model = "NVIDIA Seaboard";
-	compatible = "nvidia,seaboard", "nvidia,tegra250";
-
-	config {
-		odmdata = <0x300d8011>;
-		hwid = "ARM SEABOARD TEST 1176";
-		machine-arch-id = <3005>;
-
-		/* Chrome OS specific GPIO */
-		/*
-		 * Parameter 3 bits
-		 * bit 0: 1=output, 0=input
-		 * bit 1: 1=high, 0=low
-		 * bit 2: 1=active low, 0=active high
-		 */
-		write-protect-switch	= <&gpio 59 0>;
-		recovery-switch		= <&gpio 56 4>;
-		developer-switch	= <&gpio 168 0>;
-		/* Seaboard's lid-switch is ignored */
-		power-switch		= <&gpio 170 4>;
-	};
-
-	aliases {
-		console = "/serial@70006300";
-                usb0 = "/usb@0xc5008000";
-                usb1 = "/usb@0xc5000000";
-
-		sdmmc0 = "/sdhci@c8000600";
-		sdmmc1 = "/sdhci@c8000400";
-
-		i2c0 = "/i2c@0x7000d000";
-		i2c1 = "/i2c@0x7000c000";
-		i2c2 = "/i2c@0x7000c400";
-		i2c3 = "/i2c@0x7000c500";
-	};
-
-	memory {
-		device_type = "memory";
-		reg = <0x00000000 0x40000000>;
-	};
-
-	serial@70006300 {
-		status = "ok";
-		clock-frequency = <216000000>;
-	};
-
-	/*
-	 * Seaboard has a switch on GPIO67 which affects this UART. Until
-	 * pinmux support is added to the FDT it is not clear how to do this,
-	 * so this is a stop-gap.
-	 */
-	switch {
-		compatible = "nvidia,spi-uart-switch";
-		uart = <&uart3>;
-
-		/* Parameter 3 bit 0:1=output, 0=input; bit 1:1=high, 0=low */
-		gpios = <&gpio 67 1>; /* Port I = 8 bit = 3: 8 * 8 + 3 */
-	};
-
-	sdhci@c8000400 {
-		status = "ok";
-		width = <4>;	/* width of SDIO port */
-		removable = <1>;
-		/* Parameter 3 bit 0:1=output, 0=input; bit 1:1=high, 0=low */
-		cd-gpio = <&gpio 69 0>; /* card detect, gpio PI5 */
-		wp-gpio = <&gpio 57 0>; /* write protect, gpio PH1 */
-		power-gpio = <&gpio 70 3>; /* power enable, gpio PI6 */
-	};
-
-	emmc: sdhci@c8000600 {
-		status = "ok";
-		width = <4>;	/* width of SDIO port */
-		removable = <0>;
-	};
-
-	lcd {
-		compatible = "nvidia,tegra2-lcd";
-		width = <1366>;
-		height = <768>;
-		bits_per_pixel = <16>;
-		pwfm = <&pwfm2>;
-		display = <&display1>;
-                /* frame-buffer location = top of memory - carveout - fb */
-                frame-buffer = <0x2f680000>;
-
-		pixel_clock = <70600000>;
-
-		/* Timing: ref_to_sync, sync_width. back_porch, front_porch */
-		horiz_timing = <11 58 58 58>;
-		vert_timing = <1 4 4 4>;
-
-		/* Parameter 3 bit 0:1=output, 0=input; bit 1:1=high, 0=low */
-		backlight-enable = <&gpio 28 1>;	/* PD4 */
-		lvds-shutdown = <&gpio 10 1>;		/* PB2 */
-		backlight-vdd = <&gpio 176 1>;		/* PW0 */
-		panel-vdd = <&gpio 22 1>;		/* PC6 */
-
-		/*
-		 * Panel required timings
-		 * Timing 1: delay between panel_vdd-rise and data-rise
-		 * Timing 2: delay between data-rise and backlight_vdd-rise
-		 * Timing 3: delay between backlight_vdd and pwm-rise
-		 * Timing 4: delay between pwm-rise and backlight_en-rise
-		 */
-		panel-timings = <4 203 17 15>;
-	};
-
-	usb@0xc5000000 {
-		status = "ok";
-		host-mode = <1>;
-	};
-
-	usbphy: usbphy@0 {
-		compatible = "smsc,usb3315";
-		status = "ok";
-	};
-
-	usb@0xc5008000 {
-		status = "ok";
-		utmi = <&usbphy>;
-		host-mode = <0>;
-	};
-
-	flash@0x70008000 {
-		compatible = "hynix,HY27UF4G2B", "nand-flash";
-		controller = <&nand>;
-
-		/* How many bytes for data area */
-		page-data-bytes = <2048>;
-
-		/* How many ECC bytes to be generated for tag bytes */
-		tag-ecc-bytes = <4>;
-
-		/* How many tag bytes in spare area */
-		tag-bytes = <20>;
-
-		/* How many ECC bytes for data area */
-		data-ecc-bytes = <36>;
-
-		skipped-spare-bytes = <4>;
-
-		/*
-		 * How many bytes in spare area
-		 * spare area = skipped bytes + ECC bytes of data area
-		 * + tag bytes + ECC bytes of tag bytes
-		 */
-		page-spare-bytes = <64>;
-
-		/*
-		 * MAX_TRP_TREA:
-		 * non-EDO mode: value (in ns) = Max(tRP, tREA) + 6ns
-		 * EDO mode: value (in ns) = tRP timing
-		 *
-		 * Timing values: MAX_TRP_TREA, TWB, Max(tCS, tCH, tALS, tALH),
-		 *	TWHR, Max(tCS, tCH, tALS, tALH), TWH, TWP, TRH, TADL
-		 */
-		timing = <26 100 20 80 20 10 12 10 70>;
-	};
-
-	nand-controller@0x70008000 {
-		status = "ok";
-		wp-gpio = <&gpio 59 3>;		/* PH3 */
-		width = <8>;
-	};
-};