From patchwork Mon Sep 22 18:00:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 385 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564099; bh=qHYxH9tjalVLcrzZbQQMZ24Crh1/5l7QW323Z8uZOs0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=NTPQZjchR392WdHmDHrNCWgVX07AeZqf25mSTC+zfdXyWqtfTY45pqxpmveIEfIyA f22VYIMrMj/lOoxoX8pQH2AXdHJBE2c73n+FiCW5FA1FBhVBdKzcUCraouO58Uaj4B dH/3rohimFiZ2eBGuG4UNlscpIlJdjN5H+T93O/ZEDCWF2VRi1/nwzdXzUGT5pa2MF 4fkTMJ9BZEqHl36sReK8XfnqekMV7Esiai99TCf2NytZYVRRYrFXbVgCTC8jIS+ZgQ EBrnrrXsYFkX3MVXRaDeO5S1cfbE2U1k903Nfi1tyLeK4+2uNYvsmtE/w6kDzShCKu 37/6YPs7ECkZw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 96DEA67CAD for ; Mon, 22 Sep 2025 12:01:39 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 3Z0LBwWFgfLM for ; Mon, 22 Sep 2025 12:01:39 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564097; bh=qHYxH9tjalVLcrzZbQQMZ24Crh1/5l7QW323Z8uZOs0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=QqrNLSx3POosJofvHTsYXrrvV74J+U70CkkvHPN4ckg6yez07XsHoAeb4TVkvOX/B S1pRJZjEaW0is46tvpedfFyEPMK1PEvwsvMBtdMkSZ6OFf3yA6HXFa0gBdANqHBhNq 4e+csVdyPiY7ZtwrFKx2JStAy49c3YBmRZsISsQKzWPdvJSQYpLHxod+cDTQD5GYll q/4fjb/7zGJ0V3izVOnx2rN8aRLUKRnfGspU77yiNfhx3+wK+I/abFVYjaWMlLHXvP 1fsCWQvp+jGtmIdafE6OQxLG+MktGZCr0anZon0gbHLcwQuvJ6sAOxYjpvKppLXe0z KYoUcbpEGjykw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DED7E67C63 for ; Mon, 22 Sep 2025 12:01:37 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564093; bh=5o19y1u5qjc/gUok46O9e4bhzBCiEahSYsrzF0J97jo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nztNFBqro75acIPpRLnQypJ7bL9vTUJ3Pl8qZHv8IqD/n9bXFxBpINzwP2GL0t0ON KwAJqetAOsOIb2TD0NsWnmPR9wNPYXyVPZNucjfHLd84BCiRQdSLUjTP01deAB2q8Q NlNKeKPJIJ3QSt+eGLjmLMcU8b5inTElDTI9tIVrZDTZ/5UQU/is0cTEca6/TKnogh /jibUFAX7gI4GQX6ijkYdUbWCxi3k3ISiVnr9N8nFeoPUM6/Kbo/HtKZKlNq2KSRtt p2JS7TcGZNbteSjgk03iIJGd692Yc5IY0Ed94fNbhASjdK7eZBaDE3kzMI4olFhVXf E6+Xm+F+yZ5ew== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 83A925FE1A; Mon, 22 Sep 2025 12:01:33 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id ga4spAiq_RdX; Mon, 22 Sep 2025 12:01:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564093; bh=ZL6RQnqgMeo1hoOcEWnxkK2vGKrzgoT/7S+RZd1OT8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f8m5L+f24y+l2s/1zkQ0K66oq6xrcacIsVxDnso49m+68+f4E3VN1xnqHJ8XrH7tE Q794eym7rEyiTKeVGMTHIUFsCFQaVLNGCTxW+IDzmgjIdl5HnGw3ABdZgbW6MHdDi5 xslblijpvzyG9Sjs3kNhhKbFTLCZpKXEExZcocE/1hTD3TZC7Iuxux1h7r/GlLn5Fp Wy7e9CUDIxQxwOr5FCd1zDNaYnTT6+hLQZE47WjtUT5M+AzrMhB+ZC1+6kmtxhK85F R/bNTpExzs3lNp5DChpeLwQLfPzIkp7xCRsTEzHdXz7mRZ4jHPvzxoxiBy6HWw6lzN yd5FtvDTEH/xg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E4E0B67B38; Mon, 22 Sep 2025 12:01:32 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:45 -0600 Message-ID: <20250922180116.3088502-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RMZBJSCXIWWMA4EIS3P337AUO6T4MGBJ X-Message-ID-Hash: RMZBJSCXIWWMA4EIS3P337AUO6T4MGBJ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/24] doc: Resolve a formatting error in upcoming releases List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When there is a final release, it should be on the same line. Fix this. Signed-off-by: Simon Glass --- doc/develop/concept_releases.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/develop/concept_releases.rst b/doc/develop/concept_releases.rst index e11bf9042b2..aa4f189f1f4 100644 --- a/doc/develop/concept_releases.rst +++ b/doc/develop/concept_releases.rst @@ -38,8 +38,7 @@ Release candidate schedule: * **2025.10-rc3**: Mon 25-Aug-2025 * **2025.10-rc2**: Mon 08-Sep-2025 * **2025.10-rc1**: Mon 22-Sep-2025 -* **2025.10** (Final): \ -Mon 06-Oct-2025 +* **2025.10** (Final): Mon 06-Oct-2025 Release History --------------- From patchwork Mon Sep 22 18:00:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 386 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564102; bh=WPBJCA7WcKVupEuH7jlYzMYDzxgcPAK4IgVp2hExuFA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=AAwCUU9cAT0w2zxM4AoflGKfmhTEUteIlHA2egvNRvJTpmpKuLZjn5ZsizSBYmNtX 8nYssnJo1yX2GfZ9FxssEMBAcKKCyUDbRZ5vrDDypHzXtXReSrHBTV4YPchA2mjmWD KqikRWkvtcGe/O3TB1erR7WhtwGELuWrMvzoOzvCli7G8M+DEQfG/9m18O5GcO3jkL zKPTqnyxAZ0Ab2lA8SMJis8wdbbj1uE4JaQLxcBfMfh7PRvrEOKj5mP7KhWc9zpwfC ZnKYBnGy4XUwfWEgcjFYOGEQZ0NXY3tRB8hGdUJrOYTjo7KK+Hxtr7/1WKDHt+nElh lUkAK/4dWtHlA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0068C5FE1A for ; Mon, 22 Sep 2025 12:01:42 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 8wmsHotirCND for ; Mon, 22 Sep 2025 12:01:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564101; bh=WPBJCA7WcKVupEuH7jlYzMYDzxgcPAK4IgVp2hExuFA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=avOO0pqhqrHMQcKPqUFS1Y8eT8xh70KcUZcXLvL/GQfTcO02lZKKtNoHP4ayYtW4Y lq8LO293V1HxetAo/nDkaaysxF+096iwsGeC7Csxgl+MONfdxIqbZmHRPz3anY/03z 8UTX03+VqJ+UXrxgIrRZQHrT90cAxu+cbtzNa1hWWIyBmPnTfsHXf+Cnsp8c5alDOK 4gQ5kGMqPRRAp/18guTQJo3AORc1zxBV9pz8QZJTJL8FynS5h4J6mQnwZgOr6ylDdD ji3tmYvvLjdkPxxafcVZdnqrcJ64C5Js8jM3CvrqQoDyC76903+uNtsQ+OBzHeBGuw +0aXez7SQkpmQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 89E6467B38 for ; Mon, 22 Sep 2025 12:01:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564099; bh=6w72WixMciGk4MmZseGjjnjE9ZspIheRHuypSYIOTTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N16xgYM7+Cgr6HqPP70yVk+o5dt6PYi4cVmDM0dv4smjaAejjNq0zvUltH9Wq9Yuv 9OaEwVYmLECPu9fjybWU+E3nFiKn21WMbG8BzOuZzXhRAFPX+Fn/63ow6f39qWV7/1 /gMxVAauFZ1sjzSf3tL7ZTZJc5t62eCqPaYp/GGhh3GRBobV2Gr1dGm5Mlu5Ub5ioT 2NYHg0rCE7HKALS9tvmsNSUHFTX9oa2b2wVxp94IoILG7n72vYSyqayf870uf0ii2H qQIxqV5zlx6PHnEL0VHYXhxcEDRy5HjCviFMgQYhwRbkONRMNcPxo9XGdrjUfBwr5g 58sLyPr6RW//w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AAA0A67C63; Mon, 22 Sep 2025 12:01:39 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id bslfSVcD0BPV; Mon, 22 Sep 2025 12:01:39 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564094; bh=s1BMy72pUAidxqZg8UetNunhqLvoio2RavUBf1akPbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=buaeMq+CYfEPlUHjWKR6Bi+WCO1jl1cbvjutMafoTynMKUj3TowfeZFblQp/UxZTx axHHyAlS8xyCdK8Mn570A8LsCOcqAGbhEoJq1G/QromtjHJaPOt369HPYiE88CeD0V q1y4T2IMHLAueNMI9nDff+pHqGSK1krAzQn4nCuohKMArigGIagbP03ZMTdPGZgzzb tR1qaCq7q1HoH3+z05w8Oqi9bYm+5y+A0uh0VVcUswcWDYMBt8OogOKp21lRMsBG7/ 98VjEWbK2etyLRzuO9DL5YLcy1teisKFp14ja6UC7NT02kZYmux+SkaAUIkscQhmwl sbqXtX0CruObQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C791567B38; Mon, 22 Sep 2025 12:01:33 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:46 -0600 Message-ID: <20250922180116.3088502-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6VMSPLCCZZHFTUM2U32NTZ27HPYTY7CF X-Message-ID-Hash: 6VMSPLCCZZHFTUM2U32NTZ27HPYTY7CF X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/24] scripts: Fix RST formatting in release_version.py List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Fix line continuation in generate_schedule() that caused Sphinx to fail with "Bullet list ends without a blank line; unexpected unindent" error. Add tests to validate RST formatting of generated documentation. Co-developed-by: Claude Signed-off-by: Simon Glass --- scripts/release_version.py | 3 +- test/scripts/test_release_version.py | 164 +++++++++++++++++++++++++++ 2 files changed, 165 insertions(+), 2 deletions(-) diff --git a/scripts/release_version.py b/scripts/release_version.py index 476f394ed1a..5ff179dafb8 100755 --- a/scripts/release_version.py +++ b/scripts/release_version.py @@ -190,8 +190,7 @@ Release candidate schedule: * **{target_year}.{target_month:02d}-rc3**: {rc3_date.strftime('%a %d-%b-%Y')} * **{target_year}.{target_month:02d}-rc2**: {rc2_date.strftime('%a %d-%b-%Y')} * **{target_year}.{target_month:02d}-rc1**: {rc1_date.strftime('%a %d-%b-%Y')} -* **{target_year}.{target_month:02d}** (Final): \\ -{final_date.strftime('%a %d-%b-%Y')} +* **{target_year}.{target_month:02d}** (Final): {final_date.strftime('%a %d-%b-%Y')} ''' return schedule_text diff --git a/test/scripts/test_release_version.py b/test/scripts/test_release_version.py index 14a63beb68c..3758404672d 100755 --- a/test/scripts/test_release_version.py +++ b/test/scripts/test_release_version.py @@ -9,6 +9,7 @@ import io import json import os import shutil +import subprocess import sys import tempfile import unittest @@ -876,6 +877,169 @@ class TestMainFunction(unittest.TestCase): self.assertIn(expected_msg, mock_stdout.getvalue()) +class TestRSTFormatting(unittest.TestCase): + """Test that generated RST content is valid for Sphinx""" + + def setUp(self): + """Set up test fixtures""" + self.test_dir = tempfile.mkdtemp() + + def tearDown(self): + """Clean up test fixtures""" + shutil.rmtree(self.test_dir) + + def test_generate_schedule_rst_validity(self): + """Test that generate_schedule() produces valid RST""" + schedule = generate_schedule() + + # Write schedule to a test file + test_rst_path = os.path.join(self.test_dir, 'test_schedule.rst') + with open(test_rst_path, 'w', encoding='utf-8') as f: + f.write('''.. SPDX-License-Identifier: GPL-2.0+ + +Test Document +============= + +''') + f.write(schedule) + + # Try to validate with rst2html if available (fallback test) + try: + # Run docutils rst2html to validate the RST syntax + result = subprocess.run(['rst2html', test_rst_path], + capture_output=True, text=True, timeout=30) + # If rst2html is available and succeeds, the RST is valid + if result.returncode == 0: + self.assertTrue(True, "RST validation passed with rst2html") + else: + # Check for specific formatting errors + stderr = result.stderr.lower() + if 'bullet list ends without a blank line' in stderr: + self.fail(f"RST formatting error in schedule: {result.stderr}") + elif 'unexpected unindent' in stderr: + self.fail(f"RST formatting error in schedule: {result.stderr}") + except (subprocess.TimeoutExpired, FileNotFoundError): + # rst2html not available or timeout, do basic content checks + pass + + # Basic RST format validation checks + lines = schedule.split('\n') + + # Check for proper bullet list formatting + in_bullet_list = False + last_line_was_bullet = False + + for i, line in enumerate(lines): + stripped = line.strip() + + # Check if this line starts a bullet list item + if stripped.startswith('* '): + in_bullet_list = True + last_line_was_bullet = True + + # Check for line continuation issues + if '\\' in line: + # If there's a backslash continuation, ensure it's properly formatted + # The continuation should be on the same line, not the next line + self.assertFalse(line.rstrip().endswith('\\'), + f"Line {i+1} has improper line continuation: {line}") + elif in_bullet_list and stripped == '': + # Empty line might end the bullet list + last_line_was_bullet = False + elif in_bullet_list and stripped and not stripped.startswith(' '): + # Non-indented content after bullet list should have blank line before it + if last_line_was_bullet: + self.fail(f"Line {i+1} lacks blank line after bullet list: {line}") + in_bullet_list = False + last_line_was_bullet = False + elif in_bullet_list and stripped.startswith(' '): + # Indented content is part of the bullet list + last_line_was_bullet = False + else: + in_bullet_list = False + last_line_was_bullet = False + + def test_update_docs_rst_validity(self): + """Test that update_docs() produces valid RST""" + docs_path = os.path.join(self.test_dir, 'concept_releases.rst') + + # Create initial file + with open(docs_path, 'w', encoding='utf-8') as f: + f.write('''.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot Concept Releases +======================= + +This document tracks all concept releases of U-Boot. + +Release History +--------------- + +''') + + # Add a release that includes schedule generation + release_info = ReleaseInfo( + is_final=False, + version='2025.02-rc1', + year=2025, + month=2, + rc_number=1 + ) + + changes_made = update_docs(release_info, 'abc123def', docs_path) + self.assertTrue(changes_made) + + # Read the updated content + with open(docs_path, 'r', encoding='utf-8') as f: + content = f.read() + + # Try to validate with rst2html if available + try: + result = subprocess.run(['rst2html', docs_path], + capture_output=True, text=True, timeout=30) + if result.returncode != 0: + stderr = result.stderr.lower() + if 'bullet list ends without a blank line' in stderr: + self.fail(f"RST formatting error in generated docs: {result.stderr}") + elif 'unexpected unindent' in stderr: + self.fail(f"RST formatting error in generated docs: {result.stderr}") + except (subprocess.TimeoutExpired, FileNotFoundError): + # rst2html not available, continue with manual checks + pass + + # Manual validation of RST structure + lines = content.split('\n') + + # Find the Next Release section and check its formatting + next_release_idx = -1 + for i, line in enumerate(lines): + if line.strip() == 'Next Release': + next_release_idx = i + break + + if next_release_idx != -1: + # Check the bullet list in the schedule section + in_candidate_schedule = False + for i in range(next_release_idx, len(lines)): + line = lines[i] + if 'Release candidate schedule:' in line: + in_candidate_schedule = True + continue + elif in_candidate_schedule and line.strip().startswith('* '): + # This is a bullet list item + # Check it doesn't have improper line continuation + self.assertFalse(line.rstrip().endswith('\\'), + f"Line {i+1} has improper line continuation in schedule: {line}") + elif in_candidate_schedule and line.strip() == '': + # Empty line - bullet list might be ending + continue + elif (in_candidate_schedule and line.strip() and + not line.strip().startswith('* ') and + not line.startswith(' ')): + # End of bullet list section + break + + class TestReleaseVersionScenarios(unittest.TestCase): """Test realistic release scenarios""" From patchwork Mon Sep 22 18:00:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 387 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564104; bh=JMoiWwNIJQ/CBa/GHuUOfh+PprxLmOQ2W+eRphVyLgc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lVpgsFJUg715/v5NZ6mm7kHrNXpBE0TtIEH+Cc6ddN+GiKIhIAIGCfyzIT0BlUbnM hDg091JQcuWXiTXJjojqHa0K+Uv2okt0zOI9zC/Ls3wlplQ3CwSZWGJqzalYlfKDug nOF/18hfFDfBSn5z7jl0BGMI7jK9yCV/7jrR5MYLv82U7yHZG10+DjARqdyWtMZJOi WNHtQ0sdFA0imSRClj68P852hXuSadEpzkYFFSgQ4MEGrSHLSj3O+Xc/MVFgsSH7Vz b1W6q9W/j4iID38kqaErF+ekX8jN9isJv32n8HnahxS3guyFu20YJul1QlIqCGV7Uk rZAYgM6UVjkWg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 381D167B38 for ; Mon, 22 Sep 2025 12:01:44 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id OTS4MO8PFhaV for ; Mon, 22 Sep 2025 12:01:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564103; bh=JMoiWwNIJQ/CBa/GHuUOfh+PprxLmOQ2W+eRphVyLgc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=InSTn0jlRnb1guNI/4Pkapu5uvbymXpm7wXm2F77NB/o9dhSdJm9buTuj33srBa4v igFOhR6o7vHnj1G2jhgzMYxqmyblJpt+B5ofjhBmUbdEHfXugcO7jRgJGGOE9F3fw2 ebxjZo86D1lIMNju8s+olctyDcAoMVmuzWYIcPEwcg33INpGL6prbQ/xuG077A7u4S /C0BZ0T7td2WD1vT0ahBHgBEk5HerB/wc6VamIkfPpEEC5sk/IUwMnOvPgRaqDT4Nc 87MURfQexCGM7quIbwEQsKVCWBfK1Q3CAs8WqmS1knc+ZY9qw9IFPuCge9RqTcAmD8 qEHhd6Nt3PKgA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E0AD267BCF for ; Mon, 22 Sep 2025 12:01:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564101; bh=1bA0V1r//SHn++lpsNVj5RRw/2F0m+ZyYRyfG2vYwvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VI3zo6g6T7NfUi7r1WSDoK6wFtQA/M45oPIW3+v6bTmsvLjDtz3XgljttHIc+YdhR +1uNymrroyZHUvb3INP2aY80vo+aTn7iUSnlgjDQhHEy/vau9C9TX0iP2cy6McU1Cf VNPHpm8ncvNWw77Fs2v6wo/s0i+th+ZxGakUsqRyHuZnE3af0It72HHHx6APousXH9 xH+r2KjXpYdr6a/kXRr7jwRaEY/oPVbKwR9U7e+c9Zb84Q7XgPyTc6gI35JmvGqTyk W7Shnf898SYhmay2uUSTjx9wucpa0Zteqs2zWrcqV4JkXhRxD508OEq8dXV5IIBQZK XvP5JN2jan2Wg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E25FB67CA9; Mon, 22 Sep 2025 12:01:41 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id n5_pNwx3MCep; Mon, 22 Sep 2025 12:01:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564098; bh=I3eJg9F1rI9Ikxdcv+W1mlM6JWlDEPpumfan4KPn+N0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QRAhC3HqFVX97lp8MAv4z797Gp02XREWbo5C2SwFBTE/U8ri1eXruPGq+c1GdAwSz u4P2P2NmkpNELPpAzE0dKs/upu0WbsOEzbygQYoWU7qtbgB+obPxDfuMes6fYY4DHj QXzQqy5AiGxKCrfx/ySmx1YCDODCfseqLR4QIwv8qs2A621K3ZfWPEZUuEsQ1t2KFE STPrce+b1aGUMnuBeXxcdzIzIlT0U0LI/h7F4ynPpJeE56weF0+W8+Do1TLLrFpfOK LWRNDw60s4wM9xiwOC5ay3ryDqykMbe5/c0nMH+mCakx8i/cwiBOVHsMxUsgz/4fsg Ed44a0L+Acxhw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 80D2D67C60; Mon, 22 Sep 2025 12:01:38 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:47 -0600 Message-ID: <20250922180116.3088502-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BWS4ZAZWRGW6JVYD73DYW7LT2ZHRGH4C X-Message-ID-Hash: BWS4ZAZWRGW6JVYD73DYW7LT2ZHRGH4C X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/24] console: Restore old pager test-bypass value List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The test.py tests pass -P to sandbox to tell it to bypass the pager. Tests which change this value must restore it to the old value. Fix this, so that the -P setting remains in place across test runs. Signed-off-by: Simon Glass --- test/common/pager.c | 7 ++++--- test/test-main.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/common/pager.c b/test/common/pager.c index 1ec27c14527..53902ab29a3 100644 --- a/test/common/pager.c +++ b/test/common/pager.c @@ -403,12 +403,13 @@ static int pager_test_bypass_mode(struct unit_test_state *uts) struct pager *pag; const char *text = "This text should be returned directly"; const char *result; + bool was_bypassed; /* Init with small page length to ensure paging would normally occur */ ut_assertok(pager_init(&pag, 2, 1024)); /* Enable bypass mode */ - pager_set_test_bypass(pag, true); + was_bypassed = pager_set_test_bypass(pag, true); /* Post text - should get original string back directly */ result = pager_post(pag, true, text); @@ -418,8 +419,8 @@ static int pager_test_bypass_mode(struct unit_test_state *uts) result = pager_next(pag, true, 0); ut_assertnull(result); - /* Disable bypass mode */ - pager_set_test_bypass(pag, false); + /* Restore old bypass mode */ + pager_set_test_bypass(pag, was_bypassed); /* Now pager should work normally */ result = pager_post(pag, true, text); diff --git a/test/test-main.c b/test/test-main.c index 77d8a9f689d..b27f892140c 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -708,7 +708,7 @@ int ut_run_list(struct unit_test_state *uts, const char *category, const char *test_insert) { ; - bool has_dm_tests = false; + bool was_bypassed, has_dm_tests = false; ulong start_offset = 0; ulong test_offset = 0; int ret; @@ -748,10 +748,10 @@ int ut_run_list(struct unit_test_state *uts, const char *category, memcpy(uts->fdt_copy, gd->fdt_blob, uts->fdt_size); } uts->force_run = force_run; - pager_set_test_bypass(gd_pager(), true); + was_bypassed = pager_set_test_bypass(gd_pager(), true); ret = ut_run_tests(uts, prefix, tests, count, select_name, test_insert); - pager_set_test_bypass(gd_pager(), false); + pager_set_test_bypass(gd_pager(), was_bypassed); /* Best efforts only...ignore errors */ if (has_dm_tests) From patchwork Mon Sep 22 18:00:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 388 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564108; bh=Wt+MtWZ31l2iajrokJ5ABvZv7mWwNtaZYZwff0GXHqs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=V2NwMthCYmua69bMQhh31/4mvFRHyFBeaMcnjceeebJh7U1f74x0HwzTk+3cdThVy 6fxLPJP2YYJwxZ7AI1W0BNbadDF+UZsVL0V5FaHFY2s7wLA0ddEpmzke6KZ7d+b7uW GM1i7B/G9isb01rbp4TSJpylrF2jsS9av8Unl4LygjUWpoe10a5pgEYDH2VPOqG1oB 7CnEvyWU1HG6s0Cm/gP4fiJEopkQ+x0juUsfa26wU1ndX6F+8rWXjvhpZgsgEx7TYb R5q7GDEJYzhG49eJJzKwyNIEqiaZE9gcJO33hptt3UoK49dZdFmfRS8QoxI/9EYmlJ lt/ncUhBlQBrw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 551C567B38 for ; Mon, 22 Sep 2025 12:01:48 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2VO2wfCqgFsY for ; Mon, 22 Sep 2025 12:01:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564108; bh=Wt+MtWZ31l2iajrokJ5ABvZv7mWwNtaZYZwff0GXHqs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=V2NwMthCYmua69bMQhh31/4mvFRHyFBeaMcnjceeebJh7U1f74x0HwzTk+3cdThVy 6fxLPJP2YYJwxZ7AI1W0BNbadDF+UZsVL0V5FaHFY2s7wLA0ddEpmzke6KZ7d+b7uW GM1i7B/G9isb01rbp4TSJpylrF2jsS9av8Unl4LygjUWpoe10a5pgEYDH2VPOqG1oB 7CnEvyWU1HG6s0Cm/gP4fiJEopkQ+x0juUsfa26wU1ndX6F+8rWXjvhpZgsgEx7TYb R5q7GDEJYzhG49eJJzKwyNIEqiaZE9gcJO33hptt3UoK49dZdFmfRS8QoxI/9EYmlJ lt/ncUhBlQBrw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4432C67C32 for ; Mon, 22 Sep 2025 12:01:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564106; bh=Py9nsPHI8ejCqD9FIwMfjI+HMRlUBAy1NU5iec0ormA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c13/mHXZanvJvGcMZgnHkC4ssEMRoeBxu7D8XMyYAAbnV3dvUWEfnO8w7eFWB1bpd D/bFIx3lM5pJjwGNh43futPh+c22k340f7wSleOdQuQ9N8BdU/zvlyv1LneRkGNubH 7YEw2UWVhpK1FJ92Os7fs0RKYUen2UFmpm0PGSE1bTB+Rv6Ug86OpLkP8eHiNf6Jpe RFbbDIE2V0r4xaBHe9bQDB3DqPUAh3U6XmW9HhCPfokuqsG/pv2lw+XvHtenn/SUxJ 28Dz060wnpo42U9LIqvF6xq6HCZ1AWg4D94yJG7EtA7fp5GOJFqUC0ni6dA7ZZgnii HkQSoRzjudy5w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7058D67B38; Mon, 22 Sep 2025 12:01:46 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id X0xjaoTvGVwu; Mon, 22 Sep 2025 12:01:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564100; bh=K24+vOADWwZC59597MCrh+UQxY3cU9VFSLr7Xetf2Rk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D2lANPfIpSEloAvH4Z7XO8n/W7xtRYg9q9ebKUtFopnzPM57q5yf1Phr9gaN8lEDJ N2S4MyEgDFws9WD4Kd8IfQXNMx/wQytKOLcC7KQ58WKbnmIdwpkVfADQwM0PZqsCX4 GO7oW80Hn2hXTTCVLKB1gi2W22FLY7c59o2BMVkI+ELN5kNNIiu31rd00RAevu1ObI Q0UOlZGwoPy+E77S1+iRUrcPrgvMmRwW4Xxv6LICFcSwyf1SgrgRlhqTKrDcc31dnG BCDAfEFKI0zE7aofobiJ8/PBwDkaNLtJ1dGZz14Xb1Dlnq6QtAGFc2x8T7+cxP9xFi uZ4Q8ZVrfbnAg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8C2EF67C32; Mon, 22 Sep 2025 12:01:40 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:48 -0600 Message-ID: <20250922180116.3088502-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 54WUPNVN34OCEN572M3EOG2BEVQ762EK X-Message-ID-Hash: 54WUPNVN34OCEN572M3EOG2BEVQ762EK X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/24] console: Correct condition for setting enabled pager bypass List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The pager should be bypassed if the terminal was not detected. Fix the condition which actually says the opposite. Also fix a long line in pager_post() Signed-off-by: Simon Glass --- common/console.c | 2 +- common/pager.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/console.c b/common/console.c index 77f70588488..561a859dc1e 100644 --- a/common/console.c +++ b/common/console.c @@ -1189,7 +1189,7 @@ static int on_console(const char *name, const char *value, enum env_op op, int lines = calc_check_console_lines(); /* Set bypass mode if not connected to a terminal */ - pager_set_bypass(gd_pager(), lines != 0); + pager_set_bypass(gd_pager(), lines == 0); if (lines) pager_set_page_len(gd_pager(), lines); } diff --git a/common/pager.c b/common/pager.c index 8991d2f93fa..a16937768b6 100644 --- a/common/pager.c +++ b/common/pager.c @@ -20,7 +20,8 @@ const char *pager_post(struct pager *pag, bool use_pager, const char *s) struct membuf old; int ret, len; - if (!pag || !use_pager || pag->test_bypass || pag->state == PAGERST_BYPASS) + if (!pag || !use_pager || pag->test_bypass || + pag->state == PAGERST_BYPASS) return s; len = strlen(s); From patchwork Mon Sep 22 18:00:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 389 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564111; bh=3KxZGRrUbQMdnJVVJRfZgZVSU5Ujb/mbI9rGVOfeeSk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=PH9ZQ81bNqG0FObiBOpX/erIlX63woQtDLVfnRWmNLaaGp8KkTazUMVVTpijiq48M AjRC+rY/Q1IzdwLTDzW9bTE7gZWfA9M1+Hswxz9fjRSSJ7BLmtht2fMh1S9S6Z8PVw d+EcTj/7rj84v0H0XDX773T2spkYDzSz1oWXx+zKeSDfTCfiqugChja1cQhaUSn9qE 1vS1BDDQI7VEdSP0ALtKZ47sMq0FQicRqfTGn4hUTGHk0Ho492ByncyhSFjx58BBqJ PLjCdXSNhsqV5LPRsyTeDRhYTLovYuF+Bh1WofkHq2egLanSn030cFKTpRJ86606BI l7ynEnmGFBI4A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C3AA167C65 for ; Mon, 22 Sep 2025 12:01:51 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id pxU-jaWncyXn for ; Mon, 22 Sep 2025 12:01:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564111; bh=3KxZGRrUbQMdnJVVJRfZgZVSU5Ujb/mbI9rGVOfeeSk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=PH9ZQ81bNqG0FObiBOpX/erIlX63woQtDLVfnRWmNLaaGp8KkTazUMVVTpijiq48M AjRC+rY/Q1IzdwLTDzW9bTE7gZWfA9M1+Hswxz9fjRSSJ7BLmtht2fMh1S9S6Z8PVw d+EcTj/7rj84v0H0XDX773T2spkYDzSz1oWXx+zKeSDfTCfiqugChja1cQhaUSn9qE 1vS1BDDQI7VEdSP0ALtKZ47sMq0FQicRqfTGn4hUTGHk0Ho492ByncyhSFjx58BBqJ PLjCdXSNhsqV5LPRsyTeDRhYTLovYuF+Bh1WofkHq2egLanSn030cFKTpRJ86606BI l7ynEnmGFBI4A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B005467BCF for ; Mon, 22 Sep 2025 12:01:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564110; bh=0nFlgCGLY0kTc1knTMfuv0/e6WXN3katJgqUMCHsq5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V+rt9kaJfBHOJDTLg7X36+N/J7TNdyMtm5ZeIFJjiujyQK2UtfKIuN+dKEMtJ1PNX +ephGva8HSRqpn5/UwiMx6To0x8IfRrCRU7xaT2NFzTOo8MNi3vREkPI76H+CARg+z XxnLO6DVW4wafELZO3F2SKIYVETVOJiNPQ+cRt2zFbbmJq3K9ZUcDMRylh4jaHdxDr L7hEBRsk4bSPMwrhk+nxOCKRg6aRhtRJJK3PrAtD0fBLFq13v0xMMoNcrtD+oQRtSM 1PV2c87oGLyiufAION4Ip2r9q1Xg5cbT12CoXX8XVvsRZ03jww/dGa5LkIlBDReP3/ c0IiQOuNDlc0Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A1FCF67C55; Mon, 22 Sep 2025 12:01:50 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id AgfUZcaMInk0; Mon, 22 Sep 2025 12:01:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564105; bh=KM22mTpgO8IXfxDK8jSTM/KNRcAKmm7kfByGkq6keoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NZmb7H7eJuRDh2oRKAo/ogBXJRlIfi1x0vGp6UMkDCLXw8KwDRc1DkTE9NYjteFAx cKemBrMdmQiISwqppWM0IMzWFf5UoA5rfS86DaQFaXCDh8vXJaciwBuYQxjTvsOoLT iZ9wTY9nglHurt9Ngx3vxPTlspzCpUh5A70K1rtFGfK1bteZZj9aML90nR29BQ4/NW 7dgRU84ZjA50z38TV+v6W+DiqRNyPAq4lZcHp2dRs6TMFzGTr+BPxot5XnkwyQkTHn +JvrJ/WOnEyCpLcVW9cgPluTs7lMV2jaI/Bn/yPhTv1czCOl7ilazRHFBefBCYi4Yg CxWCppdMRu2gQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 26F135FE1A; Mon, 22 Sep 2025 12:01:45 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:49 -0600 Message-ID: <20250922180116.3088502-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DRQD7HK5FJOVHMAV6MBN2HTMGFXS2GX3 X-Message-ID-Hash: DRQD7HK5FJOVHMAV6MBN2HTMGFXS2GX3 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/24] console: Add bypass keypress to disable paging List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add support for pressing 'Q' to put the pager into bypass mode,disabling further paging for the current session. Co-developed-by: Claude Signed-off-by: Simon Glass --- common/pager.c | 36 +++++++++++++++++++++++++----------- doc/usage/console.rst | 3 +++ include/pager.h | 4 ++++ test/common/pager.c | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 11 deletions(-) diff --git a/common/pager.c b/common/pager.c index a16937768b6..c0a55b738b9 100644 --- a/common/pager.c +++ b/common/pager.c @@ -71,6 +71,10 @@ const char *pager_next(struct pager *pag, bool use_pager, int key) pag->state = PAGERST_WAIT_USER; return PAGER_PROMPT; case PAGERST_WAIT_USER: + if (key == 'Q') { + pag->state = PAGERST_BYPASS; + return PAGER_BLANK; + } if (key != ' ') return PAGER_WAITING; pag->state = PAGERST_CLEAR_PROMPT; @@ -79,7 +83,7 @@ const char *pager_next(struct pager *pag, bool use_pager, int key) pag->state = PAGERST_OK; break; case PAGERST_BYPASS: - return NULL; + break; } ret = membuf_getraw(&pag->mb, pag->buf.size - 1, false, &str); @@ -93,17 +97,26 @@ const char *pager_next(struct pager *pag, bool use_pager, int key) return NULL; } - /* return lines until we reach the limit */ - for (p = str, end = str + ret; p < end; p++) { - if (*p == '\n' && ++pag->line_count == pag->page_len - 1) { - /* remember to display the pager message next time */ - pag->state = PAGERST_AT_LIMIT; - pag->line_count = 0; - - /* skip the newline, since our prompt has one */ - p++; - break; + end = str + ret; + if (pag->state != PAGERST_BYPASS) { + /* return lines until we reach the limit */ + for (p = str; p < end; p++) { + if (*p == '\n' && + ++pag->line_count == pag->page_len - 1) { + /* + * remember to display the pager message next + * time + */ + pag->state = PAGERST_AT_LIMIT; + pag->line_count = 0; + + /* skip the newline, since our prompt has one */ + p++; + break; + } } + } else { + p = end; } /* remove the used bytes from the membuf */ @@ -178,6 +191,7 @@ static int on_pager(const char *name, const char *value, enum env_op op, if (value) { new_page_len = simple_strtoul(value, NULL, 16); pager_set_page_len(pag, new_page_len); + pager_set_bypass(pag, false); } break; case env_op_delete: diff --git a/doc/usage/console.rst b/doc/usage/console.rst index 4a28ea95906..880a5b7b605 100644 --- a/doc/usage/console.rst +++ b/doc/usage/console.rst @@ -72,6 +72,9 @@ When activated, the pager pauses at the end of each 'page' (screenful) of output, shows a prompt ": Press SPACE to continue" and lets the user read the output. To continue to the next page, press the SPACE key. +The pager can be bypassed by pressing 'Q' at the prompt. This disables the pager +until the 'pager' environment variable is given a new value. + Page Size Configuration ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/include/pager.h b/include/pager.h index b43b332a83c..887f5d1f639 100644 --- a/include/pager.h +++ b/include/pager.h @@ -110,6 +110,10 @@ const char *pager_post(struct pager *pag, bool use_pager, const char *s); * busy-wait for a keypress, if desired, since pager_next() will only ever * return PAGER_WAITING until @ch is non-zero. * + * When the pager prompts for user input, pressing SPACE continues to the next + * page, while pressing capital 'Q' puts the pager into bypass mode and + * disables further paging. + * * @pag: Pager to use * @use_pager: Whether or not to use the pager functionality * @ch: Key that the user has pressed, or 0 if none diff --git a/test/common/pager.c b/test/common/pager.c index 53902ab29a3..636069d5b37 100644 --- a/test/common/pager.c +++ b/test/common/pager.c @@ -579,3 +579,42 @@ static int pager_test_console(struct unit_test_state *uts) return 0; } COMMON_TEST(pager_test_console, UTF_CONSOLE); + +/* Test bypass keypress ('Q') functionality */ +static int pager_test_bypass_keypress(struct unit_test_state *uts) +{ + struct pager *pag; + const char *out; + int ret; + + ret = pager_init(&pag, 3, SZ_1K); + ut_assertok(ret); + + /* Post text that will trigger paging */ + out = pager_post(pag, true, "line1\nline2\nline3\nline4\n"); + ut_assertnonnull(out); + ut_asserteq_str("line1\nline2", out); + + /* Should be waiting for user input */ + out = pager_next(pag, true, 0); + ut_asserteq_str(PAGER_PROMPT, out); + + /* Press 'Q' to bypass */ + out = pager_next(pag, true, 'Q'); + ut_asserteq_str(PAGER_BLANK, out); + + /* Verify pager is now in bypass mode */ + ut_asserteq(PAGERST_BYPASS, pag->state); + + /* Next call should return the remaining text without paging */ + out = pager_next(pag, true, 0); + ut_asserteq_str("line3\nline4\n", out); + + /* No more text should be available */ + out = pager_next(pag, true, 0); + ut_asserteq_ptr(NULL, out); + + pager_uninit(pag); + return 0; +} +COMMON_TEST(pager_test_bypass_keypress, 0); From patchwork Mon Sep 22 18:00:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 390 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564116; bh=+DCbGlA9EZRqIhDuhnii+ZA7CNCZRXxZqCr507nxogM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=iwTkc/qUyUx8zqdTImVVdWbg4Hgs6XlHAvhrRFz8hUeKbJhprLpliBpshUcSwkSqO X6ZiJbLS1pTRCPUL0PX/2uuCfkZuPJQuKAGSKBmy7kpCFA6wSKGsgN75zai4lza2ga tXYQBrps3EimMwVlzqwtwTDWbgnDSi6XYVsKQq/6kA04C7Ye7msRnl0d8MobRMm74w eJbnTDGe7PGBSXqVeOXkzcFL2h2VY1MlvGO4cEsXa1bpkwP32gg//+nQMMk0Q7ddCe TfbqRE8xx1DLjPmYNXIlhcWV5DurpO6EwSOCkSDxM9d4c4jE33qGLlr10dB79sfltC xGiJI8yC/VhZA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2D1F867C65 for ; Mon, 22 Sep 2025 12:01:56 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id AquCIukwkRd1 for ; Mon, 22 Sep 2025 12:01:56 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564116; bh=+DCbGlA9EZRqIhDuhnii+ZA7CNCZRXxZqCr507nxogM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=iwTkc/qUyUx8zqdTImVVdWbg4Hgs6XlHAvhrRFz8hUeKbJhprLpliBpshUcSwkSqO X6ZiJbLS1pTRCPUL0PX/2uuCfkZuPJQuKAGSKBmy7kpCFA6wSKGsgN75zai4lza2ga tXYQBrps3EimMwVlzqwtwTDWbgnDSi6XYVsKQq/6kA04C7Ye7msRnl0d8MobRMm74w eJbnTDGe7PGBSXqVeOXkzcFL2h2VY1MlvGO4cEsXa1bpkwP32gg//+nQMMk0Q7ddCe TfbqRE8xx1DLjPmYNXIlhcWV5DurpO6EwSOCkSDxM9d4c4jE33qGLlr10dB79sfltC xGiJI8yC/VhZA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1B2B467C55 for ; Mon, 22 Sep 2025 12:01:56 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564114; bh=RUAsu/EBlmHOpGxHFenUTzPKhqlP7BF35aGgdwqwRfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J9tnMjPE8dfctDprzh1QSibMcsDAZ3QyDvBhSOxEJLL0l+SAnUiEAziT2bsUpFCQ/ uyuM0jhAt9vg/nGxWJxh3370Ft7RgA9LaldTVI1h24WvV1ABhthfCXxprMLOIKLn6V pib36Jisi5sKWjRG8OlT+L+wfY3yOe+qFCC94lD8qehYKgNFfE8RcJXbNGpuT+MO17 gdthG6LPuAl++x3Q8jCltqZg3ud1WuQTYqXXKPkOvVl3R1h3VLEQsv9dGnYNcT/jAm LMEaXYaYo03+gHPENKZbxP5Kht/UEK6Gjh3T2CBOIR4VKs9rol+KtMjJcduOcFqy1s NdFCz8lGkxT+Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 334DB67C52; Mon, 22 Sep 2025 12:01:54 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 8wPIhR2ReEhn; Mon, 22 Sep 2025 12:01:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564110; bh=YpfR/4IkCxfR5qdFYzpIo7GgTvuv3uJsMVmM/+6r2ho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e1bMaxKyhUb8UD/BGuReBBG0TIaENg+ACA42VbBy4h4/UP6PPcwjtnDGTCDRgbqY7 WpQ3LL9wAzMqeudgKBDX/gdhmsli8p3AsnUCQgIpzdxkKQ+LPmv+I9pW81NZNMac6K vhYybsau/mX5dSj/tH965DAIhNXOtz8i7jbHTfLcPEoX+ya+Op51N5ORvej36pUk/M uH7ruqX/dUL9mdvxF3WjyZuPj56tWqH7r2FcKrNW66VUvS1C256slDUIIozwHOXJe9 iTtxDTYWBy4cQXpRhHY4DWzE71kPGjmMFPXa5OlicxC9dv2h3S7MmnOuuuyAdUPJ7X 48CJ+ESp4fJCg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D069B67B38; Mon, 22 Sep 2025 12:01:49 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:50 -0600 Message-ID: <20250922180116.3088502-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3OPCYJA6MFQRBDRM7XR35PNHWL6NB2JX X-Message-ID-Hash: 3OPCYJA6MFQRBDRM7XR35PNHWL6NB2JX X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/24] console: Add a way to quit pager with no further output List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add support for pressing 'q' to throw away any further output until the prompt is reached. Signed-off-by: Simon Glass --- common/cli_readline.c | 1 + common/pager.c | 19 +++++++++++++++++ doc/usage/console.rst | 3 ++- include/pager.h | 20 +++++++++++++++++- test/common/pager.c | 47 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 88 insertions(+), 2 deletions(-) diff --git a/common/cli_readline.c b/common/cli_readline.c index dc27a962e9d..244a287b435 100644 --- a/common/cli_readline.c +++ b/common/cli_readline.c @@ -654,6 +654,7 @@ int cli_readline_into_buffer(const char *const prompt, char *buffer, static int initted; bool old_bypass; + pager_clear_quit(gd_pager()); old_bypass = pager_set_bypass(gd_pager(), true); /* diff --git a/common/pager.c b/common/pager.c index c0a55b738b9..60b1adc8571 100644 --- a/common/pager.c +++ b/common/pager.c @@ -24,6 +24,9 @@ const char *pager_post(struct pager *pag, bool use_pager, const char *s) pag->state == PAGERST_BYPASS) return s; + if (pag->state == PAGERST_QUIT_SUPPRESS) + return NULL; + len = strlen(s); if (!len) return NULL; @@ -75,6 +78,10 @@ const char *pager_next(struct pager *pag, bool use_pager, int key) pag->state = PAGERST_BYPASS; return PAGER_BLANK; } + if (key == 'q') { + pag->state = PAGERST_QUIT_SUPPRESS; + return "\r \r"; + } if (key != ' ') return PAGER_WAITING; pag->state = PAGERST_CLEAR_PROMPT; @@ -84,6 +91,9 @@ const char *pager_next(struct pager *pag, bool use_pager, int key) break; case PAGERST_BYPASS: break; + case PAGERST_QUIT_SUPPRESS: + membuf_purge(&pag->mb); + return NULL; } ret = membuf_getraw(&pag->mb, pag->buf.size - 1, false, &str); @@ -176,6 +186,15 @@ void pager_reset(struct pager *pag) pag->line_count = 0; } +void pager_clear_quit(struct pager *pag) +{ + if (!pag) + return; + + if (pag->state == PAGERST_QUIT_SUPPRESS) + pag->state = PAGERST_OK; +} + static int on_pager(const char *name, const char *value, enum env_op op, int flags) { diff --git a/doc/usage/console.rst b/doc/usage/console.rst index 880a5b7b605..088760c6f86 100644 --- a/doc/usage/console.rst +++ b/doc/usage/console.rst @@ -70,7 +70,8 @@ only available if `CONFIG_CONSOLE_MUX` is also enabled. When activated, the pager pauses at the end of each 'page' (screenful) of output, shows a prompt ": Press SPACE to continue" and lets the user read the -output. To continue to the next page, press the SPACE key. +output. To continue to the next page, press the SPACE key. To quit paging +without seeing further output from the current command, press 'q'. The pager can be bypassed by pressing 'Q' at the prompt. This disables the pager until the 'pager' environment variable is given a new value. diff --git a/include/pager.h b/include/pager.h index 887f5d1f639..3f13f82885d 100644 --- a/include/pager.h +++ b/include/pager.h @@ -33,6 +33,7 @@ * @PAGERST_WAIT_USER: Waiting for the user to press a key * @PAGERST_CLEAR_PROMPT: Clearing the prompt ready for more output * @PAGERST_BYPASS: Pager is being bypassed + * @PAGERST_QUIT_SUPPRESS: Output is being suppressed after 'q' keypress */ enum pager_state { PAGERST_OK, @@ -40,6 +41,7 @@ enum pager_state { PAGERST_WAIT_USER, PAGERST_CLEAR_PROMPT, PAGERST_BYPASS, + PAGERST_QUIT_SUPPRESS, }; /** @@ -112,7 +114,8 @@ const char *pager_post(struct pager *pag, bool use_pager, const char *s); * * When the pager prompts for user input, pressing SPACE continues to the next * page, while pressing capital 'Q' puts the pager into bypass mode and - * disables further paging. + * disables further paging. Pressing 'q' quits and suppresses all output until + * the next command prompt. * * @pag: Pager to use * @use_pager: Whether or not to use the pager functionality @@ -157,6 +160,17 @@ bool pager_set_test_bypass(struct pager *pag, bool bypass); */ void pager_reset(struct pager *pag); +/** + * pager_clear_quit() - Clear quit suppression mode + * + * If the pager is in PAGERST_QUIT_SUPPRESS state, this resets it to normal + * operation (PAGERST_OK). This is typically called at the start of + * cli_readline_into_buffer() to allow new commands to display output normally. + * + * @pag: Pager to update, may be NULL in which case this function does nothing + */ +void pager_clear_quit(struct pager *pag); + /** * pager_uninit() - Uninit the pager * @@ -188,6 +202,10 @@ static inline bool pager_set_test_bypass(struct pager *pag, bool bypass) return true; } +static inline void pager_clear_quit(struct pager *pag) +{ +} + static inline void pager_reset(struct pager *pag) { } diff --git a/test/common/pager.c b/test/common/pager.c index 636069d5b37..ccd5230f3a4 100644 --- a/test/common/pager.c +++ b/test/common/pager.c @@ -618,3 +618,50 @@ static int pager_test_bypass_keypress(struct unit_test_state *uts) return 0; } COMMON_TEST(pager_test_bypass_keypress, 0); + +/* Test quit keypress ('q') functionality */ +static int pager_test_quit_keypress(struct unit_test_state *uts) +{ + struct pager *pag; + const char *out; + int ret; + + ret = pager_init(&pag, 3, SZ_1K); + ut_assertok(ret); + + /* Post text that will trigger paging */ + out = pager_post(pag, true, "line1\nline2\nline3\nline4\n"); + ut_assertnonnull(out); + ut_asserteq_str("line1\nline2", out); + + /* Should be waiting for user input */ + out = pager_next(pag, true, 0); + ut_asserteq_str(PAGER_PROMPT, out); + + /* Press 'q' to quit and suppress */ + out = pager_next(pag, true, 'q'); + ut_asserteq_str("\r \r", out); + + /* Verify pager is now in quit suppress mode */ + ut_asserteq(PAGERST_QUIT_SUPPRESS, pag->state); + + /* Next call should return NULL (suppressed) */ + out = pager_next(pag, true, 0); + ut_asserteq_ptr(NULL, out); + + /* Posting new text should also return NULL (suppressed) */ + out = pager_post(pag, true, "new text\n"); + ut_asserteq_ptr(NULL, out); + + /* Test that pager_clear_quit() restores normal operation */ + pager_clear_quit(pag); + ut_asserteq(PAGERST_OK, pag->state); + + /* and that any new test appears */ + out = pager_post(pag, true, "more new text\n"); + ut_asserteq_str("more new text\n", out); + + pager_uninit(pag); + return 0; +} +COMMON_TEST(pager_test_quit_keypress, 0); From patchwork Mon Sep 22 18:00:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 391 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564120; bh=mPXvTEmgVO0mqmeDaCks5nU4X5TrZU2SZfl7VNT9Nz8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GDCAlWb1zs8cy7Tcfw8djxCOayLCiWBK/vnsr31FsjGlMhwfYld/6HUx+MmzpIXPi fkzKE8XMNSdv2Vkt/V3SwCEqqyDLGxrPi3VZNthHH2DFzLrs7d/WFXpUjuzr5vAOOA +bdleVC4AoCN0MzVyqh0bf735I9/tVMCJ20SNneikqO9nsnoCA8gNArSB4MWlkfgX/ b8txKwONncrYu1AtbKrPlI46zPHM4OJWljtdh791XLdcOND8iTep7xK3MoxKD67MTk cCPW9VZCUtx67nT7OWqtv+nIaXScNe3yK4O9rZI2wNmiWrIsAr6B3Dxr+jlYl1KAIc OZRsVqDw2AWvA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 87A2E67C65 for ; Mon, 22 Sep 2025 12:02:00 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ilxjE9iflldf for ; Mon, 22 Sep 2025 12:02:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564120; bh=mPXvTEmgVO0mqmeDaCks5nU4X5TrZU2SZfl7VNT9Nz8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GDCAlWb1zs8cy7Tcfw8djxCOayLCiWBK/vnsr31FsjGlMhwfYld/6HUx+MmzpIXPi fkzKE8XMNSdv2Vkt/V3SwCEqqyDLGxrPi3VZNthHH2DFzLrs7d/WFXpUjuzr5vAOOA +bdleVC4AoCN0MzVyqh0bf735I9/tVMCJ20SNneikqO9nsnoCA8gNArSB4MWlkfgX/ b8txKwONncrYu1AtbKrPlI46zPHM4OJWljtdh791XLdcOND8iTep7xK3MoxKD67MTk cCPW9VZCUtx67nT7OWqtv+nIaXScNe3yK4O9rZI2wNmiWrIsAr6B3Dxr+jlYl1KAIc OZRsVqDw2AWvA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7707667C32 for ; Mon, 22 Sep 2025 12:02:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564118; bh=j09zRc+HFc4sUpqJw4XTY4Gv1hwy8zot9cjIe7lebeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vHz1oOHxueTRjteUYVSlUHWtziBpiMpyIBa7oVhyI7pp2W8AJzQRqvbnF+bzLvJ0J QFh0eFYcB/ITtt9sLhUi6yBr7yd8Iqth10RhpqWen/AfcoHxF3tKC+xBIrTYTgjhir VwiwZgAdi6wyuOo2RRyBWH9aiAwo/gV8rmRE5ikkedTC6B5JZI5z5jyi4MYB23M8S6 bAM7f2XRajU1zx2MphjlG5B5DEFCmqkpyhZelbGPAI7hla3yY0CavVHOpaK3jY/N/s xSjYwOptYm3KlE99/GzelNEOy5Rp+jmNvfMNdPaaGHo9OHaLU3PpfEKCaIgQll/liW BR68cCIXom1kg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C09BA5FE1A; Mon, 22 Sep 2025 12:01:58 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id zXw2EPsR9u0u; Mon, 22 Sep 2025 12:01:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564114; bh=65I4LP/MGHma2IuBzqi5avnXRrfFU1dhGisMtOkmLEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HB37CGrSgy0R+HyH62/+DcVEEI0Hs07OOnfjCO3ljGCP8HMfOhSutpc8Ry/GIfZtY AUrSy8fDL/hXo/dDSOXod8gHEC62ARyHlTAtyH49iSgMCeWlKwRf2OqYhwgsbUzJOu pQgcOGY8hMmK5eZZSdmDqvUVm+82k9bhBnT5E+T+NxeOO5MZDMuQkvxJ18uBAhazFX lNZ7Ar0JH7Bt/rzOsoCiQQGflSeFS4oIQQMb/qRF2X1vaUVlPMKNvALbc21uZ8RAcL YX8SgXA4gJLJhuOKq4nPsq+lCjakGfowBBVajhGyPVWQJzzdDvwZ8KMvoGyeHVVVoG j84OHlgRCvYLQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7885E67B38; Mon, 22 Sep 2025 12:01:54 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:51 -0600 Message-ID: <20250922180116.3088502-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4LWJNVOGEHJ4URPELWMJ3TC73HC5W65S X-Message-ID-Hash: 4LWJNVOGEHJ4URPELWMJ3TC73HC5W65S X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/24] boot: Provide a Kconfig to enable faking the boot List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass This feature was designed for tracing but can be useful for debugging too, since it is possible to examine the state of the system just before handing off to the OS. Provide a separate CONFIG_BOOTM_FAKE_GO option to allow this feature to be used separate from tracing. Enable it for the EFI app. Signed-off-by: Simon Glass --- boot/Kconfig | 8 ++++++++ boot/bootm.c | 5 ++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index 13036fd3a09..8f0cecfb1f6 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -453,6 +453,14 @@ config BOOTM_VXWORKS help Support booting VxWorks images via the bootm command. +config BOOTM_FAKE_GO + bool "Support faking a boot, for debugging purposes" + default y if TRACE || EFI_APP + help + Provides a way to fake the boot, so that almost everything is done + to prepare for the boot, but the jump to the OS does not actually + happen. This can be useful for debugging. + endif # BOOT config PXE_UTILS diff --git a/boot/bootm.c b/boot/bootm.c index a536737db09..0981494a2b8 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -1260,9 +1260,9 @@ int bootm_run_states(struct bootm_info *bmi, int states) ret = boot_fn(BOOTM_STATE_OS_PREP, bmi); } -#ifdef CONFIG_TRACE /* Pretend to run the OS, then run a user command */ - if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) { + if (IS_ENABLED(CONFIG_BOOTM_FAKE_GO) && !ret && + (states & BOOTM_STATE_OS_FAKE_GO)) { char *cmd_list = env_get("fakegocmd"); log_debug("fake_go\n"); @@ -1270,7 +1270,6 @@ int bootm_run_states(struct bootm_info *bmi, int states) if (!ret && cmd_list) ret = run_command_list(cmd_list, -1, 0); } -#endif /* Check for unsupported subcommand. */ if (ret) { From patchwork Mon Sep 22 18:00:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 392 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564123; bh=kSwPyGiDpnlObASyd7p1Vz8Klxn6LvzJ6Ouu2MSnQ+M=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Ipv6bSRVuXP6hCmbWRo/MMy8VjNAKRguSVmUcrKZ8TsBFKna/JzCn0aD7XyOJzPvD ieukyB7DSoWOyi1WkXhhTz2ZFbg1fabnZz54/aZxoE/vy5gjmfMkajlBeOX4Zbqfve Z6+zGZZaXao53aDl8smTEde+AgAHotAGDL/izNXQMLIKmQ2znTh7BHiWWWjA/Hco8G B4Kn9rVKFNy9PHfs1Z466DTNmY8s94zbZlINHby9CUC/Ud0b6SzG8GKb2T5Oja5KGM ikuPICXIIj8GtJuoAzz1MZPlVmdMy6BAFVlY2eZgD9b+SiZUpg0u1yfT/a2SKL4MRh yWbn983xUFXkA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EA38167CB4 for ; Mon, 22 Sep 2025 12:02:03 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gWEAEPoysj1a for ; Mon, 22 Sep 2025 12:02:03 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564123; bh=kSwPyGiDpnlObASyd7p1Vz8Klxn6LvzJ6Ouu2MSnQ+M=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Ipv6bSRVuXP6hCmbWRo/MMy8VjNAKRguSVmUcrKZ8TsBFKna/JzCn0aD7XyOJzPvD ieukyB7DSoWOyi1WkXhhTz2ZFbg1fabnZz54/aZxoE/vy5gjmfMkajlBeOX4Zbqfve Z6+zGZZaXao53aDl8smTEde+AgAHotAGDL/izNXQMLIKmQ2znTh7BHiWWWjA/Hco8G B4Kn9rVKFNy9PHfs1Z466DTNmY8s94zbZlINHby9CUC/Ud0b6SzG8GKb2T5Oja5KGM ikuPICXIIj8GtJuoAzz1MZPlVmdMy6BAFVlY2eZgD9b+SiZUpg0u1yfT/a2SKL4MRh yWbn983xUFXkA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D102E67C32 for ; Mon, 22 Sep 2025 12:02:03 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564122; bh=9GiD8/ijozvy+nYHBU7nrxayTCuDOGttMMhRAnLqXVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HBLGnjo1U5kvFPIXBl4usho4fgMw+UNiaDcp14gfWKbke4QN1HB/n47kxIxt/JdF1 qqabzkUTceoqlBMYjnHF37c2RuaesFESntMmBpHYIrcdXjzc/c0WQ5/KQ/mp9n7hjx qJbkaXjTyOqTg5zcxT/odP1c7oFEc7A1GAHrADieuH6SCyT0cxSPGn9QFO4RQ6ENGO 7Xl+1M9+RjJLLsXASsryv5OkFtCzuSpplQQt16GapGENnOoI5wWncEJ/mIl7qz5cee iVxAJDnFxHdQ8rhGeN+0LWCI50dJEzepZN8TePU8hBno+YQiw3u3tOO8UNvhCrmCXy m+Blj2Kjy6NYg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D584367C68; Mon, 22 Sep 2025 12:02:02 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id J_9Nb7JtfMuY; Mon, 22 Sep 2025 12:02:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564119; bh=ZFo8cakkmEF7w4nt2ZitBE+JID2UOCcR0QYT1e2SZ/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c2eDARfCj0RB+qgTkoV8y0qYhVJaqkbKP6+7t49Q2LaVSM8GvlELBFIWo1GkLyFZi OlwQCbxmm6A2HRVIlFeOdDsOH1Ldj+IF3QHaBFjvJlDt68flQnOcheRbUTjnjERwq3 DnPaIS2tcUeGiY7v606X/j8tWFggX0rrPZ0yYGSOBzqiRiyqZ1y1zxFUppyMG2EPJv 4R/dIyBEgTcZQ+XbmV90AbqMCxILUhL50n3AZRp7B6ky/rMV63iDvV2wGMr5Kh7QSS R7CbrOU5NbvEBKrLYk7utv8XrGpKD+OcDxcTchP1hEl/ohdiAHDyJhdz3fxmETDVN9 1JhxmIjVIxZxA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 10C7F67B38; Mon, 22 Sep 2025 12:01:59 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:52 -0600 Message-ID: <20250922180116.3088502-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: L65CE4ZCMOTKMVPALZES4PZ7IPZZFESY X-Message-ID-Hash: L65CE4ZCMOTKMVPALZES4PZ7IPZZFESY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/24] boot: Select the fake-go state explicitly List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Rather than always going through this state, require callers to explicitly request it. This will allow the option to be enabled without affecting the boot, unless the user expressly requests it. Signed-off-by: Simon Glass --- boot/bootm.c | 9 ++++----- doc/usage/cmd/bootm.rst | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boot/bootm.c b/boot/bootm.c index 0981494a2b8..d86fedc7be1 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -1300,8 +1300,7 @@ int boot_run(struct bootm_info *bmi, const char *cmd, int extra_states) int states; bmi->cmd_name = cmd; - states = BOOTM_STATE_MEASURE | BOOTM_STATE_OS_PREP | - BOOTM_STATE_OS_FAKE_GO | BOOTM_STATE_OS_GO; + states = BOOTM_STATE_MEASURE | BOOTM_STATE_OS_PREP; if (IS_ENABLED(CONFIG_SYS_BOOT_RAMDISK_HIGH)) states |= BOOTM_STATE_RAMDISK; states |= extra_states; @@ -1318,7 +1317,7 @@ int bootm_run(struct bootm_info *bmi) { return boot_run(bmi, "bootm", BOOTM_STATE_START | BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD | BOOTM_STATE_FINDOTHER | - BOOTM_STATE_LOADOS); + BOOTM_STATE_LOADOS | BOOTM_STATE_OS_GO); } int bootz_run(struct bootm_info *bmi) @@ -1356,7 +1355,7 @@ int bootz_run(struct bootm_info *bmi) images->os.os = IH_OS_LINUX; - return boot_run(bmi, "bootz", 0); + return boot_run(bmi, "bootz", BOOTM_STATE_OS_GO); } int booti_run(struct bootm_info *bmi) @@ -1365,7 +1364,7 @@ int booti_run(struct bootm_info *bmi) return boot_run(bmi, "booti", BOOTM_STATE_START | BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD | BOOTM_STATE_FINDOTHER | - BOOTM_STATE_LOADOS); + BOOTM_STATE_LOADOS | BOOTM_STATE_OS_GO); } void bootm_read_env(struct bootm_info *bmi) diff --git a/doc/usage/cmd/bootm.rst b/doc/usage/cmd/bootm.rst index 5af331873ce..dde441d8360 100644 --- a/doc/usage/cmd/bootm.rst +++ b/doc/usage/cmd/bootm.rst @@ -130,7 +130,8 @@ prep are required. After this the OS itself is ready to boot. fake - This is only used for testing and only available when `CONFIG_TRACE` is + This is only used for testing and only available when `CONFIG_BOOTM_FAKE_GO` + is enabled. It fakes a boot of the OS, performs all the normal steps right up to the point where U-Boot is about to jump to the OS. It then runs a list of commands from the `fakegocmd` environment variable. Note that the From patchwork Mon Sep 22 18:00:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 393 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564125; bh=reMevOO9+uxrCDN8jjjLmzpeokhPBlqDR9ykad2hh64=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Fj29z27q0LP/EEdNp1BQB2QKGtk1+Iui0IXjYSitSkkZx7wdQEz1sTK0o3DSy/7Ja Vnw7b+AZOlEJq8AiPctORZHV3eDBFI5RUvnTWtXfRbDGDF/UfXpH9KPc1MPmNXHOdF ZwlF841VPhvdYjy/effpc0DaOj5S0RteRo0KRSu+5/8vrO6rfA+fVTDTBDB/FEk/hK XhnVKtAeENTxZO9I+RTNIQB3fx+UFZ/V+LW0zCBStHgNAlCBsiymgD/SiDGUrnIdqD l9qRpc0+eKWInFRRfJx0VhR6FGfAu4wV51ZgrfOwYOWis2LgcAVjbdVrv00Z4xFudK MyRZuIifBq6tQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 49C6F67CB2 for ; Mon, 22 Sep 2025 12:02:05 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id hN1anQzdaUrM for ; Mon, 22 Sep 2025 12:02:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564125; bh=reMevOO9+uxrCDN8jjjLmzpeokhPBlqDR9ykad2hh64=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Fj29z27q0LP/EEdNp1BQB2QKGtk1+Iui0IXjYSitSkkZx7wdQEz1sTK0o3DSy/7Ja Vnw7b+AZOlEJq8AiPctORZHV3eDBFI5RUvnTWtXfRbDGDF/UfXpH9KPc1MPmNXHOdF ZwlF841VPhvdYjy/effpc0DaOj5S0RteRo0KRSu+5/8vrO6rfA+fVTDTBDB/FEk/hK XhnVKtAeENTxZO9I+RTNIQB3fx+UFZ/V+LW0zCBStHgNAlCBsiymgD/SiDGUrnIdqD l9qRpc0+eKWInFRRfJx0VhR6FGfAu4wV51ZgrfOwYOWis2LgcAVjbdVrv00Z4xFudK MyRZuIifBq6tQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 28F525FE1A for ; Mon, 22 Sep 2025 12:02:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564122; bh=TiDxWponpaOjEb/5BbXBy/zBXmroQ6OcKnGcH/8LcJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mak/hH6iP4Dql5FuNqpXd/uQ0vW7R6aEWwZYWBMXZOP6GqfVSdZsb2ng9p48iO1eQ qPM9IXh3DRQMbWlboPTaal3cou3hLa8Jv8nKJlQ/4s1LfYeEmUeXgjc53uF52mIOG6 JG6Yk0+0dhijuLf7q0OgrhsyTAMFcMnLXKvFTlka1xESUer7a3cWQ4NbqAh0fPQCao FBaCATjjBzCtELzjxS7u0eaCYvy5PI9xC9LWKB8PlSvEAE+usk435TTCez1IEsWJKT 2E56sXi3CD8KgWqcIb/w2d6grUXu8r9NVUcLNKYTz1wBUG27CbsY59/ZoZCK6a4aN6 vSwXokDxgivWA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D589D67CA9; Mon, 22 Sep 2025 12:02:02 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id WPNR74-GaWPD; Mon, 22 Sep 2025 12:02:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564121; bh=qTsvo/smK4q1bjSGD+EMi/jugyFn2GtBrFrEaAsP4u4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZP693pjTKgML83iti6vXrC3rRNSDJisf2TgP2gVRfgZMUJ6VO9Ds8uV9+OoUVeGCI Ndj5cePJEE1F3vGlINIfqwfxqWiD4Or3I/kVrwvx61WMG98p+lHXlzSRKBnKErBJgQ jFWSD/0RokzTFR7we6CNiGb/g7DmIh8Kjdm3aN6KIWu0FvJcBhh6MOFL0Ww15kYcKk a4nXJnTtkSxOchId7PA4+soInXl3BL2pc3DyFNGR/Ja6Qs18QJCZrY1nxQhzOEs2Cx PpAW8jJOoXLX7RUbF1GmUWHxWQFsKuuU0HCRPddD8Z+mqZdtErPhsEomDDSj8PtowV kszozYslHQDBA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1913A5FE1A; Mon, 22 Sep 2025 12:02:01 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:53 -0600 Message-ID: <20250922180116.3088502-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MKX3OYHVK5I54T4JG4HGNIGEHYPHJZYS X-Message-ID-Hash: MKX3OYHVK5I54T4JG4HGNIGEHYPHJZYS X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/24] boot: Tidy up the bootflow flags List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Use a BIT() macro to specify the flags. Fix an extra space in the comment while we are here. Signed-off-by: Simon Glass --- include/bootflow.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/bootflow.h b/include/bootflow.h index 422fd32a3ca..c8f5d6e0859 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -42,18 +42,21 @@ enum bootflow_state_t { /** * enum bootflow_flags_t - flags for bootflows * + * These flags are set up by the bootmeth when the bootflow is created, except + * for BOOTFLOWF_FAKE which can be set later. + * * @BOOTFLOWF_USE_PRIOR_FDT: Indicates that an FDT was not found by the bootmeth * and it is using the prior-stage FDT, which is the U-Boot control FDT. * This is only possible with the EFI bootmeth (distro-efi) and only when * CONFIG_OF_HAS_PRIOR_STAGE is enabled * @BOOTFLOWF_STATIC_BUF: Indicates that @bflow->buf is statically set, rather * than being allocated by malloc(). - * @BOOTFLOWF_USE_BUILTIN_FDT : Indicates that current bootflow uses built-in FDT + * @BOOTFLOWF_USE_BUILTIN_FDT: Indicates that current bootflow uses built-in FDT */ enum bootflow_flags_t { - BOOTFLOWF_USE_PRIOR_FDT = 1 << 0, - BOOTFLOWF_STATIC_BUF = 1 << 1, - BOOTFLOWF_USE_BUILTIN_FDT = 1 << 2, + BOOTFLOWF_USE_PRIOR_FDT = BIT(0), + BOOTFLOWF_STATIC_BUF = BIT(1), + BOOTFLOWF_USE_BUILTIN_FDT = BIT(2), }; /** From patchwork Mon Sep 22 18:00:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 394 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564127; bh=JqZYvv8dVkzMUX6Pp1AAVEHHomaFokC1sFUVA2FvXD8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=tuJXmzM4QUkr+TMT52ys7IXzuyP+AZB5NzYwVfr8LejXmu1deC2fcNwgQ1Jlk39tL Kh/iwzMoQkfZNEt/+fftIg5nvjaLgvpeH6oIzSIX11kt3DxzvuwE+tr5p+7k6QeXSM 4uBXFWHl6Ogx2aeFfe3tjbh14HdLmJRRixLtxH2FuFk+2qiQcGf7s4SNGfjos35uCB KOYt+ZanZkmuP3zQB5WEMTwIOrfhhmQ0TV2t0eTHvyv+fH0V/6yfswVBTg2d/ZrDmh 1JFe8IMD+snOQDQCUNjBJPjImRHP7LZ16kRFHnPlzPG45HzcW+37ncQRCM81JjFSju HF3fTK992OmbQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8B48C67CB2 for ; Mon, 22 Sep 2025 12:02:07 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id jZZwaLdIn3CF for ; Mon, 22 Sep 2025 12:02:07 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564125; bh=JqZYvv8dVkzMUX6Pp1AAVEHHomaFokC1sFUVA2FvXD8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fmAyPCletLixtgYWjkiYjXuLQck/Zml45GiHrsdAHRElyc8Sf/qB+Ot9GIzZHG5Y1 6Dmt8gurOoX6QCdTs3DuJtvs3zKkYqTOus22VquwjeCn2NIGdkJ7DN15Sqpyvc3BWP 1bKH+Xbzy3zrzzT3pAjvF9FtfIhfXM4C1YOVS6Rd2fdFLNwYGXAPjV+LfX9DqgIwrF vzIte/7jm4/0nO0wuCPJ2Bo+V2oOiJw7ikwYxD2Lnhcj6DmVqxPmtD+08X6J765yOd xUT41bPwEwb+0ef5y4Z5iQry+bSwktlpJL0IKKOw71OetJ8i0wgj5zfyeYhcqGZTDu Vv/0lFAU5xvbA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 81DF25FE1A for ; Mon, 22 Sep 2025 12:02:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564122; bh=+1QoAaYpN6kMnOIpFonaGbbDao0T16ysceSRHziPLms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JSXN6p1LwYL8kXbnne3IHjUfe5qi0aBBCUrIIzTSlSwrkkijN8kAe8/7prXs6OJoq W5PgucmxpfpajGQE9XFTX+TobSBXQFMtanS1az75V4hjsI/0LoVMHNG1eOnMiOIOIn aYQT7OCJvyvnpXqugV8lKDVoEdkC1sVJuDMA1MDbDrSWXHmTVoUlDuEpGPd2NgxN5C y28zAnbTIyU9XLZlJ+KSYuDhHM2dxObGij9LBjwVk19R3UBN/5wX2LCiwDpmRD40hj Nk0dIgtit2ER8z9+9X4e8JvhkNzOdXZkg1/WQiF23/YYkLn5fM+G6QY2cfW875jIgw F5zqABjLLaDyw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EAF8367B38; Mon, 22 Sep 2025 12:02:02 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id UW_8BM5XydeV; Mon, 22 Sep 2025 12:02:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564122; bh=/OzobNneqHd2Y9zxyOYCp5VYxvbbHjIXT1EvZSr85Yo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uVZvDJd5gh7A3hYamS9uqkffTa+nKo1VLg+Zf2QXxOungqiaUGr+H5WKOIZ96brx/ YIak+9+wBBswrTwKNVso/3ha+qFmJxlYSMImmoLZA7OxZyb4YcSjmmh/qnZco7I0mZ GpcM4fu12ygVZJ9xvix1JCMi0T5sWKSiPVwj6A6G6lM5Wi6udv+LldAKcvPx/oqEda BE2nyMiu6/QzkIZBI2bEPX2kEUgoX+RvS8NmjoGuoMB4iZ54pbrXZH5lu91yi1tPIE TScUP2OXPsS0YZD3sp7+KsmzdzAy2u/POUtQLg9F9OVI9q4Aq07KFEFMKFqo1ubXxb Us9DT4QNAVbVw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D9DEC67C32; Mon, 22 Sep 2025 12:02:01 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:54 -0600 Message-ID: <20250922180116.3088502-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RLLBNNQYMU62NRQIIMM237T73M2RAE6N X-Message-ID-Hash: RLLBNNQYMU62NRQIIMM237T73M2RAE6N X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/24] boot: Provide a bootflow option to fake a boot List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Allow using 'bootflow boot -f' to fake a boot. Signed-off-by: Simon Glass --- cmd/bootflow.c | 16 ++++++++++++++-- doc/usage/cmd/bootflow.rst | 3 +++ include/bootflow.h | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 43335fecb34..33ed9a1cd73 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -523,8 +523,12 @@ static int do_bootflow_boot(struct cmd_tbl *cmdtp, int flag, int argc, { struct bootstd_priv *std; struct bootflow *bflow; + bool fake = false; int ret; + if (IS_ENABLED(CONFIG_BOOTM_FAKE_GO) && argc > 1 && *argv[1] == '-') + fake = strchr(argv[1], 'f'); + ret = bootstd_get_priv(&std); if (ret) return CMD_RET_FAILURE; @@ -538,6 +542,14 @@ static int do_bootflow_boot(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_FAILURE; } bflow = std->cur_bootflow; + + if (IS_ENABLED(CONFIG_BOOTM_FAKE_GO)) { + if (fake) + bflow->flags |= BOOTFLOWF_FAKE_GO; + else + bflow->flags &= ~BOOTFLOWF_FAKE_GO; + } + log_debug("cmd bflow flags %x\n", bflow->flags); ret = bootflow_run_boot(NULL, bflow); if (ret) return CMD_RET_FAILURE; @@ -649,7 +661,7 @@ U_BOOT_LONGHELP(bootflow, "bootflow select [|] - select a bootflow\n" "bootflow info [-ds] - show info on current bootflow (-d dump bootflow)\n" "bootflow read - read all current-bootflow files\n" - "bootflow boot - boot current bootflow\n" + "bootflow boot [-f] - boot current bootflow (-f fake)\n" "bootflow menu [-t] - show a menu of available bootflows\n" "bootflow cmdline [set|get|clear|delete|auto] [] - update cmdline" #else @@ -664,7 +676,7 @@ U_BOOT_CMD_WITH_SUBCMDS(bootflow, "Boot flows", bootflow_help_text, U_BOOT_SUBCMD_MKENT(select, 2, 1, do_bootflow_select), U_BOOT_SUBCMD_MKENT(info, 2, 1, do_bootflow_info), U_BOOT_SUBCMD_MKENT(read, 1, 1, do_bootflow_read), - U_BOOT_SUBCMD_MKENT(boot, 1, 1, do_bootflow_boot), + U_BOOT_SUBCMD_MKENT(boot, 2, 1, do_bootflow_boot), U_BOOT_SUBCMD_MKENT(menu, 2, 1, do_bootflow_menu), U_BOOT_SUBCMD_MKENT(cmdline, 4, 1, do_bootflow_cmdline), #endif diff --git a/doc/usage/cmd/bootflow.rst b/doc/usage/cmd/bootflow.rst index d57a6e36c3b..938e5c79903 100644 --- a/doc/usage/cmd/bootflow.rst +++ b/doc/usage/cmd/bootflow.rst @@ -231,6 +231,9 @@ bootflow boot This boots the current bootflow, reading any required files first. +For debugging only, the `-f` flag can be provided to cause a fake boot. This +runs the boot through to the point of handing off to the OS, then returns, to +allow the state to be examined. bootflow cmdline ~~~~~~~~~~~~~~~~ diff --git a/include/bootflow.h b/include/bootflow.h index c8f5d6e0859..284c23c59dd 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -52,11 +52,14 @@ enum bootflow_state_t { * @BOOTFLOWF_STATIC_BUF: Indicates that @bflow->buf is statically set, rather * than being allocated by malloc(). * @BOOTFLOWF_USE_BUILTIN_FDT: Indicates that current bootflow uses built-in FDT + * @BOOTFLOWF_FAKE_GO: Do a 'fake' boot, up to the last possible point, then + * return */ enum bootflow_flags_t { BOOTFLOWF_USE_PRIOR_FDT = BIT(0), BOOTFLOWF_STATIC_BUF = BIT(1), BOOTFLOWF_USE_BUILTIN_FDT = BIT(2), + BOOTFLOWF_FAKE_GO = BIT(3), }; /** From patchwork Mon Sep 22 18:00:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 396 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564134; bh=5oUTbh5pl5xn9vrvSBypW08aZoNILaKbUIZCQxRhwyQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=opi+fxwZPpMAYVI3VM9wNsG46K6nOSYwar4SuA3gOgbFREmG5EwNRBp8LXbCaK4Q3 NvPN1tEjC6fiSEjnVZBy+VVegienDJAD1C9bVg/n0TJReXYTvVxFoZTUKGLKbKNsqE ut29Me7QGWMh555aQcBkszjN+8CPUhTLLgTYT/6vnTSFPlH1W7QmXlmu0wWfyt6swE zJY+ykQpg+F2p9WImWGcDg4A2WeX101pNL9SKKjlisPsU1yzrSGkUybQdgdlLNgbNA Faf30bwXSrXzAs5RED8sThAzqVRXd32Gvdd2wHedUjNCPNlMtlQ2PgmtaINnpSgE3j 8H4bl/ooxh+DQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 436A267C52 for ; Mon, 22 Sep 2025 12:02:14 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id XSz5dsOuZpSo for ; Mon, 22 Sep 2025 12:02:14 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564132; bh=5oUTbh5pl5xn9vrvSBypW08aZoNILaKbUIZCQxRhwyQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kYsARbtAhp0mWyPdWaBNUPEHB2TuLzHNzTH6gXXLYa5fYO5Fb/sX/Un01kEs3M4en iNA4PepiuV1+qjvJlIzAB3LHvaQZfIGIFarmokCgEPnu1zMmbyYlqQ05vuQR9n9SBe zeMyqpBL3XjI5wKTrK+ntyhq83OO4D3R/v8m9ol0CrmcA7O6iPwrIeItSxI1dHZIcQ hj9OElOSugojhfuK5Cz3PW189N51FLQuiAaiCF5vNgWopXGjbr/nI7qnyMMGK8rNA/ zpctH0SMbEP1i+UiN61fdQYLNinJ8OeJLFjbea1LlxwYMu/j2zIi2qnB5FiruBBGRt uaz3i08jQNebA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4279867C55 for ; Mon, 22 Sep 2025 12:02:12 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564129; bh=kG9oi3H0fJBiCQI5Dz5VEb1lpaU5peNoCgaoGVuRI1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e3AyfMWDlaHXPSkyD4BplAvknmvxEEIkW131G7yaxYcep60WT8TFDqzJ+iMSGl3U9 a1gBq1w8YKLYyJHLBJasAw4vm+wiHbOJ/aAG2W+j5SLVmI0ElDxpbGPgERsLIznplC 53pN5cGRlbPC0GVa2jd/ppglGHyGno+8ayacOoaAMEL/6I5QohTMiNYiX4DuBEp1C9 QF8V6paKMSnI5LQpWTv5Su7czPUi545dZlyM7fNLCnBJ+a6AMFm9/ZuWa6l/8Nn8NH 785DaY5lvA4iifg9bCMsL6g35eP7BPt/k/VjGlMK0jKbhu8M3r4pWym6f8G65DILuT FZCodrr/ZcURQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C405A67C32; Mon, 22 Sep 2025 12:02:09 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id puIeq9R4yzgA; Mon, 22 Sep 2025 12:02:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564123; bh=SeGcbpVMS8VpoXV6kpP5KjFce5iptz9UsBDMjK5XbyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HE9JEVzYTBeYbtn96F0sj0Dl8NJ2A7g89okF5rL3/70CTxjKlqZ9o2leB73gnhSmI MnThBtbsedkXSqhIEMvQZzmOh8TbywSLqxdYK4ZdcAG4A4kvnnnnea6BLGTLLC85fs 4ETIcmA3Z2RILuaKgWVrmHDQRaBge8mooTp3gaEmV67KycqMvD7XExKg8dwYCcWKXx dFes8/hJ6VlhSdS5sMuT+oqljK0tfBTSG0kGR+FLZ7u2eE02cQEOU/C8bDE+0NkFMk 8vmcyzWIt3oB+YzRpsr3zZf2hUI5yppNn9bA+9/chJmNy/Utk/G+OOz45Une7yJgu4 SXCyyATOpFb3w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B1B9167C5F; Mon, 22 Sep 2025 12:02:02 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:55 -0600 Message-ID: <20250922180116.3088502-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: X4L3PGZPQCJPKLAGRNUFSKKPPJKOJLTA X-Message-ID-Hash: X4L3PGZPQCJPKLAGRNUFSKKPPJKOJLTA X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/24] boot: Drop hex prefix from the booti image-moving message List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass This message includes the 0x prefix which is not used elsewhere. Drop it for consistency. Signed-off-by: Simon Glass --- boot/bootm.c | 2 +- cmd/booti.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boot/bootm.c b/boot/bootm.c index d86fedc7be1..42259256ad4 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -848,7 +848,7 @@ static int bootm_load_os(struct bootm_info *bmi, int boot_progress) /* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != load) { - printf("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n", + printf("Moving Image from %lx to %lx, end %lx\n", load, relocated_addr, relocated_addr + image_size); memmove((void *)relocated_addr, load_buf, image_size); diff --git a/cmd/booti.c b/cmd/booti.c index bfbe530cb15..017cb6ed923 100644 --- a/cmd/booti.c +++ b/cmd/booti.c @@ -78,7 +78,7 @@ static int booti_start(struct bootm_info *bmi) /* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != ld) { - printf("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n", ld, + printf("Moving Image from %lx to %lx, end %lx\n", ld, relocated_addr, relocated_addr + image_size); memmove((void *)relocated_addr, (void *)ld, image_size); } From patchwork Mon Sep 22 18:00:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 395 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564131; bh=BtHqyoacUoRM6dDL2fyERzy7md/MydZRmy8KWZu7WI0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DJ0Ba6n/sZgXmwGnma1uWG3oFmqRBuO1JMftzRmhBOuYWpYO4b+PdtQC1TBYjJ8zC FuHgvxAhqoAKFZpfxW7w5pwwj0fF5fuwKpg3M2HhugsfPzkqvSipQ6ss7QOHaY+9Lz rzVb/kiie4mii6/ViPVR5QhXjijK0fhKmFOgXpbCeBzEBb3FLhFsVjKKSFbFnGcGX8 vYvmnhiSHvMTdxwpMPwbF9rvVeuUs/PAtnCrpMAPh7nxSkkZXTqpqm10Vylx8fc8tw nIO7tD43Bg7E3XF/1EOvTB6fg7pD7YO+ToD2fqiCboZGOIyE/mTzTGhBlShWlGfS0D FpjyOQlykwDQA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EFBD167C52 for ; Mon, 22 Sep 2025 12:02:11 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Z_r6PVxz4VYw for ; Mon, 22 Sep 2025 12:02:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564131; bh=BtHqyoacUoRM6dDL2fyERzy7md/MydZRmy8KWZu7WI0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DJ0Ba6n/sZgXmwGnma1uWG3oFmqRBuO1JMftzRmhBOuYWpYO4b+PdtQC1TBYjJ8zC FuHgvxAhqoAKFZpfxW7w5pwwj0fF5fuwKpg3M2HhugsfPzkqvSipQ6ss7QOHaY+9Lz rzVb/kiie4mii6/ViPVR5QhXjijK0fhKmFOgXpbCeBzEBb3FLhFsVjKKSFbFnGcGX8 vYvmnhiSHvMTdxwpMPwbF9rvVeuUs/PAtnCrpMAPh7nxSkkZXTqpqm10Vylx8fc8tw nIO7tD43Bg7E3XF/1EOvTB6fg7pD7YO+ToD2fqiCboZGOIyE/mTzTGhBlShWlGfS0D FpjyOQlykwDQA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DBCD267BCF for ; Mon, 22 Sep 2025 12:02:11 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564129; bh=xJvwXa97tNokwu6FO7t2qkM6565Ca9aNsA2jGJlugio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XtZzwDk5X6UAAwc50bCQ1cFlL6BVerIfRRxeCH6nd5k00mc9J1P4GO5NZKz/k60N7 59JsWFN+qgy/At09D66KLJZM1GtImSvmFHwpvvETH2QirtUTfaQvawDoW6rR1AEQor 3cIDvKwYRbhoS0IF0d808SAsEeQVv2kUlStlhN0wlb3Qm7Gg2/HM+IcVAL0NgzK2aM NoeEgFrYAKfe7VF8Q3H51LSvHqOYQJBrsjDbmc0vI7I/wwVzvSCP1QdI1OyOkNkW4P 2UWpjlKOhpeOMO+Lj26h5JbwLPr2bFGsrfFToYgAXHHREv9ploSWU1tnwgFmeGnqlB 1DIdPWREaEAyw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C404A67BCF; Mon, 22 Sep 2025 12:02:09 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 2xdHOPI1EO48; Mon, 22 Sep 2025 12:02:09 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564127; bh=+Z9Scyzo80ZzQvN+h9ov0uX/1zSUtkmvnRFBCpBs+XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CBbCz/D4mJsQqb4HTEEmI0kTbfVutWWTvdY4AhHxvXTuBfwL7IeMwN1cXq3Qe30tG jqkX9eaaw6iQo/vWr7e2HgqZ/9xaYKI0vB91DZ7B9r4lMz07GKk+RCMmhxKh55hB9B UoasujMjFeCnGyuZQSNRPTNtG+K9ORGE/3UhUpTkEQmuWd+SUpA2wqgdcqQ9i5Dgig u0WsBJUC716JIm2PACTBY8zl/cQdo797wtSjEJXI9xoJT2zELTqc326dUSy4lYNUJ7 ZUtxvl4loeBZXYd4oj1DPEM/teGlwKMYD7BSfBkPC2OM3SbWREzfI1q3EbG1nANdlA hzfLJn18BmOdw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 45EA167B38; Mon, 22 Sep 2025 12:02:07 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:56 -0600 Message-ID: <20250922180116.3088502-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: SI3BZVPXRDCX243CDRK3N6VYGZ5ZQNGK X-Message-ID-Hash: SI3BZVPXRDCX243CDRK3N6VYGZ5ZQNGK X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/24] boot: Show the ramdisk node when debugging List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a new debug line for the offset of the ramdisk node. Fix up some missing newlines on other log messages in this file, while we are here. Signed-off-by: Simon Glass --- boot/image-board.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/boot/image-board.c b/boot/image-board.c index 9d75def96e2..8dbc344ffb9 100644 --- a/boot/image-board.c +++ b/boot/image-board.c @@ -392,7 +392,7 @@ static int select_ramdisk(struct bootm_headers *images, const char *select, u8 a break; case IMAGE_FORMAT_FIT: if (CONFIG_IS_ENABLED(FIT)) { - log_debug("ramdisk fit load"); + log_debug("ramdisk fit load\n"); rd_noffset = fit_image_load(images, rd_addr, &fit_uname_ramdisk, &fit_uname_config, @@ -400,6 +400,7 @@ static int select_ramdisk(struct bootm_headers *images, const char *select, u8 a BOOTSTAGE_ID_FIT_RD_START, FIT_LOAD_OPTIONAL_NON_ZERO, rd_datap, rd_lenp); + log_debug("rd_noffset %d\n", rd_noffset); if (rd_noffset < 0) return rd_noffset; @@ -418,7 +419,7 @@ static int select_ramdisk(struct bootm_headers *images, const char *select, u8 a void *vendor_boot_img = map_sysmem(get_avendor_bootimg_addr(), 0); void *ramdisk_img; - log_debug("android abootimg"); + log_debug("android abootimg\n"); if (init_boot_img == -1) ramdisk_img = map_sysmem(boot_img, 0); else @@ -431,7 +432,7 @@ static int select_ramdisk(struct bootm_headers *images, const char *select, u8 a } else { void *ptr = map_sysmem(images->os.start, 0); - log_debug("android other"); + log_debug("android other\n"); ret = android_image_get_ramdisk(ptr, NULL, rd_datap, rd_lenp); unmap_sysmem(ptr); } From patchwork Mon Sep 22 18:00:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 397 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564138; bh=U0bphEFhu+XB6clY8SF+5ApGgjHtZHNn62vb5vo1KSY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GYH45RDRONC0YTRc02DTMU+QzK4eZJQMeHLTdUH84YxXibZMYCv1VTDKSJ5nysZ1E vtTXCeGCRfTtrCEKTtDn0jtiYwj6J5D531I91/XTu4hKAZVCa1/22XTuS8QtmElbww 0TXIF1LiAAZb+u8augzoir7Ds6zfLQl5xg2x0qvoe8wlhqh/AWHsmQB9EOhmhxrOMn aBsGc97w9tsT4GQCSE70mqwozKWRoZVNkNHy+TdF0P3uxx3tG+v66oEabewcysS7Zu VCHCupIYMm/pcc/DZ6X+9nkGmGGwXJepSLQmPgHG2ZlcN1FWBv5ioCdQxpXPc5tjTa 7tGWDqRR3KXxw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D759D67C52 for ; Mon, 22 Sep 2025 12:02:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 9HYdsOc7LRbR for ; Mon, 22 Sep 2025 12:02:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564138; bh=U0bphEFhu+XB6clY8SF+5ApGgjHtZHNn62vb5vo1KSY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GYH45RDRONC0YTRc02DTMU+QzK4eZJQMeHLTdUH84YxXibZMYCv1VTDKSJ5nysZ1E vtTXCeGCRfTtrCEKTtDn0jtiYwj6J5D531I91/XTu4hKAZVCa1/22XTuS8QtmElbww 0TXIF1LiAAZb+u8augzoir7Ds6zfLQl5xg2x0qvoe8wlhqh/AWHsmQB9EOhmhxrOMn aBsGc97w9tsT4GQCSE70mqwozKWRoZVNkNHy+TdF0P3uxx3tG+v66oEabewcysS7Zu VCHCupIYMm/pcc/DZ6X+9nkGmGGwXJepSLQmPgHG2ZlcN1FWBv5ioCdQxpXPc5tjTa 7tGWDqRR3KXxw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C71285FE1A for ; Mon, 22 Sep 2025 12:02:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564136; bh=pNKgi7VCc7ot3gOVgdzLYwrz9U7VymWJVUrob3ifP2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=npagOOXg/F2jr9y+PeOLqBwWsMWZPNsIcIPm8LJsONaz495M+GfZ7mvLaVDBEFecV qgAG7C0skvNv3WY/a8H+5swuTpXmBgTpGK3Ooi/NBrapZi24rIiK2F+J0oVld5c+Vs vN7GTTfMEcXzGKXM4o2Bm0jxKcoSKZzHM7phpYmqQO7DLfAsc25nbuI8G4+VraR+ce +Bj6FrNGy+1R+2aTZb5IAbfPF3aFs3XTbbQYoxeIdJwO4ULMztWwrWVkn+TBdflECl dVjnfXW3ixWla5pZ4cV6tyecklNCc7Y/HX1E4r2X+EyF6y2Lv83zrrVGKI4K8Ut0rH T7F0lN0qfzzKw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7DA3767C52; Mon, 22 Sep 2025 12:02:16 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id NyMmmi1W2M-s; Mon, 22 Sep 2025 12:02:16 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564129; bh=F34RV414OMsqKJ1RiB5h4y9bWxfqZ2ZP6gc2C8IHuzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QhekJ8xR4weP9ECzO00lFBHE0rGogNWhO2diWRlV7/m0RXoDVT5BMr9/5e2984kC+ ssdH/tHd5C9dSO3/rZSZ91FMxe64DRaGKAe/xIi0Yfu8YY//U6VYutrrE5s38ia3xI DYlykh1nL8qIR9Z9yxdAPfrITYyRcRaoTLYmXXIpvzEAzBmu8uGpMYqCFTQSG+TEJd stBdvmbQS6Gux+Yu1wLqt3H9GiW2s30FU+pX1jKvIEcH8TDgdyAkCMLr5dvD3M8Dt+ fwdpqEsQykG8XX5NRVgUS2RMJUYz2trBk2tx0wt6/wEpFRSYFIiAMPpWCEA4RH3/lE g9CVc4jZ1epyQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4DA285FE1A; Mon, 22 Sep 2025 12:02:09 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:57 -0600 Message-ID: <20250922180116.3088502-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4E6MXVMN7VXZJSVRZAT7ZKMXDPOVZO4N X-Message-ID-Hash: 4E6MXVMN7VXZJSVRZAT7ZKMXDPOVZO4N X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/24] boot: Support a fake go with pxe List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Provide a way to pass the 'fake go' flag from the bootflow flag through to the PXE implementation, so that a request for a fake go (via 'bootflow boot -f') is handled correctly in the bootmeth and when booting. Add a little more debugging of this in PXE. Signed-off-by: Simon Glass --- boot/ext_pxe_common.c | 4 ++++ boot/pxe_utils.c | 21 ++++++++++++++++++--- include/pxe_utils.h | 2 ++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/boot/ext_pxe_common.c b/boot/ext_pxe_common.c index 67d7b68d310..3b1412b86d3 100644 --- a/boot/ext_pxe_common.c +++ b/boot/ext_pxe_common.c @@ -89,6 +89,9 @@ static int extlinux_setup(struct udevice *dev, struct bootflow *bflow, false, plat->use_fallback, bflow); if (ret) return log_msg_ret("ctx", ret); + log_debug("bootfl flags %x\n", bflow->flags); + if (bflow->flags & BOOTFLOWF_FAKE_GO) + ctx->fake_go = true; return 0; } @@ -103,6 +106,7 @@ int extlinux_boot(struct udevice *dev, struct bootflow *bflow, /* if we have already selected a label, just boot it */ if (plat->ctx.label) { + plat->ctx.fake_go = bflow->flags & BOOTFLOWF_FAKE_GO; ret = pxe_do_boot(&plat->ctx); } else { ret = extlinux_setup(dev, bflow, getfile, allow_abs_path, diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index 13fd815451d..981023a3012 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -427,6 +427,11 @@ skip_overlay: static int label_process_fdt(struct pxe_context *ctx, struct pxe_label *label, char *kernel_addr, const char **fdt_argp) { + log_debug("label '%s' kernel_addr '%s' label->fdt '%s' fdtdir '%s' " + "kernel_label '%s' fdt_argp '%s'\n", + label->name, kernel_addr, label->fdt, label->fdtdir, + label->kernel_label, *fdt_argp); + /* For FIT, the label can be identical to kernel one */ if (label->fdt && !strcmp(label->kernel_label, label->fdt)) { *fdt_argp = kernel_addr; @@ -594,7 +599,11 @@ static int label_run_boot(struct pxe_context *ctx, struct pxe_label *label, int states; states = ctx->restart ? BOOTM_STATE_RESTART : BOOTM_STATE_START; - log_debug("using bootm\n"); + log_debug("using bootm fake_go=%d\n", ctx->fake_go); + if (ctx->fake_go) + states |= BOOTM_STATE_OS_FAKE_GO; + else + states |= BOOTM_STATE_OS_GO; ret = boot_run(&bmi, "ext", states | BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD | BOOTM_STATE_FINDOTHER | BOOTM_STATE_LOADOS); @@ -782,8 +791,10 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) if (!conf_fdt_str) { if (!IS_ENABLED(CONFIG_SUPPORT_PASSING_ATAGS) || - strcmp("-", label->fdt)) + strcmp("-", label->fdt)) { conf_fdt_str = env_get("fdt_addr"); + log_debug("using fdt_addr '%s'\n", conf_fdt_str); + } } if (!conf_fdt_str) { @@ -792,13 +803,17 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) buf = map_sysmem(kern_addr, 0); if (genimg_get_format(buf) != IMAGE_FORMAT_FIT) { if (!IS_ENABLED(CONFIG_SUPPORT_PASSING_ATAGS) || - strcmp("-", label->fdt)) + strcmp("-", label->fdt)) { conf_fdt_str = env_get("fdtcontroladdr"); + log_debug("using fdtcontroladdr '%s'\n", + conf_fdt_str); + } } unmap_sysmem(buf); } if (conf_fdt_str) conf_fdt = hextoul(conf_fdt_str, NULL); + log_debug("conf_fdt %lx\n", conf_fdt); if (ctx->bflow && conf_fdt_str) ctx->bflow->fdt_addr = conf_fdt; diff --git a/include/pxe_utils.h b/include/pxe_utils.h index 9100a861ba1..7ecb5788d0b 100644 --- a/include/pxe_utils.h +++ b/include/pxe_utils.h @@ -135,6 +135,7 @@ typedef int (*pxe_getfile_func)(struct pxe_context *ctx, const char *file_path, * @conf_fdt: FDT address * @restart: true to use BOOTM_STATE_RESTART instead of BOOTM_STATE_START (only * supported with FIT / bootm) + * @fake_go: Do a 'fake' boot, up to the last possible point, then return */ struct pxe_context { /** @@ -170,6 +171,7 @@ struct pxe_context { char *conf_fdt_str; ulong conf_fdt; bool restart; + bool fake_go; }; /** From patchwork Mon Sep 22 18:00:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 398 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564141; bh=zRueU+97wZdxD7N+DXGhPqXbWqJplfA9OTlavOpp0F8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kNNKAQcgR1QOLOsGwNZjvod2ssoFLDNjIJ0cLGf+5WHorAIVGM9cCDAfSf0wWBTUX det9+U01krCBdBXe1NpUiu7AIhpa7otzeNt3jUXK7f5opMlOMmk25Wanhwvm7i07CJ 9oRC7/igPOEbCGDHWIKFlKQ5MIv39IKrpHMw0LC145l4ZuUQyDvv2dj+kJaYUCoBVa +VT0pn+qmw6owBw/Gi9HjT00z4L6SFn7NYgF2zZdCq+2F2Yf1YY5JgB7Hm6cF0nrws Va8CgYAxBJyQWCgGTLVRntyc5qzMVnskBcSIRs63crBuVOn0ii7Oo8fEGBkYHjF4zF osdZ8YNKM8pZw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7657F67C55 for ; Mon, 22 Sep 2025 12:02:21 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id G4IpQ9Z1Gejb for ; Mon, 22 Sep 2025 12:02:21 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564139; bh=zRueU+97wZdxD7N+DXGhPqXbWqJplfA9OTlavOpp0F8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=efKLqm7DeIrGFrnSkBgn6HwpDY6Yyx5CitZVP6vjTHAXJuWvvbshjjFgRXKUXp9em XlkaijLAHARR9jcYu3mJmrVqlnFKmkqt4hzx4xx8XKf4Cc+UqvLUzdyQ6oI6KW9Y5i MbIbUIB9M77xbXZQU66M9lhVG5g41toBce4pHXlKV0mr6X1DBuS0wBnAjAvz2cwLkN 9bZ4Cc9HvtDFWQ5FV8sxZYoYC9DdiDgxgG5usUDLVEwusoOisI2gy5U+wX0WMT+96g uqjmTQNwHCSMeahF9N2RO0AuUofvZa2XbxnToiC88mvgSb8yWlKtvzgM8w4xk/Uuzd zwb82Z8BVijdQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7244467C96 for ; Mon, 22 Sep 2025 12:02:19 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564136; bh=hZ7AWwEEhEvbzH/zWi+sDCUAmIhJDfByChIgnQ4H+Ls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZPgmlFevYlxKPqfsKrUZmcnfu1iUlk/fvIbPaPn1/n2FF0OsjYH8pEUpSdKChttir vmT3w9nJghQqnI0zVMTTfG+waxSIz2uFVICFs6lMksh0MuQOwRh9NrAp4z0DX1z8fZ SBKbupgvsaDz4THA4srOsgRD9np4QCQakGdBUgWoDSGLcKABd7/w7JFbeWmNpzNHI8 88dbKCXGrT/+Rdc7/+FHS99PZ2DdOD1d/KWeqNN1H+QzONXZxpYY6t5xQgvBGaJdeQ Q11E5iOwxaGeX8YbKHQQnBpy42sDiu/f5Ot2yRb/rDr8vSvBVspHUOnPE3+HUwXr0q uxeWsHWFUsrOQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7DA4F67C55; Mon, 22 Sep 2025 12:02:16 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id SL0li8Rtws1s; Mon, 22 Sep 2025 12:02:16 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564134; bh=4faCVlOps+/K2pA+tYEmUMk/VOEStsJ/lF63vAIeFuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UHpp3ZmeSBDpHWxVW29o0YI3LIJI7xLtxhtpWEcwDLEGW3vseWv5ugcdMJ/dHFvXr sVYCd/+UwwzObN/1RC267fLT8VlHcldW5EcJSLmRLXZ8MzUTjV8xEi9SteThiBR+wg ILa5/Kadd5RM0QpGIqneOswc9WV8Sze4Mn4YLBjtaH6k+NtSrD48l5yTuuYnTWO77I 9ou2jZA3+lWOtkwxiYWJCkqG4ncEMuo+npOVzc83KbRtnzTB0cuPH5c/wo7ezpfZWT +E9kK79cmiO8YCirRRh0PXPvbh9cLl8oupuaUpDtqm76+up8c7F/1dK9kjNdgWCg+N hGEzPnErT2ANA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E496B67BCF; Mon, 22 Sep 2025 12:02:13 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:58 -0600 Message-ID: <20250922180116.3088502-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KQMJOQPFKZEU5ASVMI47P7O3JBV2JTEV X-Message-ID-Hash: KQMJOQPFKZEU5ASVMI47P7O3JBV2JTEV X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 14/24] boot: Add more debugging around devicetree selection List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Provide some debugging for the select string and the FDT which is actually chosen from the FIT. Signed-off-by: Simon Glass --- boot/image-fdt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boot/image-fdt.c b/boot/image-fdt.c index 87c1fef2193..e692fd1f058 100644 --- a/boot/image-fdt.c +++ b/boot/image-fdt.c @@ -170,6 +170,7 @@ int boot_relocate_fdt(char **of_flat_tree, ulong *of_size) return 0; if (fdt_check_header(fdt_blob) != 0) { + log_debug("fdt at %lx\n", (ulong)map_to_sysmem(fdt_blob)); fdt_error("image is not a fdt"); goto error; } @@ -330,6 +331,7 @@ static int select_fdt(struct bootm_headers *images, const char *select, u8 arch, /* use FIT configuration provided in first bootm * command argument */ + log_debug("using existing config node\n"); fdt_addr = map_to_sysmem(images->fit_hdr_os); fdt_noffset = fit_get_node_from_config(images, FIT_FDT_PROP, fdt_addr); @@ -446,6 +448,7 @@ int boot_get_fdt(void *buf, const char *select, uint arch, char *fdt_blob = NULL; ulong fdt_addr; + log_debug("select '%s'\n", select); if (select || genimg_has_config(images)) { int ret; From patchwork Mon Sep 22 18:00:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 399 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564145; bh=gdOnjnN29KlEOjNoUQ/gW2kwoXAacLKWn+Ixm0gmJfc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=d2SmcgUd3jjKoRpkj+JG73SS3fxL/b/R77r4/v+VRnBomAHKW7G09ugEce1zUOBOI kDmYzVpPKvyZWU5/6lf4hiB43wjbOTbHlUYqSKMgF1SuH8fTJxFpwuvCCMQmM/2lC1 lnfhpByf4PW8S6tCubuQMVdDo3Eb4ZHhu/sO+jzNq8y6ptBTGmfITsiJq95X6/wEl8 d8LgcaaEb72ZfKHe1FSCAGOjIEj4Arh6A9BhkkC1GS/0NISlLBLxeJZKUzX3OFPmDi spXU1zWj9E4j0mHTD+QK+Ni7enHGeXu+ma2IhTk0BsexmMq9Z1ES/6Z3zXNmN04GMQ y+r997wuRggMg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DC49F5FE1A for ; Mon, 22 Sep 2025 12:02:25 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id HnHBO6txZt3B for ; Mon, 22 Sep 2025 12:02:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564145; bh=gdOnjnN29KlEOjNoUQ/gW2kwoXAacLKWn+Ixm0gmJfc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=d2SmcgUd3jjKoRpkj+JG73SS3fxL/b/R77r4/v+VRnBomAHKW7G09ugEce1zUOBOI kDmYzVpPKvyZWU5/6lf4hiB43wjbOTbHlUYqSKMgF1SuH8fTJxFpwuvCCMQmM/2lC1 lnfhpByf4PW8S6tCubuQMVdDo3Eb4ZHhu/sO+jzNq8y6ptBTGmfITsiJq95X6/wEl8 d8LgcaaEb72ZfKHe1FSCAGOjIEj4Arh6A9BhkkC1GS/0NISlLBLxeJZKUzX3OFPmDi spXU1zWj9E4j0mHTD+QK+Ni7enHGeXu+ma2IhTk0BsexmMq9Z1ES/6Z3zXNmN04GMQ y+r997wuRggMg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CAC6D67C32 for ; Mon, 22 Sep 2025 12:02:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564143; bh=jQ0INEDzQvvdI+v8IHe5L4bX7hzwmCP2NjS81VWvkFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aTsqYAFn0pUzu+CfCAKDSE/nwxz4pIKc43JubMghpT/SbyQiKlc663l+XzLc9xIUu fpUe/z9sXzq4XVieD45WQu3+uFgWlG7MCcDkH0awj2EWkxXJq9pBxW5RJerBj6A2x+ riMA5sqmLlpRj/Z/gcG+J6Q5GfKH0y6KO+EFnehOlWJNLDGC3bl/G/RDnuRuOXwgjy AVCH8SMyuieOKv2af/xvKTI1NCe+ha8yymWsQX9vmuiPmPE84Pw+mFjC4bF0m3k4Fx MfGLOpj84qwtorBmneF9AfQ5fjAS4UxvsH/z/cz3yVtd0TWieVDKDgfEo7qHZO5cK5 jNhsexCMI5oVQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AD40A67B38; Mon, 22 Sep 2025 12:02:23 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id qFMz2Cv_0ZC5; Mon, 22 Sep 2025 12:02:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564136; bh=43nuBAUmL0mrs3x3nJwYylsmG2gaF/gtrmqmPEGTm+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IE6ljus4t/5/gb3I5JAmHmDCaH094o5ZvXV5WPdPDJwxT1lbpDirP4DrEnRprUAbb iSdvwx4CVMKZjIHqxK6svHY1RGBUDf3LmqYnL2HeDeq+ZfECvKUAxjMrlYbA6rQlMQ waFHiLMfNuZRzbd3IyLAIviY8cydwWxGHRjNjER72dsQB+xru4kEMsMZ7zaUaJlgqh lNiVK/LwIP76/ySpsw1LT46sFGsdacr49JDMlpyywqUwtFsRqpVUJHFu+TImgYOsQq nwEG3Gu2P0hQTu5oIJEofu07WHpBlnrTmOTMS1CGzOS3N0XB+98Nyi7uy//dN0nyxU Hp9XSv4O1OVYw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E9CE267C32; Mon, 22 Sep 2025 12:02:15 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:59 -0600 Message-ID: <20250922180116.3088502-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VMXP2AO6LY5HHR7VQPM2XHZSLKYL3WAD X-Message-ID-Hash: VMXP2AO6LY5HHR7VQPM2XHZSLKYL3WAD X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 15/24] boot: Fix code formatting in fit_image_load() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Drop an unwanted blank line and format a few lines to 80cols. Signed-off-by: Simon Glass --- boot/image-fit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boot/image-fit.c b/boot/image-fit.c index 0c1c07c8498..617bc3664d9 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -2505,18 +2505,18 @@ int fit_image_load(struct bootm_headers *images, ulong addr, prop_name, ph_type, bootstage_id, &fit_base_uname_config); if (noffset >= 0) { - ret = check_allowed(fit, noffset, images, image_type, arch, bootstage_id); if (ret) return ret; - ret = obtain_data(fit, noffset, prop_name, bootstage_id, &buf, &len); + ret = obtain_data(fit, noffset, prop_name, bootstage_id, &buf, + &len); if (ret) return ret; - ret = handle_load_op(fit, noffset, prop_name, buf, len, image_type, - load_op, bootstage_id, &load); + ret = handle_load_op(fit, noffset, prop_name, buf, len, + image_type, load_op, bootstage_id, &load); if (ret) return ret; From patchwork Mon Sep 22 18:01:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 400 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564146; bh=hDQNda6tGtxBV9Ei32RNJhSfrt5u6hM2dbtIpqMokpM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ebm3CltPMi2YfOcO4SFC4XqyVlgRHUEYUJtyGYZrEDqe89EEXdZHOwoeY1N//5k5T m8c1u1JjkQfHtA2EMSNMkvtVsT2R3kQVRyB5cIX6gyiZbs2BkBOqwh20pZPHBmnN3m 8vfbOF0ZEyDjIfIm9lQmpXhK+bYHn5gCEJmW262dv19pqfMqBRKebjox+PiJTaYvyl WcCYqggbhMTfDqFDr4iu1/v2sZSP8/NN6/TfVufpVdOjZHUBwuhEd+iPoRpJuWSObt C2kGh1xoHrrUwSCYtm6Sq+9DHtHnLWWbDZudSstIJ1g5gkTwIPkg8CHZPUHvuP6Wjc 4K5HuMP2vQeNQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D8BBD5FE1A for ; Mon, 22 Sep 2025 12:02:26 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2QKfG63nx1_M for ; Mon, 22 Sep 2025 12:02:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564146; bh=hDQNda6tGtxBV9Ei32RNJhSfrt5u6hM2dbtIpqMokpM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ebm3CltPMi2YfOcO4SFC4XqyVlgRHUEYUJtyGYZrEDqe89EEXdZHOwoeY1N//5k5T m8c1u1JjkQfHtA2EMSNMkvtVsT2R3kQVRyB5cIX6gyiZbs2BkBOqwh20pZPHBmnN3m 8vfbOF0ZEyDjIfIm9lQmpXhK+bYHn5gCEJmW262dv19pqfMqBRKebjox+PiJTaYvyl WcCYqggbhMTfDqFDr4iu1/v2sZSP8/NN6/TfVufpVdOjZHUBwuhEd+iPoRpJuWSObt C2kGh1xoHrrUwSCYtm6Sq+9DHtHnLWWbDZudSstIJ1g5gkTwIPkg8CHZPUHvuP6Wjc 4K5HuMP2vQeNQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C6BEA67C5F for ; Mon, 22 Sep 2025 12:02:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564143; bh=D1oKL3Ip4BClm+9vgnr3TLX2H3lph0IJ9HNRI/ijlUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UmhkjgjGMvrwzsb0eadaXuRMCVr92BtTlsf5dTteHuweGsKsUGv4TloasQgHR9sGU ZDoKACpaWiUufsNNmW6swICBxAXtBkFO72jg+CgLke7kMDV67RxHvAgAab42pxio1Z 1ho8Nvsjr8u58jjLjoMk2gCm830a6zm6ks5ofIF5jB555R09hhRsJwFCJ9P0n9kZ/k jXLS1YpthXzEvu9bbSyjtCaxxD0ayMA9FIHgqYQ5B9VoAVJmX5sK81C2D6T9SePDhs yK/8tuU9qUAzeHjCJgLpUj6K+j6USbTC0P8fTl1fEy9xGJJdB2eP9OGVIssykuLfN6 ipSK+LthXgQ0w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B67A467C32; Mon, 22 Sep 2025 12:02:23 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id kPoEPk4_MviH; Mon, 22 Sep 2025 12:02:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564140; bh=VFBdL8WUFetw7e2yiPBLwgzGQIGUrrBxgrgV1qXSDRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZCbx2z+zVfrtO6GFvgfdXb/JM8kKVFIfdnQa54SmGuMa+9Ny+opzm0EOQmaSNP8bS ahrklGm06HlcI2nKue+AcJG2lmhcTAlLzyTgB4Or+ZLgBgjoSWOk6cqpPl6MGboWqk fPAHFguOjOR0caAFTXyr6sN1pbDN4/bdo5jO9a+zH88bDnA4NA3x7RnMnlOfqt/KtX dPnLQ7JJge3xcWRM2jYVbdbyAYFTUbjy+KqfObUmAAwtzceu81EXyKQdwQlXCJrLt2 qnyP2HsTOYe+9GU/GkDaa7R1A15iQqvKlw4scSruMufy8b/gziF9NJX5/BN4Q1li/F C8Z+gvXdW7beg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7F12F67C68; Mon, 22 Sep 2025 12:02:20 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:01:00 -0600 Message-ID: <20250922180116.3088502-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: Z7YWHW3EAH6VEBSKBRI55UWP2UDA3AKS X-Message-ID-Hash: Z7YWHW3EAH6VEBSKBRI55UWP2UDA3AKS X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/24] boot: Add more debugging in FIT-handling List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Provide return values from a few functions to make it easier to track the flow of execution in a few places. Signed-off-by: Simon Glass --- boot/image-fit.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boot/image-fit.c b/boot/image-fit.c index 617bc3664d9..7bcdb97985a 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -2467,10 +2467,12 @@ static int handle_load_op(const void *fit, int noffset, const char *prop_name, prop_name, data, load); } else { load = data; /* No load address specified */ + log_debug("No load\n"); } ret = decomp_image(fit, noffset, prop_name, buf, size, image_type, load_op, bootstage_id, data, load, load_end); + log_debug("Decomp ret %d\n", ret); if (ret) return ret; @@ -2517,6 +2519,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr, ret = handle_load_op(fit, noffset, prop_name, buf, len, image_type, load_op, bootstage_id, &load); + log_debug("handle_load_op() returned %d\n", ret); if (ret) return ret; @@ -2527,6 +2530,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr, } /* note that fit_uname will always be NULL if noffset == -ENOPKG */ + log_debug("noffset %d\n", noffset); if (noffset >= 0 || noffset == -ENOPKG) { if (fit_unamep) *fit_unamep = (char *)fit_uname; From patchwork Mon Sep 22 18:01:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 401 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564149; bh=tWlOkqIL36GXIPrstES9oc6bpCsx07wxv1QyQtGCXO4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DluCKI/nXXXXZrBlvTZ8nd1CIIFIi3W7S6GK4sgJ7Q64cw2AlnsXu16jEaIpXj7E9 ZWQforWq8nYAlpqAr5Qa9zIfJaQB2qJ4UKC74m28Z5jBqRutnF1rk59pQ9IPaAUac4 0p2FQC31rekBDYNTVydAIXjTB7Jj6BE6QxVwXS2bMDNlT1DhQNL3PCD4GWzuHhB1Ti LMfrAthoeLm8F15tW49olsbmzBmn+jmxioRBn8KZnXb1cOg9BOoZLlrMDeSiQjPEf8 8HsJ5qvxHMosCIjH0kku7nb1S/hjEcyIlEnwThC3D2M10cDjPWvQ1ALzrjIrEGFC41 tKwmLKM+cpG4g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 480365FE1A for ; Mon, 22 Sep 2025 12:02:29 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id O7_reOd-4lYn for ; Mon, 22 Sep 2025 12:02:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564148; bh=tWlOkqIL36GXIPrstES9oc6bpCsx07wxv1QyQtGCXO4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=efbmaS8/EqZwd0o20xNNReKMdDzEPZZPUS4siDM0HAIA42Jmj/a1LipEtV2sgXLaV rgCTPp5mvXk/mkieSOJvNnVNAzkDC4krf/PxQgYJB76bO+Q4ufHBmqEUpAwb9gkV4l xhn5jDAH3dSFTbpJOPP2C0L74fvjSq3Uige3SJkA1WLJvS0jkiIW++Zgil494J3XfD xcyOD2Ju4EVaZ98N4P4sJdIPY0iLe/9ezNqduQsVEeivzs3TYzAJr6Fzvs0wI+NkcI OSau4OTFpjai3NL7MXeIb6OccRgn8v8sZfIANYtKuJvcamvRq52+JgHbuH/ilD1AnX S5XIJCF1Yi1nw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 39EF667C52 for ; Mon, 22 Sep 2025 12:02:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564145; bh=zrsLI9NYOQYLCJDyIPwIzw4cVWfBdI44AB9Pw4X7P+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c5hyoNaI97V+0R5kcTQ6tlbnGtu59zWyStM82XdsekqQEubX+PRpXNK6gl2vVCE6D 5141Dkyc0of+PGH9RaLANpNpNjSN0DFgPgZekQGB0kB3ocFnefU1IO0OI6F2SxOofM SHX+kL9eN6mIatCeI+yyIWwqitv7Xg8725WqlSo+wIxBIVOOh2Msj1w+nEgPLrlif5 Z70kh7VWPzPiaBLj3YiOnkHvm7elgMYlNne7L4EgdvSEm3jdlGth2X304m9TiWs5zT qsVN7KNWv0V9sN7hABnaJMhI2U7YJM7Or+9Yu6u4UM37jXaYwwDS44aTXllU6JrmbT PSISxbqQM8IEw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9C73F67B38; Mon, 22 Sep 2025 12:02:25 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id ic3ZCiG04JoB; Mon, 22 Sep 2025 12:02:25 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564141; bh=2B9ejhXkrVS2FqjWE8CCLjp8Vlg/BRsLY5gxCxFXxoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kqc8a8YlqON6ttgBVoDykrzZtCR69XGvTKAsyQ0MmavNyu7PY76HRjDql5XzjMbRt iwao+QsuIESByXVURIRinPchFwIk+REpsXXfIuZG2PHcPjUzUlxzbYU7giWzOrbJa4 6iocjCacXCVFm9hFtZCcihKFI1FN/JSnLMLjRe3QB6GqISnZaed2VyUG0kcEs6zXiu brTHJbzpllfU7H8YJJ7wNSH4whCr2MvNzW7XdWSJp4quNBFv98Ok8M/hNmJ3R7HiNs wG253cpDSHxRTyXJDjTkgFDRqxhxfd1npjV4/CVg04XzVzb80K0JYNLRoM9V8FVJUP 99n6323P3LNFg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4E8475FE1A; Mon, 22 Sep 2025 12:02:21 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:01:01 -0600 Message-ID: <20250922180116.3088502-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TVELLVLGH2EHZKO7FBIXBM2ITD6WTFOE X-Message-ID-Hash: TVELLVLGH2EHZKO7FBIXBM2ITD6WTFOE X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/24] arm: Update boot_prep_linux() to return an error List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Rather than panicing, return the error so that the top-level bootm logic can decide what to do. Signed-off-by: Simon Glass --- arch/arm/lib/bootm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 02ff8beaeab..7c650c3ab67 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -164,14 +164,15 @@ static void do_nonsec_virt_switch(void) __weak void board_prep_linux(struct bootm_headers *images) { } /* Subcommand: PREP */ -static void boot_prep_linux(struct bootm_headers *images) +static int boot_prep_linux(struct bootm_headers *images) { char *commandline = env_get("bootargs"); if (CONFIG_IS_ENABLED(OF_LIBFDT) && IS_ENABLED(CONFIG_LMB) && images->ft_len) { debug("using: FDT\n"); if (image_setup_linux(images)) { - panic("FDT creation failed!"); + log_err("FDT creation failed!"); + return -EINVAL; } } else if (BOOTM_ENABLE_TAGS) { debug("using: ATAGS\n"); @@ -207,6 +208,8 @@ static void boot_prep_linux(struct bootm_headers *images) } board_prep_linux(images); + + return 0; } __weak bool armv7_boot_nonsec_default(void) @@ -345,6 +348,7 @@ static void boot_jump_linux(struct bootm_headers *images, int flag) int do_bootm_linux(int flag, struct bootm_info *bmi) { struct bootm_headers *images = bmi->images; + int ret; log_debug("boot linux flag %x\n", flag); /* No need for those on ARM */ @@ -353,7 +357,9 @@ int do_bootm_linux(int flag, struct bootm_info *bmi) if (flag & BOOTM_STATE_OS_PREP) { log_debug("Preparing to boot Linux\n"); - boot_prep_linux(images); + ret = boot_prep_linux(images); + if (ret) + return ret; return 0; } @@ -364,7 +370,9 @@ int do_bootm_linux(int flag, struct bootm_info *bmi) } log_debug("No flags set: continuing to prepare and jump to Linux\n"); - boot_prep_linux(images); + ret = boot_prep_linux(images); + if (ret) + return ret; boot_jump_linux(images, flag); return 0; } From patchwork Mon Sep 22 18:01:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 402 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564153; bh=GFBWSilnT7/LqdDDPa6iqEbvRQ1Jm/K7sVT5rh3qxoY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DgDbeQE/k9/JSsCUdvy6+9SMVkJBuav2ngopF7eomhvI9nEdU7q7xtOTmabMls/VQ c8fBDJ9sH28lhkCw76EFkBO95S++KN1XU/0uxLFrSv3yemiMIKuvap4DLsOHVKJ7vN Q25ZCNlfPGJpHptRIZTr99mjle83xuRhVhjX9iYufNrzk1Jd8NVD3WYXg+vJd83NYg RArcLtF1JfPswsH6XdxJCNW8tQ8xqgCYo4c79GjYfFJy9CeqPN9kBM0jcS21QAJlZf kbcXctx7bcoopCrHzs631QF/KhoYqFMVQlkuZR+A726jaR6nBGlMaDs2T9X3O1Zbs0 jAq9glHk+bMhQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9603867C32 for ; Mon, 22 Sep 2025 12:02:33 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id M5jngtc22qRp for ; Mon, 22 Sep 2025 12:02:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564153; bh=GFBWSilnT7/LqdDDPa6iqEbvRQ1Jm/K7sVT5rh3qxoY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DgDbeQE/k9/JSsCUdvy6+9SMVkJBuav2ngopF7eomhvI9nEdU7q7xtOTmabMls/VQ c8fBDJ9sH28lhkCw76EFkBO95S++KN1XU/0uxLFrSv3yemiMIKuvap4DLsOHVKJ7vN Q25ZCNlfPGJpHptRIZTr99mjle83xuRhVhjX9iYufNrzk1Jd8NVD3WYXg+vJd83NYg RArcLtF1JfPswsH6XdxJCNW8tQ8xqgCYo4c79GjYfFJy9CeqPN9kBM0jcS21QAJlZf kbcXctx7bcoopCrHzs631QF/KhoYqFMVQlkuZR+A726jaR6nBGlMaDs2T9X3O1Zbs0 jAq9glHk+bMhQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 86AA367C52 for ; Mon, 22 Sep 2025 12:02:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564151; bh=ZVIg1DVVg6WbWsxGUbcXAsfaki9Y0MTCT0OPEjY7DNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aw5OjoUunslCJTQiVegvRhEiWz2DeSekyUNpI74Zyy+TfnG49rasS1f3HWNY6DEk1 zb0dWV9k8y4rD/tIPx8Y+778+1enIERkGHUr7x8o+KIvkDC6ioy3T5yHXA1jlvnhzo V0/YjLPuSPCUzT/kBPXXDdqPOtqOe1iNXDfL5Nhfyhn9gJvyzTD1EuBH2EfpewgeDO 94PCT/Z4YGDbAyndL8DIuS50xCOZ/WtlVJ3uN0dpxtU6uTjJCpvbYU+PlFUcAP8b4E gdBs2ktGoYUcvUR0WKQnvYLPQv+PNqGzj0RM9pf8wIZUumkJscqpqdYFmcCyFztVCC 2DZC/h3uho9kw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7E66B67C52; Mon, 22 Sep 2025 12:02:31 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id gRlTQwPAv2aE; Mon, 22 Sep 2025 12:02:31 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564146; bh=K93KCoECWGoTj16fRtogYeAvY4Cru4PkQXQGy/G1t3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IaxRFGPtuL0R5kSax19EwqKccNun6A+gDm7zdG5R4xP0nF/MrquWSOqOCByoxb6N1 X8m+rl1fXI3GNCk+FeQnOppO+WYF/NM8hTEh127OjKmywAqlS8YmO+4ItQwdiqz1tr ISHxDcGuyOHj4aFcObeD69PKiDWG82i+sjMtiQ/vY4vADTQkgR2qeFQehXs7u2zR7q jY1yhSlK1Bzbp7oZ+gifEem28Gf2huGsHqrtp6lNSi7PQbBEKQRHxgp1tOJUQK0+fG A69nXSUg7M32KtH48Xf/CxwcknvnWXG2y5AYcocAc74xSlnasZuk2LC6F7rF6O2kwx fBKGsOY1oYfYg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E085C67C32; Mon, 22 Sep 2025 12:02:25 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:01:02 -0600 Message-ID: <20250922180116.3088502-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7PBVHSGG56PK57LVUAIEAEL2WHFXCTBX X-Message-ID-Hash: 7PBVHSGG56PK57LVUAIEAEL2WHFXCTBX X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 18/24] arm: bootm: Fix a confusing message about ATAGs List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When an FDT is not provided, U-Boot currently says: FDT and ATAGS support not compiled in even if CONFIG_OF_LIBFDT and CONFIG_LMB are enabled. This can send people on a wild goose chase. Add a separate message for a devicetree not being present. Signed-off-by: Simon Glass --- arch/arm/lib/bootm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 7c650c3ab67..111c2132c6e 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -167,8 +167,9 @@ __weak void board_prep_linux(struct bootm_headers *images) { } static int boot_prep_linux(struct bootm_headers *images) { char *commandline = env_get("bootargs"); + bool use_fdt = CONFIG_IS_ENABLED(OF_LIBFDT) && IS_ENABLED(CONFIG_LMB); - if (CONFIG_IS_ENABLED(OF_LIBFDT) && IS_ENABLED(CONFIG_LMB) && images->ft_len) { + if (use_fdt && images->ft_len) { debug("using: FDT\n"); if (image_setup_linux(images)) { log_err("FDT creation failed!"); @@ -203,6 +204,9 @@ static int boot_prep_linux(struct bootm_headers *images) } setup_board_tags(¶ms); setup_end_tag(gd->bd); + } else if (use_fdt && !images->ft_len) { + log_err("No FDT provided\n"); + return -ENOENT; } else { panic("FDT and ATAGS support not compiled in\n"); } From patchwork Mon Sep 22 18:01:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 403 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564157; bh=hI2Oii10CjlfdXXuvHMyiko3Z3Iy6hxVXP1o48/+wWs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fpEmFLCZHgbx7lAWiWO9KWOTclCHD35q+I8jbnEeJ8gBz3eaaiFn3AUdP5F04L7We GZro313BTXJRwdl8WOt5E6C9lOXj+LRX1olX0+gaJf8A+XH31yQWB6QQfjFITnnJ1z 60lBS1xCMeNb+DHhw0uK9kbTF+EW4AwmSeGG1Ofsl7viSK5aQnl6p1W+GhcV4+h758 rHuW+gaQKup8dcKQ7DPz55KgwQ/T9g4vndrGhMhOrcYPl1ygltu58v4m9CogipxMMt +sMxtHdsozuNL6rf0nF7gL+3gAV78Wb6K01efATMjgW9cVcBVrk1pZK7UkwAFIPFJX aU/Nsxmune1Hg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F13F467C96 for ; Mon, 22 Sep 2025 12:02:37 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id nQfNxojpqSQC for ; Mon, 22 Sep 2025 12:02:37 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564157; bh=hI2Oii10CjlfdXXuvHMyiko3Z3Iy6hxVXP1o48/+wWs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fpEmFLCZHgbx7lAWiWO9KWOTclCHD35q+I8jbnEeJ8gBz3eaaiFn3AUdP5F04L7We GZro313BTXJRwdl8WOt5E6C9lOXj+LRX1olX0+gaJf8A+XH31yQWB6QQfjFITnnJ1z 60lBS1xCMeNb+DHhw0uK9kbTF+EW4AwmSeGG1Ofsl7viSK5aQnl6p1W+GhcV4+h758 rHuW+gaQKup8dcKQ7DPz55KgwQ/T9g4vndrGhMhOrcYPl1ygltu58v4m9CogipxMMt +sMxtHdsozuNL6rf0nF7gL+3gAV78Wb6K01efATMjgW9cVcBVrk1pZK7UkwAFIPFJX aU/Nsxmune1Hg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E0AD167C5F for ; Mon, 22 Sep 2025 12:02:37 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564155; bh=Il9EP6BgSAcZbTI1car1Y08j/7PNp+G5ofyRAOu7MhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tj2NTdL/Ugiea7YR5ktrfCC8EsZvPT2BVXdATM7GU9p4WkVqa09t4xnuCHijk/GwF ldfUnPfuXMFc9ouvZeEdas3ULnPA/ys7TNg6kPROlhCDhwIRuaK27dW04ecJD3EfXm R2X2mxygmUTc53i0VFXpjDPt85g6Fj+6DRUWp+F9aUg7XwLx37sZJFlGVZo8o7Pzt4 Q7WN+ERcRszwgQqdRTfXyDhkXcAtqte2J+aHaEQXuoEwdykja/yXkeU6qGbj1yoi68 MgZIEG8LG7LpS1ss1JSkZLf8xPvEWeonyzsglptQpx/rwJNwPVe6DmChDgb4QiGQPM ubI9uVkN85aPA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E1BAF67C52; Mon, 22 Sep 2025 12:02:35 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id PnLYwxRku22N; Mon, 22 Sep 2025 12:02:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564150; bh=F9gTRW/Nu26tGPGNzdds2/J0UEFEAYDjJNvl7kyDIbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C/+krF1Ufm7RJYdU1XYBta1yDeN7pmHzKPSboQQ70Nr8Nze38j1QaXWQtiSjQkQcJ 7rFizjycrwowGqT7ea2N/kw6KWraXA/4uPO0XGQQXWJu/gg6AqMd7FZITrR3YnjVZV BcDAScsRBqJ9HCIfcGzcaFFznFCbalkAjtKF5i+SASVh4l4Ttqh6A2g5P9lFT8BBG2 VyJMKc4plbxVbbgewcRdVaF8eSjstNHx5sbsEQYXInFhLnzlAEWYLpmq7QaqOHpOF8 BmDbVBTypXp1fbWp/zDjyYBz0+0cAOVc4XZGQ2pgzOKqOs9gBef05FaAYYhxHSe+4R xYjNxKmpLTC5A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 77B255FE1A; Mon, 22 Sep 2025 12:02:30 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:01:03 -0600 Message-ID: <20250922180116.3088502-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: FWUXASCTH36QXJTFA3YP2HT4TXR4GYYP X-Message-ID-Hash: FWUXASCTH36QXJTFA3YP2HT4TXR4GYYP X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 19/24] lmb: Provide a static inline for lmb_alloc() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When building xilinx_zynqmp_kria we cannot access lmb_alloc() since it it is not present in the image. The linker garbage-collection does not seem to handle this either. Follow the normal procedure in this case and declare a static inline. Signed-off-by: Simon Glass --- include/lmb.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/lmb.h b/include/lmb.h index f221f0cce8f..3b52ee33abe 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -93,7 +93,16 @@ long lmb_reserve(phys_addr_t base, phys_size_t size); */ long lmb_reserve_flags(phys_addr_t base, phys_size_t size, enum lmb_flags flags); + +#if CONFIG_IS_ENABLED(LMB) phys_addr_t lmb_alloc(phys_size_t size, ulong align); +#else +static inline phys_addr_t lmb_alloc(phys_size_t size, ulong align) +{ + return 0; +} +#endif + phys_addr_t lmb_alloc_base(phys_size_t size, ulong align, phys_addr_t max_addr); phys_addr_t lmb_alloc_addr(phys_addr_t base, phys_size_t size); phys_size_t lmb_get_free_size(phys_addr_t addr); From patchwork Mon Sep 22 18:01:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 404 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564160; bh=kmhpxyCyjYP8PDl2k8cBCV8xOiJtnFXQJo/q8exLp2I=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fjMvO94WYLqSpYR7QIXdA+8lJYWqw2xGCpKb0dL8xOplMQAuhqUXEmdmMcvWvTR06 4uIi5YCA7u/bDIbWKVjk2RXLTENgxsdx6W9TBGR9HyIMU5OUkv0QmDMndwccAEzlQ4 Vc9Ze5lpVe1EjkC5HN4UtM3OcecF9ZAcxfs/fPhj9X7se7z5UBd53SJiwMxC1wYbqv N47oDPuOYefgnm5jLstT2IAO0tPvuZmMbkLUHFSBRg1/PNWc9eKnjJ6JSjAGkLnLLl NYA2EF9U809ppCwkUyuKTGOzMzQOjwe/hovmy8QTyQaltvI6ozS7SlMo3ozmqUfE/h 6scJOv8uA/zJw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 474D467CE6 for ; Mon, 22 Sep 2025 12:02:40 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MHpUmo95smnz for ; Mon, 22 Sep 2025 12:02:40 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564159; bh=kmhpxyCyjYP8PDl2k8cBCV8xOiJtnFXQJo/q8exLp2I=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Bqfa6ivdZfC0IAvCaa5o8WZRT9cb/Ii/w/xavNocsqxkFxQKS955jnZpRKORg4Lba 7iz3k0GnDt0cDb63VrstF9l0O8+BB19H71GqK/swCRvLATHdJJWcRD5Wxm3P9im+25 B6mLksvnJUxveXeBEogsdUugY6xp51F+H/+dPppUbJwBFUlnPXvZVE55jz5Y3W56dJ lliJFTouDejVTh/YQTCNiXLdRcxCleKO9nIuzFlXkD9APtXN+8xztPX3hVn4HuQfSQ MLM5xXvFXvibJwEmU4zZ/x2/pMlqJ/3dbEfN8Zo+nXE5vo5RNgmAC3b8vwgYQMApa7 cz/Gjws9eA6gw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3E45767B38 for ; Mon, 22 Sep 2025 12:02:39 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564156; bh=vBQj8hdtr5uZIwwQ/GxpCAoIZ9tolm8O1Du09oAEsG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cfQCydQPQsp+vxDyNkP1WZl06+gixnKwpQxR+ru9p6kz43Sa1o25auoC3e3n0kz2f Qg3j8j329yMPHL69DX1KGwh3jA9RIfnFgcPuVoeqLji5xflwvadSmWSweG2YdaBVIp 52jBL+uqMIlNMP8kkjvkD0dDfRoWOXjiUlQBv1iTZiQxjparYj9wI6sIiuSNpDetqO 70NUsUloDHrwjdZP3r2z8FA9sbHFIygQZh36JNoyi8Ej1h7BNnZorUeXbz1PsrBc81 3IotlhyKjaT+Oq4piKf2zJHieGGZ8LoQUO8SNYLSgSqwf4WaFRcP1462J1rZ0gPOGf j7jtkWjeLSq2A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D80655FE1A; Mon, 22 Sep 2025 12:02:36 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id uLdlIqOTxByD; Mon, 22 Sep 2025 12:02:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564155; bh=vqM1aCvkQ2pb/M8Pt5SLlXpbMzfKAUIcqz34YjHkJpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TvDeZ7n3Qo2xZ+Znkqh+kGJMdQiDnPr84HBEx/xc0ZkU2RIbbNL4ADGa9kjj/A84N 2zCE7SZmhCPo+1SXnnehVZDgnQQtXVY0JrQBRGlDchu5Je1/yklChPygnplaLkiuXw zCanOxWqKu9lb6CjkgxX072nY4W/jZ8cJbGDt3hbW1wFCMmwcTAsNJ16PUY8tSLnT6 y1Z1neI1acDkF8TraQx84u26c9DPYai+rRZMEOR4ejuxQ+WPR/l2+LCLRV1bjTVFvh 3FC9s3XuJy4ZmFBrXF/L/p8c6BJ/C1RSZ+JsaHYpluIaoH8GHGPGIHetXXnjTWzU8e NrnC2ouBaEIKQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 13C1667C32; Mon, 22 Sep 2025 12:02:35 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:01:04 -0600 Message-ID: <20250922180116.3088502-21-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: G55OD7HGZVGBUGZOSHTNH4POVSIU3Q6R X-Message-ID-Hash: G55OD7HGZVGBUGZOSHTNH4POVSIU3Q6R X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 20/24] arm: Use lmb when relocating the image List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass It isn't necessarily safe to move the kernel (up to) 2MB higher in memory. If the kernel is in a FIT, this may overwrite other data such as the devicetree. Use lmb (where available) as is done with other image relocations. Update the return value to provide more specific information on failure. Signed-off-by: Simon Glass --- arch/arm/lib/image.c | 15 +++++++++++---- include/image.h | 3 ++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm/lib/image.c b/arch/arm/lib/image.c index d78d704cb58..f97276a84c5 100644 --- a/arch/arm/lib/image.c +++ b/arch/arm/lib/image.c @@ -48,7 +48,7 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size, if (!booti_is_valid(ih)) { puts("Bad Linux ARM64 Image magic!\n"); - return 1; + return -EPERM; } /* @@ -73,10 +73,17 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size, * images->ep. Otherwise, relocate the image to the base of RAM * since memory below it is not accessible via the linear mapping. */ - if (!force_reloc && (le64_to_cpu(ih->flags) & BIT(3))) - dst = image - text_offset; - else + if (!force_reloc && (le64_to_cpu(ih->flags) & BIT(3))) { + if (IS_ENABLED(CONFIG_LMB)) { + dst = lmb_alloc(image_size, SZ_2M); + if (!dst) + return -ENOSPC; + } else { + dst = image - text_offset; + } + } else { dst = gd->bd->bi_dram[0].start; + } *relocated_addr = ALIGN(dst, SZ_2M) + text_offset; diff --git a/include/image.h b/include/image.h index 7f3ca1088de..a972e3f6921 100644 --- a/include/image.h +++ b/include/image.h @@ -1134,7 +1134,8 @@ int bootz_setup(ulong image, ulong *start, ulong *end); * @start: Returns start address of image * @size : Returns size image * @force_reloc: Ignore image->ep field, always place image to RAM start - * Return: 0 if OK, 1 if the image was not recognised + * Return: 0 if OK, -EPERM image was not recognised, -ENOSPC if there was not + * enough lmb space */ int booti_setup(ulong image, ulong *relocated_addr, ulong *size, bool force_reloc); From patchwork Mon Sep 22 18:01:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 405 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564164; bh=+ksU/EbJgBBkn3OAwVJLdDwwXEtywLbN5rEHZOKGHmo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=YUCYf5Nf33w8L5EVJgWhVZ+I7nw9SnvAu5qdZOZeJHEBOjJHKWH2EDJOYVZihjo1F vM5aeFpMUN7CNDodiPIs8dEF7E6hdKwPuTLhp6u3xt/PbJCU8MPrgLmdJ8Oq/JWDMe MlUyfZxUdN3dXdhZ5yXjipLBNPwwsYQlNUAjDlYDogIDJGpcTzKeyshRrgWE19srxP 2j1PKDtcXbBEm4ejC+iYWbi+n28EeMu7dj9TVJptxUD3BtV2AL24qgQHkoI3RO+xDb zoxwqqNp3N2WlEtTTnFLdqFKz1Q6CgSSVAQ4PvlvhKwzE9cXlQh4n5IgyqfMRf9use SG77LpurIO6ig== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A52E967CD1 for ; Mon, 22 Sep 2025 12:02:44 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 55PrlxNwYE35 for ; Mon, 22 Sep 2025 12:02:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564164; bh=+ksU/EbJgBBkn3OAwVJLdDwwXEtywLbN5rEHZOKGHmo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=YUCYf5Nf33w8L5EVJgWhVZ+I7nw9SnvAu5qdZOZeJHEBOjJHKWH2EDJOYVZihjo1F vM5aeFpMUN7CNDodiPIs8dEF7E6hdKwPuTLhp6u3xt/PbJCU8MPrgLmdJ8Oq/JWDMe MlUyfZxUdN3dXdhZ5yXjipLBNPwwsYQlNUAjDlYDogIDJGpcTzKeyshRrgWE19srxP 2j1PKDtcXbBEm4ejC+iYWbi+n28EeMu7dj9TVJptxUD3BtV2AL24qgQHkoI3RO+xDb zoxwqqNp3N2WlEtTTnFLdqFKz1Q6CgSSVAQ4PvlvhKwzE9cXlQh4n5IgyqfMRf9use SG77LpurIO6ig== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9575367C96 for ; Mon, 22 Sep 2025 12:02:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564162; bh=w1kDv/iiS/2ukQ6kmBAdFDm5g+g4Mwjel9Nw6LTStMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ybrkfp0qzB2MwpevgUa37k4CbIqob6WZRf2VduLWe9RlQ54hZscTEOixhxkxpZttF jNektcwEss2wnvi8n0S0t7+/bc3Ma6RaGiGPEqnZsHag6bF5P0PMxH4l0pB+9Y87A1 OPof+E96R5P1ZSjQPdoaRssFJYR99o+v4uSmHv+ZiQfPSNibcGvwXE2SZtVqXGr8UC +z1Gw8Eex8+fjlMblsErjDe2fDqcHM8pLzbCsVARX0Oi26KIjgCnrz4L6oIVuZZEDj hDOZZX9XTIh/T8qtwWyayijoQVtVkN+VCXH1Z5pKbkHmLsKEO4hu2jj6x+dzzWFDRP Y2JrwHVtBMj3Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7D75067C52; Mon, 22 Sep 2025 12:02:42 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 3mXAFPwP4MCj; Mon, 22 Sep 2025 12:02:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564157; bh=3sFwDRHfA8jbZB2e3+ut4WgL51HsqHKBVzJoT2CA0Oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tD9G4MNZ/K2IPHUTKLVuDnS83q4D06SRF8zvyvOazRXs6nefTtCWA4XjEi4Uqlq7U 1T2S/sHd9e8kBJdQP+ddJhoQKJzWXtzCPMg+1/4qhevpfLGmx8yseX3qXoMQx6vc9M +nyT3jBYxarytwzHRoUPsarpwlDotVCXipubeTkEG+5hJ7c2iOKNa9s/4WTyFbBn97 U36hoi4EBr+WJn0LFqD9UttoTCnLbSGqH3Y+2gilJ/3LvAccyZg67tCBWnhuyZpx8P AKiyG12T8ldJw6aLswSqTl3tRPQZaZIjek8ozVRJOSYEqqVUX06id1czfFCwHC0O8Z rpKkzEJLjaJWw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2B06067C32; Mon, 22 Sep 2025 12:02:37 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:01:05 -0600 Message-ID: <20250922180116.3088502-22-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5DDIMDAUDYHALSCRJMWWZKQ67UFGCDGC X-Message-ID-Hash: 5DDIMDAUDYHALSCRJMWWZKQ67UFGCDGC X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 21/24] efi: Include efi.h in the efi_variable.h header List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass This header makes use of efi_status_t so should include the header which provides it. Add this. Signed-off-by: Simon Glass --- include/efi_variable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/efi_variable.h b/include/efi_variable.h index 4065cf45eca..4c9e0149b39 100644 --- a/include/efi_variable.h +++ b/include/efi_variable.h @@ -6,6 +6,7 @@ #ifndef _EFI_VARIABLE_H #define _EFI_VARIABLE_H +#include #include #define EFI_VARIABLE_READ_ONLY 0x80000000 From patchwork Mon Sep 22 18:01:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 406 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564167; bh=WHOKhP45eS7/MSYLHlMQFB+Ks78SS72d/rf0mLmALog=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eerSc0t7m7lMuVLdS4AHD5AoFVPd2/RlkKOkZjt+eKTnDRpTwy8xaOqQQzHHMTIip gk7kAinRua0EBj5QYpsYNzXFARrLavG6OEbZkGlab/2AcIDEf81Drgx1JHVqQCzo6V PDDMRvv3ekEbtALc+0S8qL6vGe1YCYdvvKX9Q7ASVkUKHNiUqtKD/+PGZG3nSI/8vn 1MH59Y14e0jJjb9tYVwVKuGijv/yeXBUtMYdmcHxFgIBGncEmy515nUWNv5G14Z4UB Q06U95tpaZhNkJwktqnyWos1r51BOFJRcDrP2A2G2ABrTXoWyYvWwPynjCKKplVYqn QKu2wG72ElF0w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0444467CE6 for ; Mon, 22 Sep 2025 12:02:47 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id NIToYiWagX_m for ; Mon, 22 Sep 2025 12:02:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564166; bh=WHOKhP45eS7/MSYLHlMQFB+Ks78SS72d/rf0mLmALog=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VGVK9Yv0DpuD0o0xKRTQz62BztLyH6ucIp0EZvXL1JyawbosSO5RVTPMuCjrostDu pZzSrorB50IrtMZLhe3UdY38/mWBdfrOyBiQI7bL63vD36CmUf99dfesLsizv0QuTi a4dpzL1G4YUtDweq/8eMeUe6fOBJBpzMys4VZ8uS2Va+JnjgdLa3Z99ozwhrrv8oO3 Tf+8PVSTr0knACEo+dPLP8hna+EuDt3g2yGD/rWyaMWwvP3dRQnyMRt/PQVfWVRgn1 Bs4VzbL3IP4wxbIxmbFFPopZCryZAulB8mbT+AE3ti5jK8LoiF2uBzBuPDDDS/sBtz emqZJKUm9EnAw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0415A67C52 for ; Mon, 22 Sep 2025 12:02:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564163; bh=wvBb9/S4WutmGwM/gyTkKXoRo9CqUjG06o6kYIBJjtE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dltrfy/Nr8fbfz9y1S+cAdN9Lb/X6L2sKDksFs6tYg0k+U+jlqFksOiFhGBYmmEvW Fe0V6yqvDYAIGskTKceZgRiW5jycUGKl0/u/ho83Myu4XpQylwywFQQz1ak4ysUbDP mP6x4dvdhBIwrOmqxSsgHKRDXujkc7mN31P4W+NmKyADabDQkj2H4ngxWGprNsOxw5 iHRzatLVFQ+e23m/FrJR+XI/HpGY58Yu3EpluLovCxIkAkKwYw3kqW8XKfPxrgizV/ 7J/73XWZPg/gqgUp3pmWzZNkRPyIIru54lcR0t2UjUgcp37IMNNG6GzhbO8hVbF5xb KKQFogOSJcG+w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8D32567B36; Mon, 22 Sep 2025 12:02:43 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id z0kDrlQYfeFQ; Mon, 22 Sep 2025 12:02:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564162; bh=co+Ger9/B+XSt7nQLEQmFoSTGsYNS5FJyfemMoE+wAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P77y4VOgcjP6d32q/AyJosdkQhAYyeZSAHII/Btv1id0AFL7Ba29T378jUmaKIJ+9 XHMsBUNWD2LWw1AekmDNbH6zPSaMDeJiFEQiP2Y+jBObL/cR8IKmVYWNVo34TgdlT2 YKUsjHTlHBiHro59OKYCClCgwGzVTKlzkMFEwyzfrMydF3akmyHcMxec6fxU2aJUtd e8Z2DxhRYtqsvF9h3zLjMOP4e99Wkj9ig3poeYFBdz9ia1xqAi/g3COv3l9L+mvN2O NQuXHwwOLkddyjZYWKrQjsDLGB6fW982VUpfwpgx6cco6aaAvw6gcsfNBd8zlt5po7 5IynQRGPlMekg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BE6335FE1A; Mon, 22 Sep 2025 12:02:41 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:01:06 -0600 Message-ID: <20250922180116.3088502-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JUJSLTK4PTM26RYEUJ3FNHDZJ4X3BFRT X-Message-ID-Hash: JUJSLTK4PTM26RYEUJ3FNHDZJ4X3BFRT X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 22/24] efi: app: Call efi_exit() if board_init_r() returns List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move the efi_exit() function further up the file and call it if the board_init_r() function returns. Signed-off-by: Simon Glass --- lib/efi_client/efi_app.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c index 25fc2e9cade..b99de578fac 100644 --- a/lib/efi_client/efi_app.c +++ b/lib/efi_client/efi_app.c @@ -185,6 +185,14 @@ static void find_protocols(struct efi_priv *priv) boot->locate_protocol(&guid, NULL, (void **)&priv->efi_dp_to_text); } +static void efi_exit(void) +{ + struct efi_priv *priv = efi_get_priv(); + + printf("U-Boot EFI exiting\n"); + priv->boot->exit(priv->parent_image, EFI_SUCCESS, 0, NULL); +} + /** * efi_main() - Start an EFI image * @@ -237,18 +245,11 @@ efi_status_t EFIAPI efi_main(efi_handle_t image, gd = gd->new_gd; board_init_r(NULL, 0); free_memory(priv); + efi_exit(); return EFI_SUCCESS; } -static void efi_exit(void) -{ - struct efi_priv *priv = efi_get_priv(); - - printf("U-Boot EFI exiting\n"); - priv->boot->exit(priv->parent_image, EFI_SUCCESS, 0, NULL); -} - static int efi_sysreset_request(struct udevice *dev, enum sysreset_t type) { struct efi_priv *priv = efi_get_priv(); From patchwork Mon Sep 22 18:01:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 407 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564170; bh=5deuFto6HiEMAPTBrBCPT7gMwXFIcxf/oTqw7ixKlRk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cX9GDHjleUC0wpsN0T/yeJh6ROpZ3s/9Y4Y8RLJFfZa4zKJ/cc/8kFmQVzhzurI+C RQRIySNRl8AdRybsZGa8wtKswfo9PAupWZuAKv2Mk2RA0dD73dY31jZh9NCGIbclUx ALLdQZ5TlTpCm+3uMSZfIRGQxXcQVnlr9jz8vh6I2oozp1xrUBCWn98ENF5AVXeu+B jLGI01lexuRm64ch9tju9DibyeXrQmCr+yFwbbpcdQtrERxflp9deM0sW7xND8cbfN L6XXX7hpYHhGTP7CweiKMWWgFLSAg4oIlaVCq/mGmpUkmQLVbEJeIcdyl9cetUcXPR OVOhQ00Wwap8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0D2867CA9 for ; Mon, 22 Sep 2025 12:02:50 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id X5QiN9k1CIxS for ; Mon, 22 Sep 2025 12:02:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564170; bh=5deuFto6HiEMAPTBrBCPT7gMwXFIcxf/oTqw7ixKlRk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cX9GDHjleUC0wpsN0T/yeJh6ROpZ3s/9Y4Y8RLJFfZa4zKJ/cc/8kFmQVzhzurI+C RQRIySNRl8AdRybsZGa8wtKswfo9PAupWZuAKv2Mk2RA0dD73dY31jZh9NCGIbclUx ALLdQZ5TlTpCm+3uMSZfIRGQxXcQVnlr9jz8vh6I2oozp1xrUBCWn98ENF5AVXeu+B jLGI01lexuRm64ch9tju9DibyeXrQmCr+yFwbbpcdQtrERxflp9deM0sW7xND8cbfN L6XXX7hpYHhGTP7CweiKMWWgFLSAg4oIlaVCq/mGmpUkmQLVbEJeIcdyl9cetUcXPR OVOhQ00Wwap8w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9C6D167C96 for ; Mon, 22 Sep 2025 12:02:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564169; bh=axOM1/UmfCzq+i+Hq3d5bKbzgCdixg53evjxdU0b2Go=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ClyoOqAtbBcXz/W4ijhZs5gVLCXjr2Qm0WDNOOt9GiqIHrXbUGb4icmam2E/efFB5 QS82ute+qXvR3I0FnotwpLuYnR6PjGn2+nZ1o4PMciFRnUI4Yz3iDihbM0ru1kyw9Z qE/Z4WDGIv/KrKGwWpsPCZ7l89taASSL9ed73v3i+MuOKb/QAkNoVvkybJBfRcKky4 2FUGP3j6cNG77Aw85VZKE5PFv+zLcOdAuFeDtCeViFwV9puLtYXdqLLsAcUub3D01G Y4rTSLIZGTYpUt62XIQCkykCen8Sy62Vs3COV3rLBc1v1vwyVRZGzOF7d0wwwf0bGs JXRGo3RJJqi9g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3FE2C67B36; Mon, 22 Sep 2025 12:02:49 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Yzsyji2Mj9qm; Mon, 22 Sep 2025 12:02:49 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564164; bh=yyMi59vXso6VQG3BJNEQ7esrsL9DiIu5Sl4nRGrRic8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K46NBvSm1W2mo/3iLI7vz3xvs938RbOJx633qiteIfeKkR6UtmQil7G9P/iA8aA/A k++PKA7KwQv1rcvB/KNRaXXEuZmlZBGngTvrIAVrN2YV+jXIwgcJfq9a0VfNXXTAfb J+gdPjq0TAQ/4Zh93kk8F2Uj/JZOihsLOYKNeWJIcDP80HCttBxk5+5r50muY0DBj3 OTfrGwMd7ot+W9D4lMMnF/Tq2cjlkKSMhG4tO3roe+/aRRoJeaeunn9+IQe06PplSs LCZszFb57SCA42QC3YRwRO2ntOx3pof9JbIi/t1M0xjFZphIN7/ypABoJNxGLGWfOX 6pYu3hRHW6dFQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CBF6D5FE1A; Mon, 22 Sep 2025 12:02:43 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:01:07 -0600 Message-ID: <20250922180116.3088502-24-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: A4U5PJZSCN3FF6N37VYHCF57F2XIEL7C X-Message-ID-Hash: A4U5PJZSCN3FF6N37VYHCF57F2XIEL7C X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 23/24] efi: app: Move efi_main() to the bottom of the file List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass It is common for the main program to be at the bottom, but with recent changes it has crept up a bit. Move it back to the bottom. Signed-off-by: Simon Glass --- lib/efi_client/efi_app.c | 114 +++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c index b99de578fac..c851173f1ae 100644 --- a/lib/efi_client/efi_app.c +++ b/lib/efi_client/efi_app.c @@ -193,63 +193,6 @@ static void efi_exit(void) priv->boot->exit(priv->parent_image, EFI_SUCCESS, 0, NULL); } -/** - * efi_main() - Start an EFI image - * - * This function is called by our EFI start-up code. It handles running - * U-Boot. If it returns, EFI will continue. Another way to get back to EFI - * is via reset_cpu(). - */ -efi_status_t EFIAPI efi_main(efi_handle_t image, - struct efi_system_table *sys_table) -{ - struct efi_priv local_priv, *priv = &local_priv; - efi_status_t ret; - - /* Set up access to EFI data structures */ - ret = efi_init(priv, "App", image, sys_table); - if (ret) { - printf("Failed to set up U-Boot: err=%lx\n", ret); - return ret; - } - efi_set_priv(priv); - - /* - * Set up the EFI debug UART so that printf() works. This is - * implemented in the EFI serial driver, serial_efi.c. The application - * can use printf() freely. - */ - debug_uart_init(); - - ret = setup_memory(priv); - if (ret) { - printf("Failed to set up memory: ret=%lx\n", ret); - return ret; - } - - scan_tables(priv->sys_table); - find_protocols(priv); - - /* - * We could store the EFI memory map here, but it changes all the time, - * so this is only useful for debugging. - * - * ret = efi_store_memory_map(priv); - * if (ret) - * return ret; - */ - - printf("starting\n"); - - board_init_f(GD_FLG_SKIP_RELOC); - gd = gd->new_gd; - board_init_r(NULL, 0); - free_memory(priv); - efi_exit(); - - return EFI_SUCCESS; -} - static int efi_sysreset_request(struct udevice *dev, enum sysreset_t type) { struct efi_priv *priv = efi_get_priv(); @@ -421,3 +364,60 @@ U_BOOT_DRIVER(efi_sysreset) = { .of_match = efi_sysreset_ids, .ops = &efi_sysreset_ops, }; + +/** + * efi_main() - Start an EFI image + * + * This function is called by our EFI start-up code. It handles running + * U-Boot. If it returns, EFI will continue. Another way to get back to EFI + * is via reset_cpu(). + */ +efi_status_t EFIAPI efi_main(efi_handle_t image, + struct efi_system_table *sys_table) +{ + struct efi_priv local_priv, *priv = &local_priv; + efi_status_t ret; + + /* Set up access to EFI data structures */ + ret = efi_init(priv, "App", image, sys_table); + if (ret) { + printf("Failed to set up U-Boot: err=%lx\n", ret); + return ret; + } + efi_set_priv(priv); + + /* + * Set up the EFI debug UART so that printf() works. This is + * implemented in the EFI serial driver, serial_efi.c. The application + * can use printf() freely. + */ + debug_uart_init(); + + ret = setup_memory(priv); + if (ret) { + printf("Failed to set up memory: ret=%lx\n", ret); + return ret; + } + + scan_tables(priv->sys_table); + find_protocols(priv); + + /* + * We could store the EFI memory map here, but it changes all the time, + * so this is only useful for debugging. + * + * ret = efi_store_memory_map(priv); + * if (ret) + * return ret; + */ + + printf("starting\n"); + + board_init_f(GD_FLG_SKIP_RELOC); + gd = gd->new_gd; + board_init_r(NULL, 0); + free_memory(priv); + efi_exit(); + + return EFI_SUCCESS; +} From patchwork Mon Sep 22 18:01:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 408 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564174; bh=FePPPgUP0tCMuytO7oFSCrSxiGF1ApUMEb7Q8lYDEbg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hpX/M3qAPFWa3qIzIufzuPRUfb3khDgK1DJFLh9+hbgFdaiS2ZD+WrQLMdy0FlOZh gpxo9iYjqJ9O87wYbveFI4mjFZ7z7f3v5z22H3ELSfCUmH4WrQxWvQleMzFQY31Uy7 LxEfi6PagUaKzD7m2lGE8D3zLSLvIOB+J+5G5KEvfV0Q/MIUXnBxWRCL+Ge9lhdz05 puz0IpcO+JWvHR5KupGNKpo1gIgARou7Dy6rj0k8CqFqHuc/GZG65GHjBUuMgzj5IE KnF9X03aCHOMgQ9eivxH0NkWahRKXTWrFlEi1q1WUBBb+0rAMz/LrkwTmlhu2CBEcs zrd0m9Yl2+zuw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 655FA67B38 for ; Mon, 22 Sep 2025 12:02:54 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ZD9OJ8fSGhxP for ; Mon, 22 Sep 2025 12:02:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564174; bh=FePPPgUP0tCMuytO7oFSCrSxiGF1ApUMEb7Q8lYDEbg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hpX/M3qAPFWa3qIzIufzuPRUfb3khDgK1DJFLh9+hbgFdaiS2ZD+WrQLMdy0FlOZh gpxo9iYjqJ9O87wYbveFI4mjFZ7z7f3v5z22H3ELSfCUmH4WrQxWvQleMzFQY31Uy7 LxEfi6PagUaKzD7m2lGE8D3zLSLvIOB+J+5G5KEvfV0Q/MIUXnBxWRCL+Ge9lhdz05 puz0IpcO+JWvHR5KupGNKpo1gIgARou7Dy6rj0k8CqFqHuc/GZG65GHjBUuMgzj5IE KnF9X03aCHOMgQ9eivxH0NkWahRKXTWrFlEi1q1WUBBb+0rAMz/LrkwTmlhu2CBEcs zrd0m9Yl2+zuw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5561D5FE1A for ; Mon, 22 Sep 2025 12:02:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564172; bh=8mXtmJQLWeij+wlK9uXqnSHNm6vBNyGFQQrhLzproX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CkGBqkLOz3WelzYqEB2qeJ/QSTOtZ5mvKH1rryGEuKPSiuPXmDDagtC8jEr5z1VqS nMj3QXlUWAk85dbbFniuyJfVTAlbVV7JGstLfisyW0b8UWf+E6OLoygeRfP1f3fDPM 4n/bJKqVIlp8nxcxVQEOgFOr7PPZg1L5bFuQ13mmoVMNhrzYpxQCyG5HjPjkEI65Yn 8/NC+voYpI3vHAIJ5SxMmHsVgSsXJ2gNI5IN5vvUWkqYsZhSat1IJfPz/ew1tHIVb9 WKg22E8pfJSclkzhQ1jShoR2VCqOU0S2hRl4rxyB1gemVJcNBIl0jIZJUHz5WfDOSn UpNzN7sUaQYTw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B5EA55FE1A; Mon, 22 Sep 2025 12:02:52 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id bWnQxSchFzgg; Mon, 22 Sep 2025 12:02:52 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564168; bh=O64glS8AgUAndGehV6tM6+fpTSs6fh984QaJolFAM+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gjNGLPcoBTTBBmYAQF/cGw4u+Qs2W28KNeU4ZG0IkT1fy6xnpR9gIOFqTXlApHh2a r/v+KmfB8qHkHpku4CVvWAnUsb3UeangTbQYS40tAZCCnt/YC/egjkjGdVpYH12zRh cxerU/zur8t45Iu6+tU7oN0Wa65P71noCjymRTh9mb2hqHaFgbSL4/pi2K7NLc65vn eKD7FxmxSpoyWOrPMzrfoSwFMi1AEnmrr7Lm0Z8JJfopnw7KbLJVA08ATsI5s61zxQ ql/FVxrQPoo6JL8wJH9+0gY2O/tjcvVQzPmYdXZn4vucxloQQn3VZF9Ol/BCaiz5z+ ae0DBqhvDSunA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 690CB67C52; Mon, 22 Sep 2025 12:02:48 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:01:08 -0600 Message-ID: <20250922180116.3088502-25-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: N6GQPJDAUQP4Z53DTNL7OR426MB6UW7U X-Message-ID-Hash: N6GQPJDAUQP4Z53DTNL7OR426MB6UW7U X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 24/24] efi: app: arm: Add various options to the build List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Enable some options which are useful for development: - Show function names when logging - Enable SMBIOS so we can view these tables - Include kaslrseed support - Enable commands for hashing images - Support write on FAT filesystems Signed-off-by: Simon Glass --- configs/efi-arm_app64_defconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configs/efi-arm_app64_defconfig b/configs/efi-arm_app64_defconfig index 2bc7a87506d..8defb83f9d4 100644 --- a/configs/efi-arm_app64_defconfig +++ b/configs/efi-arm_app64_defconfig @@ -21,9 +21,11 @@ CONFIG_BOOTCOMMAND="bootflow scan -lbp" CONFIG_SYS_PBSIZE=532 CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_LOG=y +CONFIG_LOGF_FUNC=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_CYCLIC_MAX_CPU_TIME_US=50000 CONFIG_BOARD_EARLY_INIT_R=y +CONFIG_CMD_SMBIOS=y CONFIG_CMD_BOOTZ=y CONFIG_CMD_MEMINFO=y CONFIG_CMD_MEMINFO_MAP=y @@ -32,6 +34,8 @@ CONFIG_CMD_LSBLK=y CONFIG_CMD_CAT=y CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y +CONFIG_CMD_KASLRSEED=y +CONFIG_CMD_HASH=y CONFIG_CMD_EXT4_WRITE=y CONFIG_MAC_PARTITION=y CONFIG_OF_LIVE=y @@ -47,4 +51,5 @@ CONFIG_SYSRESET=y CONFIG_VIDEO=y CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_CONSOLE_SCROLL_LINES=5 +CONFIG_FAT_WRITE=y CONFIG_CMD_DHRYSTONE=y