netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] net: macb: Document zynq gem dt binding
@ 2015-05-22 14:22 Nathan Sullivan
  2015-05-22 14:22 ` [PATCH v2 2/3] net: macb: Disable half duplex gigabit on Zynq Nathan Sullivan
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Nathan Sullivan @ 2015-05-22 14:22 UTC (permalink / raw)
  To: nicolas.ferre; +Cc: netdev, linux-kernel, Nathan Sullivan

Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
---
 Documentation/devicetree/bindings/net/cdns-emac.txt |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/cdns-emac.txt b/Documentation/devicetree/bindings/net/cdns-emac.txt
index abd67c1..4451ee9 100644
--- a/Documentation/devicetree/bindings/net/cdns-emac.txt
+++ b/Documentation/devicetree/bindings/net/cdns-emac.txt
@@ -3,7 +3,8 @@
 Required properties:
 - compatible: Should be "cdns,[<chip>-]{emac}"
   Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC.
-  or the generic form: "cdns,emac".
+  Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC.
+  Or the generic form: "cdns,emac".
 - reg: Address and length of the register set for the device
 - interrupts: Should contain macb interrupt
 - phy-mode: see ethernet.txt file in the same directory.
-- 
1.7.10.4

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

* [PATCH v2 2/3] net: macb: Disable half duplex gigabit on Zynq
  2015-05-22 14:22 [PATCH v2 1/3] net: macb: Document zynq gem dt binding Nathan Sullivan
@ 2015-05-22 14:22 ` Nathan Sullivan
  2015-05-22 14:56   ` Nicolas Ferre
  2015-05-22 18:58   ` David Miller
  2015-05-22 14:22 ` [PATCH v2 3/3] ARM: zynq: DT: Use the zynq binding with macb Nathan Sullivan
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Nathan Sullivan @ 2015-05-22 14:22 UTC (permalink / raw)
  To: nicolas.ferre; +Cc: netdev, linux-kernel, Nathan Sullivan

According to the Zynq TRM, gigabit half duplex is not supported.  Add a
new cap and compatible string so Zynq can avoid advertising that mode.

Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
---
 drivers/net/ethernet/cadence/macb.c |   12 ++++++++++++
 drivers/net/ethernet/cadence/macb.h |    1 +
 2 files changed, 13 insertions(+)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 61aa570..e7c0ef6 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -350,6 +350,9 @@ static int macb_mii_probe(struct net_device *dev)
 	else
 		phydev->supported &= PHY_BASIC_FEATURES;
 
+	if (bp->caps & MACB_CAPS_NO_GIGABIT_HALF)
+		phydev->supported &= ~SUPPORTED_1000baseT_Half;
+
 	phydev->advertising = phydev->supported;
 
 	bp->link = 0;
@@ -2693,6 +2696,14 @@ static const struct macb_config emac_config = {
 	.init = at91ether_init,
 };
 
+static const struct macb_config zynq_config = {
+	.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE |
+		MACB_CAPS_NO_GIGABIT_HALF,
+	.dma_burst_length = 16,
+	.clk_init = macb_clk_init,
+	.init = macb_init,
+};
+
 static const struct of_device_id macb_dt_ids[] = {
 	{ .compatible = "cdns,at32ap7000-macb" },
 	{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
@@ -2703,6 +2714,7 @@ static const struct of_device_id macb_dt_ids[] = {
 	{ .compatible = "atmel,sama5d4-gem", .data = &sama5d4_config },
 	{ .compatible = "cdns,at91rm9200-emac", .data = &emac_config },
 	{ .compatible = "cdns,emac", .data = &emac_config },
+	{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, macb_dt_ids);
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index eb7d76f..24b1d9b 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -393,6 +393,7 @@
 #define MACB_CAPS_ISR_CLEAR_ON_WRITE		0x00000001
 #define MACB_CAPS_USRIO_HAS_CLKEN		0x00000002
 #define MACB_CAPS_USRIO_DEFAULT_IS_MII		0x00000004
+#define MACB_CAPS_NO_GIGABIT_HALF		0x00000008
 #define MACB_CAPS_FIFO_MODE			0x10000000
 #define MACB_CAPS_GIGABIT_MODE_AVAILABLE	0x20000000
 #define MACB_CAPS_SG_DISABLED			0x40000000
-- 
1.7.10.4

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

* [PATCH v2 3/3] ARM: zynq: DT: Use the zynq binding with macb
  2015-05-22 14:22 [PATCH v2 1/3] net: macb: Document zynq gem dt binding Nathan Sullivan
  2015-05-22 14:22 ` [PATCH v2 2/3] net: macb: Disable half duplex gigabit on Zynq Nathan Sullivan
@ 2015-05-22 14:22 ` Nathan Sullivan
  2015-05-25 19:14   ` Sören Brinkmann
  2015-05-22 14:56 ` [PATCH v2 1/3] net: macb: Document zynq gem dt binding Nicolas Ferre
  2015-05-22 18:58 ` David Miller
  3 siblings, 1 reply; 8+ messages in thread
From: Nathan Sullivan @ 2015-05-22 14:22 UTC (permalink / raw)
  To: nicolas.ferre; +Cc: netdev, linux-kernel, Nathan Sullivan

