From patchwork Fri Sep 19 20:14: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: 343 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=1758312939; bh=Mjmd2MckedR54EDfa4gDGgvO6hVk8QrXpjeuoNcWP04=; 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=I2TPIRlct1UAC0M/yXYS2vPnmO7UXHms+gFHAUqhuJQlPa/hB9VkdEgPq0YuQWwnc XqxywfO6NBQ/hLr4FAWWl56p3smdye2fngJ7WN3R5GH6hyjkh6ELtmfPlARSqEJqWU 8394hs1o7PRDnHzX+om7azE4daTl2EaNmnLm/EqTtGDQxD7rQV6xB+b4oFsbpdMT5+ DlwWhC//F03F9MQkpLHZut127+HOx1LOWL2sVGd8v7OEUtEC6ww36qP3LpIobgmsJL pbAHCQpAGH6BLPXkOw8Jz+n4Ks32hh4KZGGOwjxgj4t0745/uKDP/oTHZJEVgLhBFe cZQBUZeet4eVA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EBCA267C5A for ; Fri, 19 Sep 2025 14:15: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 7BdXDGDOU-GN for ; Fri, 19 Sep 2025 14:15:39 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758312939; bh=Mjmd2MckedR54EDfa4gDGgvO6hVk8QrXpjeuoNcWP04=; 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=I2TPIRlct1UAC0M/yXYS2vPnmO7UXHms+gFHAUqhuJQlPa/hB9VkdEgPq0YuQWwnc XqxywfO6NBQ/hLr4FAWWl56p3smdye2fngJ7WN3R5GH6hyjkh6ELtmfPlARSqEJqWU 8394hs1o7PRDnHzX+om7azE4daTl2EaNmnLm/EqTtGDQxD7rQV6xB+b4oFsbpdMT5+ DlwWhC//F03F9MQkpLHZut127+HOx1LOWL2sVGd8v7OEUtEC6ww36qP3LpIobgmsJL pbAHCQpAGH6BLPXkOw8Jz+n4Ks32hh4KZGGOwjxgj4t0745/uKDP/oTHZJEVgLhBFe cZQBUZeet4eVA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DB35D67C0E for ; Fri, 19 Sep 2025 14:15:39 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758312937; bh=M78C+y+X5BDIjcRYxc30DGX77sj2QZ6fI95Qduqnq6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HlooGGgI7nDuzvTkqo6qmYwBkY3mTpIs8s7HxyG6LzivYaep0ywuI/nWrMy9N7fAE z8FiQSD0uCBG4f8odYP/XJx+LNEakxaCsaccrBGtt0hUS949xW61f6UndbKWlqTPd8 mXGcBKy4Dr3tI0FiNN1mchdZRIFx5SPBxzQQ7OaHqTRih2hidLTXUVoIF0pjIKFcsD t84gyHFLQT+hnYeaENLgx3D+uNt4EFj1dOGaxWRsMugEvt32f/NBAZbXzH9/vNfJqM g6qyI/+4Xpi8Z2N93Fv1UrSFs9r5Oe7Wfw59LPm/w/Oex9VmzZcNp1+ObPts/caA1D yKuhc3XVt/vHA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D085F67C0E; Fri, 19 Sep 2025 14:15: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 10026) with ESMTP id TJq6zR-mFd0q; Fri, 19 Sep 2025 14:15:37 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758312933; bh=TB5WEeThHcXTdh28siWaIifEf8+fqGYddM3bu2JyGUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CvECa6EoqBpzcgdR+P1+fqWfmuOKpdd4GqSquwB9pY/SFP/k9k2ufrDTXpMaKzhjA +5GLC0jMV2fAF7UKNCrUhfoWCzZ25KQBb1h6iaPXyQ/qD87DKi2GfhvRS64zzObWzn vyRdyxhMAF2PCWt0bsZWJ0wg8GFpjcO1yRQNSPmJK6OpRLnsM2BepSGo43P/yNYHnH QFSXBPzcFQUS40iTe5c/t1P1rWFNcm/4AzTrUvF5y2h4zohouqWBKrUU78ILaW99gD 0rjDht0fYjPDMyu0/WcfotN/Cv/dxLSMyKNKijcFTh2nL/u3DkN2hWAq0uDduxsuJv C4Hksz8waRjOA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A29E767A99; Fri, 19 Sep 2025 14:15:32 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 19 Sep 2025 14:14:08 -0600 Message-ID: <20250919201507.4024144-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250919201507.4024144-1-sjg@u-boot.org> References: <20250919201507.4024144-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RWJKGLHUHNI4WQUJYQV4M7RWX5V6ZA7S X-Message-ID-Hash: RWJKGLHUHNI4WQUJYQV4M7RWX5V6ZA7S 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/42] Provide a README for Claude 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 the beginnings of a readme to help Claude do the right thing. Signed-off-by: Simon Glass --- .claude/.gitignore | 1 + .claude/README.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + 3 files changed, 71 insertions(+) create mode 100644 .claude/.gitignore create mode 100644 .claude/README.md diff --git a/.claude/.gitignore b/.claude/.gitignore new file mode 100644 index 00000000000..93c0f73fa41 --- /dev/null +++ b/.claude/.gitignore @@ -0,0 +1 @@ +settings.local.json diff --git a/.claude/README.md b/.claude/README.md new file mode 100644 index 00000000000..b84be8d2445 --- /dev/null +++ b/.claude/README.md @@ -0,0 +1,69 @@ +# U-Boot Build Instructions for Claude Code + +This file contains information about building U-Boot for use with Claude Code. + +## Building U-Boot + +### Using crosfw (Recommended) + +To build U-Boot for sandbox testing, use the `crosfw` command: + +```bash +# Build for sandbox +crosfw sandbox -L + +# The -L flag disables LTO (equivalent to NO_LTO=1) +# The build is silent unless there are warnings or errors +# The build is done in /tmp/b/, so /tmp/b/sandbox in this case +``` + +### Using make directly + +If you prefer to use make directly, please use O= to avoid adding build files to +the source tree: + +```bash +# Clean the build (recommended before first build) +make mrproper + +# Configure for sandbox +make sandbox_defconfig O=/tmp/ + +# Build +make -j$(nproc) O=/tmp/ +``` +## Testing + +There are aliases in ~/bin/git-alias which you can use. + +To run a sandbox test: + +```bash +rtv +# For example: rtv dm_test_video_box +# which translates to: /tmp/b/sandbox/u-boot -v -Tf -c "ut dm video_box" +# test output is silenced unless -v is given +``` + +To run using the Python suite: + +```bash +pyt +# alias for: test/py/test.py -B sandbox --build-dir /tmp/b/sandbox -k +``` + +## Notes + +- The `crosfw` tool is the preferred build method for this codebase +- Always run `make mrproper` if you encounter build issues +- The sandbox build creates a test environment for U-Boot that runs on the host system +- When using `git diff`, add `--no-ext-diff` to avoid external diff tools that may not work in this environment + +## Coding Conventions + +- For function parameters that return values (output parameters), add 'p' suffix to indicate pointer + - Example: `uint *sizep` instead of `uint *size` + - Example: `bool *visiblep` instead of `bool *visible` +- This follows U-Boot's established naming convention for output parameters +- Keep commit messages concise - focus on the key change and essential details only +- Code should be formatted to 80 columns and not have trailing spaces diff --git a/.gitignore b/.gitignore index e93c33da1bd..6b95c85b9b8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ # Normal rules (sorted alphabetically) # .* +!.claude !.checkpatch.conf *.a *.asn1.[ch]