diff options
author | Arun Parameswaran <arunp@broadcom.com> | 2015-10-06 15:25:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-08 07:45:46 -0400 |
commit | a1cba5613edf50c2a213fa90c30aa10500b241b7 (patch) | |
tree | b015ddfca52bdcb0766dbc2a6abbaf5a3417c851 /include/linux/brcmphy.h | |
parent | ddc24ae1fd6ae2638365b0b824750b5b2ef13ca5 (diff) |
net: phy: Add Broadcom phy library for common interfaces
This patch adds the Broadcom phy library to consolidate common
interfaces shared by Broadcom phy's.
Moved the common interfaces to the 'bcm-phy-lib.c' and updated
the Broadcom PHY drivers to use the new APIs.
Signed-off-by: Arun Parameswaran <arunp@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/brcmphy.h')
-rw-r--r-- | include/linux/brcmphy.h | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h index 697ca7795bd9..6a53ab91407c 100644 --- a/include/linux/brcmphy.h +++ b/include/linux/brcmphy.h | |||
@@ -138,7 +138,10 @@ | |||
138 | 138 | ||
139 | /* 01010: Auto Power-Down */ | 139 | /* 01010: Auto Power-Down */ |
140 | #define BCM54XX_SHD_APD 0x0a | 140 | #define BCM54XX_SHD_APD 0x0a |
141 | #define BCM_APD_CLR_MASK 0xFE9F /* clear bits 5, 6 & 8 */ | ||
141 | #define BCM54XX_SHD_APD_EN 0x0020 | 142 | #define BCM54XX_SHD_APD_EN 0x0020 |
143 | #define BCM_NO_ANEG_APD_EN 0x0060 /* bits 5 & 6 */ | ||
144 | #define BCM_APD_SINGLELP_EN 0x0100 /* Bit 8 */ | ||
142 | 145 | ||
143 | #define BCM5482_SHD_LEDS1 0x0d /* 01101: LED Selector 1 */ | 146 | #define BCM5482_SHD_LEDS1 0x0d /* 01101: LED Selector 1 */ |
144 | /* LED3 / ~LINKSPD[2] selector */ | 147 | /* LED3 / ~LINKSPD[2] selector */ |
@@ -209,25 +212,6 @@ | |||
209 | #define MII_BRCM_FET_SHDW_AUXSTAT2 0x1b /* Auxiliary status 2 */ | 212 | #define MII_BRCM_FET_SHDW_AUXSTAT2 0x1b /* Auxiliary status 2 */ |
210 | #define MII_BRCM_FET_SHDW_AS2_APDE 0x0020 /* Auto power down enable */ | 213 | #define MII_BRCM_FET_SHDW_AS2_APDE 0x0020 /* Auto power down enable */ |
211 | 214 | ||
212 | /* | ||
213 | * Indirect register access functions for the 1000BASE-T/100BASE-TX/10BASE-T | ||
214 | * 0x1c shadow registers. | ||
215 | */ | ||
216 | static inline int bcm54xx_shadow_read(struct phy_device *phydev, u16 shadow) | ||
217 | { | ||
218 | phy_write(phydev, MII_BCM54XX_SHD, MII_BCM54XX_SHD_VAL(shadow)); | ||
219 | return MII_BCM54XX_SHD_DATA(phy_read(phydev, MII_BCM54XX_SHD)); | ||
220 | } | ||
221 | |||
222 | static inline int bcm54xx_shadow_write(struct phy_device *phydev, u16 shadow, | ||
223 | u16 val) | ||
224 | { | ||
225 | return phy_write(phydev, MII_BCM54XX_SHD, | ||
226 | MII_BCM54XX_SHD_WRITE | | ||
227 | MII_BCM54XX_SHD_VAL(shadow) | | ||
228 | MII_BCM54XX_SHD_DATA(val)); | ||
229 | } | ||
230 | |||
231 | #define BRCM_CL45VEN_EEE_CONTROL 0x803d | 215 | #define BRCM_CL45VEN_EEE_CONTROL 0x803d |
232 | #define LPI_FEATURE_EN 0x8000 | 216 | #define LPI_FEATURE_EN 0x8000 |
233 | #define LPI_FEATURE_EN_DIG1000X 0x4000 | 217 | #define LPI_FEATURE_EN_DIG1000X 0x4000 |