LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2 0/4] net: macb: add support for MII on RGMII interface
@ 2021-09-17 13:26 Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 1/4] net: macb: add description for SRTSM Claudiu Beznea
` (5 more replies)
0 siblings, 6 replies; 9+ messages in thread
From: Claudiu Beznea @ 2021-09-17 13:26 UTC (permalink / raw)
To: nicolas.ferre, davem, kuba; +Cc: netdev, linux-kernel, Claudiu Beznea
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/4] net: macb: add description for SRTSM
2021-09-17 13:26 [PATCH v2 0/4] net: macb: add support for MII on RGMII interface Claudiu Beznea
@ 2021-09-17 13:26 ` Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 2/4] net: macb: align for OSSMODE offset Claudiu Beznea
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Claudiu Beznea @ 2021-09-17 13:26 UTC (permalink / raw)
To: nicolas.ferre, davem, kuba; +Cc: netdev, linux-kernel, Claudiu Beznea
Add description for SRTSM bit.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 2/4] net: macb: align for OSSMODE offset
2021-09-17 13:26 [PATCH v2 0/4] net: macb: add support for MII on RGMII interface Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 1/4] net: macb: add description for SRTSM Claudiu Beznea
@ 2021-09-17 13:26 ` Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 3/4] net: macb: add support for mii on rgmii Claudiu Beznea
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Claudiu Beznea @ 2021-09-17 13:26 UTC (permalink / raw)
To: nicolas.ferre, davem, kuba; +Cc: netdev, linux-kernel, Claudiu Beznea
Align for OSSMODE offset.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 3/4] net: macb: add support for mii on rgmii
2021-09-17 13:26 [PATCH v2 0/4] net: macb: add support for MII on RGMII interface Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 1/4] net: macb: add description for SRTSM Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 2/4] net: macb: align for OSSMODE offset Claudiu Beznea
@ 2021-09-17 13:26 ` Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5 Claudiu Beznea
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Claudiu Beznea @ 2021-09-17 13:26 UTC (permalink / raw)
To: nicolas.ferre, davem, kuba; +Cc: netdev, linux-kernel, Claudiu Beznea
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 <claudiu.beznea@microchip.com>
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5
2021-09-17 13:26 [PATCH v2 0/4] net: macb: add support for MII on RGMII interface Claudiu Beznea
` (2 preceding siblings ...)
2021-09-17 13:26 ` [PATCH v2 3/4] net: macb: add support for mii on rgmii Claudiu Beznea
@ 2021-09-17 13:26 ` Claudiu Beznea
2021-09-17 13:33 ` Nicolas Ferre
2021-09-17 14:40 ` Andrew Lunn
2021-09-17 13:30 ` [PATCH v2 0/4] net: macb: add support for MII on RGMII interface Claudiu.Beznea
2021-09-18 13:20 ` patchwork-bot+netdevbpf
5 siblings, 2 replies; 9+ messages in thread
From: Claudiu Beznea @ 2021-09-17 13:26 UTC (permalink / raw)
To: nicolas.ferre, davem, kuba; +Cc: netdev, linux-kernel, Claudiu Beznea
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 <claudiu.beznea@microchip.com>
---
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 0/4] net: macb: add support for MII on RGMII interface
2021-09-17 13:26 [PATCH v2 0/4] net: macb: add support for MII on RGMII interface Claudiu Beznea
` (3 preceding siblings ...)
2021-09-17 13:26 ` [PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5 Claudiu Beznea
@ 2021-09-17 13:30 ` Claudiu.Beznea
2021-09-18 13:20 ` patchwork-bot+netdevbpf
5 siblings, 0 replies; 9+ messages in thread
From: Claudiu.Beznea @ 2021-09-17 13:30 UTC (permalink / raw)
To: Nicolas.Ferre, davem, kuba; +Cc: netdev, linux-kernel
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(-)
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5
2021-09-17 13:26 ` [PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5 Claudiu Beznea
@ 2021-09-17 13:33 ` Nicolas Ferre
2021-09-17 14:40 ` Andrew Lunn
1 sibling, 0 replies; 9+ messages in thread
From: Nicolas Ferre @ 2021-09-17 13:33 UTC (permalink / raw)
To: Claudiu Beznea, davem, kuba; +Cc: netdev, linux-kernel
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 <claudiu.beznea@microchip.com>
Yes:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Thanks Claudiu, best regards,
Nicolas
> ---
> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5
2021-09-17 13:26 ` [PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5 Claudiu Beznea
2021-09-17 13:33 ` Nicolas Ferre
@ 2021-09-17 14:40 ` Andrew Lunn
1 sibling, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2021-09-17 14:40 UTC (permalink / raw)
To: Claudiu Beznea; +Cc: nicolas.ferre, davem, kuba, netdev, linux-kernel
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 <claudiu.beznea@microchip.com>
Thanks for adding this.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 0/4] net: macb: add support for MII on RGMII interface
2021-09-17 13:26 [PATCH v2 0/4] net: macb: add support for MII on RGMII interface Claudiu Beznea
` (4 preceding siblings ...)
2021-09-17 13:30 ` [PATCH v2 0/4] net: macb: add support for MII on RGMII interface Claudiu.Beznea
@ 2021-09-18 13:20 ` patchwork-bot+netdevbpf
5 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-18 13:20 UTC (permalink / raw)
To: Claudiu Beznea; +Cc: nicolas.ferre, davem, kuba, netdev, linux-kernel
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
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-09-18 13:20 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17 13:26 [PATCH v2 0/4] net: macb: add support for MII on RGMII interface Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 1/4] net: macb: add description for SRTSM Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 2/4] net: macb: align for OSSMODE offset Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 3/4] net: macb: add support for mii on rgmii Claudiu Beznea
2021-09-17 13:26 ` [PATCH v2 4/4] net: macb: enable mii on rgmii for sama7g5 Claudiu Beznea
2021-09-17 13:33 ` Nicolas Ferre
2021-09-17 14:40 ` Andrew Lunn
2021-09-17 13:30 ` [PATCH v2 0/4] net: macb: add support for MII on RGMII interface Claudiu.Beznea
2021-09-18 13:20 ` patchwork-bot+netdevbpf
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).