[PATCH] ibm_newemac: Add MII mode support to the EMAC RGMII bridge.

Subsystems: networking drivers, the rest

STALE6595d

8 messages, 4 authors, 2008-07-11 · open the first message on its own page

[PATCH] ibm_newemac: Add MII mode support to the EMAC RGMII bridge.

From: Grant Erickson <hidden>
Date: 2008-07-07 23:32:01

This patch adds support to the RGMII handler in the EMAC driver for
the MII PHY mode such that device tree entries of the form `phy-mode = "mii";'
are recognized and handled appropriately.

While logically, in software, "gmii" and "mii" modes are the same,
they are wired differently, so it makes sense to allow DTS authors to
specify each explicitly.

Signed-off-by: Grant Erickson <redacted>
---
 drivers/net/ibm_newemac/rgmii.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ibm_newemac/rgmii.c b/drivers/net/ibm_newemac/rgmii.c
index e32da3d..5acb006 100644
--- a/drivers/net/ibm_newemac/rgmii.c
+++ b/drivers/net/ibm_newemac/rgmii.c
@@ -39,6 +39,7 @@
 #define RGMII_FER_RGMII(idx)	(0x5 << ((idx) * 4))
 #define RGMII_FER_TBI(idx)	(0x6 << ((idx) * 4))
 #define RGMII_FER_GMII(idx)	(0x7 << ((idx) * 4))
+#define RGMII_FER_MII(idx)	(0x7 << ((idx) * 4))
 
 /* RGMIIx_SSR */
 #define RGMII_SSR_MASK(idx)	(0x7 << ((idx) * 8))
@@ -49,6 +50,7 @@
 static inline int rgmii_valid_mode(int phy_mode)
 {
 	return  phy_mode == PHY_MODE_GMII ||
+		phy_mode == PHY_MODE_MII ||
 		phy_mode == PHY_MODE_RGMII ||
 		phy_mode == PHY_MODE_TBI ||
 		phy_mode == PHY_MODE_RTBI;
@@ -63,6 +65,8 @@ static inline const char *rgmii_mode_name(int mode)
 		return "TBI";
 	case PHY_MODE_GMII:
 		return "GMII";
+	case PHY_MODE_MII:
+		return "MII";
 	case PHY_MODE_RTBI:
 		return "RTBI";
 	default:
@@ -79,6 +83,8 @@ static inline u32 rgmii_mode_mask(int mode, int input)
 		return RGMII_FER_TBI(input);
 	case PHY_MODE_GMII:
 		return RGMII_FER_GMII(input);
+	case PHY_MODE_MII:
+		return RGMII_FER_MII(input);
 	case PHY_MODE_RTBI:
 		return RGMII_FER_RTBI(input);
 	default:
--
1.5.4.3

Re: [PATCH] ibm_newemac: Add MII mode support to the EMAC RGMII bridge.

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-07-07 23:40:52

On Mon, 2008-07-07 at 16:31 -0700, Grant Erickson wrote:
 #define RGMII_FER_GMII(idx)    (0x7 << ((idx) * 4))
+#define RGMII_FER_MII(idx)     (0x7 << ((idx) * 4))
Hrm... the setting of the register is exactly the same right ?

Do we -really- need that ?

Ben.

Re: [PATCH] ibm_newemac: Add MII mode support to the EMAC RGMII bridge.

From: Grant Erickson <hidden>
Date: 2008-07-07 23:48:01

On 7/7/08 4:40 PM, Benjamin Herrenschmidt wrote:
On Mon, 2008-07-07 at 16:31 -0700, Grant Erickson wrote:
quoted
 #define RGMII_FER_GMII(idx)    (0x7 << ((idx) * 4))
+#define RGMII_FER_MII(idx)     (0x7 << ((idx) * 4))
Hrm... the setting of the register is exactly the same right ?

Do we -really- need that ?
Would you prefer?

    +#define RGMII_FER_MII(idx)     RGMII_FER_GMII(idx)

Having the "extra" mnemonic makes the code end up looking less like a typo
and more like a conscious decision: "Yes, we know MII and GMII are the same
setting, but we're being explicit about it."

-Grant

Re: [PATCH] ibm_newemac: Add MII mode support to the EMAC RGMII bridge.

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-07-08 00:46:17

On Mon, 2008-07-07 at 16:47 -0700, Grant Erickson wrote:
Would you prefer?

    +#define RGMII_FER_MII(idx)     RGMII_FER_GMII(idx)

Having the "extra" mnemonic makes the code end up looking less like a typo
and more like a conscious decision: "Yes, we know MII and GMII are the same
setting, but we're being explicit about it."
Yeah, that looks better. Either that or a comment. 

Cheers,
Ben.

[PATCH v2] ibm_newemac: Add MII mode support to the EMAC RGMII bridge.

From: Grant Erickson <hidden>
Date: 2008-07-08 15:03:15

This patch adds support to the RGMII handler in the EMAC driver for
the MII PHY mode such that device tree entries of the form `phy-mode = "mii";'
are recognized and handled appropriately.

