Skip to content

Commit

Permalink
Mellanox drivers backport patching from kernels 4.20-5.0-next (#79)
Browse files Browse the repository at this point in the history
* Mellanox drivers backport patching from kernels 4.20-5.1

Backport from upstream kernels v4.20, v5.0.
Patches include:
- Amendment for cooling device
- Fix for mlxreg-fan driver
- Fixes for Mellanox systems DMI names.

The list of commits is below:

commit fb7255a923115188ac134bb562d1c44f4f3a413b
Author: Vadim Pasternak <[email protected]>
Date:   Thu Nov 15 17:27:00 2018 +0000

    platform/x86: mlx-platform: Convert to use SPDX identifier

    Reduce size of duplicated comments by switching to use SPDX identifier.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Darren Hart (VMware) <[email protected]>

commit e2883859dd0b4ee6fc70151e417fed8680efaa4b
Author: Vadim Pasternak <[email protected]>
Date:   Thu Nov 15 17:26:58 2018 +0000

    platform/x86: mlx-platform: Allow mlxreg-io driver activation for new systems

    Allow mlxreg-io platform driver activation for  the next generation
    systems, in particular for MQM87xx, MSN34xx, MSN37xx types, which have:
    - extended reset causes bits related to ComEx reset, voltage devices
      firmware upgrade, system platform reset;
    - additional CPLD device;
    - JTAG select capability;

    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Darren Hart (VMware) <[email protected]>

commit 440f343df1996302d9a3904647ff11b689bf27bc
Author: Vadim Pasternak <[email protected]>
Date:   Thu Nov 15 17:26:57 2018 +0000

    platform/x86: mlx-platform: Fix LED configuration

    Exchange LED configuration between msn201x and next generation systems
    types.

    Bug was introduced when LED driver activation was added to mlx-platform.
    LED configuration for the three new system MQMB7, MSN37, MSN34 was
    assigned to MSN21 and vice versa. This bug affects MSN21 only and
    likely requires backport to v4.19.

    Fixes: 1189456b1cce ("platform/x86: mlx-platform: Add LED platform driver activation")
    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Darren Hart (VMware) <[email protected]>

commit edd45cba5ed7f53974475ddc9a1453c2c87b3328
Author: Vadim Pasternak <[email protected]>
Date:   Thu Nov 15 17:26:56 2018 +0000

    platform/x86: mlx-platform: Fix tachometer registers

    Shift by one the registers for tachometers (7 - 12).

    This fix is relevant for the same new systems MQMB7, MSN37, MSN34,
    which are about to be released to the customers.
    At the moment, none of them is at customers sites. The customers will
    not suffer from this change.
    This fix is necessary, because register used before for tachometer 7
    has been than reserved for the second PWM for newer systems, which are
    not supported yet in mlx-platform driver. So registers of tachometers
    7-12 have been shifted by one.

    Fixes: 0378123c5800 ("platform/x86: mlx-platform: Add mlxreg-fan platform driver activation")
    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Darren Hart (VMware) <[email protected]>

commit 3752e5c764b4fb1abe43c78f635bf019c8e98db2
Author: Vadim Pasternak <[email protected]>
Date:   Thu Nov 15 17:26:55 2018 +0000

    platform/x86: mlx-platform: Rename new systems product names

    Rename product names for next generation systems QMB7, SN37, SN34 to
    respectively MQMB7, MSN37, MSN34.

    All these systems are about to be released to the customers.
    At the moment, none of them is at customers sites. The customers will
    not suffer from this change.
    The names have been changed due to marketing decision.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Darren Hart (VMware) <[email protected]>

commit 59e96ec85e8e59170f6d5cba028e199a2e5dfe67
Author: Vadim Pasternak <[email protected]>
Date:   Thu Nov 15 17:26:54 2018 +0000

    platform/x86: mlx-platform: Add definitions for new registers

    Add definitions for new registers:
    - CPLD3 version - next generation systems are equipped with three CPLD;
    - Two reset cause registers, which store the system reset reason (like
      system failures, upgrade failures and so on;

    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Darren Hart (VMware) <[email protected]>

	commit a421ce088ac8eb3591d2a1ae0ded2dcece72018f

Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 06:52:03 2018 +0000

    mlxsw: core: Extend cooling device with cooling levels

    Extend cooling device with cooling levels vector to allow more
    flexibility of PWM setting.

    Thermal zone algorithm operates with the numerical states for PWM
    setting. Each state is the index, defined in range from 0 to 10 and it's
    mapped to the relevant duty cycle value, which is written to PWM
    controller. With the current definition fan speed is set to 0% for state
    0, 10% for state 1, and so on up to 100% for the maximum state 10.

    Some systems have limitation for the PWM speed minimum. For such systems
    PWM setting speed to 0% will just disable the ability to increase speed
    anymore and such device will be stall on zero speed.  Cooling levels
    allow to configure state vector according to the particular system
    requirements. For example, if PWM speed is not allowed to be below 30%,
    cooling levels could be configured as 30%, 30%, 30%, 30%, 40%, 50% and
    so on.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

	commit 3f9ffa5c3a25bf2a3c880b07f620c8ef029dc261
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 23:16:36 2018 +0000

    hwmon: (mlxreg-fan) Modify macros for tachometer fault status reading

    Modify macros for tachometer fault status reading for making it more
    simple and clear.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>

commit 243cfe3fb8978c7eec24511aba7dac98819ed896
Author: Vadim Pasternak <[email protected]>
Date:   Fri Nov 16 13:47:11 2018 +0000

    hwmon: (mlxreg-fan) Fix macros for tacho fault reading

    Fix macros for tacometer fault reading.
    This fix is relevant for three Mellanox systems MQMB7, MSN37, MSN34,
    which are about to be released to the customers.
    At the moment, none of them is at customers sites.

    Fixes: 65afb4c8e7e4 ("hwmon: (mlxreg-fan) Add support for Mellanox FAN driver")
    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>

Signed-off-by: Vadim Pasternak <[email protected]>
-
Mellanox drivers backport patching from next kernels 5.1

Backport from upstream kernels accpted for v5.1.
Patches include:
- Amendment for thermal zone and hwmon for mlxsw module.
- Support for new Mellanox platforms.

The list of commits is below:

commit 572b2266b9005e8561d1942b238ae2b1c90e5758
Author: Vadim Pasternak <[email protected]>
Date:   Wed Dec 12 23:59:15 2018 +0000

commit a36d97a368f41a6d13e5c0e8b12d2d18ee81b680
Author: Vadim Pasternak <[email protected]>
Date:   Wed Dec 12 23:59:16 2018 +0000

    platform/x86: mlx-platform: Add support for new VMOD0007 board name

    Add support for new Mellanox system type MSN3700C, which is
    a cost reduced flavor of the MSN37 system class.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Darren Hart (VMware) <[email protected]>

commit 572b2266b9005e8561d1942b238ae2b1c90e5758
Author: Vadim Pasternak <[email protected]>
Date:   Wed Dec 12 23:59:15 2018 +0000

    platform/x86: mlx-platform: Add support for fan capability registers

    Provide support for the fan capability registers for the next generation
    systems of types MQM87xx, MSN34xx, MSN37xx. These new registers provide
    configuration for tachometers and fan drawers connectivity.  Use these
    registers for next generation led, fan and hotplug structures in order
    to distinguish between the systems which have minor configuration
    differences. This reduces the amount of code used to describe such
    systems.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Darren Hart (VMware) <[email protected]>

    platform/x86: mlx-platform: Add support for fan capability registers

    Provide support for the fan capability registers for the next generation
    systems of types MQM87xx, MSN34xx, MSN37xx. These new registers provide
    configuration for tachometers and fan drawers connectivity.  Use these
    registers for next generation led, fan and hotplug structures in order
    to distinguish between the systems which have minor configuration
    differences. This reduces the amount of code used to describe such
    systems.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Darren Hart (VMware) <[email protected]>

	commit 1c10399c663df363846fb70cf1cc871afaadcf59 (HEAD, combined_queue)
Author: Vadim Pasternak <[email protected]>
Date:   Thu Jan 17 14:54:11 2019 +0000

    squash to: "mlxsw: minimal: Add support for ethtool interface"

    Fix compilation error reporting by kbuild test root.
    Replace in mlxsw_m_port_switchdev_init()
      mlxsw_m_port->dev->switchdev_ops = &mlxsw_m_port_switchdev_ops; by
      SWITCHDEV_SET_OPS(mlxsw_m_port->dev, &mlxsw_m_port_switchdev_ops);
    to make minimal module independent on NET_SWITCHDEV, since SWITCHDEV
    is not mandatory for minimal driver.

    Signed-off-by: Vadim Pasternak <[email protected]>

commit 90818ac3344d31bf9eadb466243bf7e13d058107
Author: Vadim Pasternak <[email protected]>
Date:   Sun Dec 30 13:25:18 2018 +0000

    mlxsw: core: Extend thermal module with per QSFP module thermal zones

    Add a dedicated thermal zone for each QSFP/SFP module. The current
    temperature is obtained from the module's temperature sensor and the
    trip points are set based on the warning and critical thresholds
    read from the module.

    A cooling device (fan) is bound to all the thermal zones. The
    thermal zone governor is set to user space in order to avoid
    collisions between thermal zones.
    For example, one thermal zone might want to increase the speed of
    the fan, whereas another one would like to decrease it.

    Deferring this decision to user space allows the user to the take
    the most suitable decision.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit 2c68cc78f1b6a2d6908e84131e1325fd0af45755
Author: Vadim Pasternak <[email protected]>
Date:   Sun Jan 13 14:10:00 2019 +0000

    mlxsw: i2c: Extend initialization by querying firmware data

    Extend initialization flow by query requests for firmware configuration
    data in order to obtain the current firmware version.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Acked-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit ba41e5bfd3cb7e14b32bb46a5006262dfec3605d
Author: Vadim Pasternak <[email protected]>
Date:   Sun Jan 13 14:09:59 2019 +0000

    mlxsw: i2c: Extend initialization by querying resources data

    Extend initialization flow by query requests for chip resources data in
    order to obtain chip's specific capabilities, like the number of ports.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Acked-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit cdfe1c083d0869757239ed1c2fc09ef74ad60141
Author: Vadim Pasternak <[email protected]>
Date:   Sun Jan 13 14:09:58 2019 +0000

    mlxsw: i2c: Extend input parameters list of command API

    Extend input parameters list of command API in mlxsw_i2c_cmd() in order
    to support initialization commands. Up until now, only access commands
    were supported by I2C driver.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Acked-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit bb92562d37e08de040f75c604e3e9bd96d830b3a
Author: Vadim Pasternak <[email protected]>
Date:   Sun Jan 13 14:09:57 2019 +0000

    mlxsw: i2c: Modify input parameter name in initialization API

    Change input parameter name "resource" to "res" in mlxsw_i2c_init() in
    order to align it with mlxsw_pci_init().

    Signed-off-by: Vadim Pasternak <[email protected]>
    Acked-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit e8d4edb71443616911f36a8f45cb93e15a47ad4c
Author: Vadim Pasternak <[email protected]>
Date:   Sun Jan 13 14:09:56 2019 +0000

    mlxsw: i2c: Fix comment misspelling

    Fix comment for mlxsw_i2c_write_cmd().

    Signed-off-by: Vadim Pasternak <[email protected]>
    Acked-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit d1908ba110713493f9a100b58b1fe12335178fbd
Author: Vadim Pasternak <[email protected]>
Date:   Sun Jan 13 14:09:55 2019 +0000

    mlxsw: core: Move resource query API to common location

    Move mlxsw_pci_resources_query() to a common location to allow reuse by
    the different drivers and over all the supported physical buses. Rename
    it to mlxsw_core_resources_query().

    Signed-off-by: Vadim Pasternak <[email protected]>
    Acked-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit 534d3d5c66565a6d64daf8accb7e5db00eaeb9a3
Author: Vadim Pasternak <[email protected]>
Date:   Sun Dec 30 17:27:35 2018 +0000

    mlxsw: minimal: Add support for ethtool interface

    Add support for ethtool interface to allow reading QSFP/SFP modules
    content through 'ethtool -m' command.
    The minimal driver is chip independent, uses I2C bus for chip access.
    Its purpose is to support chassis management on the systems equipped
    with Mellanox network switch device. For example from BMC (Board
    Management Controller) device.
    The patch allows to obtain QSFP/SFP module info through ethtool.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Acked-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit 216cc3945f481a53f9063c5c399ac8aac69aed27
Author: Vadim Pasternak <[email protected]>
Date:   Sun Dec 30 17:27:34 2018 +0000

    mlxsw: minimal: Make structures and variables names shorter

    Replace "mlxsw_minimal" by "mlxsw_m" in order to improve code
    readability.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Acked-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit b772d504c3c04deb0fad51ba69d1af29cbeba303
Author: Vadim Pasternak <[email protected]>
Date:   Sun Dec 30 17:27:33 2018 +0000

    mlxsw: core: Move ethtool modules callbacks bodies to common location

    Move ethtool bodies of callbacks get_module_info() and get_module_eeprom()
    to the common location to allow reuse by the different mlxsw drivers.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Acked-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit cf7f555463b0370f517f3cb0bfb547fa3bf57305
Author: Vadim Pasternak <[email protected]>
Date:   Thu Nov 22 09:58:33 2018 +0000

    mlxsw: core: thermal zone binding to an external cooling device

    Allow thermal zone binding to an external cooling device from the
    cooling devices white list.
    It provides support for Mellanox next generation systems on which
    cooling device logic is not controlled through the switch registers.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit 1076dc7da451b1770efcd0a6e56c6ca59930bdf2
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 22:53:27 2018 +0000

    mlxsw: core: Add QSFP module temperature label attribute to hwmon

    Add label attribute to hwmon object for exposing QSFP module's
    temperature sensor name. Modules are labeled as "front panel xxx". The
    label is used by utilities such as "sensors":

    front panel 001:   +0.0C  (crit =  +0.0C, emerg =  +0.0C)
    ..
    front panel 020:  +31.0C  (crit = +70.0C, emerg = +80.0C)
    ..
    front panel 056:  +41.0C  (crit = +70.0C, emerg = +80.0C)

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit a44463600400715b95d2e950f3b1e6f93cbf724b
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 13:04:23 2018 +0000

    mlxsw: core: Extend hwmon interface with QSFP module temperature attributes

    Add new attributes to hwmon object for exposing QSFP module temperature
    input, fault indication, critical and emergency thresholds.
    Temperature input and fault indication are reading from Management
    Temperature Bulk Register. Temperature thresholds are reading from
    Management Cable Info Access Register.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit fbc40d0c2e0490f1f3f57e7b19eccf8279a62d7e
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 13:04:22 2018 +0000

    mlxsw: core: Extend hwmon interface with fan fault attribute

    Add new fan hwmon attribute for exposing fan faults (fault indication is
    read from Fan Out of Range Event Register).

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit 840ffb0c319eeafdad6b862b1aa687966991b2da
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 13:04:21 2018 +0000

    mlxsw: core: Rename cooling device

    Rename cooling device from "Fan" to "mlxsw_fan".
    Name "Fan" is too common name, and such name is misleading, while it's
    interpreted by user.
    For example name "Fan" could be used by ACPI.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit 125a0a232afda25362c83f9b984c8fa71458b051
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 13:04:20 2018 +0000

    mlxsw: core: Replace thermal temperature trips with defines

    Replace thermal hardcoded temperature trips values with defines.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit 6a7d5f9cf01d24581fb5a533c609d4534f2585c3
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 13:04:19 2018 +0000

    mlxsw: core: Modify thermal zone definition

    Modify thermal zone trip points setting for better alignment with system
    thermal requirement.

    Add hysteresis thresholds for thermal trips in order to avoid throttling
    around thermal trip point. If hysteresis temperature is not considered,
    PWM can have side effect of flip up/down on thermal trip point boundary.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit fd6bdf864a1f3cd5035de84ebceed573b7451374
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 13:04:18 2018 +0000

    mlxsw: core: Set different thermal polling time based on bus frequency capability

    Add low frequency bus capability in order to allow core functionality
    separation based on bus type. Driver could run over PCIe, which is
    considered as high frequency bus or I2C, which is considered as low
    frequency bus. In the last case time setting, for example, for thermal
    polling interval, should be increased.

    Use different thermal monitoring based on bus type.
    For I2C bus time is set to 20 seconds, while for PCIe 1 second polling
    interval is used.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit 2d382b8a7a63268506fa9b1d869b7139d9ee06e0
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 13:04:17 2018 +0000

    mlxsw: core: Add core environment module for QSFP module temperature thresholds reading

    Add new core_env module to allow module temperature warning and critical
    thresholds reading.

    New internal API reads the temperature thresholds from the modules, which
    are equipped with the thermal sensor. These thresholds are to be exposed
    by hwmon module and to be used by thermal module.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit a8a14ab2228eb04b4b9a38e389c1326fb634cbd3
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 13:04:16 2018 +0000

    mlxsw: reg: Add Fan Out of Range Event Register

    Add FORE (Fan Out of Range Event Register), which is used for fan fault
    reading.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit b0a01ca026839e5e93c7c53a822b407ae5ac0a7b
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 13:04:15 2018 +0000

    mlxsw: reg: Add Management Temperature Bulk Register

    Add MTBR (Management Temperature Bulk Register), which is used for port
    temperature reading in a bulk mode.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

commit d7bb8405da07703b8466fcb1fdc7a86d5cf30ae9
Author: Vadim Pasternak <[email protected]>
Date:   Tue Nov 20 13:04:14 2018 +0000

    mlxsw: spectrum: Move QSFP EEPROM definitons to common location

    Move QSFP EEPROM definitions to common location from the spectrum driver
    in order to make them available for other mlxsw modules. They are common
    for all kind of chips and have relation to SFF specifications 8024, 8436,
    8472, 8636, rather than to chip type.

    Signed-off-by: Vadim Pasternak <[email protected]>
    Reviewed-by: Jiri Pirko <[email protected]>
    Signed-off-by: Ido Schimmel <[email protected]>

	Signed-off-by: Vadim Pasternak <[email protected]>

Mellanox drivers backport patching from kernels 4.20-5.0

Backport from upstream kernels v4.20, v5.0.
Patches include:
- Amendment for cooling device
- Fix for mlxreg-fan driver
- Fixes for Mellanox systems DMI names.

The list of commits is below:

hwmon: (mlxreg-fan) Add support for fan capability registers

Add support for fan capability registers in order to distinct between
the systems which have minor fan configuration differences. This
reduces the amount of code used to describe such systems.
The capability registers provides system specific information about the
number of physically connected tachometers and system specific fan
speed scale parameter.
For example one system can be equipped with twelve fan tachometers,
while the other with for example, eight or six. Or one system should
use default fan speed divider value, while the other has a scale
parameter defined in hardware, which should be used for divider
setting.
Reading this information from the capability registers allows to use the
same fan structure for the systems with the such differences.

Signed-off-by: Vadim Pasternak <[email protected]>

hwmon: (pmbus) Fix driver info initialization in probe routine

Fix tps53679_probe() by using dynamically allocated ?pmbus_driver_info?
structure instead of static. Usage of static structures causes
overwritten of the field ?vrm_version? - when the number of tps53679
devices with the different ?vrm_version? are used within the same
system, the last probed device overwrites this field for all others.

Fixes: 610526527a13e4c9 ("hwmon: (pmbus) Add support for Texas Instruments tps53679 device")
Signed-off-by: Vadim Pasternak <[email protected]>

Signed-off-by: Vadim Pasternak <[email protected]>

Mellanox drivers backport patching for patches for next kernel 5.2

Backport from upstream kernels v4.20, v5.0.
Patches include:
- Support capability registers for Mellanox platform driver.
- Support capability registers for leds-mlxreg driver.
- Support capability registers for mlxreg-fan driver.
- Fix for probe routine of tps53679 driver.

- Fix for probe routine of tps53679 driver.

platform/x86: mlx-platform: Add support for fan speed capability register

Provide support for the fan speed capability register for the next generation
systems of types MQM87xx, MSN34xx, MSN37xx. These new register provide
configuration for tachometers and fan drawers connectivity.  Use these
scale value for FAN speed calculation.

Signed-off-by: Vadim Pasternak <[email protected]>

platform/x86: mlx-platform: Add support for CPLD4 register

Provide support for CPLD4 version register, relevant for MSN8xx system
family.

Signed-off-by: Vadim Pasternak <[email protected]>

leds: mlxreg: Add support for capability register

Add support for capability register in order to distinct between the
systems which have minor LED configuration differences. This reduces
the amount of code used to describe such systems.
For example one system can be equipped with six LED, while the other
with only four. Reading this information from the capability registers
allows to use the same LED structure for such systems.

Signed-off-by: Vadim Pasternak <[email protected]>

Signed-off-by: Vadim Pasternak <[email protected]>

* Add patch for CPLD4
  • Loading branch information
MellanoxBSP authored and lguohan committed Feb 1, 2019
1 parent 3b2114d commit 4cb2f28
Show file tree
Hide file tree
Showing 11 changed files with 18,647 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
From c6a95c1ea4518a19cf46e8d0c844ae980df4c5da Mon Sep 17 00:00:00 2001
From: Vadim Pasternak <[email protected]>
Date: Thu, 3 Jan 2019 18:05:01 +0000
Subject: [PATCH v1] mlxsw: qsfp_sysfs: Support extended port numbers for
Spectrume2 chip

Add system type detection through DMI table in order to distinct between
the systems supporting up to 64 and up to 128 ports.

Signed-off-by: Vadim Pasternak <[email protected]>
---
drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c b/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
index c072b91..bee2a08 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c
@@ -47,7 +47,7 @@
#define MLXSW_QSFP_SUB_PAGE_NUM 3
#define MLXSW_QSFP_SUB_PAGE_SIZE 48
#define MLXSW_QSFP_LAST_SUB_PAGE_SIZE 32
-#define MLXSW_QSFP_MAX_NUM 64
+#define MLXSW_QSFP_MAX_NUM 128
#define MLXSW_QSFP_MIN_REQ_LEN 4
#define MLXSW_QSFP_STATUS_VALID_TIME (120 * HZ)
#define MLXSW_QSFP_MAX_CPLD_NUM 3
@@ -88,6 +88,7 @@ struct mlxsw_qsfp {
};

static int mlxsw_qsfp_cpld_num = MLXSW_QSFP_MIN_CPLD_NUM;
+static int mlxsw_qsfp_num = MLXSW_QSFP_MAX_NUM / 2;

static int
mlxsw_qsfp_query_module_eeprom(struct mlxsw_qsfp *mlxsw_qsfp, u8 index,
@@ -238,6 +239,13 @@ static int mlxsw_qsfp_dmi_set_cpld_num(const struct dmi_system_id *dmi)
return 1;
};

+static int mlxsw_qsfp_dmi_set_qsfp_num(const struct dmi_system_id *dmi)
+{
+ mlxsw_qsfp_num = MLXSW_QSFP_MAX_NUM;
+
+ return 1;
+};
+
static const struct dmi_system_id mlxsw_qsfp_dmi_table[] = {
{
.callback = mlxsw_qsfp_dmi_set_cpld_num,
@@ -253,6 +261,13 @@ static const struct dmi_system_id mlxsw_qsfp_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "MSN27"),
},
},
+ {
+ .callback = mlxsw_qsfp_dmi_set_qsfp_num,
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "MSN37"),
+ },
+ },
{ }
};
MODULE_DEVICE_TABLE(dmi, mlxsw_qsfp_dmi_table);
@@ -283,7 +298,7 @@ int mlxsw_qsfp_init(struct mlxsw_core *mlxsw_core,
mlxsw_qsfp->bus_info = mlxsw_bus_info;
mlxsw_bus_info->dev->platform_data = mlxsw_qsfp;

- for (i = 1; i <= MLXSW_QSFP_MAX_NUM; i++) {
+ for (i = 1; i <= mlxsw_qsfp_num; i++) {
mlxsw_reg_pmlp_pack(pmlp_pl, i);
err = mlxsw_reg_query(mlxsw_qsfp->core, MLXSW_REG(pmlp),
pmlp_pl);
--
2.1.4

Loading

0 comments on commit 4cb2f28

Please sign in to comment.