[PATCH 1/5] ARM: SoCFPGA: move wait_on_timeout to generic
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Mar 3 01:12:04 PST 2025
Hello Steffen,
On 03.03.25 09:59, Steffen Trumtrar wrote:
> To be able to use the __wait_on_timeout macro in more places, move it to
> the generic socfpga header.
>
> Signed-off-by: Steffen Trumtrar <s.trumtrar at pengutronix.de>
> ---
> arch/arm/mach-socfpga/arria10-xload.c | 16 ----------------
> include/mach/socfpga/generic.h | 16 ++++++++++++++++
> 2 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/arch/arm/mach-socfpga/arria10-xload.c b/arch/arm/mach-socfpga/arria10-xload.c
> index afec55c33a278f7aa7c13d16557881a5e13f38f9..fb87135ca94a1fd12992bc8e7fb9d1725831aad6 100644
> --- a/arch/arm/mach-socfpga/arria10-xload.c
> +++ b/arch/arm/mach-socfpga/arria10-xload.c
> @@ -16,22 +16,6 @@
> #include <mach/socfpga/generic.h>
> #include <linux/sizes.h>
>
> -#define __wait_on_timeout(timeout, condition) \
> -({ \
> - int __ret = 0; \
> - int __timeout = timeout; \
> - \
> - while ((condition)) { \
> - if (__timeout-- < 0) { \
> - __ret = -ETIMEDOUT; \
> - break; \
> - } \
> - arria10_kick_l4wd0(); \
> - __udelay(1); \
Unrelated to your patch. But feeding the watchdog every 1us is
a bit excessive, isn't it?
Cheers,
Ahmad
> - } \
> - __ret; \
> -})
> -
> int a10_update_bits(unsigned int reg, unsigned int mask,
> unsigned int val)
> {
> diff --git a/include/mach/socfpga/generic.h b/include/mach/socfpga/generic.h
> index 40224897c1d2e05b934cd49963ac4ddeaeb28a25..9891dbe4fe1016ce0732d635fdd06ae7add16ac3 100644
> --- a/include/mach/socfpga/generic.h
> +++ b/include/mach/socfpga/generic.h
> @@ -106,6 +106,22 @@ static inline void __udelay(unsigned us)
> for (i = 0; i < us * 3; i++);
> }
>
> +#define __wait_on_timeout(timeout, condition) \
> +({ \
> + int __ret = 0; \
> + int __timeout = timeout; \
> + \
> + while ((condition)) { \
> + if (__timeout-- < 0) { \
> + __ret = -ETIMEDOUT; \
> + break; \
> + } \
> + arria10_kick_l4wd0(); \
> + __udelay(1); \
> + } \
> + __ret; \
> +})
> +
> struct socfpga_barebox_part {
> unsigned int nor_offset;
> unsigned int nor_size;
>
--
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