All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: fec: add new type device
@ 2016-06-22 10:52 Andy Duan
  2016-06-22 10:52 ` [PATCH net-next 1/2] net: fec: add interrupt coalesc quirk flag Andy Duan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andy Duan @ 2016-06-22 10:52 UTC (permalink / raw)
  To: davem; +Cc: netdev, stephen, fugang.duan

Different i.MX SOC FEC support different features like :
    - i.MX6Q/DL FEC does not support AVB and interrupt coalesc
    - i.MX6SX/i.MX7D supports AVB and interrupt coalesc
    - i.MX6UL/ULL does not support AVB, but support interrupt coalesc

Then, add new quirk flag to judge the supported features, and add new
type device for i.MX6UL.

Andy Duan (2):
  net: fec: add interrupt coalesc quirk flag
  net: fec: use a more proper compatible string for i.MX6UL type device

 drivers/net/ethernet/freescale/fec.h      |  2 ++
 drivers/net/ethernet/freescale/fec_main.c | 27 +++++++++++++++++----------
 2 files changed, 19 insertions(+), 10 deletions(-)

-- 
1.9.1

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

* [PATCH net-next 1/2] net: fec: add interrupt coalesc quirk flag
  2016-06-22 10:52 [PATCH net-next 0/2] net: fec: add new type device Andy Duan
@ 2016-06-22 10:52 ` Andy Duan
  2016-06-22 10:52 ` [PATCH net-next 2/2] net: fec: use a more proper compatible string for i.MX6UL type device Andy Duan
  2016-06-27  8:02 ` [PATCH net-next 0/2] net: fec: add new " David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Duan @ 2016-06-22 10:52 UTC (permalink / raw)
  To: davem; +Cc: netdev, stephen, fugang.duan

Different i.MX SOC FEC support different features like :
- i.MX6Q/DL FEC does not support AVB and interrupt coalesc
- i.MX6SX/i.MX7D supports AVB and interrupt coalesc
- i.MX6UL/ULL does not support AVB, but support interrupt coalesc

