linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/11] ibm_newemac: Candidate patches for 2.6.25
@ 2007-11-30  5:40 Benjamin Herrenschmidt
  2007-11-30  5:40 ` [PATCH 1/11] ibm_newemac: Add BCM5248 and Marvell 88E1111 PHY support Benjamin Herrenschmidt
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Benjamin Herrenschmidt @ 2007-11-30  5:40 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev

Here are the patches I have pending for EMAC. With those, along with
some other powerpc patches scheduled for 2.6.25 for adding support
for those various boards, I have EMAC now working properly on a
variety of platforms, such as Taishan (440GX), Katmai (440SP),
EP405 (405GP), Bamboo (440EP), etc...

This serie apply on top of the patch:

"ibm_newemac: Fix possible lockup on close"

Which should be on its way to 2.6.24 already.

^ permalink raw reply	[flat|nested] 21+ messages in thread
* [PATCH 6/11] ibm_newemac: Cleanup/fix support for STACR register variants
@ 2007-12-05  0:14 Benjamin Herrenschmidt
  0 siblings, 0 replies; 21+ messages in thread
From: Benjamin Herrenschmidt @ 2007-12-05  0:14 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev

There are a few variants of the STACR register that affect more than
just the "AXON" version of EMAC. Replace the current test of various
chip models with tests for generic properties in the device-tree.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
---

 arch/powerpc/boot/dts/sequoia.dts |    4 ++++
 drivers/net/ibm_newemac/core.c    |   23 +++++++++++++----------
 drivers/net/ibm_newemac/core.h    |    6 +++---
 3 files changed, 20 insertions(+), 13 deletions(-)

Index: linux-work/arch/powerpc/boot/dts/sequoia.dts
===================================================================
--- linux-work.orig/arch/powerpc/boot/dts/sequoia.dts	2007-11-20 14:47:01.000000000 +1100
+++ linux-work/arch/powerpc/boot/dts/sequoia.dts	2007-11-20 14:47:02.000000000 +1100
@@ -274,6 +274,8 @@
 				zmii-channel = <0>;
 				rgmii-device = <&RGMII0>;
 				rgmii-channel = <0>;
+				has-inverted-stacr-oc;
+				has-new-stacr-staopc;
 			};
 
 			EMAC1: ethernet@ef600f00 {
@@ -302,6 +304,8 @@
 				zmii-channel = <1>;
 				rgmii-device = <&RGMII0>;
 				rgmii-channel = <1>;
+				has-inverted-stacr-oc;
+				has-new-stacr-staopc;
 			};
 		};
 	};
Index: linux-work/drivers/net/ibm_newemac/core.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/core.c	2007-11-20 14:46:58.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/core.c	2007-11-20 14:47:02.000000000 +1100
@@ -711,7 +711,7 @@ static int __emac_mdio_read(struct emac_
 		r = EMAC_STACR_BASE(dev->opb_bus_freq);
 	if (emac_has_feature(dev, EMAC_FTR_STACR_OC_INVERT))
 		r |= EMAC_STACR_OC;
-	if (emac_has_feature(dev, EMAC_FTR_HAS_AXON_STACR))
+	if (emac_has_feature(dev, EMAC_FTR_HAS_NEW_STACR))
 		r |= EMACX_STACR_STAC_READ;
 	else
 		r |= EMAC_STACR_STAC_READ;
@@ -783,7 +783,7 @@ static void __emac_mdio_write(struct ema
 		r = EMAC_STACR_BASE(dev->opb_bus_freq);
 	if (emac_has_feature(dev, EMAC_FTR_STACR_OC_INVERT))
 		r |= EMAC_STACR_OC;
-	if (emac_has_feature(dev, EMAC_FTR_HAS_AXON_STACR))
+	if (emac_has_feature(dev, EMAC_FTR_HAS_NEW_STACR))
 		r |= EMACX_STACR_STAC_WRITE;
 	else
 		r |= EMAC_STACR_STAC_WRITE;
@@ -2480,16 +2480,19 @@ static int __devinit emac_init_config(st
 	/* Check EMAC version */
 	if (of_device_is_compatible(np, "ibm,emac4"))
 		dev->features |= EMAC_FTR_EMAC4;
-	if (of_device_is_compatible(np, "ibm,emac-axon")
-	    || of_device_is_compatible(np, "ibm,emac-440epx"))
-		dev->features |= EMAC_FTR_HAS_AXON_STACR
-			| EMAC_FTR_STACR_OC_INVERT;
-	if (of_device_is_compatible(np, "ibm,emac-440spe"))
+
+	/* Fixup some feature bits based on the device tree */
+	if (of_get_property(np, "has-inverted-stacr-oc", NULL))
 		dev->features |= EMAC_FTR_STACR_OC_INVERT;
+	if (of_get_property(np, "has-new-stacr-staopc", NULL))
+		dev->features |= EMAC_FTR_HAS_NEW_STACR;
 
-	/* Fixup some feature bits based on the device tree and verify
-	 * we have support for them compiled in
-	 */
+	/* CAB lacks the appropriate properties */
+	if (of_device_is_compatible(np, "ibm,emac-axon"))
+		dev->features |= EMAC_FTR_HAS_NEW_STACR |
+			EMAC_FTR_STACR_OC_INVERT;
+
+	/* Enable TAH/ZMII/RGMII features as found */
 	if (dev->tah_ph != 0) {
 #ifdef CONFIG_IBM_NEW_EMAC_TAH
 		dev->features |= EMAC_FTR_HAS_TAH;
Index: linux-work/drivers/net/ibm_newemac/core.h
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/core.h	2007-11-20 14:46:51.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/core.h	2007-11-20 14:47:02.000000000 +1100
@@ -293,9 +293,9 @@ struct emac_instance {
  */
 #define EMAC_FTR_HAS_RGMII		0x00000020
 /*
- * Set if we have axon-type STACR
+ * Set if we have new type STACR with STAOPC
  */
-#define EMAC_FTR_HAS_AXON_STACR		0x00000040
+#define EMAC_FTR_HAS_NEW_STACR		0x00000040
 
 
 /* Right now, we don't quite handle the always/possible masks on the
@@ -307,7 +307,7 @@ enum {
 
 	EMAC_FTRS_POSSIBLE	=
 #ifdef CONFIG_IBM_NEW_EMAC_EMAC4
-	    EMAC_FTR_EMAC4	| EMAC_FTR_HAS_AXON_STACR	|
+	    EMAC_FTR_EMAC4	| EMAC_FTR_HAS_NEW_STACR	|
 	    EMAC_FTR_STACR_OC_INVERT	|
 #endif
 #ifdef CONFIG_IBM_NEW_EMAC_TAH

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

end of thread, other threads:[~2007-12-05  0:14 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-30  5:40 [PATCH 0/11] ibm_newemac: Candidate patches for 2.6.25 Benjamin Herrenschmidt
2007-11-30  5:40 ` [PATCH 1/11] ibm_newemac: Add BCM5248 and Marvell 88E1111 PHY support Benjamin Herrenschmidt
2007-11-30  7:56   ` Christoph Hellwig
2007-11-30  8:03     ` Benjamin Herrenschmidt
2007-11-30 14:27   ` Olof Johansson
2007-11-30 14:30     ` Geert Uytterhoeven
2007-11-30  5:40 ` [PATCH 2/11] ibm_newemac: Add ET1011c " Benjamin Herrenschmidt
2007-11-30 14:29   ` Olof Johansson
2007-11-30 20:59     ` Benjamin Herrenschmidt
2007-11-30 21:30       ` Olof Johansson
2007-11-30 21:56       ` Kumar Gala
2007-11-30  5:40 ` [PATCH 3/11] ibm_newemac: Fix ZMII refcounting bug Benjamin Herrenschmidt
2007-11-30  5:40 ` [PATCH 4/11] ibm_newemac: Workaround reset timeout when no link Benjamin Herrenschmidt
2007-11-30  5:40 ` [PATCH 5/11] ibm_newemac: Cleanup/Fix RGMII MDIO support detection Benjamin Herrenschmidt
2007-11-30  5:40 ` [PATCH 6/11] ibm_newemac: Cleanup/fix support for STACR register variants Benjamin Herrenschmidt
2007-11-30  5:40 ` [PATCH 7/11] ibm_newemac: Skip EMACs that are marked unused by the firmware Benjamin Herrenschmidt
2007-11-30  5:40 ` [PATCH 8/11] ibm_newemac: Correct opb_bus_freq value Benjamin Herrenschmidt
2007-11-30  5:40 ` [PATCH 9/11] ibm_newemac: Fix typo reading TAH channel info Benjamin Herrenschmidt
2007-11-30  5:40 ` [PATCH 10/11] ibm_newemac: Call dev_set_drvdata() before tah_reset() Benjamin Herrenschmidt
2007-11-30  5:40 ` [PATCH 11/11] emac: Update file headers copyright notices Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2007-12-05  0:14 [PATCH 6/11] ibm_newemac: Cleanup/fix support for STACR register variants Benjamin Herrenschmidt

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).