[PATCH v2 3/3] pbl: introduce HAS_PBL_CLOCKSOURCE marker

Sascha Hauer s.hauer at pengutronix.de
Tue Aug 11 22:32:43 PDT 2026


On 2026-08-11 12:13, Stefan Kerkmann wrote:
> 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 at 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

This change makes arm_architected_timer_udelay() available for builds
which exclusively support ARMv7a, so breaks builds that have ARMv4/5/6
enabled as well.

You could leave pbl-$(CONFIG_CPU_32v7) untouched and put get_time_ns()
inside #ifdef CONFIG_HAS_PBL_CLOCKSOURCE

Sascha

--
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list