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

Hi,

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

Simon Horman (3):
  sh_eth: add support for gpio reset
  sh_eth: add support RMIIMODE register
  sh_eth: Add support for r8a7790 SoC

 drivers/net/ethernet/renesas/Kconfig  |  2 +-
 drivers/net/ethernet/renesas/sh_eth.c | 29 +++++++++++++++++++++++++++++
 drivers/net/ethernet/renesas/sh_eth.h |  2 ++
 include/linux/sh_eth.h                |  3 +++
 4 files changed, 35 insertions(+), 1 deletion(-)

-- 
1.8.2.1

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

* [PATCH net-next v3 1/3] sh_eth: add support for gpio reset
  2013-07-01  4:24 [PATCH net-next v3 0/3] sh_eth: Add support for r8a7790 SoC Simon Horman
@ 2013-07-01  4:24 ` Simon Horman
  2013-07-01 14:24   ` Sergei Shtylyov
  2013-07-01  4:24 ` [PATCH net-next v3 2/3] sh_eth: add support RMIIMODE register Simon Horman
  2013-07-01  4:24 ` [PATCH net-next v3 3/3] sh_eth: Add support for r8a7790 SoC Simon Horman
  2 siblings, 1 reply; 11+ messages in thread
From: Simon Horman @ 2013-07-01  4:24 UTC (permalink / raw)
  To: netdev, linux-sh; +Cc: Magnus Damm, Sergei Shtylyov, Simon Horman

Allow reset using a GPIO. In order to use this set the following
in the device's platform data:

	needs_gpio_reset = 1
	reset_gpio = GPIO pin to use

This patch is motivated by the lager board which uses the r8a7790 SoC
which has a GPIO pin to reset its sh_eth device.

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

--

v2
* First post
---
 drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
 include/linux/sh_eth.h                | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 7732f11..0253f61 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -21,6 +21,7 @@
  *  the file called "COPYING".
  */
 
+#include <linux/gpio.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -2652,6 +2653,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
 		ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER;
 	}
 
