cros_bundle_firmware: Compile source .dts files

Automatically compile .dts files rather than require the caller to
do this manually. This saves some pain in U-Boot (which no longer needs
to do this) and for hard-pressed devs who want to make a quick change to
the device tree and retry.

BUG=chromium-os:19724
TEST=emerge chromeos-bootimage

Change-Id: I436e799ce6056ba9b60c938f8ef6ddddb3284a4b
Reviewed-on: https://gerrit.chromium.org/gerrit/17767
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index 9aeee90..488eb15 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -140,7 +140,7 @@
       raise ValueError('No board defined - please define a board to use')
     build_root = os.path.join('##', 'build', self._board, 'firmware')
     if not self._fdt_fname:
-      self._fdt_fname = os.path.join(build_root, 'dtb', '%s.dtb' %
+      self._fdt_fname = os.path.join(build_root, 'dts', '%s.dts' %
           re.sub('_', '-', self._board))
     if not self.uboot_fname:
       self.uboot_fname = os.path.join(build_root, 'u-boot.bin')
@@ -339,7 +339,7 @@
 
     Args:
       uboot: Path to u-boot.bin (may be chroot-relative)
-      fdt: Fdt object containing the flat device tree.
+      base_fdt: Fdt object containing the flat device tree.
       postload: Path to u-boot-post.bin, or None if none.
 
     Returns:
@@ -506,6 +506,7 @@
     self._fdt_fname = fdt_fname
     self.CheckOptions()
     fdt = Fdt(self._tools, self._fdt_fname)
+    fdt.Compile()
     self.fdt = fdt.Copy(os.path.join(self._tools.outdir, 'updated.dtb'))
     return fdt