netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2 v4 net-next repost] sh_eth: Add support for r8a7790 SoC
@ 2013-07-23  1:18 Simon Horman
  2013-07-23  1:18 ` [PATCH v4 net-next repost 1/2] sh_eth: add support for RMIIMODE register Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Simon Horman @ 2013-07-23  1:18 UTC (permalink / raw)
  To: netdev, linux-sh; +Cc: Magnus Damm, Sergei Shtylyov, Simon Horman

[ Repost with v4 and net-next tags in subject ]

Hi,

this short series enhances the sh_eth driver for use with the r8a7790 SoC.

Changes since v3:

* Removed "sh_eth: add support for gpio reset" as it appears unnecessary
  and I am not entirely confident is is correct.
* Updated "sh_eth: Add support for r8a7790 SoC" to
  refer to R8A777x intead of R8A7779.

Simon Horman (2):
  sh_eth: add support for RMIIMODE register
  sh_eth: Add support for r8a7790 SoC

 drivers/net/ethernet/renesas/Kconfig  |  2 +-
 drivers/net/ethernet/renesas/sh_eth.c | 25 +++++++++++++++++++++++++
 drivers/net/ethernet/renesas/sh_eth.h |  2 ++
 3 files changed, 28 insertions(+), 1 deletion(-)

-- 
1.8.2.1


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

* [PATCH v4 net-next repost 1/2] sh_eth: add support for RMIIMODE register
  2013-07-23  1:18 [PATCH 0/2 v4 net-next repost] sh_eth: Add support for r8a7790 SoC Simon Horman
@ 2013-07-23  1:18 ` Simon Horman
  2013-07-23  1:18 ` [PATCH v4 net-next repost 2/2] sh_eth: Add support for r8a7790 SoC Simon Horman
  2013-07-24 22:39 ` [PATCH 0/2 v4 net-next repost] " David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2013-07-23  1:18 UTC (permalink / raw)
  To: netdev, linux-sh; +Cc: Magnus Damm, Sergei Shtylyov, Simon Horman

This register is prsent on the r8a7790 SoC.

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

--

v4
* Update changelog.

v3
* The subsequent patch to add r8a7790 support has been reworked.
  To reflect this do not add set the rmmimode bit of any
  currently available struct sh_eth_cpu_data. A new one
  will be added for r8a7790 and the bit will be set when
  it is added.

v2
* Split from patch to add r8a7790 support to driver (ifdef nastiness)
* As suggested by Sergei Shtylyov
  - Add a field to struct sh_eth_cpu_data to indicate if the
    rmiimode register is present. This replaces an extremely ugly ifdef.
---
 drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
 drivers/net/ethernet/renesas/sh_eth.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index a753928..87af49f 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -189,6 +189,7 @@ static const u16 sh_eth_offset_fast_rcar[SH_ETH_MAX_REGISTER_OFFSET] = {
 	[RMCR]		= 0x0258,
 	[TFUCR]		= 0x0264,
 	[RFOCR]		= 0x0268,
+	[RMIIMODE]      = 0x026c,
 	[FCFTR]		= 0x0270,
 	[TRIMD]		= 0x027c,
 };
@@ -1124,6 +1125,9 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
 	if (ret)
 		goto out;
 
