diff options
author | chaithrika@ti.com <chaithrika@ti.com> | 2009-10-01 06:25:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-05 03:21:55 -0400 |
commit | 69ef9694099802f7feeb23182dfb869e7c5f76f0 (patch) | |
tree | 015aac89e6e6bf9a2a41c9c984c3099baa46a586 /drivers/net/davinci_emac.c | |
parent | 0835acfe72e43b2f9bd46ec8c0d219e94c3525e0 (diff) |
TI DaVinci EMAC: Minor macro related updates
Use BIT for macro definitions wherever possible, remove
unused and redundant macros.
Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/davinci_emac.c')
-rw-r--r-- | drivers/net/davinci_emac.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 65a2d0ba64e2..a421ec046b3c 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c | |||
@@ -164,16 +164,14 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1"; | |||
164 | # define EMAC_MBP_MCASTCHAN(ch) ((ch) & 0x7) | 164 | # define EMAC_MBP_MCASTCHAN(ch) ((ch) & 0x7) |
165 | 165 | ||
166 | /* EMAC mac_control register */ | 166 | /* EMAC mac_control register */ |
167 | #define EMAC_MACCONTROL_TXPTYPE (0x200) | 167 | #define EMAC_MACCONTROL_TXPTYPE BIT(9) |
168 | #define EMAC_MACCONTROL_TXPACEEN (0x40) | 168 | #define EMAC_MACCONTROL_TXPACEEN BIT(6) |
169 | #define EMAC_MACCONTROL_MIIEN (0x20) | 169 | #define EMAC_MACCONTROL_GMIIEN BIT(5) |
170 | #define EMAC_MACCONTROL_GIGABITEN (0x80) | 170 | #define EMAC_MACCONTROL_GIGABITEN BIT(7) |
171 | #define EMAC_MACCONTROL_GIGABITEN_SHIFT (7) | 171 | #define EMAC_MACCONTROL_FULLDUPLEXEN BIT(0) |
172 | #define EMAC_MACCONTROL_FULLDUPLEXEN (0x1) | ||
173 | #define EMAC_MACCONTROL_RMIISPEED_MASK BIT(15) | 172 | #define EMAC_MACCONTROL_RMIISPEED_MASK BIT(15) |
174 | 173 | ||
175 | /* GIGABIT MODE related bits */ | 174 | /* GIGABIT MODE related bits */ |
176 | #define EMAC_DM646X_MACCONTORL_GMIIEN BIT(5) | ||
177 | #define EMAC_DM646X_MACCONTORL_GIG BIT(7) | 175 | #define EMAC_DM646X_MACCONTORL_GIG BIT(7) |
178 | #define EMAC_DM646X_MACCONTORL_GIGFORCE BIT(17) | 176 | #define EMAC_DM646X_MACCONTORL_GIGFORCE BIT(17) |
179 | 177 | ||
@@ -192,10 +190,10 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1"; | |||
192 | #define EMAC_RX_BUFFER_OFFSET_MASK (0xFFFF) | 190 | #define EMAC_RX_BUFFER_OFFSET_MASK (0xFFFF) |
193 | 191 | ||
194 | /* MAC_IN_VECTOR (0x180) register bit fields */ | 192 | /* MAC_IN_VECTOR (0x180) register bit fields */ |
195 | #define EMAC_DM644X_MAC_IN_VECTOR_HOST_INT (0x20000) | 193 | #define EMAC_DM644X_MAC_IN_VECTOR_HOST_INT BIT(17) |
196 | #define EMAC_DM644X_MAC_IN_VECTOR_STATPEND_INT (0x10000) | 194 | #define EMAC_DM644X_MAC_IN_VECTOR_STATPEND_INT BIT(16) |
197 | #define EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC (0x0100) | 195 | #define EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC BIT(8) |
198 | #define EMAC_DM644X_MAC_IN_VECTOR_TX_INT_VEC (0x01) | 196 | #define EMAC_DM644X_MAC_IN_VECTOR_TX_INT_VEC BIT(0) |
199 | 197 | ||
200 | /** NOTE:: For DM646x the IN_VECTOR has changed */ | 198 | /** NOTE:: For DM646x the IN_VECTOR has changed */ |
201 | #define EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC BIT(EMAC_DEF_RX_CH) | 199 | #define EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC BIT(EMAC_DEF_RX_CH) |
@@ -203,7 +201,6 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1"; | |||
203 | #define EMAC_DM646X_MAC_IN_VECTOR_HOST_INT BIT(26) | 201 | #define EMAC_DM646X_MAC_IN_VECTOR_HOST_INT BIT(26) |
204 | #define EMAC_DM646X_MAC_IN_VECTOR_STATPEND_INT BIT(27) | 202 | #define EMAC_DM646X_MAC_IN_VECTOR_STATPEND_INT BIT(27) |
205 | 203 | ||
206 | |||
207 | /* CPPI bit positions */ | 204 | /* CPPI bit positions */ |
208 | #define EMAC_CPPI_SOP_BIT BIT(31) | 205 | #define EMAC_CPPI_SOP_BIT BIT(31) |
209 | #define EMAC_CPPI_EOP_BIT BIT(30) | 206 | #define EMAC_CPPI_EOP_BIT BIT(30) |
@@ -747,8 +744,7 @@ static void emac_update_phystatus(struct emac_priv *priv) | |||
747 | 744 | ||
748 | if (priv->speed == SPEED_1000 && (priv->version == EMAC_VERSION_2)) { | 745 | if (priv->speed == SPEED_1000 && (priv->version == EMAC_VERSION_2)) { |
749 | mac_control = emac_read(EMAC_MACCONTROL); | 746 | mac_control = emac_read(EMAC_MACCONTROL); |
750 | mac_control |= (EMAC_DM646X_MACCONTORL_GMIIEN | | 747 | mac_control |= (EMAC_DM646X_MACCONTORL_GIG | |
751 | EMAC_DM646X_MACCONTORL_GIG | | ||
752 | EMAC_DM646X_MACCONTORL_GIGFORCE); | 748 | EMAC_DM646X_MACCONTORL_GIGFORCE); |
753 | } else { | 749 | } else { |
754 | /* Clear the GIG bit and GIGFORCE bit */ | 750 | /* Clear the GIG bit and GIGFORCE bit */ |
@@ -2105,7 +2101,7 @@ static int emac_hw_enable(struct emac_priv *priv) | |||
2105 | 2101 | ||
2106 | /* Enable MII */ | 2102 | /* Enable MII */ |
2107 | val = emac_read(EMAC_MACCONTROL); | 2103 | val = emac_read(EMAC_MACCONTROL); |
2108 | val |= (EMAC_MACCONTROL_MIIEN); | 2104 | val |= (EMAC_MACCONTROL_GMIIEN); |
2109 | emac_write(EMAC_MACCONTROL, val); | 2105 | emac_write(EMAC_MACCONTROL, val); |
2110 | 2106 | ||
2111 | /* Enable NAPI and interrupts */ | 2107 | /* Enable NAPI and interrupts */ |