From patchwork Fri Sep 5 21:23:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 253 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=1757107424; bh=pdc/K1rLQS6+OFfhZgRTaB1e9bLDHG0tZpNprnYKuys=; 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=e6lNKUM6QzE0zlpjGWr4hvHZPGgt0c9a0YR9EOE+JMLBPf7D+cpr6jEpmxiTym2Xu qEosDQF3mbUu+HsA1SE4tIK9jXOsLw8S5UYYvGQkSC3n6Ycadu7VN/G0MZZBPJa+5e diQvhL9EQOTxFVaqRUZNJpypVA23t2y7FyvoA0gKzNdQMnlG0rHSXD6qAmpfcqOkBz E7rxHFBMVCc6H56Q9IS2J6GUwzRo75As1o9YyrUEATMqw7liy7MY5+Dkw0KVc/O/dP 0XgKn55yKasvdjM9o/cRnz6n6X0KJc6TIS0sbxbSZ3pN7ropC+ioNdsRSbVA8BMtq0 Ds8/5DdPiR75Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 03327679C5 for ; Fri, 5 Sep 2025 15:23: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 eHSMnPHBWNvG for ; Fri, 5 Sep 2025 15:23:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107423; bh=pdc/K1rLQS6+OFfhZgRTaB1e9bLDHG0tZpNprnYKuys=; 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=HO3uEZp/Umko50nWFxOxKgnYa5vtu7Oo3hdrOcuMD5Yxj8bjOzlxtpZqkegDmiHIP bioLVUvDC9+o0OrpueVoP7n4YODNbWr83FNZarOn6Lk8yNcimhXrzufeNHnhW4mNlb iv/qAXOVhu4sZ7EJra4AuzWMgSwM5Jx4ANEPgvM01WLNnSXDM1tncT7DSChspZT4Rn rK7afUuEqcCX98y20H5NQDTsGU5eJdnreXY8BGoVYUvL3JpRdIluzPBBDoX+LhCGJq rV0cYc+1TVXVq6YQipYnsNVle9dkISack76sh+4gZSh8Yj1+Glw/lN/QyrHgDfK8iL 0FiZwi4ehmjLQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E56986799C for ; Fri, 5 Sep 2025 15:23:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107421; bh=QsBuJQCxKfa1prqmKhKoNhi1VYRzDtZ0563PNtWIpAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nmFKhZO0sP7MWaEBKvCUlmK5TBJ2oZjoED5FN6Gn1gsTwlvcpDZiZqMS3Y67fpEy+ mwbSvc+AAIv7QPUGFuRGQ/4kKz+w9JRfyP6bggJoxMIJl8/6mjyradimFKOtJqMThe HYFsaLeBFrjkzzHWK0AjQOKBp3S6icwdyQGjNCYwj+5Z7T5JexWI0b+gV+egsxvsD3 b7k+Qp4jQfLh6SuBPt/czJF4BTYrlp+6w0sNbDSr5eYV7HWWXzeFEvaJxoHBEoG92s CzHsJDuv5GzZhBZHAdILhKyo27c23U4IJNj/BTSpTAETIwQXvlQdK0p5Y4CrQCSBJm RQNorwcIVrE1w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 81D0B679B5; Fri, 5 Sep 2025 15:23: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 eHiz-SEAV35b; Fri, 5 Sep 2025 15:23:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107421; bh=j34PDjVE+jAltcOtuAt50SCKhyiY5UdrTAvuinFyhMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lEHPwNH1uBjpT68Kr9VoP0ib35VGd+BhgVSy9pyN5rmv+kSM/2USGDBIZ7xHawTCo h69RRW49s9uUv1Fd/JMwBfRSKseT59fF2P+fkvT6yIUCfhA1U9CVEtJkozXMevotTN hv7FcIbFjXOELATFpz+ChFSCcP6tPgUs+lb+jkq2RgCjJlXDDfryhIV7hWgSfpQJKx F7vf6zckLPCvArcEh7xuhBGkqW5jVh9qvTqf0hHVV1i/l30893OUDWxlENcTV/g0w5 BQVi6pWvyKZaHlhdF99DLZxDs+R46M6AIGpLPuC7dtNb7yOXCpdyHu6S/gloL8ke6V B9TFZq0qz47kg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0B8D767900; Fri, 5 Sep 2025 15:23:40 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 15:23:14 -0600 Message-ID: <20250905212330.354827-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905212330.354827-1-sjg@u-boot.org> References: <20250905212330.354827-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: P7MFB25SMHSBDWDJMG44KWUKAHHGOG2T X-Message-ID-Hash: P7MFB25SMHSBDWDJMG44KWUKAHHGOG2T 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/10] CI: Tidy up the template for the 'make check' items 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 These tests run as part of the test.py phase, since they will fail if there is a problem there. Fix up the logic at the start to use this phase, supporting the same options as the other tests. Signed-off-by: Simon Glass --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bced2874d2d..59bcd798d6f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -343,7 +343,11 @@ Check packing of Python tools: rules: - if: $LAB_ONLY == "1" when: never - - if: $TEST_SUITES == "1" + - if: $TEST_PY == "1" + when: always + - if: $TEST_PY == $CI_JOB_NAME + when: always + - if: $TEST_PY == $TEST_PY_BD when: always - when: never before_script: From patchwork Fri Sep 5 21:23:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 254 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=1757107426; bh=M8a7iPAag5DVrCaR7IxNT2psUEqakVye99Rf1+Hz0T0=; 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=joWMUuQVL0UyY8DyfuHXi8vBGX4COPITsxL86yJ5uNmt5jcadlcakLkW9kPIVKYCp CYCAn0mTvytGsbd8qkUA3bzgf4cecSAznxwJSFlwKCOJjtA6ZNATKxJH8YfCwqbehK u1cUFQWYw45CW2/Pzm1JJpAZeNgVNlqeGGGd7v8tU2sYAeM/C/3b5SboddJS+NWS2P asCig7bcgrgUSOwz4n7s5tvZI1tu8nJjgKY4CDAyFezANK11EAOO54Mh1EAh5HnHzt uQfkIWQZcUCk2EiJdFFMIZBH6nETTdF9vKzhrGV+N65T4Myaf4J0XKf6ktUWU4MpGa 5kPZ0l+4aMyOg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 64BCA678E7 for ; Fri, 5 Sep 2025 15:23: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 10024) with ESMTP id iKGTuN5vy3cV for ; Fri, 5 Sep 2025 15:23:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107426; bh=M8a7iPAag5DVrCaR7IxNT2psUEqakVye99Rf1+Hz0T0=; 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=joWMUuQVL0UyY8DyfuHXi8vBGX4COPITsxL86yJ5uNmt5jcadlcakLkW9kPIVKYCp CYCAn0mTvytGsbd8qkUA3bzgf4cecSAznxwJSFlwKCOJjtA6ZNATKxJH8YfCwqbehK u1cUFQWYw45CW2/Pzm1JJpAZeNgVNlqeGGGd7v8tU2sYAeM/C/3b5SboddJS+NWS2P asCig7bcgrgUSOwz4n7s5tvZI1tu8nJjgKY4CDAyFezANK11EAOO54Mh1EAh5HnHzt uQfkIWQZcUCk2EiJdFFMIZBH6nETTdF9vKzhrGV+N65T4Myaf4J0XKf6ktUWU4MpGa 5kPZ0l+4aMyOg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 50D7C6799C for ; Fri, 5 Sep 2025 15:23:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107423; bh=xGDuYlueNL/gVdOjB6buktTw/T063HHOcVAxDY2/jHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FjSvP31gTKnKq/wqbtDOcEegnVHe+KO5lZUQyGTzWg5IJ+C9DhsG1t8c4gIFHjW9q NPI+fEDXLMi89x0SH4ZHUgvn3JcN+w6rrPPFywOFy5KJSJHgSEFPzxJI22zdAvHDnV +LHlM+dk5uTkcD4jeHG7mfX3H6sT44G3bmVcwjzqOoceAdl9m6nNl2fPNAfcKVYDc+ rRKXkI0KjoYgtgKsJoSpPIHSL73x7MVMU7mgiZV0JAX2NA+PFFiaUU4OBjs/PP5UMJ TPdx0XHnS8otZednqrhOWG7ALd5SEdCUyu6loNQgvQgnh235V+jMqD5+DzVWKR7a+Q sorVzInkM/VkQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E0437679BF; Fri, 5 Sep 2025 15:23: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 2cqMw00yIMtH; Fri, 5 Sep 2025 15:23:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107422; bh=xOgruEZZvOAveiG2x6nVXZpX09fM1fr4SHYv0KdLuOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CDb3bLTkZfi5KXlmlPySUIw2VgI8irdCvA1l55Vmokf9GKfLgvgrBp7+bGdmVOTDd UT9htwlwUC9qSx+elxI2LNpdh2s7XYGhhe8/gO9m0MX7gj8XjqDP/BpDisouG06Hfv GjAcf0ruXhB+4Khd3X+vnfHNP0K5stEG6p6qq065nky8h688NqcxX9cdbHNn7K8nPQ /cbkj/bBXJtHeCjEyAr5vLOjBGLtFhbYpRV+eJL6Regmv0HH8MfwP0InmjVGrgBrWh GHTqRa+7FnqaOi1iey+px6Wh2XXMmWuhShIPS9owlSE4SMpcmI1hD2/2A76df5DgaY Xp/PZaBvJhXuw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C419D6799C; Fri, 5 Sep 2025 15:23:41 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 15:23:15 -0600 Message-ID: <20250905212330.354827-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905212330.354827-1-sjg@u-boot.org> References: <20250905212330.354827-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4LZGE6GH2EJJPLUWU5SPTBARGHHEXSGR X-Message-ID-Hash: 4LZGE6GH2EJJPLUWU5SPTBARGHHEXSGR 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/10] sandbox: Make use of PLATFORM_LIBS for ulib_test 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 specifying the sandbox-specific arguments in the main Makefile, make use of PLATFORM_LIBS which has (more than) what we need. Signed-off-by: Simon Glass --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e3b95290384..2e2f276eee6 100644 --- a/Makefile +++ b/Makefile @@ -1905,7 +1905,7 @@ quiet_cmd_ulib_test_static = HOSTCC $@ -I$(srctree)/arch/sandbox/include -o $@ $< \ -Wl,-T,$(LIB_STATIC_LDS) \ -Wl,--whole-archive $(obj)/libu-boot.a -Wl,--no-whole-archive \ - -lpthread -ldl -lSDL2 -lrt -Wl,-z,noexecstack + -ldl $(PLATFORM_LIBS) -Wl,-z,noexecstack test/ulib/ulib_test_static: test/ulib/ulib_test.o libu-boot.a \ $(LIB_STATIC_LDS) FORCE From patchwork Fri Sep 5 21:23:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 255 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=1757107428; bh=HMcK9NWo7cwYdTJ56LVE7Favm3xEXAIt/2j2bAhDetc=; 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=vS+JtSrhgGjYfHS+VkUb4InVkKzSlgmpBHnW22V7RRtRz/AZGSLsHJLEJ7MY93UYK ARTYZJIE4/ZBbsysPxJt2AtNRp+vFrk8U+3Zg1WIVfHLwjP6uj1iSgVbsqykA5gfHg FJZAXffu/NB9L/scJfZ2KuhlsWjhDBfuRw26jt69Jo3iDA6gDz3ivbD0rmY+eEFyBZ BxYQatamCfSw3lzcNjEtP3L2f4IOpK5fAcX7970ae7WJka8t5lfUdKPiEZhW60EpQC /VbhQNmrwOAk+5ks4GvP6ymW2U2Li9RtjguIoqLdVOwAY7esoJ4uRJ+UgeurhVA03W eAczyqvRjfSKg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BD3B3679BF for ; Fri, 5 Sep 2025 15:23: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 yG0UubMM6iak for ; Fri, 5 Sep 2025 15:23:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107426; bh=HMcK9NWo7cwYdTJ56LVE7Favm3xEXAIt/2j2bAhDetc=; 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=ZEyN6/n5c83153+a0dWJQnmcCwQDl/ND2+h2S+XO6gNRMAT6LnUKqtqq+5kgFcQKe FLnG4PwF0dmugPGFutRK63v+nbZZOl4/rbvbVOOxxfMxv3ZTvQRNaHSm6OBpBxWB7Y oGHliVmyD0Xj3CWwDsB70ITNInwHu0YgZbj/Iqb+APdbIO3Kptw0J4+X7xLGScYXGE K99AW7ApdmIPzS7sUourORQYnEomIMV6ABtOJOYt3ReqU2ORNjW0eUEdfcrVShEBPq 79sOVxG+qpdvP/h6SVH7BCa+hf+tbE6g3/I9f6WFD9A6uKxnjP52LG5GgUYIOZts20 88+R2vg6FRaOA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BBC39679C1 for ; Fri, 5 Sep 2025 15:23:46 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107423; bh=i5QGFumgRJ9N1O/DDBnTrEATQKQLg0puQc6tmh3fdfs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mPQ9hstd37a5HlgIVw+F6YgskumUjBDUGVIiM8RbwHfzSCR+/DBwPb16mNSElA5G+ YZD/Vj808bh0XRFUMVVoK5NUnv2va+Z0sKfo3MGd6kbYDhHtxSqfJ5pIbafjvnWJkW rtkuFvFgfMsJfvvw6ve1cvW1yXqPSRdg7+E+NDCDfY9PsoP7xTIDXPopzeuJ6fSIzi zCgRyYzgjyYBwd3ONr0j2FIkuqNpJiyqZadgMujBaWU4OCh6mjNGcOvR0quIcRTA75 ApAUEA9CBaGEA34jPa32Cjv8Di4aXx3se3E7Oz96Yy5jT/DjEVQzDIqgHkFo/gAjGW XdbIEaZ4Rp8wQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E1C22679C0; Fri, 5 Sep 2025 15:23: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 1KxMM3Hyapkm; Fri, 5 Sep 2025 15:23:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107422; bh=X0eczDwAY+0AHdOynE6W87t4yTyzUKPM6ECyfe9YO2U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TXYr9HggM+VlThx1/orKoEUKjvps5/ITfzTCwP4Dr/mX2bWsGzX9d/dSUObBcgIWD dcmjUJ7AKH8o3PoKeMNIyYmjpZ9pyMkuHEfkcHtNtpdsYoxsX18NoP2GMbqbYE63v+ E8pLRNKCcbGu8SsT3LPonJEHSRo/w7kkarDLKfvri6x/COqPWqQewO9iCK7PrfZjE0 /a2iCVxEJQ41864LayeloitQX2YNbiznGomYy6c+zJZFQ7AQal5a4Nibu8XGyPFUj6 b8FpvI/NjCOjSBDjp3POkIhrMzgqgsRS+g1RgSOaZhSDaF4fKUnG4reBylFgmbWF+Q nW9GcWqcaWrFg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8E15C678E7; Fri, 5 Sep 2025 15:23:42 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 15:23:16 -0600 Message-ID: <20250905212330.354827-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905212330.354827-1-sjg@u-boot.org> References: <20250905212330.354827-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JIWBC5HE5AQGSSTYM22MQCL2QH2INGVM X-Message-ID-Hash: JIWBC5HE5AQGSSTYM22MQCL2QH2INGVM 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/10] Kconfig: Split the EXAMPLES option into its own 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 We want to build examples for things other than the legacy API. As a first step, create a Kconfig file in examples/ and move CONFIG_EXAMPLES into it. Signed-off-by: Simon Glass --- Kconfig | 2 ++ examples/Kconfig | 11 +++++++++++ legacy_api/Kconfig | 8 -------- 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 examples/Kconfig diff --git a/Kconfig b/Kconfig index bf30179db93..76cfa74dc8b 100644 --- a/Kconfig +++ b/Kconfig @@ -733,6 +733,8 @@ config LDR_CPU source "legacy_api/Kconfig" +source "examples/Kconfig" + endmenu # General setup source "boot/Kconfig" diff --git a/examples/Kconfig b/examples/Kconfig new file mode 100644 index 00000000000..62ae2ffab2c --- /dev/null +++ b/examples/Kconfig @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright 2017 Emmanuel Vadot + +config EXAMPLES + bool "Compile legacy API examples" + depends on !SANDBOX + default y if ARCH_QEMU_ARM + help + U-Boot provides an legacy API for standalone applications. Examples + are provided in directory examples/. diff --git a/legacy_api/Kconfig b/legacy_api/Kconfig index 6dc96455ff0..7e5725a7202 100644 --- a/legacy_api/Kconfig +++ b/legacy_api/Kconfig @@ -15,14 +15,6 @@ config SYS_MMC_MAX_DEVICE int "Maximum number of MMC devices exposed via the legacy API" default 1 -config EXAMPLES - bool "Compile legacy API examples" - depends on !SANDBOX - default y if ARCH_QEMU_ARM - help - U-Boot provides an legacy API for standalone applications. Examples - are provided in directory examples/. - config STANDALONE_LOAD_ADDR depends on EXAMPLES hex "Address in memory to link standalone applications to" From patchwork Fri Sep 5 21:23:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 257 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=1757107435; bh=iOPKIceSjIe/dTHnwgKuwN1DIvkXT67JLY15UftU9rY=; 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=TTfUztfneNxdBCN1Te3cf8P3kLdAMlRvyiBLc6k9NJwZCFllmDDdRihE0Hm86js8d icjqys2/SFqftuPuZJbcQe1g/Dfppwa4GofzV5vQZX6p0tpyWrKQih5apPSKa/Uj+R VxoavVLauX/VAZVlhB6+51/EVkpjsZbDpFo2ZibpqZsjXMMpqb2TrhO6C6XPtT2tc8 spVyCqO+FfiLBzL/F5RGGL/F7cGOhMOm+LfcsLDJw9ohcCHwnqz9yrsGRtp77b/V5z PUnvw8PkmpBhItFQm/KK+yRKdZ/1TmdjWOJw/qoAuSMOdjvYqrXlvP0Lf/hLuhixNq JZzus6zyDf0pQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 84AF4679D4 for ; Fri, 5 Sep 2025 15:23:55 -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 OxgsMNc6vkdW for ; Fri, 5 Sep 2025 15:23:55 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107433; bh=iOPKIceSjIe/dTHnwgKuwN1DIvkXT67JLY15UftU9rY=; 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=g6+4EQhx071zT0fmP0GAMIAyyIAoO81X1xeHxV+s6xPTzJfTx6HIenpXv1poOxeY4 EClLIPBmfQWdaeLL85ZuxAxXE8uToHoOzF6qvrRw/NrXRKqXx+YYx8FVH9LYzxNeSq a1G8FziQduuoiI5ZOsmMZ4QBimxOy8f9HPPqMC6tv53UoH9PHc9I3IYJsjHuljcqav Cijqw6R5fr2HyvuD6TDC+WMg8oBIXOosu5gNY1xW3y1VFJeKpnLBbOZzXDgh5bTBNN 8mFIRXR3p47I2Uo4zQnZTVyEZoZkpR1Tu3NX1Mqn6mu47ZoIC7oeWZUh8MXxR7O0Qx oZ6n4Cu/i7fkg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9C5116794B for ; Fri, 5 Sep 2025 15:23:53 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107431; bh=sveJ47/VWZDovFYf2M41BtZAmiOtBqxCBaok7+Ebneg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XfzNy0W3XWa4+1hjNpenjGrvqpiMsQ84gFscDd/ZYWtr2U6w1I/6VZGd5pXwST/ec N16hsyOof2WUOaZBLLNi3K6RdN128JOIQRrJVuAItWKhObXUP8gayjBhMFc4n3mduR 7TtDDDVhwfrSSP0LOvGrK+z7eTT1NpRl9yuRpJPJQ3S3HxHMAPe1NySPVZB6Gdnkgq 9Hef9Fz5KPvLnW5RbOWEZdBJGg0E5JcK8G2p/v9AM6gzQezQzcldpG4xeqBwSm/JCH A504/6baw7hyiukgU3oexFfF1P6eVHGQUSHZmF9nH5j3/eTQZGF6l6vWwN9BumoSIJ Dse/zeHUG2qEw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 00BB5679C0; Fri, 5 Sep 2025 15:23: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 10026) with ESMTP id 76e71Ol3KW5q; Fri, 5 Sep 2025 15:23:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107423; bh=Dlyasvn2m8/EzPRaTQ18T5epefgXg/Bk6Rsg5N2aPWw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fgg2yGOD7a/RpkqDepTopurMxTS1k3qq42MdmZp1I88fPfQDPvldk3O1oJGXGVI4R C8OOyiemvaWiHCX9EP/Ubi4V4bClAXWBcosDVmddZIwnsQmf7/z2wZsV3m0UGpMxt8 kY6EFnm1/9HSqmtecZ1LDIoBBnIVvOsJ1EMro76mYIyEippjKcyOS1bA0tk6siRJ8q SBbCyeceLOpx9NiZiqAerupMxg9f5pjNbj3xzdxkribdc4Y5jN47u4giZIGUTLDBNU d3Gf51WdyEeAIH6AnHZJ9gqKMUAmT2UEAULBRHII15hDmhqNx9OoyFy9ieAq77vO2r eXbPjkvDhuRqA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 623A96790F; Fri, 5 Sep 2025 15:23:43 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 15:23:17 -0600 Message-ID: <20250905212330.354827-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905212330.354827-1-sjg@u-boot.org> References: <20250905212330.354827-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: L4KCPDHLYTG7T624JZES3RKT7QNIL4KM X-Message-ID-Hash: L4KCPDHLYTG7T624JZES3RKT7QNIL4KM 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/10] Kconfig: Provide an option for the standalone directory 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 using CONFIG_EXAMPLES to control the inclusion of this directory, create a separate option. This will allow examples to be added which don't relate to the legacy API. Signed-off-by: Simon Glass --- examples/Kconfig | 8 ++++++++ examples/Makefile | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/Kconfig b/examples/Kconfig index 62ae2ffab2c..4d5a2a9c8dd 100644 --- a/examples/Kconfig +++ b/examples/Kconfig @@ -9,3 +9,11 @@ config EXAMPLES help U-Boot provides an legacy API for standalone applications. Examples are provided in directory examples/. + +config EXAMPLES_STANDALONE + bool "Compile standalone examples" + depends on EXAMPLES + default y + help + Build the various examples in the standalone/directory for use with + the legacy API. diff --git a/examples/Makefile b/examples/Makefile index bf51f1a5018..50bef4e6157 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -6,6 +6,6 @@ ifdef FTRACE subdir-ccflags-y += -finstrument-functions -DFTRACE endif -subdir-y += standalone +subdir-$(EXAMPLES_STANDALONE) += standalone subdir-$(CONFIG_LEGACY_API) += api endif From patchwork Fri Sep 5 21:23:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 256 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=1757107433; bh=pkQ+8u+2VhudG/Kt8VB2zoNuAHMeX5TpKTuju/QB0VI=; 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=cOYtZF3kwHfaOR2lV0CHdIrjNeG7iCfo3Rc6+DwADQUjJH9QNnpkvFqCn9FgXqIVN gnHG8CQUg4hqlWkYA3u4V9gFDBK2nvpg24yeyNcWDgA9//i6r3wARan3jeUaVsRlst DRSxcXqEfxWh67RPNRN/+f+OnLhnkAUSVAP3QHUypcMPDWq5gMT3shdCon9+0rCTE6 wA6sK0UBSHP4JZobasPEc05e3QGhiFHkNPATXbfqgv7nZNM9IIY3lD/h0zLKGeDG5s O+sWoi4f1BNsWO7btGlOLnHIM5G/XDE66WJ7N6G+QCltddB2e1ObWo83CgyBItVng1 iVfhaA7qASZWA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2FF31679C1 for ; Fri, 5 Sep 2025 15:23:53 -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 S4PfcIsutMtw for ; Fri, 5 Sep 2025 15:23:53 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107433; bh=pkQ+8u+2VhudG/Kt8VB2zoNuAHMeX5TpKTuju/QB0VI=; 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=cOYtZF3kwHfaOR2lV0CHdIrjNeG7iCfo3Rc6+DwADQUjJH9QNnpkvFqCn9FgXqIVN gnHG8CQUg4hqlWkYA3u4V9gFDBK2nvpg24yeyNcWDgA9//i6r3wARan3jeUaVsRlst DRSxcXqEfxWh67RPNRN/+f+OnLhnkAUSVAP3QHUypcMPDWq5gMT3shdCon9+0rCTE6 wA6sK0UBSHP4JZobasPEc05e3QGhiFHkNPATXbfqgv7nZNM9IIY3lD/h0zLKGeDG5s O+sWoi4f1BNsWO7btGlOLnHIM5G/XDE66WJ7N6G+QCltddB2e1ObWo83CgyBItVng1 iVfhaA7qASZWA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 117D86790F for ; Fri, 5 Sep 2025 15:23:53 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107430; bh=OSOeVNW4nfmf4lp5tzElhWnZycec76/4OjNqOh2bxfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zy3f4i+FyxCXxtVKn/OPvgUc+XTcA3We0DUzTi6zBDeFZh48L2Tx8tjfo9+cT3AUY 8MZkZoUCF6KrZua1l6nSrIsgoct0ouQq2mqOoxqZhhiegagfix9Yi+KXYphahS+TBl 1j3RHgtKShHuY10xsmE9Cz/Hdd2GeNx7/jBtnlbKTYtuVYMKfvctAs63tXMRRxqCiK PysdMDbMQRotFzxDZfmy9nU+pDDISKABaDfnqgu7q3QCskIZ8OfITynSbjjLmj5HOh XqVUJKQmdGHRFxhQOIOMTKy123bOpQ19Jkn3RiUBrlAJKyuRN2alGxiNjvJD4p5VIs L4WmWktPT3djQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F38A1679BF; Fri, 5 Sep 2025 15:23: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 6xaDzZfJnaQP; Fri, 5 Sep 2025 15:23:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107428; bh=ItvM+z9kSeV3Ri7NP1LKS7SabqHu/EI9Ob1jVBY86NU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bhEN/BK/vhT2FdxxHf6NN5pejAvQJuaDifKM3wCIbdiHFwP8nKBZB/4+vLnr2Bkif 3hMYE9VUGk9mt1lzPzGygPxUU8hYC+wn8wzsgIGCPuOOMWvgHvj6DESLhSpMX5gU0b xrmQROxZTgNG/DrzZr/y/fQDQrSdAQRp+hjGPxXSr6tg47s8By8TzRIZW+rE4825Qt BDD869HLG5ZSS7Llcq37OqKRMqb2lqxRPpTQZWuMVWtHZ6F/+ivsA9o0OMSV86gSlp Dg/tZ++N9qPgwXnDLsoTlC0kj+21ZYjW5xvvXORRCjMnMLX5G5H/3y1ROda3Wix8+U nQIOsGiuxX8Gw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E30F9678E7; Fri, 5 Sep 2025 15:23:47 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 15:23:18 -0600 Message-ID: <20250905212330.354827-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905212330.354827-1-sjg@u-boot.org> References: <20250905212330.354827-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: GEAWDBVRHDOQWASZPRPVPDZAEKKMO3KT X-Message-ID-Hash: GEAWDBVRHDOQWASZPRPVPDZAEKKMO3KT 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/10] sandbox: Avoid use of ulong in os.h 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 file is useful outside U-Boot, for the ulib examples. Also it is supposed to be a system-facing header. So using U-Boot types is not a good idea. Replace the sole use of 'ulong' with 'unsigned long'. Signed-off-by: Simon Glass --- include/os.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/os.h b/include/os.h index e5c524c57a4..dfd6e3c7692 100644 --- a/include/os.h +++ b/include/os.h @@ -291,7 +291,7 @@ struct os_dirent_node { /** * @size: size of file in bytes */ - ulong size; + unsigned long size; /** * @type: type of entry */ From patchwork Fri Sep 5 21:23:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 258 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=1757107435; bh=jBkLi0OVAbpBMAINSMUs0u9GqOc0Jv0oK0LIl82G6F4=; 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=idyPuZsnvPhpIz5JaMj4/5NRPNOFI8TqCRzSyKsS3lclfW4SWAN0U/QToMKsjxUZe XvwZGArTGyaIQUKB34+0uLar8+YZ87/rT/Rqou19vLTmB9qjV1nLbEghyQTnS5V1S0 Vmfg1y+iIk6lX7VX+jOYEiOyuSUIlXFkMZb6ciEKRmZk8vavwfsfh7hJ+Hgqw8zSEM HtRZN306A4rPaDgKRKNXfmnioSqPVmJ7cOtxb9lNlxmkO34O/ycxp270PFsPtgRFnI nhBMpoSHpU8IFwqtK/DBi1CVtMmriL1Az6BivThw1eP/aSgFlTS5Q6GwLBo8mWf/PN QdnBgpmrYZTlQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A9FE6678E7 for ; Fri, 5 Sep 2025 15:23:55 -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 1hZFGuEQa8Qi for ; Fri, 5 Sep 2025 15:23:55 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107434; bh=jBkLi0OVAbpBMAINSMUs0u9GqOc0Jv0oK0LIl82G6F4=; 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=kQ8xaslrJ8xMkdiqCbqybiy2pGHFbcTp+riJQy6gp0dEaBKreTcfOY0+rttmPOlwc yNQzNWJRuAHFWy3bbLVxXyW8lWK6M9GE1n8TyMBpCl3tX79AtwQe87ZsYHkR5t3kGe ZVmKxGMiCvPcS5uCDEo0iU/ziMNkTaIFTWidtmCKZv4LhHEkC9Pxb7ubg7aZY/On8Y V4xksCqsTTQtVu2eRe7a/8JzI95n4w8WHhavDQM9NpWGl/zlQbDAfO6yuWz4ScJA5x SlbcyaiJ8A4rJbrDQG+65Kmx5/GdxUH9BXar8j927MSPn6xjJudnHJ8QokvT4WB22R HkmzNF1Wfuqpw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A0BE2679C8 for ; Fri, 5 Sep 2025 15:23:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107431; bh=9jIqd+pHRfeu5QTJBJCl1VuP93phrKpf6RuqdavVZGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OfWUqfuIrlVv08c3OeuwzAB17h3knVtlYk4EZ0VW6x6Ib1lTmvq/TdSDfR6Fk1Y6x K/sFOXs4q1GJv3VUkdDl6awY72tjLyD5Xr9H5c0KeCSbOWZIBcu9TxgasT+TGjaEaT yj3RLXl9uDNvSspaYqEYf2avaRTRH8OrknSi9+SHYJFMo/LTvxh6Z11zo6j0x/ketc w3M1xJCYZjapUjutAOAb+aErsAnAf/USu0AWE3n7uXGvveCpL+8BX3WLini3M7s6Cw h3jWCgHZKIQh4wIlQcKcysV8atOCIXJHfOq6Kg3KT+8XvfUkuXRJALnsy27KXCL7VM 2hj0bKPfda2Mg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 121AA678E7; Fri, 5 Sep 2025 15:23: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 10026) with ESMTP id cavdL7TVkM5Z; Fri, 5 Sep 2025 15:23:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107430; bh=UygeL9+2Cnb1m2pSNyRLP75mDxGTYkllNTmv/E2aTGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=alxHMQCY0YYBeMsPeSVB/AdbbznKHgMMtz9glmhZN8WD2nMU5MSGXJi3I+Y8c/4yU VQsnFjWBmHp68GLIp0fuVH90L5XosR5BKLCnN+eJr1PPhehciKfYezzvCe5T43C7Ad pHItfJLfizEdBOJ4B8sWhCUoo25rOmgJCMvbaFcZiW3wKpwwO8ckk8g43q9Cr0Deh5 MdT8azumqg4JxUOPXqT6215I0cr54C8Gfn0JFdfTP70tLI3SAhfVzDFo4dL7er/Mt0 BZ5Oj6hsuKiG9E/3IQTt70F14DR91lSFsrN4bkZ2oyO/t8FoHvR7t08sMnVbdgndJs NnoKnpCoN17Hg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E7AB66799C; Fri, 5 Sep 2025 15:23:49 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 15:23:19 -0600 Message-ID: <20250905212330.354827-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905212330.354827-1-sjg@u-boot.org> References: <20250905212330.354827-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: OSXXBIF6NRC6EM766KNLR4X3ENUUPFOV X-Message-ID-Hash: OSXXBIF6NRC6EM766KNLR4X3ENUUPFOV 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/10] examples: Allow compilation of examples on sandbox 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 'standalone' legacy-API examples don't work with sandbox, but the forthcoming ulib ones will. Adjust the !SANDBOX restriction to apply only to the former. Signed-off-by: Simon Glass --- examples/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Kconfig b/examples/Kconfig index 4d5a2a9c8dd..5738d555d22 100644 --- a/examples/Kconfig +++ b/examples/Kconfig @@ -4,7 +4,6 @@ config EXAMPLES bool "Compile legacy API examples" - depends on !SANDBOX default y if ARCH_QEMU_ARM help U-Boot provides an legacy API for standalone applications. Examples @@ -12,6 +11,7 @@ config EXAMPLES config EXAMPLES_STANDALONE bool "Compile standalone examples" + depends on !SANDBOX depends on EXAMPLES default y help From patchwork Fri Sep 5 21:23:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 259 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=1757107435; bh=byAKGrtojlLrTFobCzclqpbfAQQl6qhRTBU17zf399s=; 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=F8bpI4tV5tBGbRa45lNuW35XhHNgKlZrzIyPqXyksQnvH2y4NkBOPw8sOM8fV1bLk s9BN6D+AjQa4J425JUp/Y9Fh0omRSwk2f9fh0JQ0RTvgtjXtwOFWrXI7KPoTtimMhA QoA4Roaef6J9rsx621N53GiSrfhTS5dNKwURB8flbv9tRRBo7tRgAoEtdnoFtbv4R3 Ano/Af49GP2aoL/xAaZc6D6ZB7HpBLcvA4d5fYPqwLTl2T0xTNxVIM0Dw8MHYxbrrs yBG08k4S/wtWFYlFfrnDrtnSGUdHExmB/YZCisbpbrq2SE1gW5pYLE2U3I9yAy1ClT LUa9VJQranbog== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DDAD4679CE for ; Fri, 5 Sep 2025 15:23:55 -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 qtNoGKE0HjHz for ; Fri, 5 Sep 2025 15:23:55 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107434; bh=byAKGrtojlLrTFobCzclqpbfAQQl6qhRTBU17zf399s=; 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=sJ2FcYu8skCLvf6/6+bdGqAckWv4/0vdFDW8aAKroFUHr0Noj4DEERF4eLlY7U/nD GAk1DD6kwebE0i9EBpbnPtM3qK7IMBICvhzyjjxoe4G2BteVwmfeJtr/BUg2KlflA/ vr7qvZQ1mKZZBhc2SS1Lw1m4DnurJMnuy4Nnx+4PO810Wz0MvAjC5ui+rE7oUIXJx/ PqGpRJqlIDk+ziL89L0SqMRg3HvTiEKIQfjq+c2OKaq7Kugkxv2awkCakK6VWysp15 U5O4+9+uKC6USj6BDKVSY2YmERYAZL1IO4rOfzWNwEpm3qkdacLO/+QxXl58B5VyRF jxyKSWXIrla1A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F2EF1679D0 for ; Fri, 5 Sep 2025 15:23:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107431; bh=T/ydqS1DjPzZ03rA7dooRqXvkzmEq0AAlWFKzAXiwJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wx3T6dfJeX/RY6A+P7O/IwJdro3xxaFJGfRBH92xqLrvgW/oG+JvAh1J2QU/wwbjp n6Qv4FdctfOTzsI5ArZnVrTq860NO871ebxHMgq8lOfD5psmzn2dgnyAXq1bLjrgdV 1n3rtyhwOqlJgwmowUJT67X0XOqJOhoIv285QGa4+7X8Ojw0wB7YU3Ni1bpmg6c8Om xcb+EsHPz4MLAA6gUCl94dBE7c41cRkQUWYgPIAf7qghEWo5LYkl758MNl6m+izZFC wTWSZZz8oIhNitBGKuQ8zXO20sRDGsvpIhShQ50Y964Ym+eMDP9Gjk25qxhba0j1Yx mEjSr3gQyos1A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1A4296790F; Fri, 5 Sep 2025 15:23: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 10026) with ESMTP id Z7T74BCLdZ7j; Fri, 5 Sep 2025 15:23:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107430; bh=YbeRN/bameexkEMmZcDJ7R919Rl8pPHohExa8Q/x8zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aCLsQEP7etxCvLeYTeEDqMcJrwwWHhsSKTlE3x9a9jSfhKMGM9UQcY5GYzsDgXdd6 0cxHsZa5laY2483ROE2D1IvhLPVP9lKHG3KcHfKRm6mYCiG3BDzZXAFacTcaeaFfu6 1gkrgqJXh73/MlhmRhD5THLX2xrXUpADX51EH0uoKZtMVSpRuJS3t3nZzrlkNJmPfA 3pq/kduCzkLg0AKJTNEvRER89otYZkVkcL6VhGY1P1yvSExM1U/wqhWJLgxD8WR4N+ EPDp0xEJUynKmvbXswOfzYlM6153ptz+Rr461p1rA0ayYwNk37Ac2uNtIuQKy7cw43 Q4pPaUV3mw0Qw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9DC08679BE; Fri, 5 Sep 2025 15:23:50 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 15:23:20 -0600 Message-ID: <20250905212330.354827-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905212330.354827-1-sjg@u-boot.org> References: <20250905212330.354827-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TFSJKUF7G2VRXNIGMAP2XXTKH45K5AH7 X-Message-ID-Hash: TFSJKUF7G2VRXNIGMAP2XXTKH45K5AH7 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/10] sandbox: Enable building examples 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 the 'sandbox' board (only) to build examples. This will be used for ulib examples. Signed-off-by: Simon Glass --- configs/sandbox_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 673afdf93ba..d10b029f540 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -11,6 +11,7 @@ CONFIG_PCI=y CONFIG_DEBUG_UART=y CONFIG_SYS_MEMTEST_START=0x00100000 CONFIG_SYS_MEMTEST_END=0x00101000 +CONFIG_EXAMPLES=y CONFIG_EFI_SECURE_BOOT=y CONFIG_EFI_RT_VOLATILE_STORE=y CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y From patchwork Fri Sep 5 21:23:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 260 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=1757107438; bh=NfFvfaLqpS2xHnAxaAUDW61Qoz6npiPhV9f4Zx1jI7A=; 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=g/+M0lSJR8RG0Y8IdkuOowuRDSr2bSDXy0/UO8jf9P07AalkGLb3JZfKwzW+k+AC5 b0OAMAnzOgWFFeq+JGS5Vd6Wp5r4WYcHXZpPTDEte/I1oG+zAD3Tb9QmegTbob3iPg SQ7kDZ4HXqoTcZKZBfFYTjTc2upKFxUPMGxZfFLn/GO5HOD5xg6n6z1tfO8Ya7gmoq 4pYp5Wpla+AaMwvZpDDK/jGWlIXoUAbElVEDqO7TP1LKCYA+t/UnjCX1v03rU8RgiU WGdhdlDa8AoSvt11TODO047K770BFD97WoF8cL3a5613gayJB7/sB42xo/pYzWQvX6 g0y9CmQFib9yQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5AA4C679C1 for ; Fri, 5 Sep 2025 15:23: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 10024) with ESMTP id 50l_Z7PUinNH for ; Fri, 5 Sep 2025 15:23:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107438; bh=NfFvfaLqpS2xHnAxaAUDW61Qoz6npiPhV9f4Zx1jI7A=; 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=g/+M0lSJR8RG0Y8IdkuOowuRDSr2bSDXy0/UO8jf9P07AalkGLb3JZfKwzW+k+AC5 b0OAMAnzOgWFFeq+JGS5Vd6Wp5r4WYcHXZpPTDEte/I1oG+zAD3Tb9QmegTbob3iPg SQ7kDZ4HXqoTcZKZBfFYTjTc2upKFxUPMGxZfFLn/GO5HOD5xg6n6z1tfO8Ya7gmoq 4pYp5Wpla+AaMwvZpDDK/jGWlIXoUAbElVEDqO7TP1LKCYA+t/UnjCX1v03rU8RgiU WGdhdlDa8AoSvt11TODO047K770BFD97WoF8cL3a5613gayJB7/sB42xo/pYzWQvX6 g0y9CmQFib9yQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 46FC1679B5 for ; Fri, 5 Sep 2025 15:23:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107437; bh=VVzFPP+F/z8dXNKYEqk29MHJxsunNz3xxIvOZPmnkjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gnG4QooL6HGPqD20F+1cI83SluI6T9CBiyfUNqi2cWZ44kyUZ2Z3xD8yDX6vyn5Bv bZbnpqVRatEOFXrknaUfmrgfjRtQ0h74cFDlz1dy5pK2Jk/80wJJ2PUW2Xt66GUt3t z0bcENjgOWMxSaitgt29FMIDWXFF6IRBlPg572d324NwSD3f1Ko1x+w8mp3em3M/zv W5aaEH/XL5WpYpcS4GonhAgWVf/UdPzR/IWhL4Odrfv5sj2EHWp+LDGVouPJimg+Vy UZTGq02aTzT/CXE92pQa/E6Rtz/sySio4mDqBu4Ll+qUjTrukUTRGz2Ry9kF+2WIDS XcW23Ff43nyHg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 18A46678E7; Fri, 5 Sep 2025 15:23:57 -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 OYHyeUmBZ9rX; Fri, 5 Sep 2025 15:23:57 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107431; bh=54ct5QMplkUOElzyPFpml8vidTb6ZbDuxrHlfwFSHTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u/qrflDTKioVkOiWsnbkONTrO+JgMColW7bEpiQCkEfSId9WuryuNkniWx1Vabd9t CB3ZKFARNCyq+UNk1nf6a69/BMvg4eos/FenirCGQ56GBrb0hEmdag7MMU6OTVDIsK kU1Qhm7eIwiQoUw4WA/AtZlXbYoYKjWmF+T582ZzqFjY+VNMrU4YIaszV2rT72dSoi vtSgMrVAs7Jqcfo+Yj9orknb5HY4Twa8CdYVi6qUT27PA9kpLLdFz3J5ph9eIVMx2C iAPf4VBuVVy4Evk6zMOVILTBsr+gtidTfmBTe/7mBrJy55sQbnUTWDwPdXAcbogCom SvKUNWWsWr1Zg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 604B86799C; Fri, 5 Sep 2025 15:23:51 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 15:23:21 -0600 Message-ID: <20250905212330.354827-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905212330.354827-1-sjg@u-boot.org> References: <20250905212330.354827-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4HLF2GDCRJNV242FGT3FYN2RJ3ACJO4K X-Message-ID-Hash: 4HLF2GDCRJNV242FGT3FYN2RJ3ACJO4K 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/10] ulib: Provide an example of how to build with ulib 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 an example Makefile which shows how to build against U-Boot from outside the U-Boot source tree. Signed-off-by: Simon Glass --- Makefile | 17 +++++++++ examples/ulib/Makefile | 73 +++++++++++++++++++++++++++++++++++++++ examples/ulib/README | 74 ++++++++++++++++++++++++++++++++++++++++ examples/ulib/demo.c | 61 +++++++++++++++++++++++++++++++++ examples/ulib/static.lds | 19 +++++++++++ 5 files changed, 244 insertions(+) create mode 100644 examples/ulib/Makefile create mode 100644 examples/ulib/README create mode 100644 examples/ulib/demo.c create mode 100644 examples/ulib/static.lds diff --git a/Makefile b/Makefile index 2e2f276eee6..8d082d1ae81 100644 --- a/Makefile +++ b/Makefile @@ -1048,6 +1048,9 @@ ifneq ($(cc-name),clang) ifeq ($(NO_LIBS),) INPUTS-$(CONFIG_ULIB) += libu-boot.so test/ulib/ulib_test INPUTS-$(CONFIG_ULIB) += libu-boot.a test/ulib/ulib_test_static +ifdef CONFIG_EXAMPLES +INPUTS-$(CONFIG_ULIB) += examples_ulib +endif endif endif endif @@ -1911,6 +1914,18 @@ test/ulib/ulib_test_static: test/ulib/ulib_test.o libu-boot.a \ $(LIB_STATIC_LDS) FORCE $(call if_changed,ulib_test_static) +PHONY += examples_ulib +examples_ulib: libu-boot.a libu-boot.so FORCE + $(Q)$(MAKE) -C $(srctree)/examples/ulib \ + UBOOT_BUILD=$(abspath $(obj)) \ + EXAMPLE_DIR=. \ + OUTDIR=$(abspath $(obj)/examples/ulib) \ + srctree="$(srctree)" \ + CC="$(CC)" \ + CFLAGS="$(CFLAGS)" \ + PLATFORM_LIBS="$(PLATFORM_LIBS)" \ + LIB_STATIC_LDS="$(LIB_STATIC_LDS)" + quiet_cmd_sym ?= SYM $@ cmd_sym ?= $(OBJDUMP) -t $< > $@ u-boot.sym: u-boot FORCE @@ -2339,6 +2354,8 @@ $(clean-dirs): clean: $(clean-dirs) $(call cmd,rmdirs) $(call cmd,rmfiles) + @$(MAKE) -C $(srctree)/examples/ulib clean \ + OUTDIR=$(abspath $(obj)/examples/ulib) @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ -o -name '*.ko.*' -o -name '*.su' -o -name '*.pyc' \ diff --git a/examples/ulib/Makefile b/examples/ulib/Makefile new file mode 100644 index 00000000000..da788e5792f --- /dev/null +++ b/examples/ulib/Makefile @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Standalone Makefile for U-Boot library examples +# +# Copyright 2025 Canonical +# Written by Simon Glass + +# This Makefile can be used to build the examples. See doc/develop/ulib.rst +# +# Usage: cd examples/ulib; make UBOOT_BUILD=/tmp/b/sandbox/ srctree=../.. +# +# This Makefile is also called from the main U-Boot Makefile when CONFIG_ULIB +# and CONFIG_EXAMPLES are enabled. It receives these variables, many of which +# are needed to ensure that the output goes to the right place: +# +# UBOOT_BUILD - Build directory (e.g., /tmp/b/sandbox) +# EXAMPLE_DIR - Source tree path for these examples +# OUTDIR - Output directory for object files and executables +# srctree - U-Boot source tree +# +# Also these may be provided: +# CC - C compiler +# CFLAGS - C compiler flags +# SDL_CONFIG - Name of sdl2-config program +# PLATFORM_LIBS - Platform-specific libraries +# LIB_STATIC_LDS - Linker script for static library + +# For standalone builds, provide default values +EXAMPLE_DIR ?= . +OUTDIR ?= . +CC ?= gcc +SDL_CONFIG ?= sdl2-config +PLATFORM_LIBS ?= $(shell $(SDL_CONFIG) --libs) +LIB_STATIC_LDS ?= static.lds +# The main Makefile passes in Q=@ for quiet output +Q ?= + +DEMO_SRC := $(EXAMPLE_DIR)/demo.c +DEMO_BINS := $(OUTDIR)/demo $(OUTDIR)/demo_static + +# Default target builds both programs +all: $(DEMO_BINS) + @echo "Build complete: demo and demo_static in $(OUTDIR)" + +# Create the output directory if it doesn't exist +$(OUTDIR): + @mkdir -p $@ + +# The U-Boot library must be built before we can link against it. This is +# signalled by the presence of the $(UBOOT_BUILD)/examples/ulib directory. +# This is an order-only prerequisite, so it does not trigger a rebuild if the +# timestamp of the directory changes. +$(DEMO_BINS): | $(UBOOT_BUILD)/examples/ulib $(OUTDIR) + +# Build demo (dynamically linked with libu-boot.so) +$(OUTDIR)/demo: $(DEMO_SRC) + $(CC) $(CFLAGS) \ + -idirafter$(srctree)/include -o $@ $< \ + -L$(UBOOT_BUILD) -lu-boot \ + -Wl,-rpath,$(UBOOT_BUILD) + +# Build demo_static (statically linked with libu-boot.a) +$(OUTDIR)/demo_static: $(DEMO_SRC) + $(CC) $(CFLAGS) \ + -idirafter$(srctree)/include -o $@ $< \ + -Wl,-T,$(LIB_STATIC_LDS) \ + -Wl,--whole-archive $(UBOOT_BUILD)/libu-boot.a -Wl,--no-whole-archive \ + -lpthread -ldl $(PLATFORM_LIBS) -Wl,-z,noexecstack + +clean: + $(Q)rm -f $(DEMO_BINS) + +.PHONY: all clean diff --git a/examples/ulib/README b/examples/ulib/README new file mode 100644 index 00000000000..e6f48bf79cd --- /dev/null +++ b/examples/ulib/README @@ -0,0 +1,74 @@ +U-Boot Library Example +====================== + +This directory contains example programs showing how to use the U-Boot library +(libu-boot.so) in external C programs. + +Building U-Boot Library +----------------------- + +First, build U-Boot with library support: + + make O=/tmp/b/sandbox -j$(nproc) sandbox_defconfig all + +This creates: +- /tmp/b/sandbox/libu-boot.so (shared library) +- /tmp/b/sandbox/libu-boot.a (static library) + +Example Programs +---------------- + +The examples are built automatically as part of the U-Boot build. So far there +is only one. + +**demo.c** - Demonstrates using U-Boot library functions + +- Shows how to init the library with ulib_init() +- Uses U-Boot's OS functions (os_open(), os_fgets(), os_close()) +- Reads and displays system information +- Shows the U-Boot version + +Building Examples +----------------- + +The examples are built automatically when U-Boot has these options enabled:: + + CONFIG_ULIB=y + CONFIG_EXAMPLES=y + +To build manually: + + # From this directory examples/ulib + make UBOOT_BUILD=/tmp/b/sandbox/ srctree=../.. + +Running Examples +---------------- + + # Run the demo + LD_LIBRARY_PATH=/tmp/b/sandbox ./demo + + # Run the demo (static version) + ./demo_static + +Key Points +---------- + +- Avoid including U-Boot headers that conflict with system headers. This + Makefile gives priority to the system headers +- Use ulib_init() to init the library +- Use ulib_uninit() to clean up +- Set LD_LIBRARY_PATH when running dynamically linked programs + +Copying for External Use +------------------------- + +This directory can be copied elsewhere and used independently: + + cp -r examples/ulib ~/my-project/ + cd ~/my-project/ulib + make UBOOT_BUILD=/path/to/u-boot-build srctree=/path/to/u-boot-source + +License +------- + +All examples are licensed under GPL-2.0+ diff --git a/examples/ulib/demo.c b/examples/ulib/demo.c new file mode 100644 index 00000000000..4b12e91b17e --- /dev/null +++ b/examples/ulib/demo.c @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Demo program showing U-Boot library functionality + * + * This demonstrates using U-Boot library functions in sandbox like os_* + * from external programs. + * + * Copyright 2025 Canonical + * Written by Simon Glass + */ + +#include +#include +#include +#include + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int fd, lines = 0; + char line[256]; + + /* Init U-Boot library */ + if (ulib_init(argv[0]) < 0) { + fprintf(stderr, "Failed to initialize U-Boot library\n"); + return 1; + } + + printf("1U-Boot Library Demo\n"); + printf("================================\n"); + printf("U-Boot version: %s\n", version_string); + printf("\n"); + + /* Use U-Boot's os_open to open a file */ + fd = os_open("/proc/version", 0); + if (fd < 0) { + fprintf(stderr, "Failed to open /proc/version\n"); + ulib_uninit(); + return 1; + } + + printf("System version:\n"); + + /* Use U-Boot's os_fgets to read lines */ + while (os_fgets(line, sizeof(line), fd)) { + printf(" %s", line); + lines++; + } + + os_close(fd); + + printf("\nRead %d line(s) using U-Boot library functions.\n", lines); + + /* Clean up */ + ulib_uninit(); + + return 0; +} diff --git a/examples/ulib/static.lds b/examples/ulib/static.lds new file mode 100644 index 00000000000..c400fba4f2b --- /dev/null +++ b/examples/ulib/static.lds @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Linker script for ulib_test_static binary + * + * This ensures proper alignment for linker-lists when linking with libu-boot.a + */ + +SECTIONS +{ + /* Ensure proper alignment for linker lists */ + . = ALIGN(32); + __u_boot_list : { + __u_boot_list_start = .; + KEEP(*(SORT(__u_boot_list*))); + __u_boot_list_end = .; + } +} + +INSERT AFTER .rodata; From patchwork Fri Sep 5 21:23:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 261 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=1757107441; bh=Aoh/JERtS6orrh9n9+ptEXwtKGQcu79NL1LaPWyugaY=; 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=F/4aVoOj+SNspHfbOe1ZpKfzZmfYJ3FOhzH8CI38etmDAqx827Csdeh7QXjaKuLux bYfHfwF8DhBZIsxfSffWtjuSuucpFVZ5762KAZa0r84EYW4Gs7aA4LA6ROgDPfQ5qF DdMXoeMKP22g3ODcPl673C+/QB8LtKJH+i+VmnDKFALIhRpOPRnFq/ufbFqBrPYcGT L6C/dx8iA9RUoBAADviEDr6FG5Cr7kgen0trNQxUxDHWLKjl39CfrZM/z8J8E2CxoV sRFqlST5muKSowEQRxHmtxI4UB68kb1dQajxZ7KyTuoM46MfoWvj9I0nVSj+oNbLtX HHJTaUpynY5Dw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B57BA679BF for ; Fri, 5 Sep 2025 15:24:01 -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 FuNRTpDhsvif for ; Fri, 5 Sep 2025 15:24:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107441; bh=Aoh/JERtS6orrh9n9+ptEXwtKGQcu79NL1LaPWyugaY=; 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=F/4aVoOj+SNspHfbOe1ZpKfzZmfYJ3FOhzH8CI38etmDAqx827Csdeh7QXjaKuLux bYfHfwF8DhBZIsxfSffWtjuSuucpFVZ5762KAZa0r84EYW4Gs7aA4LA6ROgDPfQ5qF DdMXoeMKP22g3ODcPl673C+/QB8LtKJH+i+VmnDKFALIhRpOPRnFq/ufbFqBrPYcGT L6C/dx8iA9RUoBAADviEDr6FG5Cr7kgen0trNQxUxDHWLKjl39CfrZM/z8J8E2CxoV sRFqlST5muKSowEQRxHmtxI4UB68kb1dQajxZ7KyTuoM46MfoWvj9I0nVSj+oNbLtX HHJTaUpynY5Dw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A18D06794E for ; Fri, 5 Sep 2025 15:24:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107440; bh=hoOxa0AMnMXIfwYg5aaxVjBWLX46vi/3IhYaEkqWSiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fF48HtMckTZf8/WbEUDpKmIW0qeB2r7nn4jecdf9LcYVHdZVoigamLXPBFsfQ6pYF muzAE6JcNQFm7yqfNTHRM6yvzo8Efv1bzSAL9f2QGi+QgR5KQwNem3GT2B7cEaImBM +OfaOnT8TNMdkUtBW2iIwBIDXkLB9pgOIYhiwVqVQQLYZPZjhA/7tZVgSFQZIxkSDy sqlgNqjt+B9o26uGDsziESnbvFWRh3ssIEmRQhNQkRBLNeOCYoheLOk+TdIAcy4PMC znSuYe3rmjyNAXAI4W7ZbSDsK2rCSJtS71SfI0wOMdZ3uqMKrsnYmO1Us7ZdobGwq1 tziRwbQn8EWWg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 98B1F679B5; Fri, 5 Sep 2025 15:24: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 10026) with ESMTP id Ub-lQEHlwYif; Fri, 5 Sep 2025 15:24:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107435; bh=cWUYiBLJNz28nhtYVCY+SGzVsLioFs1P8ebGXxb5z+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S4jqN5FIishHmXRbLlkfrupZnNgZCHy7j/5cgqe0u6qGxqwPDczGz+P56SYwtNgle 7YnXSGs1gmaKNqezbDTBG4Ydg85795iB7MI6A8KNOIV+YPlqkTiqZaqwZUCpKVCJjt Kq3uFmOXdrS96Z3gWSadRGC6oRUftLSWXIfnCTVisvVoS+AenKK0v2Px7Bcx4gLRnx 0azpR5wrL/kY1VedOsUQJpTdg1mxNWmN4rWDGJl/ETf/clAWmJvUu210HA6ztsOlao XXhWfzInxo+VfLuww7bSRu8gZMYZaNqGJFqUS79r3RASwLYIcp9ZWTpHr3s92YNh0Z 0dPTSnqEDY4xw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AA6086794E; Fri, 5 Sep 2025 15:23:55 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 15:23:22 -0600 Message-ID: <20250905212330.354827-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905212330.354827-1-sjg@u-boot.org> References: <20250905212330.354827-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5A44HNG4C3SZFKWSEW5AL4ZMPHNHBJGA X-Message-ID-Hash: 5A44HNG4C3SZFKWSEW5AL4ZMPHNHBJGA 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/10] CI: ulib: Test building examples separately 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 Check that it is possible to build the ulib examples separately from the U-Boot build. Signed-off-by: Simon Glass --- .gitlab-ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 59bcd798d6f..e4e86801fdc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -337,6 +337,26 @@ Check packing of Python tools: script: - make pip +Examples: + extends: .test_suites + script: + - git config --global user.name "GitLab CI Runner"; + git config --global user.email trini@konsulko.com; + git config --global --add safe.directory "${CI_PROJECT_DIR}"; + export USER=gitlab; + export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox; + set +e; + ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w + --board sandbox; + set -e; + - echo "Building examples"; + cd examples/ulib; + make UBOOT_BUILD=${UBOOT_TRAVIS_BUILD_DIR} srctree=../.. + - echo "Running static"; + ./demo_static + - echo "Running dynamic"; + LD_LIBRARY_PATH=${UBOOT_TRAVIS_BUILD_DIR} ./demo + # Template for running the 'make check' tools .python_check_template: stage: test.py From patchwork Fri Sep 5 21:23:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 262 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=1757107443; bh=+TaMzstqf+bXtrsHt1uVBtfyMcrgiMsoU/QstNHII3o=; 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=s8E0/xi5jfy2XQiJJ9Fdm3VBn2dw5qUlZdpNihWk3MA+IWXTaa073iU38+9cc6k+9 dsiogUqYHgkmzqL19G+19WzY4hopelpjTEj1+E6Cn4Eh3fE4mTFyNbhAUB1THiiuny qjpCeuAdG/5ZqTggCjcdYs0/a/YWAHTkcyp0h19st8TAD1B2D4X/Uzs0pqQ+0Phj7S 4B74ZupneVIDYuVlzjbk/FgLy6kBJRAzLI9z4m1bA0PVra0ZuH7qTH7OZhMp/cgQT6 Thw8Xn/0l/Qtj9oF4grI59Y2L0rkVB/igC+xTtxcQzPglNQPEi/OARBgxq6mT8+irR JFgrq/fH3mRyA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1A904679C0 for ; Fri, 5 Sep 2025 15:24: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 befoNcESuJMT for ; Fri, 5 Sep 2025 15:24:03 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107443; bh=+TaMzstqf+bXtrsHt1uVBtfyMcrgiMsoU/QstNHII3o=; 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=s8E0/xi5jfy2XQiJJ9Fdm3VBn2dw5qUlZdpNihWk3MA+IWXTaa073iU38+9cc6k+9 dsiogUqYHgkmzqL19G+19WzY4hopelpjTEj1+E6Cn4Eh3fE4mTFyNbhAUB1THiiuny qjpCeuAdG/5ZqTggCjcdYs0/a/YWAHTkcyp0h19st8TAD1B2D4X/Uzs0pqQ+0Phj7S 4B74ZupneVIDYuVlzjbk/FgLy6kBJRAzLI9z4m1bA0PVra0ZuH7qTH7OZhMp/cgQT6 Thw8Xn/0l/Qtj9oF4grI59Y2L0rkVB/igC+xTtxcQzPglNQPEi/OARBgxq6mT8+irR JFgrq/fH3mRyA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 00193679BF for ; Fri, 5 Sep 2025 15:24:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107440; bh=q0GX3TELbifRBFCxPvLd5mQ9R4nn9mAMUqAg7PXc3kM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q6zJyt0xP5xa5hj6I5pySfzJErg/rMZz3vmVgml6rzx94czQ2/mdWd8aGZMusK1SG AmTg6GYa1Nfz0AxhKKmYf4C4qJb1UGiL7Gn60Xc+F9lhLxesQzmEhptanxvLwHlDHk pvuIK749w8plkgnM69ZSNwVtna/u13STmz2wAM3u//lytxU+7bZQMz6tlFs+wCr4g/ 6nCWF2vpLBuNL6o5AqyDRh7iYqH72rEeHtb0UF2kqJQbX4s4K0yGrSTnPtyXayRaT/ JWTrGLfvOktILBdZKOwtUH7qqfwthHQZ+7lSydmiY0pDKJcsaP4mz1fnHn0iW++HgQ 3jP6XlRduN4TQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A05A16794E; Fri, 5 Sep 2025 15:24: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 10026) with ESMTP id ocf2nL2Cw-DJ; Fri, 5 Sep 2025 15:24:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757107439; bh=5kDKd+Ft/RhzCHajHJNRt5mX48Ak+96VUdEL1c5oz7M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KuidsMx5TKq+GwsIn3Y0Vupi3nvL0I5cvU/dZpGkB3gH76feIsmkTxFGfcaLlh18f M13NvAB1CfOKKYEoE/BVLUOZApsCJziWSBQZxIlYCMnejdLWL2nmwGzZJzr6FVoUtO KqqWhF4Iy693KPK/lmNZ0L6/usckot7aR21oaucbjuh0LX03vYzXyf6RqEOm1Vako/ QBtF7UVmeCx4JICz1IAi9FmFxTduA5vP23NIx3O6Nyxq3WFWqkSEn9tdYaySbuoIZU 3Dg5ZLW2KPZBPhZh6dnQI/U32s1tWvvT3moMmhuWQAMK0sSwisB8mHFHZgEJctoQpA K8yQXgxTsqG4Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A96F6678E7; Fri, 5 Sep 2025 15:23:59 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 15:23:23 -0600 Message-ID: <20250905212330.354827-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905212330.354827-1-sjg@u-boot.org> References: <20250905212330.354827-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BFXJO2E2UWH3KXT6PTFXWM47DBQXFWG6 X-Message-ID-Hash: BFXJO2E2UWH3KXT6PTFXWM47DBQXFWG6 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/10] doc: ulib: Provide some documentation on the ulib examples 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 Update the documentation to point to the examples. Signed-off-by: Simon Glass --- doc/develop/ulib.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/develop/ulib.rst b/doc/develop/ulib.rst index 559f170ce42..8df3a6f99bc 100644 --- a/doc/develop/ulib.rst +++ b/doc/develop/ulib.rst @@ -88,6 +88,9 @@ u-boot-lib.h you will have problems, as described in the following sections. This will be addressed with future work. +With that caveat, see example/ulib/README for instructions on how to use the +provided example. + Including U-Boot header files from outside ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~