mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Stefan Kerkmann <s.kerkmann@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 "open list:BAREBOX" <barebox@lists.infradead.org>
Cc: Stefan Kerkmann <s.kerkmann@pengutronix.de>
Subject: [PATCH v2 3/3] pbl: introduce HAS_PBL_CLOCKSOURCE marker
Date: Tue, 11 Aug 2026 12:13:07 +0200	[thread overview]
Message-ID: <20260811-feature-pbl-get-time-ns-v2-3-754ee021b19d@pengutronix.de> (raw)
In-Reply-To: <20260811-feature-pbl-get-time-ns-v2-0-754ee021b19d@pengutronix.de>

This finally enables the usage of the polled timeout functions in the
barebox pbl with real timeouts for supported architectures. Currently
only ARMv7 and AARCH64 are enabled.

Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>
---
 arch/arm/cpu/Kconfig    | 2 ++
 arch/arm/lib32/Makefile | 2 +-
 include/linux/iopoll.h  | 2 +-
 pbl/Kconfig             | 3 +++
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/Kconfig b/arch/arm/cpu/Kconfig
index 47c116ea98..684c7eade9 100644
--- a/arch/arm/cpu/Kconfig
+++ b/arch/arm/cpu/Kconfig
@@ -82,6 +82,7 @@ config CPU_V7
 	bool "Generic ARMv7 support"
 	depends on 32BIT
 	select CPU_32v7
+	select HAS_PBL_CLOCKSOURCE if !CPU_32v4T && !CPU_32v5 && !CPU_32v6
 
 config CPU_V7VE
 	bool "ARMv7 Virtualization Extensions Support"
@@ -135,6 +136,7 @@ config CPU_32v7
 config CPU_64v8
 	bool
 	select CPU_64
+	select HAS_PBL_CLOCKSOURCE
 
 comment "processor features"
 
diff --git a/arch/arm/lib32/Makefile b/arch/arm/lib32/Makefile
index 67c4f16f76..796ea6c742 100644
--- a/arch/arm/lib32/Makefile
+++ b/arch/arm/lib32/Makefile
@@ -34,7 +34,7 @@ extra-y += barebox.lds
 pbl-y	+= lib1funcs.o
 pbl-y	+= ashldi3.o
 pbl-y	+= div0.o
-pbl-$(CONFIG_CPU_32v7)	+= arm_architected_timer.o
+pbl-$(CONFIG_HAS_PBL_CLOCKSOURCE)	+= arm_architected_timer.o
 CFLAGS_arm_architected_timer.o := -march=armv7-a
 
 obj-pbl-y	+= setjmp.o
diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h
index a6fade2a11..d86069f348 100644
--- a/include/linux/iopoll.h
+++ b/include/linux/iopoll.h
@@ -12,7 +12,7 @@
 #include <clock.h>
 #include <pbl.h>
 
-#if IN_PROPER
+#if IN_PROPER || IS_ENABLED(CONFIG_HAS_PBL_CLOCKSOURCE)
 # define read_poll_get_time_ns()	get_time_ns()
 # define read_poll_is_timeout(s, t)	is_timeout(s, t)
 #else
diff --git a/pbl/Kconfig b/pbl/Kconfig
index 63f29cd613..e5fe5328d2 100644
--- a/pbl/Kconfig
+++ b/pbl/Kconfig
@@ -43,6 +43,9 @@ config PBL_SINGLE_IMAGE
 	depends on !HAVE_PBL_MULTI_IMAGES
 	default y
 
+config HAS_PBL_CLOCKSOURCE
+	bool
+
 if PBL_IMAGE
 
 config USE_COMPRESSED_DTB

-- 
2.47.3




  parent reply	other threads:[~2026-08-11 10:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 10:13 [PATCH v2 0/3] PBL: enable timeouts in read_poll_timeout macros Stefan Kerkmann
2026-08-11 10:13 ` [PATCH v2 1/3] ARM64: lib64: pbl: implement get_time_ns and is_timeout Stefan Kerkmann
2026-08-11 10:13 ` [PATCH v2 2/3] ARM: lib32: " Stefan Kerkmann
2026-08-11 10:21   ` Ahmad Fatoum
2026-08-12  5:56     ` Sascha Hauer
2026-08-11 10:13 ` Stefan Kerkmann [this message]
2026-08-12  5:32   ` [PATCH v2 3/3] pbl: introduce HAS_PBL_CLOCKSOURCE marker Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260811-feature-pbl-get-time-ns-v2-3-754ee021b19d@pengutronix.de \
    --to=s.kerkmann@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox