diff options
author | David S. Miller <davem@davemloft.net> | 2014-03-26 16:19:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-26 16:19:42 -0400 |
commit | b8b6529f0536cf0d9e35e0833732199b66bf7cbc (patch) | |
tree | e43a89355affefc56828825eabc337739f7f592c /drivers | |
parent | 61b905da33ae25edb6b9d2a5de21e34c3a77efe3 (diff) | |
parent | a62ea5a75fdd4c0052bdbacd1e653b00a9f88f6d (diff) |
Merge branch 'bcm7xxx-next'
Florian Fainelli says:
====================
net: phy: bcm7xxx: workaround updates
This patch updates the BCM7xxx internal PHY workaround, this time with
defines for the registers we are touching.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/bcm7xxx.c | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c index 697337220016..526b94cea569 100644 --- a/drivers/net/phy/bcm7xxx.c +++ b/drivers/net/phy/bcm7xxx.c | |||
@@ -28,6 +28,22 @@ | |||
28 | #define MII_BCM7XXX_TEST 0x1f | 28 | #define MII_BCM7XXX_TEST 0x1f |
29 | #define MII_BCM7XXX_SHD_MODE_2 BIT(2) | 29 | #define MII_BCM7XXX_SHD_MODE_2 BIT(2) |
30 | 30 | ||
31 | /* 28nm only register definitions */ | ||
32 | #define MISC_ADDR(base, channel) base, channel | ||
33 | |||
34 | #define DSP_TAP10 MISC_ADDR(0x0a, 0) | ||
35 | #define PLL_PLLCTRL_1 MISC_ADDR(0x32, 1) | ||
36 | #define PLL_PLLCTRL_2 MISC_ADDR(0x32, 2) | ||
37 | #define PLL_PLLCTRL_4 MISC_ADDR(0x33, 0) | ||
38 | |||
39 | #define AFE_RXCONFIG_0 MISC_ADDR(0x38, 0) | ||
40 | #define AFE_RXCONFIG_1 MISC_ADDR(0x38, 1) | ||
41 | #define AFE_RX_LP_COUNTER MISC_ADDR(0x38, 3) | ||
42 | #define AFE_TX_CONFIG MISC_ADDR(0x39, 0) | ||
43 | #define AFE_HPF_TRIM_OTHERS MISC_ADDR(0x3a, 0) | ||
44 | |||
45 | #define CORE_EXPB0 0xb0 | ||
46 | |||
31 | static int bcm7445_config_init(struct phy_device *phydev) | 47 | static int bcm7445_config_init(struct phy_device *phydev) |
32 | { | 48 | { |
33 | int ret; | 49 | int ret; |
@@ -87,45 +103,45 @@ static void phy_write_misc(struct phy_device *phydev, | |||
87 | 103 | ||
88 | static int bcm7xxx_28nm_afe_config_init(struct phy_device *phydev) | 104 | static int bcm7xxx_28nm_afe_config_init(struct phy_device *phydev) |
89 | { | 105 | { |
90 | /* write AFE_RXCONFIG_0 */ | ||
91 | phy_write_misc(phydev, 0x38, 0x0000, 0xeb19); | ||
92 | |||
93 | /* write AFE_RXCONFIG_1 */ | ||
94 | phy_write_misc(phydev, 0x38, 0x0001, 0x9a3f); | ||
95 | |||
96 | /* write AFE_RX_LP_COUNTER */ | ||
97 | phy_write_misc(phydev, 0x38, 0x0003, 0x7fc7); | ||
98 | |||
99 | /* write AFE_HPF_TRIM_OTHERS */ | ||
100 | phy_write_misc(phydev, 0x3A, 0x0000, 0x000b); | ||
101 | |||
102 | /* write AFTE_TX_CONFIG */ | ||
103 | phy_write_misc(phydev, 0x39, 0x0000, 0x0800); | ||
104 | |||
105 | /* Increase VCO range to prevent unlocking problem of PLL at low | 106 | /* Increase VCO range to prevent unlocking problem of PLL at low |
106 | * temp | 107 | * temp |
107 | */ | 108 | */ |
108 | phy_write_misc(phydev, 0x0032, 0x0001, 0x0048); | 109 | phy_write_misc(phydev, PLL_PLLCTRL_1, 0x0048); |
109 | 110 | ||
110 | /* Change Ki to 011 */ | 111 | /* Change Ki to 011 */ |
111 | phy_write_misc(phydev, 0x0032, 0x0002, 0x021b); | 112 | phy_write_misc(phydev, PLL_PLLCTRL_2, 0x021b); |
112 | 113 | ||
113 | /* Disable loading of TVCO buffer to bandgap, set bandgap trim | 114 | /* Disable loading of TVCO buffer to bandgap, set bandgap trim |
114 | * to 111 | 115 | * to 111 |
115 | */ | 116 | */ |
116 | phy_write_misc(phydev, 0x0033, 0x0000, 0x0e20); | 117 | phy_write_misc(phydev, PLL_PLLCTRL_4, 0x0e20); |
117 | 118 | ||
118 | /* Adjust bias current trim by -3 */ | 119 | /* Adjust bias current trim by -3 */ |
119 | phy_write_misc(phydev, 0x000a, 0x0000, 0x690b); | 120 | phy_write_misc(phydev, DSP_TAP10, 0x690b); |
120 | 121 | ||
121 | /* Switch to CORE_BASE1E */ | 122 | /* Switch to CORE_BASE1E */ |
122 | phy_write(phydev, MII_BCM7XXX_CORE_BASE1E, 0xd); | 123 | phy_write(phydev, MII_BCM7XXX_CORE_BASE1E, 0xd); |
123 | 124 | ||
124 | /* Reset R_CAL/RC_CAL Engine */ | 125 | /* Reset R_CAL/RC_CAL Engine */ |
125 | phy_write_exp(phydev, 0x00b0, 0x0010); | 126 | phy_write_exp(phydev, CORE_EXPB0, 0x0010); |
126 | 127 | ||
127 | /* Disable Reset R_CAL/RC_CAL Engine */ | 128 | /* Disable Reset R_CAL/RC_CAL Engine */ |
128 | phy_write_exp(phydev, 0x00b0, 0x0000); | 129 | phy_write_exp(phydev, CORE_EXPB0, 0x0000); |
130 | |||
131 | /* write AFE_RXCONFIG_0 */ | ||
132 | phy_write_misc(phydev, AFE_RXCONFIG_0, 0xeb19); | ||
133 | |||
134 | /* write AFE_RXCONFIG_1 */ | ||
135 | phy_write_misc(phydev, AFE_RXCONFIG_1, 0x9a3f); | ||
136 | |||
137 | /* write AFE_RX_LP_COUNTER */ | ||
138 | phy_write_misc(phydev, AFE_RX_LP_COUNTER, 0x7fc0); | ||
139 | |||
140 | /* write AFE_HPF_TRIM_OTHERS */ | ||
141 | phy_write_misc(phydev, AFE_HPF_TRIM_OTHERS, 0x000b); | ||
142 | |||
143 | /* write AFTE_TX_CONFIG */ | ||
144 | phy_write_misc(phydev, AFE_TX_CONFIG, 0x0800); | ||
129 | 145 | ||
130 | return 0; | 146 | return 0; |
131 | } | 147 | } |