2020-09-24 01:20:51 +08:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
/*
|
2020-09-24 01:20:51 +08:00
|
|
|
* Copyright (C) 2017-2020 Mellanox Technologies Ltd.
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
*/
|
|
|
|
|
2018-01-18 02:21:53 +08:00
|
|
|
#ifndef __LINUX_PLATFORM_DATA_MLXREG_H
|
|
|
|
#define __LINUX_PLATFORM_DATA_MLXREG_H
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
|
2018-01-23 11:55:11 +08:00
|
|
|
#define MLXREG_CORE_LABEL_MAX_SIZE 32
|
2019-02-20 17:34:22 +08:00
|
|
|
#define MLXREG_CORE_WD_FEATURE_NOWAYOUT BIT(0)
|
|
|
|
#define MLXREG_CORE_WD_FEATURE_START_AT_BOOT BIT(1)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* enum mlxreg_wdt_type - type of HW watchdog
|
|
|
|
*
|
|
|
|
* TYPE1 HW watchdog implementation exist in old systems.
|
|
|
|
* All new systems have TYPE2 HW watchdog.
|
2020-05-04 22:14:24 +08:00
|
|
|
* TYPE3 HW watchdog can exist on all systems with new CPLD.
|
|
|
|
* TYPE3 is selected by WD capability bit.
|
2019-02-20 17:34:22 +08:00
|
|
|
*/
|
|
|
|
enum mlxreg_wdt_type {
|
|
|
|
MLX_WDT_TYPE1,
|
|
|
|
MLX_WDT_TYPE2,
|
2020-05-04 22:14:24 +08:00
|
|
|
MLX_WDT_TYPE3,
|
2019-02-20 17:34:22 +08:00
|
|
|
};
|
2018-01-23 11:55:11 +08:00
|
|
|
|
platform_data/mlxreg: Add new type to support modular systems
Add new types for the Nvidia modular systems MSN4800 which could
be equipped with the different types of replaceable line cards.
Add new type to specify the kind of hotplug events for the line cards.
The line card events are generated by the programmable device located
on the main board. This device implements interrupt controller logic.
Line card interrupts are associated with different line cards states
during its initialization: insertion, security signature validation,
power good state, security validation, hardware-firmware
synchronization state, line card PHYs readiness state, firmware
availability for line card ports. Also under some circumstances
hardware can generate thermal shutdown for particular line card.
Add new type specifying the action, which should be performed when
particular hotplug event is received. This action defines in which way
hotplug event should be handled by hotplug driver. There are the next
actions types:
- Connect I2C device with empty 'platform_data' field according to the
platform topology, if device is configured (for example, power unit
micro-controller driver, when power unit is connected to power source
(this is what is currently supported).
- Connect device with 'platform_data' field set according to the
platform topology. The purpose is to pass 'platform_data' through
hotplug driver to underlying device (for example line card driver).
- No device is associated with hotplug event - just send "udev" event
(this is what is currently supported).
Extend structure 'mlxreg_hotplug_device' with hotplug action field.
Extend structure 'mlxreg_core_data' with:
- Registers for line card power and enabling control.
- Slot number field, to indicate at which physical slot replaceable
line card device is located.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20211002093238.3771419-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-10-02 17:32:30 +08:00
|
|
|
/**
|
|
|
|
* enum mlxreg_hotplug_kind - kind of hotplug entry
|
|
|
|
*
|
|
|
|
* @MLXREG_HOTPLUG_DEVICE_NA: do not care;
|
|
|
|
* @MLXREG_HOTPLUG_LC_PRESENT: entry for line card presence in/out events;
|
|
|
|
* @MLXREG_HOTPLUG_LC_VERIFIED: entry for line card verification status events
|
|
|
|
* coming after line card security signature validation;
|
|
|
|
* @MLXREG_HOTPLUG_LC_POWERED: entry for line card power on/off events;
|
|
|
|
* @MLXREG_HOTPLUG_LC_SYNCED: entry for line card synchronization events, coming
|
|
|
|
* after hardware-firmware synchronization handshake;
|
|
|
|
* @MLXREG_HOTPLUG_LC_READY: entry for line card ready events, indicating line card
|
|
|
|
PHYs ready / unready state;
|
|
|
|
* @MLXREG_HOTPLUG_LC_ACTIVE: entry for line card active events, indicating firmware
|
|
|
|
* availability / unavailability for the ports on line card;
|
|
|
|
* @MLXREG_HOTPLUG_LC_THERMAL: entry for line card thermal shutdown events, positive
|
|
|
|
* event indicates that system should power off the line
|
|
|
|
* card for which this event has been received;
|
|
|
|
*/
|
|
|
|
enum mlxreg_hotplug_kind {
|
|
|
|
MLXREG_HOTPLUG_DEVICE_NA = 0,
|
|
|
|
MLXREG_HOTPLUG_LC_PRESENT = 1,
|
|
|
|
MLXREG_HOTPLUG_LC_VERIFIED = 2,
|
|
|
|
MLXREG_HOTPLUG_LC_POWERED = 3,
|
|
|
|
MLXREG_HOTPLUG_LC_SYNCED = 4,
|
|
|
|
MLXREG_HOTPLUG_LC_READY = 5,
|
|
|
|
MLXREG_HOTPLUG_LC_ACTIVE = 6,
|
|
|
|
MLXREG_HOTPLUG_LC_THERMAL = 7,
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* enum mlxreg_hotplug_device_action - hotplug device action required for
|
|
|
|
* driver's connectivity
|
|
|
|
*
|
|
|
|
* @MLXREG_HOTPLUG_DEVICE_DEFAULT_ACTION: probe device for 'on' event, remove
|
|
|
|
* for 'off' event;
|
|
|
|
* @MLXREG_HOTPLUG_DEVICE_PLATFORM_ACTION: probe platform device for 'on'
|
|
|
|
* event, remove for 'off' event;
|
|
|
|
* @MLXREG_HOTPLUG_DEVICE_NO_ACTION: no connectivity action is required;
|
|
|
|
*/
|
|
|
|
enum mlxreg_hotplug_device_action {
|
|
|
|
MLXREG_HOTPLUG_DEVICE_DEFAULT_ACTION = 0,
|
|
|
|
MLXREG_HOTPLUG_DEVICE_PLATFORM_ACTION = 1,
|
|
|
|
MLXREG_HOTPLUG_DEVICE_NO_ACTION = 2,
|
|
|
|
};
|
|
|
|
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
/**
|
2018-01-18 02:21:53 +08:00
|
|
|
* struct mlxreg_hotplug_device - I2C device data:
|
2018-01-23 11:55:11 +08:00
|
|
|
*
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
* @adapter: I2C device adapter;
|
|
|
|
* @client: I2C device client;
|
|
|
|
* @brdinfo: device board information;
|
2018-01-23 10:43:27 +08:00
|
|
|
* @nr: I2C device adapter number, to which device is to be attached;
|
platform_data/mlxreg: Add new type to support modular systems
Add new types for the Nvidia modular systems MSN4800 which could
be equipped with the different types of replaceable line cards.
Add new type to specify the kind of hotplug events for the line cards.
The line card events are generated by the programmable device located
on the main board. This device implements interrupt controller logic.
Line card interrupts are associated with different line cards states
during its initialization: insertion, security signature validation,
power good state, security validation, hardware-firmware
synchronization state, line card PHYs readiness state, firmware
availability for line card ports. Also under some circumstances
hardware can generate thermal shutdown for particular line card.
Add new type specifying the action, which should be performed when
particular hotplug event is received. This action defines in which way
hotplug event should be handled by hotplug driver. There are the next
actions types:
- Connect I2C device with empty 'platform_data' field according to the
platform topology, if device is configured (for example, power unit
micro-controller driver, when power unit is connected to power source
(this is what is currently supported).
- Connect device with 'platform_data' field set according to the
platform topology. The purpose is to pass 'platform_data' through
hotplug driver to underlying device (for example line card driver).
- No device is associated with hotplug event - just send "udev" event
(this is what is currently supported).
Extend structure 'mlxreg_hotplug_device' with hotplug action field.
Extend structure 'mlxreg_core_data' with:
- Registers for line card power and enabling control.
- Slot number field, to indicate at which physical slot replaceable
line card device is located.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20211002093238.3771419-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-10-02 17:32:30 +08:00
|
|
|
* @action: action to be performed upon event receiving;
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
*
|
|
|
|
* Structure represents I2C hotplug device static data (board topology) and
|
|
|
|
* dynamic data (related kernel objects handles).
|
|
|
|
*/
|
2018-01-18 02:21:53 +08:00
|
|
|
struct mlxreg_hotplug_device {
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
struct i2c_adapter *adapter;
|
|
|
|
struct i2c_client *client;
|
2018-01-23 11:55:11 +08:00
|
|
|
struct i2c_board_info *brdinfo;
|
2018-01-23 10:43:27 +08:00
|
|
|
int nr;
|
platform_data/mlxreg: Add new type to support modular systems
Add new types for the Nvidia modular systems MSN4800 which could
be equipped with the different types of replaceable line cards.
Add new type to specify the kind of hotplug events for the line cards.
The line card events are generated by the programmable device located
on the main board. This device implements interrupt controller logic.
Line card interrupts are associated with different line cards states
during its initialization: insertion, security signature validation,
power good state, security validation, hardware-firmware
synchronization state, line card PHYs readiness state, firmware
availability for line card ports. Also under some circumstances
hardware can generate thermal shutdown for particular line card.
Add new type specifying the action, which should be performed when
particular hotplug event is received. This action defines in which way
hotplug event should be handled by hotplug driver. There are the next
actions types:
- Connect I2C device with empty 'platform_data' field according to the
platform topology, if device is configured (for example, power unit
micro-controller driver, when power unit is connected to power source
(this is what is currently supported).
- Connect device with 'platform_data' field set according to the
platform topology. The purpose is to pass 'platform_data' through
hotplug driver to underlying device (for example line card driver).
- No device is associated with hotplug event - just send "udev" event
(this is what is currently supported).
Extend structure 'mlxreg_hotplug_device' with hotplug action field.
Extend structure 'mlxreg_core_data' with:
- Registers for line card power and enabling control.
- Slot number field, to indicate at which physical slot replaceable
line card device is located.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20211002093238.3771419-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-10-02 17:32:30 +08:00
|
|
|
enum mlxreg_hotplug_device_action action;
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2018-01-23 11:55:11 +08:00
|
|
|
* struct mlxreg_core_data - attributes control data:
|
|
|
|
*
|
|
|
|
* @label: attribute label;
|
|
|
|
* @reg: attribute register;
|
|
|
|
* @mask: attribute access mask;
|
|
|
|
* @bit: attribute effective bit;
|
2018-12-13 07:59:14 +08:00
|
|
|
* @capability: attribute capability register;
|
2020-07-14 20:02:02 +08:00
|
|
|
* @reg_prsnt: attribute presence register;
|
platform_data/mlxreg: Add new type to support modular systems
Add new types for the Nvidia modular systems MSN4800 which could
be equipped with the different types of replaceable line cards.
Add new type to specify the kind of hotplug events for the line cards.
The line card events are generated by the programmable device located
on the main board. This device implements interrupt controller logic.
Line card interrupts are associated with different line cards states
during its initialization: insertion, security signature validation,
power good state, security validation, hardware-firmware
synchronization state, line card PHYs readiness state, firmware
availability for line card ports. Also under some circumstances
hardware can generate thermal shutdown for particular line card.
Add new type specifying the action, which should be performed when
particular hotplug event is received. This action defines in which way
hotplug event should be handled by hotplug driver. There are the next
actions types:
- Connect I2C device with empty 'platform_data' field according to the
platform topology, if device is configured (for example, power unit
micro-controller driver, when power unit is connected to power source
(this is what is currently supported).
- Connect device with 'platform_data' field set according to the
platform topology. The purpose is to pass 'platform_data' through
hotplug driver to underlying device (for example line card driver).
- No device is associated with hotplug event - just send "udev" event
(this is what is currently supported).
Extend structure 'mlxreg_hotplug_device' with hotplug action field.
Extend structure 'mlxreg_core_data' with:
- Registers for line card power and enabling control.
- Slot number field, to indicate at which physical slot replaceable
line card device is located.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20211002093238.3771419-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-10-02 17:32:30 +08:00
|
|
|
* @reg_sync: attribute synch register;
|
|
|
|
* @reg_pwr: attribute power register;
|
|
|
|
* @reg_ena: attribute enable register;
|
2018-03-27 18:02:01 +08:00
|
|
|
* @mode: access mode;
|
2018-01-23 11:55:11 +08:00
|
|
|
* @np - pointer to node platform associated with attribute;
|
|
|
|
* @hpdev - hotplug device data;
|
|
|
|
* @health_cntr: dynamic device health indication counter;
|
|
|
|
* @attached: true if device has been attached after good health indication;
|
2020-07-14 20:01:58 +08:00
|
|
|
* @regnum: number of registers occupied by multi-register attribute;
|
platform_data/mlxreg: Add new type to support modular systems
Add new types for the Nvidia modular systems MSN4800 which could
be equipped with the different types of replaceable line cards.
Add new type to specify the kind of hotplug events for the line cards.
The line card events are generated by the programmable device located
on the main board. This device implements interrupt controller logic.
Line card interrupts are associated with different line cards states
during its initialization: insertion, security signature validation,
power good state, security validation, hardware-firmware
synchronization state, line card PHYs readiness state, firmware
availability for line card ports. Also under some circumstances
hardware can generate thermal shutdown for particular line card.
Add new type specifying the action, which should be performed when
particular hotplug event is received. This action defines in which way
hotplug event should be handled by hotplug driver. There are the next
actions types:
- Connect I2C device with empty 'platform_data' field according to the
platform topology, if device is configured (for example, power unit
micro-controller driver, when power unit is connected to power source
(this is what is currently supported).
- Connect device with 'platform_data' field set according to the
platform topology. The purpose is to pass 'platform_data' through
hotplug driver to underlying device (for example line card driver).
- No device is associated with hotplug event - just send "udev" event
(this is what is currently supported).
Extend structure 'mlxreg_hotplug_device' with hotplug action field.
Extend structure 'mlxreg_core_data' with:
- Registers for line card power and enabling control.
- Slot number field, to indicate at which physical slot replaceable
line card device is located.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20211002093238.3771419-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-10-02 17:32:30 +08:00
|
|
|
* @slot: slot number, at which device is located;
|
2018-01-23 11:55:11 +08:00
|
|
|
*/
|
|
|
|
struct mlxreg_core_data {
|
|
|
|
char label[MLXREG_CORE_LABEL_MAX_SIZE];
|
|
|
|
u32 reg;
|
|
|
|
u32 mask;
|
|
|
|
u32 bit;
|
2018-12-13 07:59:14 +08:00
|
|
|
u32 capability;
|
2020-07-14 20:02:02 +08:00
|
|
|
u32 reg_prsnt;
|
platform_data/mlxreg: Add new type to support modular systems
Add new types for the Nvidia modular systems MSN4800 which could
be equipped with the different types of replaceable line cards.
Add new type to specify the kind of hotplug events for the line cards.
The line card events are generated by the programmable device located
on the main board. This device implements interrupt controller logic.
Line card interrupts are associated with different line cards states
during its initialization: insertion, security signature validation,
power good state, security validation, hardware-firmware
synchronization state, line card PHYs readiness state, firmware
availability for line card ports. Also under some circumstances
hardware can generate thermal shutdown for particular line card.
Add new type specifying the action, which should be performed when
particular hotplug event is received. This action defines in which way
hotplug event should be handled by hotplug driver. There are the next
actions types:
- Connect I2C device with empty 'platform_data' field according to the
platform topology, if device is configured (for example, power unit
micro-controller driver, when power unit is connected to power source
(this is what is currently supported).
- Connect device with 'platform_data' field set according to the
platform topology. The purpose is to pass 'platform_data' through
hotplug driver to underlying device (for example line card driver).
- No device is associated with hotplug event - just send "udev" event
(this is what is currently supported).
Extend structure 'mlxreg_hotplug_device' with hotplug action field.
Extend structure 'mlxreg_core_data' with:
- Registers for line card power and enabling control.
- Slot number field, to indicate at which physical slot replaceable
line card device is located.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20211002093238.3771419-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-10-02 17:32:30 +08:00
|
|
|
u32 reg_sync;
|
|
|
|
u32 reg_pwr;
|
|
|
|
u32 reg_ena;
|
2018-01-23 11:55:11 +08:00
|
|
|
umode_t mode;
|
|
|
|
struct device_node *np;
|
|
|
|
struct mlxreg_hotplug_device hpdev;
|
2020-05-04 22:14:24 +08:00
|
|
|
u32 health_cntr;
|
2018-01-23 11:55:11 +08:00
|
|
|
bool attached;
|
2020-07-14 20:01:58 +08:00
|
|
|
u8 regnum;
|
platform_data/mlxreg: Add new type to support modular systems
Add new types for the Nvidia modular systems MSN4800 which could
be equipped with the different types of replaceable line cards.
Add new type to specify the kind of hotplug events for the line cards.
The line card events are generated by the programmable device located
on the main board. This device implements interrupt controller logic.
Line card interrupts are associated with different line cards states
during its initialization: insertion, security signature validation,
power good state, security validation, hardware-firmware
synchronization state, line card PHYs readiness state, firmware
availability for line card ports. Also under some circumstances
hardware can generate thermal shutdown for particular line card.
Add new type specifying the action, which should be performed when
particular hotplug event is received. This action defines in which way
hotplug event should be handled by hotplug driver. There are the next
actions types:
- Connect I2C device with empty 'platform_data' field according to the
platform topology, if device is configured (for example, power unit
micro-controller driver, when power unit is connected to power source
(this is what is currently supported).
- Connect device with 'platform_data' field set according to the
platform topology. The purpose is to pass 'platform_data' through
hotplug driver to underlying device (for example line card driver).
- No device is associated with hotplug event - just send "udev" event
(this is what is currently supported).
Extend structure 'mlxreg_hotplug_device' with hotplug action field.
Extend structure 'mlxreg_core_data' with:
- Registers for line card power and enabling control.
- Slot number field, to indicate at which physical slot replaceable
line card device is located.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20211002093238.3771419-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-10-02 17:32:30 +08:00
|
|
|
u8 slot;
|
2018-01-23 11:55:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct mlxreg_core_item - same type components controlled by the driver:
|
|
|
|
*
|
|
|
|
* @data: component data;
|
platform_data/mlxreg: Add new type to support modular systems
Add new types for the Nvidia modular systems MSN4800 which could
be equipped with the different types of replaceable line cards.
Add new type to specify the kind of hotplug events for the line cards.
The line card events are generated by the programmable device located
on the main board. This device implements interrupt controller logic.
Line card interrupts are associated with different line cards states
during its initialization: insertion, security signature validation,
power good state, security validation, hardware-firmware
synchronization state, line card PHYs readiness state, firmware
availability for line card ports. Also under some circumstances
hardware can generate thermal shutdown for particular line card.
Add new type specifying the action, which should be performed when
particular hotplug event is received. This action defines in which way
hotplug event should be handled by hotplug driver. There are the next
actions types:
- Connect I2C device with empty 'platform_data' field according to the
platform topology, if device is configured (for example, power unit
micro-controller driver, when power unit is connected to power source
(this is what is currently supported).
- Connect device with 'platform_data' field set according to the
platform topology. The purpose is to pass 'platform_data' through
hotplug driver to underlying device (for example line card driver).
- No device is associated with hotplug event - just send "udev" event
(this is what is currently supported).
Extend structure 'mlxreg_hotplug_device' with hotplug action field.
Extend structure 'mlxreg_core_data' with:
- Registers for line card power and enabling control.
- Slot number field, to indicate at which physical slot replaceable
line card device is located.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20211002093238.3771419-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-10-02 17:32:30 +08:00
|
|
|
* @kind: kind of hotplug attribute;
|
2018-01-23 11:55:11 +08:00
|
|
|
* @aggr_mask: group aggregation mask;
|
|
|
|
* @reg: group interrupt status register;
|
|
|
|
* @mask: group interrupt mask;
|
2020-01-14 00:28:38 +08:00
|
|
|
* @capability: group capability register;
|
2018-01-23 11:55:11 +08:00
|
|
|
* @cache: last status value for elements fro the same group;
|
|
|
|
* @count: number of available elements in the group;
|
|
|
|
* @ind: element's index inside the group;
|
|
|
|
* @inversed: if 0: 0 for signal status is OK, if 1 - 1 is OK;
|
|
|
|
* @health: true if device has health indication, false in other case;
|
|
|
|
*/
|
|
|
|
struct mlxreg_core_item {
|
|
|
|
struct mlxreg_core_data *data;
|
platform_data/mlxreg: Add new type to support modular systems
Add new types for the Nvidia modular systems MSN4800 which could
be equipped with the different types of replaceable line cards.
Add new type to specify the kind of hotplug events for the line cards.
The line card events are generated by the programmable device located
on the main board. This device implements interrupt controller logic.
Line card interrupts are associated with different line cards states
during its initialization: insertion, security signature validation,
power good state, security validation, hardware-firmware
synchronization state, line card PHYs readiness state, firmware
availability for line card ports. Also under some circumstances
hardware can generate thermal shutdown for particular line card.
Add new type specifying the action, which should be performed when
particular hotplug event is received. This action defines in which way
hotplug event should be handled by hotplug driver. There are the next
actions types:
- Connect I2C device with empty 'platform_data' field according to the
platform topology, if device is configured (for example, power unit
micro-controller driver, when power unit is connected to power source
(this is what is currently supported).
- Connect device with 'platform_data' field set according to the
platform topology. The purpose is to pass 'platform_data' through
hotplug driver to underlying device (for example line card driver).
- No device is associated with hotplug event - just send "udev" event
(this is what is currently supported).
Extend structure 'mlxreg_hotplug_device' with hotplug action field.
Extend structure 'mlxreg_core_data' with:
- Registers for line card power and enabling control.
- Slot number field, to indicate at which physical slot replaceable
line card device is located.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20211002093238.3771419-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-10-02 17:32:30 +08:00
|
|
|
enum mlxreg_hotplug_kind kind;
|
2018-01-23 11:55:11 +08:00
|
|
|
u32 aggr_mask;
|
|
|
|
u32 reg;
|
|
|
|
u32 mask;
|
2020-01-14 00:28:38 +08:00
|
|
|
u32 capability;
|
2018-01-23 11:55:11 +08:00
|
|
|
u32 cache;
|
|
|
|
u8 count;
|
|
|
|
u8 ind;
|
|
|
|
u8 inversed;
|
|
|
|
u8 health;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct mlxreg_core_platform_data - platform data:
|
|
|
|
*
|
2018-12-13 07:59:13 +08:00
|
|
|
* @data: instance private data;
|
2018-01-23 11:55:11 +08:00
|
|
|
* @regmap: register map of parent device;
|
2018-12-13 07:59:13 +08:00
|
|
|
* @counter: number of instances;
|
2019-02-20 17:34:22 +08:00
|
|
|
* @features: supported features of device;
|
|
|
|
* @version: implementation version;
|
|
|
|
* @identity: device identity name;
|
2020-09-24 01:20:52 +08:00
|
|
|
* @capability: device capability register;
|
2018-01-23 11:55:11 +08:00
|
|
|
*/
|
|
|
|
struct mlxreg_core_platform_data {
|
|
|
|
struct mlxreg_core_data *data;
|
|
|
|
void *regmap;
|
|
|
|
int counter;
|
2019-02-20 17:34:22 +08:00
|
|
|
u32 features;
|
|
|
|
u32 version;
|
|
|
|
char identity[MLXREG_CORE_LABEL_MAX_SIZE];
|
2020-09-24 01:20:52 +08:00
|
|
|
u32 capability;
|
2018-01-23 11:55:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct mlxreg_core_hotplug_platform_data - hotplug platform data:
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
*
|
2018-01-23 11:55:11 +08:00
|
|
|
* @items: same type components with the hotplug capability;
|
|
|
|
* @irq: platform interrupt number;
|
|
|
|
* @regmap: register map of parent device;
|
|
|
|
* @counter: number of the components with the hotplug capability;
|
|
|
|
* @cell: location of top aggregation interrupt register;
|
|
|
|
* @mask: top aggregation interrupt common mask;
|
|
|
|
* @cell_low: location of low aggregation interrupt register;
|
|
|
|
* @mask_low: low aggregation interrupt common mask;
|
2018-02-14 06:09:34 +08:00
|
|
|
* @deferred_nr: I2C adapter number must be exist prior probing execution;
|
2018-02-14 06:09:36 +08:00
|
|
|
* @shift_nr: I2C adapter numbers must be incremented by this value;
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
*/
|
2018-01-23 11:55:11 +08:00
|
|
|
struct mlxreg_core_hotplug_platform_data {
|
|
|
|
struct mlxreg_core_item *items;
|
|
|
|
int irq;
|
|
|
|
void *regmap;
|
|
|
|
int counter;
|
|
|
|
u32 cell;
|
|
|
|
u32 mask;
|
|
|
|
u32 cell_low;
|
|
|
|
u32 mask_low;
|
2018-02-14 06:09:34 +08:00
|
|
|
int deferred_nr;
|
2018-02-14 06:09:36 +08:00
|
|
|
int shift_nr;
|
platform/x86: Introduce support for Mellanox hotplug driver
Enable system support for the Mellanox Technologies hotplug platform
driver, which provides support for the next Mellanox basic systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100" and also various number of derivative
systems from the above basic types.
This driver handles hot-plug events for the power suppliers, power
cables and fans for the above systems.
The Kconfig currently controlling compilation of this code is:
driver/platform/x86:config MLX_CPLD_PLATFORM
tristate "Mellanox platform hotplug driver support"
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2016-10-21 00:28:01 +08:00
|
|
|
};
|
|
|
|
|
2018-01-18 02:21:53 +08:00
|
|
|
#endif /* __LINUX_PLATFORM_DATA_MLXREG_H */
|