[PATCH 2/2] clocksource/drivers/renesas-ostm: Enable OSTM reprobe for RZ/V2N SoC

Prabhakar posted 2 patches 9 months, 2 weeks ago
There is a newer version of this series
[PATCH 2/2] clocksource/drivers/renesas-ostm: Enable OSTM reprobe for RZ/V2N SoC
Posted by Prabhakar 9 months, 2 weeks ago
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Add CONFIG_ARCH_R9A09G056 to the probe condition in renesas-ostm.c so that
the OSTM platform driver can reprobe for the RZ/V2N (R9A09G056) SoC. Like
RZ/G2L and RZ/V2H(P), the RZ/V2N contains the Generic Timer Module (OSTM)
which requires its reset to be deasserted before any register access.
Enabling the platform_device probe path ensures the driver defers until
resets are available.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/clocksource/renesas-ostm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/renesas-ostm.c b/drivers/clocksource/renesas-ostm.c
index 3fcbd02b2483..c9919811542e 100644
--- a/drivers/clocksource/renesas-ostm.c
+++ b/drivers/clocksource/renesas-ostm.c
@@ -225,7 +225,7 @@ static int __init ostm_init(struct device_node *np)
 
 TIMER_OF_DECLARE(ostm, "renesas,ostm", ostm_init);
 
-#if defined(CONFIG_ARCH_RZG2L) || defined(CONFIG_ARCH_R9A09G057)
+#if defined(CONFIG_ARCH_RZG2L) || defined(CONFIG_ARCH_R9A09G057) || defined(CONFIG_ARCH_R9A09G056)
 static int __init ostm_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-- 
2.49.0
Re: [PATCH 2/2] clocksource/drivers/renesas-ostm: Enable OSTM reprobe for RZ/V2N SoC
Posted by Geert Uytterhoeven 9 months, 1 week ago
Hi Prabhakar,

On Thu, 1 May 2025 at 14:37, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Add CONFIG_ARCH_R9A09G056 to the probe condition in renesas-ostm.c so that
> the OSTM platform driver can reprobe for the RZ/V2N (R9A09G056) SoC. Like
> RZ/G2L and RZ/V2H(P), the RZ/V2N contains the Generic Timer Module (OSTM)
> which requires its reset to be deasserted before any register access.
> Enabling the platform_device probe path ensures the driver defers until
> resets are available.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/drivers/clocksource/renesas-ostm.c
> +++ b/drivers/clocksource/renesas-ostm.c
> @@ -225,7 +225,7 @@ static int __init ostm_init(struct device_node *np)
>
>  TIMER_OF_DECLARE(ostm, "renesas,ostm", ostm_init);
>
> -#if defined(CONFIG_ARCH_RZG2L) || defined(CONFIG_ARCH_R9A09G057)
> +#if defined(CONFIG_ARCH_RZG2L) || defined(CONFIG_ARCH_R9A09G057) || defined(CONFIG_ARCH_R9A09G056)

What about simplifying this to a check for CONFIG_ARM64?
The only SoCs which don't want this are RZ/A1 and RZ/A2, because they
are Cortex-A9 and thus do not have the architectured timer, which is
mandatory on ARM64.

>  static int __init ostm_probe(struct platform_device *pdev)
>  {
>         struct device *dev = &pdev->dev;

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Re: [PATCH 2/2] clocksource/drivers/renesas-ostm: Enable OSTM reprobe for RZ/V2N SoC
Posted by Lad, Prabhakar 9 months, 1 week ago
Hi Geert,

Thank you for the review.

On Fri, May 2, 2025 at 1:02 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Prabhakar,
>
> On Thu, 1 May 2025 at 14:37, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> >
> > Add CONFIG_ARCH_R9A09G056 to the probe condition in renesas-ostm.c so that
> > the OSTM platform driver can reprobe for the RZ/V2N (R9A09G056) SoC. Like
> > RZ/G2L and RZ/V2H(P), the RZ/V2N contains the Generic Timer Module (OSTM)
> > which requires its reset to be deasserted before any register access.
> > Enabling the platform_device probe path ensures the driver defers until
> > resets are available.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> > --- a/drivers/clocksource/renesas-ostm.c
> > +++ b/drivers/clocksource/renesas-ostm.c
> > @@ -225,7 +225,7 @@ static int __init ostm_init(struct device_node *np)
> >
> >  TIMER_OF_DECLARE(ostm, "renesas,ostm", ostm_init);
> >
> > -#if defined(CONFIG_ARCH_RZG2L) || defined(CONFIG_ARCH_R9A09G057)
> > +#if defined(CONFIG_ARCH_RZG2L) || defined(CONFIG_ARCH_R9A09G057) || defined(CONFIG_ARCH_R9A09G056)
>
> What about simplifying this to a check for CONFIG_ARM64?
> The only SoCs which don't want this are RZ/A1 and RZ/A2, because they
> are Cortex-A9 and thus do not have the architectured timer, which is
> mandatory on ARM64.
>
Agreed I will simplify this to CONFIG_ARM64.

Cheers,
Prabhakar