Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add OSTM support for Renesas RZ/V2H(P) SoC
@ 2024-03-18 16:07 Prabhakar
  2024-03-18 16:07 ` [PATCH 1/2] dt-bindings: timer: renesas: ostm: Document " Prabhakar
  2024-03-18 16:07 ` [PATCH 2/2] clocksource/drivers/renesas-ostm: Add OSTM support for " Prabhakar
  0 siblings, 2 replies; 7+ messages in thread
From: Prabhakar @ 2024-03-18 16:07 UTC (permalink / raw)
  To: Geert Uytterhoeven, Daniel Lezcano, Thomas Gleixner, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Chris Brandt, Magnus Damm
  Cc: linux-kernel, devicetree, linux-arm-kernel, linux-renesas-soc,
	Prabhakar, Fabrizio Castro, Lad Prabhakar

From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Hi,

This patch series aims to add OSTM support for Renesas RZ/V2H(P) SoC.
RZ/V2H(P) SoC has 8 GTM channels.

Cheers,
Prabhakar

Lad Prabhakar (2):
  dt-bindings: timer: renesas: ostm: Document Renesas RZ/V2H(P) SoC
  clocksource/drivers/renesas-ostm: Add OSTM support for RZ/V2H(P) SoC

 Documentation/devicetree/bindings/timer/renesas,ostm.yaml | 2 ++
 drivers/clocksource/renesas-ostm.c                        | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] dt-bindings: timer: renesas: ostm: Document Renesas RZ/V2H(P) SoC
  2024-03-18 16:07 [PATCH 0/2] Add OSTM support for Renesas RZ/V2H(P) SoC Prabhakar
@ 2024-03-18 16:07 ` Prabhakar
  2024-03-19  8:27   ` Geert Uytterhoeven
  2024-03-19 17:46   ` Conor Dooley
  2024-03-18 16:07 ` [PATCH 2/2] clocksource/drivers/renesas-ostm: Add OSTM support for " Prabhakar
  1 sibling, 2 replies; 7+ messages in thread
From: Prabhakar @ 2024-03-18 16:07 UTC (permalink / raw)
  To: Geert Uytterhoeven, Daniel Lezcano, Thomas Gleixner, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Chris Brandt, Magnus Damm
  Cc: linux-kernel, devicetree, linux-arm-kernel, linux-renesas-soc,
	Prabhakar, Fabrizio Castro, Lad Prabhakar

From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Document the General Timer Module (a.k.a OSTM) block on Renesas RZ/V2H(P)
("R9A09G057") SoC, which is identical to the one found on the RZ/A1H and
RZ/G2L SoCs. Add the "renesas,r9a09g057-ostm" compatible string for the
RZ/V2H(P) SoC.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 Documentation/devicetree/bindings/timer/renesas,ostm.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/timer/renesas,ostm.yaml b/Documentation/devicetree/bindings/timer/renesas,ostm.yaml
index 8b06a681764e..e8c642166462 100644
--- a/Documentation/devicetree/bindings/timer/renesas,ostm.yaml
+++ b/Documentation/devicetree/bindings/timer/renesas,ostm.yaml
@@ -26,6 +26,7 @@ properties:
           - renesas,r9a07g043-ostm # RZ/G2UL and RZ/Five
           - renesas,r9a07g044-ostm # RZ/G2{L,LC}
           - renesas,r9a07g054-ostm # RZ/V2L
+          - renesas,r9a09g057-ostm # RZ/V2H(P)
       - const: renesas,ostm        # Generic
 
   reg:
@@ -58,6 +59,7 @@ if:
           - renesas,r9a07g043-ostm
           - renesas,r9a07g044-ostm
           - renesas,r9a07g054-ostm
