1. 10 12月, 2019 1 次提交
  2. 05 12月, 2019 2 次提交
  3. 21 11月, 2019 1 次提交
  4. 14 11月, 2019 1 次提交
  5. 12 11月, 2019 17 次提交
  6. 25 8月, 2019 1 次提交
  7. 22 7月, 2019 1 次提交
    • A
      net: phy: sfp: hwmon: Fix scaling of RX power · 0cea0e11
      Andrew Lunn 提交于
      The RX power read from the SFP uses units of 0.1uW. This must be
      scaled to units of uW for HWMON. This requires a divide by 10, not the
      current 100.
      
      With this change in place, sensors(1) and ethtool -m agree:
      
      sff2-isa-0000
      Adapter: ISA adapter
      in0:          +3.23 V
      temp1:        +33.1 C
      power1:      270.00 uW
      power2:      200.00 uW
      curr1:        +0.01 A
      
              Laser output power                        : 0.2743 mW / -5.62 dBm
              Receiver signal average optical power     : 0.2014 mW / -6.96 dBm
      
      Reported-by: chris.healy@zii.aero
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Fixes: 1323061a ("net: phy: sfp: Add HWMON support for module sensors")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0cea0e11
  8. 15 6月, 2019 1 次提交
  9. 10 6月, 2019 2 次提交
  10. 04 6月, 2019 1 次提交
    • R
      net: sfp: read eeprom in maximum 16 byte increments · 28e74a7c
      Russell King 提交于
      Some SFP modules do not like reads longer than 16 bytes, so read the
      EEPROM in chunks of 16 bytes at a time.  This behaviour is not specified
      in the SFP MSAs, which specifies:
      
       "The serial interface uses the 2-wire serial CMOS E2PROM protocol
        defined for the ATMEL AT24C01A/02/04 family of components."
      
      and
      
       "As long as the SFP+ receives an acknowledge, it shall serially clock
        out sequential data words. The sequence is terminated when the host
        responds with a NACK and a STOP instead of an acknowledge."
      
      We must avoid breaking a read across a 16-bit quantity in the diagnostic
      page, thankfully all 16-bit quantities in that page are naturally
      aligned.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28e74a7c
  11. 31 5月, 2019 1 次提交
    • R
      net: phy: sfp: enable i2c-bus detection on ACPI based systems · 7ce236fa
      Ruslan Babayev 提交于
      Lookup I2C adapter using the "i2c-bus" device property on ACPI based
      systems similar to how it's done with DT.
      
      An example DSD describing an SFP on an ACPI based system:
      
      Device (SFP0)
      {
          Name (_HID, "PRP0001")
          Name (_CRS, ResourceTemplate()
          {
              GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionNone,
                     "\\_SB.PCI0.RP01.GPIO", 0, ResourceConsumer)
                  { 0, 1, 2, 3, 4 }
          })
          Name (_DSD, Package ()
          {
              ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
              Package () {
                  Package () { "compatible", "sff,sfp" },
                  Package () { "i2c-bus", \_SB.PCI0.RP01.I2C.MUX.CH0 },
                  Package () { "maximum-power-milliwatt", 1000 },
                  Package () { "tx-disable-gpios", Package () { ^SFP0, 0, 0, 1} },
                  Package () { "reset-gpio",       Package () { ^SFP0, 0, 1, 1} },
                  Package () { "mod-def0-gpios",   Package () { ^SFP0, 0, 2, 1} },
                  Package () { "tx-fault-gpios",   Package () { ^SFP0, 0, 3, 0} },
                  Package () { "los-gpios",        Package () { ^SFP0, 0, 4, 1} },
              },
          })
      }
      
      Device (PHY0)
      {
          Name (_HID, "PRP0001")
          Name (_DSD, Package ()
          {
              ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
              Package () {
                  Package () { "compatible", "ethernet-phy-ieee802.3-c45" },
                  Package () { "sfp", \_SB.PCI0.RP01.SFP0 },
                  Package () { "managed", "in-band-status" },
                  Package () { "phy-mode", "sgmii" },
              },
          })
      }
      Signed-off-by: NRuslan Babayev <ruslan@babayev.com>
      Cc: xe-linux-external@cisco.com
      Acked-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ce236fa
  12. 09 2月, 2019 1 次提交
  13. 23 1月, 2019 1 次提交
  14. 12 10月, 2018 1 次提交
  15. 27 9月, 2018 1 次提交
  16. 05 9月, 2018 1 次提交
  17. 10 8月, 2018 1 次提交
  18. 18 7月, 2018 1 次提交
    • A
      net: phy: sfp: Add HWMON support for module sensors · 1323061a
      Andrew Lunn 提交于
      SFP modules can contain a number of sensors. The EEPROM also contains
      recommended alarm and critical values for each sensor, and indications
      of if these have been exceeded. Export this information via
      HWMON. Currently temperature, VCC, bias current, transmit power, and
      possibly receiver power is supported.
      
      The sensors in the modules can either return calibrate or uncalibrated
      values. Uncalibrated values need to be manipulated, using coefficients
      provided in the SFP EEPROM. Uncalibrated receive power values require
      floating point maths in order to calibrate them. Performing this in
      the kernel is hard. So if the SFP module indicates it uses
      uncalibrated values, RX power is not made available.
      
      With this hwmon device, it is possible to view the sensor values using
      lm-sensors programs:
      
      in0:          +3.29 V  (crit min =  +2.90 V, min =  +3.00 V)
                             (max =  +3.60 V, crit max =  +3.70 V)
      temp1:        +33.0°C  (low  =  -5.0°C, high = +80.0°C)
                             (crit low = -10.0°C, crit = +85.0°C)
      power1:      1000.00 nW (max = 794.00 uW, min =  50.00 uW)  ALARM (LCRIT)
                             (lcrit =  40.00 uW, crit = 1000.00 uW)
      curr1:        +0.00 A  (crit min =  +0.00 A, min =  +0.00 A)  ALARM (LCRIT, MIN)
                             (max =  +0.01 A, crit max =  +0.01 A)
      
      The scaling sensors performs on the bias current is not particularly
      good. The raw values are more useful:
      
      curr1:
        curr1_input: 0.000
        curr1_min: 0.002
        curr1_max: 0.010
        curr1_lcrit: 0.000
        curr1_crit: 0.011
        curr1_min_alarm: 1.000
        curr1_max_alarm: 0.000
        curr1_lcrit_alarm: 1.000
        curr1_crit_alarm: 0.000
      
      In order to keep the I2C overhead to a minimum, the constant values,
      such as limits and calibration coefficients are read once at module
      insertion time. Thus only reading *_input and *_alarm properties
      requires i2c read operations.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Acked-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1323061a
  19. 24 5月, 2018 2 次提交
  20. 30 3月, 2018 1 次提交
    • R
      sfp: allow cotsworks modules · 981f1f80
      Russell King 提交于
      Cotsworks modules fail the checksums - it appears that Cotsworks
      reprograms the EEPROM at the end of production with the final product
      information (serial, date code, and exact part number for module
      options) and fails to update the checksum.
      
      Work around this by detecting the Cotsworks name in the manufacturer
      field, and reducing the checksum failures to warnings rather than a
      hard error.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      981f1f80
  21. 01 3月, 2018 1 次提交
    • J
      sfp: add high power module support · 3bb35261
      Jon Nettleton 提交于
      This patch is the result of work by both Jon Nettleton and Russell King.
      Jon wrote the original patch, adding support for SFP modules which
      require a power level greater than '1'.
      
      Russell's changes:
      - Fix the power levels for big-endian, and make the code flow better.
      - Convert to use device_property_read_u8()
      - Warn for power levels exceeding host level
        SFF-8431 says:
      
        "To avoid exceeding system power supply limits and cooling capacity,
         all modules at power up by default shall operate with up to 1.0 W.
         Hosts supporting Power Level II or III operation may enable a Power
         Level II or III module through the 2-wire interface. Power Level II
         or III modules shall assert the power level declaration bit of
         SFF-8472."
      
        Print a warning for modules that exceed the host power level, and
        leave them operating in power level 1.
      
      - Fix i2c write
        The first byte of any write after the bus address is always the
        device address.  In order to write a value to device D, address I,
        value V, we need to generate on the bus:
      
          S DDDDDDDD A IIIIIIII A VVVVVVVV A P
      
        where S = start, R = restart, A = ack, P = stop.  Splitting this
        as two:
      
          S DDDDDDDD A IIIIIIII A R DDDDDDDD A VVVVVVVV A P
      
        results in the device's address register being written first by I
        and then by V - the addressed register within the device is not
        written.
      
      - Avoid power mode switching if 0xa2 is not implemented
        Some modules indicate that they support power level II or power level
        III, but do not implement address 0xa2, meaning that the bit to set
        them to high power mode is not accessible.
      
        These modules appear to have the sff8472_compliance field set to zero,
        and also do not implement diagnostics.  Detect this, but also ensure
        that the module does not require the address switching mode, which we
        do not implement.
      
      - Use mW for power level rather than power level number.
      
      - Fix high power mode transition
        We must not switch to SFP_MOD_PRESENT state until we have finished
        initialising, because the remaining state machines check for that
        state.  Add SFP_MOD_HPOWER as an intermediate state.
      
      - Use definition for I2C register address rather than constant.
      Signed-off-by: NJon Nettleton <jon@solid-run.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3bb35261