diff mbox series

[2/3,can-next] can: rcar_can: Add RZ/G2 support

Message ID 1535029653-7418-3-git-send-email-fabrizio.castro@bp.renesas.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series Add CAN support to rcar_can driver | expand

Commit Message

Fabrizio Castro Aug. 23, 2018, 1:07 p.m. UTC
RZ/G2 devices don't have clkp2, therefore this commit adds a
generic compatible string for them to allow for proper checking
during probe.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Chris Paterson <Chris.Paterson2@renesas.com>
---

This patch applies on linux-can-next-for-4.19-20180727

 drivers/net/can/rcar/rcar_can.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Simon Horman Aug. 24, 2018, 9:16 a.m. UTC | #1
On Thu, Aug 23, 2018 at 02:07:32PM +0100, Fabrizio Castro wrote:
> RZ/G2 devices don't have clkp2, therefore this commit adds a
> generic compatible string for them to allow for proper checking
> during probe.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Chris Paterson <Chris.Paterson2@renesas.com>


Are we sure these clocks are for all RZ/G2 SoCs?

If so


Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


> ---
> 
> This patch applies on linux-can-next-for-4.19-20180727
> 
>  drivers/net/can/rcar/rcar_can.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c
> index fbd9284..397208e 100644
> --- a/drivers/net/can/rcar/rcar_can.c
> +++ b/drivers/net/can/rcar/rcar_can.c
> @@ -27,6 +27,7 @@
>  
>  #define RCAR_SUPPORTED_CLOCKS	(BIT(CLKR_CLKP1) | BIT(CLKR_CLKP2) | \
>  				 BIT(CLKR_CLKEXT))
> +#define RZG2_SUPPORTED_CLOCKS	(BIT(CLKR_CLKP1) | BIT(CLKR_CLKEXT))
>  
>  /* Mailbox configuration:
>   * mailbox 60 - 63 - Rx FIFO mailboxes
> @@ -933,6 +934,10 @@ static const struct of_device_id rcar_can_of_table[] __maybe_unused = {
>  		.compatible = "renesas,rcar-gen3-can",
>  		.data = (void *)RCAR_SUPPORTED_CLOCKS,
>  	},
> +	{
> +		.compatible = "renesas,rzg-gen2-can",
> +		.data = (void *)RZG2_SUPPORTED_CLOCKS,
> +	},
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, rcar_can_of_table);
> -- 
> 2.7.4
>
Fabrizio Castro Aug. 24, 2018, 9:22 a.m. UTC | #2
Hello Simon,

Thank you for your feedback!

> Subject: Re: [PATCH 2/3][can-next] can: rcar_can: Add RZ/G2 support
>
> On Thu, Aug 23, 2018 at 02:07:32PM +0100, Fabrizio Castro wrote:
> > RZ/G2 devices don't have clkp2, therefore this commit adds a
> > generic compatible string for them to allow for proper checking
> > during probe.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Chris Paterson <Chris.Paterson2@renesas.com>
>
>
> Are we sure these clocks are for all RZ/G2 SoCs?

Section 52.1.1 of the HW manual and Figure 52.1 state this.

Thanks,
Fab

>
> If so
>
>
> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
>
>
> > ---
> >
> > This patch applies on linux-can-next-for-4.19-20180727
> >
> >  drivers/net/can/rcar/rcar_can.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c
> > index fbd9284..397208e 100644
> > --- a/drivers/net/can/rcar/rcar_can.c
> > +++ b/drivers/net/can/rcar/rcar_can.c
> > @@ -27,6 +27,7 @@
> >
> >  #define RCAR_SUPPORTED_CLOCKS(BIT(CLKR_CLKP1) | BIT(CLKR_CLKP2) | \
> >   BIT(CLKR_CLKEXT))
> > +#define RZG2_SUPPORTED_CLOCKS(BIT(CLKR_CLKP1) | BIT(CLKR_CLKEXT))
> >
> >  /* Mailbox configuration:
> >   * mailbox 60 - 63 - Rx FIFO mailboxes
> > @@ -933,6 +934,10 @@ static const struct of_device_id rcar_can_of_table[] __maybe_unused = {
> >  .compatible = "renesas,rcar-gen3-can",
> >  .data = (void *)RCAR_SUPPORTED_CLOCKS,
> >  },
> > +{
> > +.compatible = "renesas,rzg-gen2-can",
> > +.data = (void *)RZG2_SUPPORTED_CLOCKS,
> > +},
> >  { }
> >  };
> >  MODULE_DEVICE_TABLE(of, rcar_can_of_table);
> > --
> > 2.7.4
> >



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
Geert Uytterhoeven Aug. 27, 2018, 12:30 p.m. UTC | #3
Hi Fabrizio,

(Usually the DT patch goes before the driver patch)

On Thu, Aug 23, 2018 at 3:08 PM Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> RZ/G2 devices don't have clkp2, therefore this commit adds a
> generic compatible string for them to allow for proper checking
> during probe.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Chris Paterson <Chris.Paterson2@renesas.com>

Thanks for your patch!

> --- a/drivers/net/can/rcar/rcar_can.c
> +++ b/drivers/net/can/rcar/rcar_can.c
> @@ -27,6 +27,7 @@
>
>  #define RCAR_SUPPORTED_CLOCKS  (BIT(CLKR_CLKP1) | BIT(CLKR_CLKP2) | \
>                                  BIT(CLKR_CLKEXT))
> +#define RZG2_SUPPORTED_CLOCKS  (BIT(CLKR_CLKP1) | BIT(CLKR_CLKEXT))
>
>  /* Mailbox configuration:
>   * mailbox 60 - 63 - Rx FIFO mailboxes
> @@ -933,6 +934,10 @@ static const struct of_device_id rcar_can_of_table[] __maybe_unused = {
>                 .compatible = "renesas,rcar-gen3-can",
>                 .data = (void *)RCAR_SUPPORTED_CLOCKS,
>         },
> +       {
> +               .compatible = "renesas,rzg-gen2-can",
> +               .data = (void *)RZG2_SUPPORTED_CLOCKS,
> +       },
>         { }

I think this patch is not needed, cfr. my reply to the
first^H^H^H^H^Hthird patch
in your series.

Gr{oetje,eeting}s,

                        Geert
Fabrizio Castro Sept. 10, 2018, 9:45 a.m. UTC | #4
Hello Geert,

Thank you for your feedback.

> Subject: Re: [PATCH 2/3][can-next] can: rcar_can: Add RZ/G2 support
>
> Hi Fabrizio,
>
> (Usually the DT patch goes before the driver patch)
>
> On Thu, Aug 23, 2018 at 3:08 PM Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > RZ/G2 devices don't have clkp2, therefore this commit adds a
> > generic compatible string for them to allow for proper checking
> > during probe.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Chris Paterson <Chris.Paterson2@renesas.com>
>
> Thanks for your patch!
>
> > --- a/drivers/net/can/rcar/rcar_can.c
> > +++ b/drivers/net/can/rcar/rcar_can.c
> > @@ -27,6 +27,7 @@
> >
> >  #define RCAR_SUPPORTED_CLOCKS  (BIT(CLKR_CLKP1) | BIT(CLKR_CLKP2) | \
> >                                  BIT(CLKR_CLKEXT))
> > +#define RZG2_SUPPORTED_CLOCKS  (BIT(CLKR_CLKP1) | BIT(CLKR_CLKEXT))
> >
> >  /* Mailbox configuration:
> >   * mailbox 60 - 63 - Rx FIFO mailboxes
> > @@ -933,6 +934,10 @@ static const struct of_device_id rcar_can_of_table[] __maybe_unused = {
> >                 .compatible = "renesas,rcar-gen3-can",
> >                 .data = (void *)RCAR_SUPPORTED_CLOCKS,
> >         },
> > +       {
> > +               .compatible = "renesas,rzg-gen2-can",
> > +               .data = (void *)RZG2_SUPPORTED_CLOCKS,
> > +       },
> >         { }
>
> I think this patch is not needed, cfr. my reply to the
> first^H^H^H^H^Hthird patch
> in your series.

I am dropping this patch.

Thanks,
Fab

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



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
diff mbox series

Patch

diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c
index fbd9284..397208e 100644
--- a/drivers/net/can/rcar/rcar_can.c
+++ b/drivers/net/can/rcar/rcar_can.c
@@ -27,6 +27,7 @@ 
 
 #define RCAR_SUPPORTED_CLOCKS	(BIT(CLKR_CLKP1) | BIT(CLKR_CLKP2) | \
 				 BIT(CLKR_CLKEXT))
+#define RZG2_SUPPORTED_CLOCKS	(BIT(CLKR_CLKP1) | BIT(CLKR_CLKEXT))
 
 /* Mailbox configuration:
  * mailbox 60 - 63 - Rx FIFO mailboxes
@@ -933,6 +934,10 @@  static const struct of_device_id rcar_can_of_table[] __maybe_unused = {
 		.compatible = "renesas,rcar-gen3-can",
 		.data = (void *)RCAR_SUPPORTED_CLOCKS,
 	},
+	{
+		.compatible = "renesas,rzg-gen2-can",
+		.data = (void *)RZG2_SUPPORTED_CLOCKS,
+	},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, rcar_can_of_table);