So, add new quirk flag to judge the supported features.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
---
 drivers/net/ethernet/freescale/fec.h      |  2 ++
 drivers/net/ethernet/freescale/fec_main.c | 19 +++++++++----------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index f58f9ea..92fd5c0 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -442,6 +442,8 @@ struct bufdesc_ex {
 #define FEC_QUIRK_SINGLE_MDIO		(1 << 11)
 /* Controller supports RACC register */
 #define FEC_QUIRK_HAS_RACC		(1 << 12)
+/* Controller supports interrupt coalesc */
+#define FEC_QUIRK_HAS_COALESCE		(1 << 13)
 
 struct bufdesc_prop {
 	int qid;
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index c36401e..8afef20 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -111,7 +111,7 @@ static struct platform_device_id fec_devtype[] = {
 				FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
 				FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB |
 				FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE |
-				FEC_QUIRK_HAS_RACC,
+				FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE,
 	}, {
 		/* sentinel */
 	}
@@ -2358,9 +2358,6 @@ static void fec_enet_itr_coal_set(struct net_device *ndev)
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	int rx_itr, tx_itr;
 
-	if (!(fep->quirks & FEC_QUIRK_HAS_AVB))
-		return;
-
 	/* Must be greater than zero to avoid unpredictable behavior */
 	if (!fep->rx_time_itr || !fep->rx_pkts_itr ||
 	    !fep->tx_time_itr || !fep->tx_pkts_itr)
@@ -2383,10 +2380,12 @@ static void fec_enet_itr_coal_set(struct net_device *ndev)
 
 	writel(tx_itr, fep->hwp + FEC_TXIC0);
 	writel(rx_itr, fep->hwp + FEC_RXIC0);
-	writel(tx_itr, fep->hwp + FEC_TXIC1);
-	writel(rx_itr, fep->hwp + FEC_RXIC1);
-	writel(tx_itr, fep->hwp + FEC_TXIC2);
-	writel(rx_itr, fep->hwp + FEC_RXIC2);
+	if (fep->quirks & FEC_QUIRK_HAS_AVB) {
+		writel(tx_itr, fep->hwp + FEC_TXIC1);
+		writel(rx_itr, fep->hwp + FEC_RXIC1);
+		writel(tx_itr, fep->hwp + FEC_TXIC2);
+		writel(rx_itr, fep->hwp + FEC_RXIC2);
+	}
 }
 
 static int
@@ -2394,7 +2393,7 @@ fec_enet_get_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)
 {
 	struct fec_enet_private *fep = netdev_priv(ndev);
 
-	if (!(fep->quirks & FEC_QUIRK_HAS_AVB))
+	if (!(fep->quirks & FEC_QUIRK_HAS_COALESCE))
 		return -EOPNOTSUPP;
 
 	ec->rx_coalesce_usecs = fep->rx_time_itr;
@@ -2412,7 +2411,7 @@ fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	unsigned int cycle;
 
-	if (!(fep->quirks & FEC_QUIRK_HAS_AVB))
+	if (!(fep->quirks & FEC_QUIRK_HAS_COALESCE))
 		return -EOPNOTSUPP;
 
 	if (ec->rx_max_coalesced_frames > 255) {
-- 
1.9.1

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

* [PATCH net-next 2/2] net: fec: use a more proper compatible string for i.MX6UL type device
  2016-06-22 10:52 [PATCH net-next 0/2] net: fec: add new type device Andy Duan
  2016-06-22 10:52 ` [PATCH net-next 1/2] net: fec: add interrupt coalesc quirk flag Andy Duan
@ 2016-06-22 10:52 ` Andy Duan
  2016-06-27  8:02 ` [PATCH net-next 0/2] net: fec: add new " David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Duan @ 2016-06-22 10:52 UTC (permalink / raw)
  To: davem; +Cc: netdev, stephen, fugang.duan

i.MX6UL is a member in i.MX series family, the SOC FEC inherits from
i.MX6SX but removes some IP features, lets define a new type for fec
device.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 8afef20..4040003 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -113,6 +113,12 @@ static struct platform_device_id fec_devtype[] = {
 				FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE |
 				FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE,
 	}, {
+		.name = "imx6ul-fec",
+		.driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
+				FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
+				FEC_QUIRK_HAS_VLAN | FEC_QUIRK_BUG_CAPTURE |
+				FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE,
+	}, {
 		/* sentinel */
 	}
 };
@@ -125,6 +131,7 @@ enum imx_fec_type {
 	IMX6Q_FEC,
 	MVF600_FEC,
 	IMX6SX_FEC,
+	IMX6UL_FEC,
 };
 
 static const struct of_device_id fec_dt_ids[] = {
@@ -134,6 +141,7 @@ static const struct of_device_id fec_dt_ids[] = {
 	{ .compatible = "fsl,imx6q-fec", .data = &fec_devtype[IMX6Q_FEC], },
 	{ .compatible = "fsl,mvf600-fec", .data = &fec_devtype[MVF600_FEC], },
 	{ .compatible = "fsl,imx6sx-fec", .data = &fec_devtype[IMX6SX_FEC], },
+	{ .compatible = "fsl,imx6ul-fec", .data = &fec_devtype[IMX6UL_FEC], },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, fec_dt_ids);
-- 
1.9.1

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

* Re: [PATCH net-next 0/2] net: fec: add new type device
  2016-06-22 10:52 [PATCH net-next 0/2] net: fec: add new type device Andy Duan
  2016-06-22 10:52 ` [PATCH net-next 1/2] net: fec: add interrupt coalesc quirk flag Andy Duan
  2016-06-22 10:52 ` [PATCH net-next 2/2] net: fec: use a more proper compatible string for i.MX6UL type device Andy Duan
@ 2016-06-27  8:02 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-06-27  8:02 UTC (permalink / raw)
  To: fugang.duan; +Cc: netdev, stephen

From: Andy Duan <fugang.duan@nxp.com>
Date: Wed, 22 Jun 2016 18:52:34 +0800

> Different i.MX SOC FEC support different features like :
>     - i.MX6Q/DL FEC does not support AVB and interrupt coalesc
>     - i.MX6SX/i.MX7D supports AVB and interrupt coalesc
>     - i.MX6UL/ULL does not support AVB, but support interrupt coalesc
> 
> Then, add new quirk flag to judge the supported features, and add new
> type device for i.MX6UL.

Series applied, thanks.

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

end of thread, other threads:[~2016-06-27  8:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-22 10:52 [PATCH net-next 0/2] net: fec: add new type device Andy Duan
2016-06-22 10:52 ` [PATCH net-next 1/2] net: fec: add interrupt coalesc quirk flag Andy Duan
2016-06-22 10:52 ` [PATCH net-next 2/2] net: fec: use a more proper compatible string for i.MX6UL type device Andy Duan
2016-06-27  8:02 ` [PATCH net-next 0/2] net: fec: add new " David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.