[PATCH net] dwc-xlgmac: remove Jie Deng as co-maintainer

2018-02-04 Thread Jie Deng
Jose Abreu is working on this driver and I will leave Synopsys soon.
Thus it does not seem appropriate for me to be a co-maintainer anymore.

Signed-off-by: Jie Deng <jied...@synopsys.com>
---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index b59a8cd..8903842 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13289,7 +13289,6 @@ F:  include/linux/platform_data/dma-dw.h
 F: drivers/dma/dw/
 
 SYNOPSYS DESIGNWARE ENTERPRISE ETHERNET DRIVER
-M:     Jie Deng <jied...@synopsys.com>
 M: Jose Abreu <jose.ab...@synopsys.com>
 L: netdev@vger.kernel.org
 S: Supported
-- 
2.7.4



Re: Subject: [RFC][PATCH 10/11] dwc-xlgmac: fix big-endian breakage

2018-01-07 Thread Jie Deng
On 2018/1/6 3:32, Al Viro wrote:

> Users of XLGMAC_SET_REG_BITS_LE() expect it to take le32 and return
> le32.
>
> Signed-off-by: Al Viro <v...@zeniv.linux.org.uk>
> ---
>  drivers/net/ethernet/synopsys/dwc-xlgmac.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac.h 
> b/drivers/net/ethernet/synopsys/dwc-xlgmac.h
> index cab3e40a86b9..e95c4c250e16 100644
> --- a/drivers/net/ethernet/synopsys/dwc-xlgmac.h
> +++ b/drivers/net/ethernet/synopsys/dwc-xlgmac.h
> @@ -106,7 +106,7 @@
>  #define XLGMAC_GET_REG_BITS_LE(var, pos, len) ({ \
>   typeof(pos) _pos = (pos);   \
>   typeof(len) _len = (len);   \
> - typeof(var) _var = le32_to_cpu((var));  \
> + u32 _var = le32_to_cpu((var));  \
>   ((_var) & GENMASK(_pos + _len - 1, _pos)) >> (_pos);\
>  })
>  
> @@ -125,8 +125,8 @@
>   typeof(len) _len = (len);   \
>   typeof(val) _val = (val);   \
>   _val = (_val << _pos) & GENMASK(_pos + _len - 1, _pos); \
> - _var = (_var & ~GENMASK(_pos + _len - 1, _pos)) | _val; \
> - cpu_to_le32(_var);  \
> + (_var & ~cpu_to_le32(GENMASK(_pos + _len - 1, _pos))) | \
> + cpu_to_le32(_val);  \
>  })
>  
>  struct xlgmac_pdata;
Thanks for your patch.
Acked-by: Jie Deng <jied...@synopsys.com>


[PATCH net-next] net: dwc-xlgmac: Get rid of custom hex_dump_to_buffer()

2017-12-20 Thread Jie Deng
Get rid of custom hex_dump_to_buffer().

The output is slightly changed, i.e. each byte followed by white space.

Note, we don't use print_hex_dump() here since the original code uses
nedev_dbg().

Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>
Signed-off-by: Jie Deng <jied...@synopsys.com>
---
 drivers/net/ethernet/synopsys/dwc-xlgmac-common.c | 24 +++
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
index d655a42..eb1c6b0 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
@@ -333,9 +333,8 @@ void xlgmac_print_pkt(struct net_device *netdev,
  struct sk_buff *skb, bool tx_rx)
 {
struct ethhdr *eth = (struct ethhdr *)skb->data;
-   unsigned char *buf = skb->data;
unsigned char buffer[128];
-   unsigned int i, j;
+   unsigned int i;
 
netdev_dbg(netdev, "\n** SKB dump \n");
 
@@ -346,22 +345,13 @@ void xlgmac_print_pkt(struct net_device *netdev,
netdev_dbg(netdev, "Src MAC addr: %pM\n", eth->h_source);
netdev_dbg(netdev, "Protocol: %#06hx\n", ntohs(eth->h_proto));
 
-   for (i = 0, j = 0; i < skb->len;) {
-   j += snprintf(buffer + j, sizeof(buffer) - j, "%02hhx",
- buf[i++]);
-
-   if ((i % 32) == 0) {
-   netdev_dbg(netdev, "  %#06x: %s\n", i - 32, buffer);
-   j = 0;
-   } else if ((i % 16) == 0) {
-   buffer[j++] = ' ';
-   buffer[j++] = ' ';
-   } else if ((i % 4) == 0) {
-   buffer[j++] = ' ';
-   }
+   for (i = 0; i < skb->len; i += 32) {
+   unsigned int len = min(skb->len - i, 32U);
+
+   hex_dump_to_buffer(>data[i], len, 32, 1,
+  buffer, sizeof(buffer), false);
+   netdev_dbg(netdev, "  %#06x: %s\n", i, buffer);
}
-   if (i % 32)
-   netdev_dbg(netdev, "  %#06x: %s\n", i - (i % 32), buffer);
 
netdev_dbg(netdev, "\n** SKB dump \n");
 }
-- 
1.9.1



[PATCH net] dwc-xlgmac: Add co-maintainer

2017-12-12 Thread Jie Deng
Jose Abreu will join to maintain dwc-xlgmac.
He will help with new feature development for
this driver. Thanks Jose and welcome on board!

Signed-off-by: Jie Deng <jied...@synopsys.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9e0045e..51497dc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13117,6 +13117,7 @@ F:  drivers/dma/dw/
 
 SYNOPSYS DESIGNWARE ENTERPRISE ETHERNET DRIVER
 M:     Jie Deng <jied...@synopsys.com>
+M: Jose Abreu <jose.ab...@synopsys.com>
 L: netdev@vger.kernel.org
 S: Supported
 F: drivers/net/ethernet/synopsys/
-- 
1.9.1



Re: [RFC][PATCH] apparent big-endian bugs in dwc-xlgmac

2017-12-10 Thread Jie Deng
On 2017/12/11 13:38, Al Viro wrote:

> On Mon, Dec 11, 2017 at 05:05:20AM +, Al Viro wrote:
>
>> What for?  Sure, this variant will work, but why bother with
>>  a = le32_to_cpu(b);
>>  (cpu_to_le32(a) & ) | 
>> and how is that better than
>>  (b & ...) | ...
>>
>> IDGI...  Mind you, I'm not sure if there is any point keeping _var in that 
>> thing,
>> seeing that we use var only once - might be better off with
>>  ((var) & ~cpu_to_le32(GENMASK(_pos + _len - 1, _pos))) |\
>>  cpu_to_le32(_val);  \
> FWIW, seeing how many drivers end up open-coding that, I'm rather tempted to
> add to linux/bitops.h or linux/byteorder/generic.h the following:
>
> static inline __le16 le16_replace_bits(__le16 old, u16 v, int bit, int size)
> {
>   __le16 mask = cpu_to_le16(GENMASK(bit + size - 1, bit));
>   return (old & ~mask) | (cpu_to_le16(v << bit) & mask);
> }
>
> static inline __le32 le32_replace_bits(__le32 old, u32 v, int bit, int size)
> {
>   __le32 mask = cpu_to_le32(GENMASK(bit + size - 1, bit));
>   return (old & ~mask) | (cpu_to_le32(v << bit) & mask);
> }
>
> static inline __le64 le64_replace_bits(__le64 old, u64 v, int bit, int size)
> {
>   __le64 mask = cpu_to_le64(GENMASK_ULL(bit + size - 1, bit));
>   return (old & ~mask) | (cpu_to_le64(v << bit) & mask);
> }
>
> static inline __be16 be16_replace_bits(__be16 old, u16 v, int bit, int size)
> {
>   __be16 mask = cpu_to_be16(GENMASK(bit + size - 1, bit));
>   return (old & ~mask) | (cpu_to_be16(v << bit) & mask);
> }
>
> static inline __be32 be32_replace_bits(__be32 old, u32 v, int bit, int size)
> {
>   __be32 mask = cpu_to_be32(GENMASK(bit + size - 1, bit));
>   return (old & ~mask) | (cpu_to_be32(v << bit) & mask);
> }
>
> static inline __be64 be64_replace_bits(__be64 old, u64 v, int bit, int size)
> {
>   __be64 mask = cpu_to_be64(GENMASK_ULL(bit + size - 1, bit));
>   return (old & ~mask) | (cpu_to_be64(v << bit) & mask);
> }
>
> static inline u16 le16_get_bits(__le16 v, int bit, int size)
> {
>   return (le16_to_cpu(v) >> bit) & (BIT(size) - 1);
> }
>
> static inline u32 le32_get_bits(__le32 v, int bit, int size)
> {
>   return (le32_to_cpu(v) >> bit) & (BIT(size) - 1);
> }
>
> static inline u64 le64_get_bits(__le64 v, int bit, int size)
> {
>   return (le64_to_cpu(v) >> bit) & (BIT_ULL(size) - 1);
> }
>
> static inline u16 be16_get_bits(__be16 v, int bit, int size)
> {
>   return (be16_to_cpu(v) >> bit) & (BIT(size) - 1);
> }
>
> static inline u32 be32_get_bits(__be32 v, int bit, int size)
> {
>   return (be32_to_cpu(v) >> bit) & (BIT(size) - 1);
> }
>
> static inline u64 be64_get_bits(__be64 v, int bit, int size)
> {
>   return (be64_to_cpu(v) >> bit) & (BIT_ULL(size) - 1);
> }
>
> and let drivers use those...
Sounds good. As a driver developer, I'm happy to see this.


Re: [RFC][PATCH] apparent big-endian bugs in dwc-xlgmac

2017-12-10 Thread Jie Deng
On 2017/12/11 13:05, Al Viro wrote:

> On Mon, Dec 11, 2017 at 12:33:42PM +0800, Jie Deng wrote:
>> Hi AI Viro,
>>> @@ -125,8 +125,8 @@
>>> typeof(len) _len = (len);   \
>>> typeof(val) _val = (val);   \
>>> _val = (_val << _pos) & GENMASK(_pos + _len - 1, _pos); \
>>> -   _var = (_var & ~GENMASK(_pos + _len - 1, _pos)) | _val; \
>>> -   cpu_to_le32(_var);  \
>>> +   (_var & ~cpu_to_le32(GENMASK(_pos + _len - 1, _pos))) | \
>>> +   cpu_to_le32(_val);  \
>>>  })
>>>  
>>>  struct xlgmac_pdata;
>> Make sense.  But I think what you want is fix as follows. Right ?
>>
>> @@ -125,8 +125,8 @@
>>  typeof(len) _len = (len);   
>> \
>> -typeof(val) _val = (val);   
>> \
>> +   u32 _var = le32_to_cpu((var));   
>>\
>> _val = (_val << _pos) & GENMASK(_pos + _len - 1, _pos);  
>> \
>> -_var = (_var & ~GENMASK(_pos + _len - 1, _pos)) | _val; 
>> \
>> -cpu_to_le32(_var);  
>> \
>> +(cpu_to_le32(_var) & ~cpu_to_le32(GENMASK(_pos + _len - 1, _pos))) |
>> \
>> +cpu_to_le32(_val);  
>> \
>>  })
> What for?  Sure, this variant will work, but why bother with
>   a = le32_to_cpu(b);
>   (cpu_to_le32(a) & ) | 
> and how is that better than
>   (b & ...) | ...
>
> IDGI...  Mind you, I'm not sure if there is any point keeping _var in that 
> thing,
> seeing that we use var only once - might be better off with
>   ((var) & ~cpu_to_le32(GENMASK(_pos + _len - 1, _pos))) |\
>   cpu_to_le32(_val);  \
I agree. Could you please send the patch with this better fix ?


Re: [RFC][PATCH] apparent big-endian bugs in dwc-xlgmac

2017-12-10 Thread Jie Deng
Hi AI Viro,


On 2017/12/10 12:53, Al Viro wrote:
> In xlgmac_dev_xmit():
>
> /* Mark it as a CONTEXT descriptor */
> dma_desc->desc3 = XLGMAC_SET_REG_BITS_LE(
> dma_desc->desc3,
> TX_CONTEXT_DESC3_CTXT_POS,
> TX_CONTEXT_DESC3_CTXT_LEN,
> 1);
>
>
>
> Looking at XLGMAC_SET_REG_BITS_LE() we see this:
> #define XLGMAC_SET_REG_BITS_LE(var, pos, len, val) ({   \
> typeof(var) _var = (var);   \
> typeof(pos) _pos = (pos);   \
> typeof(len) _len = (len);   \
> typeof(val) _val = (val);   \
> _val = (_val << _pos) & GENMASK(_pos + _len - 1, _pos); \
> _var = (_var & ~GENMASK(_pos + _len - 1, _pos)) | _val; \
> cpu_to_le32(_var);  \
> })
>
> That thing assumes var to be host-endian and has a little-endian result.
> Unfortunately, we feed it a little-endian and store the result back into
> the same place.  That might work if the original values *was* host-endian
> and we wanted to end up with little-endian.  However, that is immediately
> followed by
> /* Indicate this descriptor contains the MSS */
> dma_desc->desc3 = XLGMAC_SET_REG_BITS_LE(
> dma_desc->desc3,
> TX_CONTEXT_DESC3_TCMSSV_POS,
> TX_CONTEXT_DESC3_TCMSSV_LEN,
> 1);
>
> where we operate on the now definitely little-endian value.  That really
> can't be right.  I don't have the hardware in question, so I can't test
> that, but it smells like this needs something like diff below, making
> XLGMAC_SET_REG_BITS_LE take le32 and return le32.  GET side of things
> is le32 -> u32; definition looks correct, but slightly misannotated.
>
> Signed-off-by: Al Viro 
> ---
> diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac.h 
> b/drivers/net/ethernet/synopsys/dwc-xlgmac.h
> index cab3e40a86b9..e95c4c250e16 100644
> --- a/drivers/net/ethernet/synopsys/dwc-xlgmac.h
> +++ b/drivers/net/ethernet/synopsys/dwc-xlgmac.h
> @@ -106,7 +106,7 @@
>  #define XLGMAC_GET_REG_BITS_LE(var, pos, len) ({ \
>   typeof(pos) _pos = (pos);   \
>   typeof(len) _len = (len);   \
> - typeof(var) _var = le32_to_cpu((var));  \
> + u32 _var = le32_to_cpu((var));  \
>   ((_var) & GENMASK(_pos + _len - 1, _pos)) >> (_pos);\
>  })
>  
> @@ -125,8 +125,8 @@
>   typeof(len) _len = (len);   \
>   typeof(val) _val = (val);   \
>   _val = (_val << _pos) & GENMASK(_pos + _len - 1, _pos); \
> - _var = (_var & ~GENMASK(_pos + _len - 1, _pos)) | _val; \
> - cpu_to_le32(_var);  \
> + (_var & ~cpu_to_le32(GENMASK(_pos + _len - 1, _pos))) | \
> + cpu_to_le32(_val);  \
>  })
>  
>  struct xlgmac_pdata;

Make sense.  But I think what you want is fix as follows. Right ?

@@ -125,8 +125,8 @@
typeof(len) _len = (len);   
\
-   typeof(val) _val = (val);   
\
+   u32 _var = le32_to_cpu((var));  
\   
_val = (_val << _pos) & GENMASK(_pos + _len - 1, _pos); 
\
-   _var = (_var & ~GENMASK(_pos + _len - 1, _pos)) | _val; 
\
-   cpu_to_le32(_var);  
\
+   (cpu_to_le32(_var) & ~cpu_to_le32(GENMASK(_pos + _len - 1, _pos))) |
\
+   cpu_to_le32(_val);  
\
 })



