1 --- a/Embedded/src/GbE/iegbe_oem_phy.c
2 +++ b/Embedded/src/GbE/iegbe_oem_phy.c
3 @@ -65,6 +65,10 @@ static int32_t iegbe_oem_link_m88_setup(
4 static int32_t iegbe_oem_set_phy_mode(struct iegbe_hw *hw);
5 static int32_t iegbe_oem_detect_phy(struct iegbe_hw *hw);
7 +static int32_t iegbe_oem_link_bcm5481_setup(struct iegbe_hw *hw);
8 +static int32_t bcm5481_read_18sv (struct iegbe_hw *hw, int sv, uint16_t *data);
9 +static int32_t oi_phy_setup (struct iegbe_hw *hw);
12 * iegbe_oem_setup_link
13 * @hw: iegbe_hw struct containing device specific information
14 @@ -114,6 +118,10 @@ iegbe_oem_setup_link(struct iegbe_hw *hw
18 + case BCM5395S_PHY_ID:
19 + return E1000_SUCCESS;
22 case M88E1000_I_PHY_ID:
23 case M88E1141_E_PHY_ID:
24 ret_val = iegbe_oem_link_m88_setup(hw);
25 @@ -121,6 +129,12 @@ iegbe_oem_setup_link(struct iegbe_hw *hw
29 + case BCM5481_PHY_ID:
30 + ret_val = iegbe_oem_link_bcm5481_setup(hw);
36 DEBUGOUT("Invalid PHY ID\n");
37 return -E1000_ERR_PHY_TYPE;
38 @@ -179,6 +193,51 @@ iegbe_oem_setup_link(struct iegbe_hw *hw
39 #endif /* ifdef EXTERNAL_MDIO */
43 + * iegbe_oem_link_bcm5481_setup
44 + * @hw: iegbe_hw struct containing device specific information
46 + * Returns E1000_SUCCESS, negative E1000 error code on failure
48 + * copied verbatim from iegbe_oem_link_m88_setup
51 +iegbe_oem_link_bcm5481_setup(struct iegbe_hw *hw)
56 + //DEBUGFUNC(__func__);
61 + /* phy_reset_disable is set in iegbe_oem_set_phy_mode */
62 + if(hw->phy_reset_disable)
63 + return E1000_SUCCESS;
65 + // Enable MDIX in extended control reg.
66 + ret_val = iegbe_oem_read_phy_reg_ex(hw, BCM5481_ECTRL, &phy_data);
69 + DEBUGOUT("Unable to read BCM5481_ECTRL register\n");
73 + phy_data &= ~BCM5481_ECTRL_DISMDIX;
74 + ret_val = iegbe_oem_write_phy_reg_ex(hw, BCM5481_ECTRL, phy_data);
77 + DEBUGOUT("Unable to write BCM5481_ECTRL register\n");
81 + ret_val = oi_phy_setup (hw);
85 + return E1000_SUCCESS;
89 * iegbe_oem_link_m88_setup
90 @@ -340,6 +399,11 @@ iegbe_oem_force_mdi(struct iegbe_hw *hw,
91 * see iegbe_phy_force_speed_duplex, which does the following for M88
94 + case BCM5395S_PHY_ID:
95 + case BCM5481_PHY_ID:
96 + DEBUGOUT("WARNING: An empty iegbe_oem_force_mdi() has been called!\n");
99 case M88E1000_I_PHY_ID:
100 case M88E1141_E_PHY_ID:
101 ret_val = iegbe_oem_read_phy_reg_ex(hw,
102 @@ -415,6 +479,8 @@ iegbe_oem_phy_reset_dsp(struct iegbe_hw
103 switch (hw->phy_id) {
104 case M88E1000_I_PHY_ID:
105 case M88E1141_E_PHY_ID:
106 + case BCM5481_PHY_ID:
107 + case BCM5395S_PHY_ID:
108 DEBUGOUT("No DSP to reset on OEM PHY\n");
111 @@ -460,6 +526,11 @@ iegbe_oem_cleanup_after_phy_reset(struct
112 * see iegbe_phy_force_speed_duplex, which does the following for M88
114 switch (hw->phy_id) {
115 + case BCM5395S_PHY_ID:
116 + case BCM5481_PHY_ID:
117 + DEBUGOUT("WARNING: An empty iegbe_oem_cleanup_after_phy_reset() has been called!\n");
120 case M88E1000_I_PHY_ID:
121 case M88E1141_E_PHY_ID:
123 @@ -573,6 +644,11 @@ iegbe_oem_set_phy_mode(struct iegbe_hw *
124 * use iegbe_set_phy_mode as example
126 switch (hw->phy_id) {
127 + case BCM5395S_PHY_ID:
128 + case BCM5481_PHY_ID:
129 + DEBUGOUT("WARNING: An empty iegbe_oem_set_phy_mode() has been called!\n");
132 case M88E1000_I_PHY_ID:
133 case M88E1141_E_PHY_ID:
134 ret_val = iegbe_read_eeprom(hw,
135 @@ -641,6 +717,19 @@ iegbe_oem_detect_phy(struct iegbe_hw *hw
137 hw->phy_type = iegbe_phy_oem;
140 + // If MAC2 (BCM5395 switch), manually detect the phy
141 + struct iegbe_adapter *adapter;
142 + uint32_t device_number;
143 + adapter = (struct iegbe_adapter *) hw->back;
144 + device_number = PCI_SLOT(adapter->pdev->devfn);
145 + if (device_number == ICP_XXXX_MAC_2) {
146 + hw->phy_id = BCM5395S_PHY_ID;
147 + hw->phy_revision = 0;
148 + return E1000_SUCCESS;
152 ret_val = iegbe_oem_read_phy_reg_ex(hw, PHY_ID1, &phy_id_high);
154 DEBUGOUT("Unable to read PHY register PHY_ID1\n");
155 @@ -690,6 +779,8 @@ iegbe_oem_get_tipg(struct iegbe_hw *hw)
156 switch (hw->phy_id) {
157 case M88E1000_I_PHY_ID:
158 case M88E1141_E_PHY_ID:
159 + case BCM5481_PHY_ID:
160 + case BCM5395S_PHY_ID:
161 phy_num = DEFAULT_ICP_XXXX_TIPG_IPGT;
164 @@ -738,6 +829,8 @@ iegbe_oem_phy_is_copper(struct iegbe_hw
165 switch (hw->phy_id) {
166 case M88E1000_I_PHY_ID:
167 case M88E1141_E_PHY_ID:
168 + case BCM5481_PHY_ID:
169 + case BCM5395S_PHY_ID:
173 @@ -796,13 +889,13 @@ iegbe_oem_get_phy_dev_number(struct iegb
174 switch(device_number)
177 - hw->phy_addr = 0x00;
178 + hw->phy_addr = 0x01;
181 - hw->phy_addr = 0x01;
182 + hw->phy_addr = 0x02;
185 - hw->phy_addr = 0x02;
186 + hw->phy_addr = 0x00;
188 default: hw->phy_addr = 0x00;
190 @@ -851,6 +944,12 @@ iegbe_oem_mii_ioctl(struct iegbe_adapter
191 if(!adapter || !ifr) {
195 + // If MAC2 (BCM5395 switch) then leave now
196 + if ((PCI_SLOT(adapter->pdev->devfn)) == ICP_XXXX_MAC_2) {
200 switch (data->reg_num) {
202 if(mii_reg & MII_CR_POWER_DOWN) {
203 @@ -987,6 +1086,11 @@ void iegbe_oem_get_phy_regs(struct iegbe
206 switch (adapter->hw.phy_id) {
207 + case BCM5395S_PHY_ID:
208 + case BCM5481_PHY_ID:
209 + DEBUGOUT("WARNING: An empty iegbe_oem_get_phy_regs() has been called!\n");
212 case M88E1000_I_PHY_ID:
213 case M88E1141_E_PHY_ID:
214 if(corrected_len > 0) {
215 @@ -1068,8 +1172,13 @@ iegbe_oem_phy_loopback(struct iegbe_adap
216 * Loopback configuration is the same for each of the supported PHYs.
218 switch (adapter->hw.phy_id) {
219 + case BCM5395S_PHY_ID:
220 + DEBUGOUT("WARNING: An empty iegbe_oem_phy_loopback() has been called!\n");
223 case M88E1000_I_PHY_ID:
224 case M88E1141_E_PHY_ID:
225 + case BCM5481_PHY_ID:
227 adapter->hw.autoneg = FALSE;
229 @@ -1182,8 +1291,14 @@ iegbe_oem_loopback_cleanup(struct iegbe_
232 switch (adapter->hw.phy_id) {
233 + case BCM5395S_PHY_ID:
234 + DEBUGOUT("WARNING: An empty iegbe_oem_loopback_cleanup() has been called!\n");
238 case M88E1000_I_PHY_ID:
239 case M88E1141_E_PHY_ID:
240 + case BCM5481_PHY_ID:
242 adapter->hw.autoneg = TRUE;
244 @@ -1243,6 +1358,11 @@ iegbe_oem_phy_speed_downgraded(struct ie
247 switch (hw->phy_id) {
248 + case BCM5395S_PHY_ID:
249 + case BCM5481_PHY_ID:
253 case M88E1000_I_PHY_ID:
254 case M88E1141_E_PHY_ID:
255 ret_val = iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS,
256 @@ -1305,6 +1425,11 @@ iegbe_oem_check_polarity(struct iegbe_hw
259 switch (hw->phy_id) {
260 + case BCM5395S_PHY_ID:
261 + case BCM5481_PHY_ID:
265 case M88E1000_I_PHY_ID:
266 case M88E1141_E_PHY_ID:
267 /* return the Polarity bit in the Status register. */
268 @@ -1367,6 +1492,25 @@ iegbe_oem_phy_is_full_duplex(struct iegb
271 switch (hw->phy_id) {
272 + case BCM5395S_PHY_ID:
273 + /* Always full duplex */
277 + case BCM5481_PHY_ID:
278 + ret_val = iegbe_read_phy_reg(hw, BCM5481_ASTAT, &phy_data);
279 + if(ret_val) return ret_val;
281 + switch (BCM5481_ASTAT_HCD(phy_data)) {
282 + case BCM5481_ASTAT_1KBTFD:
283 + case BCM5481_ASTAT_100BTXFD:
291 case M88E1000_I_PHY_ID:
292 case M88E1141_E_PHY_ID:
293 ret_val = iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS,
294 @@ -1423,6 +1567,25 @@ iegbe_oem_phy_is_speed_1000(struct iegbe
297 switch (hw->phy_id) {
298 + case BCM5395S_PHY_ID:
299 + /* Always 1000mb */
303 + case BCM5481_PHY_ID:
304 + ret_val = iegbe_read_phy_reg(hw, BCM5481_ASTAT, &phy_data);
305 + if(ret_val) return ret_val;
307 + switch (BCM5481_ASTAT_HCD(phy_data)) {
308 + case BCM5481_ASTAT_1KBTFD:
309 + case BCM5481_ASTAT_1KBTHD:
317 case M88E1000_I_PHY_ID:
318 case M88E1141_E_PHY_ID:
319 ret_val = iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS,
320 @@ -1478,6 +1641,25 @@ iegbe_oem_phy_is_speed_100(struct iegbe_
321 * see iegbe_config_mac_to_phy
323 switch (hw->phy_id) {
324 + case BCM5395S_PHY_ID:
325 + /* Always 1000Mb, never 100mb */
329 + case BCM5481_PHY_ID:
330 + ret_val = iegbe_read_phy_reg(hw, BCM5481_ASTAT, &phy_data);
331 + if(ret_val) return ret_val;
333 + switch (BCM5481_ASTAT_HCD(phy_data)) {
334 + case BCM5481_ASTAT_100BTXFD:
335 + case BCM5481_ASTAT_100BTXHD:
343 case M88E1000_I_PHY_ID:
344 case M88E1141_E_PHY_ID:
345 ret_val = iegbe_oem_read_phy_reg_ex(hw,
346 @@ -1535,6 +1717,11 @@ iegbe_oem_phy_get_info(struct iegbe_hw *
347 * see iegbe_phy_m88_get_info
349 switch (hw->phy_id) {
350 + case BCM5395S_PHY_ID:
351 + case BCM5481_PHY_ID:
352 + DEBUGOUT("WARNING: An empty iegbe_oem_phy_get_info() has been called!\n");
355 case M88E1000_I_PHY_ID:
356 case M88E1141_E_PHY_ID:
357 /* The downshift status is checked only once, after link is
358 @@ -1636,8 +1823,13 @@ iegbe_oem_phy_hw_reset(struct iegbe_hw *
359 * the M88 used in truxton.
361 switch (hw->phy_id) {
362 + case BCM5395S_PHY_ID:
363 + DEBUGOUT("WARNING: An empty iegbe_oem_phy_hw_reset() has been called!\n");
366 case M88E1000_I_PHY_ID:
367 case M88E1141_E_PHY_ID:
368 + case BCM5481_PHY_ID:
369 ret_val = iegbe_oem_read_phy_reg_ex(hw, PHY_CTRL, &phy_data);
371 DEBUGOUT("Unable to read register PHY_CTRL\n");
372 @@ -1699,6 +1891,8 @@ iegbe_oem_phy_init_script(struct iegbe_h
373 switch (hw->phy_id) {
374 case M88E1000_I_PHY_ID:
375 case M88E1141_E_PHY_ID:
376 + case BCM5481_PHY_ID:
377 + case BCM5395S_PHY_ID:
378 DEBUGOUT("Nothing to do for OEM PHY Init");
381 @@ -1735,6 +1929,11 @@ iegbe_oem_read_phy_reg_ex(struct iegbe_h
385 + if (hw->phy_id == BCM5395S_PHY_ID) {
386 + DEBUGOUT("WARNING: iegbe_oem_read_phy_reg_ex() has been unexpectedly called!\n");
390 /* call the GCU func that will read the phy
392 * Make note that the M88 phy is what'll be used on Truxton.
393 @@ -1782,6 +1981,11 @@ iegbe_oem_set_trans_gasket(struct iegbe_
396 switch (hw->phy_id) {
397 + case BCM5395S_PHY_ID:
398 + case BCM5481_PHY_ID:
399 + DEBUGOUT("WARNING: An empty iegbe_oem_set_trans_gasket() has been called!\n");
402 case M88E1000_I_PHY_ID:
403 case M88E1141_E_PHY_ID:
404 /* Gasket set correctly for Marvell Phys, so nothing to do */
405 @@ -1886,6 +2090,8 @@ iegbe_oem_phy_needs_reset_with_mac(struc
406 switch (hw->phy_id) {
407 case M88E1000_I_PHY_ID:
408 case M88E1141_E_PHY_ID:
409 + case BCM5481_PHY_ID:
410 + case BCM5395S_PHY_ID:
414 @@ -1935,6 +2141,8 @@ iegbe_oem_config_dsp_after_link_change(s
415 switch (hw->phy_id) {
416 case M88E1000_I_PHY_ID:
417 case M88E1141_E_PHY_ID:
418 + case BCM5481_PHY_ID:
419 + case BCM5395S_PHY_ID:
420 DEBUGOUT("No DSP to configure on OEM PHY");
423 @@ -1978,6 +2186,12 @@ iegbe_oem_get_cable_length(struct iegbe_
426 switch (hw->phy_id) {
427 + case BCM5395S_PHY_ID:
428 + case BCM5481_PHY_ID:
430 + *max_length = iegbe_igp_cable_length_150;
433 case M88E1000_I_PHY_ID:
434 case M88E1141_E_PHY_ID:
435 ret_val = iegbe_oem_read_phy_reg_ex(hw,
436 @@ -2061,6 +2275,23 @@ iegbe_oem_phy_is_link_up(struct iegbe_hw
439 switch (hw->phy_id) {
440 + case BCM5395S_PHY_ID:
441 + /* Link always up */
443 + return E1000_SUCCESS;
446 + case BCM5481_PHY_ID:
447 + iegbe_oem_read_phy_reg_ex(hw, BCM5481_ESTAT, &phy_data);
448 + ret_val = iegbe_oem_read_phy_reg_ex(hw, BCM5481_ESTAT, &phy_data);
451 + DEBUGOUT("Unable to read PHY register BCM5481_ESTAT\n");
454 + statusMask = BCM5481_ESTAT_LINK;
457 case M88E1000_I_PHY_ID:
458 case M88E1141_E_PHY_ID:
459 iegbe_oem_read_phy_reg_ex(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
460 @@ -2092,3 +2323,210 @@ iegbe_oem_phy_is_link_up(struct iegbe_hw
461 #endif /* ifdef EXTERNAL_MDIO */
467 +// Read BCM5481 expansion register
470 +bcm5481_read_ex (struct iegbe_hw *hw, uint16_t reg, uint16_t *data)
476 + // Get the current value of bits 15:12
477 + ret = iegbe_oem_read_phy_reg_ex (hw, 0x15, &selector);
481 + // Select the expansion register
482 + selector &= 0xf000;
483 + selector |= (0xf << 8) | (reg);
484 + iegbe_oem_write_phy_reg_ex (hw, 0x17, selector);
486 + // Read the expansion register
487 + ret = iegbe_oem_read_phy_reg_ex (hw, 0x15, ®_data);
489 + // De-select the expansion registers.
490 + selector &= 0xf000;
491 + iegbe_oem_write_phy_reg_ex (hw, 0x17, selector);
501 +// Read reg 0x18 sub-register
504 +bcm5481_read_18sv (struct iegbe_hw *hw, int sv, uint16_t *data)
509 + // Select reg 0x18, sv
510 + tmp_data = ((sv & BCM5481_R18H_SV_MASK) << 12) | BCM5481_R18H_SV_MCTRL;
511 + ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R18H, tmp_data);
515 + // Read reg 0x18, sv
516 + ret = iegbe_oem_read_phy_reg_ex (hw, BCM5481_R18H, &tmp_data);
525 +// Read reg 0x1C sub-register
528 +bcm5481_read_1csv (struct iegbe_hw *hw, int sv, uint16_t *data)
533 + // Select reg 0x1c, sv
534 + tmp_data = ((sv & BCM5481_R1CH_SV_MASK) << BCM5481_R1CH_SV_SHIFT);
536 + ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R1CH, tmp_data);
540 + // Read reg 0x1c, sv
541 + ret = iegbe_oem_read_phy_reg_ex (hw, BCM5481_R1CH, &tmp_data);
550 +// Read-modify-write a 0x1C register.
552 +// hw - hardware access info.
553 +// reg - 0x1C register to modify.
554 +// data - bits which should be set.
555 +// mask - the '1' bits in this argument will be cleared in the data
556 +// read from 'reg' then 'data' will be or'd in and the result
557 +// will be written to 'reg'.
560 +bcm5481_rmw_1csv (struct iegbe_hw *hw, uint16_t reg, uint16_t data, uint16_t mask)
567 + ret = bcm5481_read_1csv (hw, reg, ®_data);
570 + DEBUGOUT("Unable to read BCM5481 1CH register\n");
571 + printk (KERN_ERR "Unable to read BCM5481 1CH register [0x%x]\n", reg);
576 + reg_data |= (BCM5481_R1CH_WE | data);
578 + ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R1CH, reg_data);
581 + DEBUGOUT("Unable to write BCM5481 1CH register\n");
582 + printk (KERN_ERR "Unable to write BCM5481 1CH register\n");
590 +oi_phy_setup (struct iegbe_hw *hw)
593 + uint16_t pmii_data;
594 + uint16_t mctrl_data;
595 + uint16_t cacr_data;
599 + // Set low power mode via reg 0x18, sv010, bit 6
600 + // Do a read-modify-write on reg 0x18, sv010 register to preserve existing bits.
601 + ret = bcm5481_read_18sv (hw, BCM5481_R18H_SV_PMII, &pmii_data);
604 + DEBUGOUT("Unable to read BCM5481_R18H_SV_PMII register\n");
605 + printk (KERN_ERR "Unable to read BCM5481_R18H_SV_PMII register\n");
609 + // Set the LPM bit in the data just read and write back to sv010
610 + // The shadow register select bits [2:0] are set by reading the sv010
612 + pmii_data |= BCM5481_R18H_SV010_LPM;
613 + ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R18H, pmii_data);
616 + DEBUGOUT("Unable to write BCM5481_R18H register\n");
617 + printk (KERN_ERR "Unable to write BCM5481_R18H register\n");
622 + // Set the RGMII RXD to RXC skew bit in reg 0x18, sv111
624 + if (bcm5481_read_18sv (hw, BCM5481_R18H_SV_MCTRL, &mctrl_data))
626 + DEBUGOUT("Unable to read BCM5481_R18H_SV_MCTRL register\n");
627 + printk (KERN_ERR "Unable to read BCM5481_R18H_SV_MCTRL register\n");
630 + mctrl_data |= (BCM5481_R18H_WE | BCM5481_R18H_SV111_SKEW);
632 + ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R18H, mctrl_data);
635 + DEBUGOUT("Unable to write BCM5481_R18H register\n");
636 + printk (KERN_ERR "Unable to write BCM5481_R18H register\n");
640 + // Enable RGMII transmit clock delay in reg 0x1c, sv00011
641 + ret = bcm5481_read_1csv (hw, BCM5481_R1CH_CACR, &cacr_data);
644 + DEBUGOUT("Unable to read BCM5481_R1CH_CACR register\n");
645 + printk (KERN_ERR "Unable to read BCM5481_R1CH_CACR register\n");
649 + cacr_data |= (BCM5481_R1CH_WE | BCM5481_R1CH_CACR_TCD);
651 + ret = iegbe_oem_write_phy_reg_ex (hw, BCM5481_R1CH, cacr_data);
654 + DEBUGOUT("Unable to write BCM5481_R1CH register\n");
655 + printk (KERN_ERR "Unable to write BCM5481_R1CH register\n");
659 + // Enable dual link speed indication (0x1c, sv 00010, bit 2)
660 + ret = bcm5481_rmw_1csv (hw, BCM5481_R1CH_SC1, BCM5481_R1CH_SC1_LINK, BCM5481_R1CH_SC1_LINK);
664 + // Enable link and activity on ACTIVITY LED (0x1c, sv 01001, bit 4=1, bit 3=0)
665 + ret = bcm5481_rmw_1csv (hw, BCM5481_R1CH_LCTRL, BCM5481_R1CH_LCTRL_ALEN, BCM5481_R1CH_LCTRL_ALEN | BCM5481_R1CH_LCTRL_AEN);
671 --- a/Embedded/src/GbE/iegbe_oem_phy.h
672 +++ b/Embedded/src/GbE/iegbe_oem_phy.h
673 @@ -95,6 +95,8 @@ int32_t iegbe_oem_phy_is_link_up(struct
675 #define DEFAULT_ICP_XXXX_TIPG_IPGT 8 /* Inter Packet Gap Transmit Time */
676 #define ICP_XXXX_TIPG_IPGT_MASK 0x000003FFUL
677 +#define BCM5481_PHY_ID 0x0143BCA0
678 +#define BCM5395S_PHY_ID 0x0143BCF0
680 /* Miscellaneous defines */
681 #ifdef IEGBE_10_100_ONLY
682 @@ -103,5 +105,65 @@ int32_t iegbe_oem_phy_is_link_up(struct
683 #define ICP_XXXX_AUTONEG_ADV_DEFAULT 0x2F
686 +/* BCM5481 specifics */
688 +#define BCM5481_ECTRL (0x10)
689 +#define BCM5481_ESTAT (0x11)
690 +#define BCM5481_RXERR (0x12)
691 +#define BCM5481_EXPRW (0x15)
692 +#define BCM5481_EXPACC (0x17)
693 +#define BCM5481_ASTAT (0x19)
694 +#define BCM5481_R18H (0x18)
695 +#define BCM5481_R1CH (0x1c)
697 +/* indirect register access via register 18h */
699 +#define BCM5481_R18H_SV_MASK (7) // Mask for SV bits.
700 +#define BCM5481_R18H_SV_ACTRL (0) // SV000 Aux. control
701 +#define BCM5481_R18H_SV_10BT (1) // SV001 10Base-T
702 +#define BCM5481_R18H_SV_PMII (2) // SV010 Power/MII control
703 +#define BCM5481_R18H_SV_MTEST (4) // SV100 Misc. test
704 +#define BCM5481_R18H_SV_MCTRL (7) // SV111 Misc. control
706 +#define BCM5481_R18H_SV001_POL (1 << 13) // Polarity
707 +#define BCM5481_R18H_SV010_LPM (1 << 6)
708 +#define BCM5481_R18H_SV111_SKEW (1 << 8)
709 +#define BCM5481_R18H_WE (1 << 15) // Write enable
712 +#define BCM5481_R1CH_SV_SHIFT (10)
713 +#define BCM5481_R1CH_SV_MASK (0x1f)
714 +#define BCM5481_R1CH_SC1 (0x02) // sv00010 Spare control 1
715 +#define BCM5481_R1CH_CACR (0x03) // sv00011 Clock alignment control
716 +#define BCM5481_R1CH_LCTRL (0x09) // sv01001 LED control
717 +#define BCM5481_R1CH_LEDS1 (0x0d) // sv01101 LED selector 1
720 +#define BCM5481_R1CH_WE (1 << 15) // Write enable
723 +#define BCM5481_R1CH_SC1_LINK (1 << 2) // sv00010 Linkspeed
726 +#define BCM5481_R1CH_CACR_TCD (1 << 9) // sv00011 RGMII tx clock delay
729 +#define BCM5481_R1CH_LCTRL_ALEN (1 << 4) // Activity/Link enable on ACTIVITY LED
730 +#define BCM5481_R1CH_LCTRL_AEN (1 << 3) // Activity enable on ACTIVITY LED
732 +#define BCM5481_ECTRL_DISMDIX (1 <<14)
734 +#define BCM5481_MCTRL_AUTOMDIX (1 <<9)
736 +#define BCM5481_ESTAT_LINK (1 << 8)
738 +#define BCM5481_ASTAT_ANC (1 << 15)
739 +#define BCM5481_ASTAT_ANHCD (7 << 8)
740 +#define BCM5481_ASTAT_HCD(x) ((x >> 8) & 7)
741 +#define BCM5481_ASTAT_1KBTFD (0x7)
742 +#define BCM5481_ASTAT_1KBTHD (0x6)
743 +#define BCM5481_ASTAT_100BTXFD (0x5)
744 +#define BCM5481_ASTAT_100BTXHD (0x3)
746 #endif /* ifndef _IEGBE_OEM_PHY_H_ */