From patchwork Mon Jan 19 21:48:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1673 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=1768859415; bh=A/n7ptz9id4oox9xFixP7Sb6wq3DEdSrXHrTOcZ+OrE=; 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=PA81fymaVgOhwX+Es+84CrOuYNAHA8tZwAcWucMV4UfBaC98v4MORlePpfoSrxThn UIKY5SdYqw9xDJgw+fCYpn2zxamJ+XV0a96mb0Bc7p7voNtJdgTxvCVhQwBK6JlXBP YXH6vmiWynzTeOPM5jXSOK7KupcPbnQ0X/+f50zCrwb6RlBxjsSXTWniACAk6Eewh9 L9Qc92s2cyxv6nsuKs/ID+6URUTQiRzTUkdmcg5kmKnz7+oOUOPETIfSXIG6AUXEwK j9lTJvOyDOcMcBButtMgGEc9bYjRUGv1565APIQ2fbF14eDGdfN77DT4PvNIlyA7BC 2bBCfFgjsz5GA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B5F7369533 for ; Mon, 19 Jan 2026 14:50:15 -0700 (MST) 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 gSGXav9KdkbT for ; Mon, 19 Jan 2026 14:50:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859415; bh=A/n7ptz9id4oox9xFixP7Sb6wq3DEdSrXHrTOcZ+OrE=; 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=PA81fymaVgOhwX+Es+84CrOuYNAHA8tZwAcWucMV4UfBaC98v4MORlePpfoSrxThn UIKY5SdYqw9xDJgw+fCYpn2zxamJ+XV0a96mb0Bc7p7voNtJdgTxvCVhQwBK6JlXBP YXH6vmiWynzTeOPM5jXSOK7KupcPbnQ0X/+f50zCrwb6RlBxjsSXTWniACAk6Eewh9 L9Qc92s2cyxv6nsuKs/ID+6URUTQiRzTUkdmcg5kmKnz7+oOUOPETIfSXIG6AUXEwK j9lTJvOyDOcMcBButtMgGEc9bYjRUGv1565APIQ2fbF14eDGdfN77DT4PvNIlyA7BC 2bBCfFgjsz5GA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A50356951A for ; Mon, 19 Jan 2026 14:50:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859413; bh=AuK8FRn/w/9IatKK0Pcf6PHd03vR/YHqD4QUVSaOfsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SRV9Ew9Q13v+tzYuDjXQXqi07+rRuwTvuaEOE1Ph1ZMFnAXWDzxm04i5MdNoS/eLy MepOhYUr/8fyzvrydF6lb9lj/4I8fjSqsG8kvLu+oZgzRgFXA/Dxr5MEqA/CdcRsJ6 o3J/eHFnQ2hoKSBONdrtZ8yqPRT2K5NpfwQigpWqVMnuhdO86Z1fQxnxHfd0HfVu51 2Ow3GcPxQXVS6iYU7rrSoqpPGJtESCL5q7AT6g41UrZlMV88f1GJuQ6vSC7ZtGRhN3 jIPcwZ/2nlI3VmC0rqyP4xg9bEMjDWMa5xRrf04+WjNGRvCeYI4XMJ7FWURKRYRZNL yNB6uGP1wWQAA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D36B6913F; Mon, 19 Jan 2026 14:50:13 -0700 (MST) 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 h23SpXNM5knr; Mon, 19 Jan 2026 14:50:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768859409; bh=Dr99DA4Q5G09dRWYwgjzsYWXk4E0+ojUHv0IB/NIel0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BEyQTwnoAAslCpTeADyF8rCj7b/MRwX3YnjaQlc/tEN/M/JhC7MbvYwGUncVxHOEw nwkEWFlGdfweUo3pU5PlMr+ixLZOYLerQ5YsKTHFhijFUCc8vckdwUuqCqk6+obVWX Ar5aW1ylget13fS75PWIHD1r8WrCDHWsflXuS3bLv6mycPsXKttR9NqJnqFuOOm5pa axb6b3iFB5jFqmlQwQh2eoSMDvC8SIW98jG1phmzYSFU3QL3UXpAuEvLV/IlqOIJ40 NfVwXVoOzv0/OveLdJNFdnMiydxgkb2yDdmx/lncD6mXM95gZY3+ajCpuErceTQ0la UE3znDmx1GDwQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 01E346951A; Mon, 19 Jan 2026 14:50:08 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 14:48:41 -0700 Message-ID: <20260119214846.3087611-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119214846.3087611-1-sjg@u-boot.org> References: <20260119214846.3087611-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: V2SDW6OMWQXB6RI5BW7WXYHBCJJWURFP X-Message-ID-Hash: V2SDW6OMWQXB6RI5BW7WXYHBCJJWURFP 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 , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/16] ext4l: Add asm-generic/timex.h and move get_cycles 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 Create include/asm-generic/timex.h with the get_cycles() macro that returns 0 (U-Boot doesn't have a cycle counter). Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 4 ++-- include/asm-generic/timex.h | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 include/asm-generic/timex.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 49405877133..eadff92aecb 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -1322,8 +1322,8 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr, /* atomic64 operations are now in asm-generic/atomic.h */ -/* CPU cycle counter stub */ -#define get_cycles() (0ULL) +/* get_cycles is in asm-generic/timex.h */ +#include /* folio_address is in linux/pagemap.h */ diff --git a/include/asm-generic/timex.h b/include/asm-generic/timex.h new file mode 100644 index 00000000000..005befd6b6d --- /dev/null +++ b/include/asm-generic/timex.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Generic timex definitions for U-Boot + * + * Based on Linux asm-generic/timex.h + */ +#ifndef _ASM_GENERIC_TIMEX_H +#define _ASM_GENERIC_TIMEX_H + +typedef unsigned long long cycles_t; + +/** + * get_cycles() - Get CPU cycle counter + * + * U-Boot doesn't have a cycle counter, so return 0. + * + * Return: 0 (stub) + */ +#define get_cycles() (0ULL) + +#endif /* _ASM_GENERIC_TIMEX_H */