Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5318EC433EF for ; Wed, 27 Apr 2022 19:48:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0C34E80FF0; Wed, 27 Apr 2022 21:48:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="J9ntsC6z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 43845802EF; Wed, 27 Apr 2022 21:48:14 +0200 (CEST) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8E810810FC for ; Wed, 27 Apr 2022 21:48:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-wm1-x32e.google.com with SMTP id n126-20020a1c2784000000b0038e8af3e788so1825414wmn.1 for ; Wed, 27 Apr 2022 12:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=paJHQQVb12eCqzfYwXCM/q4SvlLDAIrdDUOWOvJUVKI=; b=J9ntsC6zR9KvQtMsgH+o6wmPVodwvfK1ipGUbNJrVEABQFi2VVlhn+XzyEZ5GMkiBA wbgdHD6gihTYzbMzRrrKlw1AcXZxIjlOdJ8h5uhhZnt/RpA1eSzIypym1ART4mgkWznd uWlCZJuXIDc8ovEdc+hR18sJ1UwrfRQ3Q79T0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=paJHQQVb12eCqzfYwXCM/q4SvlLDAIrdDUOWOvJUVKI=; b=YUqsCXRm2CeR8/F658KTyEZ9w6C8QgEsMQnZgCjRLotCXbzXXP+k1ir/FIgXbJbwdp fYM0RUZCee8gssMwqj6m0BhV2gbry7LnQpfBdnVf06hjVVwSzyu5b0SZvGUBvxaVxgBM az3oSMprKQckJKkvzWD0+5WsPZ7YM0I49gBf8RxTSVvIzgVIfyCnshQr8WmM+PDJW0w6 QO1rI044kzQ+LAz2tjNQdReu0mOWr3SNbN1IvoSwWs9yyemS3sm3IeaNcw0P+0a2htVT GiruFAmwSrN3HS6+xcMEZqDrzFJm/XQAXfPRSQVSEi9GLUu03wBCLIjaaGF9yeDEAFI0 utYw== X-Gm-Message-State: AOAM533xPyVx/xwzTn54QVFS5AhcIvlSeOsjTO90Gu5YnnCX3FEn960n MKjwneEcdg4twjSPfMK/TirUVZvK0EN4eg== X-Google-Smtp-Source: ABdhPJzdM0nlEpGImw/1ypR4aY0+T70LshJjUWoLNDbm3IGlUFbkuN5DAlVH2Ot1ACrIKYSCrM5vpA== X-Received: by 2002:a1c:e911:0:b0:38e:6c5d:40e5 with SMTP id q17-20020a1ce911000000b0038e6c5d40e5mr36454542wmc.116.1651088887745; Wed, 27 Apr 2022 12:48:07 -0700 (PDT) Received: from sjg1.roam.corp.google.com (246.45-246-81.adsl-static.isp.belgacom.be. [81.246.45.246]) by smtp.gmail.com with ESMTPSA id d13-20020adfc08d000000b0020ad7b380d3sm10477207wrf.6.2022.04.27.12.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 12:48:06 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Philippe Reynes , Marek Vasut , Tom Rini , Simon Glass , Heinrich Schuchardt , Masami Hiramatsu , Stephen Warren , Stephen Warren 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 Message-Id: <20220427194757.90810-1-sjg@chromium.org> X-Mailer: git-send-email 2.36.0.464.gb9c8b46e94-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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 --- 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