bundle_firmware: Update Tegra entries and isolate Exynos a bit

This script seemed to still be using the tegra20.dtsi file, and had
references to tegra20. Currently the only supported tegra platform will
be Nyan which is a Tegra124 platform. Hence update the arch_dts. Also
update the default flashmap name for tegra to nyan.

Also, remove some confusing text about this being a Tegra script.
While it might have started out that way, it is certainly more
general now, and the text was misleading.

Lastly, only some platforms have need of the /iram and /config
nodes. It seems unique to exynos platforms. On other platforms
like Nyan, it simply causes excess warnings. As it was working
without a flashmap, and hence without these nodes already, this
should be fine for Tegra. This does however also block this code path
for coreboot.

BUG=chrome-os-partner:22596
TEST=Verified I can flash nyan platform with u-boot and receive no
warnings.

$ cros_bundle_firmware --board=nyan --write=usb --flash=spi:1 --servo=none \
   --dt=/build/nyan/firmware/dtb/tegra124-venice2.dtb

No warnings displayed, and flash was successful.

Change-Id: I204af8d0b625d597ad8d8637fbfb930617594933
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/181642
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Katie Roberts-Hoffman <katierh@chromium.org>
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index eb4a314..68c6b50 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -2,7 +2,7 @@
 # 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 for a tegra-based board.
+"""This module builds a firmware image.
 
 This modules uses a few rudimentary other libraries for its activity.
 
@@ -61,7 +61,7 @@
 # each area, since there is no guarantee what order the nodes will appear
 # in the fdt, and if they are out of order the image will not boot.
 default_flashmaps = {
-  'tegra' : [
+  'nyan' : [
     {
         'path' : '/flash',
         'reg' : [0, 0x400000],
@@ -246,7 +246,7 @@
     self._out = output
 
     # Set up the things we need to know in order to operate.
-    self._board = None          # Board name, e.g. tegra2_seaboard.
+    self._board = None          # Board name, e.g. nyan.
     self._fdt_fname = None      # Filename of our FDT.
     self._force_rw = None
     self._force_efs = None
@@ -284,7 +284,7 @@
     """Set up files required for Bundle.
 
     Args:
-      board: The name of the board to target (e.g. tegra2_seaboard).
+      board: The name of the board to target (e.g. nyan).
       uboot: The filename of the u-boot.bin image to use.
       bct: The filename of the binary BCT file to use.
       bmpblk: The filename of bitmap block file to use.
@@ -1066,7 +1066,7 @@
     elif self._board == 'daisy':
       arch_dts = 'exynos5250.dtsi'
     else:
-      arch_dts = 'tegra20.dtsi'
+      arch_dts = 'tegra124.dtsi'
 
     fdt.Compile(arch_dts)
     fdt = fdt.Copy(os.path.join(self._tools.outdir, 'updated.dtb'))
@@ -1078,23 +1078,25 @@
     if not fdt.GetProp('/flash', 'reg', ''):
       fdt.InsertNodes(default_flashmap)
 
-    # Insert default values for any essential properties that are missing.
-    # This should only happen for upstream U-Boot, until our changes are
-    # upstreamed.
-    if not fdt.GetProp('/iram', 'reg', ''):
-      self._out.Warning('Cannot find /iram, using default')
-      fdt.InsertNodes([i for i in default_flashmap if i['path'] == '/iram'])
+    # Only check for /iram and /config nodes for boards that require it.
+    if self._board in ('daisy', 'peach'):
+      # Insert default values for any essential properties that are missing.
+      # This should only happen for upstream U-Boot, until our changes are
+      # upstreamed.
+      if not fdt.GetProp('/iram', 'reg', ''):
+        self._out.Warning('Cannot find /iram, using default')
+        fdt.InsertNodes([i for i in default_flashmap if i['path'] == '/iram'])
 
-    # Sadly the pit branch has an invalid /memory node. Work around it for now.
-    # crosbug.com/p/22184
-    if (not fdt.GetProp('/memory', 'reg', '') or
-        fdt.GetIntList('/memory', 'reg')[0] == 0):
-      self._out.Warning('Cannot find /memory, using default')
-      fdt.InsertNodes([i for i in default_flashmap if i['path'] == '/memory'])
+      # Sadly the pit branch has an invalid /memory node. Work around it
+      # for now. crosbug.com/p/22184
+      if (not fdt.GetProp('/memory', 'reg', '') or
+          fdt.GetIntList('/memory', 'reg')[0] == 0):
+        self._out.Warning('Cannot find /memory, using default')
+        fdt.InsertNodes([i for i in default_flashmap if i['path'] == '/memory'])
 
-    if not fdt.GetProp('/config', 'samsung,bl1-offset', ''):
-      self._out.Warning('Missing properties in /config, using defaults')
-      fdt.InsertNodes([i for i in default_flashmap if i['path'] == '/config'])
+      if not fdt.GetProp('/config', 'samsung,bl1-offset', ''):
+        self._out.Warning('Missing properties in /config, using defaults')
+        fdt.InsertNodes([i for i in default_flashmap if i['path'] == '/config'])
 
     # Remember our board type.
     fdt.PutString('/chromeos-config', 'board', self._board)