+	if (pd->needs_gpio_reset)
+		gpio_request_one(pd->reset_gpio, GPIOF_OUT_INIT_HIGH, NULL);
+
 	/* initialize first or needed device */
 	if (!devno || pd->needs_init) {
 		if (mdp->cd->chip_reset)
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index fc30571..b3f1550 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -22,6 +22,9 @@ struct sh_eth_plat_data {
 	unsigned no_ether_link:1;
 	unsigned ether_link_active_low:1;
 	unsigned needs_init:1;
+	unsigned needs_gpio_reset:1;
+
+	unsigned reset_gpio;	/* Used if needs_gpio_reset is true */
 };
 
 #endif
-- 
1.8.2.1

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

* [PATCH net-next v3 2/3] sh_eth: add support RMIIMODE register
  2013-07-01  4:24 [PATCH net-next v3 0/3] sh_eth: Add support for r8a7790 SoC Simon Horman
  2013-07-01  4:24 ` [PATCH net-next v3 1/3] sh_eth: add support for gpio reset Simon Horman
@ 2013-07-01  4:24 ` Simon Horman
  2013-07-01 14:26   ` Sergei Shtylyov
  2013-07-01 14:27   ` Sergei Shtylyov
  2013-07-01  4:24 ` [PATCH net-next v3 3/3] sh_eth: Add support for r8a7790 SoC Simon Horman
  2 siblings, 2 replies; 11+ messages in thread
From: Simon Horman @ 2013-07-01  4:24 UTC (permalink / raw)
  To: netdev, linux-sh; +Cc: Magnus Damm, Sergei Shtylyov, Simon Horman

This change is motivated by the lager board which uses the r8a7790 SoC,
an R-Car SoC. For this board setting the RMIIMODE register is necessary.

This patch assumes this is valid for all R-Car SoCs.

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

--

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 0253f61..f97700f 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -190,6 +190,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,
 };
@@ -1122,6 +1123,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 a78fb0c..6f76088 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 related	[flat|nested] 11+ messages in thread

* [PATCH net-next v3 3/3] sh_eth: Add support for r8a7790 SoC
  2013-07-01  4:24 [PATCH net-next v3 0/3] sh_eth: Add support for r8a7790 SoC Simon Horman
  2013-07-01  4:24 ` [PATCH net-next v3 1/3] sh_eth: add support for gpio reset Simon Horman
  2013-07-01  4:24 ` [PATCH net-next v3 2/3] sh_eth: add support RMIIMODE register Simon Horman
@ 2013-07-01  4:24 ` Simon Horman
  2013-07-01 14:30   ` Sergei Shtylyov
  2 siblings, 1 reply; 11+ messages in thread
From: Simon Horman @ 2013-07-01  4:24 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.

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

---

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 544514e..0d8a124a 100644
--- a/drivers/net/ethernet/renesas/Kconfig
+++ b/drivers/net/ethernet/renesas/Kconfig
@@ -12,4 +12,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, R8A7779 and R8A7790.
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index f97700f..3504878 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 related	[flat|nested] 11+ messages in thread

* Re: [PATCH net-next v3 1/3] sh_eth: add support for gpio reset
  2013-07-01  4:24 ` [PATCH net-next v3 1/3] sh_eth: add support for gpio reset Simon Horman
@ 2013-07-01 14:24   ` Sergei Shtylyov
  2013-07-02  5:25     ` Simon Horman
  0 siblings, 1 reply; 11+ messages in thread
From: Sergei Shtylyov @ 2013-07-01 14:24 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev, linux-sh, Magnus Damm

Hello.

On 01-07-2013 8:24, Simon Horman wrote:

> Allow reset using a GPIO. In order to use this set the following
> in the device's platform data:

> 	needs_gpio_reset = 1
> 	reset_gpio = GPIO pin to use

> This patch is motivated by the lager board which uses the r8a7790 SoC
> which has a GPIO pin to reset its sh_eth device.

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

> --

> v2
> * First post
> ---
>   drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
>   include/linux/sh_eth.h                | 3 +++
>   2 files changed, 7 insertions(+)

> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 7732f11..0253f61 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
[...]
> @@ -2652,6 +2653,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
>   		ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER;
>   	}
>
> +	if (pd->needs_gpio_reset)
> +		gpio_request_one(pd->reset_gpio, GPIOF_OUT_INIT_HIGH, NULL);

    Is reset signal active low or active high? Are you asserting or 
releasing it?

> diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
> index fc30571..b3f1550 100644
> --- a/include/linux/sh_eth.h
> +++ b/include/linux/sh_eth.h
> @@ -22,6 +22,9 @@ struct sh_eth_plat_data {
>   	unsigned no_ether_link:1;
>   	unsigned ether_link_active_low:1;
>   	unsigned needs_init:1;
> +	unsigned needs_gpio_reset:1;
> +
> +	unsigned reset_gpio;	/* Used if needs_gpio_reset is true */

    s/true/1/.

WBR, Sergei


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

* Re: [PATCH net-next v3 2/3] sh_eth: add support RMIIMODE register
  2013-07-01  4:24 ` [PATCH net-next v3 2/3] sh_eth: add support RMIIMODE register Simon Horman
@ 2013-07-01 14:26   ` Sergei Shtylyov
  2013-07-01 14:27   ` Sergei Shtylyov
  1 sibling, 0 replies; 11+ messages in thread
From: Sergei Shtylyov @ 2013-07-01 14:26 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev, linux-sh, Magnus Damm

Hello.

On 01-07-2013 8:24, Simon Horman wrote:

> This change is motivated by the lager board which uses the r8a7790 SoC,
> an R-Car SoC. For this board setting the RMIIMODE register is necessary.

     I've told you this is not board specific.

> This patch assumes this is valid for all R-Car SoCs.

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

WBR, Sergei


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

* Re: [PATCH net-next v3 2/3] sh_eth: add support RMIIMODE register
  2013-07-01  4:24 ` [PATCH net-next v3 2/3] sh_eth: add support RMIIMODE register Simon Horman
  2013-07-01 14:26   ` Sergei Shtylyov
@ 2013-07-01 14:27   ` Sergei Shtylyov
  1 sibling, 0 replies; 11+ messages in thread
From: Sergei Shtylyov @ 2013-07-01 14:27 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev, linux-sh, Magnus Damm

Hello.

On 01-07-2013 8:24, Simon Horman wrote:

> This change is motivated by the lager board which uses the r8a7790 SoC,
> an R-Car SoC. For this board setting the RMIIMODE register is necessary.

> This patch assumes this is valid for all R-Car SoCs.

    This is not so for this version of the patch.

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

WBR, Sergei


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

* Re: [PATCH net-next v3 3/3] sh_eth: Add support for r8a7790 SoC
  2013-07-01  4:24 ` [PATCH net-next v3 3/3] sh_eth: Add support for r8a7790 SoC Simon Horman
@ 2013-07-01 14:30   ` Sergei Shtylyov
  2013-07-02  1:24     ` Simon Horman
  0 siblings, 1 reply; 11+ messages in thread
From: Sergei Shtylyov @ 2013-07-01 14:30 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev, linux-sh, Magnus Damm

Hello.

On 01-07-2013 8:24, Simon Horman wrote:

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

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

> ---

> 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 544514e..0d8a124a 100644
> --- a/drivers/net/ethernet/renesas/Kconfig
> +++ b/drivers/net/ethernet/renesas/Kconfig
> @@ -12,4 +12,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, R8A7779 and R8A7790.

    Could you s/R8A7779/R8A777x/, while at it?

WBR, Sergei

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

* Re: [PATCH net-next v3 3/3] sh_eth: Add support for r8a7790 SoC
  2013-07-01 14:30   ` Sergei Shtylyov
@ 2013-07-02  1:24     ` Simon Horman
  0 siblings, 0 replies; 11+ messages in thread
From: Simon Horman @ 2013-07-02  1:24 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: netdev, linux-sh, Magnus Damm

On Mon, Jul 01, 2013 at 06:30:12PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 01-07-2013 8:24, Simon Horman wrote:
> 
> >This is a copy of support for r8a7778/9 with the .rmiimode mode bit
> >of struct sh_eth_cpu_data set.
> 
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> 
> >---
> 
> >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 544514e..0d8a124a 100644
> >--- a/drivers/net/ethernet/renesas/Kconfig
> >+++ b/drivers/net/ethernet/renesas/Kconfig
> >@@ -12,4 +12,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, R8A7779 and R8A7790.
> 
>    Could you s/R8A7779/R8A777x/, while at it?

Sure, will do.

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

* Re: [PATCH net-next v3 1/3] sh_eth: add support for gpio reset
  2013-07-01 14:24   ` Sergei Shtylyov
@ 2013-07-02  5:25     ` Simon Horman
  2013-07-04 15:20       ` Laurent Pinchart
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Horman @ 2013-07-02  5:25 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: netdev, linux-sh, Magnus Damm

On Mon, Jul 01, 2013 at 06:24:34PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 01-07-2013 8:24, Simon Horman wrote:
> 
> >Allow reset using a GPIO. In order to use this set the following
> >in the device's platform data:
> 
> >	needs_gpio_reset = 1
> >	reset_gpio = GPIO pin to use
> 
> >This patch is motivated by the lager board which uses the r8a7790 SoC
> >which has a GPIO pin to reset its sh_eth device.
> 
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> 
> >--
> 
> >v2
> >* First post
> >---
> >  drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
> >  include/linux/sh_eth.h                | 3 +++
> >  2 files changed, 7 insertions(+)
> 
> >diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> >index 7732f11..0253f61 100644
> >--- a/drivers/net/ethernet/renesas/sh_eth.c
> >+++ b/drivers/net/ethernet/renesas/sh_eth.c
> [...]
> >@@ -2652,6 +2653,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
> >  		ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER;
> >  	}
> >
> >+	if (pd->needs_gpio_reset)
> >+		gpio_request_one(pd->reset_gpio, GPIOF_OUT_INIT_HIGH, NULL);
> 
>    Is reset signal active low or active high? Are you asserting or
> releasing it?

Good point.

I'm not sure that the documentation that I have is sufficient to answer that.
Empirically it seems that this change isn't strictly necessary, so perhaps
it would be best to drop it for now.

