16621Sbt150084 /* 26621Sbt150084 * CDDL HEADER START 36621Sbt150084 * 46621Sbt150084 * The contents of this file are subject to the terms of the 56621Sbt150084 * Common Development and Distribution License (the "License"). 66621Sbt150084 * You may not use this file except in compliance with the License. 76621Sbt150084 * 86621Sbt150084 * You can obtain a copy of the license at: 96621Sbt150084 * http://www.opensolaris.org/os/licensing. 106621Sbt150084 * See the License for the specific language governing permissions 116621Sbt150084 * and limitations under the License. 126621Sbt150084 * 136621Sbt150084 * When using or redistributing this file, you may do so under the 146621Sbt150084 * License only. No other modification of this header is permitted. 156621Sbt150084 * 166621Sbt150084 * If applicable, add the following below this CDDL HEADER, with the 176621Sbt150084 * fields enclosed by brackets "[]" replaced with your own identifying 186621Sbt150084 * information: Portions Copyright [yyyy] [name of copyright owner] 196621Sbt150084 * 206621Sbt150084 * CDDL HEADER END 216621Sbt150084 */ 226621Sbt150084 236621Sbt150084 /* 24*13006SChenlu.Chen@Sun.COM * Copyright(c) 2007-2010 Intel Corporation. All rights reserved. 256621Sbt150084 */ 266621Sbt150084 27*13006SChenlu.Chen@Sun.COM /* 28*13006SChenlu.Chen@Sun.COM * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 29*13006SChenlu.Chen@Sun.COM */ 30*13006SChenlu.Chen@Sun.COM 31*13006SChenlu.Chen@Sun.COM /* IntelVersion: 1.43 scm_061610_003709 */ 326621Sbt150084 336621Sbt150084 #ifndef _IXGBE_PHY_H 346621Sbt150084 #define _IXGBE_PHY_H 356621Sbt150084 368490SPaul.Guo@Sun.COM #include "ixgbe_type.h" 378490SPaul.Guo@Sun.COM 388490SPaul.Guo@Sun.COM #define IXGBE_I2C_EEPROM_DEV_ADDR 0xA0 398490SPaul.Guo@Sun.COM 408490SPaul.Guo@Sun.COM /* EEPROM byte offsets */ 418490SPaul.Guo@Sun.COM #define IXGBE_SFF_IDENTIFIER 0x0 428490SPaul.Guo@Sun.COM #define IXGBE_SFF_IDENTIFIER_SFP 0x3 438490SPaul.Guo@Sun.COM #define IXGBE_SFF_VENDOR_OUI_BYTE0 0x25 448490SPaul.Guo@Sun.COM #define IXGBE_SFF_VENDOR_OUI_BYTE1 0x26 458490SPaul.Guo@Sun.COM #define IXGBE_SFF_VENDOR_OUI_BYTE2 0x27 468490SPaul.Guo@Sun.COM #define IXGBE_SFF_1GBE_COMP_CODES 0x6 478490SPaul.Guo@Sun.COM #define IXGBE_SFF_10GBE_COMP_CODES 0x3 4810305SPaul.Guo@Sun.COM #define IXGBE_SFF_CABLE_TECHNOLOGY 0x8 49*13006SChenlu.Chen@Sun.COM #define IXGBE_SFF_CABLE_SPEC_COMP 0x3C 506621Sbt150084 518490SPaul.Guo@Sun.COM /* Bitmasks */ 5210305SPaul.Guo@Sun.COM #define IXGBE_SFF_DA_PASSIVE_CABLE 0x4 53*13006SChenlu.Chen@Sun.COM #define IXGBE_SFF_DA_ACTIVE_CABLE 0x8 54*13006SChenlu.Chen@Sun.COM #define IXGBE_SFF_DA_SPEC_ACTIVE_LIMITING 0x4 558490SPaul.Guo@Sun.COM #define IXGBE_SFF_1GBASESX_CAPABLE 0x1 569353SSamuel.Tu@Sun.COM #define IXGBE_SFF_1GBASELX_CAPABLE 0x2 57*13006SChenlu.Chen@Sun.COM #define IXGBE_SFF_1GBASET_CAPABLE 0x8 588490SPaul.Guo@Sun.COM #define IXGBE_SFF_10GBASESR_CAPABLE 0x10 598490SPaul.Guo@Sun.COM #define IXGBE_SFF_10GBASELR_CAPABLE 0x20 608490SPaul.Guo@Sun.COM #define IXGBE_I2C_EEPROM_READ_MASK 0x100 618490SPaul.Guo@Sun.COM #define IXGBE_I2C_EEPROM_STATUS_MASK 0x3 628490SPaul.Guo@Sun.COM #define IXGBE_I2C_EEPROM_STATUS_NO_OPERATION 0x0 638490SPaul.Guo@Sun.COM #define IXGBE_I2C_EEPROM_STATUS_PASS 0x1 648490SPaul.Guo@Sun.COM #define IXGBE_I2C_EEPROM_STATUS_FAIL 0x2 658490SPaul.Guo@Sun.COM #define IXGBE_I2C_EEPROM_STATUS_IN_PROGRESS 0x3 668490SPaul.Guo@Sun.COM 67*13006SChenlu.Chen@Sun.COM /* Flow control defines */ 68*13006SChenlu.Chen@Sun.COM #define IXGBE_TAF_SYM_PAUSE 0x400 69*13006SChenlu.Chen@Sun.COM #define IXGBE_TAF_ASM_PAUSE 0x800 70*13006SChenlu.Chen@Sun.COM 718490SPaul.Guo@Sun.COM /* Bit-shift macros */ 729353SSamuel.Tu@Sun.COM #define IXGBE_SFF_VENDOR_OUI_BYTE0_SHIFT 24 739353SSamuel.Tu@Sun.COM #define IXGBE_SFF_VENDOR_OUI_BYTE1_SHIFT 16 749353SSamuel.Tu@Sun.COM #define IXGBE_SFF_VENDOR_OUI_BYTE2_SHIFT 8 758490SPaul.Guo@Sun.COM 768490SPaul.Guo@Sun.COM /* Vendor OUIs: format of OUI is 0x[byte0][byte1][byte2][00] */ 778490SPaul.Guo@Sun.COM #define IXGBE_SFF_VENDOR_OUI_TYCO 0x00407600 788490SPaul.Guo@Sun.COM #define IXGBE_SFF_VENDOR_OUI_FTL 0x00906500 798490SPaul.Guo@Sun.COM #define IXGBE_SFF_VENDOR_OUI_AVAGO 0x00176A00 809353SSamuel.Tu@Sun.COM #define IXGBE_SFF_VENDOR_OUI_INTEL 0x001B2100 818490SPaul.Guo@Sun.COM 829353SSamuel.Tu@Sun.COM /* I2C SDA and SCL timing parameters for standard mode */ 839353SSamuel.Tu@Sun.COM #define IXGBE_I2C_T_HD_STA 4 849353SSamuel.Tu@Sun.COM #define IXGBE_I2C_T_LOW 5 859353SSamuel.Tu@Sun.COM #define IXGBE_I2C_T_HIGH 4 869353SSamuel.Tu@Sun.COM #define IXGBE_I2C_T_SU_STA 5 879353SSamuel.Tu@Sun.COM #define IXGBE_I2C_T_HD_DATA 5 889353SSamuel.Tu@Sun.COM #define IXGBE_I2C_T_SU_DATA 1 899353SSamuel.Tu@Sun.COM #define IXGBE_I2C_T_RISE 1 909353SSamuel.Tu@Sun.COM #define IXGBE_I2C_T_FALL 1 919353SSamuel.Tu@Sun.COM #define IXGBE_I2C_T_SU_STO 4 929353SSamuel.Tu@Sun.COM #define IXGBE_I2C_T_BUF 5 936621Sbt150084 94*13006SChenlu.Chen@Sun.COM #define IXGBE_TN_LASI_STATUS_REG 0x9005 95*13006SChenlu.Chen@Sun.COM #define IXGBE_TN_LASI_STATUS_TEMP_ALARM 0x0008 96*13006SChenlu.Chen@Sun.COM 976621Sbt150084 s32 ixgbe_init_phy_ops_generic(struct ixgbe_hw *hw); 986621Sbt150084 bool ixgbe_validate_phy_addr(struct ixgbe_hw *hw, u32 phy_addr); 996621Sbt150084 enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id); 1006621Sbt150084 s32 ixgbe_get_phy_id(struct ixgbe_hw *hw); 1016621Sbt150084 s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw); 1026621Sbt150084 s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw); 1036621Sbt150084 s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr, 1046621Sbt150084 u32 device_type, u16 *phy_data); 1056621Sbt150084 s32 ixgbe_write_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr, 1066621Sbt150084 u32 device_type, u16 phy_data); 1076621Sbt150084 s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw); 1086621Sbt150084 s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw, 1098490SPaul.Guo@Sun.COM ixgbe_link_speed speed, bool autoneg, bool autoneg_wait_to_complete); 1109353SSamuel.Tu@Sun.COM s32 ixgbe_get_copper_link_capabilities_generic(struct ixgbe_hw *hw, 1119353SSamuel.Tu@Sun.COM ixgbe_link_speed *speed, bool *autoneg); 1128490SPaul.Guo@Sun.COM 1138490SPaul.Guo@Sun.COM /* PHY specific */ 1148490SPaul.Guo@Sun.COM s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw, 1158490SPaul.Guo@Sun.COM ixgbe_link_speed *speed, bool *link_up); 11610998SChenlu.Chen@Sun.COM s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw); 1178490SPaul.Guo@Sun.COM s32 ixgbe_get_phy_firmware_version_tnx(struct ixgbe_hw *hw, 1188490SPaul.Guo@Sun.COM u16 *firmware_version); 11910998SChenlu.Chen@Sun.COM s32 ixgbe_get_phy_firmware_version_generic(struct ixgbe_hw *hw, 12010305SPaul.Guo@Sun.COM u16 *firmware_version); 1218490SPaul.Guo@Sun.COM 1228490SPaul.Guo@Sun.COM s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw); 1238490SPaul.Guo@Sun.COM s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw); 1248490SPaul.Guo@Sun.COM s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, 1258490SPaul.Guo@Sun.COM u16 *list_offset, u16 *data_offset); 126*13006SChenlu.Chen@Sun.COM s32 ixgbe_tn_check_overtemp(struct ixgbe_hw *hw); 1279353SSamuel.Tu@Sun.COM s32 ixgbe_read_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset, 1289353SSamuel.Tu@Sun.COM u8 dev_addr, u8 *data); 1299353SSamuel.Tu@Sun.COM s32 ixgbe_write_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset, 1309353SSamuel.Tu@Sun.COM u8 dev_addr, u8 data); 1319353SSamuel.Tu@Sun.COM s32 ixgbe_read_i2c_eeprom_generic(struct ixgbe_hw *hw, u8 byte_offset, 1329353SSamuel.Tu@Sun.COM u8 *eeprom_data); 1339353SSamuel.Tu@Sun.COM s32 ixgbe_write_i2c_eeprom_generic(struct ixgbe_hw *hw, u8 byte_offset, 1349353SSamuel.Tu@Sun.COM u8 eeprom_data); 1356621Sbt150084 1366621Sbt150084 #endif /* _IXGBE_PHY_H */ 137