+          - renesas,r9a09g057-ostm
 then:
   required:
     - resets
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] clocksource/drivers/renesas-ostm: Add OSTM support for RZ/V2H(P) SoC
  2024-03-18 16:07 [PATCH 0/2] Add OSTM support for Renesas RZ/V2H(P) SoC Prabhakar
  2024-03-18 16:07 ` [PATCH 1/2] dt-bindings: timer: renesas: ostm: Document " Prabhakar
@ 2024-03-18 16:07 ` Prabhakar
  2024-03-19  8:33   ` Geert Uytterhoeven
  1 sibling, 1 reply; 7+ messages in thread
From: Prabhakar @ 2024-03-18 16:07 UTC (permalink / raw)
  To: Geert Uytterhoeven, Daniel Lezcano, Thomas Gleixner, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Chris Brandt, Magnus Damm
  Cc: linux-kernel, devicetree, linux-arm-kernel, linux-renesas-soc,
	Prabhakar, Fabrizio Castro, Lad Prabhakar

From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

RZ/V2H(P) (R9A09G057) SoC has Generic Timer Module(a.k.a OSTM) which
needs to deassert the reset line before accessing any registers just
like the RZ/G2L SoC.

Enable the entry point for RZ/V2H(P) SoC so that we can deassert
the reset line in probe callback.

While at it use IS_ENABLED() macro instead of open coding.

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 8da972dc1713..b8b3c82b2528 100644
--- a/drivers/clocksource/renesas-ostm.c
+++ b/drivers/clocksource/renesas-ostm.c
@@ -224,7 +224,7 @@ static int __init ostm_init(struct device_node *np)
 
 TIMER_OF_DECLARE(ostm, "renesas,ostm", ostm_init);
 
-#ifdef CONFIG_ARCH_RZG2L
+#if IS_ENABLED(CONFIG_ARCH_RZG2L) || IS_ENABLED(CONFIG_ARCH_R9A09G057)
 static int __init ostm_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] dt-bindings: timer: renesas: ostm: Document Renesas RZ/V2H(P) SoC
  2024-03-18 16:07 ` [PATCH 1/2] dt-bindings: timer: renesas: ostm: Document " Prabhakar
@ 2024-03-19  8:27   ` Geert Uytterhoeven
  2024-03-19 17:46   ` Conor Dooley
  1 sibling, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-03-19  8:27 UTC (permalink / raw)
  To: Prabhakar
  Cc: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chris Brandt, Magnus Damm, linux-kernel, devicetree,
	linux-arm-kernel, linux-renesas-soc, Fabrizio Castro,
	Lad Prabhakar

On Mon, Mar 18, 2024 at 5:08 PM Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Document the General Timer Module (a.k.a OSTM) block on Renesas RZ/V2H(P)
> ("R9A09G057") SoC, which is identical to the one found on the RZ/A1H and
> RZ/G2L SoCs. Add the "renesas,r9a09g057-ostm" compatible string for the
> RZ/V2H(P) SoC.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

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

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] clocksource/drivers/renesas-ostm: Add OSTM support for RZ/V2H(P) SoC
  2024-03-18 16:07 ` [PATCH 2/2] clocksource/drivers/renesas-ostm: Add OSTM support for " Prabhakar
@ 2024-03-19  8:33   ` Geert Uytterhoeven
  2024-03-19  9:26     ` Lad, Prabhakar
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-03-19  8:33 UTC (permalink / raw)
  To: Prabhakar
  Cc: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chris Brandt, Magnus Damm, linux-kernel, devicetree,
	linux-arm-kernel, linux-renesas-soc, Fabrizio Castro,
	Lad Prabhakar

Hi Prabhakar,

Thanks for your patch!

On Mon, Mar 18, 2024 at 5:08 PM Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> RZ/V2H(P) (R9A09G057) SoC has Generic Timer Module(a.k.a OSTM) which
> needs to deassert the reset line before accessing any registers just
> like the RZ/G2L SoC.
>
> Enable the entry point for RZ/V2H(P) SoC so that we can deassert
> the reset line in probe callback.

This is not really what is happening.
As OSTM on RZ/V2H has a reset specified, the early call to ostm_init()
through TIMER_OF_DECLARE() always fails with -EPROBE_DEFER, as resets
are not available that early in the boot process.  Hence the driver
needs to be reprobed later through the platform driver probe.

> While at it use IS_ENABLED() macro instead of open coding.

I don't see how the code was open-coding IS_ENABLED()?

>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

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

I think you want to use "defined()" instead of "IS_ENABLED()"?

>  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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] clocksource/drivers/renesas-ostm: Add OSTM support for RZ/V2H(P) SoC
  2024-03-19  8:33   ` Geert Uytterhoeven
