xref: /onnv-gate/usr/src/uts/common/io/ixgbe/ixgbe_phy.h (revision 10998:fa3b21f3b03c)
16621Sbt150084 /*
26621Sbt150084  * CDDL HEADER START
36621Sbt150084  *
49353SSamuel.Tu@Sun.COM  * Copyright(c) 2007-2009 Intel Corporation. All rights reserved.
56621Sbt150084  * The contents of this file are subject to the terms of the
66621Sbt150084  * Common Development and Distribution License (the "License").
76621Sbt150084  * You may not use this file except in compliance with the License.
86621Sbt150084  *
96621Sbt150084  * You can obtain a copy of the license at:
106621Sbt150084  *      http://www.opensolaris.org/os/licensing.
116621Sbt150084  * See the License for the specific language governing permissions
126621Sbt150084  * and limitations under the License.
136621Sbt150084  *
146621Sbt150084  * When using or redistributing this file, you may do so under the
156621Sbt150084  * License only. No other modification of this header is permitted.
166621Sbt150084  *
176621Sbt150084  * If applicable, add the following below this CDDL HEADER, with the
186621Sbt150084  * fields enclosed by brackets "[]" replaced with your own identifying
196621Sbt150084  * information: Portions Copyright [yyyy] [name of copyright owner]
206621Sbt150084  *
216621Sbt150084  * CDDL HEADER END
226621Sbt150084  */
236621Sbt150084 
246621Sbt150084 /*
258490SPaul.Guo@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
269353SSamuel.Tu@Sun.COM  * Use is subject to license terms.
276621Sbt150084  */
286621Sbt150084 
29*10998SChenlu.Chen@Sun.COM /* IntelVersion: 1.36 scm_100309_002210 */
306621Sbt150084 
316621Sbt150084 #ifndef _IXGBE_PHY_H
326621Sbt150084 #define	_IXGBE_PHY_H
336621Sbt150084 
348490SPaul.Guo@Sun.COM #include "ixgbe_type.h"
358490SPaul.Guo@Sun.COM 
368490SPaul.Guo@Sun.COM #define	IXGBE_I2C_EEPROM_DEV_ADDR	0xA0
378490SPaul.Guo@Sun.COM 
388490SPaul.Guo@Sun.COM /* EEPROM byte offsets */
398490SPaul.Guo@Sun.COM #define	IXGBE_SFF_IDENTIFIER		0x0
408490SPaul.Guo@Sun.COM #define	IXGBE_SFF_IDENTIFIER_SFP	0x3
418490SPaul.Guo@Sun.COM #define	IXGBE_SFF_VENDOR_OUI_BYTE0	0x25
428490SPaul.Guo@Sun.COM #define	IXGBE_SFF_VENDOR_OUI_BYTE1	0x26
438490SPaul.Guo@Sun.COM #define	IXGBE_SFF_VENDOR_OUI_BYTE2	0x27
448490SPaul.Guo@Sun.COM #define	IXGBE_SFF_1GBE_COMP_CODES	0x6
458490SPaul.Guo@Sun.COM #define	IXGBE_SFF_10GBE_COMP_CODES	0x3
4610305SPaul.Guo@Sun.COM #define	IXGBE_SFF_CABLE_TECHNOLOGY	0x8
476621Sbt150084 
488490SPaul.Guo@Sun.COM /* Bitmasks */
4910305SPaul.Guo@Sun.COM #define	IXGBE_SFF_DA_PASSIVE_CABLE	0x4
508490SPaul.Guo@Sun.COM #define	IXGBE_SFF_1GBASESX_CAPABLE	0x1
519353SSamuel.Tu@Sun.COM #define	IXGBE_SFF_1GBASELX_CAPABLE	0x2
528490SPaul.Guo@Sun.COM #define	IXGBE_SFF_10GBASESR_CAPABLE	0x10
538490SPaul.Guo@Sun.COM #define	IXGBE_SFF_10GBASELR_CAPABLE	0x20
548490SPaul.Guo@Sun.COM #define	IXGBE_I2C_EEPROM_READ_MASK	0x100
558490SPaul.Guo@Sun.COM #define	IXGBE_I2C_EEPROM_STATUS_MASK	0x3
568490SPaul.Guo@Sun.COM #define	IXGBE_I2C_EEPROM_STATUS_NO_OPERATION	0x0
578490SPaul.Guo@Sun.COM #define	IXGBE_I2C_EEPROM_STATUS_PASS	0x1
588490SPaul.Guo@Sun.COM #define	IXGBE_I2C_EEPROM_STATUS_FAIL	0x2
598490SPaul.Guo@Sun.COM #define	IXGBE_I2C_EEPROM_STATUS_IN_PROGRESS	0x3
608490SPaul.Guo@Sun.COM 
618490SPaul.Guo@Sun.COM /* Bit-shift macros */
629353SSamuel.Tu@Sun.COM #define	IXGBE_SFF_VENDOR_OUI_BYTE0_SHIFT	24
639353SSamuel.Tu@Sun.COM #define	IXGBE_SFF_VENDOR_OUI_BYTE1_SHIFT	16
649353SSamuel.Tu@Sun.COM #define	IXGBE_SFF_VENDOR_OUI_BYTE2_SHIFT	8
658490SPaul.Guo@Sun.COM 
668490SPaul.Guo@Sun.COM /* Vendor OUIs: format of OUI is 0x[byte0][byte1][byte2][00] */
678490SPaul.Guo@Sun.COM #define	IXGBE_SFF_VENDOR_OUI_TYCO	0x00407600
688490SPaul.Guo@Sun.COM #define	IXGBE_SFF_VENDOR_OUI_FTL	0x00906500
698490SPaul.Guo@Sun.COM #define	IXGBE_SFF_VENDOR_OUI_AVAGO	0x00176A00
709353SSamuel.Tu@Sun.COM #define	IXGBE_SFF_VENDOR_OUI_INTEL	0x001B2100
718490SPaul.Guo@Sun.COM 
729353SSamuel.Tu@Sun.COM /* I2C SDA and SCL timing parameters for standard mode */
739353SSamuel.Tu@Sun.COM #define	IXGBE_I2C_T_HD_STA	4
749353SSamuel.Tu@Sun.COM #define	IXGBE_I2C_T_LOW		5
759353SSamuel.Tu@Sun.COM #define	IXGBE_I2C_T_HIGH	4
769353SSamuel.Tu@Sun.COM #define	IXGBE_I2C_T_SU_STA	5
779353SSamuel.Tu@Sun.COM #define	IXGBE_I2C_T_HD_DATA	5
789353SSamuel.Tu@Sun.COM #define	IXGBE_I2C_T_SU_DATA	1
799353SSamuel.Tu@Sun.COM #define	IXGBE_I2C_T_RISE	1
809353SSamuel.Tu@Sun.COM #define	IXGBE_I2C_T_FALL	1
819353SSamuel.Tu@Sun.COM #define	IXGBE_I2C_T_SU_STO	4
829353SSamuel.Tu@Sun.COM #define	IXGBE_I2C_T_BUF		5
836621Sbt150084 
846621Sbt150084 s32 ixgbe_init_phy_ops_generic(struct ixgbe_hw *hw);
856621Sbt150084 bool ixgbe_validate_phy_addr(struct ixgbe_hw *hw, u32 phy_addr);
866621Sbt150084 enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id);
876621Sbt150084 s32 ixgbe_get_phy_id(struct ixgbe_hw *hw);
886621Sbt150084 s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw);
896621Sbt150084 s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw);
906621Sbt150084 s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
916621Sbt150084     u32 device_type, u16 *phy_data);
926621Sbt150084 s32 ixgbe_write_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
936621Sbt150084     u32 device_type, u16 phy_data);
946621Sbt150084 s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw);
956621Sbt150084 s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw,
968490SPaul.Guo@Sun.COM     ixgbe_link_speed speed, bool autoneg, bool autoneg_wait_to_complete);
979353SSamuel.Tu@Sun.COM s32 ixgbe_get_copper_link_capabilities_generic(struct ixgbe_hw *hw,
989353SSamuel.Tu@Sun.COM     ixgbe_link_speed *speed, bool *autoneg);
998490SPaul.Guo@Sun.COM 
1008490SPaul.Guo@Sun.COM /* PHY specific */
1018490SPaul.Guo@Sun.COM s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw,
1028490SPaul.Guo@Sun.COM     ixgbe_link_speed *speed, bool *link_up);
103*10998SChenlu.Chen@Sun.COM s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw);
1048490SPaul.Guo@Sun.COM s32 ixgbe_get_phy_firmware_version_tnx(struct ixgbe_hw *hw,
1058490SPaul.Guo@Sun.COM     u16 *firmware_version);
106*10998SChenlu.Chen@Sun.COM s32 ixgbe_get_phy_firmware_version_generic(struct ixgbe_hw *hw,
10710305SPaul.Guo@Sun.COM     u16 *firmware_version);
1088490SPaul.Guo@Sun.COM 
1098490SPaul.Guo@Sun.COM s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw);
1108490SPaul.Guo@Sun.COM s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw);
1118490SPaul.Guo@Sun.COM s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
1128490SPaul.Guo@Sun.COM     u16 *list_offset, u16 *data_offset);
1139353SSamuel.Tu@Sun.COM s32 ixgbe_read_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset,
1149353SSamuel.Tu@Sun.COM     u8 dev_addr, u8 *data);
1159353SSamuel.Tu@Sun.COM s32 ixgbe_write_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset,
1169353SSamuel.Tu@Sun.COM     u8 dev_addr, u8 data);
1179353SSamuel.Tu@Sun.COM s32 ixgbe_read_i2c_eeprom_generic(struct ixgbe_hw *hw, u8 byte_offset,
1189353SSamuel.Tu@Sun.COM     u8 *eeprom_data);
1199353SSamuel.Tu@Sun.COM s32 ixgbe_write_i2c_eeprom_generic(struct ixgbe_hw *hw, u8 byte_offset,
1209353SSamuel.Tu@Sun.COM     u8 eeprom_data);
1216621Sbt150084 
1226621Sbt150084 #endif /* _IXGBE_PHY_H */
123