netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: Sergey Shtylyov <s.shtylyov@omp.ru>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Sergei Shtylyov <sergei.shtylyov@gmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Adam Ford <aford173@gmail.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-renesas-soc@vger.kernel.org" 
	<linux-renesas-soc@vger.kernel.org>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Biju Das <biju.das@bp.renesas.com>
Subject: RE: [RFC/PATCH 03/18] ravb: Initialize GbEthernet dmac
Date: Thu, 23 Sep 2021 18:42:00 +0000	[thread overview]
Message-ID: <OS0PR01MB5922B004290AC86D382069EA86A39@OS0PR01MB5922.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <40b51655-bd61-e1ab-5d9a-2448f39cd1a7@omp.ru>

Hi Sergei,

> Subject: Re: [RFC/PATCH 03/18] ravb: Initialize GbEthernet dmac
> 
> On 9/23/21 5:07 PM, Biju Das wrote:
> 
> > Initialize GbEthernet dmac found on RZ/G2L SoC.
> 
>    DMAC (or AVB-DMAC).

OK will change it to DMAC. AVB-DMAC is not applicable for GbEthernet.

> 
> > This patch also renames ravb_rcar_dmac_init to ravb_dmac_init_rcar to
> > be consistent with the naming convention used in sh_eth driver.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> >  drivers/net/ethernet/renesas/ravb.h      |  4 ++
> >  drivers/net/ethernet/renesas/ravb_main.c | 84
> > +++++++++++++++++++++++-
> >  2 files changed, 85 insertions(+), 3 deletions(-)
> 
> [...]
> > diff --git a/drivers/net/ethernet/renesas/ravb_main.c
> > b/drivers/net/ethernet/renesas/ravb_main.c
> > index 2422e74d9b4f..54c4d31a6950 100644
> > --- a/drivers/net/ethernet/renesas/ravb_main.c
> > +++ b/drivers/net/ethernet/renesas/ravb_main.c
> > @@ -83,6 +83,11 @@ static int ravb_config(struct net_device *ndev)
> >  	return error;
> >  }
> >
> > +static void ravb_rgeth_set_rate(struct net_device *ndev)
> 
>    What does 'rgeth' stand for? And why not the trailing part of the name,
> like the other cases?

'rgeth' stands for Renesas Gigabit Ethernet like 'ravb' renesas AVB.
OK it can be moved to trailing part.

> 
> > +{
> > +	/* Place holder */
> > +}
> > +
> >  static void ravb_set_rate(struct net_device *ndev)  {
> >  	struct ravb_private *priv = netdev_priv(ndev); @@ -217,6 +222,11 @@
> > static int ravb_tx_free(struct net_device *ndev, int q, bool
> free_txed_only)
> >  	return free_num;
> >  }
> >
> > +static void ravb_rx_ring_free_rgeth(struct net_device *ndev, int q)
> 
>    rgeth? 

Are you ok with this function name right? Since based on previous comment
to trailing part.

> 
> > +{
> > +	/* Place holder */
> > +}
> > +
> >  static void ravb_rx_ring_free(struct net_device *ndev, int q)  {
> >  	struct ravb_private *priv = netdev_priv(ndev); @@ -283,6 +293,11 @@
> > static void ravb_ring_free(struct net_device *ndev, int q)
> >  	priv->tx_skb[q] = NULL;
> >  }
> >
> > +static void ravb_rx_ring_format_rgeth(struct net_device *ndev, int q)
> 
>    rgeth?
Are you ok with this function name right? Since based on previous comment
to trailing part.

> 
> > +{
> > +	/* Place holder */
> > +}
> > +
> >  static void ravb_rx_ring_format(struct net_device *ndev, int q)  {
> >  	struct ravb_private *priv = netdev_priv(ndev); @@ -356,6 +371,12 @@
> > static void ravb_ring_format(struct net_device *ndev, int q)
> >  	desc->dptr = cpu_to_le32((u32)priv->tx_desc_dma[q]);
> >  }
> >
> > +static void *ravb_rgeth_alloc_rx_desc(struct net_device *ndev, int q)
> 
>    Again, why rgeth is not in the symbol's tail?