Use the new zynq binding for macb ethernet, since it will disable half
duplex gigabit like the Zynq TRM says to do.

Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
---
 arch/arm/boot/dts/zynq-7000.dtsi |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
index a5cd2ed..9ea54b3 100644
--- a/arch/arm/boot/dts/zynq-7000.dtsi
+++ b/arch/arm/boot/dts/zynq-7000.dtsi
@@ -193,7 +193,7 @@
 		};
 
 		gem0: ethernet@e000b000 {
-			compatible = "cdns,gem";
+			compatible = "cdns,zynq-gem";
 			reg = <0xe000b000 0x1000>;
 			status = "disabled";
 			interrupts = <0 22 4>;
@@ -204,7 +204,7 @@
 		};
 
 		gem1: ethernet@e000c000 {
-			compatible = "cdns,gem";
+			compatible = "cdns,zynq-gem";
 			reg = <0xe000c000 0x1000>;
 			status = "disabled";
 			interrupts = <0 45 4>;
-- 
1.7.10.4

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

* Re: [PATCH v2 2/3] net: macb: Disable half duplex gigabit on Zynq
  2015-05-22 14:22 ` [PATCH v2 2/3] net: macb: Disable half duplex gigabit on Zynq Nathan Sullivan
@ 2015-05-22 14:56   ` Nicolas Ferre
  2015-05-22 18:58   ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: Nicolas Ferre @ 2015-05-22 14:56 UTC (permalink / raw)
  To: Nathan Sullivan; +Cc: netdev, linux-kernel

Le 22/05/2015 16:22, Nathan Sullivan a écrit :
> According to the Zynq TRM, gigabit half duplex is not supported.  Add a
> new cap and compatible string so Zynq can avoid advertising that mode.
> 
> Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>  drivers/net/ethernet/cadence/macb.c |   12 ++++++++++++
>  drivers/net/ethernet/cadence/macb.h |    1 +
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
> index 61aa570..e7c0ef6 100644
> --- a/drivers/net/ethernet/cadence/macb.c
> +++ b/drivers/net/ethernet/cadence/macb.c
> @@ -350,6 +350,9 @@ static int macb_mii_probe(struct net_device *dev)
>  	else
>  		phydev->supported &= PHY_BASIC_FEATURES;
>  
> +	if (bp->caps & MACB_CAPS_NO_GIGABIT_HALF)
> +		phydev->supported &= ~SUPPORTED_1000baseT_Half;
> +
>  	phydev->advertising = phydev->supported;
>  
>  	bp->link = 0;
> @@ -2693,6 +2696,14 @@ static const struct macb_config emac_config = {
>  	.init = at91ether_init,
>  };
>  
> +static const struct macb_config zynq_config = {
> +	.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE |
> +		MACB_CAPS_NO_GIGABIT_HALF,
> +	.dma_burst_length = 16,
> +	.clk_init = macb_clk_init,
> +	.init = macb_init,
> +};
> +
>  static const struct of_device_id macb_dt_ids[] = {
>  	{ .compatible = "cdns,at32ap7000-macb" },
>  	{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
> @@ -2703,6 +2714,7 @@ static const struct of_device_id macb_dt_ids[] = {
>  	{ .compatible = "atmel,sama5d4-gem", .data = &sama5d4_config },
>  	{ .compatible = "cdns,at91rm9200-emac", .data = &emac_config },
>  	{ .compatible = "cdns,emac", .data = &emac_config },
> +	{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, macb_dt_ids);
> diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
> index eb7d76f..24b1d9b 100644
> --- a/drivers/net/ethernet/cadence/macb.h
> +++ b/drivers/net/ethernet/cadence/macb.h
> @@ -393,6 +393,7 @@
>  #define MACB_CAPS_ISR_CLEAR_ON_WRITE		0x00000001
>  #define MACB_CAPS_USRIO_HAS_CLKEN		0x00000002
>  #define MACB_CAPS_USRIO_DEFAULT_IS_MII		0x00000004
> +#define MACB_CAPS_NO_GIGABIT_HALF		0x00000008
>  #define MACB_CAPS_FIFO_MODE			0x10000000
>  #define MACB_CAPS_GIGABIT_MODE_AVAILABLE	0x20000000
>  #define MACB_CAPS_SG_DISABLED			0x40000000
> 


-- 
Nicolas Ferre

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

* Re: [PATCH v2 1/3] net: macb: Document zynq gem dt binding
  2015-05-22 14:22 [PATCH v2 1/3] net: macb: Document zynq gem dt binding Nathan Sullivan
  2015-05-22 14:22 ` [PATCH v2 2/3] net: macb: Disable half duplex gigabit on Zynq Nathan Sullivan
  2015-05-22 14:22 ` [PATCH v2 3/3] ARM: zynq: DT: Use the zynq binding with macb Nathan Sullivan
@ 2015-05-22 14:56 ` Nicolas Ferre
  2015-05-22 18:58 ` David Miller
  3 siblings, 0 replies; 8+ messages in thread
From: Nicolas Ferre @ 2015-05-22 14:56 UTC (permalink / raw)
  To: Nathan Sullivan; +Cc: netdev, linux-kernel

Le 22/05/2015 16:22, Nathan Sullivan a écrit :
> Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>  Documentation/devicetree/bindings/net/cdns-emac.txt |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/cdns-emac.txt b/Documentation/devicetree/bindings/net/cdns-emac.txt
> index abd67c1..4451ee9 100644
> --- a/Documentation/devicetree/bindings/net/cdns-emac.txt
> +++ b/Documentation/devicetree/bindings/net/cdns-emac.txt
> @@ -3,7 +3,8 @@
>  Required properties:
>  - compatible: Should be "cdns,[<chip>-]{emac}"
>    Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC.
> -  or the generic form: "cdns,emac".
> +  Use "cdns,zynq-gem" Xilinx Zynq-7xxx SoC.
> +  Or the generic form: "cdns,emac".
>  - reg: Address and length of the register set for the device
>  - interrupts: Should contain macb interrupt
>  - phy-mode: see ethernet.txt file in the same directory.
> 


-- 
Nicolas Ferre

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

* Re: [PATCH v2 1/3] net: macb: Document zynq gem dt binding
  2015-05-22 14:22 [PATCH v2 1/3] net: macb: Document zynq gem dt binding Nathan Sullivan
                   ` (2 preceding siblings ...)
  2015-05-22 14:56 ` [PATCH v2 1/3] net: macb: Document zynq gem dt binding Nicolas Ferre
@ 2015-05-22 18:58 ` David Miller
  3 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2015-05-22 18:58 UTC (permalink / raw)
  To: nathan.sullivan; +Cc: nicolas.ferre, netdev, linux-kernel

From: Nathan Sullivan <nathan.sullivan@ni.com>
Date: Fri, 22 May 2015 09:22:09 -0500

> Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>

Applied.

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

* Re: [PATCH v2 2/3] net: macb: Disable half duplex gigabit on Zynq
  2015-05-22 14:22 ` [PATCH v2 2/3] net: macb: Disable half duplex gigabit on Zynq Nathan Sullivan
  2015-05-22 14:56   ` Nicolas Ferre
@ 2015-05-22 18:58   ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2015-05-22 18:58 UTC (permalink / raw)
  To: nathan.sullivan; +Cc: nicolas.ferre, netdev, linux-kernel

From: Nathan Sullivan <nathan.sullivan@ni.com>
Date: Fri, 22 May 2015 09:22:10 -0500

> According to the Zynq TRM, gigabit half duplex is not supported.  Add a
> new cap and compatible string so Zynq can avoid advertising that mode.
> 
> Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>

Applied.

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

* Re: [PATCH v2 3/3] ARM: zynq: DT: Use the zynq binding with macb
  2015-05-22 14:22 ` [PATCH v2 3/3] ARM: zynq: DT: Use the zynq binding with macb Nathan Sullivan
@ 2015-05-25 19:14   ` Sören Brinkmann
  0 siblings, 0 replies; 8+ messages in thread
From: Sören Brinkmann @ 2015-05-25 19:14 UTC (permalink / raw)
  To: Nathan Sullivan; +Cc: nicolas.ferre, netdev, linux-kernel

On Fri, 2015-05-22 at 09:22AM -0500, Nathan Sullivan wrote:
> Use the new zynq binding for macb ethernet, since it will disable half
> duplex gigabit like the Zynq TRM says to do.
> 
> Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
> ---
>  arch/arm/boot/dts/zynq-7000.dtsi |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
> index a5cd2ed..9ea54b3 100644
> --- a/arch/arm/boot/dts/zynq-7000.dtsi
> +++ b/arch/arm/boot/dts/zynq-7000.dtsi
> @@ -193,7 +193,7 @@
>  		};
>  
>  		gem0: ethernet@e000b000 {
> -			compatible = "cdns,gem";
> +			compatible = "cdns,zynq-gem";

Please, prepend the new string to the compatible list. Don't just
replace it like this.

>  			reg = <0xe000b000 0x1000>;
>  			status = "disabled";
>  			interrupts = <0 22 4>;
> @@ -204,7 +204,7 @@
>  		};
>  
>  		gem1: ethernet@e000c000 {
> -			compatible = "cdns,gem";
> +			compatible = "cdns,zynq-gem";

ditto

	Sören

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

end of thread, other threads:[~2015-05-25 19:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-22 14:22 [PATCH v2 1/3] net: macb: Document zynq gem dt binding Nathan Sullivan
2015-05-22 14:22 ` [PATCH v2 2/3] net: macb: Disable half duplex gigabit on Zynq Nathan Sullivan
2015-05-22 14:56   ` Nicolas Ferre
2015-05-22 18:58   ` David Miller
2015-05-22 14:22 ` [PATCH v2 3/3] ARM: zynq: DT: Use the zynq binding with macb Nathan Sullivan
2015-05-25 19:14   ` Sören Brinkmann
2015-05-22 14:56 ` [PATCH v2 1/3] net: macb: Document zynq gem dt binding Nicolas Ferre
2015-05-22 18:58 ` 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).