From patchwork Fri Sep 5 13:18: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: 233 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=1757078312; bh=6hqH55/5YGDgpkbUAtY458gpOG4Vwj2TeoVmOkFMROM=; 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=AZarFp9MwjjBPIfXM1yypX5TjUqf0BJzKcwIt06ddo05VlNHZJwKxsPVfrhJ2Va7G aPm5k/L1h0AWaXgTKQEewOx7gmpk76UhH9zbTyF07HHpMj/xNYhW6V3CsVLryQWvB1 +S9gGLZbIhSk8trWohlDGYZqUmO1iBzHiQjMQkB4NpGKiIIk7XLNG8ZQ4cVrIYNogI tnslxkp6IsRc89zlPHNkxCgBmJ4YueGJSfrG+lCYsTtfZUTUt3k0lcqUm2ljBycRnh 18s8MmEPRMghHWkkUtk6d80cEZmaXdUdYpQOrGIMtakP+TqdEUkZWbmY5X1REfrFkd 5YfriPCU1p8ng== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7BA246799B for ; Fri, 5 Sep 2025 07:18:32 -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 U5H4XT_FbeBy for ; Fri, 5 Sep 2025 07:18:32 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078311; bh=6hqH55/5YGDgpkbUAtY458gpOG4Vwj2TeoVmOkFMROM=; 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=VSUdRp6zOF5o8x22b3n0G8QlUs2RGjLvw1h2rWs/i/N4vuwY1NF8uw8bdde0MazVb K25B7jW+dg/U/z5CGp9gmyX2drMFfmi2kg7vVSMF3hwyft5QCvLkGzrNPke7Sv3xbS CX73E/PvatQR47mfz3R/bW77hGkYK4SB+ZD1U6ybvQ4TFWIYtyceNgg0KL+bQcqh/p x1zVlJ6eWikI7qpl8EdO72x0up0rswYeDbT1siUGd6eDg98ee+EIu0nrI9XeUyDYAE iRb2N5i/YmIqUmZQ40AnNVhxjvixbf2KAsygze/76DIUzSnMKSqCIU40w6zqPVb0iI /IBKk0ijd+Kww== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 299226799F for ; Fri, 5 Sep 2025 07:18:31 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078310; bh=u9cM4A6odEO1xmuHN4BGDqZLE/ZNtRU4URg0eMJRjbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PJBqOlRayLSQbza5W37uY5KiwuMWCU6I8PpAvFVXMOpM0fxnSXXSOxzgdQKSqH7NF BgErNPSUmKwvF1uCYlc80lm3imvy3952jTsCYsHZyTFxB0U8eHXoU9OLHqHXfMC6y7 4M8PcKMMWjm4r5pT0alNJ5dItNF0BhyENBYvIwPycZiOyVvvpk50klSFBOncZf2DCg V/L0hdShFkx/w4qGn1JyXmrwpZNJkyxmCLOzHdrII9c+YxZ6/JMC5sH9hW1VwvAbgm J+Os9JiaphGsfdpRSY9Lj1uhDJpRIwmuCpZajQDMJ+ZsAz5ZOZ7IVVWh5BoYlhGZBa lIH1LWh8aAwkQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 063CD5FE1B; Fri, 5 Sep 2025 07:18:30 -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 RKLC1syAOnGt; Fri, 5 Sep 2025 07:18:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078309; bh=nDNhmXyuanMLWCkiceelnJC2E8hwMJszn4UIYGUJS9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ShHKVWYXMEfZBql4F7EAyJYvS+w9O+VUmoJgZSZgAjl4ZOfYD5Wvx6k8XJyR5C09+ xqoX47npkrrHSjB9HQ7psspgKvspCPRRFM7RCdKkmLFDIbC9RHfKFhEhIlbGCC4rlJ X+a0WRUkTAUdNYAiFuPOCasWYBU3IdqeAWwRSMXes6E3vrPp2CYkAiq4srH1uBbvYt k3IuuVLssyhv+9sCPsT10jlEPRxWu48IyZYKSMm0exWzOLsDUZSHZwfQyzXgtZYq24 Kvbi3jTmUNVM+kSoOFgacMlOuuBZ7Kocd0TkGWU3avLIbSsA7P2mHGSSuIsxba4VFv ekwQH7fXXyFLw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1BE8A678AA; Fri, 5 Sep 2025 07:18:29 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 07:18:08 -0600 Message-ID: <20250905131816.3344908-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905131816.3344908-1-sjg@u-boot.org> References: <20250905131816.3344908-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: D5SICQAGFGVR4A3GK35R5GZZR27ZVAV5 X-Message-ID-Hash: D5SICQAGFGVR4A3GK35R5GZZR27ZVAV5 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 1/5] api: Rename legacy API files and 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 The API is not very useful these days, since it doesn't support driver model. It is laborious to add new functions to the API as there are so many needed. A better approach would be to create a library containing all of U-Boot, then have the API be generated by a script containing a list of functions, perhaps with wildcards. Then a stub could be created, with a list of entry points, which links with and calls through into the library. In preparation for heading in this direction, rename some of the existing files and directories: - examples/api -> examples/legacy_api - include/api*.h -> include/legacy_api*.h - API_BUILD to LEGACY_API_BUILD Co-developed-by: Claude Signed-off-by: Simon Glass --- api/api.c | 2 +- api/api_display.c | 2 +- api/api_net.c | 2 +- api/api_platform-arm.c | 2 +- api/api_platform-mips.c | 2 +- api/api_platform-powerpc.c | 2 +- api/api_storage.c | 2 +- common/board_r.c | 2 +- examples/{api => legacy_api}/.gitignore | 0 examples/{api => legacy_api}/Makefile | 8 ++++---- examples/{api => legacy_api}/crt0.S | 0 examples/{api => legacy_api}/demo.c | 2 +- examples/{api => legacy_api}/glue.c | 2 +- examples/{api => legacy_api}/glue.h | 0 examples/{api => legacy_api}/libgenwrap.c | 2 +- include/{api.h => legacy_api.h} | 4 ++-- include/{api_public.h => legacy_api_public.h} | 6 +++--- lib/Makefile | 2 +- lib/vsprintf.c | 6 +++--- test/common/print.c | 2 +- test/lib/unicode.c | 2 +- 21 files changed, 26 insertions(+), 26 deletions(-) rename examples/{api => legacy_api}/.gitignore (100%) rename examples/{api => legacy_api}/Makefile (87%) rename examples/{api => legacy_api}/crt0.S (100%) rename examples/{api => legacy_api}/demo.c (99%) rename examples/{api => legacy_api}/glue.c (99%) rename examples/{api => legacy_api}/glue.h (100%) rename examples/{api => legacy_api}/libgenwrap.c (96%) rename include/{api.h => legacy_api.h} (89%) rename include/{api_public.h => legacy_api_public.h} (96%) diff --git a/api/api.c b/api/api.c index b892c5c278a..458eaf0c5a4 100644 --- a/api/api.c +++ b/api/api.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include "api_private.h" diff --git a/api/api_display.c b/api/api_display.c index 8fd078c8c4a..83ff89d3680 100644 --- a/api/api_display.c +++ b/api/api_display.c @@ -3,7 +3,7 @@ * Copyright (c) 2011 The Chromium OS Authors. */ -#include +#include #include #include diff --git a/api/api_net.c b/api/api_net.c index 264ff530563..0bedcce4df5 100644 --- a/api/api_net.c +++ b/api/api_net.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #define DEBUG #undef DEBUG diff --git a/api/api_platform-arm.c b/api/api_platform-arm.c index 9afba66c244..3d2a3e0bd45 100644 --- a/api/api_platform-arm.c +++ b/api/api_platform-arm.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include diff --git a/api/api_platform-mips.c b/api/api_platform-mips.c index 262b35a2777..b5632320290 100644 --- a/api/api_platform-mips.c +++ b/api/api_platform-mips.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include diff --git a/api/api_platform-powerpc.c b/api/api_platform-powerpc.c index 2c1ab043af6..6b76afd955f 100644 --- a/api/api_platform-powerpc.c +++ b/api/api_platform-powerpc.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include diff --git a/api/api_storage.c b/api/api_storage.c index c663e7df942..23f043fbb5d 100644 --- a/api/api_storage.c +++ b/api/api_storage.c @@ -6,7 +6,7 @@ */ #include -#include +#include #include #include #include diff --git a/common/board_r.c b/common/board_r.c index ca1498de11e..a141312f918 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -10,7 +10,7 @@ */ #include -#include +#include #include #include #include diff --git a/examples/api/.gitignore b/examples/legacy_api/.gitignore similarity index 100% rename from examples/api/.gitignore rename to examples/legacy_api/.gitignore diff --git a/examples/api/Makefile b/examples/legacy_api/Makefile similarity index 87% rename from examples/api/Makefile rename to examples/legacy_api/Makefile index ec1643e4875..07a31e219b6 100644 --- a/examples/api/Makefile +++ b/examples/legacy_api/Makefile @@ -2,8 +2,8 @@ # # (C) Copyright 2007 Semihalf -# Provide symbol API_BUILD to signal that the API example is being built. -KBUILD_CPPFLAGS += -DAPI_BUILD +# Provide symbol LEGACY_API_BUILD to signal that the legacy API example is being built. +KBUILD_CPPFLAGS += -DLEGACY_API_BUILD ifeq ($(ARCH),powerpc) LOAD_ADDR = 0x40000 @@ -26,13 +26,13 @@ endif # Resulting ELF and binary exectuables will be named demo and demo.bin extra-y = demo -# Source files located in the examples/api directory +# Source files located in the examples/legacy_api directory OBJ-y += crt0.o OBJ-y += demo.o OBJ-y += glue.o OBJ-y += libgenwrap.o -# Source files which exist outside the examples/api directory +# Source files which exist outside the examples/legacy_api directory EXT_COBJ-y += lib/crc32.o EXT_COBJ-y += lib/ctype.o EXT_COBJ-y += lib/div64.o diff --git a/examples/api/crt0.S b/examples/legacy_api/crt0.S similarity index 100% rename from examples/api/crt0.S rename to examples/legacy_api/crt0.S diff --git a/examples/api/demo.c b/examples/legacy_api/demo.c similarity index 99% rename from examples/api/demo.c rename to examples/legacy_api/demo.c index 9a55f76c504..ea1a8746812 100644 --- a/examples/api/demo.c +++ b/examples/legacy_api/demo.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "glue.h" diff --git a/examples/api/glue.c b/examples/legacy_api/glue.c similarity index 99% rename from examples/api/glue.c rename to examples/legacy_api/glue.c index 478f7b6cfb4..4f7012ea730 100644 --- a/examples/api/glue.c +++ b/examples/legacy_api/glue.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "glue.h" diff --git a/examples/api/glue.h b/examples/legacy_api/glue.h similarity index 100% rename from examples/api/glue.h rename to examples/legacy_api/glue.h diff --git a/examples/api/libgenwrap.c b/examples/legacy_api/libgenwrap.c similarity index 96% rename from examples/api/libgenwrap.c rename to examples/legacy_api/libgenwrap.c index bfd88e100d6..9ada33fb15b 100644 --- a/examples/api/libgenwrap.c +++ b/examples/legacy_api/libgenwrap.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include "glue.h" diff --git a/include/api.h b/include/legacy_api.h similarity index 89% rename from include/api.h rename to include/legacy_api.h index 83412a7c87f..85bd80b2e33 100644 --- a/include/api.h +++ b/include/legacy_api.h @@ -4,8 +4,8 @@ * Written by Simon Glass */ -#ifndef __API_H -#define __API_H +#ifndef __LEGACY_API_H +#define __LEGACY_API_H /** * api_init() - Initialize API for external applications diff --git a/include/api_public.h b/include/legacy_api_public.h similarity index 96% rename from include/api_public.h rename to include/legacy_api_public.h index e89572c00a4..d8bb5807460 100644 --- a/include/api_public.h +++ b/include/legacy_api_public.h @@ -5,8 +5,8 @@ * Written by: Rafal Jaworowski */ -#ifndef _API_PUBLIC_H_ -#define _API_PUBLIC_H_ +#ifndef _LEGACY_API_PUBLIC_H_ +#define _LEGACY_API_PUBLIC_H_ #include @@ -139,4 +139,4 @@ struct display_info { int screen_cols; }; -#endif /* _API_PUBLIC_H_ */ +#endif /* _LEGACY_API_PUBLIC_H_ */ diff --git a/lib/Makefile b/lib/Makefile index af191913873..1db1e3c9000 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -23,7 +23,7 @@ obj-$(CONFIG_AES) += aes.o obj-$(CONFIG_AES) += aes/ obj-$(CONFIG_$(PHASE_)BINMAN_FDT) += binman.o -ifndef API_BUILD +ifndef LEGACY_API_BUILD ifneq ($(CONFIG_CHARSET),) obj-y += charset.o endif diff --git a/lib/vsprintf.c b/lib/vsprintf.c index c7340a047b2..c072b44140b 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -308,7 +308,7 @@ static __maybe_unused char *string16(char *buf, char *end, u16 *s, return buf; } -#if CONFIG_IS_ENABLED(EFI_DEVICE_PATH_TO_TEXT) && !defined(API_BUILD) +#if CONFIG_IS_ENABLED(EFI_DEVICE_PATH_TO_TEXT) && !defined(LEGACY_API_BUILD) static char *device_path_string(char *buf, char *end, void *dp, int field_width, int precision, int flags) { @@ -469,7 +469,7 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr, switch (*fmt) { /* Device paths only exist in the EFI context. */ -#if CONFIG_IS_ENABLED(EFI_DEVICE_PATH_TO_TEXT) && !defined(API_BUILD) +#if CONFIG_IS_ENABLED(EFI_DEVICE_PATH_TO_TEXT) && !defined(LEGACY_API_BUILD) case 'D': return device_path_string(buf, end, ptr, field_width, precision, flags); @@ -630,7 +630,7 @@ repeat: case 's': /* U-Boot uses UTF-16 strings in the EFI context only. */ #if (CONFIG_IS_ENABLED(EFI_LOADER) || IS_ENABLED(CONFIG_EFI_APP)) && \ - !defined(API_BUILD) + !defined(LEGACY_API_BUILD) if (qualifier == 'l') { str = string16(str, end, va_arg(args, u16 *), field_width, precision, flags); diff --git a/test/common/print.c b/test/common/print.c index c48efc2783f..3fe24dc3e9d 100644 --- a/test/common/print.c +++ b/test/common/print.c @@ -59,7 +59,7 @@ static int print_guid(struct unit_test_state *uts) COMMON_TEST(print_guid, 0); #endif -#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(API_BUILD) +#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(LEGACY_API_BUILD) /* Test efi_loader specific printing */ static int print_efi_ut(struct unit_test_state *uts) { diff --git a/test/lib/unicode.c b/test/lib/unicode.c index 673470c8d2c..5bd3629b153 100644 --- a/test/lib/unicode.c +++ b/test/lib/unicode.c @@ -100,7 +100,7 @@ static int unicode_test_u16_strcpy(struct unit_test_state *uts) LIB_TEST(unicode_test_u16_strcpy, 0); /* U-Boot uses UTF-16 strings in the EFI context only. */ -#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(API_BUILD) +#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(LEGACY_API_BUILD) static int unicode_test_string16(struct unit_test_state *uts) { char buf[20]; From patchwork Fri Sep 5 13:18:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 234 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=1757078317; bh=3KxckCdqQy997QV2z+BVCEyXY3Jd3TDcfnaNvZ3lIoU=; 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=XDbKJzGxsb9yBl0rbrZ5tyqWiX+tdQv6GQ46ehRsJuQHhxU/T3QL+uH/aAokR5tGN ubcxh22jYeNEZw0P4HTCvyDSEEwB7vfXYPrSHFcRpgpDUFw+ce2g50fAvP6Ux6YVaT DWiJsMUOYcfFxKvRdR6TTQupUX7dbXrQscwHBD2qmHmZjBZyUYjejmWAAUNTj0BpDS OA8D+IVW+uf3v8GrYNqTPwMdI9R/qi5qj0U94iZNv9JI5+8eYYhz2aRVGj3y5kBwBY pDJT9qlQYvxV1DuhR2Cjt9yzv3itCNbYpRLU+1sr5xBFa1+wHqrauEgHw0cetyIHjN cRtBavGT1Sw1A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0DF2E5FE1B for ; Fri, 5 Sep 2025 07:18: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 c-vOzpt4XV-8 for ; Fri, 5 Sep 2025 07:18:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078316; bh=3KxckCdqQy997QV2z+BVCEyXY3Jd3TDcfnaNvZ3lIoU=; 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=MH6U1UglwySw6BsD3TIaUsEFPrvqjMm0d9ZsoxjMt9cvW385PEWrNJyiDqxoCnoLV xuIfQAo6gDc3A9+Y4OmqexxjPAleqQHuNWmR3YtAFENKpGRXPWpjPNGrsAY3atabC7 6gDOhHDOz8f6hAQ3j/UyJzMiMWo4cpdyCQnkpZp4G83lTDKstjcCDv3rvvMXFoMN61 06ds8e4z4rVR2T3b5gv5YpHCruUYJeHc4+dtls80LnJyim3jOOhyCN76kTIbIM7MWR AYWiRB0aaHjQIIO6QcYsUGcchU6LW1iWw+jCRfPzmMdUSSoHSDT3ujZwbc9YymK+td HUR1OtzdOC30A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 80AB16790F for ; Fri, 5 Sep 2025 07:18:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078314; bh=ZBl39VcYOjdKO4bzTcBEFa/aDsJc9gAyQH8r4CP6nok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hmNl07WbJhqmhLlfQI+9mezStLNiAbMIXGolOW0/24FEjPKMsS6KXii3WNl1KU36i zazocZPsRFzfK/sRAvXS4+HQsmuTGIxKvj/voaWLEBb5BJeETDHPrKKqBC1JnHgdPl 6XDp+NempaG31p/IOngNtpUd+KfijI8bcRzgiG/uXlCbE24JRsnYyTMbnz6Z1NZbKd HnyeaMQgPOot5L5qlj7z8YoXz9K/uJnY34gIXMyaAOAFXbBMI1dLhZ59cqDhh46sNo YNd5zAIeD+3+H66YiGxmfgbX2erlsgkSkPUDLYMhqJ8M5t+4jN+aOdmbyFaw/30xqk IcsoDdvjXuVkA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CA9595FE1B; Fri, 5 Sep 2025 07:18:34 -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 VfHb1tEXSkJ9; Fri, 5 Sep 2025 07:18:34 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078310; bh=eJ8oghuMTHfmL5qPewUkuuk5SRG4lYi1QZ9Lobm++rA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TP2Jx3VVidyJEoVqWSU9IkQDX2isITV70vzfrLhIE6SUWxu6cw9qZyAaT2/UtWbnQ beBmt6RZn8uFFuLTuGwZ6tQz70sMhgQKFMyfty/vcrK+D8VnlcoKJxDtn6PnYWEPxA +uRTfGuP0hk+izYeaOtncJ8E5gHxFc0+gT7WxIn3ljNR5aFUSmD//gKyVEYsw3vmVf u+9ZHCI3/VADySvnBVru9StbTIe2TJty2wRL7NIRN/jvNwUJZCNCBJlnvVNMOmucEj E81OZIrhZkrx04MPmd1lh4fv6Pmn7iIbjGRAmfZ6oVpSRk5x4DBCL4A9KKawAKevcu 5pZtBvvKbmshA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4B65A678AA; Fri, 5 Sep 2025 07:18:30 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 07:18:09 -0600 Message-ID: <20250905131816.3344908-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905131816.3344908-1-sjg@u-boot.org> References: <20250905131816.3344908-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4OINADJ7GKMW47NTYPMPHCEECQYRAOQL X-Message-ID-Hash: 4OINADJ7GKMW47NTYPMPHCEECQYRAOQL 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 2/5] api: Rename the api/ 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 Rename this directory legacy_api since it is now considered legacy. Co-developed-by: Claude Signed-off-by: Simon Glass --- Kconfig | 2 +- Makefile | 2 +- {api => legacy_api}/Kconfig | 0 {api => legacy_api}/Makefile | 0 {api => legacy_api}/README | 0 {api => legacy_api}/api.c | 0 {api => legacy_api}/api_display.c | 0 {api => legacy_api}/api_net.c | 0 {api => legacy_api}/api_platform-arm.c | 0 {api => legacy_api}/api_platform-mips.c | 0 {api => legacy_api}/api_platform-powerpc.c | 0 {api => legacy_api}/api_private.h | 0 {api => legacy_api}/api_storage.c | 0 13 files changed, 2 insertions(+), 2 deletions(-) rename {api => legacy_api}/Kconfig (100%) rename {api => legacy_api}/Makefile (100%) rename {api => legacy_api}/README (100%) rename {api => legacy_api}/api.c (100%) rename {api => legacy_api}/api_display.c (100%) rename {api => legacy_api}/api_net.c (100%) rename {api => legacy_api}/api_platform-arm.c (100%) rename {api => legacy_api}/api_platform-mips.c (100%) rename {api => legacy_api}/api_platform-powerpc.c (100%) rename {api => legacy_api}/api_private.h (100%) rename {api => legacy_api}/api_storage.c (100%) diff --git a/Kconfig b/Kconfig index 3b136a5f897..bf30179db93 100644 --- a/Kconfig +++ b/Kconfig @@ -731,7 +731,7 @@ config LDR_CPU generally used on processors from Analog Devices, but may be also be useful for other vendors. -source "api/Kconfig" +source "legacy_api/Kconfig" endmenu # General setup diff --git a/Makefile b/Makefile index b43e028a06e..088de1d1de4 100644 --- a/Makefile +++ b/Makefile @@ -865,7 +865,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags) HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n) -libs-$(CONFIG_API) += api/ +libs-$(CONFIG_API) += legacy_api/ libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ libs-y += boot/ libs-$(CONFIG_CMDLINE) += cmd/ diff --git a/api/Kconfig b/legacy_api/Kconfig similarity index 100% rename from api/Kconfig rename to legacy_api/Kconfig diff --git a/api/Makefile b/legacy_api/Makefile similarity index 100% rename from api/Makefile rename to legacy_api/Makefile diff --git a/api/README b/legacy_api/README similarity index 100% rename from api/README rename to legacy_api/README diff --git a/api/api.c b/legacy_api/api.c similarity index 100% rename from api/api.c rename to legacy_api/api.c diff --git a/api/api_display.c b/legacy_api/api_display.c similarity index 100% rename from api/api_display.c rename to legacy_api/api_display.c diff --git a/api/api_net.c b/legacy_api/api_net.c similarity index 100% rename from api/api_net.c rename to legacy_api/api_net.c diff --git a/api/api_platform-arm.c b/legacy_api/api_platform-arm.c similarity index 100% rename from api/api_platform-arm.c rename to legacy_api/api_platform-arm.c diff --git a/api/api_platform-mips.c b/legacy_api/api_platform-mips.c similarity index 100% rename from api/api_platform-mips.c rename to legacy_api/api_platform-mips.c diff --git a/api/api_platform-powerpc.c b/legacy_api/api_platform-powerpc.c similarity index 100% rename from api/api_platform-powerpc.c rename to legacy_api/api_platform-powerpc.c diff --git a/api/api_private.h b/legacy_api/api_private.h similarity index 100% rename from api/api_private.h rename to legacy_api/api_private.h diff --git a/api/api_storage.c b/legacy_api/api_storage.c similarity index 100% rename from api/api_storage.c rename to legacy_api/api_storage.c From patchwork Fri Sep 5 13:18:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 235 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=1757078318; bh=uO4aY2JmNerE0jq3Hj2XHeWsGPPjBs3ynXll1QB0m/4=; 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=cANpLhPVkPpM8W3rdPyND3BHcokTrI0mCDAViNv54HrIf7GsUXTf9SHnDT6yo5vbN nDp+gTK5WmR2QqWdrH/A2PqSFIwD+HB4RveqGowjOQQ99dxf6SXF4p0lnYXnS/F4B2 izNjjKX3Dx7Hhvqv7yfKuaP/f7ign+kccevRnyMoQsj9BA9sIqBvVPpkuHPu9QLitZ 7pmA/qJZ02zSSdph/0l14T+JJb68Dvv8q/dctiCsmpmWGRAGBPq3E0QNnK9xVNfkjw WTZQLomTbVXnxmSDyE/hf9cIKmy6d0fKmFq+ZhUrVMuPu/1PIWbf7NAbauYCHF5Du2 Lro7EGsI2qjMw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E1EA567989 for ; Fri, 5 Sep 2025 07:18:38 -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 wKD3d5MC8KS3 for ; Fri, 5 Sep 2025 07:18:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078318; bh=uO4aY2JmNerE0jq3Hj2XHeWsGPPjBs3ynXll1QB0m/4=; 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=cANpLhPVkPpM8W3rdPyND3BHcokTrI0mCDAViNv54HrIf7GsUXTf9SHnDT6yo5vbN nDp+gTK5WmR2QqWdrH/A2PqSFIwD+HB4RveqGowjOQQ99dxf6SXF4p0lnYXnS/F4B2 izNjjKX3Dx7Hhvqv7yfKuaP/f7ign+kccevRnyMoQsj9BA9sIqBvVPpkuHPu9QLitZ 7pmA/qJZ02zSSdph/0l14T+JJb68Dvv8q/dctiCsmpmWGRAGBPq3E0QNnK9xVNfkjw WTZQLomTbVXnxmSDyE/hf9cIKmy6d0fKmFq+ZhUrVMuPu/1PIWbf7NAbauYCHF5Du2 Lro7EGsI2qjMw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CB312678E5 for ; Fri, 5 Sep 2025 07:18:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078317; bh=R974Oz2eRZJw0R3+y6eocPFAC7/PBofvrkxp5rwjT4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bdS+uBIe7+33EnQZJw1ZW/Fjee+FXY7cix8Qz5hE6bxUQrYeK12dZlv9IfgHtjPO4 SbhEDdgz/hZ+IqD+MW4VgINdCX2Y1Jk15Ls81q0Eizp/qTPZbJflIiWUIvJo6gr5iM 2eqMdoCwEePYV/iwCprWXWDvIrDDQyjplrTfLixeX6k1J4vs15a/Oxs/5YrDt5f/uj +haMi7atx9NuoowVAkgXhFvbJ9A3ziiyFUKfMVQAJVSNoIfG7rwxi8WJ5Sa7tDkDH1 790uyLzLHU/ehyhVT3GQXeV3y8YBqyCM7/CgKFSs9prG7Uh44WFplCT8ZV+QutvDnk /9oMEZ8+2u+Gg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2308B6790F; Fri, 5 Sep 2025 07:18: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 T0EBWXnrJuAr; Fri, 5 Sep 2025 07:18:37 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078315; bh=1NGzt/ii/VtHx2hJSPiX1Cb5HIlTtdm/hcM2l+r7Tos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VQDIQQnZzjbYDE62j8m+XubSk3M4Tj9dWsMBRqZjmsKD/JxxLi0OzXxKspSGVdtq3 phYsbWnOFX61YdIxCjiP5pfvsv8VRWPTbVqkVTSDnI8EEQBKfoRT4/2qRIO12eK3HP NAmZCmyM+WuClZupeGPOz9Yu8j5UiVumK95s6PutSyhdqOXwbREa13YyjxhjqjPnob GOcj8Hk+ibwi4shEJ+Q1qk++MCV9Z5MpcaTM1bd2PGxnhK1RAl4s9W9j/qsU/SzH1m tNAY5cG6KvaqoZvJFecRDXHdmh1LDPrXspscd/DMFtuwNguf01yKysoQ9z2v6RqBl7 YjKcVmH7Ay62Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E2DD2678AA; Fri, 5 Sep 2025 07:18:34 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 07:18:10 -0600 Message-ID: <20250905131816.3344908-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905131816.3344908-1-sjg@u-boot.org> References: <20250905131816.3344908-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UINNGYLIOFCYMU7MGPG2PJF63QVN54MD X-Message-ID-Hash: UINNGYLIOFCYMU7MGPG2PJF63QVN54MD 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 3/5] Kconfig: Rename API to LEGACY_API 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 Kconfig use use CONFIG_LEGACY_API since the API is now deprecated. Signed-off-by: Simon Glass --- Makefile | 2 +- common/board_r.c | 4 ++-- examples/Makefile | 2 +- include/net-common.h | 2 +- include/net-legacy.h | 2 +- legacy_api/Kconfig | 22 +++++++++++++--------- legacy_api/README | 2 +- net/lwip/net-lwip.c | 4 ++-- net/net.c | 4 ++-- 9 files changed, 24 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 088de1d1de4..7011535bb2f 100644 --- a/Makefile +++ b/Makefile @@ -865,7 +865,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags) HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n) -libs-$(CONFIG_API) += legacy_api/ +libs-$(CONFIG_LEGACY_API) += legacy_api/ libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ libs-y += boot/ libs-$(CONFIG_CMDLINE) += cmd/ diff --git a/common/board_r.c b/common/board_r.c index a141312f918..1bb0eb37e9b 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -686,8 +686,8 @@ static void initcall_run_r(void) #endif INITCALL(stdio_add_devices); INITCALL(jumptable_init); -#if CONFIG_IS_ENABLED(API) - INITCALL(api_init); +#if CONFIG_IS_ENABLED(LEGACY_API) + INITCALL(legacy_api_init); #endif INITCALL(console_init_r); /* fully init console as a device */ #if CONFIG_IS_ENABLED(DISPLAY_BOARDINFO_LATE) diff --git a/examples/Makefile b/examples/Makefile index bf518bd221b..bf51f1a5018 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -7,5 +7,5 @@ subdir-ccflags-y += -finstrument-functions -DFTRACE endif subdir-y += standalone -subdir-$(CONFIG_API) += api +subdir-$(CONFIG_LEGACY_API) += api endif diff --git a/include/net-common.h b/include/net-common.h index 0829e05f94b..9d26c26cf5f 100644 --- a/include/net-common.h +++ b/include/net-common.h @@ -198,7 +198,7 @@ int usb_ether_init(void); int eth_init(void); /* Initialize the device */ int eth_start_udev(struct udevice *dev); /* ->start() if not already running */ int eth_send(void *packet, int length); /* Send a packet */ -#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) +#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER) int eth_receive(void *packet, int length); /* Receive a packet*/ extern void (*push_packet)(void *packet, int length); #endif diff --git a/include/net-legacy.h b/include/net-legacy.h index a7dbcec1506..41a898bb7d1 100644 --- a/include/net-legacy.h +++ b/include/net-legacy.h @@ -105,7 +105,7 @@ int eth_env_get_enetaddr_by_index(const char *base_name, int index, int eth_send(void *packet, int length); /* Send a packet */ -#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) +#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER) int eth_receive(void *packet, int length); /* Receive a packet*/ extern void (*push_packet)(void *packet, int length); #endif diff --git a/legacy_api/Kconfig b/legacy_api/Kconfig index b58f293107f..6dc96455ff0 100644 --- a/legacy_api/Kconfig +++ b/legacy_api/Kconfig @@ -1,23 +1,27 @@ -config API - bool "Enable U-Boot API" +config LEGACY_API + bool "Enable Legacy U-Boot API" depends on CC_IS_GCC help - This option enables the U-Boot API. See api/README for more information. + This option enables the legcay U-Boot API. See legacy_api/README for + more information. -menu "API" - depends on API + Note that this is deprecated and not intended to be used. It will be + removed by the end of 2027. + +menu "LEGACY API" + depends on LEGACY_API config SYS_MMC_MAX_DEVICE - int "Maximum number of MMC devices exposed via the API" + int "Maximum number of MMC devices exposed via the legacy API" default 1 config EXAMPLES - bool "Compile API examples" + bool "Compile legacy API examples" depends on !SANDBOX default y if ARCH_QEMU_ARM help - U-Boot provides an API for standalone applications. Examples are - provided in directory examples/. + U-Boot provides an legacy API for standalone applications. Examples + are provided in directory examples/. config STANDALONE_LOAD_ADDR depends on EXAMPLES diff --git a/legacy_api/README b/legacy_api/README index 6df225f584b..e635735f689 100644 --- a/legacy_api/README +++ b/legacy_api/README @@ -24,7 +24,7 @@ U-Boot machine/arch independent API for external apps for example it doesn't keep states, but relies on hints from the app and so on - - optional (CONFIG_API) + - optional (CONFIG_LEGACY_API) 2. Calls diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index 2cc5749d459..bf3bdd6f950 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -18,7 +18,7 @@ /* xx:xx:xx:xx:xx:xx\0 */ #define MAC_ADDR_STRLEN 18 -#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) +#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER) void (*push_packet)(void *, int len) = 0; #endif static int net_try_count; @@ -303,7 +303,7 @@ int net_lwip_rx(struct udevice *udev, struct netif *netif) void net_process_received_packet(uchar *in_packet, int len) { -#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) +#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER) if (push_packet) (*push_packet)(in_packet, len); #endif diff --git a/net/net.c b/net/net.c index 7b9fc3fb0df..d2a698aea2f 100644 --- a/net/net.c +++ b/net/net.c @@ -158,7 +158,7 @@ static unsigned net_ip_id; /* Ethernet bcast address */ const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; const u8 net_null_ethaddr[6]; -#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) +#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER) void (*push_packet)(void *, int len) = 0; #endif /* Network loop state */ @@ -1248,7 +1248,7 @@ void net_process_received_packet(uchar *in_packet, int len) if (len < ETHER_HDR_SIZE) return; -#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER) +#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER) if (push_packet) { (*push_packet)(in_packet, len); return; From patchwork Fri Sep 5 13:18:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 236 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=1757078323; bh=Zm+v8tRBxVhQzQf0hYueZw3LfHIUHxf5DeYeUclkbkw=; 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=E8jNaiDgOovQqFrYB+3hFao9ivzk9YhQsN2ogHBaC/I9VyQTSw1fDwyJL6oJHyg1J dQPTOur6rtHbIAZXtBaKehxs7NxvkStexjURLFkarj9ew9EXrETKtY96DTfuPdAV/G D/O5kNsiBWOTbZwNl4ddyT00qZ+X03p6aEqMWqiHK4KjCGJPF/gtJMsp+yeGRcIJnk ZGHBF94QC0MJTF/uRu0DpBKXn5BMOwpVPEbfn+FS9xB2KDzkfsD7zr4/RLpadNpyV8 tqPwvyiAUVoalvNVYe5exJhpR1Mr11f16CJCwg6VukU2XMIqNU37u3X0JLl8G2ACBt ORtd3osFraKBA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3DE896799B for ; Fri, 5 Sep 2025 07:18: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 10024) with ESMTP id lOoEjyzf8Xsn for ; Fri, 5 Sep 2025 07:18:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078323; bh=Zm+v8tRBxVhQzQf0hYueZw3LfHIUHxf5DeYeUclkbkw=; 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=E8jNaiDgOovQqFrYB+3hFao9ivzk9YhQsN2ogHBaC/I9VyQTSw1fDwyJL6oJHyg1J dQPTOur6rtHbIAZXtBaKehxs7NxvkStexjURLFkarj9ew9EXrETKtY96DTfuPdAV/G D/O5kNsiBWOTbZwNl4ddyT00qZ+X03p6aEqMWqiHK4KjCGJPF/gtJMsp+yeGRcIJnk ZGHBF94QC0MJTF/uRu0DpBKXn5BMOwpVPEbfn+FS9xB2KDzkfsD7zr4/RLpadNpyV8 tqPwvyiAUVoalvNVYe5exJhpR1Mr11f16CJCwg6VukU2XMIqNU37u3X0JLl8G2ACBt ORtd3osFraKBA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 29F2D6790F for ; Fri, 5 Sep 2025 07:18:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078321; bh=3UWd2YBWqBKRqiiKzEXuBuqInHPESfP7jMLpVeGiSfc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NTapw/rkQyi5apqgpjblPS56aUY04AtqRTBNmwvLHL14AJ0xiBUH+SKVISOhDqJEh yMvI+aR4VSk7C7tc89EQqRNKDdYbobufQiW5EriwkUlkErXkM5OwLT6dANW3xPw6Ar UcfM1JfBqZpscaYqjhEMl54BkZ8wwBEw6DDY5Njdws/1tMHz4TsXHCqromuPcvOtj9 FUMIeX3du4Th5Yt7Cqcgx5v93aVREhrDHYgb3xXHoUVhmv6mweeMtoPH8y7M7GrOL3 T0uIOz0L/nRtRZPCOTbRRSvL9tmRT8J2VdRzA0NbYi04DtoNYWgw+QRkjryUh+6LoN hQzJRK7aHemgA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 938646790F; Fri, 5 Sep 2025 07:18: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 6cGU2qStBZiA; Fri, 5 Sep 2025 07:18:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078317; bh=Z6C9dXb9Q9l7siKXoKRr/b36nVvtpzKN+xOlSug2IN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wObVDCUkQh1sDsUW2so55yKIfPMK2gttxO0ePgaVOqUUARL7hZD90mEcfya7XG+DD tZtqWKWVB3fNH/XaYrPntK0Mzqun1coqVrJ8roUqG31lP7KKqFq5EeqiQmbS2UMQBf JhdgUyLLaQ3zMxKOXwrF3c/dZ7oXv+IuZ/kKwVw3L+U6tZA9Gym+d6HsGjGP8xNVtX 1zlk7Tcn8K7BM5MW4UlPEMUqjr5WfPVY1FRdBmp6Gp/Hvar8+DASlVgV8Ym6oVhwdj vNVfVMW3rH8nh5FHnZKImrZvkuWdh7NURuVAl7j3DB7k9PVhuVqQZmU17GQWojwOjp J7qAbHuGcnZhw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EE1E36799D; Fri, 5 Sep 2025 07:18:36 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 07:18:11 -0600 Message-ID: <20250905131816.3344908-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905131816.3344908-1-sjg@u-boot.org> References: <20250905131816.3344908-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AH6EGB3ZRCO5GR3MIATOALB4E5WLPLRM X-Message-ID-Hash: AH6EGB3ZRCO5GR3MIATOALB4E5WLPLRM 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 4/5] api: Rename api_init() to legacy_api_init() 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 Complete the rename of this API so that it is clear it is considered deprecated. Signed-off-by: Simon Glass --- include/legacy_api.h | 6 ++++-- legacy_api/api.c | 2 +- legacy_api/api_private.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/legacy_api.h b/include/legacy_api.h index 85bd80b2e33..6ada4000715 100644 --- a/include/legacy_api.h +++ b/include/legacy_api.h @@ -8,13 +8,15 @@ #define __LEGACY_API_H /** - * api_init() - Initialize API for external applications + * legacy_api_init() - Initialize legacy API for external applications * * Initialize API for external (standalone) applications running on top of * U-Boot. It is called during the generic post-relocation init sequence. * + * Note that this is deprecated. + * * Return: 0 if OK */ -int api_init(void); +int legacy_api_init(void); #endif diff --git a/legacy_api/api.c b/legacy_api/api.c index 458eaf0c5a4..a3d3a8eccae 100644 --- a/legacy_api/api.c +++ b/legacy_api/api.c @@ -638,7 +638,7 @@ int syscall(int call, int *retval, ...) return 1; } -int api_init(void) +int legacy_api_init(void) { struct api_signature *sig; diff --git a/legacy_api/api_private.h b/legacy_api/api_private.h index bb23821c2c0..1871ba4f431 100644 --- a/legacy_api/api_private.h +++ b/legacy_api/api_private.h @@ -8,7 +8,7 @@ #ifndef _API_PRIVATE_H_ #define _API_PRIVATE_H_ -int api_init(void); +int legacy_api_init(void); void platform_set_mr(struct sys_info *, unsigned long, unsigned long, int); int platform_sys_info(struct sys_info *); From patchwork Fri Sep 5 13:18:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 237 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=1757078325; bh=NbSBqeTXsMunv1qUqDT5oH8vv9pcwiFLfQTX4VY//10=; 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=A//saJCOOJ5OVjO9CeVeXtnIBcaNAqPytx7FotbKFVxEcsT7hhnpNyA9f2eFloI9J L0hO6awS8s3PeGTCG4b6sUJ6cj03HnGsIsOgPJxdv9TEtk/LYEPcflxQru4IW7Z+rZ Rteh1Hg2HbIADt73ZKFK7Gta0RzLdLu1Fg6Rsubi+/6/skJOA55sfy0RG8YIZSdL2b m5OLvZV7qzf5olD9xrlwdCinfoxOappWX+aonPFkuS4KuMQ9bp8805IDUp33eBCI+R y3Q33fwH7aY+47kgoZloJfKsJq2qTNDXgD25l6F+vh+LVXrxt82DrCxE+RXaOaGOb0 7HnpcAzRLmrNQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 912C267980 for ; Fri, 5 Sep 2025 07:18:45 -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 rrQ3e0ULLtah for ; Fri, 5 Sep 2025 07:18:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078325; bh=NbSBqeTXsMunv1qUqDT5oH8vv9pcwiFLfQTX4VY//10=; 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=A//saJCOOJ5OVjO9CeVeXtnIBcaNAqPytx7FotbKFVxEcsT7hhnpNyA9f2eFloI9J L0hO6awS8s3PeGTCG4b6sUJ6cj03HnGsIsOgPJxdv9TEtk/LYEPcflxQru4IW7Z+rZ Rteh1Hg2HbIADt73ZKFK7Gta0RzLdLu1Fg6Rsubi+/6/skJOA55sfy0RG8YIZSdL2b m5OLvZV7qzf5olD9xrlwdCinfoxOappWX+aonPFkuS4KuMQ9bp8805IDUp33eBCI+R y3Q33fwH7aY+47kgoZloJfKsJq2qTNDXgD25l6F+vh+LVXrxt82DrCxE+RXaOaGOb0 7HnpcAzRLmrNQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7FAD1678DF for ; Fri, 5 Sep 2025 07:18:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078323; bh=U1wgVLT7SeJ6F49eFPvJx10evISfx4aY4EiqMFQyuN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pP+9asaOIfqqbZx0h5RAKOHqsAlihnxAf9Ds620yQ0KmuIVJ1DfDw+dkEX4BjsbIA QeAP2ekd6S3LiaR6Y61JG5J1zr/8X2yWKxPrLWw+gWmt6vjJag8Jh/4uhpbBMeYe6h m+zhMNNSXGk8Kh8/6yC3XoJ1AgFc78SQdZWniyYvORbKQ80CS5Ly+rXseaz6LPZmJ6 27FIELiK5mnHfVD6/9bougIqdxuAM2mZejuMBdhClbI1FCiFFM8+tte9FGlFvOT28w E8iDwto4SHyll9jqNADGO4acVte58Y0k38RscmvVFK729fhesU49wHF8C8XznBOMDF D3JFgtxY2hwhQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5D6D36799E; Fri, 5 Sep 2025 07:18: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 YvWgm8Uui7YY; Fri, 5 Sep 2025 07:18:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757078321; bh=j/hGCoTcXEzsI7LAs5hIqSrNe639TYr0dIlDQRuvgtY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=keuHppCGgVyXP2UTl5CIrXPv/Rg//BGARzioe2C8ZN6r1dKE2/EMiZP1FnR9fw7Ua GbcKVsR6ZVcKKtIwg/1BXwD0KIphLJ96A4VTbfmP+FyZdojwSvQAC6A6a9SJwg/+X8 Yb3zLXzCdcT3JXGjrSyXDeF+gq348y4rgNstwKe8RInmrg4qpagH5h2JZIBR1+47eQ EKd2yYwCG1RO7YJM2hPOdVtnEFf4vB6c5kGFJrrrYKNhPP9W9b3py2ANIRmo86EgVN 9vhOIVPkRKDteqGp+dRBxGy4Qh73PuqswXaDfpipzjuw76lHaTJPekPplxF5Sx9Tjw 9oQhCuax3F2jw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8375F678DF; Fri, 5 Sep 2025 07:18:41 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 5 Sep 2025 07:18:12 -0600 Message-ID: <20250905131816.3344908-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250905131816.3344908-1-sjg@u-boot.org> References: <20250905131816.3344908-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZZ4NEIVZKAQEOSFZLFUM66FOUBAEL6HM X-Message-ID-Hash: ZZ4NEIVZKAQEOSFZLFUM66FOUBAEL6HM 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 5/5] doc: api: Add a migration deadline 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 Set a deadline of the end of 2027 for removal of what is now the legacy API. Signed-off-by: Simon Glass --- doc/develop/driver-model/migration.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/develop/driver-model/migration.rst b/doc/develop/driver-model/migration.rst index b40a6af9d11..50689282b39 100644 --- a/doc/develop/driver-model/migration.rst +++ b/doc/develop/driver-model/migration.rst @@ -118,3 +118,15 @@ Deadline: 2023.04 The serial subsystem has supported the driver model since late 2014. Maintainers should submit patches switching over to using CONFIG_DM_SERIAL and other base driver model options in time for inclusion in the 2022.10 release. + +CONFIG_LEGACY_API +----------------- +Deadline: 2028.01 + +U-Boot has long supported an API which allows external programs to call entry +points in U-Boot. This API does not support driver model and is not widely used. +It is being replaced by a library approach (libu-boot.a/so) which is more +flexible and could potentially support an automatically generated stub with +those entry points. + +The API will be removed for the 2028.01 release.