*** link.c.orig Fri Apr 7 17:43:21 2000 --- link.c Wed Jul 26 10:32:55 2000 *************** *** 1102,1107 **** --- 1102,1109 ---- void activate_phy(void) { + U16 mii_reg_status; + /* mask off rx attn event... */ EVENT_MASK &= ~TG_FW_EVENT_MAC_RX_ATTN; *************** *** 1202,1207 **** --- 1204,1222 ---- /* clear the attn bits */ trp->mac_control.mac_rx_state |= TG_MAC_RX_ATTN_MASK; + /* poll for the no HCD link interrupt, broadcom errata */ + read_mii_mgt(PHYADDR, 0x1a, &mii_reg_status); + if (mii_reg_status & 0x200) { + LINK_UTRACE("noHcdLk", 0xc0111, + mii_reg_status, 0, + active_phy, gig_negotiate); + set_mii_reg(GMII_REG_CONTROL, WR_OP, 0x4040); + /* go back to reset mii phy to restore its state */ + BRINGUP_LINK_STATE = BRINGUP_LINK_STATE_RESET_WAIT; + break; /* early return */ + + } + /* start the flaps timer */ bringup_link_timer = trp->gen_control.timer; *************** *** 1491,1497 **** trp->mac_control.mac_len = (trp->mac_control.mac_len & TG_MAC_TX_LEN_TAG_TYPE_MASK) | ! 0x251f; BRINGUP_LINK_STATE = BRINGUP_LINK_STATE_READY; --- 1506,1512 ---- trp->mac_control.mac_len = (trp->mac_control.mac_len & TG_MAC_TX_LEN_TAG_TYPE_MASK) | ! 0x241f; BRINGUP_LINK_STATE = BRINGUP_LINK_STATE_READY; *************** *** 1680,1686 **** trp->mac_control.mac_len = (trp->mac_control.mac_len & TG_MAC_TX_LEN_TAG_TYPE_MASK) | ! 0x251f; BRINGUP_LINK_STATE = BRINGUP_LINK_STATE_READY; --- 1695,1701 ---- trp->mac_control.mac_len = (trp->mac_control.mac_len & TG_MAC_TX_LEN_TAG_TYPE_MASK) | ! 0x241f; BRINGUP_LINK_STATE = BRINGUP_LINK_STATE_READY; *************** *** 1783,1788 **** --- 1798,1818 ---- /* clear the attn bits */ trp->mac_control.mac_rx_state |= TG_MAC_RX_ATTN_MASK; + /* poll for the no HCD link interrupt, broadcom errata */ + read_mii_mgt(PHYADDR, 0x1a, &mii_reg_status); + if (mii_reg_status & 0x200) { + LINK_UTRACE("noHcdLk", 0xc0112, + mii_reg_status, 0, + active_phy, gig_negotiate); + set_mii_reg(GMII_REG_CONTROL, WR_OP, 0x4040); + if (gig_negotiate) + set_mii_reg(GMII_REG_CONTROL, WR_OP, 0x1000); + else + /* go back to reset mii phy to restore its state */ + BRINGUP_LINK_STATE = BRINGUP_LINK_STATE_RESET_WAIT; + break; /* early return */ + } + /* start the flaps timer */ bringup_link_timer = trp->gen_control.timer; *************** *** 1869,1875 **** trp->mac_control.mac_len = (trp->mac_control.mac_len & TG_MAC_TX_LEN_TAG_TYPE_MASK) | ! 0x251f; BRINGUP_LINK_STATE = BRINGUP_LINK_STATE_READY; --- 1899,1905 ---- trp->mac_control.mac_len = (trp->mac_control.mac_len & TG_MAC_TX_LEN_TAG_TYPE_MASK) | ! 0x241f; BRINGUP_LINK_STATE = BRINGUP_LINK_STATE_READY; *************** *** 2308,2314 **** trp->mac_control.mac_len = (trp->mac_control.mac_len & TG_MAC_TX_LEN_TAG_TYPE_MASK) | ! 0x251f; /* enable normal operation */ ENABLE_MAC_RX(); --- 2338,2344 ---- trp->mac_control.mac_len = (trp->mac_control.mac_len & TG_MAC_TX_LEN_TAG_TYPE_MASK) | ! 0x241f; /* enable normal operation */ ENABLE_MAC_RX();