mbox series

[net-next,00/18] Add Gigabit Ethernet driver support

Message ID 20210722141351.13668-1-biju.das.jz@bp.renesas.com (mailing list archive)
Headers show
Series Add Gigabit Ethernet driver support | expand

Message

Biju Das July 22, 2021, 2:13 p.m. UTC
The DMAC and EMAC blocks of Gigabit Ethernet IP is almost similar to Ethernet AVB.

The Gigabit Etherner IP consists of Ethernet controller (E-MAC), Internal TCP/IP Offload Engine (TOE) and Dedicated Direct memory access controller (DMAC).

With few changes in driver, we can support Gigabit ethernet driver as well.

This patch series is aims to support the same

RFC->V1
  * Incorporated feedback from Andrew, Sergei, Geert and Prabhakar
  * https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=515525

Biju Das (18):
  dt-bindings: net: renesas,etheravb: Document Gigabit Ethernet IP
  drivers: clk: renesas: rzg2l-cpg: Add support to handle MUX clocks
  drivers: clk: renesas: r9a07g044-cpg: Add ethernet clock sources
  drivers: clk: renesas: r9a07g044-cpg: Add GbEthernet clock/reset
  ravb: Replace chip type with a structure for driver data
  ravb: Factorise ptp feature
  ravb: Add features specific to R-Car Gen3
  ravb: Add R-Car common features
  ravb: Factorise ravb_ring_free function
  ravb: Factorise ravb_ring_format function
  ravb: Factorise ravb_ring_init function
  ravb: Factorise {emac,dmac} init function
  ravb: Factorise ravb_rx function
  ravb: Factorise ravb_adjust_link function
  ravb: Factorise ravb_set_features
  ravb: Add reset support
  ravb: Add GbEthernet driver support
  arm64: dts: renesas: r9a07g044: Add GbEther nodes

 .../bindings/net/renesas,etheravb.yaml        |  57 +-
 arch/arm64/boot/dts/renesas/r9a07g044.dtsi    |  42 +
 drivers/clk/renesas/r9a07g044-cpg.c           |  27 +
 drivers/clk/renesas/rzg2l-cpg.c               |  24 +
 drivers/clk/renesas/rzg2l-cpg.h               |  15 +
 drivers/net/ethernet/renesas/ravb.h           | 112 ++-
 drivers/net/ethernet/renesas/ravb_main.c      | 922 +++++++++++++++---
 7 files changed, 1031 insertions(+), 168 deletions(-)

Comments

Sergey Shtylyov July 22, 2021, 8:53 p.m. UTC | #1
On 7/22/21 5:13 PM, Biju Das wrote:

> The DMAC and EMAC blocks of Gigabit Ethernet IP is almost similar to Ethernet AVB.
> 
> The Gigabit Etherner IP consists of Ethernet controller (E-MAC), Internal TCP/IP Offload Engine (TOE) and Dedicated Direct memory access controller (DMAC).
> 
> With few changes in driver, we can support Gigabit ethernet driver as well.
> 
> This patch series is aims to support the same
> 
> RFC->V1
>   * Incorporated feedback from Andrew, Sergei, Geert and Prabhakar
>   * https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=515525
> 
> Biju Das (18):
>   dt-bindings: net: renesas,etheravb: Document Gigabit Ethernet IP
>   drivers: clk: renesas: rzg2l-cpg: Add support to handle MUX clocks
>   drivers: clk: renesas: r9a07g044-cpg: Add ethernet clock sources
>   drivers: clk: renesas: r9a07g044-cpg: Add GbEthernet clock/reset


   It's not a good idea to have the patch to the defferent subsystems lumped
all together in a single series...

>   ravb: Replace chip type with a structure for driver data

   I was expecting some real changes on how the gen2/3 diff. features in this patch,
but I only saw new info having no real changes where they were needed and having the
changes that did not need to be converted yet...
   Anwyay, I have stopped here for today.