+	if (mdp->cd->rmiimode)
+		sh_eth_write(ndev, 0x1, RMIIMODE);
+
 	/* Descriptor format */
 	sh_eth_ring_format(ndev);
 	if (mdp->cd->rpadir)
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index 99995bf..da93f5c 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -60,6 +60,7 @@ enum {
 	EDOCR,
 	TFUCR,
 	RFOCR,
+	RMIIMODE,
 	FCFTR,
 	RPADIR,
 	TRIMD,
@@ -482,6 +483,7 @@ struct sh_eth_cpu_data {
 	unsigned hw_crc:1;	/* E-DMAC have CSMR */
 	unsigned select_mii:1;	/* EtherC have RMII_MII (MII select register) */
 	unsigned shift_rd0:1;	/* shift Rx descriptor word 0 right by 16 */
+	unsigned rmiimode:1;	/* EtherC has RMIIMODE register */
 };
 
 struct sh_eth_private {
-- 
1.8.2.1


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

* [PATCH v4 net-next repost 2/2] sh_eth: Add support for r8a7790 SoC
  2013-07-23  1:18 [PATCH 0/2 v4 net-next repost] sh_eth: Add support for r8a7790 SoC Simon Horman
  2013-07-23  1:18 ` [PATCH v4 net-next repost 1/2] sh_eth: add support for RMIIMODE register Simon Horman
@ 2013-07-23  1:18 ` Simon Horman
  2013-07-29 23:32   ` Laurent Pinchart
  2013-07-24 22:39 ` [PATCH 0/2 v4 net-next repost] " David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2013-07-23  1:18 UTC (permalink / raw)
  To: netdev, linux-sh; +Cc: Magnus Damm, Sergei Shtylyov, Simon Horman

This is a copy of support for r8a7778/9 with the .rmiimode mode bit
of struct sh_eth_cpu_data set.

Also update R8A7779 to R8A777x.

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

---

v4
* s/R8A7779/R8A777x/ as requested by Sergei Shtylyov.

v3
* Add r8a7790_data rather than updating r8a777x_data.
  As requested by Sergei Shtylyov.

v2
* Split from "sh_eth: add support RMIIMODE register"
---
 drivers/net/ethernet/renesas/Kconfig  |  2 +-
 drivers/net/ethernet/renesas/sh_eth.c | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
index 19a8a04..a30c439 100644
--- a/drivers/net/ethernet/renesas/Kconfig
+++ b/drivers/net/ethernet/renesas/Kconfig
@@ -13,4 +13,4 @@ config SH_ETH
 	  Renesas SuperH Ethernet device driver.
 	  This driver supporting CPUs are:
 		- SH7619, SH7710, SH7712, SH7724, SH7734, SH7763, SH7757,
-		  R8A7740 and R8A7779.
+		  R8A7740, R8A777x and R8A7790.
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 87af49f..fedc0a0 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -393,6 +393,26 @@ static struct sh_eth_cpu_data r8a777x_data = {
 	.hw_swap	= 1,
 };
 
+/* R8A7790 */
+static struct sh_eth_cpu_data r8a7790_data = {
+	.set_duplex	= sh_eth_set_duplex,
+	.set_rate	= sh_eth_set_rate_r8a777x,
+
+	.ecsr_value	= ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD,
+	.ecsipr_value	= ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP,
+	.eesipr_value	= 0x01ff009f,
+
+	.tx_check	= EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | EESR_RTO,
+	.eesr_err_check	= EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE |
+			  EESR_RFRMER | EESR_TFE | EESR_TDE | EESR_ECI,
+
+	.apr		= 1,
+	.mpr		= 1,
+	.tpauser	= 1,
+	.hw_swap	= 1,
+	.rmiimode	= 1,
+};
+
 static void sh_eth_set_rate_sh7724(struct net_device *ndev)
 {
 	struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -2753,6 +2773,7 @@ static struct platform_device_id sh_eth_id_table[] = {
 	{ "sh7763-gether", (kernel_ulong_t)&sh7763_data },
 	{ "r8a7740-gether", (kernel_ulong_t)&r8a7740_data },
 	{ "r8a777x-ether", (kernel_ulong_t)&r8a777x_data },
+	{ "r8a7790-ether", (kernel_ulong_t)&r8a7790_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, sh_eth_id_table);
-- 
1.8.2.1


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

* Re: [PATCH 0/2 v4 net-next repost] sh_eth: Add support for r8a7790 SoC
  2013-07-23  1:18 [PATCH 0/2 v4 net-next repost] sh_eth: Add support for r8a7790 SoC Simon Horman
  2013-07-23  1:18 ` [PATCH v4 net-next repost 1/2] sh_eth: add support for RMIIMODE register Simon Horman
  2013-07-23  1:18 ` [PATCH v4 net-next repost 2/2] sh_eth: Add support for r8a7790 SoC Simon Horman
@ 2013-07-24 22:39 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-07-24 22:39 UTC (permalink / raw)
  To: horms+renesas; +Cc: netdev, linux-sh, magnus.damm, sergei.shtylyov

From: Simon Horman <horms+renesas@verge.net.au>
Date: Tue, 23 Jul 2013 10:18:03 +0900

> this short series enhances the sh_eth driver for use with the r8a7790 SoC.

Applied, thanks Simon.

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

* Re: [PATCH v4 net-next repost 2/2] sh_eth: Add support for r8a7790 SoC
  2013-07-23  1:18 ` [PATCH v4 net-next repost 2/2] sh_eth: Add support for r8a7790 SoC Simon Horman
@ 2013-07-29 23:32   ` Laurent Pinchart
  2013-07-29 23:59     ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Laurent Pinchart @ 2013-07-29 23:32 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev, linux-sh, Magnus Damm, Sergei Shtylyov

Hi Simon,

On Tuesday 23 July 2013 10:18:05 Simon Horman wrote:
> This is a copy of support for r8a7778/9 with the .rmiimode mode bit
> of struct sh_eth_cpu_data set.
> 
> Also update R8A7779 to R8A777x.
> 
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> 
> ---
> 
> v4
> * s/R8A7779/R8A777x/ as requested by Sergei Shtylyov.
> 
> v3
> * Add r8a7790_data rather than updating r8a777x_data.
>   As requested by Sergei Shtylyov.
> 
> v2
> * Split from "sh_eth: add support RMIIMODE register"
> ---
>  drivers/net/ethernet/renesas/Kconfig  |  2 +-
>  drivers/net/ethernet/renesas/sh_eth.c | 21 +++++++++++++++++++++
>  2 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/renesas/Kconfig
> b/drivers/net/ethernet/renesas/Kconfig index 19a8a04..a30c439 100644
> --- a/drivers/net/ethernet/renesas/Kconfig
> +++ b/drivers/net/ethernet/renesas/Kconfig
> @@ -13,4 +13,4 @@ config SH_ETH
>  	  Renesas SuperH Ethernet device driver.
>  	  This driver supporting CPUs are:
>  		- SH7619, SH7710, SH7712, SH7724, SH7734, SH7763, SH7757,
> -		  R8A7740 and R8A7779.
> +		  R8A7740, R8A777x and R8A7790.
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c
> b/drivers/net/ethernet/renesas/sh_eth.c index 87af49f..fedc0a0 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -393,6 +393,26 @@ static struct sh_eth_cpu_data r8a777x_data = {
>  	.hw_swap	= 1,
>  };
> 
> +/* R8A7790 */
> +static struct sh_eth_cpu_data r8a7790_data = {
> +	.set_duplex	= sh_eth_set_duplex,
> +	.set_rate	= sh_eth_set_rate_r8a777x,
> +
> +	.ecsr_value	= ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD,
> +	.ecsipr_value	= ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP,
> +	.eesipr_value	= 0x01ff009f,
> +
> +	.tx_check	= EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | EESR_RTO,
> +	.eesr_err_check	= EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE |
> +			  EESR_RFRMER | EESR_TFE | EESR_TDE | EESR_ECI,

Is there a reason why the EESR_RFE bit isn't set in eesr_err_check (and thus 
ignored in the interrupt handler) but set in eesipr_value ?

If it's just an omission I'll send a patch.

> +
> +	.apr		= 1,
> +	.mpr		= 1,
> +	.tpauser	= 1,
> +	.hw_swap	= 1,
> +	.rmiimode	= 1,
> +};
> +
>  static void sh_eth_set_rate_sh7724(struct net_device *ndev)
>  {
>  	struct sh_eth_private *mdp = netdev_priv(ndev);
> @@ -2753,6 +2773,7 @@ static struct platform_device_id sh_eth_id_table[] = {
> { "sh7763-gether", (kernel_ulong_t)&sh7763_data },
>  	{ "r8a7740-gether", (kernel_ulong_t)&r8a7740_data },
>  	{ "r8a777x-ether", (kernel_ulong_t)&r8a777x_data },
> +	{ "r8a7790-ether", (kernel_ulong_t)&r8a7790_data },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(platform, sh_eth_id_table);

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH v4 net-next repost 2/2] sh_eth: Add support for r8a7790 SoC
  2013-07-29 23:32   ` Laurent Pinchart
@ 2013-07-29 23:59     ` Simon Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2013-07-29 23:59 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: netdev, linux-sh, Magnus Damm, Sergei Shtylyov

On Tue, Jul 30, 2013 at 01:32:33AM +0200, Laurent Pinchart wrote:
> Hi Simon,
> 
> On Tuesday 23 July 2013 10:18:05 Simon Horman wrote:
> > This is a copy of support for r8a7778/9 with the .rmiimode mode bit
> > of struct sh_eth_cpu_data set.
> > 
> > Also update R8A7779 to R8A777x.
> > 
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > 
> > ---
> > 
> > v4
> > * s/R8A7779/R8A777x/ as requested by Sergei Shtylyov.
> > 
> > v3
> > * Add r8a7790_data rather than updating r8a777x_data.
> >   As requested by Sergei Shtylyov.
> > 
> > v2
> > * Split from "sh_eth: add support RMIIMODE register"
> > ---
> >  drivers/net/ethernet/renesas/Kconfig  |  2 +-
> >  drivers/net/ethernet/renesas/sh_eth.c | 21 +++++++++++++++++++++
> >  2 files changed, 22 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/renesas/Kconfig
> > b/drivers/net/ethernet/renesas/Kconfig index 19a8a04..a30c439 100644
> > --- a/drivers/net/ethernet/renesas/Kconfig
> > +++ b/drivers/net/ethernet/renesas/Kconfig
> > @@ -13,4 +13,4 @@ config SH_ETH
> >  	  Renesas SuperH Ethernet device driver.
> >  	  This driver supporting CPUs are:
> >  		- SH7619, SH7710, SH7712, SH7724, SH7734, SH7763, SH7757,
> > -		  R8A7740 and R8A7779.
> > +		  R8A7740, R8A777x and R8A7790.
> > diff --git a/drivers/net/ethernet/renesas/sh_eth.c
> > b/drivers/net/ethernet/renesas/sh_eth.c index 87af49f..fedc0a0 100644
> > --- a/drivers/net/ethernet/renesas/sh_eth.c
> > +++ b/drivers/net/ethernet/renesas/sh_eth.c
> > @@ -393,6 +393,26 @@ static struct sh_eth_cpu_data r8a777x_data = {
> >  	.hw_swap	= 1,
> >  };
> > 
> > +/* R8A7790 */
> > +static struct sh_eth_cpu_data r8a7790_data = {
> > +	.set_duplex	= sh_eth_set_duplex,
> > +	.set_rate	= sh_eth_set_rate_r8a777x,
> > +
> > +	.ecsr_value	= ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD,
> > +	.ecsipr_value	= ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | ECSIPR_ICDIP,
> > +	.eesipr_value	= 0x01ff009f,
> > +
> > +	.tx_check	= EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | EESR_RTO,
> > +	.eesr_err_check	= EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE |
> > +			  EESR_RFRMER | EESR_TFE | EESR_TDE | EESR_ECI,
> 
> Is there a reason why the EESR_RFE bit isn't set in eesr_err_check (and thus 
> ignored in the interrupt handler) but set in eesipr_value ?
> 
> If it's just an omission I'll send a patch.

I believe it is just an omission.

> > +
> > +	.apr		= 1,
> > +	.mpr		= 1,
> > +	.tpauser	= 1,
> > +	.hw_swap	= 1,
> > +	.rmiimode	= 1,
> > +};
> > +
> >  static void sh_eth_set_rate_sh7724(struct net_device *ndev)
> >  {
> >  	struct sh_eth_private *mdp = netdev_priv(ndev);
> > @@ -2753,6 +2773,7 @@ static struct platform_device_id sh_eth_id_table[] = {
> > { "sh7763-gether", (kernel_ulong_t)&sh7763_data },
> >  	{ "r8a7740-gether", (kernel_ulong_t)&r8a7740_data },
> >  	{ "r8a777x-ether", (kernel_ulong_t)&r8a777x_data },
> > +	{ "r8a7790-ether", (kernel_ulong_t)&r8a7790_data },
> >  	{ }
> >  };
> >  MODULE_DEVICE_TABLE(platform, sh_eth_id_table);
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

end of thread, other threads:[~2013-07-29 23:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-23  1:18 [PATCH 0/2 v4 net-next repost] sh_eth: Add support for r8a7790 SoC Simon Horman
2013-07-23  1:18 ` [PATCH v4 net-next repost 1/2] sh_eth: add support for RMIIMODE register Simon Horman
2013-07-23  1:18 ` [PATCH v4 net-next repost 2/2] sh_eth: Add support for r8a7790 SoC Simon Horman
2013-07-29 23:32   ` Laurent Pinchart
2013-07-29 23:59     ` Simon Horman
2013-07-24 22:39 ` [PATCH 0/2 v4 net-next repost] " David Miller

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