While logically, in software, "gmii" and "mii" modes are the same,
they are wired differently, so it makes sense to allow DTS authors to
specify each explicitly.

Signed-off-by: Grant Erickson <redacted>
---
 drivers/net/ibm_newemac/rgmii.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ibm_newemac/rgmii.c b/drivers/net/ibm_newemac/rgmii.c
index e32da3d..5acb006 100644
--- a/drivers/net/ibm_newemac/rgmii.c
+++ b/drivers/net/ibm_newemac/rgmii.c
@@ -39,6 +39,7 @@
 #define RGMII_FER_RGMII(idx)	(0x5 << ((idx) * 4))
 #define RGMII_FER_TBI(idx)	(0x6 << ((idx) * 4))
 #define RGMII_FER_GMII(idx)	(0x7 << ((idx) * 4))
+#define RGMII_FER_MII(idx)	RGMII_FER_GMII(idx)
 
 /* RGMIIx_SSR */
 #define RGMII_SSR_MASK(idx)	(0x7 << ((idx) * 8))
@@ -49,6 +50,7 @@
 static inline int rgmii_valid_mode(int phy_mode)
 {
 	return  phy_mode == PHY_MODE_GMII ||
+		phy_mode == PHY_MODE_MII ||
 		phy_mode == PHY_MODE_RGMII ||
 		phy_mode == PHY_MODE_TBI ||
 		phy_mode == PHY_MODE_RTBI;
@@ -63,6 +65,8 @@ static inline const char *rgmii_mode_name(int mode)
 		return "TBI";
 	case PHY_MODE_GMII:
 		return "GMII";
+	case PHY_MODE_MII:
+		return "MII";
 	case PHY_MODE_RTBI:
 		return "RTBI";
 	default:
@@ -79,6 +83,8 @@ static inline u32 rgmii_mode_mask(int mode, int input)
 		return RGMII_FER_TBI(input);
 	case PHY_MODE_GMII:
 		return RGMII_FER_GMII(input);
+	case PHY_MODE_MII:
+		return RGMII_FER_MII(input);
 	case PHY_MODE_RTBI:
 		return RGMII_FER_RTBI(input);
 	default:
--
1.5.4.3

Re: [PATCH v2] ibm_newemac: Add MII mode support to the EMAC RGMII bridge.

From: Stefan Roese <sr@denx.de>
Date: 2008-07-08 15:36:50

On Tuesday 08 July 2008, Grant Erickson wrote:
This patch adds support to the RGMII handler in the EMAC driver for
the MII PHY mode such that device tree entries of the form `phy-mode =
"mii";' are recognized and handled appropriately.

While logically, in software, "gmii" and "mii" modes are the same,
they are wired differently, so it makes sense to allow DTS authors to
specify each explicitly.

Signed-off-by: Grant Erickson <redacted>
Acked-by: Stefan Roese <sr@denx.de>

Best regards,
Stefan

Re: [PATCH v2] ibm_newemac: Add MII mode support to the EMAC RGMII bridge.

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-07-09 03:23:39

On Tue, 2008-07-08 at 08:03 -0700, Grant Erickson wrote:
This patch adds support to the RGMII handler in the EMAC driver for
the MII PHY mode such that device tree entries of the form `phy-mode = "mii";'
are recognized and handled appropriately.

While logically, in software, "gmii" and "mii" modes are the same,
they are wired differently, so it makes sense to allow DTS authors to
specify each explicitly.

Signed-off-by: Grant Erickson <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

Jeff, I'd like to apply that (and other EMAC patches for 2.6.27, do you
have anything else pending ?) via my tree provided you give me your ack.
The reason is that the multicast fix one is going that way as it touches
other arch files, and subsequent ones are now likely to conflict.

