1d035aa2dSJack F Vogel /****************************************************************************** 27282444bSPedro F. Giffuni SPDX-License-Identifier: BSD-3-Clause 38cfa0ad2SJack F Vogel 4702cac6cSKevin Bowling Copyright (c) 2001-2020, Intel Corporation 58cfa0ad2SJack F Vogel All rights reserved. 68cfa0ad2SJack F Vogel 78cfa0ad2SJack F Vogel Redistribution and use in source and binary forms, with or without 88cfa0ad2SJack F Vogel modification, are permitted provided that the following conditions are met: 98cfa0ad2SJack F Vogel 108cfa0ad2SJack F Vogel 1. Redistributions of source code must retain the above copyright notice, 118cfa0ad2SJack F Vogel this list of conditions and the following disclaimer. 128cfa0ad2SJack F Vogel 138cfa0ad2SJack F Vogel 2. Redistributions in binary form must reproduce the above copyright 148cfa0ad2SJack F Vogel notice, this list of conditions and the following disclaimer in the 158cfa0ad2SJack F Vogel documentation and/or other materials provided with the distribution. 168cfa0ad2SJack F Vogel 178cfa0ad2SJack F Vogel 3. Neither the name of the Intel Corporation nor the names of its 188cfa0ad2SJack F Vogel contributors may be used to endorse or promote products derived from 198cfa0ad2SJack F Vogel this software without specific prior written permission. 208cfa0ad2SJack F Vogel 218cfa0ad2SJack F Vogel THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 228cfa0ad2SJack F Vogel AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 238cfa0ad2SJack F Vogel IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 248cfa0ad2SJack F Vogel ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 258cfa0ad2SJack F Vogel LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 268cfa0ad2SJack F Vogel CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 278cfa0ad2SJack F Vogel SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 288cfa0ad2SJack F Vogel INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 298cfa0ad2SJack F Vogel CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 308cfa0ad2SJack F Vogel ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 318cfa0ad2SJack F Vogel POSSIBILITY OF SUCH DAMAGE. 328cfa0ad2SJack F Vogel 338cfa0ad2SJack F Vogel ******************************************************************************/ 348cfa0ad2SJack F Vogel 358cfa0ad2SJack F Vogel #ifndef _E1000_PHY_H_ 368cfa0ad2SJack F Vogel #define _E1000_PHY_H_ 378cfa0ad2SJack F Vogel 388cfa0ad2SJack F Vogel void e1000_init_phy_ops_generic(struct e1000_hw *hw); 398cfa0ad2SJack F Vogel s32 e1000_null_read_reg(struct e1000_hw *hw, u32 offset, u16 *data); 408cfa0ad2SJack F Vogel void e1000_null_phy_generic(struct e1000_hw *hw); 418cfa0ad2SJack F Vogel s32 e1000_null_lplu_state(struct e1000_hw *hw, bool active); 428cfa0ad2SJack F Vogel s32 e1000_null_write_reg(struct e1000_hw *hw, u32 offset, u16 data); 434dab5c37SJack F Vogel s32 e1000_null_set_page(struct e1000_hw *hw, u16 data); 44ab5d0362SJack F Vogel s32 e1000_read_i2c_byte_null(struct e1000_hw *hw, u8 byte_offset, 45ab5d0362SJack F Vogel u8 dev_addr, u8 *data); 46ab5d0362SJack F Vogel s32 e1000_write_i2c_byte_null(struct e1000_hw *hw, u8 byte_offset, 47ab5d0362SJack F Vogel u8 dev_addr, u8 data); 488cfa0ad2SJack F Vogel s32 e1000_check_downshift_generic(struct e1000_hw *hw); 498cfa0ad2SJack F Vogel s32 e1000_check_polarity_m88(struct e1000_hw *hw); 508cfa0ad2SJack F Vogel s32 e1000_check_polarity_igp(struct e1000_hw *hw); 519d81738fSJack F Vogel s32 e1000_check_polarity_ife(struct e1000_hw *hw); 528cfa0ad2SJack F Vogel s32 e1000_check_reset_block_generic(struct e1000_hw *hw); 534edd8523SJack F Vogel s32 e1000_phy_setup_autoneg(struct e1000_hw *hw); 548cfa0ad2SJack F Vogel s32 e1000_copper_link_autoneg(struct e1000_hw *hw); 558cfa0ad2SJack F Vogel s32 e1000_copper_link_setup_igp(struct e1000_hw *hw); 568cfa0ad2SJack F Vogel s32 e1000_copper_link_setup_m88(struct e1000_hw *hw); 57f0ecc46dSJack F Vogel s32 e1000_copper_link_setup_m88_gen2(struct e1000_hw *hw); 588cfa0ad2SJack F Vogel s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw); 598cfa0ad2SJack F Vogel s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw); 609d81738fSJack F Vogel s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw); 618cfa0ad2SJack F Vogel s32 e1000_get_cable_length_m88(struct e1000_hw *hw); 62f0ecc46dSJack F Vogel s32 e1000_get_cable_length_m88_gen2(struct e1000_hw *hw); 638cfa0ad2SJack F Vogel s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw); 648cfa0ad2SJack F Vogel s32 e1000_get_cfg_done_generic(struct e1000_hw *hw); 658cfa0ad2SJack F Vogel s32 e1000_get_phy_id(struct e1000_hw *hw); 668cfa0ad2SJack F Vogel s32 e1000_get_phy_info_igp(struct e1000_hw *hw); 678cfa0ad2SJack F Vogel s32 e1000_get_phy_info_m88(struct e1000_hw *hw); 684edd8523SJack F Vogel s32 e1000_get_phy_info_ife(struct e1000_hw *hw); 698cfa0ad2SJack F Vogel s32 e1000_phy_sw_reset_generic(struct e1000_hw *hw); 708cfa0ad2SJack F Vogel void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl); 718cfa0ad2SJack F Vogel s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw); 728cfa0ad2SJack F Vogel s32 e1000_phy_reset_dsp_generic(struct e1000_hw *hw); 738cfa0ad2SJack F Vogel s32 e1000_read_kmrn_reg_generic(struct e1000_hw *hw, u32 offset, u16 *data); 744edd8523SJack F Vogel s32 e1000_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 *data); 754dab5c37SJack F Vogel s32 e1000_set_page_igp(struct e1000_hw *hw, u16 page); 768cfa0ad2SJack F Vogel s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data); 774edd8523SJack F Vogel s32 e1000_read_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 *data); 788cfa0ad2SJack F Vogel s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data); 798cfa0ad2SJack F Vogel s32 e1000_set_d3_lplu_state_generic(struct e1000_hw *hw, bool active); 808cfa0ad2SJack F Vogel s32 e1000_setup_copper_link_generic(struct e1000_hw *hw); 818cfa0ad2SJack F Vogel s32 e1000_write_kmrn_reg_generic(struct e1000_hw *hw, u32 offset, u16 data); 824edd8523SJack F Vogel s32 e1000_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 data); 838cfa0ad2SJack F Vogel s32 e1000_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data); 844edd8523SJack F Vogel s32 e1000_write_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 data); 858cfa0ad2SJack F Vogel s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data); 868cfa0ad2SJack F Vogel s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, 878cfa0ad2SJack F Vogel u32 usec_interval, bool *success); 888cfa0ad2SJack F Vogel s32 e1000_phy_init_script_igp3(struct e1000_hw *hw); 898cfa0ad2SJack F Vogel enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id); 908cfa0ad2SJack F Vogel s32 e1000_determine_phy_address(struct e1000_hw *hw); 918cfa0ad2SJack F Vogel s32 e1000_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data); 928cfa0ad2SJack F Vogel s32 e1000_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data); 934dab5c37SJack F Vogel s32 e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg); 944dab5c37SJack F Vogel s32 e1000_disable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg); 958cfa0ad2SJack F Vogel s32 e1000_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data); 968cfa0ad2SJack F Vogel s32 e1000_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data); 978cfa0ad2SJack F Vogel void e1000_power_up_phy_copper(struct e1000_hw *hw); 988cfa0ad2SJack F Vogel void e1000_power_down_phy_copper(struct e1000_hw *hw); 998cfa0ad2SJack F Vogel s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data); 1008cfa0ad2SJack F Vogel s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data); 1014edd8523SJack F Vogel s32 e1000_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data); 1024edd8523SJack F Vogel s32 e1000_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data); 1034dab5c37SJack F Vogel s32 e1000_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data); 1044dab5c37SJack F Vogel s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data); 1059d81738fSJack F Vogel s32 e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data); 1064edd8523SJack F Vogel s32 e1000_read_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, u16 *data); 1074dab5c37SJack F Vogel s32 e1000_read_phy_reg_page_hv(struct e1000_hw *hw, u32 offset, u16 *data); 1089d81738fSJack F Vogel s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data); 1094edd8523SJack F Vogel s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, u16 data); 1104dab5c37SJack F Vogel s32 e1000_write_phy_reg_page_hv(struct e1000_hw *hw, u32 offset, u16 data); 1119d81738fSJack F Vogel s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw); 1129d81738fSJack F Vogel s32 e1000_copper_link_setup_82577(struct e1000_hw *hw); 1139d81738fSJack F Vogel s32 e1000_check_polarity_82577(struct e1000_hw *hw); 1149d81738fSJack F Vogel s32 e1000_get_phy_info_82577(struct e1000_hw *hw); 1159d81738fSJack F Vogel s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw); 1169d81738fSJack F Vogel s32 e1000_get_cable_length_82577(struct e1000_hw *hw); 117ab5d0362SJack F Vogel s32 e1000_write_phy_reg_gs40g(struct e1000_hw *hw, u32 offset, u16 data); 118ab5d0362SJack F Vogel s32 e1000_read_phy_reg_gs40g(struct e1000_hw *hw, u32 offset, u16 *data); 1197609433eSJack F Vogel s32 e1000_read_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 *data); 1207609433eSJack F Vogel s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data, 1217609433eSJack F Vogel bool line_override); 1227609433eSJack F Vogel bool e1000_is_mphy_ready(struct e1000_hw *hw); 1238cfa0ad2SJack F Vogel 124da24467cSGuinan Sun s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, 125da24467cSGuinan Sun u16 *data); 126da24467cSGuinan Sun s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, 127da24467cSGuinan Sun u16 data); 128da24467cSGuinan Sun 1294dab5c37SJack F Vogel #define E1000_MAX_PHY_ADDR 8 1308cfa0ad2SJack F Vogel 1318cfa0ad2SJack F Vogel /* IGP01E1000 Specific Registers */ 1328cfa0ad2SJack F Vogel #define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */ 1338cfa0ad2SJack F Vogel #define IGP01E1000_PHY_PORT_STATUS 0x11 /* Status */ 1348cfa0ad2SJack F Vogel #define IGP01E1000_PHY_PORT_CTRL 0x12 /* Control */ 1358cfa0ad2SJack F Vogel #define IGP01E1000_PHY_LINK_HEALTH 0x13 /* PHY Link Health */ 1368cfa0ad2SJack F Vogel #define IGP01E1000_GMII_FIFO 0x14 /* GMII FIFO */ 1378cfa0ad2SJack F Vogel #define IGP02E1000_PHY_POWER_MGMT 0x19 /* Power Management */ 1388cfa0ad2SJack F Vogel #define IGP01E1000_PHY_PAGE_SELECT 0x1F /* Page Select */ 1398cfa0ad2SJack F Vogel #define BM_PHY_PAGE_SELECT 22 /* Page Select for BM */ 1408cfa0ad2SJack F Vogel #define IGP_PAGE_SHIFT 5 1418cfa0ad2SJack F Vogel #define PHY_REG_MASK 0x1F 1428cfa0ad2SJack F Vogel 143ab5d0362SJack F Vogel /* GS40G - I210 PHY defines */ 144ab5d0362SJack F Vogel #define GS40G_PAGE_SELECT 0x16 145ab5d0362SJack F Vogel #define GS40G_PAGE_SHIFT 16 146ab5d0362SJack F Vogel #define GS40G_OFFSET_MASK 0xFFFF 147ab5d0362SJack F Vogel #define GS40G_PAGE_2 0x20000 148ab5d0362SJack F Vogel #define GS40G_MAC_REG2 0x15 149ab5d0362SJack F Vogel #define GS40G_MAC_LB 0x4140 150ab5d0362SJack F Vogel #define GS40G_MAC_SPEED_1G 0X0006 151ab5d0362SJack F Vogel #define GS40G_COPPER_SPEC 0x0010 152ab5d0362SJack F Vogel 153d035aa2dSJack F Vogel /* BM/HV Specific Registers */ 154d035aa2dSJack F Vogel #define BM_PORT_CTRL_PAGE 769 1558cfa0ad2SJack F Vogel #define BM_WUC_PAGE 800 1568cfa0ad2SJack F Vogel #define BM_WUC_ADDRESS_OPCODE 0x11 1578cfa0ad2SJack F Vogel #define BM_WUC_DATA_OPCODE 0x12 158d035aa2dSJack F Vogel #define BM_WUC_ENABLE_PAGE BM_PORT_CTRL_PAGE 1598cfa0ad2SJack F Vogel #define BM_WUC_ENABLE_REG 17 1608cfa0ad2SJack F Vogel #define BM_WUC_ENABLE_BIT (1 << 2) 1618cfa0ad2SJack F Vogel #define BM_WUC_HOST_WU_BIT (1 << 4) 1624dab5c37SJack F Vogel #define BM_WUC_ME_WU_BIT (1 << 5) 1638cfa0ad2SJack F Vogel 164d035aa2dSJack F Vogel #define PHY_UPPER_SHIFT 21 165d035aa2dSJack F Vogel #define BM_PHY_REG(page, reg) \ 166d035aa2dSJack F Vogel (((reg) & MAX_PHY_REG_ADDRESS) |\ 167d035aa2dSJack F Vogel (((page) & 0xFFFF) << PHY_PAGE_SHIFT) |\ 168d035aa2dSJack F Vogel (((reg) & ~MAX_PHY_REG_ADDRESS) << (PHY_UPPER_SHIFT - PHY_PAGE_SHIFT))) 169d035aa2dSJack F Vogel #define BM_PHY_REG_PAGE(offset) \ 170d035aa2dSJack F Vogel ((u16)(((offset) >> PHY_PAGE_SHIFT) & 0xFFFF)) 171d035aa2dSJack F Vogel #define BM_PHY_REG_NUM(offset) \ 172d035aa2dSJack F Vogel ((u16)(((offset) & MAX_PHY_REG_ADDRESS) |\ 173d035aa2dSJack F Vogel (((offset) >> (PHY_UPPER_SHIFT - PHY_PAGE_SHIFT)) &\ 174d035aa2dSJack F Vogel ~MAX_PHY_REG_ADDRESS))) 175d035aa2dSJack F Vogel 1769d81738fSJack F Vogel #define HV_INTC_FC_PAGE_START 768 1779d81738fSJack F Vogel #define I82578_ADDR_REG 29 1789d81738fSJack F Vogel #define I82577_ADDR_REG 16 1799d81738fSJack F Vogel #define I82577_CFG_REG 22 1809d81738fSJack F Vogel #define I82577_CFG_ASSERT_CRS_ON_TX (1 << 15) 1817609433eSJack F Vogel #define I82577_CFG_ENABLE_DOWNSHIFT (3 << 10) /* auto downshift */ 1829d81738fSJack F Vogel #define I82577_CTRL_REG 23 1839d81738fSJack F Vogel 1849d81738fSJack F Vogel /* 82577 specific PHY registers */ 1859d81738fSJack F Vogel #define I82577_PHY_CTRL_2 18 1869d81738fSJack F Vogel #define I82577_PHY_LBK_CTRL 19 1879d81738fSJack F Vogel #define I82577_PHY_STATUS_2 26 1889d81738fSJack F Vogel #define I82577_PHY_DIAG_STATUS 31 1899d81738fSJack F Vogel 1909d81738fSJack F Vogel /* I82577 PHY Status 2 */ 1919d81738fSJack F Vogel #define I82577_PHY_STATUS2_REV_POLARITY 0x0400 1929d81738fSJack F Vogel #define I82577_PHY_STATUS2_MDIX 0x0800 1939d81738fSJack F Vogel #define I82577_PHY_STATUS2_SPEED_MASK 0x0300 1949d81738fSJack F Vogel #define I82577_PHY_STATUS2_SPEED_1000MBPS 0x0200 1959d81738fSJack F Vogel 1969d81738fSJack F Vogel /* I82577 PHY Control 2 */ 197ab5d0362SJack F Vogel #define I82577_PHY_CTRL2_MANUAL_MDIX 0x0200 198ab5d0362SJack F Vogel #define I82577_PHY_CTRL2_AUTO_MDI_MDIX 0x0400 199ab5d0362SJack F Vogel #define I82577_PHY_CTRL2_MDIX_CFG_MASK 0x0600 2009d81738fSJack F Vogel 2019d81738fSJack F Vogel /* I82577 PHY Diagnostics Status */ 2029d81738fSJack F Vogel #define I82577_DSTATUS_CABLE_LENGTH 0x03FC 2039d81738fSJack F Vogel #define I82577_DSTATUS_CABLE_LENGTH_SHIFT 2 2049d81738fSJack F Vogel 205f0ecc46dSJack F Vogel /* 82580 PHY Power Management */ 206f0ecc46dSJack F Vogel #define E1000_82580_PHY_POWER_MGMT 0xE14 207f0ecc46dSJack F Vogel #define E1000_82580_PM_SPD 0x0001 /* Smart Power Down */ 208f0ecc46dSJack F Vogel #define E1000_82580_PM_D0_LPLU 0x0002 /* For D0a states */ 209f0ecc46dSJack F Vogel #define E1000_82580_PM_D3_LPLU 0x0004 /* For all other states */ 2106ab6bfe3SJack F Vogel #define E1000_82580_PM_GO_LINKD 0x0020 /* Go Link Disconnect */ 211f0ecc46dSJack F Vogel 2127609433eSJack F Vogel #define E1000_MPHY_DIS_ACCESS 0x80000000 /* disable_access bit */ 2137609433eSJack F Vogel #define E1000_MPHY_ENA_ACCESS 0x40000000 /* enable_access bit */ 2147609433eSJack F Vogel #define E1000_MPHY_BUSY 0x00010000 /* busy bit */ 2157609433eSJack F Vogel #define E1000_MPHY_ADDRESS_FNC_OVERRIDE 0x20000000 /* fnc_override bit */ 2167609433eSJack F Vogel #define E1000_MPHY_ADDRESS_MASK 0x0000FFFF /* address mask */ 2177609433eSJack F Vogel 2188cfa0ad2SJack F Vogel /* BM PHY Copper Specific Control 1 */ 2198cfa0ad2SJack F Vogel #define BM_CS_CTRL1 16 2208cfa0ad2SJack F Vogel 2219d81738fSJack F Vogel /* BM PHY Copper Specific Status */ 2228cfa0ad2SJack F Vogel #define BM_CS_STATUS 17 2239d81738fSJack F Vogel #define BM_CS_STATUS_LINK_UP 0x0400 2249d81738fSJack F Vogel #define BM_CS_STATUS_RESOLVED 0x0800 2259d81738fSJack F Vogel #define BM_CS_STATUS_SPEED_MASK 0xC000 2269d81738fSJack F Vogel #define BM_CS_STATUS_SPEED_1000 0x8000 2278cfa0ad2SJack F Vogel 2284edd8523SJack F Vogel /* 82577 Mobile Phy Status Register */ 2294edd8523SJack F Vogel #define HV_M_STATUS 26 2304edd8523SJack F Vogel #define HV_M_STATUS_AUTONEG_COMPLETE 0x1000 2314edd8523SJack F Vogel #define HV_M_STATUS_SPEED_MASK 0x0300 2324edd8523SJack F Vogel #define HV_M_STATUS_SPEED_1000 0x0200 2338cc64f1eSJack F Vogel #define HV_M_STATUS_SPEED_100 0x0100 2344edd8523SJack F Vogel #define HV_M_STATUS_LINK_UP 0x0040 2354edd8523SJack F Vogel 2368cfa0ad2SJack F Vogel #define IGP01E1000_PHY_PCS_INIT_REG 0x00B4 2378cfa0ad2SJack F Vogel #define IGP01E1000_PHY_POLARITY_MASK 0x0078 2388cfa0ad2SJack F Vogel 2398cfa0ad2SJack F Vogel #define IGP01E1000_PSCR_AUTO_MDIX 0x1000 2408cfa0ad2SJack F Vogel #define IGP01E1000_PSCR_FORCE_MDI_MDIX 0x2000 /* 0=MDI, 1=MDIX */ 2418cfa0ad2SJack F Vogel 2428cfa0ad2SJack F Vogel #define IGP01E1000_PSCFR_SMART_SPEED 0x0080 2438cfa0ad2SJack F Vogel 2448cfa0ad2SJack F Vogel /* Enable flexible speed on link-up */ 2458cfa0ad2SJack F Vogel #define IGP01E1000_GMII_FLEX_SPD 0x0010 2468cfa0ad2SJack F Vogel #define IGP01E1000_GMII_SPD 0x0020 /* Enable SPD */ 2478cfa0ad2SJack F Vogel 2488cfa0ad2SJack F Vogel #define IGP02E1000_PM_SPD 0x0001 /* Smart Power Down */ 2498cfa0ad2SJack F Vogel #define IGP02E1000_PM_D0_LPLU 0x0002 /* For D0a states */ 2508cfa0ad2SJack F Vogel #define IGP02E1000_PM_D3_LPLU 0x0004 /* For all other states */ 2518cfa0ad2SJack F Vogel 2528cfa0ad2SJack F Vogel #define IGP01E1000_PLHR_SS_DOWNGRADE 0x8000 2538cfa0ad2SJack F Vogel 2548cfa0ad2SJack F Vogel #define IGP01E1000_PSSR_POLARITY_REVERSED 0x0002 2559d81738fSJack F Vogel #define IGP01E1000_PSSR_MDIX 0x0800 2568cfa0ad2SJack F Vogel #define IGP01E1000_PSSR_SPEED_MASK 0xC000 2578cfa0ad2SJack F Vogel #define IGP01E1000_PSSR_SPEED_1000MBPS 0xC000 2588cfa0ad2SJack F Vogel 2598cfa0ad2SJack F Vogel #define IGP02E1000_PHY_CHANNEL_NUM 4 2608cfa0ad2SJack F Vogel #define IGP02E1000_PHY_AGC_A 0x11B1 2618cfa0ad2SJack F Vogel #define IGP02E1000_PHY_AGC_B 0x12B1 2628cfa0ad2SJack F Vogel #define IGP02E1000_PHY_AGC_C 0x14B1 2638cfa0ad2SJack F Vogel #define IGP02E1000_PHY_AGC_D 0x18B1 2648cfa0ad2SJack F Vogel 2657609433eSJack F Vogel #define IGP02E1000_AGC_LENGTH_SHIFT 9 /* Course=15:13, Fine=12:9 */ 2668cfa0ad2SJack F Vogel #define IGP02E1000_AGC_LENGTH_MASK 0x7F 2678cfa0ad2SJack F Vogel #define IGP02E1000_AGC_RANGE 15 2688cfa0ad2SJack F Vogel 2698cfa0ad2SJack F Vogel #define E1000_CABLE_LENGTH_UNDEFINED 0xFF 2708cfa0ad2SJack F Vogel 2718cfa0ad2SJack F Vogel #define E1000_KMRNCTRLSTA_OFFSET 0x001F0000 2728cfa0ad2SJack F Vogel #define E1000_KMRNCTRLSTA_OFFSET_SHIFT 16 2738cfa0ad2SJack F Vogel #define E1000_KMRNCTRLSTA_REN 0x00200000 2747d9119bdSJack F Vogel #define E1000_KMRNCTRLSTA_CTRL_OFFSET 0x1 /* Kumeran Control */ 2758cfa0ad2SJack F Vogel #define E1000_KMRNCTRLSTA_DIAG_OFFSET 0x3 /* Kumeran Diagnostic */ 2769d81738fSJack F Vogel #define E1000_KMRNCTRLSTA_TIMEOUTS 0x4 /* Kumeran Timeouts */ 2779d81738fSJack F Vogel #define E1000_KMRNCTRLSTA_INBAND_PARAM 0x9 /* Kumeran InBand Parameters */ 278f0ecc46dSJack F Vogel #define E1000_KMRNCTRLSTA_IBIST_DISABLE 0x0200 /* Kumeran IBIST Disable */ 2798cfa0ad2SJack F Vogel #define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */ 2804edd8523SJack F Vogel #define E1000_KMRNCTRLSTA_K1_CONFIG 0x7 2816ab6bfe3SJack F Vogel #define E1000_KMRNCTRLSTA_K1_ENABLE 0x0002 /* enable K1 */ 2827d9119bdSJack F Vogel #define E1000_KMRNCTRLSTA_HD_CTRL 0x10 /* Kumeran HD Control */ 283*d5ad2f2aSWenzhuo Lu #define E1000_KMRNCTRLSTA_K0S_CTRL 0x1E /* Kumeran K0s Control */ 284*d5ad2f2aSWenzhuo Lu #define E1000_KMRNCTRLSTA_K0S_CTRL_ENTRY_LTNCY_SHIFT 0 285*d5ad2f2aSWenzhuo Lu #define E1000_KMRNCTRLSTA_K0S_CTRL_MIN_TIME_SHIFT 4 286*d5ad2f2aSWenzhuo Lu #define E1000_KMRNCTRLSTA_K0S_CTRL_ENTRY_LTNCY_MASK \ 287*d5ad2f2aSWenzhuo Lu (3 << E1000_KMRNCTRLSTA_K0S_CTRL_ENTRY_LTNCY_SHIFT) 288*d5ad2f2aSWenzhuo Lu #define E1000_KMRNCTRLSTA_K0S_CTRL_MIN_TIME_MASK \ 289*d5ad2f2aSWenzhuo Lu (7 << E1000_KMRNCTRLSTA_K0S_CTRL_MIN_TIME_SHIFT) 2908cfa0ad2SJack F Vogel 2918cfa0ad2SJack F Vogel #define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10 2927609433eSJack F Vogel #define IFE_PHY_SPECIAL_CONTROL 0x11 /* 100BaseTx PHY Special Ctrl */ 2937609433eSJack F Vogel #define IFE_PHY_SPECIAL_CONTROL_LED 0x1B /* PHY Special and LED Ctrl */ 2948cfa0ad2SJack F Vogel #define IFE_PHY_MDIX_CONTROL 0x1C /* MDI/MDI-X Control */ 2958cfa0ad2SJack F Vogel 2968cfa0ad2SJack F Vogel /* IFE PHY Extended Status Control */ 2978cfa0ad2SJack F Vogel #define IFE_PESC_POLARITY_REVERSED 0x0100 2988cfa0ad2SJack F Vogel 2998cfa0ad2SJack F Vogel /* IFE PHY Special Control */ 3008cfa0ad2SJack F Vogel #define IFE_PSC_AUTO_POLARITY_DISABLE 0x0010 3018cfa0ad2SJack F Vogel #define IFE_PSC_FORCE_POLARITY 0x0020 3028cfa0ad2SJack F Vogel 3038cfa0ad2SJack F Vogel /* IFE PHY Special Control and LED Control */ 3048cfa0ad2SJack F Vogel #define IFE_PSCL_PROBE_MODE 0x0020 3058cfa0ad2SJack F Vogel #define IFE_PSCL_PROBE_LEDS_OFF 0x0006 /* Force LEDs 0 and 2 off */ 3068cfa0ad2SJack F Vogel #define IFE_PSCL_PROBE_LEDS_ON 0x0007 /* Force LEDs 0 and 2 on */ 3078cfa0ad2SJack F Vogel 3088cfa0ad2SJack F Vogel /* IFE PHY MDIX Control */ 3098cfa0ad2SJack F Vogel #define IFE_PMC_MDIX_STATUS 0x0020 /* 1=MDI-X, 0=MDI */ 3108cfa0ad2SJack F Vogel #define IFE_PMC_FORCE_MDIX 0x0040 /* 1=force MDI-X, 0=force MDI */ 3114dab5c37SJack F Vogel #define IFE_PMC_AUTO_MDIX 0x0080 /* 1=enable auto, 0=disable */ 3124dab5c37SJack F Vogel 3134dab5c37SJack F Vogel /* SFP modules ID memory locations */ 3144dab5c37SJack F Vogel #define E1000_SFF_IDENTIFIER_OFFSET 0x00 3154dab5c37SJack F Vogel #define E1000_SFF_IDENTIFIER_SFF 0x02 3164dab5c37SJack F Vogel #define E1000_SFF_IDENTIFIER_SFP 0x03 3174dab5c37SJack F Vogel 3184dab5c37SJack F Vogel #define E1000_SFF_ETH_FLAGS_OFFSET 0x06 3194dab5c37SJack F Vogel /* Flags for SFP modules compatible with ETH up to 1Gb */ 3204dab5c37SJack F Vogel struct sfp_e1000_flags { 3214dab5c37SJack F Vogel u8 e1000_base_sx:1; 3224dab5c37SJack F Vogel u8 e1000_base_lx:1; 3234dab5c37SJack F Vogel u8 e1000_base_cx:1; 3244dab5c37SJack F Vogel u8 e1000_base_t:1; 3254dab5c37SJack F Vogel u8 e100_base_lx:1; 3264dab5c37SJack F Vogel u8 e100_base_fx:1; 3274dab5c37SJack F Vogel u8 e10_base_bx10:1; 3284dab5c37SJack F Vogel u8 e10_base_px:1; 3294dab5c37SJack F Vogel }; 3304dab5c37SJack F Vogel 3314dab5c37SJack F Vogel /* Vendor OUIs: format of OUI is 0x[byte0][byte1][byte2][00] */ 3324dab5c37SJack F Vogel #define E1000_SFF_VENDOR_OUI_TYCO 0x00407600 3334dab5c37SJack F Vogel #define E1000_SFF_VENDOR_OUI_FTL 0x00906500 3344dab5c37SJack F Vogel #define E1000_SFF_VENDOR_OUI_AVAGO 0x00176A00 3354dab5c37SJack F Vogel #define E1000_SFF_VENDOR_OUI_INTEL 0x001B2100 3368cfa0ad2SJack F Vogel 3378cfa0ad2SJack F Vogel #endif 338