From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>,
barebox@lists.infradead.org,
Sascha Hauer <s.hauer@pengutronix.de>
Subject: Re: [PATCH 1/5] ARM: SoCFPGA: move wait_on_timeout to generic
Date: Mon, 3 Mar 2025 10:12:04 +0100 [thread overview]
Message-ID: <f8f5ceab-65d0-44a3-bf19-8fce40f56bc3@pengutronix.de> (raw)
In-Reply-To: <20250303-v2025-02-0-topic-socfpga-arria10-v1-1-d66021246a66@pengutronix.de>
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@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 |
next prev parent reply other threads:[~2025-03-03 9:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 8:59 [PATCH 0/5] SoCFPGA: Arria10: sdram: cleanup and fix DDR driver Steffen Trumtrar
2025-03-03 8:59 ` [PATCH 1/5] ARM: SoCFPGA: move wait_on_timeout to generic Steffen Trumtrar
2025-03-03 9:12 ` Ahmad Fatoum [this message]
2025-03-03 11:11 ` Steffen Trumtrar
2025-03-03 8:59 ` [PATCH 2/5] ARM: SoCFPGA: arria10-sdram: cleanup emif_clear Steffen Trumtrar
2025-03-03 8:59 ` [PATCH 3/5] ARM: SoCFPGA: arria10-sdram: cleanup emif_reset Steffen Trumtrar
2025-03-03 8:59 ` [PATCH 4/5] ARM: SoCFPGA: arria10-sdram: remove workaround Steffen Trumtrar
2025-03-03 8:59 ` [PATCH 5/5] ARM: SoCFPGA: arria10-sdram: cleanup ddr_setup Steffen Trumtrar
2025-03-05 11:17 ` [PATCH 0/5] SoCFPGA: Arria10: sdram: cleanup and fix DDR driver 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=f8f5ceab-65d0-44a3-bf19-8fce40f56bc3@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
--cc=s.trumtrar@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