Ok will move to the tail.
> 
> > +{
> > +	/* Place holder */
> > +	return NULL;
> > +}
> > +
> >  static void *ravb_alloc_rx_desc(struct net_device *ndev, int q)  {
> >  	struct ravb_private *priv = netdev_priv(ndev); @@ -426,6 +447,11 @@
> > static int ravb_ring_init(struct net_device *ndev, int q)
> >  	return -ENOMEM;
> >  }
> >
> > +static void ravb_rgeth_emac_init(struct net_device *ndev)
> 
>    Same here...
OK will move to the tail.
> 
> > +{
> > +	/* Place holder */
> > +}
> > +
> >  static void ravb_rcar_emac_init(struct net_device *ndev)  {
> >  	/* Receive frame limit set register */ @@ -461,7 +487,32 @@ static
> > void ravb_emac_init(struct net_device *ndev)
> >  	info->emac_init(ndev);
> >  }
> >
> > -static void ravb_rcar_dmac_init(struct net_device *ndev)
> > +static void ravb_dmac_init_rgeth(struct net_device *ndev) {
> > +	/* Set AVB RX */
> > +	ravb_write(ndev, 0x60000000, RCR);
> > +
> > +	/* Set Max Frame Length (RTC) */
> > +	ravb_write(ndev, 0x7ffc0000 | RGETH_RX_BUFF_MAX, RTC);
> > +
> > +	/* Set FIFO size */
> > +	ravb_write(ndev, 0x00222200, TGC);
> > +
> > +	ravb_write(ndev, 0, TCCR);
> > +
> > +	/* Frame receive */
> > +	ravb_write(ndev, RIC0_FRE0, RIC0);
> > +	/* Disable FIFO full warning */
> > +	ravb_write(ndev, 0x0, RIC1);
> > +	/* Receive FIFO full error, descriptor empty */
> > +	ravb_write(ndev, RIC2_QFE0 | RIC2_RFFE, RIC2);
> > +
> > +	ravb_write(ndev, 0x0, RIC3);
> > +
> > +	ravb_write(ndev, TIC_FTE0, TIC);
> > +}
> 
>    Ah, so 'rgeth' stands for GbEthernet... why not 'gbeth' then?

'rgeth" is Renesas Gigabit ethernet. If needed I can change it to 'gbeth' if there is no 
Objection from others.

