All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Philippe Reynes <philippe.reynes@softathome.com>,
	Marek Vasut <marex@denx.de>, Tom Rini <trini@konsulko.com>,
	Simon Glass <sjg@chromium.org>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Masami Hiramatsu <masami.hiramatsu@linaro.org>,
	Stephen Warren <swarren@nvidia.com>,
	Stephen Warren <swarren@wwwdotorg.org>
Subject: [PATCH 1/2] test/py: Add a way to start sandbox without a device tree
Date: Wed, 27 Apr 2022 13:47:56 -0600	[thread overview]
Message-ID: <20220427194757.90810-1-sjg@chromium.org> (raw)

This is useful sometimes when running a specific test. Add support for it
in the existing restart_uboot_with_flags() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 test/py/u_boot_console_sandbox.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/test/py/u_boot_console_sandbox.py b/test/py/u_boot_console_sandbox.py
index ce4ca7e55ef..b79ec817957 100644
--- a/test/py/u_boot_console_sandbox.py
+++ b/test/py/u_boot_console_sandbox.py
@@ -27,6 +27,7 @@ class ConsoleSandbox(ConsoleBase):
 
         super(ConsoleSandbox, self).__init__(log, config, max_fifo_fill=1024)
         self.sandbox_flags = []
+        self.use_dtb = True
 
     def get_spawn(self):
         """Connect to a fresh U-Boot instance.
@@ -48,16 +49,13 @@ class ConsoleSandbox(ConsoleBase):
         cmd = []
         if self.config.gdbserver:
             cmd += ['gdbserver', self.config.gdbserver]
-        cmd += [
-            self.config.build_dir + fname,
-            '-v',
-            '-d',
-            self.config.dtb
-        ]
+        cmd += [self.config.build_dir + fname, '-v']
+        if self.use_dtb:
+            cmd += ['-d', self.config.dtb]
         cmd += self.sandbox_flags
         return Spawn(cmd, cwd=self.config.source_dir)
 
-    def restart_uboot_with_flags(self, flags, expect_reset=False):
+    def restart_uboot_with_flags(self, flags, expect_reset=False, use_dtb=True):
         """Run U-Boot with the given command-line flags
 
         Args:
@@ -65,6 +63,7 @@ class ConsoleSandbox(ConsoleBase):
             expect_reset: Boolean indication whether this boot is expected
                 to be reset while the 1st boot process after main boot before
                 prompt. False by default.
+            use_dtb: True to use a device tree file, False to run without one
 
         Returns:
             A u_boot_spawn.Spawn object that is attached to U-Boot.
@@ -72,9 +71,11 @@ class ConsoleSandbox(ConsoleBase):
 
         try:
             self.sandbox_flags = flags
+            self.use_dtb = use_dtb
             return self.restart_uboot(expect_reset)
         finally:
             self.sandbox_flags = []
+            self.use_dtb = True
 
     def kill(self, sig):
         """Send a specific Unix signal to the sandbox process.
-- 
2.36.0.464.gb9c8b46e94-goog


             reply	other threads:[~2022-04-27 19:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 19:47 Simon Glass [this message]
2022-04-27 19:47 ` [PATCH 2/2] sandbox: Avoid binman error when run without device tree Simon Glass
2022-05-05 18:53   ` Tom Rini
2022-05-05 18:52 ` [PATCH 1/2] test/py: Add a way to start sandbox without a " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220427194757.90810-1-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=marex@denx.de \
    --cc=masami.hiramatsu@linaro.org \
    --cc=philippe.reynes@softathome.com \
    --cc=swarren@nvidia.com \
    --cc=swarren@wwwdotorg.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.