>   ravb: Factorise ptp feature
>   ravb: Add features specific to R-Car Gen3
>   ravb: Add R-Car common features
>   ravb: Factorise ravb_ring_free function
>   ravb: Factorise ravb_ring_format function
>   ravb: Factorise ravb_ring_init function
>   ravb: Factorise {emac,dmac} init function
>   ravb: Factorise ravb_rx function
>   ravb: Factorise ravb_adjust_link function
>   ravb: Factorise ravb_set_features
>   ravb: Add reset support
>   ravb: Add GbEthernet driver support
>   arm64: dts: renesas: r9a07g044: Add GbEther nodes
> 
[...]

MBR, Sergei
Andrew Lunn July 22, 2021, 9:07 p.m. UTC | #2
On Thu, Jul 22, 2021 at 11:53:59PM +0300, Sergei Shtylyov wrote:
> On 7/22/21 5:13 PM, Biju Das wrote:
> 
> > The DMAC and EMAC blocks of Gigabit Ethernet IP is almost similar to Ethernet AVB.
> > 
> > The Gigabit Etherner IP consists of Ethernet controller (E-MAC), Internal TCP/IP Offload Engine (TOE) and Dedicated Direct memory access controller (DMAC).
> > 
> > With few changes in driver, we can support Gigabit ethernet driver as well.
> > 
> > This patch series is aims to support the same
> > 
> > RFC->V1
> >   * Incorporated feedback from Andrew, Sergei, Geert and Prabhakar
> >   * https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=515525
> > 
> > Biju Das (18):
> >   dt-bindings: net: renesas,etheravb: Document Gigabit Ethernet IP
> >   drivers: clk: renesas: rzg2l-cpg: Add support to handle MUX clocks
> >   drivers: clk: renesas: r9a07g044-cpg: Add ethernet clock sources
> >   drivers: clk: renesas: r9a07g044-cpg: Add GbEthernet clock/reset
> 
> 
>    It's not a good idea to have the patch to the defferent subsystems lumped
> all together in a single series...

Agreed.

Are these changes inseparable? If so, you need to be up front on this,
and you need an agreement with the subsystem maintainers how the
patches are going to be merged? Through which tree. And you need
Acked-by from the other tree maintainers.

Ideally you submit multiple patchsets. This assumes all sets will
compile independently.

	Andrew
Biju Das July 23, 2021, 6:23 a.m. UTC | #3
Hi Sergei,

Thanks for the feedback.

> Subject: Re: [PATCH net-next 00/18] Add Gigabit Ethernet driver support
> 
> On 7/22/21 5:13 PM, Biju Das wrote:
> 
> > The DMAC and EMAC blocks of Gigabit Ethernet IP is almost similar to
> Ethernet AVB.
> >
> > The Gigabit Etherner IP consists of Ethernet controller (E-MAC),
> Internal TCP/IP Offload Engine (TOE) and Dedicated Direct memory access
> controller (DMAC).
> >
> > With few changes in driver, we can support Gigabit ethernet driver as
> well.
> >
> > This patch series is aims to support the same
> >
> > RFC->V1
> >   * Incorporated feedback from Andrew, Sergei, Geert and Prabhakar
> >   *
> > https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
> > hwork.kernel.org%2Fproject%2Flinux-renesas-soc%2Flist%2F%3Fseries%3D51
> > 5525&data=04%7C01%7Cbiju.das.jz%40bp.renesas.com%7Cb01d51eb4442476
> > 149d608d94d52d7c9%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%7C6376258
> > 40484693261%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMz
> > IiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=M6biLbregS1y2R%2BMNb
> > b5PRRvgQxympZfHZkbuH0ZrXI%3D&reserved=0
> >
> > Biju Das (18):
> >   dt-bindings: net: renesas,etheravb: Document Gigabit Ethernet IP
> >   drivers: clk: renesas: rzg2l-cpg: Add support to handle MUX clocks
> >   drivers: clk: renesas: r9a07g044-cpg: Add ethernet clock sources
> >   drivers: clk: renesas: r9a07g044-cpg: Add GbEthernet clock/reset
> 
> 
>    It's not a good idea to have the patch to the defferent subsystems
> lumped all together in a single series...
> 
> >   ravb: Replace chip type with a structure for driver data
> 
>    I was expecting some real changes on how the gen2/3 diff. features in
> this patch, but I only saw new info having no real changes where they were
> needed and having the changes that did not need to be converted yet...
>    Anwyay, I have stopped here for today.