> 
> [...]
> > @@ -579,6 +630,14 @@ static void ravb_rx_csum(struct sk_buff *skb)
> >  	skb_trim(skb, skb->len - sizeof(__sum16));  }
> >
> > +/* Packet receive function for Gigabit Ethernet */ static bool
> > +ravb_rgeth_rx(struct net_device *ndev, int *quota, int q) {
> > +	/* Place holder */
> > +	return true;
> > +}
> > +
> > +/* Packet receive function for Ethernet AVB */
> >  static bool ravb_rcar_rx(struct net_device *ndev, int *quota, int q)
> > {
> >  	struct ravb_private *priv = netdev_priv(ndev); @@ -1918,6 +1977,13
> > @@ static void ravb_set_rx_csum(struct net_device *ndev, bool enable)
> >  	spin_unlock_irqrestore(&priv->lock, flags);  }
> >
> > +static int ravb_set_features_rgeth(struct net_device *ndev,
> > +				   netdev_features_t features)
> > +{
> > +	/* Place holder */
> > +	return 0;
> > +}
> > +
> >  static int ravb_set_features_rcar(struct net_device *ndev,
> >  				  netdev_features_t features)
> >  {
> > @@ -2007,7 +2073,7 @@ static const struct ravb_hw_info ravb_gen3_hw_info
> = {
> >  	.receive = ravb_rcar_rx,
> >  	.set_rate = ravb_set_rate,
> >  	.set_feature = ravb_set_features_rcar,
> > -	.dmac_init = ravb_rcar_dmac_init,
> > +	.dmac_init = ravb_dmac_init_rcar,
> >  	.emac_init = ravb_rcar_emac_init,
> >  	.gstrings_stats = ravb_gstrings_stats,
> >  	.gstrings_size = sizeof(ravb_gstrings_stats), @@ -2028,7 +2094,7 @@
> > static const struct ravb_hw_info ravb_gen2_hw_info = {
> >  	.receive = ravb_rcar_rx,
> >  	.set_rate = ravb_set_rate,
> >  	.set_feature = ravb_set_features_rcar,
> > -	.dmac_init = ravb_rcar_dmac_init,
> > +	.dmac_init = ravb_dmac_init_rcar,
> >  	.emac_init = ravb_rcar_emac_init,
> >  	.gstrings_stats = ravb_gstrings_stats,
> >  	.gstrings_size = sizeof(ravb_gstrings_stats), @@ -2039,12 +2105,24
> > @@ static const struct ravb_hw_info ravb_gen2_hw_info = {
> >  	.aligned_tx = 1,
> >  };
> >
> > +static const struct ravb_hw_info rgeth_hw_info = {
> > +	.rx_ring_free = ravb_rx_ring_free_rgeth,
> > +	.rx_ring_format = ravb_rx_ring_format_rgeth,
> > +	.alloc_rx_desc = ravb_rgeth_alloc_rx_desc,
> > +	.receive = ravb_rgeth_rx,
> > +	.set_rate = ravb_rgeth_set_rate,
> > +	.set_feature = ravb_set_features_rgeth,
> > +	.dmac_init = ravb_dmac_init_rgeth,
> > +	.emac_init = ravb_rgeth_emac_init,
> > +};
> > +>  static const struct of_device_id ravb_match_table[] = {
> >  	{ .compatible = "renesas,etheravb-r8a7790", .data =
> &ravb_gen2_hw_info },
> >  	{ .compatible = "renesas,etheravb-r8a7794", .data =
> &ravb_gen2_hw_info },
> >  	{ .compatible = "renesas,etheravb-rcar-gen2", .data =
> &ravb_gen2_hw_info },
> >  	{ .compatible = "renesas,etheravb-r8a7795", .data =
> &ravb_gen3_hw_info },
> >  	{ .compatible = "renesas,etheravb-rcar-gen3", .data =
> > &ravb_gen3_hw_info },
> > +	{ .compatible = "renesas,rzg2l-gbeth", .data = &rgeth_hw_info },
> 
>     Mhm, I thought this parch should come lst of the series, without any
> placeholders...

It is OK. 

Like you commented on https://patchwork.kernel.org/project/linux-renesas-soc/patch/20210923140813.13541-5-biju.das.jz@bp.renesas.com/, why there is a patch required for this feature bits?

Cheers,
Biju

> 
> [...]
> 
> MBR, Sergey

  reply	other threads:[~2021-09-23 18:42 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 14:07 [RFC/PATCH 00/18] Add Gigabit Ethernet driver support Biju Das
2021-09-23 14:07 ` [RFC/PATCH 01/18] ravb: Rename "ravb_set_features_rx_csum" function to "ravb_set_features_rcar" Biju Das
2021-09-27 19:54   ` Sergey Shtylyov
2021-09-23 14:07 ` [RFC/PATCH 02/18] ravb: Rename the variables "no_ptp_cfg_active" and "ptp_cfg_active" Biju Das
2021-09-23 16:07   ` Sergey Shtylyov
2021-09-23 16:35     ` Biju Das
2021-09-23 17:57       ` Sergey Shtylyov
2021-09-23 18:20         ` Biju Das
2021-09-26 13:34           ` Biju Das
2021-09-23 14:07 ` [RFC/PATCH 03/18] ravb: Initialize GbEthernet dmac Biju Das
2021-09-23 17:41   ` Sergey Shtylyov
2021-09-23 18:42     ` Biju Das [this message]
2021-09-23 19:07   ` Sergey Shtylyov
2021-09-23 19:22     ` Biju Das
2021-09-23 19:29       ` Biju Das
2021-09-26 13:38         ` Biju Das
2021-09-23 14:07 ` [RFC/PATCH 04/18] ravb: Enable aligned_tx and tx_counters for RZ/G2L Biju Das
2021-09-23 18:05   ` Sergey Shtylyov
2021-09-23 18:10     ` Sergey Shtylyov
2021-09-23 18:13     ` Biju Das
2021-09-26 13:40       ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 05/18] ravb: Exclude gPTP feature support " Biju Das
2021-09-23 19:00   ` Sergey Shtylyov
2021-09-23 19:13     ` Biju Das
2021-09-23 19:41       ` Sergey Shtylyov
2021-09-23 19:45         ` Biju Das
2021-09-26 13:48           ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 06/18] ravb: Add multi_tsrq to struct ravb_hw_info Biju Das
2021-09-23 20:19   ` Sergey Shtylyov
2021-09-24  6:19     ` Biju Das
2021-09-26 13:54       ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 07/18] ravb: Add magic_pkt " Biju Das
2021-09-23 20:42   ` Sergey Shtylyov
2021-09-24  6:24     ` Biju Das
2021-09-26 13:56       ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 08/18] ravb: Add mii_rgmii_selection " Biju Das
2021-09-24 19:49   ` Sergey Shtylyov
2021-09-25  6:23     ` Biju Das
2021-09-26 15:49       ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 09/18] ravb: Add half_duplex " Biju Das
2021-09-24 20:07   ` Sergey Shtylyov
2021-09-25  6:37     ` Biju Das
2021-09-26 15:51     ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 10/18] ravb: Initialize GbEthernet E-MAC Biju Das
2021-09-24 20:44   ` Sergey Shtylyov
2021-09-25  6:38     ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 11/18] ravb: Add rx_2k_buffers to struct ravb_hw_info Biju Das
2021-09-24 19:35   ` Sergey Shtylyov
2021-09-26 15:48     ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 12/18] ravb: Add timestamp " Biju Das
2021-09-25 20:52   ` Sergey Shtylyov
2021-09-26  6:34     ` Biju Das
2021-09-26 16:52       ` Biju Das
2021-09-26 20:45       ` Sergey Shtylyov
2021-09-26 20:48         ` Sergei Shtylyov
2021-09-27  6:10           ` Biju Das
2021-09-27  6:04         ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 13/18] ravb: Add rx_ring_free function support for GbEthernet Biju Das
2021-09-27 19:28   ` Sergey Shtylyov
2021-09-28  9:24     ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 14/18] ravb: Add rx_ring_format function " Biju Das
2021-09-27 20:32   ` Sergey Shtylyov
2021-09-29  7:49     ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 15/18] ravb: Add rx_alloc helper " Biju Das
2021-09-23 14:08 ` [RFC/PATCH 16/18] ravb: Add Packet receive function for Gigabit Ethernet Biju Das
2021-10-01 17:27   ` Sergey Shtylyov
2021-10-04 14:56     ` Biju Das
2021-09-23 14:08 ` [RFC/PATCH 17/18] ravb: Add carrier_counters to struct ravb_hw_info Biju Das
2021-09-28 20:50   ` Sergey Shtylyov
2021-09-23 14:08 ` [RFC/PATCH 18/18] ravb: Add set_feature support for RZ/G2L Biju Das
2021-09-30 20:39   ` Sergey Shtylyov
2021-10-01  6:53     ` Biju Das
2021-10-01  9:13       ` Sergey Shtylyov
2021-10-01  9:26         ` Biju Das
2021-10-01  8:22     ` Biju Das
2021-09-23 15:11 ` [RFC/PATCH 00/18] Add Gigabit Ethernet driver support Sergey Shtylyov
2021-09-23 15:13   ` Sergey Shtylyov
2021-09-23 15:37   ` Jakub Kicinski
2021-09-23 17:43     ` Sergey Shtylyov

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=OS0PR01MB5922B004290AC86D382069EA86A39@OS0PR01MB5922.jpnprd01.prod.outlook.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=Chris.Paterson2@renesas.com \
    --cc=aford173@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=biju.das@bp.renesas.com \
    --cc=davem@davemloft.net \
    --cc=geert+renesas@glider.be \
    --cc=kuba@kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=s.shtylyov@omp.ru \
    --cc=sergei.shtylyov@gmail.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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;
as well as URLs for NNTP newsgroup(s).