From patchwork Tue Jun 11 20:01:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946497 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=BEvrRbzB; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKMh4B1Kz20Pb for ; Wed, 12 Jun 2024 06:02:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E186F88700; Tue, 11 Jun 2024 22:02:18 +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="BEvrRbzB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5FE6288700; Tue, 11 Jun 2024 22:02:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 4EF1F883F4 for ; Tue, 11 Jun 2024 22:02:16 +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-il1-x136.google.com with SMTP id e9e14a558f8ab-36ddf683ad7so6722435ab.2 for ; Tue, 11 Jun 2024 13:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136135; x=1718740935; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JQKfsJLU+OUD/kHdy/ujD6mUfsxlx0MiBlMmcB6yFM4=; b=BEvrRbzBz4hqm+sLZXM/AFTi6fCfXe7mHXgPUA4Ar1sEdLKYIBrgubI+EpfElfmDO3 fTKwQkMpK34cx4o1Xak7L/1XA0MZ78v6PXfmYgjHIQpKnW2oxJfUbVKOjVH082Gk4OBX HQlkYr2pC3kTvylD1/epWicszpui2HryOZob4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136135; x=1718740935; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JQKfsJLU+OUD/kHdy/ujD6mUfsxlx0MiBlMmcB6yFM4=; b=sbyyv7Fg3gTQd44pfWWmC4ldzQNUzMLg0GZbEHrRyUVApjlEFPHSs54zvoXfNdqSle aNVyjOREtkBZ0mxbursEDDQ3UISzMUn92uS8uR9nrnQxt2GaCz7ZKvQF/6314LNOysla AEoxGOC+ffE90nMuQArr4fsRq9eo2xyhZ9Skcbyq2au8Cfvo+UzporHNOG3NUS9GVSX5 2RTOUObZzYnVAXpIl8E0MJl67OJP0s85wODJWeKnR1vD2Ji/cYS8fAYiKFvKWDSM+RfS gXmprDTbUPlhEqEB2cIuRE5DL5ySme8CcwhJNUHRJ6CjI9NLj+unG0BoV4/kU7BqC47o 5CIg== X-Gm-Message-State: AOJu0Yz5BIbSvcg4qfWy6XQkegYSAXM6jiiXfz6EQFmjBUjReGg6PPoi 3/r0Yl7xixHYzDQhFgwkeQ3tj36fe2u54qLjmczJg+2Mv6wmz9I0ppM3K73ievxLF643u8j2F29 cmg== X-Google-Smtp-Source: AGHT+IElOikStNXY/FiStZGypyQUhfk9XuX6CmKEd1ZjP5aIN0vjpZj0jFXo6nD9X11/cJ88rl3M4g== X-Received: by 2002:a92:c244:0:b0:374:a176:e26e with SMTP id e9e14a558f8ab-375803a4565mr148355525ab.31.1718136134780; Tue, 11 Jun 2024 13:02:14 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:14 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Sughosh Ganu Subject: [PATCH 01/42] trace: Update test to tolerate different trace-cmd version Date: Tue, 11 Jun 2024 14:01:15 -0600 Message-Id: <20240611200156.2245525-2-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Some versions of trace-cmd (or some machines?) show one less dot in the CPU list. Signed-off-by: Simon Glass --- test/py/tests/test_trace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py index 7c5696ce747..f41d4cf71f0 100644 --- a/test/py/tests/test_trace.py +++ b/test/py/tests/test_trace.py @@ -12,7 +12,7 @@ import u_boot_utils as util TMPDIR = '/tmp/test_trace' # Decode a function-graph line -RE_LINE = re.compile(r'.*0\.\.\.\.\. \s*([0-9.]*): func.*[|](\s*)(\S.*)?([{};])$') +RE_LINE = re.compile(r'.*0\.\.\.\.\.? \s*([0-9.]*): func.*[|](\s*)(\S.*)?([{};])$') def collect_trace(cons): From patchwork Tue Jun 11 20:01:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946498 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=cq5V6EHI; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKMy31vbz20Pb for ; Wed, 12 Jun 2024 06:02:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4A54F88712; Tue, 11 Jun 2024 22:02:21 +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="cq5V6EHI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AA94B8870C; Tue, 11 Jun 2024 22:02:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (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 57FCE8860C for ; Tue, 11 Jun 2024 22:02:17 +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-il1-x130.google.com with SMTP id e9e14a558f8ab-3737b47c0acso25282745ab.3 for ; Tue, 11 Jun 2024 13:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136136; x=1718740936; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oy9j24m9nybV5TvTe9ViOPQMZtEVluxuodA2IBRMin0=; b=cq5V6EHI0n1nkR4jd0LjusNpjj32djIr21+r/86T5ge6ZlSEOuXttVUHEfNVihvSRZ GcHwbEo8VJE/MTmL74ujKtAlNV/b24fD4G6TrL8KNndDjvlwzdAML7iSzMXUnQEwMxnh VxSfCFWPlzAHW2gbz3R6U8Zup/xa2H4eJIN98= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136136; x=1718740936; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oy9j24m9nybV5TvTe9ViOPQMZtEVluxuodA2IBRMin0=; b=NJJG9/cL2JCcI1BroZmiaNDWB59+Tb4kWzGwp2Pf1DqK5tpnfTrWlt/D5WxRZrOaPu x8QYCXQ0JINlMIFyuTwYik/b3pCUxXcewIYWcqpRdl4rMKjl1/X3+Lptdf2Ia9BTe1B1 raWrp0IGPX6M1qiS2NWL+A8GgGuQR3sGz3upzMndm5K+jnljV5Ol0QYeDSSAGvwYaQaR OKcCH5/zJXE/mzpuFUqpdj1dyeQ0eIX39pFku0MK0cljbe1udKTDM5poZrAlAGn5OOrq 4nP0qNy7ZnHfYc7MOiyVbcYfKFCfi9Zw9yCcJjTLpwZyCW26mt8T7SnwNLHfVizQPJFT PBKA== X-Gm-Message-State: AOJu0YyrE9FfQrk1CNH7RAm1QRMU4m+ZdE/TNXtufqy+GuzgLFPnDygi oo3P6SsUF563eHvb38bNgfGGc6snIkT9M6Ab4v51IF3cuHmJxJ1ylSBHJ+SN5czKo2WyK8K8OL/ JMQ== X-Google-Smtp-Source: AGHT+IHWi1q0V6PK2dh3MrJ71rvWsl5dDS/aSHHoofaMZ0yyTJkm5Ewi5kPTxriQVDf8RI7WTJFkZg== X-Received: by 2002:a05:6e02:1a06:b0:375:a0ba:c125 with SMTP id e9e14a558f8ab-375a0bac653mr84631305ab.31.1718136135754; Tue, 11 Jun 2024 13:02:15 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:15 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , Christian Taedcke , Heinrich Schuchardt , Lukas Funke , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier , Sughosh Ganu , Vignesh Raghavendra Subject: [PATCH 02/42] binman: efi: Correct entry docs Date: Tue, 11 Jun 2024 14:01:16 -0600 Message-Id: <20240611200156.2245525-3-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Somehow the class documentation has got out of sync with the generated entries.rst file. Regenerating it causes errors, so correct these and regenerate the entries.rst file. Signed-off-by: Simon Glass Fixes: 809f28e7213 ("binman: capsule: Use dumped capsule header...") --- tools/binman/entries.rst | 58 ++++++++++++------------- tools/binman/etype/efi_capsule.py | 40 ++++++++--------- tools/binman/etype/efi_empty_capsule.py | 22 +++++----- 3 files changed, 61 insertions(+), 59 deletions(-) diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst index 86a3c02b485..531a92e2e0c 100644 --- a/tools/binman/entries.rst +++ b/tools/binman/entries.rst @@ -477,11 +477,11 @@ updating the EC on startup via software sync. .. _etype_efi_capsule: -Entry: capsule: Entry for generating EFI Capsule files ------------------------------------------------------- +Entry: efi-capsule: Generate EFI capsules +----------------------------------------- -The parameters needed for generation of the capsules can be provided -as properties in the entry. +The parameters needed for generation of the capsules can +be provided as properties in the entry. Properties / Entry arguments: - image-index: Unique number for identifying corresponding @@ -502,9 +502,9 @@ Properties / Entry arguments: file. Mandatory property for generating signed capsules. - oem-flags - OEM flags to be passed through capsule header. - Since this is a subclass of Entry_section, all properties of the parent - class also apply here. Except for the properties stated as mandatory, the - rest of the properties are optional. +Since this is a subclass of Entry_section, all properties of the parent +class also apply here. Except for the properties stated as mandatory, the +rest of the properties are optional. For more details on the description of the capsule format, and the capsule update functionality, refer Section 8.5 and Chapter 23 in the `UEFI @@ -517,17 +517,17 @@ provided as a subnode of the capsule entry. A typical capsule entry node would then look something like this:: capsule { - type = "efi-capsule"; - image-index = <0x1>; - /* Image GUID for testing capsule update */ - image-guid = SANDBOX_UBOOT_IMAGE_GUID; - hardware-instance = <0x0>; - private-key = "path/to/the/private/key"; - public-key-cert = "path/to/the/public-key-cert"; - oem-flags = <0x8000>; + type = "efi-capsule"; + image-index = <0x1>; + /* Image GUID for testing capsule update */ + image-guid = SANDBOX_UBOOT_IMAGE_GUID; + hardware-instance = <0x0>; + private-key = "path/to/the/private/key"; + public-key-cert = "path/to/the/public-key-cert"; + oem-flags = <0x8000>; - u-boot { - }; + u-boot { + }; }; In the above example, the capsule payload is the U-Boot image. The @@ -541,8 +541,8 @@ payload using the blob-ext subnode. .. _etype_efi_empty_capsule: -Entry: efi-empty-capsule: Entry for generating EFI Empty Capsule files ----------------------------------------------------------------------- +Entry: efi-empty-capsule: Generate EFI empty capsules +----------------------------------------------------- The parameters needed for generation of the empty capsules can be provided as properties in the entry. @@ -558,22 +558,22 @@ update functionality, refer Section 8.5 and Chapter 23 in the `UEFI specification`_. For more information on the empty capsule, refer the sections 2.3.2 and 2.3.3 in the `Dependable Boot specification`_. -A typical accept empty capsule entry node would then look something -like this:: +A typical accept empty capsule entry node would then look something like +this:: empty-capsule { - type = "efi-empty-capsule"; - /* GUID of the image being accepted */ - image-type-id = SANDBOX_UBOOT_IMAGE_GUID; - capsule-type = "accept"; + type = "efi-empty-capsule"; + /* GUID of image being accepted */ + image-type-id = SANDBOX_UBOOT_IMAGE_GUID; + capsule-type = "accept"; }; -A typical revert empty capsule entry node would then look something -like this:: +A typical revert empty capsule entry node would then look something like +this:: empty-capsule { - type = "efi-empty-capsule"; - capsule-type = "revert"; + type = "efi-empty-capsule"; + capsule-type = "revert"; }; The empty capsules do not have any input payload image. diff --git a/tools/binman/etype/efi_capsule.py b/tools/binman/etype/efi_capsule.py index e3203717822..751f654bf31 100644 --- a/tools/binman/etype/efi_capsule.py +++ b/tools/binman/etype/efi_capsule.py @@ -36,23 +36,23 @@ class Entry_efi_capsule(Entry_section): be provided as properties in the entry. Properties / Entry arguments: - - image-index: Unique number for identifying corresponding - payload image. Number between 1 and descriptor count, i.e. - the total number of firmware images that can be updated. Mandatory - property. - - image-guid: Image GUID which will be used for identifying the - updatable image on the board. Mandatory property. - - hardware-instance: Optional number for identifying unique - hardware instance of a device in the system. Default value of 0 - for images where value is not to be used. - - fw-version: Value of image version that can be put on the capsule - through the Firmware Management Protocol(FMP) header. - - monotonic-count: Count used when signing an image. - - private-key: Path to PEM formatted .key private key file. Mandatory - property for generating signed capsules. - - public-key-cert: Path to PEM formatted .crt public key certificate - file. Mandatory property for generating signed capsules. - - oem-flags - OEM flags to be passed through capsule header. + - image-index: Unique number for identifying corresponding + payload image. Number between 1 and descriptor count, i.e. + the total number of firmware images that can be updated. Mandatory + property. + - image-guid: Image GUID which will be used for identifying the + updatable image on the board. Mandatory property. + - hardware-instance: Optional number for identifying unique + hardware instance of a device in the system. Default value of 0 + for images where value is not to be used. + - fw-version: Value of image version that can be put on the capsule + through the Firmware Management Protocol(FMP) header. + - monotonic-count: Count used when signing an image. + - private-key: Path to PEM formatted .key private key file. Mandatory + property for generating signed capsules. + - public-key-cert: Path to PEM formatted .crt public key certificate + file. Mandatory property for generating signed capsules. + - oem-flags - OEM flags to be passed through capsule header. Since this is a subclass of Entry_section, all properties of the parent class also apply here. Except for the properties stated as mandatory, the @@ -66,9 +66,9 @@ class Entry_efi_capsule(Entry_section): properties in the entry. The payload to be used in the capsule is to be provided as a subnode of the capsule entry. - A typical capsule entry node would then look something like this + A typical capsule entry node would then look something like this:: - capsule { + capsule { type = "efi-capsule"; image-index = <0x1>; /* Image GUID for testing capsule update */ @@ -80,7 +80,7 @@ class Entry_efi_capsule(Entry_section): u-boot { }; - }; + }; In the above example, the capsule payload is the U-Boot image. The capsule entry would read the contents of the payload and put them diff --git a/tools/binman/etype/efi_empty_capsule.py b/tools/binman/etype/efi_empty_capsule.py index 064bf9a77f0..1d99fbfb3bb 100644 --- a/tools/binman/etype/efi_empty_capsule.py +++ b/tools/binman/etype/efi_empty_capsule.py @@ -19,31 +19,33 @@ class Entry_efi_empty_capsule(Entry_section): be provided as properties in the entry. Properties / Entry arguments: - - image-guid: Image GUID which will be used for identifying the - updatable image on the board. Mandatory for accept capsule. - - capsule-type - String to indicate type of capsule to generate. Valid - values are 'accept' and 'revert'. + - image-guid: Image GUID which will be used for identifying the + updatable image on the board. Mandatory for accept capsule. + - capsule-type - String to indicate type of capsule to generate. Valid + values are 'accept' and 'revert'. For more details on the description of the capsule format, and the capsule update functionality, refer Section 8.5 and Chapter 23 in the `UEFI specification`_. For more information on the empty capsule, refer the sections 2.3.2 and 2.3.3 in the `Dependable Boot specification`_. - A typical accept empty capsule entry node would then look something like this + A typical accept empty capsule entry node would then look something like + this:: - empty-capsule { + empty-capsule { type = "efi-empty-capsule"; /* GUID of image being accepted */ image-type-id = SANDBOX_UBOOT_IMAGE_GUID; capsule-type = "accept"; - }; + }; - A typical revert empty capsule entry node would then look something like this + A typical revert empty capsule entry node would then look something like + this:: - empty-capsule { + empty-capsule { type = "efi-empty-capsule"; capsule-type = "revert"; - }; + }; The empty capsules do not have any input payload image. From patchwork Tue Jun 11 20:01:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946499 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ZZdd7Dck; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKN55q2sz20Pb for ; Wed, 12 Jun 2024 06:02:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AA7D088719; Tue, 11 Jun 2024 22:02:21 +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="ZZdd7Dck"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 51FCF886AE; Tue, 11 Jun 2024 22:02:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 2ABB3886DA for ; Tue, 11 Jun 2024 22:02:18 +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-il1-x12c.google.com with SMTP id e9e14a558f8ab-375b2fe7003so6751535ab.1 for ; Tue, 11 Jun 2024 13:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136137; x=1718740937; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HNy79vFX3GihHub247LitC8y+80SEFlHKgr0PfQRDQI=; b=ZZdd7Dckp1KpZDFgOuACgBEE5AGax4MxCPU4cksACVh3aHMpfgIz6DpI+bhqyHFEs1 3US1qkozcSYGZC3Kr1I4fcAHQzrmdBewNofd0/IDwdKbpDF0TnGPomdd+7lzTFdaRv8i oY8BS3/JhIEkC1muHHMZ+ET0yGIWgjgaIOE00= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136137; x=1718740937; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HNy79vFX3GihHub247LitC8y+80SEFlHKgr0PfQRDQI=; b=mxJWQGrAJXV+SA8EHLBAAj//+ldKNT3F/Qd2rg1oIQSWOaokcts0JX+N3Sxbdzhq0u l4UTjrr5cF35EKPj85cQ4U2EDbWFiPBx32yfXvLcvylA8G4GJHqJWFImUHFTj0C+/sAm cC/I9meTWLf84jZDOdzhFT6YmmZM2b2oM8sr0y8QAj720htikip4MMwgYIO6wQQNno1C EUQW2AUjEEuoSI/s3j8Cfucfl8hHdGwz7SQ0jxF2irc7BK5ftFFZWKx7DycpcLPs3AVC 1En/uF1Dgp5Y5+29VzWq0vGIacUe6BUgD86B9K0hsYw6ca4Hlv9UwZsntUYepuZCCjSH vn5w== X-Gm-Message-State: AOJu0YzBHhptlD+SURIQ+MtQJKWaKpJSIeo7eFvkxrrH0sfQvedOcJV1 JF24JxzWx/brNG77MpWTY7Xzv5syBv0PJziHpE9sVbhoha7g7KxxnGyvv3r0BGDLbhBg/amaw8W PyQ== X-Google-Smtp-Source: AGHT+IEiM6pht5MH2kMNlUTzz/a2Etxhr8GtufZSKlgd0FERnwFu0hBhl50Pg/js3dwhKIiCxqDA/g== X-Received: by 2002:a05:6e02:13a7:b0:374:593f:914a with SMTP id e9e14a558f8ab-3758030b7b0mr168990835ab.4.1718136136738; Tue, 11 Jun 2024 13:02:16 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:16 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , Andrew Davis , Christian Taedcke , Heinrich Schuchardt , Lukas Funke , Marek Vasut , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier , Sughosh Ganu Subject: [PATCH 03/42] binman: Regenerate nxp docs Date: Tue, 11 Jun 2024 14:01:17 -0600 Message-Id: <20240611200156.2245525-4-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Regenerate the entries.rst file to include this recent addition. Note that more docs are needed here, to actually describe the entry type. Note also that the entry type needs Binman tests added. Signed-off-by: Simon Glass --- tools/binman/entries.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst index 531a92e2e0c..ecccf77d112 100644 --- a/tools/binman/entries.rst +++ b/tools/binman/entries.rst @@ -1528,6 +1528,28 @@ byte. +.. _etype_nxp_imx8mcst: + +Entry: nxp-imx8mcst: NXP i.MX8M CST .cfg file generator and cst invoker +----------------------------------------------------------------------- + +Properties / Entry arguments: + - nxp,loader-address - loader address (SPL text base) + + + +.. _etype_nxp_imx8mimage: + +Entry: nxp-imx8mimage: NXP i.MX8M imx8mimage .cfg file generator and mkimage invoker +------------------------------------------------------------------------------------ + +Properties / Entry arguments: + - nxp,boot-from - device to boot from (e.g. 'sd') + - nxp,loader-address - loader address (SPL text base) + - nxp,rom-version - BootROM version ('2' for i.MX8M Nano and Plus) + + + .. _etype_opensbi: Entry: opensbi: RISC-V OpenSBI fw_dynamic blob From patchwork Tue Jun 11 20:01:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946500 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=SAvMfsoe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKNL0G9rz20Pb for ; Wed, 12 Jun 2024 06:02:58 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1E6BE8872B; Tue, 11 Jun 2024 22:02:24 +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="SAvMfsoe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 61F8A88715; Tue, 11 Jun 2024 22:02:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 20BB688707 for ; Tue, 11 Jun 2024 22:02:19 +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-il1-x135.google.com with SMTP id e9e14a558f8ab-371c97913cdso24384945ab.3 for ; Tue, 11 Jun 2024 13:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136138; x=1718740938; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E8nnk5jWdK3zZ581gHeC46n7Pfv/XYLITCis/5YnFTE=; b=SAvMfsoe8Ac80U6nL9c4gpq/lQz77jm2gdL4ts5OZPQbP8QxIUqIdRm18Wdx2uR1/5 KYx8N5sTXUejKslTySfIGsbeVixdJ8wtRYCtLOSTU6vmNyM/0mEvBDrUxCh5slpN4I/Y mWpo26Gdw4qLJNkQDtoFchVqBFIA1PW1flqWc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136138; x=1718740938; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E8nnk5jWdK3zZ581gHeC46n7Pfv/XYLITCis/5YnFTE=; b=q8t3d1llYbusJE1KIJ+9FlvLVeybxYhHRDBCjQHCtmuQ8PN7paVvjot47Qy0CPFX5I 7dEjBCa7cgfYrFBMGWSo10DbX7FvUk+ZiFI3zpDQdlIFOh4rmL7ltJwhG92uQA/5rmQu zYbGhXcW9sb487q9I3mSf6wmcj7iFuSrHfoHM93BWESKk8MStxDtbZ69zUQYLehO1E8b hPB6JbV9Afi7YuR4T8ZBX24GujICjgrN4i8lXS+Ljk9jFulOPCgMT1xAq9rxOyR6U1FU z3NBKPyMcyg1sampicfrSdGWgStRxqI0PiuzBlSEweUtWbS7ka8qs0kuuxg6uiczgqC8 Djdg== X-Gm-Message-State: AOJu0YwqZcXGY3N+bjly1JaGtKMmPeMrexkA0VPfc/pfkMuJq/qNoGv9 2B7YeytQIEvtBniQNQE0isju9vMDJWyaRTrmQU1QP9vBiBhxrYP/F2sX0IThUQhmwv0CXFu7m2A BYg== X-Google-Smtp-Source: AGHT+IGOH6jX5317ACskWsO4dciHGtiKiXoIm++DfN94JWBjziiPrTq613jo09ki9vgA4i0acVEt8w== X-Received: by 2002:a92:cdae:0:b0:375:adcd:e6db with SMTP id e9e14a558f8ab-375adcde918mr51905065ab.9.1718136137764; Tue, 11 Jun 2024 13:02:17 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:17 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , Christian Taedcke , Heinrich Schuchardt , Lukas Funke , Manorit Chawdhry , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier , Sughosh Ganu , Vignesh Raghavendra Subject: [PATCH 04/42] binman: ti: Regenerate entry docs Date: Tue, 11 Jun 2024 14:01:18 -0600 Message-Id: <20240611200156.2245525-5-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Correct formatting errors in the documentation. Regenerate the entries.rst file to include this recent addition. Signed-off-by: Simon Glass --- tools/binman/entries.rst | 35 +++++++++++++++++++++++++ tools/binman/etype/ti_secure.py | 45 +++++++++++++++++---------------- 2 files changed, 58 insertions(+), 22 deletions(-) diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst index ecccf77d112..f59c0341840 100644 --- a/tools/binman/entries.rst +++ b/tools/binman/entries.rst @@ -1958,6 +1958,12 @@ Properties / Entry arguments: - content: List of phandles to entries to sign - keyfile: Filename of file containing key to sign binary with - sha: Hash function to be used for signing + - auth-in-place: This is an integer field that contains two pieces + of information: + + - Lower Byte - Remains 0x02 as per our use case + ( 0x02: Move the authenticated binary back to the header ) + - Upper Byte - The Host ID of the core owning the firewall Output files: - input. - input file passed to openssl @@ -1966,6 +1972,35 @@ Output files: - cert. - output file generated by openssl (which is used as the entry contents) +Depending on auth-in-place information in the inputs, we read the +firewall nodes that describe the configurations of firewall that TIFS +will be doing after reading the certificate. + +The syntax of the firewall nodes are as such:: + + firewall-257-0 { + id = <257>; /* The ID of the firewall being configured */ + region = <0>; /* Region number to configure */ + + control = /* The control register */ + <(FWCTRL_EN | FWCTRL_LOCK | FWCTRL_BG | FWCTRL_CACHE)>; + + permissions = /* The permission registers */ + <((FWPRIVID_ALL << FWPRIVID_SHIFT) | + FWPERM_SECURE_PRIV_RWCD | + FWPERM_SECURE_USER_RWCD | + FWPERM_NON_SECURE_PRIV_RWCD | + FWPERM_NON_SECURE_USER_RWCD)>; + + /* More defines can be found in k3-security.h */ + + start_address = /* The Start Address of the firewall */ + <0x0 0x0>; + end_address = /* The End Address of the firewall */ + <0xff 0xffffffff>; + }; + + openssl signs the provided data, using the TI templated config file and writes the signature in this entry. This allows verification that the data is genuine. diff --git a/tools/binman/etype/ti_secure.py b/tools/binman/etype/ti_secure.py index 704dcf8a381..420ee263e4f 100644 --- a/tools/binman/etype/ti_secure.py +++ b/tools/binman/etype/ti_secure.py @@ -53,10 +53,11 @@ class Entry_ti_secure(Entry_x509_cert): - keyfile: Filename of file containing key to sign binary with - sha: Hash function to be used for signing - auth-in-place: This is an integer field that contains two pieces - of information - Lower Byte - Remains 0x02 as per our use case - ( 0x02: Move the authenticated binary back to the header ) - Upper Byte - The Host ID of the core owning the firewall + of information: + + - Lower Byte - Remains 0x02 as per our use case + ( 0x02: Move the authenticated binary back to the header ) + - Upper Byte - The Host ID of the core owning the firewall Output files: - input. - input file passed to openssl @@ -69,29 +70,29 @@ class Entry_ti_secure(Entry_x509_cert): firewall nodes that describe the configurations of firewall that TIFS will be doing after reading the certificate. - The syntax of the firewall nodes are as such: + The syntax of the firewall nodes are as such:: - firewall-257-0 { - id = <257>; /* The ID of the firewall being configured */ - region = <0>; /* Region number to configure */ + firewall-257-0 { + id = <257>; /* The ID of the firewall being configured */ + region = <0>; /* Region number to configure */ - control = /* The control register */ - <(FWCTRL_EN | FWCTRL_LOCK | FWCTRL_BG | FWCTRL_CACHE)>; + control = /* The control register */ + <(FWCTRL_EN | FWCTRL_LOCK | FWCTRL_BG | FWCTRL_CACHE)>; - permissions = /* The permission registers */ - <((FWPRIVID_ALL << FWPRIVID_SHIFT) | - FWPERM_SECURE_PRIV_RWCD | - FWPERM_SECURE_USER_RWCD | - FWPERM_NON_SECURE_PRIV_RWCD | - FWPERM_NON_SECURE_USER_RWCD)>; + permissions = /* The permission registers */ + <((FWPRIVID_ALL << FWPRIVID_SHIFT) | + FWPERM_SECURE_PRIV_RWCD | + FWPERM_SECURE_USER_RWCD | + FWPERM_NON_SECURE_PRIV_RWCD | + FWPERM_NON_SECURE_USER_RWCD)>; - /* More defines can be found in k3-security.h */ + /* More defines can be found in k3-security.h */ - start_address = /* The Start Address of the firewall */ - <0x0 0x0>; - end_address = /* The End Address of the firewall */ - <0xff 0xffffffff>; - }; + start_address = /* The Start Address of the firewall */ + <0x0 0x0>; + end_address = /* The End Address of the firewall */ + <0xff 0xffffffff>; + }; openssl signs the provided data, using the TI templated config file and From patchwork Tue Jun 11 20:01:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946501 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=iy6utdNU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKNb02dxz20Pb for ; Wed, 12 Jun 2024 06:03:11 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7B10588746; Tue, 11 Jun 2024 22:02:24 +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="iy6utdNU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B1678872D; Tue, 11 Jun 2024 22:02:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 F310388617 for ; Tue, 11 Jun 2024 22:02:19 +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-il1-x131.google.com with SMTP id e9e14a558f8ab-3747e9f7cceso25102035ab.1 for ; Tue, 11 Jun 2024 13:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136138; x=1718740938; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FA+FlwdkRSMhQxY2MZH+AxkvYhCzQLUcdRiqc88p2+4=; b=iy6utdNUXZxhrgs/+6ldj3SBjY1bjtT0e9iuIpKU1jOsgts8U5tACCYan64neVu1Y1 3ZgYF6KtHoWOw83NHzrKu434R+tuEWwtU2agpolQjd8NE/CldxqBru3OdHGAcr/BdcxW pYLAFn0PAagMXvzK611PGDxB7plPQ6CSht2h0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136138; x=1718740938; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FA+FlwdkRSMhQxY2MZH+AxkvYhCzQLUcdRiqc88p2+4=; b=MJblJNGJV5P2x0cldQi5a8ygXG6CpL7XH3Cgrd7W6ORP5B4Q7wNjIAiMhgmg+vAa3h HwbKtNhlh/K/jjzds4MI+ggYAVE2B6lC4jVrzEjOO+9rhdQoTDAYW6NsZD32gJM33qtD Ssf6BlCI8Kge8xcQoBgV2tDmwg0GiCV58AUvd5KGhhSi2Ig6ciMhaeVQW0GLC1/g6wi1 ZUF9s00moveYz+inl+cwOSNbGJtMUlkS3PLEEic+vOOHApwbSqqxIg+buKscbPdtNDfh 5oh6ZDUVtkd2RbEPlINWwHbMyssh51Q2MTK7fu1DEWtjkkcmR6QC2PCEK3MQBOhaswa6 3+zA== X-Gm-Message-State: AOJu0YyfVJq+frlNx/ObPEgU+52iYWcbPzaSHVXdLTD8dudt7mFobYUH B0o5tzgkvkoIvyMg3pvPIlYWP6QSRLmTCtg9kdIggDZNIcTfxTKXKZf/8XiosGaNpj8ER6npV1Z z4Q== X-Google-Smtp-Source: AGHT+IGyU95wmmrDVxHAfdhLwtFRnCa6WH/As/Sj4TqoJGOHLpfWoLlTFFN7OQ+VRzbk1U1ioABm1A== X-Received: by 2002:a05:6e02:216a:b0:374:9b99:752a with SMTP id e9e14a558f8ab-3758033c3dfmr168048415ab.14.1718136138620; Tue, 11 Jun 2024 13:02:18 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:18 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , Marek Vasut , Neha Malcom Francis , Peng Fan , Philippe Reynes , Stefan Herbrechtsmeier , Sughosh Ganu Subject: [PATCH 05/42] binman: Update the entrydocs header Date: Tue, 11 Jun 2024 14:01:19 -0600 Message-Id: <20240611200156.2245525-6-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Reduce the length of the underline for this header, to match the heading itself. Signed-off-by: Simon Glass --- tools/binman/entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 42e0b7b9145..2ed65800d22 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -812,7 +812,7 @@ class Entry(object): as missing """ print('''Binman Entry Documentation -=========================== +========================== This file describes the entry types supported by binman. These entry types can be placed in an image one by one to build up a final firmware image. It is From patchwork Tue Jun 11 20:01:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946502 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ZU4rBQyu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKNp02Ywz20Pb for ; Wed, 12 Jun 2024 06:03:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D77A888753; Tue, 11 Jun 2024 22:02:24 +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="ZU4rBQyu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFB7A8870E; Tue, 11 Jun 2024 22:02:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 A8759883F4 for ; Tue, 11 Jun 2024 22:02:20 +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-il1-x12b.google.com with SMTP id e9e14a558f8ab-37597eba356so14069495ab.2 for ; Tue, 11 Jun 2024 13:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136139; x=1718740939; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oksFfmSkHnmY059/50YjczK0o27dkuCx4uuoJ73RzBM=; b=ZU4rBQyuFBWv4B/hulcKlGEXRcwubpKeDPPOHb43QOpk1qa/W+OYp0fPLVksStDx2x AzyllYNe7QpkFxGW0/LqrNENhYFiIQe6X192TtlH4lz0jiJryWxF3zILAHoHh7aJsFFZ iD6tenu9+AdKxepxPgAzgiPZy13FLVAj+6/JE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136139; x=1718740939; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oksFfmSkHnmY059/50YjczK0o27dkuCx4uuoJ73RzBM=; b=E1MIEDNayywSgyngoc23lWmX4zrYV79KuejzTbuhRzaYlYnMlnp8YLBTITiSTAyBQr rWSClntiP0H1n/EtCrn2twNtl+xe6dh3OvoV4WUQaiIa+sYBw1/ZAa4qSTX5SUmt92ps VwVDFXLJ+26LqdKQAxENSjisf02eNNQxlhDRvocGiiu750KvDXEAQIPd5iJS+ET+ygn2 1OumR8N+FaXuzirKg708rBMqi8lqwFFUuNafadGlHIXk8nodIya7UJc1wn1YpL6Dn3Iu AfL/66zcjuv1nLdDe4YSvTP+ovaSZWxlMAAJ/keT37+iqtKkA+0wY8TFKN+rYhAlbAuc OMMA== X-Gm-Message-State: AOJu0YzzX21exhI/4KdHVvxzB6y/3UFYvpnZSFr61t9UVlZwG8S6E2qv C5CiEeDPX41PMCVM852FtQzwMQELyUZfH4wLyl5DRDwk6pPmbbz26Foi6lcKlmZfWZxX+wqLjn8 IAw== X-Google-Smtp-Source: AGHT+IEU1Yri1JoKNIGiDe93RMOLMH1vbtspqz7VMU/PuReijlcKyohnGEwZJYsCmJJaUOp2couL6A== X-Received: by 2002:a05:6e02:1908:b0:374:ada1:296b with SMTP id e9e14a558f8ab-3758032247emr160883225ab.8.1718136139294; Tue, 11 Jun 2024 13:02:19 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 06/42] buildman: Make mrproper an argument to _reconfigure() Date: Tue, 11 Jun 2024 14:01:20 -0600 Message-Id: <20240611200156.2245525-7-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Pass this in so the caller can change it independently of the member variable. Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index a8599c0bb2a..5d4426bf0d1 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -240,7 +240,7 @@ class BuilderThread(threading.Thread): return args, cwd, src_dir def _reconfigure(self, commit, brd, cwd, args, env, config_args, config_out, - cmd_list): + cmd_list, mrproper): """Reconfigure the build Args: @@ -251,11 +251,12 @@ class BuilderThread(threading.Thread): env (dict): Environment strings config_args (list of str): defconfig arg for this board cmd_list (list of str): List to add the commands to, for logging + mrproper (bool): True to run mrproper first Returns: CommandResult object """ - if self.mrproper: + if mrproper: result = self.make(commit, brd, 'mrproper', cwd, 'mrproper', *args, env=env) config_out.write(result.combined) @@ -419,7 +420,8 @@ class BuilderThread(threading.Thread): cmd_list = [] if do_config or adjust_cfg: result = self._reconfigure( - commit, brd, cwd, args, env, config_args, config_out, cmd_list) + commit, brd, cwd, args, env, config_args, config_out, cmd_list, + self.mrproper) do_config = False # No need to configure next time if adjust_cfg: cfgutil.adjust_cfg_file(cfg_file, adjust_cfg) From patchwork Tue Jun 11 20:01:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946503 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CbzTJ8Vx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKP1060pz20Pb for ; Wed, 12 Jun 2024 06:03:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3D7E68875B; Tue, 11 Jun 2024 22:02:25 +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="CbzTJ8Vx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B8F838873A; Tue, 11 Jun 2024 22:02:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (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 9846688715 for ; Tue, 11 Jun 2024 22:02:21 +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-il1-x132.google.com with SMTP id e9e14a558f8ab-3737b47c0acso25283135ab.3 for ; Tue, 11 Jun 2024 13:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136140; x=1718740940; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wQWCHAppkaPnl6ePnNncon/+GhSpdXUItRx1/sMowC4=; b=CbzTJ8VxwyoluOt+i/HoecZncKe3D2oqNrGQVQc27N5YFVq1S02/dg9+ZFT/3NPocJ vc6c5s8W+UieJV9Z0DaKLDADSPfNttIeuHwP7EHCwp1xJonbRGk/4Sr3603L3QQLIUPn qKHJjd40Pm3lYX8WHEElzcQI5hyD/Keo0Jodg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136140; x=1718740940; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wQWCHAppkaPnl6ePnNncon/+GhSpdXUItRx1/sMowC4=; b=s2Inbz0Ns6DSwuAZHRYHXcv3ZHpHcdJreALLcfODL8I9jwah5AY8MykewkxD7g3kht jQ+H9bqrngcVNUXanmv/lhKjn2u08ipzpXpzNBi5Ct/N1P/Y/ZErN24BensjZJFRtPZT vTEUyedc3PDTx5Kf+BMZDPih+CU1La2yrW3GcPHXSnZ2KHsQiB1P7xh9SNKsH6qOyLIn wnqALfe6pe1pFZ/QaF+XrTQNAALhH+coZIppYMxppVz87zaZw+yFgfm+ut5IuUl768O5 nRbu15p92B8wRA3Vf696lT4YFQimT2LomWwB/uZXCkB/95f95k09ki30hctb/usdK4UY ZuEQ== X-Gm-Message-State: AOJu0YzLw8mkeDAJvHGnoUHL0GfTahA2R2n8/k//KidJZPiIKQeSwbKg pTZaA8l0q1AEThu5R2e4Bp/29x0wizpGoTBVlrjwVteCalKoWjdMiWe+KnlYEZps5veVBorFPs0 QQg== X-Google-Smtp-Source: AGHT+IEQUIJ0/jGIqwgPAE/HO+sExkPdP5sh2UPir+1dbIJX+nByD0JhiMpvn2PnE6PfJ5sv8zObVw== X-Received: by 2002:a05:6e02:1448:b0:374:ad1d:941a with SMTP id e9e14a558f8ab-37580312f34mr182421815ab.10.1718136140091; Tue, 11 Jun 2024 13:02:20 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 07/42] buildman: Make mrproper an argument to _config_and_build() Date: Tue, 11 Jun 2024 14:01:21 -0600 Message-Id: <20240611200156.2245525-8-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Pass this in so the caller can change it independently of the member variable. Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 5d4426bf0d1..ff63f9397e6 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -381,7 +381,7 @@ class BuilderThread(threading.Thread): commit = 'current' return commit - def _config_and_build(self, commit_upto, brd, work_dir, do_config, + def _config_and_build(self, commit_upto, brd, work_dir, do_config, mrproper, config_only, adjust_cfg, commit, out_dir, out_rel_dir, result): """Do the build, configuring first if necessary @@ -391,6 +391,7 @@ class BuilderThread(threading.Thread): brd (Board): Board to create arguments for work_dir (str): Directory to which the source will be checked out do_config (bool): True to run a make _defconfig on the source + mrproper (bool): True to run mrproper first config_only (bool): Only configure the source, do not build it adjust_cfg (list of str): See the cfgutil module and run_commit() commit (Commit): Commit only being built @@ -421,7 +422,7 @@ class BuilderThread(threading.Thread): if do_config or adjust_cfg: result = self._reconfigure( commit, brd, cwd, args, env, config_args, config_out, cmd_list, - self.mrproper) + mrproper) do_config = False # No need to configure next time if adjust_cfg: cfgutil.adjust_cfg_file(cfg_file, adjust_cfg) @@ -500,8 +501,9 @@ class BuilderThread(threading.Thread): if self.toolchain: commit = self._checkout(commit_upto, work_dir) result, do_config = self._config_and_build( - commit_upto, brd, work_dir, do_config, config_only, - adjust_cfg, commit, out_dir, out_rel_dir, result) + commit_upto, brd, work_dir, do_config, self.mrproper, + config_only, adjust_cfg, commit, out_dir, out_rel_dir, + result) result.already_done = False result.toolchain = self.toolchain From patchwork Tue Jun 11 20:01:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946504 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=l5HDZNiD; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKPC4g6Tz20Pb for ; Wed, 12 Jun 2024 06:03:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 96D248872D; Tue, 11 Jun 2024 22:02:25 +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="l5HDZNiD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4066688717; Tue, 11 Jun 2024 22:02:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 12F2B8870C for ; Tue, 11 Jun 2024 22:02:22 +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-il1-x135.google.com with SMTP id e9e14a558f8ab-375932c953aso18234475ab.0 for ; Tue, 11 Jun 2024 13:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136141; x=1718740941; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TilowMtmIbLEJX6Ew7pKKH3SkTzbW9M9g59F5fRsUic=; b=l5HDZNiDAh2D+Q/xT2ei5W2K3ab3dhepqEKDJ4Bd3Dio/LHLTlDgvXgGVgJsI/afmT HwHGtZsdG2GkKDC6A/5OGHEUJB8+m39GljKJVjRi8Sfao2m2oGag7P8FZnzYLxNfmn5M Aw2EsgZpa2zf0B8MQ0sP+GDA54Mrel4qpiDqw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136141; x=1718740941; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TilowMtmIbLEJX6Ew7pKKH3SkTzbW9M9g59F5fRsUic=; b=b3Jruyjoc36sBnX1uYst3XSpnx+mGO9fkEK3BPCqKA5hn0H35EMy4TD3jFrrA+xesK Y1fPsb4XwoSs5UQ4awnckX6gQGAAdVvBlp3ki81Mjc6DhM2Oq14lvaYifU82H3Jb1c33 l1mRDsQfVTOKQfuidzWNjCylfEixPsEspGbWAbjImNJtdS0Ztfx/9cxqVHkUxuVCyoP0 zkITzBWroF9Hf1VsAr0NsXBBN+ATVSpgZGRv+vd2efHOi3QjPQ0Ed8vcAhGye7YWdaE0 zywNyROlOkKqCaF34f0mgpS6AtMumNgP6kseEPU1lKXOsiG0wMwWem94LxgYn4faGqWk pxkg== X-Gm-Message-State: AOJu0Yw7Cr5hJX9HgziBBqngiQrgRbcVgRzUdy/f/Tk0cyF9TLV+OEa5 cpqt9PZfvcm79JkG/qvx8aZlXu5G983Oiypa13B/YToCt9BIVh2saNWVCg/WY/uMFABOmrEc/d8 bFw== X-Google-Smtp-Source: AGHT+IGrckJRZ6XF5eaC33sPEjbs+Tyv8nVPPZynJEJ9hGsewxTnmhVfvDPPV2kYAR45Emp7ZHiOMg== X-Received: by 2002:a05:6e02:216f:b0:375:9828:ae0 with SMTP id e9e14a558f8ab-3759828119bmr109714305ab.24.1718136140802; Tue, 11 Jun 2024 13:02:20 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 08/42] buildman: Make mrproper an argument to run_commit() Date: Tue, 11 Jun 2024 14:01:22 -0600 Message-Id: <20240611200156.2245525-9-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Pass this in so the caller can change it independently of the member variable. Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index ff63f9397e6..0a7ff2e083e 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -448,9 +448,9 @@ class BuilderThread(threading.Thread): result.cmd_list = cmd_list return result, do_config - def run_commit(self, commit_upto, brd, work_dir, do_config, config_only, - force_build, force_build_failures, work_in_output, - adjust_cfg): + def run_commit(self, commit_upto, brd, work_dir, do_config, mrproper, + config_only, force_build, force_build_failures, + work_in_output, adjust_cfg): """Build a particular commit. If the build is already done, and we are not forcing a build, we skip @@ -461,6 +461,7 @@ class BuilderThread(threading.Thread): brd (Board): Board to build work_dir (str): Directory to which the source will be checked out do_config (bool): True to run a make _defconfig on the source + mrproper (bool): True to run mrproper first config_only (bool): Only configure the source, do not build it force_build (bool): Force a build even if one was previously done force_build_failures (bool): Force a bulid if the previous result @@ -501,7 +502,7 @@ class BuilderThread(threading.Thread): if self.toolchain: commit = self._checkout(commit_upto, work_dir) result, do_config = self._config_and_build( - commit_upto, brd, work_dir, do_config, self.mrproper, + commit_upto, brd, work_dir, do_config, mrproper, config_only, adjust_cfg, commit, out_dir, out_rel_dir, result) result.already_done = False @@ -692,7 +693,8 @@ class BuilderThread(threading.Thread): force_build = False for commit_upto in range(0, len(job.commits), job.step): result, request_config = self.run_commit(commit_upto, brd, - work_dir, do_config, self.builder.config_only, + work_dir, do_config, self.mrproper, + self.builder.config_only, force_build or self.builder.force_build, self.builder.force_build_failures, job.work_in_output, job.adjust_cfg) @@ -703,8 +705,8 @@ class BuilderThread(threading.Thread): # with a reconfig. if self.builder.force_config_on_failure: result, request_config = self.run_commit(commit_upto, - brd, work_dir, True, False, True, False, - job.work_in_output, job.adjust_cfg) + brd, work_dir, True, self.mrproper, False, True, + False, job.work_in_output, job.adjust_cfg) did_config = True if not self.builder.force_reconfig: do_config = request_config @@ -748,7 +750,7 @@ class BuilderThread(threading.Thread): else: # Just build the currently checked-out build result, request_config = self.run_commit(None, brd, work_dir, True, - self.builder.config_only, True, + self.mrproper, self.builder.config_only, True, self.builder.force_build_failures, job.work_in_output, job.adjust_cfg) result.commit_upto = 0 From patchwork Tue Jun 11 20:01:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946505 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=cuFMjDUl; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKPQ3Bmzz20Pb for ; Wed, 12 Jun 2024 06:03:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF56F8877E; Tue, 11 Jun 2024 22:02:25 +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="cuFMjDUl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D888688755; Tue, 11 Jun 2024 22:02:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 CA469883F4 for ; Tue, 11 Jun 2024 22:02:22 +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-il1-x12b.google.com with SMTP id e9e14a558f8ab-36dd6110186so6676775ab.0 for ; Tue, 11 Jun 2024 13:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136141; x=1718740941; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TJatQ67wLsUKufFx8+ZIAVVElx7A/F8+oG5u3y8kT7g=; b=cuFMjDUlcdT11GVJyfTsCQUk005JNmEfzDpX+k2XXvyTe4qRrgakh/867XG77GZvbZ fWFWdT0E6EsDPT/waOAxSrS2jETH6wbyz/yMDzlWTzApy2xZ1jcuNFlPFZXj+lQ+haoJ cNHWH10m4hG1p7vyhtdh31OPrbouPus7sWPTY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136141; x=1718740941; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TJatQ67wLsUKufFx8+ZIAVVElx7A/F8+oG5u3y8kT7g=; b=g0JGxNymRETSWVxwx2VxGBSLtPWYWEtouU92mSpFp/wJoeH6+DUARgUme9PKt6jLst ndwqlTNUmRdcT6o9Zr6W7DW5H8hMM3xIqVH68oytzelUrBIw8uJWJK8UsXgqVzTDz0Pf Erva3bj67EoH3EkvuH5OBuX9hhxIA89RHGq7nAZ9GdtDn1HZ2UbK833iLNIrM501SL2W RYSaKgrZ7bJ0OlFQe4vMK9HQxy4xdH3PH4YA0sOwqpnHwMPXmHpD/1bZb8jofnJMMBMc f/BWyCw3CGecHfWxNuUGGaoN3FnaRlhRQ7hff0MCiuhZdcn5MFj26g9jDQ3AGYD/JAXB izmw== X-Gm-Message-State: AOJu0Yzi3txJxrdnj3zHgUeIUeRfN6/eGykwkNTyjU0CSR9ps8+FXz4G jYEL/lwuycRHE9P8jGp+JBm+Ato7mrPIFvOKB6Y9ljkU7F7EfzmFh4WQz68AkP/FOP8IxlgCxdy bGA== X-Google-Smtp-Source: AGHT+IF7CR4uSpto4C0/bEmtlGSVNtiauEiGBhDMxE3fudHfxb4OgtZdiRtxEo749C2e2ETKApN7Fw== X-Received: by 2002:a92:ca07:0:b0:375:9ecb:acd3 with SMTP id e9e14a558f8ab-3759ecbb3f2mr89232755ab.9.1718136141460; Tue, 11 Jun 2024 13:02:21 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:21 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 09/42] buildman: Avoid rebuilding when --mrproper is used Date: Tue, 11 Jun 2024 14:01:23 -0600 Message-Id: <20240611200156.2245525-10-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean When this flag is enabled, 'make mrproper' is always used when reconfiguring, so there is no point in doing it again. Update this. Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 0a7ff2e083e..c0b1067e3f7 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -700,7 +700,7 @@ class BuilderThread(threading.Thread): job.work_in_output, job.adjust_cfg) failed = result.return_code or result.stderr did_config = do_config - if failed and not do_config: + if failed and not do_config and not self.mrproper: # If our incremental build failed, try building again # with a reconfig. if self.builder.force_config_on_failure: From patchwork Tue Jun 11 20:01:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946506 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ZhbfrTlk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKPd2ts9z20Pb for ; Wed, 12 Jun 2024 06:04:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6685188728; Tue, 11 Jun 2024 22:02:27 +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="ZhbfrTlk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D84E488717; Tue, 11 Jun 2024 22:02:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 BC6E588715 for ; Tue, 11 Jun 2024 22:02:23 +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-io1-xd43.google.com with SMTP id ca18e2360f4ac-7eb895539e3so108196439f.2 for ; Tue, 11 Jun 2024 13:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136142; x=1718740942; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E+q4gqJa2swS7fW00RKTnduYoOd3HH3BvpJOyGpjEl4=; b=ZhbfrTlkr7KRtZDgqP1p0GyuZPL0Je1D1R3rDvxXiuBtdJtyExso+piYAGfMfRnT0J Wq20BH6BiF+rkhVGgXj0FpwhV3Vvz1M70KVSf56FwiyOG3aFcaOrJldU2863TibiVSXQ jVu1wP82c/aKZzifE2rNsMeMrGM6ZzaF3Gimc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136142; x=1718740942; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E+q4gqJa2swS7fW00RKTnduYoOd3HH3BvpJOyGpjEl4=; b=isfBwfewgdzwfuq+1V0kdxrxlzCBEgIuRRkL2MV6IWdpnqFw0kkct2v5pZAB3wLwIw Y3ukKfYeGHmJbpQiOBMSJxyoM36S0hizrCCGFSrLrlVSaXa0NsSqlMmQ4aw0YQ860QXb X84vjmCuNgHpuvcV1t3nz8xUtXQKS0oy/ClLLubzG3d2cHgbVZWOj9X172w4RZkmy74A +Qe6/DqlMfdxkwmhB+UGUEhVDKYuIjJ0TDgYFvow+gFHY0ywyyahCbp5HnoPRHwwpGtX Y6avU/bQp0WlWepawCER89Mf4utoJRTi5cOmId0L5kOMecZubcICQ7i8/ibesMQ/l6Xd D/LQ== X-Gm-Message-State: AOJu0YwoCwR+OSN/O1YxqNuxTLztsH7WuTezrPKkpLm1L4V01w7naSL7 qGOBgg/amCCWAR8t+5mRjH9qRCsZEcfG1MJ9Dhzgd8R6q4oPaVFRaQk1uKJcKMTWGsIbkfEqFa4 i+53u X-Google-Smtp-Source: AGHT+IHRBYfG1t54v7ZCBvWuiVEPeZKJom2F+z1XAth+Zne8fqJGurcQ3jAyB5z7fme6jgAlgdQVjg== X-Received: by 2002:a05:6e02:1aa9:b0:375:acd1:8bc4 with SMTP id e9e14a558f8ab-375acd190f3mr59089255ab.27.1718136142234; Tue, 11 Jun 2024 13:02:22 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alexey Brodkin Subject: [PATCH 10/42] buildman: Add a flag to force mrproper on failure Date: Tue, 11 Jun 2024 14:01:24 -0600 Message-Id: <20240611200156.2245525-11-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean When a file is removed by a commit (e.g. include/common.h yay!) it can cause incremental build failures since one of the dependency files from a previous build may mention the file. Add an option to run 'make mrproper' automatically when a build fails. This can be used to automatically resolve the problem, without always adding the large overhead of 'make mrproper' to every build. Signed-off-by: Simon Glass --- tools/buildman/builder.py | 18 ++++++++++-------- tools/buildman/builderthread.py | 6 ++++-- tools/buildman/buildman.rst | 3 ++- tools/buildman/cmdline.py | 4 +++- tools/buildman/control.py | 1 + 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index f35175b4598..c4384f53e8d 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -256,14 +256,14 @@ class Builder: def __init__(self, toolchains, base_dir, git_dir, num_threads, num_jobs, gnu_make='make', checkout=True, show_unknown=True, step=1, no_subdirs=False, full_path=False, verbose_build=False, - mrproper=False, per_board_out_dir=False, - config_only=False, squash_config_y=False, - warnings_as_errors=False, work_in_output=False, - test_thread_exceptions=False, adjust_cfg=None, - allow_missing=False, no_lto=False, reproducible_builds=False, - force_build=False, force_build_failures=False, - force_reconfig=False, in_tree=False, - force_config_on_failure=False, make_func=None): + mrproper=False, fallback_mrproper=False, + per_board_out_dir=False, config_only=False, + squash_config_y=False, warnings_as_errors=False, + work_in_output=False, test_thread_exceptions=False, + adjust_cfg=None, allow_missing=False, no_lto=False, + reproducible_builds=False, force_build=False, + force_build_failures=False, force_reconfig=False, + in_tree=False, force_config_on_failure=False, make_func=None): """Create a new Builder object Args: @@ -283,6 +283,7 @@ class Builder: PATH verbose_build: Run build with V=1 and don't use 'make -s' mrproper: Always run 'make mrproper' when configuring + fallback_mrproper: Run 'make mrproper' and retry on build failure per_board_out_dir: Build in a separate persistent directory per board rather than a thread-specific directory config_only: Only configure each build, don't build it @@ -352,6 +353,7 @@ class Builder: self.force_reconfig = force_reconfig self.in_tree = in_tree self.force_config_on_failure = force_config_on_failure + self.fallback_mrproper = fallback_mrproper if not self.squash_config_y: self.config_filenames += EXTRA_CONFIG_FILENAMES diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index c0b1067e3f7..bbe2f6f0d24 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -705,8 +705,10 @@ class BuilderThread(threading.Thread): # with a reconfig. if self.builder.force_config_on_failure: result, request_config = self.run_commit(commit_upto, - brd, work_dir, True, self.mrproper, False, True, - False, job.work_in_output, job.adjust_cfg) + brd, work_dir, True, + self.mrproper or self.builder.fallback_mrproper, + False, True, False, job.work_in_output, + job.adjust_cfg) did_config = True if not self.builder.force_reconfig: do_config = request_config diff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst index aae2477b5c3..bd0482af5f7 100644 --- a/tools/buildman/buildman.rst +++ b/tools/buildman/buildman.rst @@ -995,7 +995,8 @@ By default, buildman doesn't execute 'make mrproper' prior to building the first commit for each board. This reduces the amount of work 'make' does, and hence speeds up the build. To force use of 'make mrproper', use -the -m flag. This flag will slow down any buildman invocation, since it increases the amount -of work done on any build. +of work done on any build. An alternative is to use the --fallback-mrproper +flag, which retries the build with 'make mrproper' only after a build failure. One possible application of buildman is as part of a continual edit, build, edit, build, ... cycle; repeatedly applying buildman to the same change or diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py index 03211bd5aa5..8dc5a8787b5 100644 --- a/tools/buildman/cmdline.py +++ b/tools/buildman/cmdline.py @@ -90,7 +90,9 @@ def add_upto_m(parser): parser.add_argument('--list-tool-chains', action='store_true', default=False, help='List available tool chains (use -v to see probing detail)') parser.add_argument('-m', '--mrproper', action='store_true', - default=False, help="Run 'make mrproper before reconfiguring") + default=False, help="Run 'make mrproper' before reconfiguring") + parser.add_argument('--fallback-mrproper', action='store_true', + default=False, help="Run 'make mrproper' and retry on build failure") parser.add_argument( '-M', '--allow-missing', action='store_true', default=False, help='Tell binman to allow missing blobs and generate fake ones as needed') diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 8f6850c5211..f2dd87814c3 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -656,6 +656,7 @@ def do_buildman(args, toolchains=None, make_func=None, brds=None, no_subdirs=args.no_subdirs, full_path=args.full_path, verbose_build=args.verbose_build, mrproper=args.mrproper, + fallback_mrproper=args.fallback_mrproper, per_board_out_dir=args.per_board_out_dir, config_only=args.config_only, squash_config_y=not args.preserve_config_y, From patchwork Tue Jun 11 20:01:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946507 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=IdeWGmHu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKPs0bmWz20Pb for ; Wed, 12 Jun 2024 06:04:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C901B88729; Tue, 11 Jun 2024 22:02:30 +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="IdeWGmHu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3BA6E88715; Tue, 11 Jun 2024 22:02:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (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 3F83688744 for ; Tue, 11 Jun 2024 22:02:24 +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-il1-x12a.google.com with SMTP id e9e14a558f8ab-3758fa1cc8eso6234385ab.3 for ; Tue, 11 Jun 2024 13:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136143; x=1718740943; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kSHg7qWjXsARtjBpbR4RtDAK6qA5RpzZmG7C39EaVxs=; b=IdeWGmHuImLHJdfpcaTC5BzA1CDqH55PUA7xE5uPrj0LsUBs5fxDQwiMe+jCQz8HZ4 KVWkH7un8+7B+Y+d3zz6dK0mmo3Qpoem5zsYpabDZW1oLq7mCX7TMb0qSbK7p/m23ZTF NMjyWeEEkp6h2gmPsjhmkL7SzkoYQ9RM4oNpM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136143; x=1718740943; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kSHg7qWjXsARtjBpbR4RtDAK6qA5RpzZmG7C39EaVxs=; b=B/0x+bg9kYV6AjrbX6OPkqZLFq+0OmELtuF9Y/M9RrQS7BB47taV5bV8wam8FFPChg 5KIpd8OYDZ0znvR2jN/2g5jlQnT5R2MwAMnXUnxxyuSreD8voV2tngOzRUZvsbb2Vm6f qG7klgqR3W8rd/wtXRrNueBzdM8GD0rCHDRSHgmwtvmXuyL2tkkjUFQ31azejQu42b5X wjVCu/0yEo7qNzRpSo8bUrNwytGMo25/1DaDL1l3I5NEUgnA8S+hG8Soa10n6Yy27L7V 8mSUdrAvDIyD8nCe1QjuN4uPmVRfwJHYtJn+LfwcK1vheUMttLjxmKTmifwmdmmR3e6M Kgww== X-Gm-Message-State: AOJu0YxiigzHhQcEFbU6tTLIk5A/hDwNw0xLOrYu2V/9ikL06QoTR2pa 1oGjRferjw45i6NLWFqYVof4ZSRvQa7N4srlm4p9kI66yzC6BjXkuJqwRRCuQDsQweMmbFODWEr VGA== X-Google-Smtp-Source: AGHT+IEE6JwyAsLHB/0WuHPw8DUi75cSbjDSnfW1rR3rEHI3pqEKIx5I2KqCXkz5xuXesyeFiWal3w== X-Received: by 2002:a05:6e02:174e:b0:375:9c7e:d09 with SMTP id e9e14a558f8ab-3759c7e1050mr121201275ab.7.1718136142938; Tue, 11 Jun 2024 13:02:22 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 11/42] buildman: Retry the build for current source Date: Tue, 11 Jun 2024 14:01:25 -0600 Message-Id: <20240611200156.2245525-12-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Buildman retries a failed build when processing a branch, but does not do this when building current source. It is useful to do this retry in both cases, so add the logic for it. Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index bbe2f6f0d24..55658487abf 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -755,6 +755,14 @@ class BuilderThread(threading.Thread): self.mrproper, self.builder.config_only, True, self.builder.force_build_failures, job.work_in_output, job.adjust_cfg) + failed = result.return_code or result.stderr + if failed and not self.mrproper: + result, request_config = self.run_commit(None, brd, work_dir, + True, self.builder.fallback_mrproper, + self.builder.config_only, True, + self.builder.force_build_failures, + job.work_in_output, job.adjust_cfg) + result.commit_upto = 0 self._write_result(result, job.keep_outputs, job.work_in_output) self._send_result(result) From patchwork Tue Jun 11 20:01:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946508 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Ewu4fYIz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKQ35gR6z20Pb for ; Wed, 12 Jun 2024 06:04:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 38C3A88761; Tue, 11 Jun 2024 22:02:31 +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="Ewu4fYIz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2416488738; Tue, 11 Jun 2024 22:02:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 1FF2F8859A for ; Tue, 11 Jun 2024 22:02:25 +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-il1-x141.google.com with SMTP id e9e14a558f8ab-375932c94a9so6627345ab.1 for ; Tue, 11 Jun 2024 13:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136144; x=1718740944; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eVShViM73zxJOwfrcyPwQc2E+SZEwYZjtlVJOQ7v5XY=; b=Ewu4fYIzvlOwa3exsOvJqhMJwaCzpmaVIRpou3CpTCaychtu3KookhCOz6f6HFsi/I fgkK7tmswnnBnmY1aump4Rg/QnP+VtMgzWH4VTrDc4WQIDig4WnFhWq3gnQdO2eH1IxY I2FjD4GnyfxjP6hJEaYhrOufgwW/9Kk+FBN9Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136144; x=1718740944; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eVShViM73zxJOwfrcyPwQc2E+SZEwYZjtlVJOQ7v5XY=; b=jkk9KioWbkPU+qR20ZNwYf/7T1gsdoBStfdpga53kiew3LjQ8msV35QZ4FMKe4NgDW hmOt9iaeBlgAIDqYt2QBk/UghJJZTL4yhu72Hj6FGg1CjPUqeG1l4LTmCmcLbBkoMYsb BxzbJ1ih+JcnLpPm1usPNOAepUJ1YdyendgABqItC7k776xv6GKBOwuyprFpPxEz1Awi 39vEeFMQvzYmY7l/yw/8pxwRpf/f0J2xDZ3yTSiUsvOT35KsKkeltg4Yu/Qn/rScjgHS 7cuu1ZmMGggMhzSvaq0UvgtA1uz5INefS4F11jnEe45l/MdzYkQf5JBlGgPP+sZBTHp8 INEA== X-Gm-Message-State: AOJu0YwCey7z4B8WHcs3/TABSLhySel+P5JbmQQpLJhr1mDKtAmEbDgi U7jJbRpBJIOdVWwnm3KIRrmXAiRHsUoE7VqubxE9LSiFGbAVmfZ0/KgJ9dB7rb1YVgJLIK1iUh4 698en X-Google-Smtp-Source: AGHT+IHSDwsn9Qyuc/AKOkmGI2ZG8QNvHQZ1rmU2fCEeORfGtSBI8OSUTW4NpvKX8xnkAuhyOJ805A== X-Received: by 2002:a05:6e02:19ce:b0:375:b22b:376e with SMTP id e9e14a558f8ab-375b22b3830mr42825135ab.20.1718136143698; Tue, 11 Jun 2024 13:02:23 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:23 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alexey Brodkin , Heinrich Schuchardt Subject: [PATCH 12/42] buildman: Add a way to limit the number of buildmans Date: Tue, 11 Jun 2024 14:01:26 -0600 Message-Id: <20240611200156.2245525-13-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Buildman uses all available CPUs by default, so running more than one or two concurrent processes is not normally useful. However in some CI cases we want to be able to run several jobs at once to save time. For example, in a lab situation we may want to run a test on 20 boards at a time, since only the build step actually takes much CPU. Add an option which allows such a limit. When buildman starts up, it waits until the number of running processes goes below the limit, then claims a spot in the list. The list is maintained with a temporary file. Note that the temp file is user-specific, since it is hard to create a locked temporary file which can be accessed by any user. In most cases, only one user is running jobs on a machine, so this should not matter. Signed-off-by: Simon Glass --- tools/buildman/buildman.rst | 5 ++ tools/buildman/cmdline.py | 2 + tools/buildman/control.py | 140 ++++++++++++++++++++++++++++++++- tools/buildman/pyproject.toml | 6 +- tools/buildman/test.py | 121 ++++++++++++++++++++++++++++ tools/u_boot_pylib/terminal.py | 7 +- 6 files changed, 277 insertions(+), 4 deletions(-) diff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst index bd0482af5f7..b8ff3bf1ab2 100644 --- a/tools/buildman/buildman.rst +++ b/tools/buildman/buildman.rst @@ -1286,6 +1286,11 @@ then buildman hangs. Failing to handle any eventuality is a bug in buildman and should be reported. But you can use -T0 to disable threading and hopefully figure out the root cause of the build failure. +For situations where buildman is invoked from multiple running processes, it is +sometimes useful to have buildman wait until the others have finished. Use the +--process-limit option for this: --process-limit 1 will allow only one buildman +to process jobs at a time. + Build summary ------------- diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py index 8dc5a8787b5..544a391a464 100644 --- a/tools/buildman/cmdline.py +++ b/tools/buildman/cmdline.py @@ -129,6 +129,8 @@ def add_after_m(parser): default=False, help="Use an O= (output) directory per board rather than per thread") parser.add_argument('--print-arch', action='store_true', default=False, help="Print the architecture for a board (ARCH=)") + parser.add_argument('--process-limit', type=int, + default=0, help='Limit to number of buildmans running at once') parser.add_argument('-r', '--reproducible-builds', action='store_true', help='Set SOURCE_DATE_EPOCH=0 to suuport a reproducible build') parser.add_argument('-R', '--regen-board-list', type=str, diff --git a/tools/buildman/control.py b/tools/buildman/control.py index f2dd87814c3..464835c5be5 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -7,10 +7,13 @@ This holds the main control logic for buildman, when not running tests. """ +import getpass import multiprocessing import os import shutil import sys +import tempfile +import time from buildman import boards from buildman import bsettings @@ -21,10 +24,23 @@ from patman import gitutil from patman import patchstream from u_boot_pylib import command from u_boot_pylib import terminal -from u_boot_pylib.terminal import tprint +from u_boot_pylib import tools +from u_boot_pylib.terminal import print_clear, tprint TEST_BUILDER = None +# Space-separated list of buildman process IDs currently running jobs +RUNNING_FNAME = f'buildmanq.{getpass.getuser()}' + +# Lock file for access to RUNNING_FILE +LOCK_FNAME = f'{RUNNING_FNAME}.lock' + +# Wait time for access to lock (seconds) +LOCK_WAIT_S = 10 + +# Wait time to start running +RUN_WAIT_S = 300 + def get_plural(count): """Returns a plural 's' if count is not 1""" return 's' if count != 1 else '' @@ -578,6 +594,125 @@ def calc_adjust_cfg(adjust_cfg, reproducible_builds): return adjust_cfg +def read_procs(tmpdir=tempfile.gettempdir()): + """Read the list of running buildman processes + + If the list is corrupted, returns an empty list + + Args: + tmpdir (str): Temporary directory to use (for testing only) + """ + running_fname = os.path.join(tmpdir, RUNNING_FNAME) + procs = [] + if os.path.exists(running_fname): + items = tools.read_file(running_fname, binary=False).split() + try: + procs = [int(x) for x in items] + except ValueError: # Handle invalid format + pass + return procs + + +def check_pid(pid): + """Check for existence of a unix PID + + https://stackoverflow.com/questions/568271/how-to-check-if-there-exists-a-process-with-a-given-pid-in-python + + Args: + pid (int): PID to check + + Returns: + True if it exists, else False + """ + try: + os.kill(pid, 0) + except OSError: + return False + else: + return True + + +def write_procs(procs, tmpdir=tempfile.gettempdir()): + """Write the list of running buildman processes + + Args: + tmpdir (str): Temporary directory to use (for testing only) + """ + running_fname = os.path.join(tmpdir, RUNNING_FNAME) + tools.write_file(running_fname, ' '.join([str(p) for p in procs]), + binary=False) + + # Allow another user to access the file + os.chmod(running_fname, 0o666) + +def wait_for_process_limit(limit, tmpdir=tempfile.gettempdir(), + pid=os.getpid()): + """Wait until the number of buildman processes drops to the limit + + This uses FileLock to protect a 'running' file, which contains a list of + PIDs of running buildman processes. The number of PIDs in the file indicates + the number of running processes. + + When buildman starts up, it calls this function to wait until it is OK to + start the build. + + On exit, no attempt is made to remove the PID from the file, since other + buildman processes will notice that the PID is no-longer valid, and ignore + it. + + Two timeouts are provided: + LOCK_WAIT_S: length of time to wait for the lock; if this occurs, the + lock is busted / removed before trying again + RUN_WAIT_S: length of time to wait to be allowed to run; if this occurs, + the build starts, with the PID being added to the file. + + Args: + limit (int): Maximum number of buildman processes, including this one; + must be > 0 + tmpdir (str): Temporary directory to use (for testing only) + pid (int): Current process ID (for testing only) + """ + from filelock import Timeout, FileLock + + running_fname = os.path.join(tmpdir, RUNNING_FNAME) + lock_fname = os.path.join(tmpdir, LOCK_FNAME) + lock = FileLock(lock_fname) + + # Allow another user to access the file + col = terminal.Color() + tprint('Waiting for other buildman processes...', newline=False, + colour=col.RED) + + claimed = False + deadline = time.time() + RUN_WAIT_S + while True: + try: + with lock.acquire(timeout=LOCK_WAIT_S): + os.chmod(lock_fname, 0o666) + procs = read_procs(tmpdir) + + # Drop PIDs which are not running + procs = list(filter(check_pid, procs)) + + # If we haven't hit the limit, add ourself + if len(procs) < limit: + tprint('done...', newline=False) + claimed = True + if time.time() >= deadline: + tprint('timeout...', newline=False) + claimed = True + if claimed: + write_procs(procs + [pid], tmpdir) + break + + except Timeout: + tprint('failed to get lock: busting...', newline=False) + os.remove(lock_fname) + + time.sleep(1) + tprint('starting build', newline=False) + print_clear() + def do_buildman(args, toolchains=None, make_func=None, brds=None, clean_dir=False, test_thread_exceptions=False): """The main control code for buildman @@ -677,5 +812,8 @@ def do_buildman(args, toolchains=None, make_func=None, brds=None, TEST_BUILDER = builder + if args.process_limit: + wait_for_process_limit(args.process_limit) + return run_builder(builder, series.commits if series else None, brds.get_selected_dict(), args) diff --git a/tools/buildman/pyproject.toml b/tools/buildman/pyproject.toml index fe0f6421b53..68bfa45c3f4 100644 --- a/tools/buildman/pyproject.toml +++ b/tools/buildman/pyproject.toml @@ -8,7 +8,11 @@ version = "0.0.6" authors = [ { name="Simon Glass", email="sjg@chromium.org" }, ] -dependencies = ["u_boot_pylib >= 0.0.6", "patch-manager >= 0.0.6"] +dependencies = [ + "filelock >= 3.0.12", + "u_boot_pylib >= 0.0.6", + "patch-manager >= 0.0.6" +] description = "Buildman build tool for U-Boot" readme = "README.rst" requires-python = ">=3.7" diff --git a/tools/buildman/test.py b/tools/buildman/test.py index f92add7a7c5..d68395c2164 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -2,12 +2,14 @@ # Copyright (c) 2012 The Chromium OS Authors. # +from filelock import FileLock import os import shutil import sys import tempfile import time import unittest +from unittest.mock import patch from buildman import board from buildman import boards @@ -156,6 +158,11 @@ class TestBuild(unittest.TestCase): if not os.path.isdir(self.base_dir): os.mkdir(self.base_dir) + self.cur_time = 0 + self.valid_pids = [] + self.finish_time = None + self.finish_pid = None + def tearDown(self): shutil.rmtree(self.base_dir) @@ -747,6 +754,120 @@ class TestBuild(unittest.TestCase): self.assertEqual([ ['MARY="mary"', 'Missing expected line: CONFIG_MARY="mary"']], result) + def get_procs(self): + running_fname = os.path.join(self.base_dir, control.RUNNING_FNAME) + items = tools.read_file(running_fname, binary=False).split() + return [int(x) for x in items] + + def get_time(self): + return self.cur_time + + def inc_time(self, amount): + self.cur_time += amount + + # Handle a process exiting + if self.finish_time == self.cur_time: + self.valid_pids = [pid for pid in self.valid_pids + if pid != self.finish_pid] + + def kill(self, pid, signal): + if pid not in self.valid_pids: + raise OSError('Invalid PID') + + def test_process_limit(self): + """Test wait_for_process_limit() function""" + tmpdir = self.base_dir + + with (patch('time.time', side_effect=self.get_time), + patch('time.sleep', side_effect=self.inc_time), + patch('os.kill', side_effect=self.kill)): + # Grab the process. Since there is no other profcess, this should + # immediately succeed + control.wait_for_process_limit(1, tmpdir=tmpdir, pid=1) + lines = terminal.get_print_test_lines() + self.assertEqual(0, self.cur_time) + self.assertEqual('Waiting for other buildman processes...', + lines[0].text) + self.assertEqual(self._col.RED, lines[0].colour) + self.assertEqual(False, lines[0].newline) + self.assertEqual(True, lines[0].bright) + + self.assertEqual('done...', lines[1].text) + self.assertEqual(None, lines[1].colour) + self.assertEqual(False, lines[1].newline) + self.assertEqual(True, lines[1].bright) + + self.assertEqual('starting build', lines[2].text) + self.assertEqual([1], control.read_procs(tmpdir)) + self.assertEqual(None, lines[2].colour) + self.assertEqual(False, lines[2].newline) + self.assertEqual(True, lines[2].bright) + + # Try again, with a different PID...this should eventually timeout + # and start the build anyway + self.cur_time = 0 + self.valid_pids = [1] + control.wait_for_process_limit(1, tmpdir=tmpdir, pid=2) + lines = terminal.get_print_test_lines() + self.assertEqual('Waiting for other buildman processes...', + lines[0].text) + self.assertEqual('timeout...', lines[1].text) + self.assertEqual(None, lines[1].colour) + self.assertEqual(False, lines[1].newline) + self.assertEqual(True, lines[1].bright) + self.assertEqual('starting build', lines[2].text) + self.assertEqual([1, 2], control.read_procs(tmpdir)) + self.assertEqual(control.RUN_WAIT_S, self.cur_time) + + # Check lock-busting + self.cur_time = 0 + self.valid_pids = [1, 2] + lock_fname = os.path.join(tmpdir, control.LOCK_FNAME) + lock = FileLock(lock_fname) + lock.acquire(timeout=1) + control.wait_for_process_limit(1, tmpdir=tmpdir, pid=3) + lines = terminal.get_print_test_lines() + self.assertEqual('Waiting for other buildman processes...', + lines[0].text) + self.assertEqual('failed to get lock: busting...', lines[1].text) + self.assertEqual(None, lines[1].colour) + self.assertEqual(False, lines[1].newline) + self.assertEqual(True, lines[1].bright) + self.assertEqual('timeout...', lines[2].text) + self.assertEqual('starting build', lines[3].text) + self.assertEqual([1, 2, 3], control.read_procs(tmpdir)) + self.assertEqual(control.RUN_WAIT_S, self.cur_time) + lock.release() + + # Check handling of dead processes. Here we have PID 2 as a running + # process, even though the PID file contains 1, 2 and 3. So we can + # add one more PID, to make 2 and 4 + self.cur_time = 0 + self.valid_pids = [2] + control.wait_for_process_limit(2, tmpdir=tmpdir, pid=4) + lines = terminal.get_print_test_lines() + self.assertEqual('Waiting for other buildman processes...', + lines[0].text) + self.assertEqual('done...', lines[1].text) + self.assertEqual('starting build', lines[2].text) + self.assertEqual([2, 4], control.read_procs(tmpdir)) + self.assertEqual(0, self.cur_time) + + # Try again, with PID 2 quitting at time 50. This allows the new + # build to start + self.cur_time = 0 + self.valid_pids = [2, 4] + self.finish_pid = 2 + self.finish_time = 50 + control.wait_for_process_limit(2, tmpdir=tmpdir, pid=5) + lines = terminal.get_print_test_lines() + self.assertEqual('Waiting for other buildman processes...', + lines[0].text) + self.assertEqual('done...', lines[1].text) + self.assertEqual('starting build', lines[2].text) + self.assertEqual([4, 5], control.read_procs(tmpdir)) + self.assertEqual(self.finish_time, self.cur_time) + if __name__ == "__main__": unittest.main() diff --git a/tools/u_boot_pylib/terminal.py b/tools/u_boot_pylib/terminal.py index 40d79f8ac07..2cd5a54ab52 100644 --- a/tools/u_boot_pylib/terminal.py +++ b/tools/u_boot_pylib/terminal.py @@ -164,8 +164,11 @@ def print_clear(): global last_print_len if last_print_len: - print('\r%s\r' % (' '* last_print_len), end='', flush=True) - last_print_len = None + if print_test_mode: + print_test_list.append(PrintLine(None, None, None, None)) + else: + print('\r%s\r' % (' '* last_print_len), end='', flush=True) + last_print_len = None def set_print_test_mode(enable=True): """Go into test mode, where all printing is recorded""" From patchwork Tue Jun 11 20:01:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946509 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=FG8OJ6/Z; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKQH1KFLz20Pb for ; Wed, 12 Jun 2024 06:04:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 99E4888777; Tue, 11 Jun 2024 22:02:31 +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="FG8OJ6/Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C139888732; Tue, 11 Jun 2024 22:02:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (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 BB9E488777 for ; Tue, 11 Jun 2024 22:02:25 +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-il1-x12e.google.com with SMTP id e9e14a558f8ab-37594abcee7so14699975ab.0 for ; Tue, 11 Jun 2024 13:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136144; x=1718740944; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1tnGCPRa6aDvFaFRV/tH0I/XqpicUUh3iuN+3XL99U4=; b=FG8OJ6/Z/Tq34XuPQlltjt1s07zQeOlmbVuxUiQQPD+fdbnc+ae919wo0zZwf3cRJv SEzTmbLNb9CUq+itsycOLjN335xSw67Uzl3BYHQ9y1RzPXkohlJFFOmN3NggRnF3J+Qv td9TnMGqLRhIx0cCxYvieaWUunAugjOCl2TUk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136144; x=1718740944; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1tnGCPRa6aDvFaFRV/tH0I/XqpicUUh3iuN+3XL99U4=; b=EkYbukMGm0533ke/zGQapVeo/YMdAqihl8dA+NSYjpRwSthbzR7Tcv+qiI6IFORXiQ XNzOjj6Hf/2ro/26E554FW5ayOTzhqeKyJd8nc7IYEr0/GyV1XyqSK9KMGdYJ8rqSFAg 3lsiizwR+wCRSbaprtaV57WVVZP5BAEErQ0ScUbVFCFoYHlFdAeVDgoAB7JJs8OQw75D A30RXnUFwXXQzzMbszJvJ38c/WWo3pEbI7xMiEDDXKm0vIIzXIT5quTH9oduVMsbzo2f WT3UecPD6om4T1aPk0P33i4AUniUSnrhCkltdN3hz1QOIenmPrl3uNIk05RBaF7OGiv/ i1dg== X-Gm-Message-State: AOJu0Yy/A+uy1wUzJTK+KwtctmIkmgYDnUSvc5nOrvfKAwSKhRrLO8nM DJHiLEkRww2pC9FVh+Iy2SSlZSqyIg484UhZeRn2fv48unOPFejmqByiQ91Vqrz3sCgCiLsEOSj Mdg== X-Google-Smtp-Source: AGHT+IHyWdQYphBvIjcnmUUmsA0tOwXGmKqcTAP88VIZtJQCYyv1tEPGdflaKlYXF7QYAl8BSVJsfw== X-Received: by 2002:a05:6e02:1c24:b0:374:9916:70 with SMTP id e9e14a558f8ab-37580333543mr145402425ab.11.1718136144460; Tue, 11 Jun 2024 13:02:24 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:24 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH 13/42] dm: core: Enhance comments on bind_drivers_pass() Date: Tue, 11 Jun 2024 14:01:27 -0600 Message-Id: <20240611200156.2245525-14-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean This part of driver model is a little subtle, so add some more comments to promote better understanding. Signed-off-by: Simon Glass --- drivers/core/lists.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/core/lists.c b/drivers/core/lists.c index 2839a9b7371..a84e6a98cb1 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -8,6 +8,7 @@ #define LOG_CATEGORY LOGC_DM +#include #include #include #include @@ -50,6 +51,21 @@ struct uclass_driver *lists_uclass_lookup(enum uclass_id id) return NULL; } +/** + * bind_drivers_pass() - Perform a pass of driver binding + * + * Work through the driver_info records binding a driver for each one. If the + * binding fails, continue binding others, but return the error. + * + * For OF_PLATDATA we must bind parent devices before their children. So only + * children of bound parents are bound on each call to this function. When a + * child is left unbound, -EAGAIN is returned, indicating that this function + * should be called again + * + * @parent: Parent device to use when binding each child device + * Return: 0 if OK, -EAGAIN if unbound children exist, -ENOENT if there is no + * driver for one of the devices, other -ve on other error + */ static int bind_drivers_pass(struct udevice *parent, bool pre_reloc_only) { struct driver_info *info = From patchwork Tue Jun 11 20:01:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946510 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=EhX28Cd1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKQV27hlz20Pb for ; Wed, 12 Jun 2024 06:04:50 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 066978879C; Tue, 11 Jun 2024 22:02:32 +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="EhX28Cd1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 28CAA88732; Tue, 11 Jun 2024 22:02:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (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 B11538870E for ; Tue, 11 Jun 2024 22:02:26 +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-il1-x134.google.com with SMTP id e9e14a558f8ab-37588517095so19782025ab.2 for ; Tue, 11 Jun 2024 13:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136145; x=1718740945; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xuhSU9HTCauKB+4KV1rteE+u47LRYZE6pFbP//jaf9k=; b=EhX28Cd1YpvDs8D+2JWs4yheBuJgwpgPiLJk+zeBCiSCRApjrLFbM6zzGcGZeA4KTr dYpLqMULM64qhqjA4uc0rzkDDRJHSUmkhTRWsvhKAWoaLkqvqBjf5UnzqYNoE2g8LjBm BeQalRCjU0lr52FMFw2Ei/gstLxF4lCXEtF7A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136145; x=1718740945; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xuhSU9HTCauKB+4KV1rteE+u47LRYZE6pFbP//jaf9k=; b=HO8xUige/zL17CycaNPnrw7Pu5ogWzy92buwhqbITwBhhy+WFAVxNJ/ZxWLb2khEfJ rCoPvCshmV8wSw5th3SRwqBwt131COL0eor2/FLtOHFIF1hv3uBFUKYcqIiQX98xYlIw p5MhezpmHHwwd5asmeVX1cXU/VcRxORkiNIsZjfLOLx3t1meXg36zPWSeGr1In2OmnP7 voXEXQBR4j3HvdUKTDamMDzLDPKbc+7mL6FoBrcsPCl1CGRdp96iWnA2zAnFtgH7wRP1 R/1mT9AfIdKuaZquGo1yM1yQP9JjH1FF4zC+RvX5N50wSs8uz8GDkd1JvH/a0yrMwq3E 9FLw== X-Gm-Message-State: AOJu0YyF7owztm+ayT7dB9wamFW65b45iFxbQyIdUdUFZj8Qd9YrNp55 GiwiB6o5MrtFj8tgUK7c9ECa6C7BReWgoBQPRS3AeAVPcqXyGgeBE/IqHHpPMHxbO2WohhxmRyb rSw== X-Google-Smtp-Source: AGHT+IHRxLzuuaXZ0Q34W9G7viBxlV6eO+Kr0Qq+8BqcIA/KxHJI4BA6FjmWcTwWyHj8Bbz7OkKJEA== X-Received: by 2002:a05:6e02:1aa2:b0:375:af5f:67ea with SMTP id e9e14a558f8ab-375af5f6ab8mr49147985ab.18.1718136145330; Tue, 11 Jun 2024 13:02:25 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Caleb Connolly , Dan Carpenter , Marek Vasut , Sughosh Ganu Subject: [PATCH 14/42] initcall: Correct use of relocation offset Date: Tue, 11 Jun 2024 14:01:28 -0600 Message-Id: <20240611200156.2245525-15-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The relocation offset can change in some initcall sequences. Handle this and make sure it is used for all debugging statements in init_run_list() Update the trace test to match. Signed-off-by: Simon Glass Reviewed-by: Caleb Connolly --- lib/initcall.c | 6 ++++-- test/py/tests/test_trace.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/initcall.c b/lib/initcall.c index c8e2b0f6a38..2686b9aed5c 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -49,13 +49,14 @@ static int initcall_is_event(init_fnc_t func) */ int initcall_run_list(const init_fnc_t init_sequence[]) { - ulong reloc_ofs = calc_reloc_ofs(); + ulong reloc_ofs; const init_fnc_t *ptr; enum event_t type; init_fnc_t func; int ret = 0; for (ptr = init_sequence; func = *ptr, func; ptr++) { + reloc_ofs = calc_reloc_ofs(); type = initcall_is_event(func); if (type) { @@ -84,7 +85,8 @@ int initcall_run_list(const init_fnc_t init_sequence[]) sprintf(buf, "event %d/%s", type, event_type_name(type)); } else { - sprintf(buf, "call %p", func); + sprintf(buf, "call %p", + (char *)func - reloc_ofs); } printf("initcall failed at %s (err=%dE)\n", buf, ret); diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py index f41d4cf71f0..ec1e624722c 100644 --- a/test/py/tests/test_trace.py +++ b/test/py/tests/test_trace.py @@ -175,7 +175,7 @@ def check_funcgraph(cons, fname, proftool, map_fname, trace_dat): # Then look for this: # u-boot-1 0..... 282.101375: funcgraph_exit: 0.006 us | } # Then check for this: - # u-boot-1 0..... 282.101375: funcgraph_entry: 0.000 us | initcall_is_event(); + # u-boot-1 0..... 282.101375: funcgraph_entry: 0.000 us | calc_reloc_ofs(); expected_indent = None found_start = False @@ -199,7 +199,7 @@ def check_funcgraph(cons, fname, proftool, map_fname, trace_dat): # The next function after initf_bootstage() exits should be # initcall_is_event() - assert upto == 'initcall_is_event()' + assert upto == 'calc_reloc_ofs()' # Now look for initf_dm() and dm_timer_init() so we can check the bootstage # time From patchwork Tue Jun 11 20:01:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946511 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=VhkO7lwE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKQk25Nxz20Pb for ; Wed, 12 Jun 2024 06:05:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6742D88710; Tue, 11 Jun 2024 22:02:32 +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="VhkO7lwE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BAC4688710; Tue, 11 Jun 2024 22:02:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 68C4E88730 for ; Tue, 11 Jun 2024 22:02:27 +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-il1-x12b.google.com with SMTP id e9e14a558f8ab-375b27243e5so7425215ab.0 for ; Tue, 11 Jun 2024 13:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136146; x=1718740946; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rY6UgbnF9suBfeM5Xzr1xoZtJR9Dlhn8vfJ4cBYgtak=; b=VhkO7lwEl5zstIaUQEEkJO02Pm1fjf6DKjilluQXewt/ql5TmuzdoFiy1P9GK1ruQ3 ClCqSk5Fx4gqfND57tPPx/chxsMH8635EO5Iv6+9mMLowK8GGRDY2BBiNl1fVedF/ZsL BMOuIIV5OVvMH3JfWrMQqSrDZ49qGGFkyEAPQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136146; x=1718740946; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rY6UgbnF9suBfeM5Xzr1xoZtJR9Dlhn8vfJ4cBYgtak=; b=TC5ns6wlykwhddOghtxgUfrAErTAhSG/r4Wr15c4sDjhGRmjxE97xc4ZwjHZPg9EOd KrWQD+8Ew4Q8LVwZkBK9/xmnS7Ieb73Cy6OpM4jvwscnb5IQww2uRU2+P+sw1r03E7e+ pkt0yofx1B1uEydWrzmbjDVTXSOOvHOFEup6vP8YKbyTHY6gnnu6CBCFfQGOKfVYJGfO DGOZwHS8eQT5CCyucMLoH4UM4tmOfSdcpaLmtKlfjg1JUHcb+AJ73myqftRjgN0poq5h d5tUn3w6PEmq/NG5ukWg0KS62EebR1DKPxF8MsbT0SHASCVeqD3zGqdnzS1l+n/BqJMT Zblw== X-Gm-Message-State: AOJu0Yy7IVdNx8LKBIu9AYF8x+txHtss2MCd9Mhlfgeyqvl7Cbxo80Ks 2H5b1ygI0RljMnD+QKB5X7v+8AL0F9Z790uielBViccsXGVmofmEcGX8FbwcUrGrc9ZHcLzN6UA 4Fg== X-Google-Smtp-Source: AGHT+IGE0BlKa3FFwhyOfkm0Luh1nEXsonesW0Gt+raBc0blR2625jUgl2ve3RkYwKTI5VjAavWduA== X-Received: by 2002:a05:6e02:20ed:b0:375:a7ee:dffc with SMTP id e9e14a558f8ab-375a7eee1ebmr65549515ab.11.1718136146105; Tue, 11 Jun 2024 13:02:26 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , =?utf-8?q?Michal_Such=C3=A1nek?= , Nishanth Menon , Trevor Woerner Subject: [PATCH 15/42] am33xx: Provide a function to set up the debug UART Date: Tue, 11 Jun 2024 14:01:29 -0600 Message-Id: <20240611200156.2245525-16-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Since commit 0dba45864b2a ("arm: Init the debug UART") the debug UART is set up in _main() before early_system_init() is called. Add a suitable board_debug_uart_init() function to set up the UART in SPL. Signed-off-by: Simon Glass --- arch/arm/mach-omap2/am33xx/board.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index 78c1e965c9f..84a60dedd72 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -490,9 +490,6 @@ void early_system_init(void) */ save_omap_boot_params(); #endif -#ifdef CONFIG_DEBUG_UART_OMAP - debug_uart_init(); -#endif #ifdef CONFIG_SPL_BUILD spl_early_init(); @@ -533,3 +530,18 @@ static int am33xx_dm_post_init(void) return 0; } EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, am33xx_dm_post_init); + +#ifdef CONFIG_DEBUG_UART_BOARD_INIT +void board_debug_uart_init(void) +{ + if (u_boot_first_phase()) { + hw_data_init(); + set_uart_mux_conf(); + setup_early_clocks(); + uart_soft_reset(); + + /* avoid uart gibberish by allowing the clocks to settle */ + mdelay(50); + } +} +#endif From patchwork Tue Jun 11 20:01:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946512 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=RqwNadX6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKQy5WN9z1ydW for ; Wed, 12 Jun 2024 06:05:14 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BEDA488766; Tue, 11 Jun 2024 22:02:33 +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="RqwNadX6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 650FF88717; Tue, 11 Jun 2024 22:02:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 5681D8859A for ; Tue, 11 Jun 2024 22:02:28 +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-il1-x136.google.com with SMTP id e9e14a558f8ab-3737dc4a669so7070065ab.0 for ; Tue, 11 Jun 2024 13:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136147; x=1718740947; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EAxnoetFX8TDGTVaRPuPszKw/VWrSDhtxAkOmQtnSM4=; b=RqwNadX6HgCSnmRwLl3gDM+S0+zHi2a5IogxyIEovX9ZA004kaJZog1fylywnNDbV6 xVxrhZEErgu6Tri2B4SZQOqoJ/e49wsxWMm0rdWdnIOobilZMjweKLtIdRkWx325DNnq ObZgk+l/vabAMHqmYZ/uwFj+Qjaip/r1Uemvc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136147; x=1718740947; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EAxnoetFX8TDGTVaRPuPszKw/VWrSDhtxAkOmQtnSM4=; b=kEzftSougWiM1kzCZyvy+8oeSxXVI9T9thqtHzVDSXJy4tuNs3NQrOCljkdzoNF9BT +16R3HMdPXUtGoyR406PTOTrFwGjj0O1/QcYkPxq+PQIkXxjgtj62WpyYYAQa/985kxu tUmo6TbBnrvK3Z2jhpV/8BhvYwjvGY/TY83Q/Us0Xu40aDKCnpqEl9WUJJESnUCHEJLk X6g4e0Vd3JtyabJJYYcnnFbhcBncyPPPar+mUM0ulXGSXJTf3hjbVPlNnwoVLWfFF0XJ M0PtgdwcNb/fpUzVPPeFPjhajYCnenW/Ks69jQqlr+3jXLomTW9v+SeYkCMlfUNxE9T8 UCLA== X-Gm-Message-State: AOJu0YxpQaT5t7m1leiLNbXceTS4XWk5ekcO4uxPKeopzjXddz/NJzeV AcenLAbWwLQlFqHspJ493t9EfzO/3O8AjWmlj0bTGHY6JiTpZE2IkvIdIJQpc6DTkTdYYTzcK32 WtQ== X-Google-Smtp-Source: AGHT+IG3vENbleWl0cZtzrUfnB3NknvgdJYAbwcj9PS+DW1ujaMWbb+g3MpksZxZVu/xomhxp87RxA== X-Received: by 2002:a05:6e02:1fea:b0:375:c56b:a0fe with SMTP id e9e14a558f8ab-375c56ba749mr12337595ab.19.1718136146918; Tue, 11 Jun 2024 13:02:26 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:26 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Andre Przywara , Jagan Teki , Samuel Holland Subject: [PATCH 16/42] sunxi: Mark scp as optional Date: Tue, 11 Jun 2024 14:01:30 -0600 Message-Id: <20240611200156.2245525-17-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean This binary does not prevent the system from booting. Mark it optional so that U-Boot can be built without it. Signed-off-by: Simon Glass --- arch/arm/dts/sunxi-u-boot.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi index 0909a67883e..e1a9a7f5d4c 100644 --- a/arch/arm/dts/sunxi-u-boot.dtsi +++ b/arch/arm/dts/sunxi-u-boot.dtsi @@ -90,6 +90,7 @@ scp { filename = "scp.bin"; missing-msg = "scp-sunxi"; + optional; }; }; #endif From patchwork Tue Jun 11 20:01:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946513 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=HlZJ9uFs; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKRC20qsz1ydW for ; Wed, 12 Jun 2024 06:05:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2947B887B7; Tue, 11 Jun 2024 22:02:34 +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="HlZJ9uFs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3BB7588758; Tue, 11 Jun 2024 22:02:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 20F2D8871A for ; Tue, 11 Jun 2024 22:02:29 +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-il1-x12b.google.com with SMTP id e9e14a558f8ab-3758fbc25f3so14894805ab.3 for ; Tue, 11 Jun 2024 13:02:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136148; x=1718740948; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wvRkEuBZ1SEdecF6ABEjT77RDraKDJonNimggxkHM/s=; b=HlZJ9uFsyhla3TcHky59vY79mFN7uDBEYmPU3xPla9UjKUurZzWNWjgWhip+CIGNgb NWrS+6/ghEAzUTrsREkoomFr3dvXW8d7qyd84j2YZpOZLuKOxCv4TSj3mMDvmqDN/Snn kjauKT6V8x+I1H6aFur7dddxt+vcPtMvtlPiw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136148; x=1718740948; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wvRkEuBZ1SEdecF6ABEjT77RDraKDJonNimggxkHM/s=; b=hZSi1D+GHBF+GtcBBfgVNPg11bbR5//CIxOWaanET6p3bkHo/CWPWxnk8L0wmEpIom O9BpVDffpJL3E3PhCRfpyCEs1kSNqOn1VHNprusAlQCsIcqWb30zm9iZgdhCii2Gs3Co 3ec0h+3gocNSmAHVGZPxuCVb/oxsTb3mxQdh+TCON3coz0fTn1sgAIJDYSp/R2Xh5ibl AXSryQjFaxxEMwnYKPQMDCj8XbqU/eAskPv6MxxJltTrQhzOb/iytUSuFFL+JeoHhK27 rSuvsS+MHntpXSDnMhvF5HvWl6TkihphOpERaFnJo95TkS+X7PS+pUcQFrk8vUJZTMAi F6QA== X-Gm-Message-State: AOJu0Yy5NebjD+DxBDU/XnvrmkVUgYHPiu9GGjd4lsaTLlVUJRl9Qe2K G4k3yNokztQ/BYNj8RRDTCbgFBbvjzG9cftyuiglexnawDgFCTmollNCsnnzqb3PGqbjNpsRclV HYg== X-Google-Smtp-Source: AGHT+IFQGJv3RvoMbwFJI4YQVpfPrSFOdy1BsgCkJucOE+Ay8A8YIXNU4LpqTGF5+6YhEwlQDudbBg== X-Received: by 2002:a92:ca4a:0:b0:375:a282:c96b with SMTP id e9e14a558f8ab-375a282cc8fmr84130065ab.27.1718136147819; Tue, 11 Jun 2024 13:02:27 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:27 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Allen Martin , Bin Meng , Ilias Apalodimas , Jaehoon Chung , Marcel Ziswiler , Martyn Welch , Peter Robinson , Svyatoslav Ryhel Subject: [PATCH 17/42] google: Disable TPMv2 on most Chromebooks Date: Tue, 11 Jun 2024 14:01:31 -0600 Message-Id: <20240611200156.2245525-18-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean This feature is not present on older Chromebooks, so disable the setting. Signed-off-by: Simon Glass Reviewed-by: Ilias Apalodimas --- configs/chromebook_link64_defconfig | 1 + configs/chromebook_link_defconfig | 1 + configs/chromebook_samus_defconfig | 1 + configs/chromebook_samus_tpl_defconfig | 1 + configs/nyan-big_defconfig | 4 +--- configs/snow_defconfig | 1 + 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configs/chromebook_link64_defconfig b/configs/chromebook_link64_defconfig index 7cf23b29e46..9583f87bf0f 100644 --- a/configs/chromebook_link64_defconfig +++ b/configs/chromebook_link64_defconfig @@ -80,6 +80,7 @@ CONFIG_SYS_NS16550=y CONFIG_SYS_NS16550_PORT_MAPPED=y CONFIG_SPI=y CONFIG_TPM_TIS_LPC=y +# CONFIG_TPM_V2 is not set CONFIG_USB_STORAGE=y CONFIG_USB_KEYBOARD=y CONFIG_FRAMEBUFFER_SET_VESA_MODE=y diff --git a/configs/chromebook_link_defconfig b/configs/chromebook_link_defconfig index a9f91dd9b26..75a7a488a92 100644 --- a/configs/chromebook_link_defconfig +++ b/configs/chromebook_link_defconfig @@ -70,6 +70,7 @@ CONFIG_SYS_NS16550_PORT_MAPPED=y CONFIG_SOUND=y CONFIG_SPI=y CONFIG_TPM_TIS_LPC=y +# CONFIG_TPM_V2 is not set CONFIG_USB_STORAGE=y CONFIG_USB_KEYBOARD=y CONFIG_VIDEO_COPY=y diff --git a/configs/chromebook_samus_defconfig b/configs/chromebook_samus_defconfig index 40cc449b9b3..8cdad8d2344 100644 --- a/configs/chromebook_samus_defconfig +++ b/configs/chromebook_samus_defconfig @@ -74,6 +74,7 @@ CONFIG_SOUND_I8254=y CONFIG_SOUND_RT5677=y CONFIG_SPI=y CONFIG_TPM_TIS_LPC=y +# CONFIG_TPM_V2 is not set CONFIG_USB_STORAGE=y CONFIG_USB_KEYBOARD=y CONFIG_VIDEO_COPY=y diff --git a/configs/chromebook_samus_tpl_defconfig b/configs/chromebook_samus_tpl_defconfig index 3e7298f16af..1be57560f89 100644 --- a/configs/chromebook_samus_tpl_defconfig +++ b/configs/chromebook_samus_tpl_defconfig @@ -96,6 +96,7 @@ CONFIG_SOUND_RT5677=y CONFIG_SPI=y CONFIG_TPL_SYSRESET=y CONFIG_TPM_TIS_LPC=y +# CONFIG_TPM_V2 is not set CONFIG_USB_STORAGE=y CONFIG_USB_KEYBOARD=y CONFIG_FRAMEBUFFER_SET_VESA_MODE=y diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig index 4dec710cf8d..78fb7580da7 100644 --- a/configs/nyan-big_defconfig +++ b/configs/nyan-big_defconfig @@ -11,8 +11,6 @@ CONFIG_DEFAULT_DEVICE_TREE="tegra124-nyan-big" CONFIG_SPL_TEXT_BASE=0x80108000 CONFIG_SPL_STACK=0x800ffffc CONFIG_BOOTSTAGE_STASH_ADDR=0x83000000 -CONFIG_DEBUG_UART_BASE=0x70006000 -CONFIG_DEBUG_UART_CLOCK=408000000 CONFIG_TEGRA124=y CONFIG_TARGET_NYAN_BIG=y CONFIG_TEGRA_GPU=y @@ -75,7 +73,6 @@ CONFIG_DM_REGULATOR=y CONFIG_REGULATOR_AS3722=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_PWM_TEGRA=y -CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y CONFIG_SOUND=y CONFIG_I2S=y @@ -83,6 +80,7 @@ CONFIG_I2S_TEGRA=y CONFIG_SOUND_MAX98090=y CONFIG_TEGRA114_SPI=y CONFIG_TPM_TIS_INFINEON=y +# CONFIG_TPM_V2 is not set CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_TEGRA=y diff --git a/configs/snow_defconfig b/configs/snow_defconfig index 3a617c6cf40..2c0757194bd 100644 --- a/configs/snow_defconfig +++ b/configs/snow_defconfig @@ -88,6 +88,7 @@ CONFIG_SOUND_MAX98095=y CONFIG_SOUND_WM8994=y CONFIG_EXYNOS_SPI=y CONFIG_TPM_TIS_INFINEON=y +# CONFIG_TPM_V2 is not set CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y From patchwork Tue Jun 11 20:01:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946514 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Ker3UrRY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKRQ3qsRz1ydW for ; Wed, 12 Jun 2024 06:05:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 846E6887BE; Tue, 11 Jun 2024 22:02:34 +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="Ker3UrRY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 51BCB887A9; Tue, 11 Jun 2024 22:02:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 2FE4288710 for ; Tue, 11 Jun 2024 22:02:30 +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-il1-x129.google.com with SMTP id e9e14a558f8ab-374528b81ddso24067335ab.2 for ; Tue, 11 Jun 2024 13:02:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136149; x=1718740949; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Qf2T4EoOgEH5RJRfr6RU1JO8qUpBjihP5i6QW2xcyjQ=; b=Ker3UrRYgIPuUKlfw99AK4D3sFqfCytVN2glKzglXkEOorbWAbWv6H9FS8MN2yOnpH RgWyiBzSxqehUFA/DHbX7qdVJeeJNP+FkVP/PJCGmSa7YBOLvE/JwzB3aD49Ba6V/bID g0sJxg3o4LUjk2wb2/8BrSW5p5qLg+oYV49+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136149; x=1718740949; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qf2T4EoOgEH5RJRfr6RU1JO8qUpBjihP5i6QW2xcyjQ=; b=ZC7ChE9bH5z5FV17xb1BruEQaZMCY2QYZtn80x6YQXPSIktaTYtIpjSKFau0xJo758 TmitnIWhJeuYYcEvJmoeAVjrcduilmxOr4u1ueqoN0jufLCspMLRTrvTlfchJkdn8RpF mzV8Na/PlLp8CkIwUMqcKO1E3xaAt8ijgV7pxEb+O9EQDHuN/peSydmwBmUKf6cJemqm Dvz0qIdhqy17Tf229t7eBmAERu3j5FpM6vNdNcz2Vq8ZA4r5fT0NMF+TXPbsLnnD9rov W/Ppfu8wZY/pp8326HaV/o59jD8TtljLeZJa2zHNwofVX8tSaBvQaMEAnA8sB+W5OKsb uSPQ== X-Gm-Message-State: AOJu0Yys2QLB9qlbjiHXko+juuNyZ+AAl5N5owpTkgLPsn+CHl4a06vd JL12LjdPk6Mib4gzqvjYXWZxrAQE0hjpKKL764v3dw4mvzb1H3IQvHW0P8ZRdnohW/e0oKWbddi YFg== X-Google-Smtp-Source: AGHT+IEgSBtCT5zVxwq3XgJLg68nPLcdS6qLNF9VBoT46G4+sLMYy12e9VkY8oD7/qKDBKZEdDcsQg== X-Received: by 2002:a05:6e02:1487:b0:374:a412:3d95 with SMTP id e9e14a558f8ab-3758035f491mr152648375ab.20.1718136148668; Tue, 11 Jun 2024 13:02:28 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:28 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jerome Brunet , Neil Armstrong , Peter Robinson , u-boot-amlogic@groups.io Subject: [PATCH 18/42] meson: Correct driver declaration for meson_axg_gpio Date: Tue, 11 Jun 2024 14:01:32 -0600 Message-Id: <20240611200156.2245525-19-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean This should use the driver macros so that the driver appears in the linker list. Fix this. Fixes: 8587839f19d ("pinctrl: meson: add axg support") Signed-off-by: Simon Glass Reviewed-by: Neil Armstrong --- drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c | 2 +- drivers/pinctrl/meson/pinctrl-meson-axg.c | 4 ++-- drivers/pinctrl/meson/pinctrl-meson-axg.h | 2 +- drivers/pinctrl/meson/pinctrl-meson-g12a.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c b/drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c index 52c726cf038..15ebd574ef1 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c +++ b/drivers/pinctrl/meson/pinctrl-meson-axg-pmx.c @@ -179,7 +179,7 @@ static const struct dm_gpio_ops meson_axg_gpio_ops = { .direction_output = meson_gpio_direction_output, }; -const struct driver meson_axg_gpio_driver = { +U_BOOT_DRIVER(meson_axg_gpio) = { .name = "meson-axg-gpio", .id = UCLASS_GPIO, .probe = meson_gpio_probe, diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg.c b/drivers/pinctrl/meson/pinctrl-meson-axg.c index 94e09cd3f8a..ed3f92b2d75 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-axg.c +++ b/drivers/pinctrl/meson/pinctrl-meson-axg.c @@ -939,7 +939,7 @@ struct meson_pinctrl_data meson_axg_periphs_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_axg_periphs_groups), .num_funcs = ARRAY_SIZE(meson_axg_periphs_functions), .num_banks = ARRAY_SIZE(meson_axg_periphs_banks), - .gpio_driver = &meson_axg_gpio_driver, + .gpio_driver = DM_DRIVER_REF(meson_axg_gpio), .pmx_data = &meson_axg_periphs_pmx_banks_data, }; @@ -953,7 +953,7 @@ struct meson_pinctrl_data meson_axg_aobus_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_axg_aobus_groups), .num_funcs = ARRAY_SIZE(meson_axg_aobus_functions), .num_banks = ARRAY_SIZE(meson_axg_aobus_banks), - .gpio_driver = &meson_axg_gpio_driver, + .gpio_driver = DM_DRIVER_REF(meson_axg_gpio), .pmx_data = &meson_axg_aobus_pmx_banks_data, }; diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg.h b/drivers/pinctrl/meson/pinctrl-meson-axg.h index c8d2b3af036..a6581bab500 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-axg.h +++ b/drivers/pinctrl/meson/pinctrl-meson-axg.h @@ -61,6 +61,6 @@ struct meson_pmx_axg_data { } extern const struct pinctrl_ops meson_axg_pinctrl_ops; -extern const struct driver meson_axg_gpio_driver; +extern U_BOOT_DRIVER(meson_axg_gpio); #endif /* __PINCTRL_MESON_AXG_H__ */ diff --git a/drivers/pinctrl/meson/pinctrl-meson-g12a.c b/drivers/pinctrl/meson/pinctrl-meson-g12a.c index 24f47f82558..67114df6824 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-g12a.c +++ b/drivers/pinctrl/meson/pinctrl-meson-g12a.c @@ -1253,7 +1253,7 @@ static struct meson_pinctrl_data meson_g12a_periphs_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_g12a_periphs_groups), .num_funcs = ARRAY_SIZE(meson_g12a_periphs_functions), .num_banks = ARRAY_SIZE(meson_g12a_periphs_banks), - .gpio_driver = &meson_axg_gpio_driver, + .gpio_driver = DM_DRIVER_REF(meson_axg_gpio), .pmx_data = &meson_g12a_periphs_pmx_banks_data, }; @@ -1267,7 +1267,7 @@ static struct meson_pinctrl_data meson_g12a_aobus_pinctrl_data = { .num_groups = ARRAY_SIZE(meson_g12a_aobus_groups), .num_funcs = ARRAY_SIZE(meson_g12a_aobus_functions), .num_banks = ARRAY_SIZE(meson_g12a_aobus_banks), - .gpio_driver = &meson_axg_gpio_driver, + .gpio_driver = DM_DRIVER_REF(meson_axg_gpio), .pmx_data = &meson_g12a_aobus_pmx_banks_data, }; From patchwork Tue Jun 11 20:01:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946515 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jwaF4/tp; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKRd5kSkz1ydW for ; Wed, 12 Jun 2024 06:05:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E2580887C0; Tue, 11 Jun 2024 22:02:34 +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="jwaF4/tp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 28F57887B4; Tue, 11 Jun 2024 22:02:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 0CA7888730 for ; Tue, 11 Jun 2024 22:02:31 +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-il1-x129.google.com with SMTP id e9e14a558f8ab-3737b47c0acso25283865ab.3 for ; Tue, 11 Jun 2024 13:02:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136149; x=1718740949; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xcQmcXiYKGIPan3cCnjiFgcA5e7cuV+KxudUtOwwAbI=; b=jwaF4/tpRFcntjO+WCJ8N2mBw1/Q22+yxopai4rvCMDZ0yN+u8jeTwqMLe0hSrpp7s i6NgwMfdjaLGFq1rjb5jEf7dyCc+xlLB8tTAgQ+lZr8dK/2OHW8TsBIKoUW9NTnAdqXF 4W+kopMphzfqry+Jie7x106GckRPFC//qJ0m8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136149; x=1718740949; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xcQmcXiYKGIPan3cCnjiFgcA5e7cuV+KxudUtOwwAbI=; b=WroRK4kHu2kNXlGsCTGXYEI2A+XOHi4psotkSKSEAgHVTFFTp2iEXNwPjXFg7uuPq4 bRfGwcF7895O+p93C8cPgLj2lOb3d4l/f2bR6ERDW/bniqWb1vBejy6sx72GC4qG4vWt 0ELw0K4tIWF2U0wnmgjVB0oZjsCaleXd0zcgsk4y4iab4blHDpjdywvvUwUmuYbMdLTL jrAepHgnhhXODEzmcvSzVve96FwuaUfxRPYa3flX2O+KRskZVNp/r7SK1zzyU39zvL6G 69k9hOlhH4HPsme3C/2CUuUzL8FnVRzhZqCXTtcSa+FnctL7hDy97kXwdY0dL1xuFdG/ m9lg== X-Gm-Message-State: AOJu0YyMIcVClXj69H1+Aw3idP8lCdd9/zwEty3suulIIAJr1XeEVzy6 2vdFV/CsxQ24unA9l4Cl84mgI0KSRTS4lUgPyGfdZ20ecve9QBhgQkumSlLJCLISVsT9dl1R76o UeA== X-Google-Smtp-Source: AGHT+IEHUmuyUIHRQ0MpYcLAZmHnui8TT5OywSJGYQOVAEnx/0CQnZ2tv7RpZgHwGWTDhdj59XPV1A== X-Received: by 2002:a92:c241:0:b0:375:a48d:fda1 with SMTP id e9e14a558f8ab-375a48e0215mr78102685ab.2.1718136149588; Tue, 11 Jun 2024 13:02:29 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:29 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 19/42] test: Allow signaling that U-Boot is ready Date: Tue, 11 Jun 2024 14:01:33 -0600 Message-Id: <20240611200156.2245525-20-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean When Labgrid is used, it can get U-Boot ready for running tests. It prints a message when it has done so. Add logic to detect this message and accept it. Signed-off-by: Simon Glass --- test/py/u_boot_console_base.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index 3e01be11029..e230caf37e1 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -22,6 +22,7 @@ pattern_stop_autoboot_prompt = re.compile('Hit any key to stop autoboot: ') pattern_unknown_command = re.compile('Unknown command \'.*\' - try \'help\'') pattern_error_notification = re.compile('## Error: ') pattern_error_please_reset = re.compile('### ERROR ### Please RESET the board ###') +pattern_ready_prompt = re.compile('U-Boot is ready') PAT_ID = 0 PAT_RE = 1 @@ -170,15 +171,15 @@ class ConsoleBase(object): self.bad_pattern_ids[m - 1]) self.u_boot_version_string = self.p.after while True: - m = self.p.expect([self.prompt_compiled, + m = self.p.expect([self.prompt_compiled, pattern_ready_prompt, pattern_stop_autoboot_prompt] + self.bad_patterns) - if m == 0: + if m == 0 or m == 1: break - if m == 1: + if m == 2: self.p.send(' ') continue raise Exception('Bad pattern found on console: ' + - self.bad_pattern_ids[m - 2]) + self.bad_pattern_ids[m - 3]) except Exception as ex: self.log.error(str(ex)) From patchwork Tue Jun 11 20:01:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946516 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Q2iORBnF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKRs4cn8z1ydW for ; Wed, 12 Jun 2024 06:06:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4EC30887CE; Tue, 11 Jun 2024 22:02:37 +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="Q2iORBnF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C23AE887B4; Tue, 11 Jun 2024 22:02:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 B322788789 for ; Tue, 11 Jun 2024 22:02:31 +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-il1-x12b.google.com with SMTP id e9e14a558f8ab-3759e1ca122so12540555ab.2 for ; Tue, 11 Jun 2024 13:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136150; x=1718740950; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+4PckMd1VrN3KC+ErpFYV2XSdLhICyhnWuN5RSX9y+Y=; b=Q2iORBnF6HuID51kVC1KXrlk/os5uaEF+HB8QSv1Rhng550uE391h2FZHxhMK51gqn oEslTN1p+RV4hyd0mlSAZ0ricHE5Q0CnvkCigLW9yL0Wg3jSBsrL1Q8X6LGrtOeOU3sO WgFijom3T/wj8xi2UJMlPEgLkAj0rJhJYXjlI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136150; x=1718740950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+4PckMd1VrN3KC+ErpFYV2XSdLhICyhnWuN5RSX9y+Y=; b=CtKmWUotlLsLHYmdICHNnLF40wkbsinQt2SIWRhyzzezparUZqEXwPkOthHImvqBMx I2B7og1pO4xCI3t+8RGOFesrtqiwbKIfXFdtdkGOe4CWLG11jVbuthH+pGTuqjXaWoRp ul2aNqiNNIROIcPlByvMD04T1r7xLhjY1+f8DE2HlHTuFNT2Ke2QkLOO3DQoPnxi/YV4 l1Y6rEYxsmvV6QSMarPEF1DremyqpglQlyUzQU+gKkXObpyxEncwdnaZsc8dAkGZbddr jy3aFxkM3/H+2nJhFJmhqvJL+MYs+9FPQ5c9MtUok4jpianL+YphTnWMzObf4t4G2Z3g 7Fjw== X-Gm-Message-State: AOJu0YzMMUVKczGaOb9hF2dqx+0Zb1fldm9LTEFtujhuPWueK+aDEr+G rp5Wr9zWU4tEr1f7PjCgmhpgHA1YTwWEyK4CLxxE9rsJ7YtQnCeBd/RPEYE6bp/BNKK+cZXzoVc BfA== X-Google-Smtp-Source: AGHT+IEoAsGUQLZ8kV+U3Tju18j7aPt5AVUq15xdmn3p2/1Lc01JjnzYzP6GJ15RT9krOAZI9fdQPw== X-Received: by 2002:a05:6e02:1d17:b0:375:a8a8:8e7 with SMTP id e9e14a558f8ab-375a8a80dadmr71719035ab.8.1718136150481; Tue, 11 Jun 2024 13:02:30 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:30 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alexander Gendin , Francis Laniel Subject: [PATCH 20/42] test: Make bootstd init run only on sandbox Date: Tue, 11 Jun 2024 14:01:34 -0600 Message-Id: <20240611200156.2245525-21-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Tests for standard boot need disks to be set up, which can only be done on sandbox, since adjusting disks on real hardware is not currently supported. Mark the init function as sandbox-only. Signed-off-by: Simon Glass --- test/py/tests/test_ut.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py index c169c835e38..58205066ec8 100644 --- a/test/py/tests/test_ut.py +++ b/test/py/tests/test_ut.py @@ -470,6 +470,7 @@ def test_ut_dm_init(u_boot_console): fh.write(data) @pytest.mark.buildconfigspec('cmd_bootflow') +@pytest.mark.buildconfigspec('sandbox') def test_ut_dm_init_bootstd(u_boot_console): """Initialise data for bootflow tests""" From patchwork Tue Jun 11 20:01:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946517 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=h75GiK00; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKS451XLz1ydW for ; Wed, 12 Jun 2024 06:06:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AEBD2887DA; Tue, 11 Jun 2024 22:02:37 +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="h75GiK00"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9B158887C1; Tue, 11 Jun 2024 22:02:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (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 8790A887B2 for ; Tue, 11 Jun 2024 22:02:32 +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-il1-x12f.google.com with SMTP id e9e14a558f8ab-3737b250ef9so23344725ab.0 for ; Tue, 11 Jun 2024 13:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136151; x=1718740951; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RKh1S8djeXX8dGLZBAmWB3QkCr648dmxKHJXLSrALSg=; b=h75GiK00l1W3QqGpCkjQYM7utf17Vi8KVvhWiH2jzwTiZu36AIk/U/1tGWhdpziX2s X2NJ2+0e4gSWBoJPvGvG0AZVgnBqskioAJmjthxEoSPA3u6PEyV86SvAFff5BrLBoxSq hL+l8GMESv7p/wJtVJbj88ySatFiXHDnR+8Hk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136151; x=1718740951; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RKh1S8djeXX8dGLZBAmWB3QkCr648dmxKHJXLSrALSg=; b=lxNhFw+Pdm9xvIbHGrNaPen1JDOCMgoIO1cgtc6pG38I3DLoHj77TKTF/zoVKQz01J jnnpB+UO6Jinn7WkhCb6wfjj/1NT9lNF6CsuwJSSBxak40VX+OHDMjMHBjlZf3z6I3yz FCpfbV2xjq/jss9ozT0cbptscBGSvT0KVfDpujfgp4bl7cyPRxJJnC+v5/GM/Pr08JM6 lcAgyQBMPYv2+agAi0Z628KHmmJCD42J5skxFVuckz4sAs2O4hjOsHh6Ca1g0Hg7Ovaf m5C70qaFQRbx7NL0SE5AsLU/S+lSS/3LMcsDQ6pTZni4JeMOI6eUG841T3euA+xO+9za Qy7Q== X-Gm-Message-State: AOJu0YwJ01UPSelHEOJ3no0KxE0zVZMI9WFUbUhOGXJ80Ylhkb0aDFI4 ZDgPAPwi4Txqa8w8Aglca9yRVbdl/oT01zJtdaMRpvsr+aGcWegOkO4ESMt110z3+2Kdp6+ISMH JmA== X-Google-Smtp-Source: AGHT+IGST5HWkhcGRRKQw88WzzMuaWG0INrwwsVTPn+sMlHkeq0Kyb7BGL7gXbj5LK2uyWN098DLGw== X-Received: by 2002:a92:ca4a:0:b0:375:a282:c96b with SMTP id e9e14a558f8ab-375a282cc8fmr84131745ab.27.1718136151173; Tue, 11 Jun 2024 13:02:31 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:31 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 21/42] test: Use a constant for the test timeout Date: Tue, 11 Jun 2024 14:01:35 -0600 Message-Id: <20240611200156.2245525-22-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Declare a constant rather than open-coding the same value twice. Signed-off-by: Simon Glass --- test/py/u_boot_console_base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index e230caf37e1..e4f86f6af5b 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -27,6 +27,9 @@ pattern_ready_prompt = re.compile('U-Boot is ready') PAT_ID = 0 PAT_RE = 1 +# Timeout before expecting the console to be ready (in milliseconds) +TIMEOUT_MS = 30000 + bad_pattern_defs = ( ('spl_signon', pattern_u_boot_spl_signon), ('main_signon', pattern_u_boot_main_signon), @@ -397,7 +400,7 @@ class ConsoleBase(object): # Reset the console timeout value as some tests may change # its default value during the execution if not self.config.gdbserver: - self.p.timeout = 30000 + self.p.timeout = TIMEOUT_MS return try: self.log.start_section('Starting U-Boot') @@ -408,7 +411,7 @@ class ConsoleBase(object): # future, possibly per-test to be optimal. This works for 'help' # on board 'seaboard'. if not self.config.gdbserver: - self.p.timeout = 30000 + self.p.timeout = TIMEOUT_MS self.p.logfile_read = self.logstream if expect_reset: loop_num = 2 From patchwork Tue Jun 11 20:01:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946518 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=mBrspzp2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKSK1LLsz1ydW for ; Wed, 12 Jun 2024 06:06:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1F77F887E2; Tue, 11 Jun 2024 22:02:38 +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="mBrspzp2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2E4CE887C2; Tue, 11 Jun 2024 22:02:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 2123888717 for ; Tue, 11 Jun 2024 22:02:33 +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-il1-x135.google.com with SMTP id e9e14a558f8ab-37588517095so19782485ab.2 for ; Tue, 11 Jun 2024 13:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136152; x=1718740952; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=25PMBjQA8NgI3xIumRB4sJ3DyECLP6DF31sohVNFl8M=; b=mBrspzp2PT409bz+2lLt4d62FSrD8rmDQVt6U1mG2GnkRiiM6cSt78CXNALRUyDfFu 7CcSmTgn+jXJpuV2XQOCUFp1o7gFHWFbTwYQMQJDL7MqooYFdy3rJFtmh39PuMFe0mJR W+yUDtwyPRtmQYwtu8wsAqJieN7hzNWaKdeMY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136152; x=1718740952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=25PMBjQA8NgI3xIumRB4sJ3DyECLP6DF31sohVNFl8M=; b=b9/jkvQeUt7zUXinhPeqEDvgxmuw6ZPwtmOD2NFSkMjqZG1D2gT0eRzlyxzDnrck5E DCc3+GyAcVYOnTEKih0SyE6ICXxBVkLJ4JEBEWF5iRv7cPEf9RkN6WLyLkbUAJkQGFva O9Gdbnfv/NBXt9ZKvIZOOZ0EnTcX8GR+wQ77jxDQ5+xU8NgZrkCW/bzG0iw04/Zd5lIr PavxKYYxbTjd2KAeun5BmRItXE19EbCpzZL6tHV5S0DJsGYayn/lzvuetK3xwFG2LFtF jt4VSkgkPr8P6rvtsrFC+z0HU4ky0qflgyHVaFJuI2dkykjWz7Sbep5mI+sMr9+rZ0ie S9Ew== X-Gm-Message-State: AOJu0YwH6lRC4bYAcqExupRqN5fvPb+GQfdIK2oOFM8Jg9rVxSARbY0X AAn2IkzbgMS+pxrws4qXNyE40FZt9/axC1S3iN/LFlBbiNHfhs8V15xba8j1lj4U3JLai71T76K Dzw== X-Google-Smtp-Source: AGHT+IEoay25ZSwA/9O9AfBCIInQZhOPEnXjSBhwxCU8TZBkvo8Klx8v1FD3s7oV/l6We5hdHXXeJQ== X-Received: by 2002:a05:6e02:1c26:b0:375:b095:808c with SMTP id e9e14a558f8ab-375b095838cmr49662175ab.16.1718136151851; Tue, 11 Jun 2024 13:02:31 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:31 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 22/42] test: Pass stderr to stdout Date: Tue, 11 Jun 2024 14:01:36 -0600 Message-Id: <20240611200156.2245525-23-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Some tests may output things to stderr. Ensure that this output is not dropped, by redirecting it to stdout Signed-off-by: Simon Glass --- test/py/u_boot_spawn.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 7c48d96210e..7421da49aa9 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -10,6 +10,7 @@ import re import pty import signal import select +import sys import time import traceback @@ -57,6 +58,7 @@ class Spawn: signal.signal(signal.SIGHUP, signal.SIG_DFL) if cwd: os.chdir(cwd) + sys.stderr = sys.stdout os.execvp(args[0], args) except: print('CHILD EXECEPTION:') From patchwork Tue Jun 11 20:01:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946521 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=V/fKeea+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKT25Lkbz1ydW for ; Wed, 12 Jun 2024 06:07:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3F6E8887EA; Tue, 11 Jun 2024 22:02:41 +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="V/fKeea+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D6DBE887C7; Tue, 11 Jun 2024 22:02:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (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 B8C30887C6 for ; Tue, 11 Jun 2024 22:02:35 +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-io1-xd32.google.com with SMTP id ca18e2360f4ac-7e201ab539eso239205039f.1 for ; Tue, 11 Jun 2024 13:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136154; x=1718740954; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5kQ0sfNktLS9BPxE2/bMuAta0itAhnN3N9PgOmsWa5Q=; b=V/fKeea+ULUd39yciwWFZWjDwdCPJjsTnQoQ1+MS04Bd4opR0jw95gQZkhEoJ569M5 JttlLN+vbiIRUUSKPaiGsfQCDNx9JQGkHtTuKam1rZmfrxLk92F3KIiw7TXRKf/YDVjK NxjXyl4hq07X3n3TIm3VUN+jlmikWMX8s1GNU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136154; x=1718740954; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5kQ0sfNktLS9BPxE2/bMuAta0itAhnN3N9PgOmsWa5Q=; b=O+IBNJuh1S0gxvu35ZhxauqXjx0Xy4sqAhGYviUI/3JCOz0Crd/NU6gE01Sx02VB9J huOmchjrDWC/WxBVQxwuOCdOvpUfP01IieYRgti2BdFVzp5pFiy0tbVoVKjQT0uM+zkG oms+GJONYm8mxZrVztUsUOtoXQ0YOWvLsxQuwgtgwkc4VTNp932XBN0GeO+/+YfDvjRJ tLzZE0hvsYijXwHcKImtt+KG0IDPhh1xT9+ME0ssyPQyN/Q+XtJiAXbdeaeR6huOF1lH oguHR8EY0myy1v+Sf3y+KKvUzZyr3E6YmM25qV69iGTRfpNaZv1QIQaLMrRJHHd7giLT Aw1A== X-Gm-Message-State: AOJu0YxN1ikFfVdpbvfwDw0k/SMlQynfSOUwJgRDkisZinr4Z+7T4KUT QQloKRAsUNfAr8BO/DJwAnjnBudi9VSuO8mPz5SKFClp2uwWK4S8ip3yb4+pcWBCnZvz6++HDa7 nbA== X-Google-Smtp-Source: AGHT+IEgbKaTxMTU0XUtOA6rkYPrm6dyjZZWgnA63tI2soSpXFucB1WOM0F+E3M5UEMhifPnIgRBrg== X-Received: by 2002:a05:6e02:168c:b0:375:c3a3:4c16 with SMTP id e9e14a558f8ab-375c3a34d74mr17914505ab.18.1718136152682; Tue, 11 Jun 2024 13:02:32 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:32 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 23/42] test: Release board after tests complete Date: Tue, 11 Jun 2024 14:01:37 -0600 Message-Id: <20240611200156.2245525-24-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean When a board is finished with, the lab may want to power it off, or perform some other function. Add a new script which is called when tests are complete. Signed-off-by: Simon Glass --- test/py/u_boot_console_exec_attach.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/py/u_boot_console_exec_attach.py b/test/py/u_boot_console_exec_attach.py index 8dd8cc1230c..5f4916b7da2 100644 --- a/test/py/u_boot_console_exec_attach.py +++ b/test/py/u_boot_console_exec_attach.py @@ -70,3 +70,13 @@ class ConsoleExecAttach(ConsoleBase): raise return s + + def close(self): + super().close() + + self.log.action('Releasing board') + args = [self.config.board_type, self.config.board_identity] + cmd = ['u-boot-test-release'] + args + runner = self.log.get_runner(cmd[0], sys.stdout) + runner.run(cmd) + runner.close() From patchwork Tue Jun 11 20:01:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946519 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=RdcLck5G; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKSZ1Gznz1ydW for ; Wed, 12 Jun 2024 06:06:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7AF1F887C1; Tue, 11 Jun 2024 22:02:40 +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="RdcLck5G"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0CEF9887CA; Tue, 11 Jun 2024 22:02:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 EBB6F887C1 for ; Tue, 11 Jun 2024 22:02:34 +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-il1-x12b.google.com with SMTP id e9e14a558f8ab-374a342cf47so18683185ab.0 for ; Tue, 11 Jun 2024 13:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136153; x=1718740953; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ab92cG+vAGgLwXnrxG/TMlEX8bfg48nqM7Ek2Jfns+A=; b=RdcLck5Givwi1gHfjX1NScxtiav/+Gkrin/pwQn0nwnnB37GUuA8QhFPe4r0EXwyog Tu4g5Tcq9921PMtf6a8YDRcZboBzx+2UJbQAl3UlR3qUWa+NChOAcZDXFEC/r4407FAc IlAJGlvq7kJ5irhgC437DSxBN5siYfXbfDBwE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136153; x=1718740953; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ab92cG+vAGgLwXnrxG/TMlEX8bfg48nqM7Ek2Jfns+A=; b=tvXGcqhAgo+XZ0sG3EOGWbBCFhvWKztYt5ctRemoUASCkbzASJ8djMRBGA/+zvLYQW BLXMBPoOwOaiepvkqsY0MePBOtYTdQDI6Ux4mMESlwccfVnNWa8TTs9CQRx5NXHmquCn Mv0Nk9NIMVo3SVFnu5PbubdXn+g3cdztDnH+kh3rnvE0brRI6+jxF+VIrLCs4RJqJPIL 9q5Kkr2ovnk9cRm7XRP5BZfBIzx6/CQp6Lq3WkST+G1QSBhD6lzllv3Aaw7ypDZFYqFT boS762L6Wful07IGvmmshRIq8qeiZdfoJX7qRAv/Bq9YuqWOuuEZw3L3vY1ysnxX/vpE Mh4Q== X-Gm-Message-State: AOJu0YzBJpqxKyoxHB2FaWl+6NayIjfiK0aLfjbMs1UzfgPUugNMXBtc K4yMx6W/hueuxHaJj1yWx2km2oOtRAvbutxwn6FNbtrdBVzE80780Z2AQB9fETqZhOniNYJl0tt Ldw== X-Google-Smtp-Source: AGHT+IF7VcJIg2VAjDfcoV7SX6G/r0m3DQ+0QBhZQ8hMqSuNlqkcGogo7628/CLpz/CQpzgqHWmzkg== X-Received: by 2002:a05:6e02:148a:b0:375:be2b:3a4e with SMTP id e9e14a558f8ab-375be2b3bdfmr28267045ab.5.1718136153580; Tue, 11 Jun 2024 13:02:33 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:33 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 24/42] log: Allow tests to pass with CONFIG_LOGF_FUNC_PAD set Date: Tue, 11 Jun 2024 14:01:38 -0600 Message-Id: <20240611200156.2245525-25-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean This setting pads out the function names. Adjust the test to handle this, since some boards use it. Signed-off-by: Simon Glass --- test/py/tests/test_log.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/py/tests/test_log.py b/test/py/tests/test_log.py index 140dcb9aa2b..79808674bbe 100644 --- a/test/py/tests/test_log.py +++ b/test/py/tests/test_log.py @@ -27,13 +27,16 @@ def test_log_format(u_boot_console): cons = u_boot_console with cons.log.section('format'): - run_with_format('all', 'NOTICE.arch,file.c:123-func() msg') + pad = int(u_boot_console.config.buildconfig.get('config_logf_func_pad')) + padding = ' ' * (pad - len('func')) + + run_with_format('all', f'NOTICE.arch,file.c:123-{padding}func() msg') output = cons.run_command('log format') assert output == 'Log format: clFLfm' - run_with_format('fm', 'func() msg') - run_with_format('clfm', 'NOTICE.arch,func() msg') - run_with_format('FLfm', 'file.c:123-func() msg') + run_with_format('fm', f'{padding}func() msg') + run_with_format('clfm', f'NOTICE.arch,{padding}func() msg') + run_with_format('FLfm', f'file.c:123-{padding}func() msg') run_with_format('lm', 'NOTICE. msg') run_with_format('m', 'msg') From patchwork Tue Jun 11 20:01:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946520 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=J+kB4nSL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKSq118hz1ydW for ; Wed, 12 Jun 2024 06:06:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D6E8988749; Tue, 11 Jun 2024 22:02:40 +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="J+kB4nSL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA8A9887E2; Tue, 11 Jun 2024 22:02:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 9CCB2887C2 for ; Tue, 11 Jun 2024 22:02:35 +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-il1-x141.google.com with SMTP id e9e14a558f8ab-37594abcee7so14700705ab.0 for ; Tue, 11 Jun 2024 13:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136154; x=1718740954; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f8d5pCrKZer70FEt7ghOMSkmBnRDlmL/iRc57EkYTMI=; b=J+kB4nSLNh5gav9QoEodCx2U4wqEunwUXSvPVnCV2CyN2wXpGda109XA5ToaVxS+JQ /ykAza+raGbxV8ectH9dMxuq2ieYTR1BeTPtgD9CDYc4r1kRRkmqBykNcResuCXxkluW N0KPQBfHHmH0Dmu/qV2HoVIjRUhbi0e9vBi0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136154; x=1718740954; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f8d5pCrKZer70FEt7ghOMSkmBnRDlmL/iRc57EkYTMI=; b=ofNRbS8RKUQF7O03ROVrMxPZUVsc/w9sU6UKlftP2wM6bS/bVkAHelPi33j5GQnkjy Ol5L657hfb/i8xR9gD9JrNIKAuB6idP3kA73E5mrb+B9dq0UVkgnN9K/UQqp9Hg6GR6i /e5DAbSNW2pJrg7EEcGM89ZJZkKl1AATl+TPV4WhPnHhxsNIO6tDcLdepMZBbPCHgpC9 afI157IAwTtxy9fRRpw5ily3JvQ51bDltRDTlBaQ3FXILcByR6noFMobrV3vF4iSWhXg MKWbM/KZ0FGizV/7sKDtgPUj70doAwHzVit37owlXKhYpUXHc2kBf6vcxAol2EnGRbyg EHvg== X-Gm-Message-State: AOJu0YzvNiWTttjjdFHXxUPjH5aZ0U8m0Be014n6LvANSP6EGpS5be6k NvaphfyRDGnDLbHKz3MCoXwTPcyekTXKrmesmH+tpZWyleQ6SXV2mRQha0WMv71qz7L/klCLs8w F+kR0 X-Google-Smtp-Source: AGHT+IH9LCSH2zQRudpzDlxUbG410G4HwejEtp3gwkeg/9yb01mQcPNR9U8u89LoylnNYfU0MRNgcg== X-Received: by 2002:a05:6e02:1c8f:b0:375:9e20:beef with SMTP id e9e14a558f8ab-3759e20c202mr91265645ab.0.1718136154286; Tue, 11 Jun 2024 13:02:34 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:34 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 25/42] test: Allow connecting to a running board Date: Tue, 11 Jun 2024 14:01:39 -0600 Message-Id: <20240611200156.2245525-26-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Sometimes we know that the board is already running the right software, so provide an option to allow running of tests directly, without first resetting the board. This saves time when re-running a test where only the Python code is changing. Signed-off-by: Simon Glass --- test/py/conftest.py | 3 +++ test/py/u_boot_console_base.py | 14 ++++++++++---- test/py/u_boot_console_exec_attach.py | 21 ++++++++++++--------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index fc9dd3a83f8..ca66b9d9e61 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -79,6 +79,8 @@ def pytest_addoption(parser): parser.addoption('--gdbserver', default=None, help='Run sandbox under gdbserver. The argument is the channel '+ 'over which gdbserver should communicate, e.g. localhost:1234') + parser.addoption('--no-prompt-wait', default=False, action='store_true', + help="Assume that U-Boot is ready and don't wait for a prompt") def run_build(config, source_dir, build_dir, board_type, log): """run_build: Build U-Boot @@ -238,6 +240,7 @@ def pytest_configure(config): ubconfig.board_type = board_type ubconfig.board_identity = board_identity ubconfig.gdbserver = gdbserver + ubconfig.no_prompt_wait = config.getoption('no_prompt_wait') ubconfig.dtb = build_dir + '/arch/sandbox/dts/test.dtb' env_vars = ( diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index e4f86f6af5b..a61eec31148 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -413,11 +413,17 @@ class ConsoleBase(object): if not self.config.gdbserver: self.p.timeout = TIMEOUT_MS self.p.logfile_read = self.logstream - if expect_reset: - loop_num = 2 + if self.config.no_prompt_wait: + # Send an empty command to set up the 'expect' logic. This has + # the side effect of ensuring that there was no partial command + # line entered + self.run_command(' ') else: - loop_num = 1 - self.wait_for_boot_prompt(loop_num = loop_num) + if expect_reset: + loop_num = 2 + else: + loop_num = 1 + self.wait_for_boot_prompt(loop_num = loop_num) self.at_prompt = True self.at_prompt_logevt = self.logstream.logfile.cur_evt except Exception as ex: diff --git a/test/py/u_boot_console_exec_attach.py b/test/py/u_boot_console_exec_attach.py index 5f4916b7da2..42fc15197b9 100644 --- a/test/py/u_boot_console_exec_attach.py +++ b/test/py/u_boot_console_exec_attach.py @@ -59,15 +59,18 @@ class ConsoleExecAttach(ConsoleBase): args = [self.config.board_type, self.config.board_identity] s = Spawn(['u-boot-test-console'] + args) - try: - self.log.action('Resetting board') - cmd = ['u-boot-test-reset'] + args - runner = self.log.get_runner(cmd[0], sys.stdout) - runner.run(cmd) - runner.close() - except: - s.close() - raise + if self.config.no_prompt_wait: + self.log.action('Connecting to board without reset') + else: + try: + self.log.action('Resetting board') + cmd = ['u-boot-test-reset'] + args + runner = self.log.get_runner(cmd[0], sys.stdout) + runner.run(cmd) + runner.close() + except: + s.close() + raise return s From patchwork Tue Jun 11 20:01:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946522 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=RzE6PkT6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKTF5jddz1ydW for ; Wed, 12 Jun 2024 06:07:13 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9E93B887B8; Tue, 11 Jun 2024 22:02:41 +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="RzE6PkT6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 84D98887E8; Tue, 11 Jun 2024 22:02:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 5E31C8859A for ; Tue, 11 Jun 2024 22:02:36 +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-il1-x131.google.com with SMTP id e9e14a558f8ab-375932c94f0so7404325ab.0 for ; Tue, 11 Jun 2024 13:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136155; x=1718740955; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QNUvBXjivKarqdxeSd0NQYDCsDvN7Yplcy0JmaYqxJY=; b=RzE6PkT6mHWhZ3xHO6rssNi9Tfztm9fojw6yYZY45T//9yQpa5kbD2u/kkILVvCGtD 95QHnRR6a8snA5WwIQ/cI54nLF6kiHGURo+Q8goTde/w1Auz5iNaZTiaH6FxP7VQB9+Q b4BLncoz2jHuukP6pD4q2ftVlLoD8NhAFvdzg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136155; x=1718740955; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QNUvBXjivKarqdxeSd0NQYDCsDvN7Yplcy0JmaYqxJY=; b=Xkj9t5g5ng3UryHOB6iQ9KVUamdYxn3j2iuUGCdYTeqr9VyWP6MJ30cxkN0Ccpvqci hAlIuOT6Wx0ZPhYJUuCqkubZFH2ETNzBKxJ0w6R3nQIhQ8KuyZoxDLnR6WBsHApk3y5K 0umMX/hDjBvTfCl0ztUZHQRWRLvEFWg3CK16dm5Fi8Tdxzh53oiQ8pXwRNlSTLyhihNf TdvCRAhKUomBatzh+2V1orD0h6l/sUvOO6FHgtmn4El9R1+y9YV5JTAJTQYNzgV0b7f0 l3JiN466dQYGCdeJfJaH9SDTDoV2W+1uW76XvZP43xTmOXZEpqlbXfVYH10XapL5RsHv pZcw== X-Gm-Message-State: AOJu0YziNgxuvYzr4/oU1LXVU1z0CPmwzZPq6GDH+Furg3hvmAbKArcE kKn69PyZdqJONsEI1/hixEfCtv7dQJEaY8z34R+mN6eIXus8Ahtgb2UKB4uPgwLmJZqpRtmgmNS y2g== X-Google-Smtp-Source: AGHT+IGvFpe3e8fGDZR/XPibtAzSGpzo+L4VZnT6BE7Nw6mgxUmAXXhALyCXKBQU/oyYGRd+K78Wzw== X-Received: by 2002:a05:6e02:188d:b0:375:a180:b3d1 with SMTP id e9e14a558f8ab-375a180b7ccmr97126915ab.20.1718136155044; Tue, 11 Jun 2024 13:02:35 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:34 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 26/42] test: Decode exceptions only with sandbox Date: Tue, 11 Jun 2024 14:01:40 -0600 Message-Id: <20240611200156.2245525-27-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean When a real board fails we don't want to decode the exception. Reserve that behaviour for sandbox. Also avoid raising a new exception on failure - just re-raise the existing one. Signed-off-by: Simon Glass --- test/py/u_boot_console_sandbox.py | 2 +- test/py/u_boot_spawn.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/py/u_boot_console_sandbox.py b/test/py/u_boot_console_sandbox.py index 27c6db8d719..7bc44c78b8b 100644 --- a/test/py/u_boot_console_sandbox.py +++ b/test/py/u_boot_console_sandbox.py @@ -58,7 +58,7 @@ class ConsoleSandbox(ConsoleBase): if self.use_dtb: cmd += ['-d', self.config.dtb] cmd += self.sandbox_flags - return Spawn(cmd, cwd=self.config.source_dir) + return Spawn(cmd, cwd=self.config.source_dir, decode_signal=True) def restart_uboot_with_flags(self, flags, expect_reset=False, use_dtb=True): """Run U-Boot with the given command-line flags diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 7421da49aa9..81a09a9d639 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -25,18 +25,20 @@ class Spawn: output: accumulated output from expect() """ - def __init__(self, args, cwd=None): + def __init__(self, args, cwd=None, decode_signal=False): """Spawn (fork/exec) the sub-process. Args: args: array of processs arguments. argv[0] is the command to execute. cwd: the directory to run the process in, or None for no change. + decode_signal (bool): True to indicate the exception number when + something goes wrong Returns: Nothing. """ - + self.decode_signal = decode_signal self.waited = False self.exit_code = 0 self.exit_info = '' @@ -199,12 +201,12 @@ class Spawn: # With sandbox, try to detect when U-Boot exits when it # shouldn't and explain why. This is much more friendly than # just dying with an I/O error - if err.errno == 5: # Input/output error + if self.decode_signal and err.errno == 5: # I/O error alive, _, info = self.checkalive() if alive: raise err raise ValueError('U-Boot exited with %s' % info) - raise err + raise if self.logfile_read: self.logfile_read.write(c) self.buf += c From patchwork Tue Jun 11 20:01:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946523 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=fQ5gX5pd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKTT3yJRz1ydW for ; Wed, 12 Jun 2024 06:07:25 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F274E887F8; Tue, 11 Jun 2024 22:02:41 +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="fQ5gX5pd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AE451887B4; Tue, 11 Jun 2024 22:02:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (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 2BBA0887CA for ; Tue, 11 Jun 2024 22:02:37 +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-il1-x12d.google.com with SMTP id e9e14a558f8ab-375b27243e5so7426185ab.0 for ; Tue, 11 Jun 2024 13:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136156; x=1718740956; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XUJkuHT8rngSmGrSwhsyZ88bgz7zpFTxpmcB6oq9qLU=; b=fQ5gX5pduouCOK3yDnR73y37PrUrguJUcOIaRQiMLRA2USJ328C+rcGlE4Pr7yPVXz OTNkEQVeK6xJfPIuHxzKhl/mProTkee4OwEKnIfN/SEQjK7kl+6m5oj5qynu175DfElK +oejKs8rku46d6m7zb4Ig3H12iVtOO8zU+YfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136156; x=1718740956; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XUJkuHT8rngSmGrSwhsyZ88bgz7zpFTxpmcB6oq9qLU=; b=uJmjQnFMByoH06osYH+bKXh94MUT4SBrA/+YHwjR6YoSFoGrroStdE760eoRAWuxcD 2S82a/z+jmUIcbNhyNMzHkNcjDLcE9fvW+TryCc9idNxSk7CsVKe8aj7y8E7fi722Lgc sOI1nv3ypgcdV/RaeM85t3BlntQEiyVRjLJSaezOYUxHwCPRbH2Id9fq+6HG2+ndx9AB TdQQJ75aPIjrqA8sb/efwQoC30F0yjZBbzEZxQ+CXlhMdq9JwV58B9rjY2eOSyuX0Vfw mUfnkpl9i66BDyAV/OQ+XyI6dJcTn6LCr8aj2Gmmo51hjEBgRqR71NsMN1iONAa6V1pa 7P6w== X-Gm-Message-State: AOJu0Yweq3fjcUn50geCtDzairTQmssBeO5aJAZckWGx05tvh7zr5WpJ 5EEKsUaMdMKo69gNPxdGr7dH+fvrDsGDaChgwzUXlDUG5+4z6sumF3puFDpZuDkvaD0WhvlP/BN BSg== X-Google-Smtp-Source: AGHT+IFaPB9WJAlTRkme+efotvjsMqiIGQNbkxbOEbzLclDMENYNoKOPTqERZRT1VtTS8XtaKRGCOg== X-Received: by 2002:a05:6e02:1385:b0:375:a3d8:97be with SMTP id e9e14a558f8ab-375a3d89aa6mr67749775ab.9.1718136155882; Tue, 11 Jun 2024 13:02:35 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:35 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , AKASHI Takahiro , Bin Meng , Sean Anderson Subject: [PATCH 27/42] test: Avoid failing skipped tests Date: Tue, 11 Jun 2024 14:01:41 -0600 Message-Id: <20240611200156.2245525-28-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean When a test returns -EAGAIN this should not be considered a failure. Fix what seems to be a problem case, where the pytests see a failure when a test has merely been skipped. Signed-off-by: Simon Glass --- test/test-main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/test-main.c b/test/test-main.c index 3fa6f6e32ec..cda1a186390 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -448,7 +448,7 @@ static int ut_run_test(struct unit_test_state *uts, struct unit_test *test, static int ut_run_test_live_flat(struct unit_test_state *uts, struct unit_test *test) { - int runs; + int runs, ret; if ((test->flags & UT_TESTF_OTHER_FDT) && !IS_ENABLED(CONFIG_SANDBOX)) return skip_test(uts); @@ -458,8 +458,11 @@ static int ut_run_test_live_flat(struct unit_test_state *uts, if (CONFIG_IS_ENABLED(OF_LIVE)) { if (!(test->flags & UT_TESTF_FLAT_TREE)) { uts->of_live = true; - ut_assertok(ut_run_test(uts, test, test->name)); - runs++; + ret = ut_run_test(uts, test, test->name); + if (ret != -EAGAIN) { + ut_assertok(ret); + runs++; + } } } @@ -483,8 +486,11 @@ static int ut_run_test_live_flat(struct unit_test_state *uts, (!runs || ut_test_run_on_flattree(test)) && !(gd->flags & GD_FLG_FDT_CHANGED)) { uts->of_live = false; - ut_assertok(ut_run_test(uts, test, test->name)); - runs++; + ret = ut_run_test(uts, test, test->name); + if (ret != -EAGAIN) { + ut_assertok(ret); + runs++; + } } return 0; From patchwork Tue Jun 11 20:01:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946524 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=K6n4eTo6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKTh2yJ2z1ydW for ; Wed, 12 Jun 2024 06:07:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5F0D588804; Tue, 11 Jun 2024 22:02:42 +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="K6n4eTo6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B34E3887CC; Tue, 11 Jun 2024 22:02:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (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 19343887DD for ; Tue, 11 Jun 2024 22:02:38 +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-il1-x12e.google.com with SMTP id e9e14a558f8ab-37597eba356so14071125ab.2 for ; Tue, 11 Jun 2024 13:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136157; x=1718740957; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=44bk925XlBlo4oIPhsCGOVqldbsxzgGdPRMUpsyUgp0=; b=K6n4eTo6U8mZ55xi2CFFGHzjGd28w1xcfwxOdoT6pLsdDIPmOwePj4ofuwsd/E5zQc AE3CZUI78MFhLFjos8PE2XYaOwiCZwUQvhdH9wIWx921bsImn1GFoW7vb0mLr2mGvWmo AbzZfq9WROTno9nqTQzsEzSK1q7pPlXmJWpmw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136157; x=1718740957; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=44bk925XlBlo4oIPhsCGOVqldbsxzgGdPRMUpsyUgp0=; b=Npk6V8wI2NEJUBtTZS1Q4Gw7LXDly0JjG5PwS9OsIyiD8BQ+iQs4kq7M82czr2hoIg snY8i5ZWUnXIHMoVy4KMn5kBb0Yc6cR9EjUv2W1ycjqCNWhh6O3uw6VJqIexVaV7B64h Sd8g+4LLIXC2x7mOmTLb9t0f/aAeEfTgfrSlGmY6jnqc3TJWG8g3k7h4tm9JnDF5Fg4P 5zkBDxxuiv1XKB51Z6sw70G//NeT6FPpSYTJtD69HRSw9Xc0+aeawiAdy/gmDrWVTvhB GmdR38spmGqCipwpuFgpETgLSHcWukSht731C5qR3TpW9V2JdIIYZo2v7AQZhR/L6mhM c95w== X-Gm-Message-State: AOJu0YyppS8P5FzlrhhGIHzdBlJmOOSPJtSKWmo2Y8wvoxynAMZ1pdht Amd61eWnjjpgeoZd/tN1a6EFJdP04fRQiFJuzChEAbBkKkBBSEahjwLZ/5JhtG6k7jjQ7bneuMs 3/g== X-Google-Smtp-Source: AGHT+IEZ2uglipTU5Akx19wF8fIJbn/4vCPtdZWJuArxusfyWXMGyqrMcphunIJoXinBTt22LcaqIw== X-Received: by 2002:a92:290e:0:b0:375:8b0e:4434 with SMTP id e9e14a558f8ab-3758b0e477fmr96496645ab.16.1718136156716; Tue, 11 Jun 2024 13:02:36 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:36 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH 28/42] test: dm: Show failing driver name Date: Tue, 11 Jun 2024 14:01:42 -0600 Message-Id: <20240611200156.2245525-29-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean When a driver is not registered properly it is not clear which one it is. Adjust test_dm_compat() to show this. Signed-off-by: Simon Glass --- test/py/tests/test_dm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/py/tests/test_dm.py b/test/py/tests/test_dm.py index 68d4ea12235..be94971e455 100644 --- a/test/py/tests/test_dm.py +++ b/test/py/tests/test_dm.py @@ -13,8 +13,11 @@ def test_dm_compat(u_boot_console): for line in response[:-1].split('\n')[2:]) response = u_boot_console.run_command('dm compat') + bad_drivers = set() for driver in drivers: - assert driver in response + if not driver in response: + bad_drivers.add(driver) + assert not bad_drivers # check sorting - output looks something like this: # testacpi 0 [ ] testacpi_drv |-- acpi-test From patchwork Tue Jun 11 20:01:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946525 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=LgFmgXb2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKTv0MQwz1ydW for ; Wed, 12 Jun 2024 06:07:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B8A8C88809; Tue, 11 Jun 2024 22:02:42 +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="LgFmgXb2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA909887B6; Tue, 11 Jun 2024 22:02:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (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 A43628859A for ; Tue, 11 Jun 2024 22:02:38 +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-il1-x12e.google.com with SMTP id e9e14a558f8ab-36ddf683ad7so6724265ab.2 for ; Tue, 11 Jun 2024 13:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136157; x=1718740957; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xrk66g0HtXE2BUPgxaLISVoF0S1VL3an45CfFPnDPto=; b=LgFmgXb25wZ/ckBjrq1uj79IjKEW6X2uN5xpBgYilzaIBvRbLXLVnYL2ehgqUlLsvU qcfPDg7J1BFdhiMsrSgrpZCBjg154f2/yb85gG2yQWlVd5r2V9WASNPMuim6ZjNd1DHm l2ope1/4C5aWaIrPkl8tNiGEhRlQm4di0ux4s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136157; x=1718740957; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xrk66g0HtXE2BUPgxaLISVoF0S1VL3an45CfFPnDPto=; b=NaXzMR6sj/aWOjY1upaVASnT7m6VOZXcEbHMn2AHxi6bvQ4DlVo/rSLbjfbcrHTmTQ dAQjS0v6MhJRlRy5a+a4WVVvXor3RL44cKbjcj1MBE1237ZzcRdRNDkQKIBhP7w+Hs9P 2fUc+vjXMDU01wBqNrSWGmAB7z4EknJkKOuFdDZFOoyvxWTbL+8UkVuoWSXhciiNM+7N s8Lppb7ZSUA4we0XUpFCw/R7qgJcp5BtzSRfnnpZzGS0St3a491T7stwrZ6ns/0/PGio bGRYUKi3FqPFGqQrrIhhKXGWjWtRcuIZVtpf7THbXg9G0zzJVPEvicCZEn6Ef4v8e+d0 aLLg== X-Gm-Message-State: AOJu0YzJzXNGkOiS7K4zCngqHlAbKwa6dsu9FNC3+m8BW4Eqcy+8w82Q 604pz7OkCRviDbBLpYZDm1WB5Yd6lZV92AAOT3HS72HtYryDaCKYiNhq1SJDTWWRj/Zc8DITGrs i2A== X-Google-Smtp-Source: AGHT+IFmECS+W+QmXDwz7uYbkSuIxxdlWUMRJOpCHvxvWLgcYyjAYtugveQBv56dh6h8bPRiQr08DA== X-Received: by 2002:a05:6e02:b25:b0:375:c443:9883 with SMTP id e9e14a558f8ab-375c4439b6bmr17265155ab.21.1718136157420; Tue, 11 Jun 2024 13:02:37 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:37 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 29/42] test: Check help output Date: Tue, 11 Jun 2024 14:01:43 -0600 Message-Id: <20240611200156.2245525-30-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The current test doesn't check anything about the output. If a bug results in junk before the output, this is not currently detected. Add a check for the first line being the one expected. Signed-off-by: Simon Glass --- test/py/tests/test_help.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/py/tests/test_help.py b/test/py/tests/test_help.py index 153133cf28f..2325ff69229 100644 --- a/test/py/tests/test_help.py +++ b/test/py/tests/test_help.py @@ -7,7 +7,11 @@ import pytest def test_help(u_boot_console): """Test that the "help" command can be executed.""" - u_boot_console.run_command('help') + lines = u_boot_console.run_command('help') + if u_boot_console.config.buildconfig.get('config_cmd_2048', 'n') == 'y': + assert lines.splitlines()[0] == "2048 - The 2048 game" + else: + assert lines.splitlines()[0] == "? - alias for 'help'" @pytest.mark.boardspec('sandbox') def test_help_no_devicetree(u_boot_console): From patchwork Tue Jun 11 20:01:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946526 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=JGqsfIIr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKV60NK7z1ydW for ; Wed, 12 Jun 2024 06:07:58 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 222DC887E6; Tue, 11 Jun 2024 22:02:45 +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="JGqsfIIr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8B98B887EE; Tue, 11 Jun 2024 22:02:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 6EA6688717 for ; Tue, 11 Jun 2024 22:02:39 +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-il1-x12b.google.com with SMTP id e9e14a558f8ab-36dd56cf5f5so6264875ab.3 for ; Tue, 11 Jun 2024 13:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136158; x=1718740958; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/J33EPRw9IWBdkRjjt85gW1RFgSTxY2FoqSGmnE7KAI=; b=JGqsfIIr96NSWDZXBM6WqPTzSfyYBhEAwcofw7pxF36+fwt7mwuwU1yOV0QZiYARsX 4BrtP4YAf5+psRjH2it9bf+hsmOkhJaAsExEFE18bNrPNd1pwUo2sEoVRTiTw3mPT7M4 xl7nJxKqETP3eXgd0SaOP5I6kFdE3kiPTHXS8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136158; x=1718740958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/J33EPRw9IWBdkRjjt85gW1RFgSTxY2FoqSGmnE7KAI=; b=hVDy7wn2rRhF3ENKc+gO8wO2u0NUnYxQYLoAYvvjNUX0uPi5PzwtYaFsUUvQzzn+vd 2kDjZefyxSnKhZKDhz+b4HQYJSpZ/21ANmcg0DDW7JnlhzUOtlmip2GEqyRfGryuf9uE eTM6IS0NEk56MXYqkfDDtBxh1rtoWhQscD9/Kb+UKAVK9twHn8IvfM8YBeWXa4vj5Fdq KsF1pRF/5NCbnY2LhLrfFgwjutw39n9TVNl5mXTklxTUGSDLFCX9OX0b3nLaBs6vtVh+ bA4inKrue8MJosVRzbiIP5raaZWBYzNPZ0hePqIcc5RZCDZhc/o52jj9Qvncm5pxW3Bv DWsA== X-Gm-Message-State: AOJu0Ywp9ctU5bUs/j5Au3uz620P1s956YMtzRVBbbVzQPNQsOwoSfmo r6mhOX5VnLrPiSRhuKi9DJ5VWpbpn7kT85Z+j3PHiDMZvgTWK+m2ju9OyDdyEeiXX4V1ET/XnLw 3Kg== X-Google-Smtp-Source: AGHT+IFzLkGbVo+YDARg23XholuBmclqMuIL9I+o5cBbQ0bdWK6Guvj3vQcMfbuNZo8nXvNsYV3ygg== X-Received: by 2002:a05:6e02:2147:b0:375:be9e:34c3 with SMTP id e9e14a558f8ab-375be9e36f9mr24845275ab.12.1718136158102; Tue, 11 Jun 2024 13:02:38 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:37 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 30/42] test: Create a common function to get the config Date: Tue, 11 Jun 2024 14:01:44 -0600 Message-Id: <20240611200156.2245525-31-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The settings are decoded in two places. Combine them into a new function, before (in a future patch) expanding the number of items. Signed-off-by: Simon Glass --- test/py/conftest.py | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index ca66b9d9e61..6547c6922c6 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -117,14 +117,36 @@ def run_build(config, source_dir, build_dir, board_type, log): runner.close() log.status_pass('OK') -def pytest_xdist_setupnodes(config, specs): - """Clear out any 'done' file from a previous build""" - global build_done_file - build_dir = config.getoption('build_dir') +def get_details(config): + """Obtain salient details about the board and directories to use + + Args: + config (pytest.Config): pytest configuration + + Returns: + tuple: + str: Board type (U-Boot build name) + str: Identity for the lab board + str: Build directory + str: Source directory + """ board_type = config.getoption('board_type') + board_identity = config.getoption('board_identity') + build_dir = config.getoption('build_dir') + source_dir = os.path.dirname(os.path.dirname(TEST_PY_DIR)) + default_build_dir = source_dir + '/build-' + board_type if not build_dir: - build_dir = source_dir + '/build-' + board_type + build_dir = default_build_dir + + return board_type, board_identity, build_dir, source_dir + +def pytest_xdist_setupnodes(config, specs): + """Clear out any 'done' file from a previous build""" + global build_done_file + + build_dir = get_details(config)[2] + build_done_file = Path(build_dir) / 'build.done' if build_done_file.exists(): os.remove(build_done_file) @@ -163,17 +185,10 @@ def pytest_configure(config): global console global ubconfig - source_dir = os.path.dirname(os.path.dirname(TEST_PY_DIR)) + board_type, board_identity, build_dir, source_dir = get_details(config) - board_type = config.getoption('board_type') board_type_filename = board_type.replace('-', '_') - - board_identity = config.getoption('board_identity') board_identity_filename = board_identity.replace('-', '_') - - build_dir = config.getoption('build_dir') - if not build_dir: - build_dir = source_dir + '/build-' + board_type mkdir_p(build_dir) result_dir = config.getoption('result_dir') From patchwork Tue Jun 11 20:01:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946527 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=mpW8wxBL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKVL1fS6z1ydW for ; Wed, 12 Jun 2024 06:08:10 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7AB74887FC; Tue, 11 Jun 2024 22:02:45 +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="mpW8wxBL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8140888808; Tue, 11 Jun 2024 22:02:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (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 5EBCB887B4 for ; Tue, 11 Jun 2024 22:02:40 +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-il1-x12f.google.com with SMTP id e9e14a558f8ab-37597eba356so14071275ab.2 for ; Tue, 11 Jun 2024 13:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136159; x=1718740959; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V3Y4lC5JXlHY+LX5GyoIledZHn+Eu+6T1mKWwGFAg3k=; b=mpW8wxBLgr8slXRjptNYRXXdZULCAjDDrd+rZH39NmL0CTuTp2feIN0lwnmlbwpOUT 3RfJwdsEjs5DJk77jlc8HdHzGuWYM51+kMCPgpUtu50FtbvgBMYw9cBuz/dUdGPZmkBd brWlfca2UwTu+wcD/qa7+L7rvBpW79HEbyPKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136159; x=1718740959; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V3Y4lC5JXlHY+LX5GyoIledZHn+Eu+6T1mKWwGFAg3k=; b=OxhOnaPyctO+SQtxGIP3JnlrgRaT5nQ4bBqUGqvPyLjAkCbj6nhPSmiwC+9p1SLerF aDVkTGbqSEZ2YOawQmdiQkHONUhzO9BXFLKS+/LCuE97xj8ogLYNAOYu4lXpbkzqGr06 2NwI0ixkiy473fx066A4Q4oZYQtYR4eAmVxpCWOZ24ggFj5lBcbkLSsk+1uTy+fLyCkQ 5W7X3YunFE5COuq6+AlfuF2HsCxI3mjQBYR3MCUv67rGxdt+BqmwISKTfBx1dtYhCBYU //Fdc3vvM6NCebXyZlylY0ULT3uDATeGPDmsa1fKyGGqeNKnwzUXVnVytOQJ/xryMCWW oo5w== X-Gm-Message-State: AOJu0YxVHepspalGTc9XXscWAmDyyPy3lR37pZt+q2paJTKO73kkxAhP 8RzV2siC3QeoxKrF9f56W+mb7scF71hnqaTO9iay4aM2h7TDpwjsTQhaqlg7PMWiI4hpAcZ7sIP 8wQ== X-Google-Smtp-Source: AGHT+IGAnRpGw4hjiiLI7breuglJe4AtpzLjtj2n1JomUd0Jt4T4KEM4d6fQ0ZQNXeLXtG9lmFg3nA== X-Received: by 2002:a05:6e02:1d90:b0:375:a234:9dc0 with SMTP id e9e14a558f8ab-375a234a17fmr84466725ab.10.1718136158800; Tue, 11 Jun 2024 13:02:38 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:38 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 31/42] test: Introduce the concept of a role Date: Tue, 11 Jun 2024 14:01:45 -0600 Message-Id: <20240611200156.2245525-32-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean In Labgrid there is the concept of a 'role', which is similar to the U-Boot board ID in U-Boot's pytest subsystem. The role indicates both the target and information about the U-Boot build to use. It can also provide any amount of other configuration. The information is obtained using the 'labgrid-client query' operation. Make use of this in tests, so that only the role is required in gitlab and other situations. The board type and other things can be queried as needed. Use a new 'u-boot-test-getrole' script to obtain the requested information. With this it is possible to run lab tests in gitlab with just a single 'ROLE' variable for each board. Signed-off-by: Simon Glass --- test/py/conftest.py | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index 6547c6922c6..5de8d7b0e23 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -23,6 +23,7 @@ from pathlib import Path import pytest import re from _pytest.runner import runtestprotocol +import subprocess import sys # Globals: The HTML log file, and the connection to the U-Boot console. @@ -79,6 +80,7 @@ def pytest_addoption(parser): parser.addoption('--gdbserver', default=None, help='Run sandbox under gdbserver. The argument is the channel '+ 'over which gdbserver should communicate, e.g. localhost:1234') + parser.addoption('--role', help='U-Boot board role (for Labgrid)') parser.addoption('--no-prompt-wait', default=False, action='store_true', help="Assume that U-Boot is ready and don't wait for a prompt") @@ -130,12 +132,33 @@ def get_details(config): str: Build directory str: Source directory """ - board_type = config.getoption('board_type') - board_identity = config.getoption('board_identity') + role = config.getoption('role') build_dir = config.getoption('build_dir') + if role: + board_identity = role + cmd = ['u-boot-test-getrole', role, '--configure'] + env = os.environ.copy() + if build_dir: + env['U_BOOT_BUILD_DIR'] = build_dir + proc = subprocess.run(cmd, capture_output=True, encoding='utf-8', + env=env) + if proc.returncode: + raise ValueError(proc.stderr) + print('conftest: lab:', proc.stdout) + vals = {} + for line in proc.stdout.splitlines(): + item, value = line.split(' ', maxsplit=1) + k = item.split(':')[-1] + vals[k] = value + print('conftest: lab info:', vals) + board_type, default_build_dir, source_dir = (vals['board'], + vals['build_dir'], vals['source_dir']) + else: + board_type = config.getoption('board_type') + board_identity = config.getoption('board_identity') - source_dir = os.path.dirname(os.path.dirname(TEST_PY_DIR)) - default_build_dir = source_dir + '/build-' + board_type + source_dir = os.path.dirname(os.path.dirname(TEST_PY_DIR)) + default_build_dir = source_dir + '/build-' + board_type if not build_dir: build_dir = default_build_dir From patchwork Tue Jun 11 20:01:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946528 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=PP+GE1gG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKVY5Kfyz1ydW for ; Wed, 12 Jun 2024 06:08:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D15478880F; Tue, 11 Jun 2024 22:02:45 +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="PP+GE1gG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F7A58859A; Tue, 11 Jun 2024 22:02:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (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 35F4D887E6 for ; Tue, 11 Jun 2024 22:02:41 +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-il1-x12f.google.com with SMTP id e9e14a558f8ab-375b27243e5so7426465ab.0 for ; Tue, 11 Jun 2024 13:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136160; x=1718740960; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s+1HxCHfFZL1faeYWd8IpaqmdZ63yd0dKYjebIDbVa4=; b=PP+GE1gGdqWagusCDvFPf8jPh0+wr45KnxD19WU6ycCbX4zy5AIM5Vocpw5gb8isK3 aymQ91GzBCsq3O/6Vq1Lwwj/7uzj7mqUWeZmuTQy814yBCEVF1XL3FLf58aFR1w6KxBb 5Y+A3WA9be/s6byyjGEQ+4h6/xtNPHcTn2yCc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136160; x=1718740960; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s+1HxCHfFZL1faeYWd8IpaqmdZ63yd0dKYjebIDbVa4=; b=SfxZYVR4Q8FcLFPJ+patY5JBD2gvyU2QLoZA/gQizDJgGzm7Dlhw436w+1O49H2aI/ Z0K/0RpAwP46MvrTudfhbYfUHmtqTd91s9fD0M6hfg8HkJQ3FvZzJBQNixSS71aVWIIj P7FEp/1yQ6m1kUF0ZZYnel3yf5fnVrjfvUKGATZMBIbkmL5iqcv3jsVewDM+lBrsefhn jvH6n2CWTT2wtxQ9LZigmyr0oceAXllSAuPIdTBnAi+k6FXhVCjz/DmAW4UQZ+F61bLz g2KWLnZc6rcGs7NZ42CL1TJ1dw3r92ZXcL1B/QQXDRfAVCuCmOckcESeQ/pP43sn9Apg YWtw== X-Gm-Message-State: AOJu0YzGKIvfOhSVdsgbvN4IhwB6kEbGh8AV4TRrh9OPMzNt4Pk1Xna+ JKwqbByjsCj35B5/CF4X374xv+x+bPkErJF30iuLj3OWXxQMRs8L36xzkRvgtsU5ck+xs7Sndh/ FUA== X-Google-Smtp-Source: AGHT+IH0zIgrn/0i6gRweRWfCPjotgwg8C/ctQOI+woQhEjmqTv275za8J+dLayyBpPWd6UttM9koQ== X-Received: by 2002:a92:c242:0:b0:375:97bd:3b1c with SMTP id e9e14a558f8ab-37597bdf5aemr110679105ab.27.1718136159852; Tue, 11 Jun 2024 13:02:39 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:39 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 32/42] test: Move the receive code into a function Date: Tue, 11 Jun 2024 14:01:46 -0600 Message-Id: <20240611200156.2245525-33-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean There is quite a bit of code to deal with receiving data from the target so move it into its own receive() function. Signed-off-by: Simon Glass --- test/py/u_boot_spawn.py | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 81a09a9d639..cb0d8f702ba 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -139,6 +139,32 @@ class Spawn: os.write(self.fd, data.encode(errors='replace')) + def receive(self, num_bytes): + """Receive data from the sub-process's stdin. + + Args: + num_bytes (int): Maximum number of bytes to read + + Returns: + str: The data received + + Raises: + ValueError if U-Boot died + """ + try: + c = os.read(self.fd, num_bytes).decode(errors='replace') + except OSError as err: + # With sandbox, try to detect when U-Boot exits when it + # shouldn't and explain why. This is much more friendly than + # just dying with an I/O error + if self.decode_signal and err.errno == 5: # I/O error + alive, _, info = self.checkalive() + if alive: + raise err + raise ValueError('U-Boot exited with %s' % info) + raise + return c + def expect(self, patterns): """Wait for the sub-process to emit specific data. @@ -195,18 +221,7 @@ class Spawn: events = self.poll.poll(poll_maxwait) if not events: raise Timeout() - try: - c = os.read(self.fd, 1024).decode(errors='replace') - except OSError as err: - # With sandbox, try to detect when U-Boot exits when it - # shouldn't and explain why. This is much more friendly than - # just dying with an I/O error - if self.decode_signal and err.errno == 5: # I/O error - alive, _, info = self.checkalive() - if alive: - raise err - raise ValueError('U-Boot exited with %s' % info) - raise + c = self.receive(1024) if self.logfile_read: self.logfile_read.write(c) self.buf += c From patchwork Tue Jun 11 20:01:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946529 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Mor6WDNH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKVm6cbRz1ydW for ; Wed, 12 Jun 2024 06:08:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3645988818; Tue, 11 Jun 2024 22:02:46 +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="Mor6WDNH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2160288717; Tue, 11 Jun 2024 22:02:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 EC9CB887F5 for ; Tue, 11 Jun 2024 22:02:41 +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-il1-x141.google.com with SMTP id e9e14a558f8ab-37588517095so19783235ab.2 for ; Tue, 11 Jun 2024 13:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136160; x=1718740960; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ljpiqH+EYJPZ6UTBFPLbmKwsn10FzqjBB1psvjHVnPQ=; b=Mor6WDNHuPFW3xGMEUyKiYwaFjZjRkinE89vjfmb8G5i5A2BARDN4vBSOxvqZx+fYy p8l0VnA7LXP0BJ+gqv0WhdPStsJyTaOV+DphS+suhOYrYVPzEcqkTRfydV+4TQFYWCur mGVd4MTvPbMBjph4FxW/z2WhRxQeS3JGrqzNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136160; x=1718740960; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ljpiqH+EYJPZ6UTBFPLbmKwsn10FzqjBB1psvjHVnPQ=; b=ejkD89AXLdYsjEFXL8Cvre+xmZWbYSqc7b3No60/uz3CdwkexADLMpDYysDDqF3lE0 MNvp9lGozBhzs2k2P2Kyt0fHbn9cGS0Cix0dVX4UtMWDWAjQejtogTteAiVi/BASsPUh yR6CG/4fGDTkIoz2cRP75Ez6+1PBWl6A4ZfwvB0vjVNMMlL3G9H0/Vr8JuYy3fcBunap Ou/PLgEnFEEVeUiSN8/35vgwMKxINA2FtoBjg/6eeujsnKW1a/NAGQVdwQ90pshcWfh6 oAjo7gAuOQT1mKYR1LTNqbpeesge17sVAXnZwy7pN7gtzyFyNIPQm/eWhln+AnqcDPd4 5RSw== X-Gm-Message-State: AOJu0Ywmr78DBpo3BW0GezLz9khAe0UdOtr9TByjxq7ZeeXAKEa/+cna Zd7iSW35MoiE6oiY7iX0HO8+RxfC8GIY5W7FKf6xuPXLGtv69m+LwT9s+718hgdXmW+Ks6+g5rt 0QyiB X-Google-Smtp-Source: AGHT+IFJcH8XxQR0B+n02XHZqsWGnKS6qiHnmkYt7E0pS9DqZY3UO2sD3NGkhlZ4zcTVuvMMMcuj5Q== X-Received: by 2002:a05:6e02:18c7:b0:36a:1104:2d6e with SMTP id e9e14a558f8ab-375802ee14amr161146635ab.1.1718136160583; Tue, 11 Jun 2024 13:02:40 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:40 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 33/42] test: Separate out the exception handling Date: Tue, 11 Jun 2024 14:01:47 -0600 Message-Id: <20240611200156.2245525-34-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean The tests currently catch a very board Exception in each case. This is thrown even in the event of a coding error. We want to handle exceptions differently depending on their severity, so that we can avoid hour-long delays waiting for a board that is clearly broken. As a first step, create some new exception types, separating out those which are simply an unexpected result from executed a command, from those which indicate some kind of hardware failure. Signed-off-by: Simon Glass --- test/py/u_boot_console_base.py | 26 ++++++++++++++------------ test/py/u_boot_spawn.py | 11 +++++++++++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index a61eec31148..b656a1f38cd 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -14,6 +14,7 @@ import pytest import re import sys import u_boot_spawn +from u_boot_spawn import BootFail, Timeout, Unexpected # Regexes for text we expect U-Boot to send to the console. pattern_u_boot_spl_signon = re.compile('(U-Boot SPL \\d{4}\\.\\d{2}[^\r\n]*\\))') @@ -164,13 +165,13 @@ class ConsoleBase(object): m = self.p.expect([pattern_u_boot_spl_signon] + self.bad_patterns) if m != 0: - raise Exception('Bad pattern found on SPL console: ' + + raise BootFail('Bad pattern found on SPL console: ' + self.bad_pattern_ids[m - 1]) env_spl_banner_times -= 1 m = self.p.expect([pattern_u_boot_main_signon] + self.bad_patterns) if m != 0: - raise Exception('Bad pattern found on console: ' + + raise BootFail('Bad pattern found on console: ' + self.bad_pattern_ids[m - 1]) self.u_boot_version_string = self.p.after while True: @@ -181,13 +182,9 @@ class ConsoleBase(object): if m == 2: self.p.send(' ') continue - raise Exception('Bad pattern found on console: ' + + raise BootFail('Bad pattern found on console: ' + self.bad_pattern_ids[m - 3]) - except Exception as ex: - self.log.error(str(ex)) - self.cleanup_spawn() - raise finally: self.log.timestamp() @@ -253,7 +250,7 @@ class ConsoleBase(object): m = self.p.expect([chunk] + self.bad_patterns) if m != 0: self.at_prompt = False - raise Exception('Bad pattern found on console: ' + + raise BootFail('Bad pattern found on console: ' + self.bad_pattern_ids[m - 1]) if not wait_for_prompt: return @@ -263,14 +260,18 @@ class ConsoleBase(object): m = self.p.expect([self.prompt_compiled] + self.bad_patterns) if m != 0: self.at_prompt = False - raise Exception('Bad pattern found on console: ' + + raise BootFail('Missing prompt on console: ' + self.bad_pattern_ids[m - 1]) self.at_prompt = True self.at_prompt_logevt = self.logstream.logfile.cur_evt # Only strip \r\n; space/TAB might be significant if testing # indentation. return self.p.before.strip('\r\n') - except Exception as ex: + except Timeout as exc: + self.log.error(str(exc)) + self.cleanup_spawn() + raise + except BootFail as ex: self.log.error(str(ex)) self.cleanup_spawn() raise @@ -329,8 +330,9 @@ class ConsoleBase(object): text = re.escape(text) m = self.p.expect([text] + self.bad_patterns) if m != 0: - raise Exception('Bad pattern found on console: ' + - self.bad_pattern_ids[m - 1]) + raise Unexpected( + "Unexpected pattern found on console (exp '{text}': " + + self.bad_pattern_ids[m - 1]) def drain_console(self): """Read from and log the U-Boot console for a short time. diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index cb0d8f702ba..57ea845ad4c 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -17,6 +17,17 @@ import traceback class Timeout(Exception): """An exception sub-class that indicates that a timeout occurred.""" +class BootFail(Exception): + """An exception sub-class that indicates that a boot failure occurred. + + This is used when a bad pattern is seen when waiting for the boot prompt. + It is regarded as fatal, to avoid trying to boot the again and again to no + avail. + """ + +class Unexpected(Exception): + """An exception sub-class that indicates that unexpected test was seen.""" + class Spawn: """Represents the stdio of a freshly created sub-process. Commands may be sent to the process, and responses waited for. From patchwork Tue Jun 11 20:01:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946530 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Sp/xsN3H; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKVz5WZHz1ydW for ; Wed, 12 Jun 2024 06:08:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9276588826; Tue, 11 Jun 2024 22:02:47 +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="Sp/xsN3H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C5651887B4; Tue, 11 Jun 2024 22:02:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 92C0C887B4 for ; Tue, 11 Jun 2024 22:02:42 +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-io1-xd43.google.com with SMTP id ca18e2360f4ac-7eb715a3411so59256639f.2 for ; Tue, 11 Jun 2024 13:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136161; x=1718740961; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H79prm0oFv/uWfC6EV+xxTIFkUSPkDa59IkT7ktXOok=; b=Sp/xsN3HbneEcZ54zeOvbfEuJOpKMo1W2Xpe4+pknfQzP6g6MWlvLvoN2F6l+GgVRQ gA3Zp431Y0hEWRFchHYkaBLt1MoVvudjquhTk9R1qyPXEmnCa4rD+YRvg1z5yRWBKYii HEqcfoefU6A5/41TqTaI6ij/JaxNKNNkspPyc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136161; x=1718740961; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H79prm0oFv/uWfC6EV+xxTIFkUSPkDa59IkT7ktXOok=; b=p9JRk90EVf52OQG+p7ZO2gnZD2O/juaE3efq/IO8CA9P98gjLVLG/2BqaLGLdF2V+z BmFrz3p21y3W7ax0D3vG//NfT8P6rhQnU0R5EiC8dzkJP7FF9RubV5L0ymlHCFT99i1F ez84onuTqC5viZSXLdrEDa2nZ4QwgJUAUWc5G7mv6AkNKPnAOA60FSVLZBymfFu/WOQy 4M5q671Q5wSVC6aKIutvOZZvZis8vnL0jKUaRnTznyByoBekZlyz3j7AHFCZha1DJ9/N Jk171OMC1e82j4iPEQNXRknvaDwNJVcCLZm6sIXs+nvHcAsBngupfzptIRzcLi9WXh95 dSFQ== X-Gm-Message-State: AOJu0YzalFZpgPuyowTwV8KD09fpFQId6zDlSE2Ne6M1rieWYdrgQ8Kd /WRbkIIYXknh3XyMmPMblFkZe5UxclvkkMFCqh+YBKG9qFuPl2aDVe0XYVOUGx/YoVZ+3fKUmLB odRTC X-Google-Smtp-Source: AGHT+IGrrRfyxA24wy0mLfPx7uyN4/WWKdqLh3WyYJS7boB/s4tvFfOt7Wpss0VIddRZmNnWBLob9w== X-Received: by 2002:a05:6e02:1606:b0:375:a7ee:dff9 with SMTP id e9e14a558f8ab-375a7eee19cmr81233565ab.17.1718136161306; Tue, 11 Jun 2024 13:02:41 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 34/42] test: Detect dead connections Date: Tue, 11 Jun 2024 14:01:48 -0600 Message-Id: <20240611200156.2245525-35-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean When the connection to a board dies, assume it is dead forever until some user action is taken. Skip all remaining tests. This avoids CI runs taking an hour, with hundreds of 30-second timeouts all to no avail. Signed-off-by: Simon Glass --- test/py/conftest.py | 19 +++++++++++++++++-- test/py/u_boot_spawn.py | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index 5de8d7b0e23..42af1abd72e 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -25,6 +25,7 @@ import re from _pytest.runner import runtestprotocol import subprocess import sys +from u_boot_spawn import BootFail, Timeout, Unexpected, handle_exception # Globals: The HTML log file, and the connection to the U-Boot console. log = None @@ -280,6 +281,7 @@ def pytest_configure(config): ubconfig.gdbserver = gdbserver ubconfig.no_prompt_wait = config.getoption('no_prompt_wait') ubconfig.dtb = build_dir + '/arch/sandbox/dts/test.dtb' + ubconfig.connection_ok = True env_vars = ( 'board_type', @@ -446,8 +448,21 @@ def u_boot_console(request): Returns: The fixture value. """ - - console.ensure_spawned() + if not ubconfig.connection_ok: + pytest.skip('Cannot get target connection') + return None + try: + console.ensure_spawned() + except OSError as err: + handle_exception(ubconfig, console, log, err, 'Lab failure', True) + except Timeout as err: + handle_exception(ubconfig, console, log, err, 'Lab timeout', True) + except BootFail as err: + handle_exception(ubconfig, console, log, err, 'Boot fail', True, + console.get_spawn_output()) + except Unexpected: + handle_exception(ubconfig, console, log, err, 'Unexpected test output', + False) return console anchors = {} diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 57ea845ad4c..62eb4118731 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -8,6 +8,7 @@ Logic to spawn a sub-process and interact with its stdio. import os import re import pty +import pytest import signal import select import sys @@ -28,6 +29,43 @@ class BootFail(Exception): class Unexpected(Exception): """An exception sub-class that indicates that unexpected test was seen.""" + +def handle_exception(ubconfig, console, log, err, name, fatal, output=''): + """Handle an exception from the console + + Exceptions can occur when there is unexpected output or due to the board + crashing or hanging. Some exceptions are likely fatal, where retrying will + just chew up time to no available. In those cases it is best to cause + further tests be skipped. + + Args: + ubconfig (ArbitraryAttributeContainer): ubconfig object + log (Logfile): Place to log errors + console (ConsoleBase): Console to clean up, if fatal + err (Exception): Exception which was thrown + name (str): Name of problem, to log + fatal (bool): True to abort all tests + output (str): Extra output to report on boot failure. This can show the + target's console output as it tried to boot + """ + msg = f'{name}: ' + if fatal: + msg += 'Marking connection bad - no other tests will run' + else: + msg += 'Assuming that lab is healthy' + print(msg) + log.error(msg) + log.error(f'Error: {err}') + + if output: + msg += f'; output {output}' + + if fatal: + ubconfig.connection_ok = False + console.cleanup_spawn() + pytest.exit(msg) + + class Spawn: """Represents the stdio of a freshly created sub-process. Commands may be sent to the process, and responses waited for. From patchwork Tue Jun 11 20:01:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946531 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hzB6ebVe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKWB2hTzz1ydW for ; Wed, 12 Jun 2024 06:08:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 08EB388816; Tue, 11 Jun 2024 22:02:48 +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="hzB6ebVe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9AC758880C; Tue, 11 Jun 2024 22:02:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (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 820728859A for ; Tue, 11 Jun 2024 22:02:43 +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-il1-x133.google.com with SMTP id e9e14a558f8ab-3737b250ef9so23345495ab.0 for ; Tue, 11 Jun 2024 13:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136162; x=1718740962; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xg2oQgv83oGzuWGSGX51RYeJuk1rjdPiV5Aas551pAc=; b=hzB6ebVebGuGKvnC2az1tx/KfIeohOHVkKDha5Pmg/Cp3dMGmSi3kpu65SeeZPHMwF vuZXvVOFeUEASTqU7C35YffXcXoDx5mrDlyMA9iOBn7vDoVSVL91HycfCEJ/xk9tGd8H lD4gFI0lFevyNCFuyhAkPisE4Q8b0x8wvcy9M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136162; x=1718740962; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xg2oQgv83oGzuWGSGX51RYeJuk1rjdPiV5Aas551pAc=; b=gbiGuB1nDlcAuzECLyETMzNnOVFjmraMBcm4poMLyo2EEfuIJZHbsd7b3+KbtTX5EN zuSgYlgaQNf22RrdotZPtqcxIihq5U9jfcn54+chbpQdZosO3rxHQ2Xre5/BV+nrJFE7 2K6LKpXTsbLhIjDRi8T/sthCmYN6LzsyXyWwilGSuH0UYAn8erYALtmFtpRfIlYoTpkj 0CTj8VE9HdREdLPQ7ROzmeYpy4lDjpYNXM7/IMM96meGoYOZGksv84/2lXR1KagxpH4h 6xAFtlZb4W6B5q5T6Wzvwa0mokHwSO3YWCVYzH3jraudC/CBXam10H96xFL2S6cigoIX wM+Q== X-Gm-Message-State: AOJu0Yxokn9SHjuULV5hL1jm+xUtqjdPSLG+nTkvsthRkB9+m5Czg9gs HqnemMdxjlbvhfw2XwpCi3tuDDJ3QqimEgSA0i/2dp1hjMyAO0cQ5lCiI1K6UlPEfiwS1HHqhrR Shg== X-Google-Smtp-Source: AGHT+IEY9DmMzAWqfFa5XhZzL4inT+g7mGbac1scNKIPsZL6cR5HJYBzjhj/Yr0QfqQBs1NpTZULxw== X-Received: by 2002:a05:6e02:12c2:b0:374:9c67:1df6 with SMTP id e9e14a558f8ab-3758035fd9emr158833145ab.22.1718136161995; Tue, 11 Jun 2024 13:02:41 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 35/42] test: Tidy up remaining exceptions Date: Tue, 11 Jun 2024 14:01:49 -0600 Message-Id: <20240611200156.2245525-36-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Use the new handle_exception() function from ConsoleBase also. Signed-off-by: Simon Glass --- test/py/u_boot_console_base.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index b656a1f38cd..dbf54eadd0f 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -14,7 +14,7 @@ import pytest import re import sys import u_boot_spawn -from u_boot_spawn import BootFail, Timeout, Unexpected +from u_boot_spawn import BootFail, Timeout, Unexpected, handle_exception # Regexes for text we expect U-Boot to send to the console. pattern_u_boot_spl_signon = re.compile('(U-Boot SPL \\d{4}\\.\\d{2}[^\r\n]*\\))') @@ -268,12 +268,12 @@ class ConsoleBase(object): # indentation. return self.p.before.strip('\r\n') except Timeout as exc: - self.log.error(str(exc)) - self.cleanup_spawn() + handle_exception(self.config, self, self.log, exc, 'Lab failure', + True) raise - except BootFail as ex: - self.log.error(str(ex)) - self.cleanup_spawn() + except BootFail as exc: + handle_exception(self.config, self, self.log, exc, 'Boot fail', + True, self.get_spawn_output()) raise finally: self.log.timestamp() From patchwork Tue Jun 11 20:01:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946532 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=dsBaDFAJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKWN42Bsz1ydW for ; Wed, 12 Jun 2024 06:09:04 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6A2BA88836; Tue, 11 Jun 2024 22:02:48 +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="dsBaDFAJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5460288819; Tue, 11 Jun 2024 22:02:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 241AD887CD for ; Tue, 11 Jun 2024 22:02:44 +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-il1-x141.google.com with SMTP id e9e14a558f8ab-371c97913cdso24386795ab.3 for ; Tue, 11 Jun 2024 13:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136163; x=1718740963; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kaisMaTkCsjn+kUDWuiR8eKgrb7ee+UKwVTPrjvv+B4=; b=dsBaDFAJNS5kUvgyOkI1Ns6tPZK62SYMKtxUkEy2oEfgVbrDpcs2PUyXdq13nycZcB 3Pk1ysRzbMlqN64teVcE+qBxmlPhAoqTRH62aYDwChYfLfpEBXxwx55QE0B9zf58AHPV TgX6Qy8IADLPCuKVUVEBgdagsGqge9q4v1mIk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136163; x=1718740963; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kaisMaTkCsjn+kUDWuiR8eKgrb7ee+UKwVTPrjvv+B4=; b=c1HfQeIBnVVtgWw0Eg26/gMfbks+TAKZ/XGPuLu6ZHdkobxHUQdJ1J+sQnBPV9qc2R kKSpru0szYOKYJpftJh4kxYnJlXTM7NIXIJlc6LkiCoC5exnV36+dHQWRZuQGsovGCp2 3JudrpLlDPU0xB9zLIjEu0fOL3oBWVQfFX6H8eRfLbnW1BF5hpxdLGBZR9RhY4eNHNW7 mSjwsRFuv4x7QclhrjX+lk7Kp+VZ67Nj5RDlYO2elA+Gv/bx+JnqgtXQBi8mvIlDel1A LTiY8/n+rQIkD34ImSfGmanQoIMMsBQ3yeHCFRSQGWatyIuaNNae378igdml6qTuOIYk ALxw== X-Gm-Message-State: AOJu0YzYbaRPQU+HpZzAcK9Wm/p9vP0eHDHuTAbiSxWKQHzbXKFiC+eY 4Ay8PirA8RjwOCd5OA1imbWiz7pAn6+S8QO3ONseU2eork3X5RZgXJd3yrQmEnrETIcQO4/utWc NF+OV X-Google-Smtp-Source: AGHT+IHxtySCNenby1POrdRueqVzGWsSpvJX1SUo1Bi5kVflxX/4OxYVuQ6WKHw0wPEkBojZXePfOQ== X-Received: by 2002:a05:6e02:1d8b:b0:375:a3d8:97a5 with SMTP id e9e14a558f8ab-375a3d89a5bmr82909695ab.5.1718136162820; Tue, 11 Jun 2024 13:02:42 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:42 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 36/42] test: Introduce lab mode Date: Tue, 11 Jun 2024 14:01:50 -0600 Message-Id: <20240611200156.2245525-37-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean There is quite a bit of code in pytest to try to start up U-Boot on a board, with timeouts, expects, etc. This is tedious to maintain and is peripheral to the test system's purpose. It seems better to put this logic in the lab itself, where is can provide such support. With Labgrid we can use the UbootStrategy class to get the board into a useful state, however it needs to do it. Then it can report to pytest by writing a suitable string along with the U-Boot version it detected. Add support for detecting 'lab mode' and simply assume that all is well in that case. Collect the version string when Labgrid says it is ready. Signed-off-by: Simon Glass --- test/py/u_boot_console_base.py | 68 ++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 15 deletions(-) diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index dbf54eadd0f..cfde57649f1 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -23,13 +23,21 @@ pattern_stop_autoboot_prompt = re.compile('Hit any key to stop autoboot: ') pattern_unknown_command = re.compile('Unknown command \'.*\' - try \'help\'') pattern_error_notification = re.compile('## Error: ') pattern_error_please_reset = re.compile('### ERROR ### Please RESET the board ###') -pattern_ready_prompt = re.compile('U-Boot is ready') +pattern_ready_prompt = re.compile('{lab ready in (.*)s: (.*)}') +pattern_lab_mode = re.compile('{lab mode.*}') PAT_ID = 0 PAT_RE = 1 # Timeout before expecting the console to be ready (in milliseconds) -TIMEOUT_MS = 30000 +TIMEOUT_MS = 30000 # Standard timeout + +# Timeout for board preparation in lab mode. This needs to be enough to build +# U-Boot, write it to the board and then boot the board. Since this process is +# under the control of another program (e.g. Labgrid), it will failure sooner +# if something goes way. So use a very long timeout here to cover all possible +# situations. +TIMEOUT_PREPARE_MS = 3 * 60 * 1000 bad_pattern_defs = ( ('spl_signon', pattern_u_boot_spl_signon), @@ -117,6 +125,7 @@ class ConsoleBase(object): self.at_prompt = False self.at_prompt_logevt = None + self.lab_mode = False def get_spawn(self): # This is not called, ssubclass must define this. @@ -150,40 +159,69 @@ class ConsoleBase(object): self.p.close() self.logstream.close() + def set_lab_mode(self): + """Select lab mode + + This tells us that we will get a 'lab ready' message when the board is + ready for use. We don't need to look for signon messages. + """ + self.log.info(f'test.py: Lab mode is active') + self.p.timeout = TIMEOUT_PREPARE_MS + self.lab_mode = True + def wait_for_boot_prompt(self, loop_num = 1): """Wait for the boot up until command prompt. This is for internal use only. """ try: + self.log.info('Waiting for U-Boot to be ready') bcfg = self.config.buildconfig config_spl_serial = bcfg.get('config_spl_serial', 'n') == 'y' env_spl_skipped = self.config.env.get('env__spl_skipped', False) env_spl_banner_times = self.config.env.get('env__spl_banner_times', 1) - while loop_num > 0: + while not self.lab_mode and loop_num > 0: loop_num -= 1 while config_spl_serial and not env_spl_skipped and env_spl_banner_times > 0: - m = self.p.expect([pattern_u_boot_spl_signon] + - self.bad_patterns) - if m != 0: + m = self.p.expect([pattern_u_boot_spl_signon, + pattern_lab_mode] + self.bad_patterns) + if m == 1: + self.set_lab_mode() + break + elif m != 0: raise BootFail('Bad pattern found on SPL console: ' + - self.bad_pattern_ids[m - 1]) + self.bad_pattern_ids[m - 1]) env_spl_banner_times -= 1 - m = self.p.expect([pattern_u_boot_main_signon] + self.bad_patterns) - if m != 0: - raise BootFail('Bad pattern found on console: ' + - self.bad_pattern_ids[m - 1]) - self.u_boot_version_string = self.p.after + if not self.lab_mode: + m = self.p.expect([pattern_u_boot_main_signon, + pattern_lab_mode] + self.bad_patterns) + if m == 1: + self.set_lab_mode() + elif m != 0: + raise BootFail('Bad pattern found on console: ' + + self.bad_pattern_ids[m - 1]) + if not self.lab_mode: + self.u_boot_version_string = self.p.after while True: m = self.p.expect([self.prompt_compiled, pattern_ready_prompt, pattern_stop_autoboot_prompt] + self.bad_patterns) - if m == 0 or m == 1: + if m == 0: + self.log.info(f'Found ready prompt {m}') + break + elif m == 1: + m = pattern_ready_prompt.search(self.p.after) + self.u_boot_version_string = m.group(2) + self.log.info(f'Lab: Board is ready') + self.p.timeout = TIMEOUT_MS break if m == 2: + self.log.info(f'Found autoboot prompt {m}') self.p.send(' ') continue - raise BootFail('Bad pattern found on console: ' + - self.bad_pattern_ids[m - 3]) + if not self.lab_mode: + raise BootFail('Missing prompt / ready message on console: ' + + self.bad_pattern_ids[m - 3]) + self.log.info(f'U-Boot is ready') finally: self.log.timestamp() From patchwork Tue Jun 11 20:01:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946533 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CFPytp9B; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKWb2Tcpz1ydW for ; Wed, 12 Jun 2024 06:09:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C863F8880C; Tue, 11 Jun 2024 22:02:49 +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="CFPytp9B"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1D0AD88820; Tue, 11 Jun 2024 22:02:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (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 F2DA0887B4 for ; Tue, 11 Jun 2024 22:02:44 +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-il1-x142.google.com with SMTP id e9e14a558f8ab-3748ebe7e53so24916525ab.1 for ; Tue, 11 Jun 2024 13:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136163; x=1718740963; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wgjH4HZfAMWO6Hy3LvlyHa5S0tqFK79KaHDzmNRl6Cg=; b=CFPytp9BChC8R1AJBvr0ulQGK04EMFBNH4PQua6vo1V0iO6AIIbCxGQxLRYkul2JEy jCUBtxG4ugwzjn78aHjwCGtP9VpzyPcu6xOem6lQn4rF5k0uYyXY/x1vHVoBAM8JtYY4 tHA31SpmF34Pm9PKan25cJii7RqtGDoYqdiaA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136163; x=1718740963; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wgjH4HZfAMWO6Hy3LvlyHa5S0tqFK79KaHDzmNRl6Cg=; b=NV6GnLW+XDQSg6kYHsVfNLtO0W8EIvACjDU+XWuQACZZvjK6qdecAqE2hue8rRC1O1 I2HuE6Bt3zLILwDeMUaUT0ESEJPtb7EICrqf9cmcUQuK/uhjqJRmQ2gcI1XsxL13LNPf kzeKz+z+x6ZHfNHt4BxiMVqRoslkP50haA7khiBcGBkO0ITWeOly+LeMR2c9uCyaK6yx 3Z1hpLfdkY7ljF1hvOnQuSY4jM4tUB/skJ70AZfwBlPzNEzpkmIdqiaZlorqy4oEVm0n 85wLylk6aoqdhcifxDke+cRsSaHMIh7E1dBrNBX7GwqdM6fqPv0akjmp8GUmxN7gCFsE TQOw== X-Gm-Message-State: AOJu0YwUk1Osvxjgx1hiL4y48/6SqSffH5563+hRHHybrguOiFXt9uoS f7aA/TcNpF6SLYyRXYJ6A509qVqy0ztzjJe1DuVuYvg8Y8db8UyWn+332ZigbpaiQFOKZ8py/kh yxueE X-Google-Smtp-Source: AGHT+IE0Ru27I5rHAiuxahEqWPJiJ+80S8HLMyQe1k4AVa6841tvptIh/zoaNsEi6JHo91Riw1skkg== X-Received: by 2002:a05:6e02:1a4f:b0:375:be9d:5086 with SMTP id e9e14a558f8ab-375be9d58bcmr26645415ab.11.1718136163566; Tue, 11 Jun 2024 13:02:43 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:43 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 37/42] test: Improve handling of sending commands Date: Tue, 11 Jun 2024 14:01:51 -0600 Message-Id: <20240611200156.2245525-38-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean We expect commands to be echoed and this should happen quite quickly, since U-Boot is sitting at the prompt waiting for a command. Reduce the timeout for this situation. Try to produce a more useful error message when something goes wrong. Also handle the case where the connection has gone away since the last command was issued. Signed-off-by: Simon Glass --- test/py/u_boot_console_base.py | 35 ++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index cfde57649f1..eda48cd35f7 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -31,6 +31,7 @@ PAT_RE = 1 # Timeout before expecting the console to be ready (in milliseconds) TIMEOUT_MS = 30000 # Standard timeout +TIMEOUT_CMD_MS = 10000 # Command-echo timeout # Timeout for board preparation in lab mode. This needs to be enough to build # U-Boot, write it to the board and then boot the board. Since this process is @@ -274,22 +275,28 @@ class ConsoleBase(object): try: self.at_prompt = False + if not self.p: + raise BootFail( + f"Lab failure: Connection lost when sending command '{cmd}'") + if send_nl: cmd += '\n' - while cmd: - # Limit max outstanding data, so UART FIFOs don't overflow - chunk = cmd[:self.max_fifo_fill] - cmd = cmd[self.max_fifo_fill:] - self.p.send(chunk) - if not wait_for_echo: - continue - chunk = re.escape(chunk) - chunk = chunk.replace('\\\n', '[\r\n]') - m = self.p.expect([chunk] + self.bad_patterns) - if m != 0: - self.at_prompt = False - raise BootFail('Bad pattern found on console: ' + - self.bad_pattern_ids[m - 1]) + rem = cmd # Remaining to be sent + with self.temporary_timeout(TIMEOUT_CMD_MS): + while rem: + # Limit max outstanding data, so UART FIFOs don't overflow + chunk = rem[:self.max_fifo_fill] + rem = rem[self.max_fifo_fill:] + self.p.send(chunk) + if not wait_for_echo: + continue + chunk = re.escape(chunk) + chunk = chunk.replace('\\\n', '[\r\n]') + m = self.p.expect([chunk] + self.bad_patterns) + if m != 0: + self.at_prompt = False + raise BootFail(f"Failed to get echo on console (cmd '{cmd}':rem '{rem}'): " + + self.bad_pattern_ids[m - 1]) if not wait_for_prompt: return if wait_for_reboot: From patchwork Tue Jun 11 20:01:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946534 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=bwweXeHe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKWm731Hz1ydW for ; Wed, 12 Jun 2024 06:09:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DBC088823; Tue, 11 Jun 2024 22:02:50 +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="bwweXeHe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9A59A887E1; Tue, 11 Jun 2024 22:02:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (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 8465C887FF for ; Tue, 11 Jun 2024 22:02:45 +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-il1-x143.google.com with SMTP id e9e14a558f8ab-37597eba356so14071665ab.2 for ; Tue, 11 Jun 2024 13:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136164; x=1718740964; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+efTwnbqAclrkOcv0sY5l3taj6AFXPXyErZ/eaktCgY=; b=bwweXeHeZNdhD4m9hF9axIna+v/0Gzqa6NWW2ailtEVJRTPR+3SV83JdB6tedMZli9 uiF9jCe8wj0vQYw1huCqzqL30xre2lKkqhxe/BJoGW3yL5Bb0gXZmfDVlFLOw6jpZ5xA ya9mFmsP3YQkbyMfpRqd39psZ8c5d/ncHgFQ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136164; x=1718740964; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+efTwnbqAclrkOcv0sY5l3taj6AFXPXyErZ/eaktCgY=; b=pt/mdOHT1ggH8Orwa8lrO8wIc6KyqZD0nL6zRrUvDJqiUb7ZMVjaODCY0MUJzJuk77 aM6b1y4cuFP9vuHCWzIy7HcEl3/OMvPDlZw26TFRyTPPySHMDNK0gmUdbbACjCjBLH52 vaw7EV5fK2krtrAMgbcbrQjgCKqib7c0//ZMgDqez6DucBGYApbt+GccRWBLn+kVaB6T JlO/MNZVnIDqLBiXwz+CevYy9JTCZmyZYZuEEmf5cAnCIfNzp+5D+ggCIJgkLNwdUCMf nObnihNaOF34e4r3VkiBfQ27DSkks9utksYDk9GVDbF70myEpMrcmFmrnsylhlrfdjHW GGCg== X-Gm-Message-State: AOJu0YwS/LTaF7AhRJ2QF+Z7n7CQF321/s70MhyoSp500+t5jk9pTS1/ dAbH3sMd9pqDWmLARDWJ5u+VOdgHY3J4wwol97Qt0z41iSSvI0oExpOYxB8CnMV5uv/C3oBVNyI KuqAs X-Google-Smtp-Source: AGHT+IFM1CKR/cpcdUjsMg3TKldI2dX+bKnElQTjCq1NJCxE4OwvUCMwm6Q484YevtVsVidC9j9GSg== X-Received: by 2002:a05:6e02:1908:b0:374:ada1:296b with SMTP id e9e14a558f8ab-3758032247emr160896835ab.8.1718136164286; Tue, 11 Jun 2024 13:02:44 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:44 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 38/42] test: Fix mulptiplex_log typo Date: Tue, 11 Jun 2024 14:01:52 -0600 Message-Id: <20240611200156.2245525-39-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Fix a typo in a comment. Signed-off-by: Simon Glass --- test/py/u_boot_console_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index eda48cd35f7..1b00821c5e9 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -97,7 +97,7 @@ class ConsoleBase(object): Can only usefully be called by sub-classes. Args: - log: A mulptiplex_log.Logfile object, to which the U-Boot output + log: A multiplexed_log.Logfile object, to which the U-Boot output will be logged. config: A configuration data structure, as built by conftest.py. max_fifo_fill: The maximum number of characters to send to U-Boot From patchwork Tue Jun 11 20:01:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946535 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ZhCEBB7u; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKWz3bJHz1ydW for ; Wed, 12 Jun 2024 06:09:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 839B688715; Tue, 11 Jun 2024 22:02:51 +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="ZhCEBB7u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EFC0B8880C; Tue, 11 Jun 2024 22:02:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (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 5CE3488717 for ; Tue, 11 Jun 2024 22:02:46 +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-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7eb0b9fa610so273647839f.3 for ; Tue, 11 Jun 2024 13:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136165; x=1718740965; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xVesZdjJwHtp4r7cSUkWpG3wg6027NEyrGlCxtH6zYs=; b=ZhCEBB7uOg/ikwv8xbmzuyCo7rLoQM7owSwxnA0m4iW9hHfWBGJ2W/bwmvHNY8YxlG Zm8p8wDJoCiOfiFjrkHWNU9RXL7Fy9wfMfM4+L72Jdivb9+OVhhSac+aBEQ6ttNbQsDC 7pT9O7SF6Ge5G5etVjDlglZqJYjYljpoW7Dnk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136165; x=1718740965; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xVesZdjJwHtp4r7cSUkWpG3wg6027NEyrGlCxtH6zYs=; b=Un2kbLAzEfjRtqGiLPamQXGrpI0nEL/7vX6U7nI5mnjA9pJEBLmOtkI8HN7spKsc0F biUuXR6kSCnNMT+P4AjsryFYp0Knu5/HHbrRxFDEZnxGUoTFmcwGWRBjuWcgGZZW50wc QvVw8eom6DiCLx/nQqwie9TCnoundsTPaQIiCZ1KZ2WRChEU1b4h1iSnJdEZbMCDwrsH lx4dv2WgfGXGEt1f+W8BJkYq7gCkmpWPYCPs+XJt30shiOVC667+AHqkPpJVlJnXL/SW MA/Cmd3FxBtzX3tlPJegaHeST9rOZA0y4u4DXB3KFXuWAydM7d/veaJFG8bYoaG5jJME macQ== X-Gm-Message-State: AOJu0YyMLtoD47esQ0Wl9Q7ggHXYCUDPaVwlQTv87kY6hAUbY2VQZtH1 sjSIDwt7+2lpH8tmQhtMPNTAX2j1IXelM6zMs84OWhDbUnp7y/khFumTwt7vGKnhqTo5onFRIPg 4Mw== X-Google-Smtp-Source: AGHT+IEUi+E4ECOeuCRtp+lkUcs6GUaYChVt9IFo9hWHdB0yak24kXuJRA3EwLdCTwBYJZ6V0MeCHg== X-Received: by 2002:a05:6e02:20e9:b0:375:af34:c13e with SMTP id e9e14a558f8ab-375af34c4afmr57912255ab.12.1718136164965; Tue, 11 Jun 2024 13:02:44 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:44 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 39/42] test: Avoid double echo when starting up Date: Tue, 11 Jun 2024 14:01:53 -0600 Message-Id: <20240611200156.2245525-40-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean There is a very annoying bug at present where the terminal echos part of the first command sent to the board. This happens because the terminal is still set to echo for a period until Labgrid starts up and can change this. Fix this by disabling echo (and other terminal features) as soon as the spawn happens. Signed-off-by: Simon Glass --- test/py/u_boot_spawn.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 62eb4118731..261bdf62e15 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -12,6 +12,7 @@ import pytest import signal import select import sys +import termios import time import traceback @@ -118,10 +119,19 @@ class Spawn: os._exit(255) try: + new = termios.tcgetattr(self.fd) + old = new + new[3] = new[3] & ~(termios.ICANON | termios.ISIG) + new[3] = new[3] & ~termios.ECHO + new[6][termios.VMIN] = 0 + new[6][termios.VTIME] = 0 + termios.tcsetattr(self.fd, termios.TCSANOW, new) + self.poll = select.poll() self.poll.register(self.fd, select.POLLIN | select.POLLPRI | select.POLLERR | select.POLLHUP | select.POLLNVAL) except: + termios.tcsetattr(self.fd, termios.TCSANOW, old) self.close() raise From patchwork Tue Jun 11 20:01:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946536 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=TGmzA2Mm; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKXB07bvz1ydW for ; Wed, 12 Jun 2024 06:09:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D93288882C; Tue, 11 Jun 2024 22:02:51 +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="TGmzA2Mm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8395B8880C; Tue, 11 Jun 2024 22:02:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 381D6887F5 for ; Tue, 11 Jun 2024 22:02:47 +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-io1-xd31.google.com with SMTP id ca18e2360f4ac-7eb7c0f9784so126453039f.2 for ; Tue, 11 Jun 2024 13:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136165; x=1718740965; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8QMVkY7BvaRWAZoLEJM08l+xrvINJOBOBScHOhbX5go=; b=TGmzA2Mm2fU/WfpbTwOUkAEBIYp5XKlv322wmE2X9bm+7fD2IU+UAJRv/NS0KzoI81 nh00YYfPmCxp+nlPXo23061JnGibPU32QrYTekHrJ2br9ll1zFWSJ2Sih4NgU+IPuis0 o8JBYPHuKoAefkoIl0Rxq22VjWxje8jlKOnGM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136165; x=1718740965; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8QMVkY7BvaRWAZoLEJM08l+xrvINJOBOBScHOhbX5go=; b=KXE1HtubKLffwjcI5DX9SPUdMw6iGtDFtRQOwPZF8LrA6yQOJZRsQpw7bpu2RIRfrp Yyxi1Q9B0i5H5JDr+5O/CSE/pcHzYlZ0K/YHp0lAjhn3ptaHqZZ6tS8rclhrLzRGQXDR Z75lTu9r6r/6XEvubBm/30wCre0BSDY0F97e7BqkBI7qs1ISH6UefckWTdHtaVb8YGyn egd2OSW0J62GIWHC1OPFwmgUiqwg69hqcH1dD01Vy0s5Xu7GoT3j9epemXsZm3n3iERS YCL6Pwc01MjPQ4Oy6/JRMkbhoo5Ie0jyVcLtFZfjPiMOvH5P7wYsoGY0ieHMsUDidC70 KRHA== X-Gm-Message-State: AOJu0YxDgY7kRui7MOgiC61BM4O/scdA7tyc+bjG67nW1Qd7GBRXtHXg 64qeAdNHFYc5X3JPC6vVLUZB59iLxk4iZ4+eHOuejwZmcANAWFiGpDKOzFniIHo755l3eDR+gXj osA== X-Google-Smtp-Source: AGHT+IFdQY2cVAtkzX/6JwXMZIdfoUdqBx5hx/Xz6L+QpRPQrZCqX/4n+olQ/PXZeQ9Y/dmMOfuMWQ== X-Received: by 2002:a05:6e02:1ca2:b0:375:8f09:6f07 with SMTP id e9e14a558f8ab-3758f097436mr127501995ab.21.1718136165677; Tue, 11 Jun 2024 13:02:45 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:45 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 40/42] test: Try to shut down the lab console gracefully Date: Tue, 11 Jun 2024 14:01:54 -0600 Message-Id: <20240611200156.2245525-41-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Send the Labgrid quit characters to ask it to exit gracefully. This typically allows it to power off the board being used. If that doesn't work, try the less graceful approach. Signed-off-by: Simon Glass --- test/py/u_boot_spawn.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 261bdf62e15..000e2a364e4 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -16,6 +16,9 @@ import termios import time import traceback +# Character to send (twice) to exit the terminal +EXIT_CHAR = 0x1d # FS (Ctrl + ]) + class Timeout(Exception): """An exception sub-class that indicates that a timeout occurred.""" @@ -301,15 +304,25 @@ class Spawn: None. Returns: - Nothing. + str: Type of closure completed """ + self.send(chr(EXIT_CHAR) * 2) + # Wait about 10 seconds for Labgrid to close and power off the board + for _ in range(100): + if not self.isalive(): + return 'normal' + time.sleep(0.1) + + # That didn't work, so try closing the PTY os.close(self.fd) for _ in range(100): if not self.isalive(): - break + return 'break' time.sleep(0.1) + return 'timeout' + def get_expect_output(self): """Return the output read by expect() From patchwork Tue Jun 11 20:01:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946537 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Qaz2oB9p; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKXP3LSfz1ydW for ; Wed, 12 Jun 2024 06:09:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3B94B8883D; Tue, 11 Jun 2024 22:02:52 +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="Qaz2oB9p"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0AA988817; Tue, 11 Jun 2024 22:02:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 B68BC887E1 for ; Tue, 11 Jun 2024 22:02:47 +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-il1-x141.google.com with SMTP id e9e14a558f8ab-375932c94f0so7405115ab.0 for ; Tue, 11 Jun 2024 13:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136166; x=1718740966; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xu2S9arxpK63uzshlHxPPtzmeco72Yo91f7DTE+pThw=; b=Qaz2oB9pL3/gP4yccdgz/XBNwM7hmg1r2kbDnY0fygRalfHQSZMi8vIHYQUVUThrkn cA05UaxAkzOHt++KgmaApQPVXNl13eiQZTjqZLnub8HHnLLBreLl6iNL6YqpKV73NKRc ddymFPJ686TTt2kCUU03ku4digOkKl8Nz+oKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136166; x=1718740966; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xu2S9arxpK63uzshlHxPPtzmeco72Yo91f7DTE+pThw=; b=l9B8R6ZAzHFYSSVFLHXavpMflH+kWwLJ2yIvw3Gd2RLQIq2c4HrmlX3zTneAzp6v3f Bs/HNrAM2FwBS3I5v3rCd3U5ZXhU/TR02fGZ1eWlQdUmMCgrCnXPWKk/rVVLEF9d91ID LhNgUJj5IWf/SAQNZYzoXAtY0mHw0ohxQZq7UVEM/IAq3oG6qtdPyPTjDbzVdAX03COE g7ok1vStORkxy7ySXv7Pt6ZHtE0Ies2gxUxbpqOv42tXHPB58e2g89NVY0GkV21rsM02 +NsDGg0unseLGxbEWePAf6M0XmMKOua2rfxZD1bOz6qhrrbP+3SID52KgKEhVAJT7XuY rbvQ== X-Gm-Message-State: AOJu0YybGjMT/oAEFdyJh0QknJRULu50tMuyrD/4dK93dukkTDg6AWsZ KHKyGh0JG8mgxQWHLhNEc4ITScW1shhsmtMs8RAw3D07cseR6jy58+jSeiO61KSVKsIPG26UiqO wn5cb X-Google-Smtp-Source: AGHT+IEb7KazQ2qJthA772RQJpANC1aeZQHKjdJdqPp0tPwvQpr7gpOhl3/uQfkgisDOIJvgnJu+zg== X-Received: by 2002:a92:c047:0:b0:375:86c9:9ec9 with SMTP id e9e14a558f8ab-37586c9a260mr115011875ab.11.1718136166460; Tue, 11 Jun 2024 13:02:46 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:46 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 41/42] test: Add a section for closing the connection Date: Tue, 11 Jun 2024 14:01:55 -0600 Message-Id: <20240611200156.2245525-42-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean This can take a while and involve multiple steps (e.g. turning the board back off). Add a section for it and show the output. Signed-off-by: Simon Glass --- test/py/u_boot_console_base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/py/u_boot_console_base.py b/test/py/u_boot_console_base.py index 1b00821c5e9..95096fc123c 100644 --- a/test/py/u_boot_console_base.py +++ b/test/py/u_boot_console_base.py @@ -157,7 +157,10 @@ class ConsoleBase(object): """ if self.p: - self.p.close() + self.log.start_section('Stopping U-Boot') + close_type = self.p.close() + self.log.info(f'Close type: {close_type}') + self.log.end_section('Stopping U-Boot') self.logstream.close() def set_lab_mode(self): From patchwork Tue Jun 11 20:01:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1946538 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=KanG9Kf3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzKXZ6bfNz20Pb for ; Wed, 12 Jun 2024 06:10:06 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 980C9887F5; Tue, 11 Jun 2024 22:02:54 +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="KanG9Kf3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6982288715; Tue, 11 Jun 2024 22:02:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (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 AC54D887CD for ; Tue, 11 Jun 2024 22:02:48 +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-il1-x134.google.com with SMTP id e9e14a558f8ab-3748ebe7e53so24916715ab.1 for ; Tue, 11 Jun 2024 13:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718136167; x=1718740967; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h92n+sOrCC7tuCHSnlTk9wUaUL0Vmi34wr+LtqZI2iI=; b=KanG9Kf3PAfrkqa/k67IAFTj+v2bGm0KCrCCj4vBPd1Gqb/7LkcrHXbBzRSjclwW3v R38/0ZUzuN+fpOOWqjlHlxOw0ehuqUKTqt4qlEA3oezCSYn9dUK/dvb/aXZPHzQRBtf3 vd9i7J0SaUudcJQwSNq72AMA1yAueM76wK9ww= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718136167; x=1718740967; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h92n+sOrCC7tuCHSnlTk9wUaUL0Vmi34wr+LtqZI2iI=; b=l5GhcuzshVGY4x87wEq2GSI9UoYIwjPR45a8GYi4n2XBCY1Ijef3srTkmzTODTCWoo nf0Ila5CtHdVlSUuge2YQUWQkF0wwdHaDb+xVGUYdFP775LOU+rgk0iiM7FQbAQ0/v1W S4C6yBGyX82w4UcCy4RGLmEncPlUW6UD6rVdJFpSN2stVbOyqbwpDOqxmeagbNfL6zg7 P/jM2pueZw0rUlybOp23zkXTOIuSfnGlzJ3fgq6DJFtQvu5NBG56Yxi1i23ede88ULPR 6d6SEgkqRORwwWoj3YxdCxzoQ7L+xj4q0qf+ubh9oH+a4yHjGDYvvhMGl7j7ycC/PGtA vzIg== X-Gm-Message-State: AOJu0YxzQJWL9Ud1AQh9IFnrkMz04aplDYpYTuUwr5Vhhu8zdmBVzBAj 9lh8/subcnZYljFkSWtMnNPll5hF5CLpKc7x4+53mCyNu7Uswo+SMDsbsouJPuwzHnySdBkNBNQ MuA== X-Google-Smtp-Source: AGHT+IFVGjPcHXxIVkLNN03LsBuIpdXcLwcH2qPV6nmW5TsNZvT4I77wmmjJXYUDzRlgfVrf4JHQUQ== X-Received: by 2002:a05:6e02:219b:b0:36c:4688:85aa with SMTP id e9e14a558f8ab-37580309dc2mr163838355ab.10.1718136167249; Tue, 11 Jun 2024 13:02:47 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-375ca7617cbsm1119305ab.30.2024.06.11.13.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:02:47 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Andrejs Cainikovs , Leo Yu-Chi Liang , Marek Vasut Subject: [PATCH 42/42] CI: Allow running tests on sjg lab Date: Tue, 11 Jun 2024 14:01:56 -0600 Message-Id: <20240611200156.2245525-43-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240611200156.2245525-1-sjg@chromium.org> References: <20240611200156.2245525-1-sjg@chromium.org> MIME-Version: 1.0 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.8 at phobos.denx.de X-Virus-Status: Clean Add a way to run tests on a real hardware lab. This is in the very early experimental stages. There are only 23 boards and 3 of those are broken! (bob, ff3399, samus). A fourth fails due to problems with the TPM tests. To try this, assuming you have gitlab access, set SJG_LAB=1, e.g.: git push -o ci.variable="SJG_LAB=1" dm HEAD:try Signed-off-by: Simon Glass --- .gitlab-ci.yml | 151 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 165f765a833..6c362340341 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,7 @@ stages: - testsuites - test.py - world build + - sjg-lab .buildman_and_testpy_template: &buildman_and_testpy_dfn stage: test.py @@ -482,3 +483,153 @@ coreboot test.py: TEST_PY_TEST_SPEC: "not sleep" TEST_PY_ID: "--id qemu" <<: *buildman_and_testpy_dfn + +.lab_template: &lab_dfn + stage: sjg-lab + rules: + - when: always + tags: [ 'lab' ] + script: + - if [[ -z "${SJG_LAB}" ]]; then + exit 0; + fi + # Environment: + # SRC - source tree + # OUT - output directory for builds + - export SRC="$(pwd)" + - export OUT="${SRC}/build/${BOARD}" + - export PATH=$PATH:~/bin + - export PATH=$PATH:/vid/software/devel/ubtest/u-boot-test-hooks/bin + + # Load it on the device + - ret=0 + - echo "role ${ROLE}" + - export strategy="-s uboot -e off" + # export verbose="-v" + - ${SRC}/test/py/test.py --role ${ROLE} --build-dir "${OUT}" + --capture=tee-sys -k "not bootstd"|| ret=$? + - U_BOOT_BOARD_IDENTITY="${ROLE}" u-boot-test-release || true + - if [[ $ret -ne 0 ]]; then + exit $ret; + fi + artifacts: + when: always + paths: + - "build/${BOARD}/test-log.html" + - "build/${BOARD}/multiplexed_log.css" + expire_in: 1 week + +rpi3: + variables: + ROLE: rpi3 + <<: *lab_dfn + +opi_pc: + variables: + ROLE: opi_pc + <<: *lab_dfn + +pcduino3_nano: + variables: + ROLE: pcduino3_nano + <<: *lab_dfn + +samus: + variables: + ROLE: samus + <<: *lab_dfn + +link: + variables: + ROLE: link + <<: *lab_dfn + +jerry: + variables: + ROLE: jerry + <<: *lab_dfn + +minnowmax: + variables: + ROLE: minnowmax + <<: *lab_dfn + +opi_pc2: + variables: + ROLE: opi_pc2 + <<: *lab_dfn + +bpi: + variables: + ROLE: bpi + <<: *lab_dfn + +rpi2: + variables: + ROLE: rpi2 + <<: *lab_dfn + +bob: + variables: + ROLE: bob + <<: *lab_dfn + +ff3399: + variables: + ROLE: ff3399 + <<: *lab_dfn + +coral: + variables: + ROLE: coral + <<: *lab_dfn + +rpi3z: + variables: + ROLE: rpi3z + <<: *lab_dfn + +bbb: + variables: + ROLE: bbb + <<: *lab_dfn + +kevin: + variables: + ROLE: kevin + <<: *lab_dfn + +pine64: + variables: + ROLE: pine64 + <<: *lab_dfn + +c4: + variables: + ROLE: c4 + <<: *lab_dfn + +rpi4: + variables: + ROLE: rpi4 + <<: *lab_dfn + +rpi0: + variables: + ROLE: rpi0 + <<: *lab_dfn + +snow: + variables: + ROLE: snow + <<: *lab_dfn + +pcduino3: + variables: + ROLE: pcduino3 + <<: *lab_dfn + +nyan-big: + variables: + ROLE: nyan-big + <<: *lab_dfn