This patch is a preparation patch. On the subsequent patches[1] [2] and [3] you will see the real hw changes wr.to gen2/gen3. Feature bit is not added in this patch, but on the subsequent patches. I believe you haven't reviewed that patches yet.

PTP feature and the diff between gen2/gen3
------------------------------------------
[1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20210722141351.13668-7-biju.das.jz@bp.renesas.com/


Features specific to R-Car Gen3
--------------------------------
[2] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20210722141351.13668-8-biju.das.jz@bp.renesas.com/


R-Car common features
---------------------

[3] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20210722141351.13668-9-biju.das.jz@bp.renesas.com/

There is a review comment for making smaller changes. 
what do you recommend after going through [1],[2] and [3]. 
Please let us know.

Regards,
Biju


> 
> >   ravb: Factorise ptp feature
> >   ravb: Add features specific to R-Car Gen3
> >   ravb: Add R-Car common features
> >   ravb: Factorise ravb_ring_free function
> >   ravb: Factorise ravb_ring_format function
> >   ravb: Factorise ravb_ring_init function
> >   ravb: Factorise {emac,dmac} init function
> >   ravb: Factorise ravb_rx function
> >   ravb: Factorise ravb_adjust_link function
> >   ravb: Factorise ravb_set_features
> >   ravb: Add reset support
> >   ravb: Add GbEthernet driver support
> >   arm64: dts: renesas: r9a07g044: Add GbEther nodes
> >
> [...]
> 
> MBR, Sergei
Biju Das July 23, 2021, 6:28 a.m. UTC | #4
Hi Andrew and Sergei,


> Subject: Re: [PATCH net-next 00/18] Add Gigabit Ethernet driver support
> 
> On Thu, Jul 22, 2021 at 11:53:59PM +0300, Sergei Shtylyov wrote:
> > On 7/22/21 5:13 PM, Biju Das wrote:
> >
> > > The DMAC and EMAC blocks of Gigabit Ethernet IP is almost similar to
> Ethernet AVB.
> > >
> > > The Gigabit Etherner IP consists of Ethernet controller (E-MAC),
> Internal TCP/IP Offload Engine (TOE) and Dedicated Direct memory access
> controller (DMAC).
> > >
> > > With few changes in driver, we can support Gigabit ethernet driver as
> well.
> > >
> > > This patch series is aims to support the same
> > >
> > > RFC->V1
> > >   * Incorporated feedback from Andrew, Sergei, Geert and Prabhakar
> > >   *
> > > https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpa
> > > tchwork.kernel.org%2Fproject%2Flinux-renesas-soc%2Flist%2F%3Fseries%
> > > 3D515525&data=04%7C01%7Cbiju.das.jz%40bp.renesas.com%7C6fe3922cc
> > > 35d4178cb1d08d94d54bc75%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%7
> > > C637625848601442706%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > > IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=bOpIqV1g
> > > lMUXqz9rsX0UK3Oqap2J1cY86TGVOJvzYe4%3D&reserved=0
> > >
> > > Biju Das (18):
> > >   dt-bindings: net: renesas,etheravb: Document Gigabit Ethernet IP
> > >   drivers: clk: renesas: rzg2l-cpg: Add support to handle MUX clocks
> > >   drivers: clk: renesas: r9a07g044-cpg: Add ethernet clock sources
> > >   drivers: clk: renesas: r9a07g044-cpg: Add GbEthernet clock/reset
> >
> >
> >    It's not a good idea to have the patch to the defferent subsystems
> > lumped all together in a single series...
> 
> Agreed.
> 
> Are these changes inseparable? If so, you need to be up front on this, and
> you need an agreement with the subsystem maintainers how the patches are
> going to be merged? Through which tree. And you need Acked-by from the
> other tree maintainers.
> 
> Ideally you submit multiple patchsets. This assumes all sets will compile
> independently.

Agreed. Will split this patch series in 3 patchsets

1) single binding patch 

