cros_bundle_firmware: Support arch-specific .dtsi file
Unfortunately, upstream U-Boot does not rely on the new dtc -i option to
specify an include directory. Instead it uses a macro which is expanded
by the build.
To deal with this we need to expand the macro ourselves, but the resulting
value needs to be different for each board. Add support for this so we
can support booting upstream U-Boot on snow, link and tegra.
BUG=chrome-os-partner:13961
BRANCH=none
TEST=manual
Build and boot upstream U-Boot on seaboard, snow and link.
Change-Id: I1d3f861c769f5624889110fab8fddcd1cd7c1efb
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39873
Reviewed-by: Randall Spangler <rspangler@chromium.org>
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index fc582f0..de2584d 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -1083,7 +1083,16 @@
self._fdt_fname = fdt_fname
self.CheckOptions()
fdt = Fdt(self._tools, self._fdt_fname)
- fdt.Compile()
+
+ # For upstream, select the correct architecture .dtsi manually.
+ if self._board == 'link' or 'x86' in self._board:
+ arch_dts = 'coreboot.dtsi'
+ elif self._board == 'daisy':
+ arch_dts = 'exynos5250.dtsi'
+ else:
+ arch_dts = 'tegra20.dtsi'
+
+ fdt.Compile(arch_dts)
self.fdt = fdt.Copy(os.path.join(self._tools.outdir, 'updated.dtb'))
return fdt