@ 2024-03-19  9:26     ` Lad, Prabhakar
  0 siblings, 0 replies; 7+ messages in thread
From: Lad, Prabhakar @ 2024-03-19  9:26 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chris Brandt, Magnus Damm, linux-kernel, devicetree,
	linux-arm-kernel, linux-renesas-soc, Fabrizio Castro,
	Lad Prabhakar

Hi Geert,

Thank you for the review.

On Tue, Mar 19, 2024 at 8:33 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Prabhakar,
>
> Thanks for your patch!
>
> On Mon, Mar 18, 2024 at 5:08 PM Prabhakar <prabhakar.csengg@gmail.com> wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> >
> > RZ/V2H(P) (R9A09G057) SoC has Generic Timer Module(a.k.a OSTM) which
> > needs to deassert the reset line before accessing any registers just
> > like the RZ/G2L SoC.
> >
> > Enable the entry point for RZ/V2H(P) SoC so that we can deassert
> > the reset line in probe callback.
>
> This is not really what is happening.
> As OSTM on RZ/V2H has a reset specified, the early call to ostm_init()
> through TIMER_OF_DECLARE() always fails with -EPROBE_DEFER, as resets
> are not available that early in the boot process.  Hence the driver
> needs to be reprobed later through the platform driver probe.
>
Thank you for clarification. Ill update the commit description as above.

> > While at it use IS_ENABLED() macro instead of open coding.
>
> I don't see how the code was open-coding IS_ENABLED()?
>
Ahh..

> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> > --- a/drivers/clocksource/renesas-ostm.c
> > +++ b/drivers/clocksource/renesas-ostm.c
> > @@ -224,7 +224,7 @@ static int __init ostm_init(struct device_node *np)
> >
> >  TIMER_OF_DECLARE(ostm, "renesas,ostm", ostm_init);
> >
> > -#ifdef CONFIG_ARCH_RZG2L
> > +#if IS_ENABLED(CONFIG_ARCH_RZG2L) || IS_ENABLED(CONFIG_ARCH_R9A09G057)
>
> I think you want to use "defined()" instead of "IS_ENABLED()"?
>
OK, I will use defined().

Cheers,
Prabhakar

> >  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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] dt-bindings: timer: renesas: ostm: Document Renesas RZ/V2H(P) SoC
  2024-03-18 16:07 ` [PATCH 1/2] dt-bindings: timer: renesas: ostm: Document " Prabhakar
  2024-03-19  8:27   ` Geert Uytterhoeven
@ 2024-03-19 17:46   ` Conor Dooley
  1 sibling, 0 replies; 7+ messages in thread
From: Conor Dooley @ 2024-03-19 17:46 UTC (permalink / raw)
  To: Prabhakar
  Cc: Geert Uytterhoeven, Daniel Lezcano, Thomas Gleixner, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Chris Brandt, Magnus Damm,
	linux-kernel, devicetree, linux-arm-kernel, linux-renesas-soc,
	Fabrizio Castro, Lad Prabhakar


[-- Attachment #1.1: Type: text/plain, Size: 508 bytes --]

On Mon, Mar 18, 2024 at 04:07:30PM +0000, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> 
> Document the General Timer Module (a.k.a OSTM) block on Renesas RZ/V2H(P)
> ("R9A09G057") SoC, which is identical to the one found on the RZ/A1H and
> RZ/G2L SoCs. Add the "renesas,r9a09g057-ostm" compatible string for the
> RZ/V2H(P) SoC.
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-19 17:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-18 16:07 [PATCH 0/2] Add OSTM support for Renesas RZ/V2H(P) SoC Prabhakar
2024-03-18 16:07 ` [PATCH 1/2] dt-bindings: timer: renesas: ostm: Document " Prabhakar
2024-03-19  8:27   ` Geert Uytterhoeven
2024-03-19 17:46   ` Conor Dooley
2024-03-18 16:07 ` [PATCH 2/2] clocksource/drivers/renesas-ostm: Add OSTM support for " Prabhakar
2024-03-19  8:33   ` Geert Uytterhoeven
2024-03-19  9:26     ` Lad, Prabhakar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox