From a1e991c12f878c17290ac80761034fbedd608af0 Mon Sep 17 00:00:00 2001
From: Sergei Trofimov <sergei.trofimov@arm.com>
Date: Tue, 15 Dec 2015 16:17:08 +0000
Subject: [PATCH] vexpress-uboot: only set env if bootargs are specified

If env is specified, U-Boot module will wait for U-Boot prompt and then
interrupt the boot sequence so it should be updated. The vexpress module
that used it always set the env to contain bootargs (even if they were
None), always causing boot to be interrupted, even when that is not
necessary. This update means that boot will be interrupted only if
bootargs were specified (and therefore env needs to be updated).
---
 devlib/platform/arm.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/devlib/platform/arm.py b/devlib/platform/arm.py
index cee399d..2f60c56 100644
--- a/devlib/platform/arm.py
+++ b/devlib/platform/arm.py
@@ -145,9 +145,12 @@ class VersatileExpressPlatform(Platform):
                                                          'bootargs': self.bootargs,
                                                          }})
         elif self.bootloader == 'u-boot':
+            uboot_env = None
+            if self.bootargs:
+                uboot_env = {'bootargs': self.bootargs}
             self.modules.append({'vexpress-u-boot': {'port': self.serial_port,
                                                      'baudrate': self.baudrate,
-                                                     'env': {'bootargs': self.bootargs},
+                                                     'env': uboot_env,
                                                      }})
         elif self.bootloader == 'bootmon':
             self.modules.append({'vexpress-bootmon': {'port': self.serial_port,