Let me know if that's ok with you in which case I'll stick your ack in
there.

Cheers,
Ben.
quoted hunk
---
 drivers/net/ibm_newemac/rgmii.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ibm_newemac/rgmii.c b/drivers/net/ibm_newemac/rgmii.c
index e32da3d..5acb006 100644
--- a/drivers/net/ibm_newemac/rgmii.c
+++ b/drivers/net/ibm_newemac/rgmii.c
@@ -39,6 +39,7 @@
 #define RGMII_FER_RGMII(idx)	(0x5 << ((idx) * 4))
 #define RGMII_FER_TBI(idx)	(0x6 << ((idx) * 4))
 #define RGMII_FER_GMII(idx)	(0x7 << ((idx) * 4))
+#define RGMII_FER_MII(idx)	RGMII_FER_GMII(idx)
 
 /* RGMIIx_SSR */
 #define RGMII_SSR_MASK(idx)	(0x7 << ((idx) * 8))
@@ -49,6 +50,7 @@
 static inline int rgmii_valid_mode(int phy_mode)
 {
 	return  phy_mode == PHY_MODE_GMII ||
+		phy_mode == PHY_MODE_MII ||
 		phy_mode == PHY_MODE_RGMII ||
 		phy_mode == PHY_MODE_TBI ||
 		phy_mode == PHY_MODE_RTBI;
@@ -63,6 +65,8 @@ static inline const char *rgmii_mode_name(int mode)
 		return "TBI";
 	case PHY_MODE_GMII:
 		return "GMII";
+	case PHY_MODE_MII:
+		return "MII";
 	case PHY_MODE_RTBI:
 		return "RTBI";
 	default:
@@ -79,6 +83,8 @@ static inline u32 rgmii_mode_mask(int mode, int input)
 		return RGMII_FER_TBI(input);
 	case PHY_MODE_GMII:
 		return RGMII_FER_GMII(input);
+	case PHY_MODE_MII:
+		return RGMII_FER_MII(input);
 	case PHY_MODE_RTBI:
 		return RGMII_FER_RTBI(input);
 	default:
--
1.5.4.3

Re: [PATCH v2] ibm_newemac: Add MII mode support to the EMAC RGMII bridge.

From: Jeff Garzik <hidden>
Date: 2008-07-11 05:19:53

Benjamin Herrenschmidt wrote:
On Tue, 2008-07-08 at 08:03 -0700, Grant Erickson wrote:
quoted
This patch adds support to the RGMII handler in the EMAC driver for
the MII PHY mode such that device tree entries of the form `phy-mode = "mii";'
are recognized and handled appropriately.

While logically, in software, "gmii" and "mii" modes are the same,
they are wired differently, so it makes sense to allow DTS authors to
specify each explicitly.

Signed-off-by: Grant Erickson <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
ACK

Jeff, I'd like to apply that (and other EMAC patches for 2.6.27, do you
have anything else pending ?) via my tree provided you give me your ack.
The reason is that the multicast fix one is going that way as it touches
other arch files, and subsequent ones are now likely to conflict.

Let me know if that's ok with you in which case I'll stick your ack in
there.
Ok w/ me!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help