[PATCH v2 0/4] net: macb: add support for MII on RGMII interface

STALE1786d

Revision v2 of 2 in this series.

9 messages, 4 authors, 2021-09-18 · open the first message on its own page

[PATCH v2 0/4] net: macb: add support for MII on RGMII interface

From: Claudiu Beznea <hidden>
Date: 2021-09-17 13:26:22

Hi,

This series adds support for MII mode on RGMII interface (patches 3/4,
4/4). Along with this the series also contains minor cleanups (patches 1/3,
2/3) on macb.h.

Thank you,
Claudiu Beznea

Changes in v2:
- added patch 4/4 to enable MII on RGMII support for SAMA7G5 MAC IPs

Claudiu Beznea (4):
  net: macb: add description for SRTSM
  net: macb: align for OSSMODE offset
  net: macb: add support for mii on rgmii
  net: macb: enable mii on rgmii for sama7g5

 drivers/net/ethernet/cadence/macb.h      | 7 +++++--
 drivers/net/ethernet/cadence/macb_main.c | 9 +++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

-- 
2.25.1

[PATCH v2 1/4] net: macb: add description for SRTSM

From: Claudiu Beznea <hidden>
Date: 2021-09-17 13:26:28

Add description for SRTSM bit.

Signed-off-by: Claudiu Beznea <redacted>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
---
 drivers/net/ethernet/cadence/macb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index d8d87213697c..d1e0e116b976 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -243,7 +243,7 @@
 #define MACB_NCR_TPF_SIZE	1
 #define MACB_TZQ_OFFSET		12 /* Transmit zero quantum pause frame */
 #define MACB_TZQ_SIZE		1
-#define MACB_SRTSM_OFFSET	15
+#define MACB_SRTSM_OFFSET	15 /* Store Receive Timestamp to Memory */
 #define MACB_OSSMODE_OFFSET 24 /* Enable One Step Synchro Mode */
 #define MACB_OSSMODE_SIZE	1
 
-- 
2.25.1

[PATCH v2 2/4] net: macb: align for OSSMODE offset

From: Claudiu Beznea <hidden>
Date: 2021-09-17 13:26:30

Align for OSSMODE offset.

Signed-off-by: Claudiu Beznea <redacted>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
---
 drivers/net/ethernet/cadence/macb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index d1e0e116b976..c33e98bfa5e8 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -244,7 +244,7 @@
 #define MACB_TZQ_OFFSET		12 /* Transmit zero quantum pause frame */
 #define MACB_TZQ_SIZE		1
 #define MACB_SRTSM_OFFSET	15 /* Store Receive Timestamp to Memory */
-#define MACB_OSSMODE_OFFSET 24 /* Enable One Step Synchro Mode */
+#define MACB_OSSMODE_OFFSET	24 /* Enable One Step Synchro Mode */
 #define MACB_OSSMODE_SIZE	1
 
 /* Bitfields in NCFGR */
-- 
2.25.1

[PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5

From: Claudiu Beznea <hidden>
Date: 2021-09-17 13:26:36

Both MAC IPs available on SAMA7G5 support MII on RGMII feature.
Enable these by adding proper capability to proper macb_config
objects.

Signed-off-by: Claudiu Beznea <redacted>
---
 drivers/net/ethernet/cadence/macb_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index cdf3e35b5b33..e2730b3e1a57 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4597,7 +4597,8 @@ static const struct macb_config zynq_config = {
 };
 
 static const struct macb_config sama7g5_gem_config = {
-	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG,
+	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG |
+		MACB_CAPS_MIIONRGMII,
 	.dma_burst_length = 16,
 	.clk_init = macb_clk_init,
 	.init = macb_init,
@@ -4605,7 +4606,8 @@ static const struct macb_config sama7g5_gem_config = {
 };
 
 static const struct macb_config sama7g5_emac_config = {
-	.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_USRIO_HAS_CLKEN,
+	.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
+		MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII,
 	.dma_burst_length = 16,
 	.clk_init = macb_clk_init,
 	.init = macb_init,
-- 
2.25.1

[PATCH v2 3/4] net: macb: add support for mii on rgmii

From: Claudiu Beznea <hidden>
Date: 2021-09-17 13:26:39

Cadence IP has option to enable MII support on RGMII interface. This
could be selected though bit 28 of network control register. This option
is not enabled on all the IP versions thus add a software capability to
be selected by the proper implementation of this IP.

Signed-off-by: Claudiu Beznea <redacted>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
---
 drivers/net/ethernet/cadence/macb.h      | 3 +++
 drivers/net/ethernet/cadence/macb_main.c | 3 +++
 2 files changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index c33e98bfa5e8..5620b97b3482 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -246,6 +246,8 @@
 #define MACB_SRTSM_OFFSET	15 /* Store Receive Timestamp to Memory */
 #define MACB_OSSMODE_OFFSET	24 /* Enable One Step Synchro Mode */
 #define MACB_OSSMODE_SIZE	1
+#define MACB_MIIONRGMII_OFFSET	28 /* MII Usage on RGMII Interface */
+#define MACB_MIIONRGMII_SIZE	1
 
 /* Bitfields in NCFGR */
 #define MACB_SPD_OFFSET		0 /* Speed */
@@ -713,6 +715,7 @@
 #define MACB_CAPS_GEM_HAS_PTP			0x00000040
 #define MACB_CAPS_BD_RD_PREFETCH		0x00000080
 #define MACB_CAPS_NEEDS_RSTONUBR		0x00000100
+#define MACB_CAPS_MIIONRGMII			0x00000200
 #define MACB_CAPS_CLK_HW_CHG			0x04000000
 #define MACB_CAPS_MACB_IS_EMAC			0x08000000
 #define MACB_CAPS_FIFO_MODE			0x10000000
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index d13fb1d31821..cdf3e35b5b33 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -684,6 +684,9 @@ static void macb_mac_config(struct phylink_config *config, unsigned int mode,
 		} else if (state->interface == PHY_INTERFACE_MODE_10GBASER) {
 			ctrl |= GEM_BIT(PCSSEL);
 			ncr |= GEM_BIT(ENABLE_HS_MAC);
+		} else if (bp->caps & MACB_CAPS_MIIONRGMII &&
+			   bp->phy_interface == PHY_INTERFACE_MODE_MII) {
+			ncr |= MACB_BIT(MIIONRGMII);
 		}
 	}
 
-- 
2.25.1

Re: [PATCH v2 0/4] net: macb: add support for MII on RGMII interface

From: <hidden>
Date: 2021-09-17 13:30:52

On 17.09.2021 16:26, Claudiu Beznea wrote:
Hi,

This series adds support for MII mode on RGMII interface (patches 3/4,
4/4). Along with this the series also contains minor cleanups (patches 1/3,
2/3) on macb.h.

Thank you,
Claudiu Beznea

Changes in v2:
- added patch 4/4 to enable MII on RGMII support for SAMA7G5 MAC IPs
and collected tags
Claudiu Beznea (4):
  net: macb: add description for SRTSM
  net: macb: align for OSSMODE offset
  net: macb: add support for mii on rgmii
  net: macb: enable mii on rgmii for sama7g5

 drivers/net/ethernet/cadence/macb.h      | 7 +++++--
 drivers/net/ethernet/cadence/macb_main.c | 9 +++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

Re: [PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5

From: Nicolas Ferre <nicolas.ferre@microchip.com>
Date: 2021-09-17 13:33:59

On 17/09/2021 at 15:26, Claudiu Beznea wrote:
Both MAC IPs available on SAMA7G5 support MII on RGMII feature.
Enable these by adding proper capability to proper macb_config
objects.

Signed-off-by: Claudiu Beznea <redacted>
Yes:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Thanks Claudiu, best regards,
   Nicolas
quoted hunk
---
  drivers/net/ethernet/cadence/macb_main.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index cdf3e35b5b33..e2730b3e1a57 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4597,7 +4597,8 @@ static const struct macb_config zynq_config = {
  };
  
  static const struct macb_config sama7g5_gem_config = {
-	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG,
+	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG |
+		MACB_CAPS_MIIONRGMII,
  	.dma_burst_length = 16,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -4605,7 +4606,8 @@ static const struct macb_config sama7g5_gem_config = {
  };
  
  static const struct macb_config sama7g5_emac_config = {
-	.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_USRIO_HAS_CLKEN,
+	.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
+		MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII,
  	.dma_burst_length = 16,
  	.clk_init = macb_clk_init,
  	.init = macb_init,

-- 
Nicolas Ferre

Re: [PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5

From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-09-17 14:41:01

On Fri, Sep 17, 2021 at 04:26:15PM +0300, Claudiu Beznea wrote:
Both MAC IPs available on SAMA7G5 support MII on RGMII feature.
Enable these by adding proper capability to proper macb_config
objects.

Signed-off-by: Claudiu Beznea <redacted>
Thanks for adding this.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

Re: [PATCH v2 0/4] net: macb: add support for MII on RGMII interface

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-09-18 13:20:16

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Fri, 17 Sep 2021 16:26:11 +0300 you wrote:
Hi,

This series adds support for MII mode on RGMII interface (patches 3/4,
4/4). Along with this the series also contains minor cleanups (patches 1/3,
2/3) on macb.h.

Thank you,
Claudiu Beznea

[...]
Here is the summary with links:
  - [v2,1/4] net: macb: add description for SRTSM
    https://git.kernel.org/netdev/net-next/c/1dac0084d412
  - [v2,2/4] net: macb: align for OSSMODE offset
    https://git.kernel.org/netdev/net-next/c/d7b3485f1c2b
  - [v2,3/4] net: macb: add support for mii on rgmii
    https://git.kernel.org/netdev/net-next/c/1a9b5a26daf6
  - [v2,4/4] net: macb: enable mii on rgmii for sama7g5
    https://git.kernel.org/netdev/net-next/c/0f4f6d7332bb

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help