2) Clock patchset

3) ravb driver patchset.

Cheers,
Biju
Geert Uytterhoeven July 26, 2021, 10:55 a.m. UTC | #5
Hi Biju,

On Fri, Jul 23, 2021 at 8:28 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > Subject: Re: [PATCH net-next 00/18] Add Gigabit Ethernet driver support
> >
> > On Thu, Jul 22, 2021 at 11:53:59PM +0300, Sergei Shtylyov wrote:
> > > On 7/22/21 5:13 PM, Biju Das wrote:
> > >
> > > > The DMAC and EMAC blocks of Gigabit Ethernet IP is almost similar to
> > Ethernet AVB.
> > > >
> > > > The Gigabit Etherner IP consists of Ethernet controller (E-MAC),
> > Internal TCP/IP Offload Engine (TOE) and Dedicated Direct memory access
> > controller (DMAC).
> > > >
> > > > With few changes in driver, we can support Gigabit ethernet driver as
> > well.
> > > >
> > > > This patch series is aims to support the same
> > > >
> > > > RFC->V1
> > > >   * Incorporated feedback from Andrew, Sergei, Geert and Prabhakar
> > > >   *
> > > > https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpa
> > > > tchwork.kernel.org%2Fproject%2Flinux-renesas-soc%2Flist%2F%3Fseries%
> > > > 3D515525&amp;data=04%7C01%7Cbiju.das.jz%40bp.renesas.com%7C6fe3922cc
> > > > 35d4178cb1d08d94d54bc75%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%7
> > > > C637625848601442706%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > > > IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=bOpIqV1g
> > > > lMUXqz9rsX0UK3Oqap2J1cY86TGVOJvzYe4%3D&amp;reserved=0
> > > >
> > > > Biju Das (18):
> > > >   dt-bindings: net: renesas,etheravb: Document Gigabit Ethernet IP
> > > >   drivers: clk: renesas: rzg2l-cpg: Add support to handle MUX clocks
> > > >   drivers: clk: renesas: r9a07g044-cpg: Add ethernet clock sources
> > > >   drivers: clk: renesas: r9a07g044-cpg: Add GbEthernet clock/reset
> > >
> > >
> > >    It's not a good idea to have the patch to the defferent subsystems
> > > lumped all together in a single series...
> >
> > Agreed.
> >
> > Are these changes inseparable? If so, you need to be up front on this, and
> > you need an agreement with the subsystem maintainers how the patches are
> > going to be merged? Through which tree. And you need Acked-by from the
> > other tree maintainers.
> >
> > Ideally you submit multiple patchsets. This assumes all sets will compile
> > independently.
>
> Agreed. Will split this patch series in 3 patchsets
>
> 1) single binding patch
>
> 2) Clock patchset
>
> 3) ravb driver patchset.

4) dts part.

Part 2 should pass through renesas-clk.
Part 4 should pass through renesas-devel.

Gr{oetje,eeting}s,

                        Geert
Arnd Bergmann July 26, 2021, 1:49 p.m. UTC | #6
On Mon, Jul 26, 2021 at 12:56 PM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Fri, Jul 23, 2021 at 8:28 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > >
> > > Are these changes inseparable? If so, you need to be up front on this, and
> > > you need an agreement with the subsystem maintainers how the patches are
> > > going to be merged? Through which tree. And you need Acked-by from the
> > > other tree maintainers.
> > >
> > > Ideally you submit multiple patchsets. This assumes all sets will compile
> > > independently.
> >
> > Agreed. Will split this patch series in 3 patchsets
> >
> > 1) single binding patch
> >
> > 2) Clock patchset
> >
> > 3) ravb driver patchset.
>
> 4) dts part.
>
> Part 2 should pass through renesas-clk.
> Part 4 should pass through renesas-devel.

Sounds good. To clarify: the changes should not just compile, but
each branch should be usable independently with no loss of
functionality. Using the feature depends on having all branches
merged, but they should not introduced regressions when applied
into some other tree.

I hope this was already obvious to everyone involved.

       Arnd