[PATCH v2 net-next] net: dwc-xlgmac: add the initial ethtool support

2017-04-11 Thread Jie Deng
It is necessary to provide ethtool support for displaying and
modifying parameters of dwc-xlgmac.

Signed-off-by: Jie Deng <jied...@synopsys.com>
---
v1->v2:
- remove begin() method which is unnecessary

 drivers/net/ethernet/synopsys/Makefile |   3 +-
 drivers/net/ethernet/synopsys/dwc-xlgmac-common.c  |   1 +
 drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c | 275 +
 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c  |   4 +-
 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c |  22 +-
 drivers/net/ethernet/synopsys/dwc-xlgmac.h |  11 +
 6 files changed, 312 insertions(+), 4 deletions(-)
 create mode 100644 drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c

diff --git a/drivers/net/ethernet/synopsys/Makefile 
b/drivers/net/ethernet/synopsys/Makefile
index c06e2eb..0ad0191 100644
--- a/drivers/net/ethernet/synopsys/Makefile
+++ b/drivers/net/ethernet/synopsys/Makefile
@@ -4,6 +4,7 @@
 
 obj-$(CONFIG_DWC_XLGMAC) += dwc-xlgmac.o
 dwc-xlgmac-objs := dwc-xlgmac-net.o dwc-xlgmac-desc.o \
-  dwc-xlgmac-hw.o dwc-xlgmac-common.o
+  dwc-xlgmac-hw.o dwc-xlgmac-common.o \
+  dwc-xlgmac-ethtool.o
 
 dwc-xlgmac-$(CONFIG_DWC_XLGMAC_PCI) += dwc-xlgmac-pci.o
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
index 07def2b..d655a42 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
@@ -175,6 +175,7 @@ static int xlgmac_init(struct xlgmac_pdata *pdata)
 
/* Set device operations */
netdev->netdev_ops = xlgmac_get_netdev_ops();
+   netdev->ethtool_ops = xlgmac_get_ethtool_ops();
 
