Commit 00643631 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'clean-up-sfp-register-definitions'

Russell King says:

====================
Clean up SFP register definitions

This two-part patch series cleans up the SFP register definitions by
1. converting them from hex to decimal, as all the definitions in the
   documents use decimal, this makes it easier to cross-reference.
2. moving the bit definitions for each register along side their
   register address definition
====================

Link: https://lore.kernel.org/r/Y1qFvaDlLVM1fHdG@shell.armlinux.org.ukSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents e3855920 d83845d2
......@@ -332,39 +332,33 @@ enum {
/* SFP EEPROM registers */
enum {
SFP_PHYS_ID = 0x00,
SFP_PHYS_EXT_ID = 0x01,
SFP_CONNECTOR = 0x02,
SFP_COMPLIANCE = 0x03,
SFP_ENCODING = 0x0b,
SFP_BR_NOMINAL = 0x0c,
SFP_RATE_ID = 0x0d,
SFP_LINK_LEN_SM_KM = 0x0e,
SFP_LINK_LEN_SM_100M = 0x0f,
SFP_LINK_LEN_50UM_OM2_10M = 0x10,
SFP_LINK_LEN_62_5UM_OM1_10M = 0x11,
SFP_LINK_LEN_COPPER_1M = 0x12,
SFP_LINK_LEN_50UM_OM4_10M = 0x12,
SFP_LINK_LEN_50UM_OM3_10M = 0x13,
SFP_VENDOR_NAME = 0x14,
SFP_VENDOR_OUI = 0x25,
SFP_VENDOR_PN = 0x28,
SFP_VENDOR_REV = 0x38,
SFP_OPTICAL_WAVELENGTH_MSB = 0x3c,
SFP_OPTICAL_WAVELENGTH_LSB = 0x3d,
SFP_CABLE_SPEC = 0x3c,
SFP_CC_BASE = 0x3f,
SFP_OPTIONS = 0x40, /* 2 bytes, MSB, LSB */
SFP_BR_MAX = 0x42,
SFP_BR_MIN = 0x43,
SFP_VENDOR_SN = 0x44,
SFP_DATECODE = 0x54,
SFP_DIAGMON = 0x5c,
SFP_ENHOPTS = 0x5d,
SFP_SFF8472_COMPLIANCE = 0x5e,
SFP_CC_EXT = 0x5f,
SFP_PHYS_ID = 0,
SFP_PHYS_EXT_ID = 1,
SFP_PHYS_EXT_ID_SFP = 0x04,
SFP_CONNECTOR = 2,
SFP_COMPLIANCE = 3,
SFP_ENCODING = 11,
SFP_BR_NOMINAL = 12,
SFP_RATE_ID = 13,
SFP_LINK_LEN_SM_KM = 14,
SFP_LINK_LEN_SM_100M = 15,
SFP_LINK_LEN_50UM_OM2_10M = 16,
SFP_LINK_LEN_62_5UM_OM1_10M = 17,
SFP_LINK_LEN_COPPER_1M = 18,
SFP_LINK_LEN_50UM_OM4_10M = 18,
SFP_LINK_LEN_50UM_OM3_10M = 19,
SFP_VENDOR_NAME = 20,
SFP_VENDOR_OUI = 37,
SFP_VENDOR_PN = 40,
SFP_VENDOR_REV = 56,
SFP_OPTICAL_WAVELENGTH_MSB = 60,
SFP_OPTICAL_WAVELENGTH_LSB = 61,
SFP_CABLE_SPEC = 60,
SFP_CC_BASE = 63,
SFP_OPTIONS = 64, /* 2 bytes, MSB, LSB */
SFP_OPTIONS_HIGH_POWER_LEVEL = BIT(13),
SFP_OPTIONS_PAGING_A2 = BIT(12),
SFP_OPTIONS_RETIMER = BIT(11),
......@@ -378,11 +372,20 @@ enum {
SFP_OPTIONS_TX_FAULT = BIT(3),
SFP_OPTIONS_LOS_INVERTED = BIT(2),
SFP_OPTIONS_LOS_NORMAL = BIT(1),
SFP_BR_MAX = 66,
SFP_BR_MIN = 67,
SFP_VENDOR_SN = 68,
SFP_DATECODE = 84,
SFP_DIAGMON = 92,
SFP_DIAGMON_DDM = BIT(6),
SFP_DIAGMON_INT_CAL = BIT(5),
SFP_DIAGMON_EXT_CAL = BIT(4),
SFP_DIAGMON_RXPWR_AVG = BIT(3),
SFP_DIAGMON_ADDRMODE = BIT(2),
SFP_ENHOPTS = 93,
SFP_ENHOPTS_ALARMWARN = BIT(7),
SFP_ENHOPTS_SOFT_TX_DISABLE = BIT(6),
SFP_ENHOPTS_SOFT_TX_FAULT = BIT(5),
......@@ -390,6 +393,8 @@ enum {
SFP_ENHOPTS_SOFT_RATE_SELECT = BIT(3),
SFP_ENHOPTS_APP_SELECT_SFF8079 = BIT(2),
SFP_ENHOPTS_SOFT_RATE_SFF8431 = BIT(1),
SFP_SFF8472_COMPLIANCE = 94,
SFP_SFF8472_COMPLIANCE_NONE = 0x00,
SFP_SFF8472_COMPLIANCE_REV9_3 = 0x01,
SFP_SFF8472_COMPLIANCE_REV9_5 = 0x02,
......@@ -399,68 +404,70 @@ enum {
SFP_SFF8472_COMPLIANCE_REV11_3 = 0x06,
SFP_SFF8472_COMPLIANCE_REV11_4 = 0x07,
SFP_SFF8472_COMPLIANCE_REV12_0 = 0x08,
SFP_CC_EXT = 95,
};
/* SFP Diagnostics */
enum {
/* Alarm and warnings stored MSB at lower address then LSB */
SFP_TEMP_HIGH_ALARM = 0x00,
SFP_TEMP_LOW_ALARM = 0x02,
SFP_TEMP_HIGH_WARN = 0x04,
SFP_TEMP_LOW_WARN = 0x06,
SFP_VOLT_HIGH_ALARM = 0x08,
SFP_VOLT_LOW_ALARM = 0x0a,
SFP_VOLT_HIGH_WARN = 0x0c,
SFP_VOLT_LOW_WARN = 0x0e,
SFP_BIAS_HIGH_ALARM = 0x10,
SFP_BIAS_LOW_ALARM = 0x12,
SFP_BIAS_HIGH_WARN = 0x14,
SFP_BIAS_LOW_WARN = 0x16,
SFP_TXPWR_HIGH_ALARM = 0x18,
SFP_TXPWR_LOW_ALARM = 0x1a,
SFP_TXPWR_HIGH_WARN = 0x1c,
SFP_TXPWR_LOW_WARN = 0x1e,
SFP_RXPWR_HIGH_ALARM = 0x20,
SFP_RXPWR_LOW_ALARM = 0x22,
SFP_RXPWR_HIGH_WARN = 0x24,
SFP_RXPWR_LOW_WARN = 0x26,
SFP_LASER_TEMP_HIGH_ALARM = 0x28,
SFP_LASER_TEMP_LOW_ALARM = 0x2a,
SFP_LASER_TEMP_HIGH_WARN = 0x2c,
SFP_LASER_TEMP_LOW_WARN = 0x2e,
SFP_TEC_CUR_HIGH_ALARM = 0x30,
SFP_TEC_CUR_LOW_ALARM = 0x32,
SFP_TEC_CUR_HIGH_WARN = 0x34,
SFP_TEC_CUR_LOW_WARN = 0x36,
SFP_CAL_RXPWR4 = 0x38,
SFP_CAL_RXPWR3 = 0x3c,
SFP_CAL_RXPWR2 = 0x40,
SFP_CAL_RXPWR1 = 0x44,
SFP_CAL_RXPWR0 = 0x48,
SFP_CAL_TXI_SLOPE = 0x4c,
SFP_CAL_TXI_OFFSET = 0x4e,
SFP_CAL_TXPWR_SLOPE = 0x50,
SFP_CAL_TXPWR_OFFSET = 0x52,
SFP_CAL_T_SLOPE = 0x54,
SFP_CAL_T_OFFSET = 0x56,
SFP_CAL_V_SLOPE = 0x58,
SFP_CAL_V_OFFSET = 0x5a,
SFP_CHKSUM = 0x5f,
SFP_TEMP = 0x60,
SFP_VCC = 0x62,
SFP_TX_BIAS = 0x64,
SFP_TX_POWER = 0x66,
SFP_RX_POWER = 0x68,
SFP_LASER_TEMP = 0x6a,
SFP_TEC_CUR = 0x6c,
SFP_STATUS = 0x6e,
SFP_TEMP_HIGH_ALARM = 0,
SFP_TEMP_LOW_ALARM = 2,
SFP_TEMP_HIGH_WARN = 4,
SFP_TEMP_LOW_WARN = 6,
SFP_VOLT_HIGH_ALARM = 8,
SFP_VOLT_LOW_ALARM = 10,
SFP_VOLT_HIGH_WARN = 12,
SFP_VOLT_LOW_WARN = 14,
SFP_BIAS_HIGH_ALARM = 16,
SFP_BIAS_LOW_ALARM = 18,
SFP_BIAS_HIGH_WARN = 20,
SFP_BIAS_LOW_WARN = 22,
SFP_TXPWR_HIGH_ALARM = 24,
SFP_TXPWR_LOW_ALARM = 26,
SFP_TXPWR_HIGH_WARN = 28,
SFP_TXPWR_LOW_WARN = 30,
SFP_RXPWR_HIGH_ALARM = 32,
SFP_RXPWR_LOW_ALARM = 34,
SFP_RXPWR_HIGH_WARN = 36,
SFP_RXPWR_LOW_WARN = 38,
SFP_LASER_TEMP_HIGH_ALARM = 40,
SFP_LASER_TEMP_LOW_ALARM = 42,
SFP_LASER_TEMP_HIGH_WARN = 44,
SFP_LASER_TEMP_LOW_WARN = 46,
SFP_TEC_CUR_HIGH_ALARM = 48,
SFP_TEC_CUR_LOW_ALARM = 50,
SFP_TEC_CUR_HIGH_WARN = 52,
SFP_TEC_CUR_LOW_WARN = 54,
SFP_CAL_RXPWR4 = 56,
SFP_CAL_RXPWR3 = 60,
SFP_CAL_RXPWR2 = 64,
SFP_CAL_RXPWR1 = 68,
SFP_CAL_RXPWR0 = 72,
SFP_CAL_TXI_SLOPE = 76,
SFP_CAL_TXI_OFFSET = 78,
SFP_CAL_TXPWR_SLOPE = 80,
SFP_CAL_TXPWR_OFFSET = 82,
SFP_CAL_T_SLOPE = 84,
SFP_CAL_T_OFFSET = 86,
SFP_CAL_V_SLOPE = 88,
SFP_CAL_V_OFFSET = 90,
SFP_CHKSUM = 95,
SFP_TEMP = 96,
SFP_VCC = 98,
SFP_TX_BIAS = 100,
SFP_TX_POWER = 102,
SFP_RX_POWER = 104,
SFP_LASER_TEMP = 106,
SFP_TEC_CUR = 108,
SFP_STATUS = 110,
SFP_STATUS_TX_DISABLE = BIT(7),
SFP_STATUS_TX_DISABLE_FORCE = BIT(6),
SFP_STATUS_TX_FAULT = BIT(2),
SFP_STATUS_RX_LOS = BIT(1),
SFP_ALARM0 = 0x70,
SFP_ALARM0 = 112,
SFP_ALARM0_TEMP_HIGH = BIT(7),
SFP_ALARM0_TEMP_LOW = BIT(6),
SFP_ALARM0_VCC_HIGH = BIT(5),
......@@ -470,11 +477,11 @@ enum {
SFP_ALARM0_TXPWR_HIGH = BIT(1),
SFP_ALARM0_TXPWR_LOW = BIT(0),
SFP_ALARM1 = 0x71,
SFP_ALARM1 = 113,
SFP_ALARM1_RXPWR_HIGH = BIT(7),
SFP_ALARM1_RXPWR_LOW = BIT(6),
SFP_WARN0 = 0x74,
SFP_WARN0 = 116,
SFP_WARN0_TEMP_HIGH = BIT(7),
SFP_WARN0_TEMP_LOW = BIT(6),
SFP_WARN0_VCC_HIGH = BIT(5),
......@@ -484,15 +491,15 @@ enum {
SFP_WARN0_TXPWR_HIGH = BIT(1),
SFP_WARN0_TXPWR_LOW = BIT(0),
SFP_WARN1 = 0x75,
SFP_WARN1 = 117,
SFP_WARN1_RXPWR_HIGH = BIT(7),
SFP_WARN1_RXPWR_LOW = BIT(6),
SFP_EXT_STATUS = 0x76,
SFP_EXT_STATUS = 118,
SFP_EXT_STATUS_PWRLVL_SELECT = BIT(0),
SFP_VSL = 0x78,
SFP_PAGE = 0x7f,
SFP_VSL = 120,
SFP_PAGE = 127,
};
struct fwnode_handle;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment