diff options
author | Eugene Surovegin <ebs@ebshome.net> | 2005-10-29 15:43:14 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-29 18:06:54 -0400 |
commit | 7ad8a89c2e8a930a902cb0622956b27796c027e5 (patch) | |
tree | c1241696b8fc5ab55d389f9accd80f399e3d9d86 /drivers/net/ibm_emac/ibm_emac.h | |
parent | be15cd72d256e5eb3261a781b8507fac83ab33f6 (diff) |
[PATCH] PPC 44x EMAC driver: add 440SPe support
For some reason, the hardware designers made the polarity of one bit
in the 440SPe's PHY interface register the opposite of all other PPC
440 chips. To handle this, abstract our access to this bit and do the
right thing based on the configured CPU type.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/ibm_emac/ibm_emac.h')
-rw-r--r-- | drivers/net/ibm_emac/ibm_emac.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/net/ibm_emac/ibm_emac.h b/drivers/net/ibm_emac/ibm_emac.h index 28c476f28c20..d3166da753ef 100644 --- a/drivers/net/ibm_emac/ibm_emac.h +++ b/drivers/net/ibm_emac/ibm_emac.h | |||
@@ -26,7 +26,7 @@ | |||
26 | /* This is a simple check to prevent use of this driver on non-tested SoCs */ | 26 | /* This is a simple check to prevent use of this driver on non-tested SoCs */ |
27 | #if !defined(CONFIG_405GP) && !defined(CONFIG_405GPR) && !defined(CONFIG_405EP) && \ | 27 | #if !defined(CONFIG_405GP) && !defined(CONFIG_405GPR) && !defined(CONFIG_405EP) && \ |
28 | !defined(CONFIG_440GP) && !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && \ | 28 | !defined(CONFIG_440GP) && !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && \ |
29 | !defined(CONFIG_440EP) && !defined(CONFIG_NP405H) | 29 | !defined(CONFIG_440EP) && !defined(CONFIG_NP405H) && !defined(CONFIG_440SPE) |
30 | #error "Unknown SoC. Please, check chip user manual and make sure EMAC defines are OK" | 30 | #error "Unknown SoC. Please, check chip user manual and make sure EMAC defines are OK" |
31 | #endif | 31 | #endif |
32 | 32 | ||
@@ -246,6 +246,25 @@ struct emac_regs { | |||
246 | #define EMAC_STACR_PCDA_SHIFT 5 | 246 | #define EMAC_STACR_PCDA_SHIFT 5 |
247 | #define EMAC_STACR_PRA_MASK 0x1f | 247 | #define EMAC_STACR_PRA_MASK 0x1f |
248 | 248 | ||
249 | /* | ||
250 | * For the 440SPe, AMCC inexplicably changed the polarity of | ||
251 | * the "operation complete" bit in the MII control register. | ||
252 | */ | ||
253 | #if defined(CONFIG_440SPE) | ||
254 | static inline int emac_phy_done(u32 stacr) | ||
255 | { | ||
256 | return !(stacr & EMAC_STACR_OC); | ||
257 | }; | ||
258 | #define EMAC_STACR_START EMAC_STACR_OC | ||
259 | |||
260 | #else /* CONFIG_440SPE */ | ||
261 | static inline int emac_phy_done(u32 stacr) | ||
262 | { | ||
263 | return stacr & EMAC_STACR_OC; | ||
264 | }; | ||
265 | #define EMAC_STACR_START 0 | ||
266 | #endif /* !CONFIG_440SPE */ | ||
267 | |||
249 | /* EMACx_TRTR */ | 268 | /* EMACx_TRTR */ |
250 | #if !defined(CONFIG_IBM_EMAC4) | 269 | #if !defined(CONFIG_IBM_EMAC4) |
251 | #define EMAC_TRTR_SHIFT 27 | 270 | #define EMAC_TRTR_SHIFT 27 |