> 
> >diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
> >index fc30571..b3f1550 100644
> >--- a/include/linux/sh_eth.h
> >+++ b/include/linux/sh_eth.h
> >@@ -22,6 +22,9 @@ struct sh_eth_plat_data {
> >  	unsigned no_ether_link:1;
> >  	unsigned ether_link_active_low:1;
> >  	unsigned needs_init:1;
> >+	unsigned needs_gpio_reset:1;
> >+
> >+	unsigned reset_gpio;	/* Used if needs_gpio_reset is true */
> 
>    s/true/1/.
> 
> WBR, Sergei
> 

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

* Re: [PATCH net-next v3 1/3] sh_eth: add support for gpio reset
  2013-07-02  5:25     ` Simon Horman
@ 2013-07-04 15:20       ` Laurent Pinchart
  0 siblings, 0 replies; 11+ messages in thread
From: Laurent Pinchart @ 2013-07-04 15:20 UTC (permalink / raw)
  To: Simon Horman; +Cc: Sergei Shtylyov, netdev, linux-sh, Magnus Damm

Hi Simon,

On Tuesday 02 July 2013 14:25:00 Simon Horman wrote:
> On Mon, Jul 01, 2013 at 06:24:34PM +0400, Sergei Shtylyov wrote:
> > On 01-07-2013 8:24, Simon Horman wrote:
> > >Allow reset using a GPIO. In order to use this set the following
> > >
> > >in the device's platform data:
> > >	needs_gpio_reset = 1
> > >	reset_gpio = GPIO pin to use
> > >
> > >This patch is motivated by the lager board which uses the r8a7790 SoC
> > >which has a GPIO pin to reset its sh_eth device.
> > >
> > >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > >
> > >--
> > >
> > >v2
> > >* First post
> > >---
> > >
> > >  drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
> > >  include/linux/sh_eth.h                | 3 +++
> > >  2 files changed, 7 insertions(+)
> > >
> > >diff --git a/drivers/net/ethernet/renesas/sh_eth.c
> > >b/drivers/net/ethernet/renesas/sh_eth.c index 7732f11..0253f61 100644
> > >--- a/drivers/net/ethernet/renesas/sh_eth.c
> > >+++ b/drivers/net/ethernet/renesas/sh_eth.c
> > 
> > [...]
> > 
> > >@@ -2652,6 +2653,9 @@ static int sh_eth_drv_probe(struct platform_device
> > >*pdev)> >
> > >  		ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER;
> > >  	
> > >  	}
> > >
> > >+	if (pd->needs_gpio_reset)
> > >+		gpio_request_one(pd->reset_gpio, GPIOF_OUT_INIT_HIGH, NULL);
> > >
> >    Is reset signal active low or active high? Are you asserting or
> > 
> > releasing it?
> 
> Good point.
> 
> I'm not sure that the documentation that I have is sufficient to answer
> that. Empirically it seems that this change isn't strictly necessary, so
> perhaps it would be best to drop it for now.

GPIO 5-31 is connected to the active-low reset input of the KSZ8041 PHY. 
Wouldn't it make more sense to handle it in the PHY framework ? More work is 
then be needed. If the Lager boot loader configures the GPIO correctly I would 
thus drop this patch.

-- 
Regards,

Laurent Pinchart


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

end of thread, other threads:[~2013-07-04 15:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-01  4:24 [PATCH net-next v3 0/3] sh_eth: Add support for r8a7790 SoC Simon Horman
2013-07-01  4:24 ` [PATCH net-next v3 1/3] sh_eth: add support for gpio reset Simon Horman
2013-07-01 14:24   ` Sergei Shtylyov
2013-07-02  5:25     ` Simon Horman
2013-07-04 15:20       ` Laurent Pinchart
2013-07-01  4:24 ` [PATCH net-next v3 2/3] sh_eth: add support RMIIMODE register Simon Horman
2013-07-01 14:26   ` Sergei Shtylyov
2013-07-01 14:27   ` Sergei Shtylyov
2013-07-01  4:24 ` [PATCH net-next v3 3/3] sh_eth: Add support for r8a7790 SoC Simon Horman
2013-07-01 14:30   ` Sergei Shtylyov
2013-07-02  1:24     ` Simon Horman

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