/* Set device features */
if (pdata->hw_feat.tso) {
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c
new file mode 100644
index 000..fde7221
--- /dev/null
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c
@@ -0,0 +1,275 @@
+/* Synopsys DesignWare Core Enterprise Ethernet (XLGMAC) Driver
+ *
+ * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
+ *
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
+ *
+ * This Synopsys DWC XLGMAC software driver and associated documentation
+ * (hereinafter the "Software") is an unsupported proprietary work of
+ * Synopsys, Inc. unless otherwise expressly agreed to in writing between
+ * Synopsys and you. The Software IS NOT an item of Licensed Software or a
+ * Licensed Product under any End User Software License Agreement or
+ * Agreement for Licensed Products with Synopsys or any supplement thereto.
+ * Synopsys is a registered trademark of Synopsys, Inc. Other names included
+ * in the SOFTWARE may be the trademarks of their respective owners.
+ */
+
+#include 
+#include 
+#include 
+
+#include "dwc-xlgmac.h"
+#include "dwc-xlgmac-reg.h"
+
+struct xlgmac_stats_desc {
+   char stat_string[ETH_GSTRING_LEN];
+   int stat_offset;
+};
+
+#define XLGMAC_STAT(str, var)  \
+   {   \
+   str,\
+   offsetof(struct xlgmac_pdata, stats.var),   \
+   }
+
+static const struct xlgmac_stats_desc xlgmac_gstring_stats[] = {
+   /* MMC TX counters */
+   XLGMAC_STAT("tx_bytes", txoctetcount_gb),
+   XLGMAC_STAT("tx_bytes_good", txoctetcount_g),
+   XLGMAC_STAT("tx_packets", txframecount_gb),
+   XLGMAC_STAT("tx_packets_good", txframecount_g),
+   XLGMAC_STAT("tx_unicast_packets", txunicastframes_gb),
+   XLGMAC_STAT("tx_broadcast_packets", txbroadcastframes_gb),
+   XLGMAC_STAT("tx_broadcast_packets_good", txbroadcastframes_g),
+   XLGMAC_STAT("tx_multicast_packets", txmulticastframes_gb),
+   XLGMAC_STAT("tx_multicast_packets_good", txmulticastframes_g),
+   XLGMAC_STAT("tx_vlan_packets_good", txvlanframes_g),
+   XLGMAC_STAT("tx_64_byte_packets", tx64octets_gb),
+   XLGMAC_STAT("tx_65_to_127_byte_packets", tx65to127octets_gb),
+   XLGMAC_STAT("tx_128_to_255_byte_packets", tx128to255octets_gb),
+   XLGMAC_STAT("tx_256_to_511_byte_packets", tx256to511octets_gb),
+   XLGMAC_STAT("tx_512_to_1023_byte_packets", tx512to1023octets_gb),
+   XLGMAC_STAT("tx_1024_to_max_byte_packets", tx1024tomaxoctets_gb),
+   XLGMAC_STAT("tx_underflow_errors", txunderflowerror),
+   XLGMAC_STAT("tx_pause_frames", txpauseframes),
+
+   /* MMC RX counters */
+   XLGMAC_STAT("rx_bytes", rxoctetcount_gb),
+

Re: [PATCH net-next] net: dwc-xlgmac: add the initial ethtool support

2017-04-11 Thread Jie Deng
On 2017/4/11 22:47, David Miller wrote:

> From: Jie Deng <jie.de...@synopsys.com>
> Date: Tue, 11 Apr 2017 16:14:04 +0800
>
>> It is necessary to provide ethtool support for displaying and
>> modifying parameters of dwc-xlgmac.
>>
>> Signed-off-by: Jie Deng <jied...@synopsys.com>
> I don't see why you cannot allow the statistics to be obtained when
> the device is not running.  Similarly for other ethtool calls that
> just fetch information stored in the software state of the driver.
>
> I think your ->begin() method is way too restrictive.
Yeah, begin() seems unreasonable here. I will remove it.


[PATCH net-next] net: dwc-xlgmac: add the initial ethtool support

2017-04-11 Thread Jie Deng
It is necessary to provide ethtool support for displaying and
modifying parameters of dwc-xlgmac.

Signed-off-by: Jie Deng <jied...@synopsys.com>
---
 drivers/net/ethernet/synopsys/Makefile |   3 +-
 drivers/net/ethernet/synopsys/dwc-xlgmac-common.c  |   1 +
 drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c | 284 +
 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c  |   4 +-
 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c |  22 +-
 drivers/net/ethernet/synopsys/dwc-xlgmac.h |  11 +
 6 files changed, 321 insertions(+), 4 deletions(-)
 create mode 100644 drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c

diff --git a/drivers/net/ethernet/synopsys/Makefile 
b/drivers/net/ethernet/synopsys/Makefile
index c06e2eb..0ad0191 100644
--- a/drivers/net/ethernet/synopsys/Makefile
+++ b/drivers/net/ethernet/synopsys/Makefile
@@ -4,6 +4,7 @@
 
 obj-$(CONFIG_DWC_XLGMAC) += dwc-xlgmac.o
 dwc-xlgmac-objs := dwc-xlgmac-net.o dwc-xlgmac-desc.o \
-  dwc-xlgmac-hw.o dwc-xlgmac-common.o
+  dwc-xlgmac-hw.o dwc-xlgmac-common.o \
+  dwc-xlgmac-ethtool.o
 
 dwc-xlgmac-$(CONFIG_DWC_XLGMAC_PCI) += dwc-xlgmac-pci.o
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
index 07def2b..d655a42 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
@@ -175,6 +175,7 @@ static int xlgmac_init(struct xlgmac_pdata *pdata)
 
/* Set device operations */
netdev->netdev_ops = xlgmac_get_netdev_ops();
+   netdev->ethtool_ops = xlgmac_get_ethtool_ops();
 
/* Set device features */
if (pdata->hw_feat.tso) {
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c
new file mode 100644
index 000..8aaabf3
--- /dev/null
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-ethtool.c
@@ -0,0 +1,284 @@
+/* Synopsys DesignWare Core Enterprise Ethernet (XLGMAC) Driver
+ *
+ * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
+ *
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
+ *
+ * This Synopsys DWC XLGMAC software driver and associated documentation
+ * (hereinafter the "Software") is an unsupported proprietary work of
+ * Synopsys, Inc. unless otherwise expressly agreed to in writing between
+ * Synopsys and you. The Software IS NOT an item of Licensed Software or a
+ * Licensed Product under any End User Software License Agreement or
+ * Agreement for Licensed Products with Synopsys or any supplement thereto.
+ * Synopsys is a registered trademark of Synopsys, Inc. Other names included
+ * in the SOFTWARE may be the trademarks of their respective owners.
+ */
+
+#include 
+#include 
+#include 
+
+#include "dwc-xlgmac.h"
+#include "dwc-xlgmac-reg.h"
+
+struct xlgmac_stats_desc {
+   char stat_string[ETH_GSTRING_LEN];
+   int stat_offset;
+};
+
+#define XLGMAC_STAT(str, var)  \
+   {   \
+   str,\
+   offsetof(struct xlgmac_pdata, stats.var),   \
+   }
+
+static const struct xlgmac_stats_desc xlgmac_gstring_stats[] = {
+   /* MMC TX counters */
+   XLGMAC_STAT("tx_bytes", txoctetcount_gb),
+   XLGMAC_STAT("tx_bytes_good", txoctetcount_g),
+   XLGMAC_STAT("tx_packets", txframecount_gb),
+   XLGMAC_STAT("tx_packets_good", txframecount_g),
+   XLGMAC_STAT("tx_unicast_packets", txunicastframes_gb),
+   XLGMAC_STAT("tx_broadcast_packets", txbroadcastframes_gb),
+   XLGMAC_STAT("tx_broadcast_packets_good", txbroadcastframes_g),
+   XLGMAC_STAT("tx_multicast_packets", txmulticastframes_gb),
+   XLGMAC_STAT("tx_multicast_packets_good", txmulticastframes_g),
+   XLGMAC_STAT("tx_vlan_packets_good", txvlanframes_g),
+   XLGMAC_STAT("tx_64_byte_packets", tx64octets_gb),
+   XLGMAC_STAT("tx_65_to_127_byte_packets", tx65to127octets_gb),
+   XLGMAC_STAT("tx_128_to_255_byte_packets", tx128to255octets_gb),
+   XLGMAC_STAT("tx_256_to_511_byte_packets", tx256to511octets_gb),
+   XLGMAC_STAT("tx_512_to_1023_byte_packets", tx512to1023octets_gb),
+   XLGMAC_STAT("tx_1024_to_max_byte_packets", tx1024tomaxoctets_gb),
+   XLGMAC_STAT("tx_underflow_errors", txunderflowerror),
+   XLGMAC_STAT("tx_pause_frames", txpauseframes),
+
+   /* MMC RX counters */
+   XLGMAC_STAT("rx_bytes", rxoctetcount_gb),
+   XLGMAC_STAT("rx_bytes_good", rxoctetcount_g),
+   XLGMAC_

[PATCH net-next 2/2] net: dwc-xlgmac: use dual license

2017-03-22 Thread Jie Deng
The driver "dwc-xlgmac" is dual-licensed.
Declare the dual license with MODULE_LICENSE().

Signed-off-by: Jie Deng <jied...@synopsys.com>
---
 drivers/net/ethernet/synopsys/dwc-xlgmac-common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
index cb11928..07def2b 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
@@ -21,9 +21,10 @@
 #include "dwc-xlgmac.h"
 #include "dwc-xlgmac-reg.h"
 
+MODULE_LICENSE("Dual BSD/GPL");
+
 static int debug = -1;
 module_param(debug, int, 0644);
-MODULE_LICENSE("GPL");
 MODULE_PARM_DESC(debug, "DWC ethernet debug level (0=none,...,16=all)");
 static const u32 default_msg_level = (NETIF_MSG_LINK | NETIF_MSG_IFDOWN |
  NETIF_MSG_IFUP);
-- 
1.9.1



[PATCH net-next 1/2] net: dwc-xlgmac: declaration of dual license in headers

2017-03-22 Thread Jie Deng
The driver "dwc-xlgmac" is dual-licensed. This patch adds
declaration of dual license in file headers.

Signed-off-by: Jie Deng <jied...@synopsys.com>
---
 drivers/net/ethernet/synopsys/dwc-xlgmac-common.c | 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c   | 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c | 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c| 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c| 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac-reg.h| 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac.h| 6 ++
 7 files changed, 14 insertions(+), 28 deletions(-)

diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
index b72196a..cb11928 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
@@ -2,10 +2,8 @@
  *
  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
  *
  * This Synopsys DWC XLGMAC software driver and associated documentation
  * (hereinafter the "Software") is an unsupported proprietary work of
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c
index 39b5cb9..e9672b1 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c
@@ -2,10 +2,8 @@
  *
  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
  *
  * This Synopsys DWC XLGMAC software driver and associated documentation
  * (hereinafter the "Software") is an unsupported proprietary work of
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c
index 1e25a86..0dec1dc 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c
@@ -2,10 +2,8 @@
  *
  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
  *
  * This Synopsys DWC XLGMAC software driver and associated documentation
  * (hereinafter the "Software") is an unsupported proprietary work of
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
index 5e8428b..6acf86c 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
@@ -2,10 +2,8 @@
  *
  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
  *
  * This Synopsys DWC XLGMAC software driver and associated documentation
  * (hereinafter the "Software") is an unsupported proprietary work of
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
index 504e80d..386bafe 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
@@ -2,10 +2,8 @@
  *
  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License (&qu

Re: [PATCH net-next 1/2] net: dwc-xlgmac: declaration of dual license in headers

2017-03-22 Thread Jie Deng
On 2017/3/23 2:50, David Miller wrote:

> From: Jie Deng <jie.de...@synopsys.com>
> Date: Tue, 21 Mar 2017 11:59:04 +0800
>
>> This patch adds declaration of dual license in file headers.
>>
>> Signed-off-by: Jie Deng <jied...@synopsys.com>
> My apologies.  I applied Arnd's patches.  Could you please respin
> these two patches against net-next so that the final result is what
> you want?
>
> Thanks.
Sure. Thanks.


Re: [patch -next] net: dwc-xlgmac: fix an error code in xlgmac_alloc_pages()

2017-03-21 Thread Jie Deng
On 2017/3/22 4:42, Dan Carpenter wrote:

> The dma_mapping_error() returns true if there is an error but we want
> to return -ENOMEM and not 1.
>
> Fixes: 65e0ace2c5cd ("net: dwc-xlgmac: Initial driver for DesignWare 
> Enterprise Ethernet")
> Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com>
>
> diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c 
> b/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c
> index 55c796ed7d26..39b5cb967bba 100644
> --- a/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c
> +++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c
> @@ -335,7 +335,6 @@ static int xlgmac_alloc_pages(struct xlgmac_pdata *pdata,
>  {
>   struct page *pages = NULL;
>   dma_addr_t pages_dma;
> - int ret;
>  
>   /* Try to obtain pages, decreasing order if necessary */
>   gfp |= __GFP_COLD | __GFP_COMP | __GFP_NOWARN;
> @@ -352,10 +351,9 @@ static int xlgmac_alloc_pages(struct xlgmac_pdata *pdata,
>   /* Map the pages */
>   pages_dma = dma_map_page(pdata->dev, pages, 0,
>PAGE_SIZE << order, DMA_FROM_DEVICE);
> - ret = dma_mapping_error(pdata->dev, pages_dma);
> - if (ret) {
> + if (dma_mapping_error(pdata->dev, pages_dma)) {
>   put_page(pages);
> -     return ret;
> + return -ENOMEM;
>   }
>  
>   pa->pages = pages;
Thanks for fixes.
Reviewed-by: Jie Deng <jied...@synopsys.com>


[PATCH net-next 1/2] net: dwc-xlgmac: declaration of dual license in headers

2017-03-20 Thread Jie Deng
This patch adds declaration of dual license in file headers.

Signed-off-by: Jie Deng <jied...@synopsys.com>
---
 drivers/net/ethernet/synopsys/dwc-xlgmac-common.c | 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c   | 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c | 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c| 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c| 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac-reg.h| 6 ++
 drivers/net/ethernet/synopsys/dwc-xlgmac.h| 6 ++
 7 files changed, 14 insertions(+), 28 deletions(-)

diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
index 726d78a..53ad707 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
@@ -2,10 +2,8 @@
  *
  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
  *
  * This Synopsys DWC XLGMAC software driver and associated documentation
  * (hereinafter the "Software") is an unsupported proprietary work of
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c
index 55c796e..bfe810e 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c
@@ -2,10 +2,8 @@
  *
  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
  *
  * This Synopsys DWC XLGMAC software driver and associated documentation
  * (hereinafter the "Software") is an unsupported proprietary work of
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c
index 5cf3e90..e2a58ec 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c
@@ -2,10 +2,8 @@
  *
  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
  *
  * This Synopsys DWC XLGMAC software driver and associated documentation
  * (hereinafter the "Software") is an unsupported proprietary work of
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
index 5e8428b..6acf86c 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
@@ -2,10 +2,8 @@
  *
  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
  *
  * This Synopsys DWC XLGMAC software driver and associated documentation
  * (hereinafter the "Software") is an unsupported proprietary work of
diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
index 504e80d..386bafe 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-pci.c
@@ -2,10 +2,8 @@
  *
  * Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
+ * This program is dual-licensed; you may select either version 2 of
+ * the GNU General Public License ("GPL") or BSD license ("BSD").
  *
  * This 

[PATCH net-next 2/2] net: dwc-xlgmac: add module license

2017-03-20 Thread Jie Deng
Fix the warning about missing MODULE_LICENSE().

Signed-off-by: Jie Deng <jied...@synopsys.com>
---
 drivers/net/ethernet/synopsys/dwc-xlgmac-common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c 
b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
index 53ad707..07def2b 100644
--- a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
+++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
@@ -21,6 +21,8 @@
 #include "dwc-xlgmac.h"
 #include "dwc-xlgmac-reg.h"
 
+MODULE_LICENSE("Dual BSD/GPL");
+
 static int debug = -1;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "DWC ethernet debug level (0=none,...,16=all)");
-- 
1.9.1



Re: [PATCH 2/2] [net-next] net: dwc-xlgmac: add module license

2017-03-20 Thread Jie Deng
On 2017/3/20 16:51, Arnd Bergmann wrote:
> When building the driver as a module, we get a warning about the
> lack of a license:
>
> WARNING: modpost: missing MODULE_LICENSE() in 
> drivers/net/ethernet/synopsys/dwc-xlgmac.o
> see include/linux/module.h for more information
>
> Curiously the text in the .c files only mentions GPLv2+, while the license
> tag in the PCI driver contains both GPL and BSD. I picked the license text
> as the more definite reference here and put a GPL tag in there.
>
> Fixes: 65e0ace2c5cd ("net: dwc-xlgmac: Initial driver for DesignWare 
> Enterprise Ethernet")
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/net/ethernet/synopsys/dwc-xlgmac-common.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c 
> b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
> index 726d78ac4907..b72196ab647f 100644
> --- a/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
> +++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-common.c
> @@ -25,6 +25,7 @@
>  
>  static int debug = -1;
>  module_param(debug, int, 0644);
> +MODULE_LICENSE("GPL");
>  MODULE_PARM_DESC(debug, "DWC ethernet debug level (0=none,...,16=all)");
>  static const u32 default_msg_level = (NETIF_MSG_LINK | NETIF_MSG_IFDOWN |
> NETIF_MSG_IFUP);
This driver uses dual license. I will update the headers to include BSD. Thanks!


Re: [PATCH 1/2] [net-next] net: dwc-xlgmac: include dcbnl.h

2017-03-20 Thread Jie Deng


On 2017/3/20 16:51, Arnd Bergmann wrote:
> Without this header, we can run into a build error:
>
> drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c: In function 
> 'xlgmac_config_queue_mapping':
> drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c:1548:36: error: 
> 'IEEE_8021QAZ_MAX_TCS' undeclared (first use in this function)
>   prio_queues = min_t(unsigned int, IEEE_8021QAZ_MAX_TCS,
>
> Fixes: 65e0ace2c5cd ("net: dwc-xlgmac: Initial driver for DesignWare 
> Enterprise Ethernet")
> Signed-off-by: Arnd Bergmann <a...@arndb.de>
> ---
>  drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c 
> b/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c
> index 5cf3e90d4834..1e25a86f6a27 100644
> --- a/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c
> +++ b/drivers/net/ethernet/synopsys/dwc-xlgmac-hw.c
> @@ -22,6 +22,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include "dwc-xlgmac.h"
>  #include "dwc-xlgmac-reg.h"
Thanks.
Reviewed-by: Jie Deng <jied...@synopsys.com>


Re: [PATCH v2 2/2] stmmac: rename it to synopsys

2017-01-11 Thread Jie Deng
Hi Joao,

On 2017/1/11 18:35, Joao Pinto wrote:
> Hi Jie,
>
> Às 4:00 AM de 1/11/2017, Jie Deng escreveu:
>> Hi Joao,
>>
>>
>> On 2017/1/10 22:52, Joao Pinto wrote:
>>> This patch renames stmicro/stmmac to synopsys/ since it is a standard
>>> ethernet software package regarding synopsys ethernet controllers, 
>>> supporting
>>> the majority of Synopsys Ethernet IPs. The config IDs remain the same, for
>>> retro-compatibility, only the description was changed.
>>>
>>> Signed-off-by: Joao Pinto <jpi...@synopsys.com>
>>> ---
>>> changes v1->v2:
>>> - nothing changed. Just to keep up with patch set version
>>>
>>> @@ -1,5 +1,5 @@
>>>  config STMMAC_ETH
>>> -   tristate "STMicroelectronics 10/100/1000 Ethernet driver"
>>> +   tristate "Synopsys Ethernet drivers"
>>> depends on HAS_IOMEM && HAS_DMA
>>> select MII
>>> select PHYLIB
>>> @@ -14,7 +14,7 @@ config STMMAC_ETH
>>>  if STMMAC_ETH
>>>  
>> "Synopsys Ethernet drivers" is too generic. The name should reflect the
>> controller. This driver is for Synopsys GMAC 10M/100M/1G IPs. We will submit 
>> a
>> driver for the new 25G/40G/50G/100G XLGMAC IP in the future.
> As you know Synopsys is an IP vendor that as a wide range of IPs related to
> Ethernet. stmmac is a driver that was well built and well maintained and
> supports most of those Ethernet IPs, so it has the potential to be the 
> official
> Synopsys Ethernet driver suite in the future.
>
> Let's make baby steps. For now stmmac supports 10M/100M/1G and also QoS which 
> is
> a separated IP and the different IP cores are selected by device tree.
>
> In the future it would be usefull to be selectable by Kconfig options, making 
> it
> more clear to the kernel user. For example:
>
> Synopsys Ethernet drivers
>   eQoS Core
>   10M Core
>   100M Core
>   1G Core
>   25G Core
>   
>
> The XLGMAC will be great for our users and I will be 100% available to help 
> you
> with it.
>
> Thanks,
> Joao
>
Currently, Synopsys has three series IPs cores. They are
1. 10M/100M/1G   (GMAC, QoS)
2. 1G/2.5G/5G/10G (XGMAC)
3. 10G/25G/40G/50G/100G (XLGMAC)
More info: https://www.synopsys.com/designware-ip/interface-ip/ethernet.html
 
You have successfully merged  dwc_eth_qos.c into stmmac. stmmac now fully
supports the 10M/100M/1G series IPs. Personally, I do support Florian's
suggestion not to rename stmmac.
considering to avoid  future confusion and make easy maintenance, Following is
my suggestions
   1. not to do any rename
   2. keep all 10M/100M/1G IPs (GMAC, QoS) development in stmmac.
   3. keep all 1G/2.5G/5G/10G IP (XGMAC) development in amd-xgbe.
   4. submit a new driver under synopsys/ for the new 10G/25G/40G/50G/100G
(XLGMAC) IP.

Welcome opinions from others.

Thanks,
Jie



Re: [PATCH v2 2/2] stmmac: rename it to synopsys

2017-01-10 Thread Jie Deng
Hi Joao,


On 2017/1/10 22:52, Joao Pinto wrote:
> This patch renames stmicro/stmmac to synopsys/ since it is a standard
> ethernet software package regarding synopsys ethernet controllers, supporting
> the majority of Synopsys Ethernet IPs. The config IDs remain the same, for
> retro-compatibility, only the description was changed.
>
> Signed-off-by: Joao Pinto 
> ---
> changes v1->v2:
> - nothing changed. Just to keep up with patch set version
>
> @@ -1,5 +1,5 @@
>  config STMMAC_ETH
> - tristate "STMicroelectronics 10/100/1000 Ethernet driver"
> + tristate "Synopsys Ethernet drivers"
>   depends on HAS_IOMEM && HAS_DMA
>   select MII
>   select PHYLIB
> @@ -14,7 +14,7 @@ config STMMAC_ETH
>  if STMMAC_ETH
>  
"Synopsys Ethernet drivers" is too generic. The name should reflect the
controller. This driver is for Synopsys GMAC 10M/100M/1G IPs. We will submit a
driver for the new 25G/40G/50G/100G XLGMAC IP in the future.
>  config STMMAC_PLATFORM
> - tristate "STMMAC Platform bus support"
> + tristate "Platform bus support"
>   depends on STMMAC_ETH
>   select MFD_SYSCON
>   default y
> @@ -149,13 +149,13 @@ config DWMAC_SUNXI
>  endif
>  
>  config STMMAC_PCI
> - tristate "STMMAC PCI bus support"
> + tristate "PCI bus support"
>   depends on STMMAC_ETH && PCI
>   ---help---
> This is to select the Synopsys DWMAC available on PCI devices,
> if you have a controller with this interface, say Y or M here.
>  
> -   This PCI support is tested on XLINX XC2V3000 FF1152AMT0221
> +   This PCI support was tested on XLINX XC2V3000 FF1152AMT0221
> D1215994A VIRTEX FPGA board.
The name is also too generic. Please try to reflect the controller.

Thanks,
Jie


[PATCH net-next] net: phy: add extension of phy-mode for XLGMII

2017-01-03 Thread Jie Deng
The Synopsys DWC_xlgmac core provides a multiplexed 40-Gigabit
Media-Independent Interface (XLGMII, an IEEE 802.3 Clause 81
compliant reconciliation sub-layer) for communication with
the 100/50/40/25-Gigabit PHY and 10-Gigabit Media-Independent
Interface (XGMII, an IEEE 802.3 Clause 46 compliant reconciliation
sub-layer) for communication with the 10-Gigabit PHY.

Currently, There are only interface mode definitions for "xgmii".
This patch adds the definitions for the PHY layer to recognize
"xlgmii" as a valid PHY interface.

Signed-off-by: Jie Deng <jied...@synopsys.com>
---
 include/linux/phy.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index f7d95f6..7b6bfb3 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -82,6 +82,7 @@
PHY_INTERFACE_MODE_MOCA,
PHY_INTERFACE_MODE_QSGMII,
PHY_INTERFACE_MODE_TRGMII,
+   PHY_INTERFACE_MODE_XLGMII,
PHY_INTERFACE_MODE_MAX,
 } phy_interface_t;
 
@@ -142,6 +143,8 @@ static inline const char *phy_modes(phy_interface_t 
interface)
return "qsgmii";
case PHY_INTERFACE_MODE_TRGMII:
return "trgmii";
+   case PHY_INTERFACE_MODE_XLGMII:
+   return "xlgmii";
default:
return "unknown";
}
-- 
1.9.1



Re: stmmac driver...

2016-12-14 Thread Jie Deng
Hi David,

 Giuseppe and Alexandre,

 There are a lot of patches and discussions happening around the stammc
 driver lately and both of you are listed as the maintainers.

 I really need prompt and conclusive reviews of these patch submissions
 from you, and participation in all discussions about the driver.
>>>
>>> yes we are trying to do the best.
>>>
 Otherwise I have only three things I can do: 1) let the patches rot in
 patchwork for days 2) trust that the patches are sane and fit your
 desires and goals and just apply them or 3) reject them since they
 aren't being reviewed properly.
>>>
>>> at this stage, I think the best is: (3).
>> I think the patches David mentioned also included XLGMAC. He sent this email
>> before I explained QoS and XLGMAC were different IPs. Do you mind we do 
>> XLGMAC
>> development under drivers/net/ethernet/synopsys/ ? I think we don't have
>> conflict since we will keep QoS development in stmmac.
>
> Great. Many thanks for the clarification :-)
>
> Regards
> Peppe
>
Do you agree that we do XLGMAC  development under drivers/net/ethernet/synopsys/
in the future ?
There is no conflict of interest since this is a new IP without driver. As you
see, there are several drivers for QoS (GMAC) and several drivers for XGMAC. We
want to avoid this situation for the new IP XLGMAC.

Regards,
Jie



Re: stmmac driver...

2016-12-13 Thread Jie Deng
Hi Peppe,

On 2016/12/12 22:17, Giuseppe CAVALLARO wrote:
> Hi David
>
> On 12/7/2016 7:06 PM, David Miller wrote:
>>
>> Giuseppe and Alexandre,
>>
>> There are a lot of patches and discussions happening around the stammc
>> driver lately and both of you are listed as the maintainers.
>>
>> I really need prompt and conclusive reviews of these patch submissions
>> from you, and participation in all discussions about the driver.
>
> yes we are trying to do the best.
>
>> Otherwise I have only three things I can do: 1) let the patches rot in
>> patchwork for days 2) trust that the patches are sane and fit your
>> desires and goals and just apply them or 3) reject them since they
>> aren't being reviewed properly.
>
> at this stage, I think the best is: (3).
I think the patches David mentioned also included XLGMAC. He sent this email
before I explained QoS and XLGMAC were different IPs. Do you mind we do XLGMAC
development under drivers/net/ethernet/synopsys/ ? I think we don't have
conflict since we will keep QoS development in stmmac.
>
>>
>> Thanks in advance.
>>
> you are welcome
>
>
> Peppe



Re: [PATCH net-next 1/2] net: phy: add extension of phy-mode for XLGMII

2016-12-09 Thread Jie Deng


On 2016/12/10 0:39, Andrew Lunn wrote:
> On Fri, Dec 09, 2016 at 01:19:07PM +0800, Jie Deng wrote:
>>
>> On 2016/12/9 6:15, Florian Fainelli wrote:
>>> On 12/06/2016 07:57 PM, Jie Deng wrote:
>>>> This patch adds phy-mode support for Synopsys XLGMAC
>>> The functional changes look good, but I would like to see some
>>> description of what the XL part stands for here.
>>>
>>> While you are modifying this, do you also mind submitting a Device Tree
>>> specification change:
>>>
>>> https://www.devicetree.org/specifications/
>>>
>>> Thanks!
>> Thank you for the information.
>>
>> Currenlty, the XLGMAC is a new IP from Synopsys.
> I think Florian wants to know about the IEEE standard or what ever
> which defines what the phy-mode XLGMAC is, in the same way there are
> standards for RGMII, SGMII, etc.
>
> Andrew
Understood! Thank you !


Re: Synopsys Ethernet QoS

2016-12-09 Thread Jie Deng


On 2016/12/10 8:16, Andy Shevchenko wrote:
> On Sat, Dec 10, 2016 at 12:52 AM, Florian Fainelli  
> wrote:
>
>> It's kind of sad that customers of that IP (stmmac, amd-xgbe, sxgbe)
>> did
>> actually pioneer the upstreaming effort, but it is good to see people
>> from Synopsys willing to fix that in the future.
> Wait, you would like to tell that we have more than 2 drivers for the
> same (okay, same vendor) IP?!
> It's better to unify them earlier, than have n+ copies.
>
> P.S. Though, I don't see how sxgbe got in the list. First glance on
> the code doesn't show similarities.
Glance on sxgbe_reg.h the register seems from Synopsys XGMAC IP... Probably,
amd-xgbe and sxgbe targeted the same IP



Re: stmmac driver...

2016-12-09 Thread Jie Deng


On 2016/12/8 23:25, David Miller wrote:
> From: Alexandre Torgue 
> Date: Thu, 8 Dec 2016 14:55:04 +0100
>
>> Maybe I forget some series. Do you have others in mind ?
> Please see the thread titled:
>
> "net: ethernet: Initial driver for Synopsys DWC XLGMAC"
>
> which seems to be discussing consolidation of various drivers
> for the same IP core, of which stmmac is one.
>
> I personally am against any change of the driver name and
> things like this, and wish the people doing that work would
> simply contribute to making whatever changes they need directly
> to the stmmac driver.
>
> You really need to voice your opinion when major changes are being
> proposed for the driver you maintain.
>
Hi David and Alex,

XLGMAC is not a version of GMAC. Synopsys has several IPs and each IP has
several versions.

GMAC(QoS): 3.5, 3.7, 4.0, 4.10, 4.20...
XGMAC: 1.00, 1.10, 1.20, 2.00, 2.10, 2.11...
XLGMAC (Synopsys DesignWare Core Enterprise Ethernet): this is a new IP.

Regards,
Jie



Re: [PATCH net-next 1/2] net: phy: add extension of phy-mode for XLGMII

2016-12-08 Thread Jie Deng


On 2016/12/9 6:15, Florian Fainelli wrote:
> On 12/06/2016 07:57 PM, Jie Deng wrote:
>> This patch adds phy-mode support for Synopsys XLGMAC
> The functional changes look good, but I would like to see some
> description of what the XL part stands for here.
>
> While you are modifying this, do you also mind submitting a Device Tree
> specification change:
>
> https://www.devicetree.org/specifications/
>
> Thanks!
Thank you for the information.

Currenlty, the XLGMAC is a new IP from Synopsys. We are using a PCI driver for
testing on FPGA platform.  Is it possible to add these changes first and submit
a device tree in the future?
>> Signed-off-by: Jie Deng <jied...@synopsys.com>
>> ---
>>  Documentation/devicetree/bindings/net/ethernet.txt | 1 +
>>  include/linux/phy.h| 3 +++
>>  2 files changed, 4 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/net/ethernet.txt 
>> b/Documentation/devicetree/bindings/net/ethernet.txt
>> index 0515095..2378f00 100644
>> --- a/Documentation/devicetree/bindings/net/ethernet.txt
>> +++ b/Documentation/devicetree/bindings/net/ethernet.txt
>> @@ -28,6 +28,7 @@ The following properties are common to the Ethernet 
>> controllers:
>>* "rtbi"
>>* "smii"
>>* "xgmii"
>> +  * "xlgmii"
>>* "trgmii"
>>  - phy-connection-type: the same as "phy-mode" property but described in 
>> ePAPR;
>>  - phy-handle: phandle, specifies a reference to a node representing a PHY
>> diff --git a/include/linux/phy.h b/include/linux/phy.h
>> index feb8a98..b52f9f8 100644
>> --- a/include/linux/phy.h
>> +++ b/include/linux/phy.h
>> @@ -79,6 +79,7 @@
>>  PHY_INTERFACE_MODE_RTBI,
>>  PHY_INTERFACE_MODE_SMII,
>>  PHY_INTERFACE_MODE_XGMII,
>> +PHY_INTERFACE_MODE_XLGMII,
>>  PHY_INTERFACE_MODE_MOCA,
>>  PHY_INTERFACE_MODE_QSGMII,
>>  PHY_INTERFACE_MODE_TRGMII,
>> @@ -136,6 +137,8 @@ static inline const char *phy_modes(phy_interface_t 
>> interface)
>>  return "smii";
>>  case PHY_INTERFACE_MODE_XGMII:
>>  return "xgmii";
>> +case PHY_INTERFACE_MODE_XLGMII:
>> +return "xlgmii";
>>  case PHY_INTERFACE_MODE_MOCA:
>>  return "moca";
>>  case PHY_INTERFACE_MODE_QSGMII:
>>
>



Re: [PATCH net-next 0/2] Initial driver for Synopsys DWC XLGMAC

2016-12-08 Thread Jie Deng


On 2016/12/8 23:59, Alexandre Torgue wrote:
> Hi
>
> On 12/07/2016 04:57 AM, Jie Deng wrote:
>> This series provides the support for 25/40/50/100 GbE
>> devices using Synopsys DWC Enterprise Ethernet (XLGMAC).
>
> Can you explain which GMAC are you targeted ?
>
> A driver which support some Synopsys GMAC IP already exists. It support GMAC
> 3.5, 3.7, 4.0, 4.10 versions. You can find it in:
> drivers/net/ethernet/stmicro/stmmac/. When I look at all files your gonna to
> create, it looks like to ones in stmmac driver so maybe you could easily add
> your IP inside stmmac driver.
>
> Note that an other driver is existing for synopsys GMAC 4.0 IP. it is located
> in drivers/net/ethernet/synopsys/dwc_eth_qos.c and coming from AXIS guys. A
> task is ongoing to only have stmmac driver so it should be harmful to create a
> new one.
>
> Regards
> Alex
>
I didn't target any version of GMAC IP. GMAC IP (QoS IP) currently has two
drivers in mainline
drivers/net/ethernet/synopsys/dwc_eth_qos.c
drivers/net/ethernet/stmicro/stmmac/

XGMAC IP: drivers/net/ethernet/amd/xgbe

XLGMAC IP: no driver in mainline at present

For more info about Synopsys Ethernet IP, Please check:
http://www.synopsys.com/IP/InterfaceIP/Ethernet/Pages/default.aspx

I think it should be better to integrate above drivers into
drivers/net/ethernet/synopsys/. This helps to reuse codes and makes maintenance
easier. I prefer to choose AMD XGBE as a basis. This driver integrated Synopsys
internal driver and had most features supported. What do you think about this ? 
>
>
>
>>
>> The first patch adds support for Synopsys XLGMII.
>> The second patch provides the initial driver for Synopsys XLGMAC
>>
>> The driver has three layers by refactoring AMD XGBE.
>>
>> dwc-eth-xxx.x
>>   The DWC ethernet core layer (DWC ECL). This layer contains codes
>> can be shared by different DWC series ethernet cores
>>
>> dwc-xxx.x (e.g. dwc-xlgmac.c)
>>   The DWC MAC HW adapter layer (DWC MHAL). This layer contains
>> special support for a specific MAC. e.g. currently, XLGMAC.
>>
>> xxx-xxx-pci.c xxx-xxx-plat.c (e.g. dwc-xlgmac-pci.c)
>>   The glue adapter layer (GAL). Vendors who adopt Synopsys Etherent
>> cores can develop a glue driver for their platform.
>>
>> Jie Deng (2):
>>   net: phy: add extension of phy-mode for XLGMII
>>   net: ethernet: Initial driver for Synopsys DWC XLGMAC
>>
>>  Documentation/devicetree/bindings/net/ethernet.txt |1 +
>>  MAINTAINERS|6 +
>>  drivers/net/ethernet/synopsys/Kconfig  |2 +
>>  drivers/net/ethernet/synopsys/Makefile |1 +
>>  drivers/net/ethernet/synopsys/dwc/Kconfig  |   37 +
>>  drivers/net/ethernet/synopsys/dwc/Makefile |9 +
>>  drivers/net/ethernet/synopsys/dwc/dwc-eth-dcb.c|  228 ++
>>  .../net/ethernet/synopsys/dwc/dwc-eth-debugfs.c|  328 +++
>>  drivers/net/ethernet/synopsys/dwc/dwc-eth-desc.c   |  715 +
>>  .../net/ethernet/synopsys/dwc/dwc-eth-ethtool.c|  567 
>>  drivers/net/ethernet/synopsys/dwc/dwc-eth-hw.c | 3098 
>> 
>>  drivers/net/ethernet/synopsys/dwc/dwc-eth-mdio.c   |  252 ++
>>  drivers/net/ethernet/synopsys/dwc/dwc-eth-net.c| 2319 +++
>>  drivers/net/ethernet/synopsys/dwc/dwc-eth-ptp.c|  216 ++
>>  drivers/net/ethernet/synopsys/dwc/dwc-eth-regacc.h | 1115 +++
>>  drivers/net/ethernet/synopsys/dwc/dwc-eth.h|  738 +
>>  drivers/net/ethernet/synopsys/dwc/dwc-xlgmac-pci.c |  538 
>>  drivers/net/ethernet/synopsys/dwc/dwc-xlgmac.c |  135 +
>>  drivers/net/ethernet/synopsys/dwc/dwc-xlgmac.h |   85 +
>>  include/linux/phy.h|3 +
>>  20 files changed, 10393 insertions(+)
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/Kconfig
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/Makefile
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-dcb.c
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-debugfs.c
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-desc.c
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-ethtool.c
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-hw.c
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-mdio.c
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-net.c
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-ptp.c
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-regacc.h
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth.h
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-xlgmac-pci.c
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-xlgmac.c
>>  create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-xlgmac.h
>>



[PATCH net-next 0/2] Initial driver for Synopsys DWC XLGMAC

2016-12-06 Thread Jie Deng
This series provides the support for 25/40/50/100 GbE
devices using Synopsys DWC Enterprise Ethernet (XLGMAC).

The first patch adds support for Synopsys XLGMII.
The second patch provides the initial driver for Synopsys XLGMAC

The driver has three layers by refactoring AMD XGBE.

dwc-eth-xxx.x
  The DWC ethernet core layer (DWC ECL). This layer contains codes
can be shared by different DWC series ethernet cores

dwc-xxx.x (e.g. dwc-xlgmac.c)
  The DWC MAC HW adapter layer (DWC MHAL). This layer contains
special support for a specific MAC. e.g. currently, XLGMAC.

xxx-xxx-pci.c xxx-xxx-plat.c (e.g. dwc-xlgmac-pci.c)
  The glue adapter layer (GAL). Vendors who adopt Synopsys Etherent
cores can develop a glue driver for their platform.

Jie Deng (2):
  net: phy: add extension of phy-mode for XLGMII
  net: ethernet: Initial driver for Synopsys DWC XLGMAC

 Documentation/devicetree/bindings/net/ethernet.txt |1 +
 MAINTAINERS|6 +
 drivers/net/ethernet/synopsys/Kconfig  |2 +
 drivers/net/ethernet/synopsys/Makefile |1 +
 drivers/net/ethernet/synopsys/dwc/Kconfig  |   37 +
 drivers/net/ethernet/synopsys/dwc/Makefile |9 +
 drivers/net/ethernet/synopsys/dwc/dwc-eth-dcb.c|  228 ++
 .../net/ethernet/synopsys/dwc/dwc-eth-debugfs.c|  328 +++
 drivers/net/ethernet/synopsys/dwc/dwc-eth-desc.c   |  715 +
 .../net/ethernet/synopsys/dwc/dwc-eth-ethtool.c|  567 
 drivers/net/ethernet/synopsys/dwc/dwc-eth-hw.c | 3098 
 drivers/net/ethernet/synopsys/dwc/dwc-eth-mdio.c   |  252 ++
 drivers/net/ethernet/synopsys/dwc/dwc-eth-net.c| 2319 +++
 drivers/net/ethernet/synopsys/dwc/dwc-eth-ptp.c|  216 ++
 drivers/net/ethernet/synopsys/dwc/dwc-eth-regacc.h | 1115 +++
 drivers/net/ethernet/synopsys/dwc/dwc-eth.h|  738 +
 drivers/net/ethernet/synopsys/dwc/dwc-xlgmac-pci.c |  538 
 drivers/net/ethernet/synopsys/dwc/dwc-xlgmac.c |  135 +
 drivers/net/ethernet/synopsys/dwc/dwc-xlgmac.h |   85 +
 include/linux/phy.h|3 +
 20 files changed, 10393 insertions(+)
 create mode 100644 drivers/net/ethernet/synopsys/dwc/Kconfig
 create mode 100644 drivers/net/ethernet/synopsys/dwc/Makefile
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-dcb.c
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-debugfs.c
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-desc.c
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-ethtool.c
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-hw.c
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-mdio.c
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-net.c
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-ptp.c
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth-regacc.h
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-eth.h
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-xlgmac-pci.c
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-xlgmac.c
 create mode 100644 drivers/net/ethernet/synopsys/dwc/dwc-xlgmac.h

-- 
1.9.1



[PATCH net-next 1/2] net: phy: add extension of phy-mode for XLGMII

2016-12-06 Thread Jie Deng
This patch adds phy-mode support for Synopsys XLGMAC

Signed-off-by: Jie Deng <jied...@synopsys.com>
---
 Documentation/devicetree/bindings/net/ethernet.txt | 1 +
 include/linux/phy.h| 3 +++
 2 files changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/ethernet.txt 
b/Documentation/devicetree/bindings/net/ethernet.txt
index 0515095..2378f00 100644
--- a/Documentation/devicetree/bindings/net/ethernet.txt
+++ b/Documentation/devicetree/bindings/net/ethernet.txt
@@ -28,6 +28,7 @@ The following properties are common to the Ethernet 
controllers:
   * "rtbi"
   * "smii"
   * "xgmii"
+  * "xlgmii"
   * "trgmii"
 - phy-connection-type: the same as "phy-mode" property but described in ePAPR;
 - phy-handle: phandle, specifies a reference to a node representing a PHY
diff --git a/include/linux/phy.h b/include/linux/phy.h
index feb8a98..b52f9f8 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -79,6 +79,7 @@
PHY_INTERFACE_MODE_RTBI,
PHY_INTERFACE_MODE_SMII,
PHY_INTERFACE_MODE_XGMII,
+   PHY_INTERFACE_MODE_XLGMII,
PHY_INTERFACE_MODE_MOCA,
PHY_INTERFACE_MODE_QSGMII,
PHY_INTERFACE_MODE_TRGMII,
@@ -136,6 +137,8 @@ static inline const char *phy_modes(phy_interface_t 
interface)
return "smii";
case PHY_INTERFACE_MODE_XGMII:
return "xgmii";
+   case PHY_INTERFACE_MODE_XLGMII:
+   return "xlgmii";
case PHY_INTERFACE_MODE_MOCA:
return "moca";
case PHY_INTERFACE_MODE_QSGMII:
-- 
1.9.1