Add new features and amendments for Nvidia systems
Subsystems (2)
Vadim Pasternak
maintainerv4 cover Add new features and amendments for Nvidia systems
The patch set:
- Provides New system attributes for monitoring.
- Adds system reboot callback to perform system specific operations.
- Adds support for ACPI based initialization flow.
- Adds support for FPGA device connected through PCIe bus.
- Adds additional logic for hotplug events handling.
- Contains some amendments and cosmetic changes.
The patch set includes:
Patches #1 - #3, #5: add new attributes for monitoring. Patch #4: sets hotplug event action for health and power signals. Patch #6: adds CPLD versioning registers for systems equipped with five
CPLD devices.
Patch #7: modifies power off callback.
Patch #8: cosmetic changes - fixes misspelling.
Patch #9: provides system reboot callback through system reboot
notifier.
Patch #10: prepares driver to allow probing through ACPI hooks along
with probing through DMI hooks.
Patch #11: adds ACPI match hook for initialization flow. Patch #12: adds support for getting system interrupt line from ACPI
table.
Patch #13: adds initial support for programming logic device connected
through PCIe.
Patch #14: Extends condition for notification callback processing. Patch #15: defines the exact i2c bus of fans on the SN2201 system. Patch #16: Documents new attributes.
Changes in v4:
- Address review comments from Ilpo, see patch 16/16 for details. Changes in v3:
- Address review comments from Hans, see patch 16/16 for details.
- Rebased on top of:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Michael Shych (1):
platform: mellanox: nvsw-sn2201: change fans i2c busses.
Vadim Pasternak (15):
platform: mellanox: Add new attributes
platform: mellanox: Add field upgrade capability register
platform: mellanox: Modify reset causes description
platform: mellanox: mlx-platform: Modify health and power hotplug
action
platform: mellanox: mlx-platform: Add reset cause attribute
platform: mellanox: mlx-platform: add support for additional CPLD
platform: mellanox: mlx-platform: Modify power off callback
platform: mellanox: Cosmetic changes
platform: mellanox: mlx-platform: Add reset callback
platform: mellanox: mlx-platform: Prepare driver to allow probing
through ACPI infrastructure
platform: mellanox: mlx-platform: Introduce ACPI init flow
platform: mellanox: mlx-platform: Get interrupt line through ACPI
platform: mellanox: Add initial support for PCIe based programming
logic device
platform/mellanox: mlxreg-hotplug: Extend condition for notification
callback processing
Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces
.../ABI/stable/sysfs-driver-mlxreg-io | 52 +++ drivers/platform/mellanox/mlxreg-hotplug.c | 2 +- drivers/platform/mellanox/nvsw-sn2201.c | 12 +- drivers/platform/x86/mlx-platform.c | 376 ++++++++++++++++-- 4 files changed, 393 insertions(+), 49 deletions(-)
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 1/16 platform: mellanox: Add new attributes
Add new attribute:
"lid_open" - to indicate system intrusion detection. "reset_long_pwr_pb" - to indicate that system has been reset due to long press of power button.
--- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/platform/x86/mlx-platform.c +12 -0
@@ -3792,6 +3792,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(1), .mode = 0444, }, + { + .label = "lid_open", + .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(2), + .mode = 0444, + }, { .label = "clk_brd1_boot_fail", .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET,
@@ -4431,6 +4437,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_chassis_blade_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(6), .mode = 0444, }, + { + .label = "reset_long_pwr_pb", + .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(7), + .mode = 0444, + }, { .label = "pwr_cycle", .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET,
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 2/16 platform: mellanox: Add field upgrade capability register
In reply to Vadim PasternakAdd new register to indicate the method of FPGA/CPLD field upgrade supported on the specific system.
Currently two masks are available:
b00 - field upgrade through LPC gateway (new method introduced to
accelerate field upgrade process).
b11 - field upgrade through CPU GPIO pins (old method).
--- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/platform/x86/mlx-platform.c +12 -0
@@ -62,6 +62,7 @@#define MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET 0x37#define MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET 0x3a#define MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET 0x3b +#define MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET 0x3c#define MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET 0x40#define MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET 0x41#define MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET 0x42
@@ -236,6 +237,7 @@#define MLXPLAT_CPLD_VOLTREG_UPD_MASK GENMASK(5, 4)#define MLXPLAT_CPLD_GWP_MASK GENMASK(0, 0)#define MLXPLAT_CPLD_EROT_MASK GENMASK(1, 0) +#define MLXPLAT_CPLD_FU_CAP_MASK GENMASK(1, 0)#define MLXPLAT_CPLD_PWR_BUTTON_MASK BIT(0)#define MLXPLAT_CPLD_LATCH_RST_MASK BIT(6)#define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3)
@@ -3680,6 +3682,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(6), .mode = 0200, }, + { + .label = "jtag_cap", + .reg = MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET, + .mask = MLXPLAT_CPLD_FU_CAP_MASK, + .bit = 1, + .mode = 0444, + }, { .label = "jtag_enable", .reg = MLXPLAT_CPLD_LPC_REG_GP2_OFFSET,
@@ -4935,6 +4944,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_SAFE_BIOS_OFFSET :case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET :case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET : +case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET :case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET :case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET :case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET :
@@ -5046,6 +5056,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET :case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET :case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET : +case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET :case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET :case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET :case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET :
@@ -5203,6 +5214,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_SAFE_BIOS_WP_OFFSET :case MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET :case MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET : +case MLXPLAT_CPLD_LPC_REG_FU_CAP_OFFSET :case MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET :case MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET :case MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET :
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 3/16 platform: mellanox: Modify reset causes description
In reply to Vadim PasternakFor system of classes VMOD0005, VMOD0010:
- remove "reset_from_comex", since this cause doesn't define specific reason.
- add more specific reason "reset_sw_reset", which is set along with removed "reset_from_comex".
---v1->v2:
- Comments pointed out by Ilpo:
- Fix misspelling in commit text.
--- drivers/platform/x86/mlx-platform.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/platform/x86/mlx-platform.c +6 -6
@@ -3556,12 +3556,6 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(2), .mode = 0444, }, - { - .label = "reset_from_comex", - .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, - .mask = GENMASK(7, 0) & ~BIT(4), - .mode = 0444, - }, { .label = "reset_from_asic", .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET,
@@ -3580,6 +3574,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(7), .mode = 0444, }, + { + .label = "reset_sw_reset", + .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(0), + .mode = 0444, + }, { .label = "reset_comex_pwr_fail", .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET,
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 4/16 platform: mellanox: mlx-platform: Modify health and power hotplug action
In reply to Vadim PasternakSet explicitly hotplug event action for health and power signals for L1 switch as "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in order to allow processing of notification callback even I2C parent bus is not specified.
--- drivers/platform/x86/mlx-platform.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/platform/x86/mlx-platform.c +2 -0
@@ -2373,6 +2373,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_pwr_events_items_data[] .reg = MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET, .mask = MLXPLAT_CPLD_PWR_BUTTON_MASK, .hpdev.nr = MLXPLAT_CPLD_NR_NONE, + .hpdev.action = MLXREG_HOTPLUG_DEVICE_NO_ACTION, .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_pwr_events_notifier, }, };
@@ -2433,6 +2434,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_l1_switch_health_events_items_dat .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET, .mask = MLXPLAT_CPLD_INTRUSION_MASK, .hpdev.nr = MLXPLAT_CPLD_NR_NONE, + .hpdev.action = MLXREG_HOTPLUG_DEVICE_NO_ACTION, .hpdev.notifier = &mlxplat_mlxcpld_l1_switch_intrusion_events_notifier, }, {
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 5/16 platform: mellanox: mlx-platform: Add reset cause attribute
In reply to Vadim PasternakExtend IO registers description for some system types with reset cause attribute "reset_swb_dc_dc_pwr_fail" to indicate reset caused by switch board DC-DC power failure.
--- drivers/platform/x86/mlx-platform.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/platform/x86/mlx-platform.c +6 -0
@@ -3558,6 +3558,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mask = GENMASK(7, 0) & ~BIT(2), .mode = 0444, }, + { + .label = "reset_swb_dc_dc_pwr_fail", + .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(3), + .mode = 0444, + }, { .label = "reset_from_asic", .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET,
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 6/16 platform: mellanox: mlx-platform: add support for additional CPLD
In reply to Vadim PasternakExtend to support 5-th CPLD version, PN and minimal version registers.
--- drivers/platform/x86/mlx-platform.c | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
drivers/platform/x86/mlx-platform.c +31 -0
@@ -95,6 +95,9 @@#define MLXPLAT_CPLD_LPC_REG_FAN_OFFSET 0x88#define MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET 0x89#define MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET 0x8a +#define MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET 0x8e +#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET 0x8f +#define MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET 0x90#define MLXPLAT_CPLD_LPC_REG_EROT_OFFSET 0x91#define MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET 0x92#define MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET 0x93
@@ -129,6 +132,7 @@#define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0xb9#define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2#define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3 +#define MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET 0xc4#define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET 0xc7#define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET 0xc8#define MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET 0xc9
@@ -3431,6 +3435,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .bit = GENMASK(7, 0), .mode = 0444, }, + { + .label = "cpld5_version", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET, + .bit = GENMASK(7, 0), + .mode = 0444, + }, { .label = "cpld1_pn", .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET,
@@ -3459,6 +3469,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .mode = 0444, .regnum = 2, }, + { + .label = "cpld5_pn", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET, + .bit = GENMASK(15, 0), + .mode = 0444, + .regnum = 2, + }, { .label = "cpld1_version_min", .reg = MLXPLAT_CPLD_LPC_REG_CPLD1_MVER_OFFSET,
@@ -3483,6 +3500,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { .bit = GENMASK(7, 0), .mode = 0444, }, + { + .label = "cpld5_version_min", + .reg = MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET, + .bit = GENMASK(7, 0), + .mode = 0444, + }, { .label = "asic_reset", .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET,
@@ -5031,6 +5054,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET : +case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET :
@@ -5039,6 +5063,8 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET : +case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET : +case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET :case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET :case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET :case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET :
@@ -5150,6 +5176,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET : +case MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET :case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET :case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET :case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET :
@@ -5191,6 +5218,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_REG_CPLD2_VER_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD3_VER_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD4_VER_OFFSET : +case MLXPLAT_CPLD_LPC_REG_CPLD5_VER_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD1_PN_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD1_PN1_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD2_PN_OFFSET :
@@ -5199,6 +5227,8 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET : +case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET : +case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET :case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET :case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET :case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET :
@@ -5302,6 +5332,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_REG_CPLD2_MVER_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD3_MVER_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD4_MVER_OFFSET : +case MLXPLAT_CPLD_LPC_REG_CPLD5_MVER_OFFSET :case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET :case MLXPLAT_CPLD_LPC_REG_PWM2_OFFSET :case MLXPLAT_CPLD_LPC_REG_PWM3_OFFSET :
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 7/16 platform: mellanox: mlx-platform: Modify power off callback
In reply to Vadim PasternakExtend platform power off callback with kernel_halt() call.
When powering off, the process involves setting a halt bit in the register space, which is then activated after a certain delay and power off auxiliary power. By invoking kernel_halt() within this timeframe, the intention is to facilitate a clean system power-off sequence.
---v1->v2:
- Comments pointed out by Ilpo:
- Amend commit text.
--- drivers/platform/x86/mlx-platform.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/mlx-platform.c +1 -0
@@ -5539,6 +5539,7 @@ static void mlxplat_poweroff(void)struct mlxplat_priv *priv =platform_get_drvdata (mlxplat_dev);regmap_write (priv->regmap,MLXPLAT_CPLD_LPC_REG_GP1_OFFSET ,MLXPLAT_CPLD_HALT_MASK ); +kernel_halt (); }static int __init mlxplat_dmi_default_matched (const struct dmi_system_id *dmi)
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 8/16 platform: mellanox: Cosmetic changes
In reply to Vadim PasternakFix routines and labels names by s/topolgy/topology.
---v1->v2:
- Comments pointed out by Ilpo:
- Fix commit text.
--- drivers/platform/x86/mlx-platform.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/platform/x86/mlx-platform.c +7 -7
@@ -6265,7 +6265,7 @@ mlxplat_i2c_mux_complition_notify(void *handle, struct i2c_adapter *parent,return mlxplat_post_init (priv); } -static int mlxplat_i2c_mux_topolgy_init (struct mlxplat_priv *priv) +static int mlxplat_i2c_mux_topology_init (struct mlxplat_priv *priv) {int i, err;
@@ -6294,7 +6294,7 @@ static int mlxplat_i2c_mux_topolgy_init(struct mlxplat_priv *priv)return err; } -static void mlxplat_i2c_mux_topolgy_exit (struct mlxplat_priv *priv) +static void mlxplat_i2c_mux_topology_exit (struct mlxplat_priv *priv) {int i;
@@ -6308,7 +6308,7 @@ static int mlxplat_i2c_main_complition_notify(void *handle, int id) {struct mlxplat_priv *priv = handle; -return mlxplat_i2c_mux_topolgy_init (priv); +return mlxplat_i2c_mux_topology_init (priv); }static int mlxplat_i2c_main_init (struct mlxplat_priv *priv)
@@ -6336,14 +6336,14 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) }if (priv->i2c_main_init_status ==MLXPLAT_I2C_MAIN_BUS_NOTIFIED ) { - err =mlxplat_i2c_mux_topolgy_init (priv); + err =mlxplat_i2c_mux_topology_init (priv);if (err) - goto fail_mlxplat_i2c_mux_topolgy_init; + goto fail_mlxplat_i2c_mux_topology_init; }return 0 ; -fail_mlxplat_i2c_mux_topolgy_init: +fail_mlxplat_i2c_mux_topology_init: fail_platform_i2c_register: fail_mlxplat_mlxcpld_verify_bus_topology:return err;
@@ -6351,7 +6351,7 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv)static void mlxplat_i2c_main_exit (struct mlxplat_priv *priv) { -mlxplat_i2c_mux_topolgy_exit (priv); +mlxplat_i2c_mux_topology_exit (priv);if (priv->pdev_i2c)platform_device_unregister (priv->pdev_i2c); }
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 9/16 platform: mellanox: mlx-platform: Add reset callback
In reply to Vadim PasternakOn L1 switches reset should include special actions against CPLD device for performing graceful operations.
For that purpose, special PLATFORM_RESET# signal should be indicated.
---v1->v2:
- Comments pointed out by Ilpo:
- Use GENMASK() for MLXPLAT_CPLD_RESET_MASK define.
- Use a named define instead of BIT(0).
--- drivers/platform/x86/mlx-platform.c | 46 +++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-)
drivers/platform/x86/mlx-platform.c +44 -2
@@ -35,6 +35,7 @@#define MLXPLAT_CPLD_LPC_REG_CPLD3_PN1_OFFSET 0x09#define MLXPLAT_CPLD_LPC_REG_CPLD4_PN_OFFSET 0x0a#define MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET 0x0b +#define MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET 0x17#define MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET 0x19#define MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET 0x1c#define MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET 0x1d
@@ -254,6 +255,7 @@ MLXPLAT_CPLD_PWM_PG_MASK)#define MLXPLAT_CPLD_I2C_CAP_BIT 0x04#define MLXPLAT_CPLD_I2C_CAP_MASK GENMASK(5, MLXPLAT_CPLD_I2C_CAP_BIT) +#define MLXPLAT_CPLD_SYS_RESET_MASK BIT(0)/* Masks for aggregation for comex carriers */ #define MLXPLAT_CPLD_AGGR_MASK_CARRIER BIT(1)
@@ -265,6 +267,7 @@#define MLXPLAT_CPLD_LPC_LC_MASK GENMASK(7, 0)#define MLXPLAT_CPLD_HALT_MASK BIT(3) +#define MLXPLAT_CPLD_RESET_MASK GENMASK(7, 1)/* Default I2C parent bus number */ #define MLXPLAT_CPLD_PHYS_ADAPTER_DEF_NR 1
@@ -441,6 +444,7 @@ static struct i2c_mux_reg_platform_data mlxplat_default_mux_data[] = {static int mlxplat_max_adap_num;static int mlxplat_mux_num;static struct i2c_mux_reg_platform_data *mlxplat_mux_data; +static struct notifier_block *mlxplat_reboot_nb;/* Platform extended mux data */ static struct i2c_mux_reg_platform_data mlxplat_extended_mux_data[] = {
@@ -2361,8 +2365,11 @@ static int mlxplat_mlxcpld_l1_switch_pwr_events_handler(void *handle, enum mlxreg_hotplug_kind kind, u8 action) { -dev_info (&mlxplat_dev->dev,"System shutdown due to short press of power button" ); -kernel_power_off (); +if (action) { +dev_info (&mlxplat_dev->dev,"System shutdown due to short press of power button" ); +kernel_power_off (); + } +return 0 ; }
@@ -4957,6 +4964,7 @@ static struct mlxreg_core_platform_data mlxplat_mlxcpld_wd_set_type3[] = {static bool mlxplat_mlxcpld_writeable_reg (struct device *dev,unsigned int reg) {switch (reg) { +case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET :case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET :case MLXPLAT_CPLD_LPC_REG_LED1_OFFSET :case MLXPLAT_CPLD_LPC_REG_LED2_OFFSET :
@@ -5065,6 +5073,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET : +case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET :case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET :case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET :case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET :
@@ -5229,6 +5238,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg)case MLXPLAT_CPLD_LPC_REG_CPLD4_PN1_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD5_PN_OFFSET :case MLXPLAT_CPLD_LPC_REG_CPLD5_PN1_OFFSET : +case MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET :case MLXPLAT_CPLD_LPC_REG_RESET_GP4_OFFSET :case MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET :case MLXPLAT_CPLD_LPC_REG_RST_CAUSE1_OFFSET :
@@ -5533,11 +5543,33 @@ static struct mlxreg_core_platform_data *mlxplat_wd_data[MLXPLAT_CPLD_WD_MAX_DEVS ];static const struct regmap_config *mlxplat_regmap_config; +/* Platform default reset function */ +static int mlxplat_reboot_notifier (struct notifier_block *nb,unsigned long action,void *unused) +{ +struct mlxplat_priv *priv =platform_get_drvdata (mlxplat_dev); +u32 regval; +int ret; + + ret =regmap_read (priv->regmap,MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET , ®val); + +if (action ==SYS_RESTART && !ret && regval &MLXPLAT_CPLD_SYS_RESET_MASK ) +regmap_write (priv->regmap,MLXPLAT_CPLD_LPC_REG_RESET_GP1_OFFSET , +MLXPLAT_CPLD_RESET_MASK ); + +return NOTIFY_DONE ; +} + +static struct notifier_block mlxplat_reboot_default_nb = { + .notifier_call = mlxplat_reboot_notifier, +}; +/* Platform default poweroff function */ static void mlxplat_poweroff (void ) {struct mlxplat_priv *priv =platform_get_drvdata (mlxplat_dev); +if (mlxplat_reboot_nb) +unregister_reboot_notifier (mlxplat_reboot_nb);regmap_write (priv->regmap,MLXPLAT_CPLD_LPC_REG_GP1_OFFSET ,MLXPLAT_CPLD_HALT_MASK );kernel_halt (); }
@@ -5861,6 +5893,7 @@ static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_rack_switch; pm_power_off = mlxplat_poweroff; + mlxplat_reboot_nb = &mlxplat_reboot_default_nb;return 1 ; }
@@ -6410,8 +6443,15 @@ static int __init mlxplat_init(void)if (err) goto fail_regcache_sync; +if (mlxplat_reboot_nb) { + err =register_reboot_notifier (mlxplat_reboot_nb); +if (err) + goto fail_register_reboot_notifier; + } +return 0 ; +fail_register_reboot_notifier: fail_regcache_sync:mlxplat_pre_exit (priv); fail_mlxplat_i2c_main_init:
@@ -6429,6 +6469,8 @@ static void __exit mlxplat_exit(void)if (pm_power_off) pm_power_off =NULL ; +if (mlxplat_reboot_nb) +unregister_reboot_notifier (mlxplat_reboot_nb);mlxplat_pre_exit (priv);mlxplat_i2c_main_exit (priv);mlxplat_post_exit ();
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 10/16 platform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infrastructure
In reply to Vadim PasternakCurrently driver is activated through DMI hooks. Prepare driver to allow activation also through ACPI trigger.
Modify mlxplat_init()/mlxplat_exit() routines.
Add mlxplat_probe()/mlxplat_remove() routines and "mlxplat_driver" structure.
--- drivers/platform/x86/mlx-platform.c | 91 +++++++++++++++++++---------- 1 file changed, 61 insertions(+), 30 deletions(-)
drivers/platform/x86/mlx-platform.c +61 -30
@@ -5574,6 +5574,17 @@ static void mlxplat_poweroff(void)kernel_halt (); } +static int __init mlxplat_register_platform_device (void ) +{ + mlxplat_dev =platform_device_register_simple (MLX_PLAT_DEVICE_NAME ,-1 , + mlxplat_lpc_resources, +ARRAY_SIZE (mlxplat_lpc_resources)); +if (IS_ERR (mlxplat_dev)) +return PTR_ERR (mlxplat_dev); +else +return 1 ; +} +static int __init mlxplat_dmi_default_matched (const struct dmi_system_id *dmi) {int i;
@@ -5594,7 +5605,7 @@ static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0 ] = &mlxplat_mlxcpld_wd_set_type1[0 ]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_default_wc_matched (const struct dmi_system_id *dmi)
@@ -5617,7 +5628,7 @@ static int __init mlxplat_dmi_default_wc_matched(const struct dmi_system_id *dmi mlxplat_wd_data[0 ] = &mlxplat_mlxcpld_wd_set_type1[0 ]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_default_eth_wc_blade_matched (const struct dmi_system_id *dmi)
@@ -5642,7 +5653,7 @@ static int __init mlxplat_dmi_default_eth_wc_blade_matched(const struct dmi_syst mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_msn21xx_matched (const struct dmi_system_id *dmi)
@@ -5665,7 +5676,7 @@ static int __init mlxplat_dmi_msn21xx_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0 ] = &mlxplat_mlxcpld_wd_set_type1[0 ]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_msn274x_matched (const struct dmi_system_id *dmi)
@@ -5688,7 +5699,7 @@ static int __init mlxplat_dmi_msn274x_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0 ] = &mlxplat_mlxcpld_wd_set_type1[0 ]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_msn201x_matched (const struct dmi_system_id *dmi)
@@ -5711,7 +5722,7 @@ static int __init mlxplat_dmi_msn201x_matched(const struct dmi_system_id *dmi) mlxplat_wd_data[0 ] = &mlxplat_mlxcpld_wd_set_type1[0 ]; mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_qmb7xx_matched (const struct dmi_system_id *dmi)
@@ -5737,7 +5748,7 @@ static int __init mlxplat_dmi_qmb7xx_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_comex_matched (const struct dmi_system_id *dmi)
@@ -5762,7 +5773,7 @@ static int __init mlxplat_dmi_comex_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_default_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_comex; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_ng400_matched (const struct dmi_system_id *dmi)
@@ -5788,7 +5799,7 @@ static int __init mlxplat_dmi_ng400_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_modular_matched (const struct dmi_system_id *dmi)
@@ -5808,7 +5819,7 @@ static int __init mlxplat_dmi_modular_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_eth_modular; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_chassis_blade_matched (const struct dmi_system_id *dmi)
@@ -5830,7 +5841,7 @@ static int __init mlxplat_dmi_chassis_blade_matched(const struct dmi_system_id * mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_rack_switch_matched (const struct dmi_system_id *dmi)
@@ -5851,7 +5862,7 @@ static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dm mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_rack_switch; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_ng800_matched (const struct dmi_system_id *dmi)
@@ -5872,7 +5883,7 @@ static int __init mlxplat_dmi_ng800_matched(const struct dmi_system_id *dmi) mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; -return 1 ; +return mlxplat_register_platform_device (); }static int __init mlxplat_dmi_l1_switch_matched (const struct dmi_system_id *dmi)
@@ -5895,7 +5906,7 @@ static int __init mlxplat_dmi_l1_switch_matched(const struct dmi_system_id *dmi) pm_power_off = mlxplat_poweroff; mlxplat_reboot_nb = &mlxplat_reboot_default_nb; -return 1 ; +return mlxplat_register_platform_device (); }static const struct dmi_system_id mlxplat_dmi_table[]__initconst = {
@@ -6139,12 +6150,6 @@ static int mlxplat_lpc_cpld_device_init(struct resource **hotplug_resources, {int err; - mlxplat_dev =platform_device_register_simple (MLX_PLAT_DEVICE_NAME ,PLATFORM_DEVID_NONE , - mlxplat_lpc_resources, -ARRAY_SIZE (mlxplat_lpc_resources)); -if (IS_ERR (mlxplat_dev)) -return PTR_ERR (mlxplat_dev); - mlxplat_mlxcpld_regmap_ctx.base =devm_ioport_map (&mlxplat_dev->dev, mlxplat_lpc_resources[1 ].start,1 );if (!mlxplat_mlxcpld_regmap_ctx.base) {
@@ -6158,13 +6163,11 @@ static int mlxplat_lpc_cpld_device_init(struct resource **hotplug_resources,return 0 ; fail_devm_ioport_map: -platform_device_unregister (mlxplat_dev);return err; }static void mlxplat_lpc_cpld_device_exit (void ) { -platform_device_unregister (mlxplat_dev); } static int
@@ -6389,16 +6392,13 @@ static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv)platform_device_unregister (priv->pdev_i2c); } -static int __init mlxplat_init (void ) +static int mlxplat_probe (struct platform_device *pdev) { -unsigned int hotplug_resources_size; -struct resource *hotplug_resources; +unsigned int hotplug_resources_size =0 ; +struct resource *hotplug_resources =NULL ;struct mlxplat_priv *priv;int i, err; -if (!dmi_check_system (mlxplat_dmi_table)) -return -ENODEV ; - err =mlxplat_pre_init (&hotplug_resources, &hotplug_resources_size);if (err)return err;
@@ -6461,9 +6461,8 @@ static int __init mlxplat_init(void)return err; } -module_init (mlxplat_init); -static void __exit mlxplat_exit(void) +static int mlxplat_remove (struct platform_device *pdev) {struct mlxplat_priv *priv =platform_get_drvdata (mlxplat_dev);
@@ -6474,6 +6473,38 @@ static void __exit mlxplat_exit(void)mlxplat_pre_exit (priv);mlxplat_i2c_main_exit (priv);mlxplat_post_exit (); +return 0 ; +} + +static struct platform_driver mlxplat_driver = { + .driver = { + .name ="mlxplat" , + .probe_type =PROBE_FORCE_SYNCHRONOUS , + }, + .probe = mlxplat_probe, + .remove = mlxplat_remove, +}; + +static int __init mlxplat_init (void ) +{ +int err; + +if (!dmi_check_system (mlxplat_dmi_table)) +return -ENODEV ; + + err =platform_driver_register (&mlxplat_driver); +if (err) +return err; +return 0 ; +} +module_init (mlxplat_init); + +static void __exit mlxplat_exit(void) +{ +if (mlxplat_dev) +platform_device_unregister (mlxplat_dev); + +platform_driver_unregister (&mlxplat_driver); }module_exit (mlxplat_exit);
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 11/16 platform: mellanox: mlx-platform: Introduce ACPI init flow
In reply to Vadim PasternakIntroduce support for ACPI initialization flow - add ACPI match hook.
---v1->v2:
- Comments pointed out by Ilpo:
- Squash few lines from the next patch to this one to have less churn in next.
--- drivers/platform/x86/mlx-platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/platform/x86/mlx-platform.c +12 -0
@@ -6396,9 +6396,14 @@ static int mlxplat_probe(struct platform_device *pdev) {unsigned int hotplug_resources_size =0 ;struct resource *hotplug_resources =NULL ; +struct acpi_device *acpi_dev;struct mlxplat_priv *priv;int i, err; + acpi_dev =ACPI_COMPANION (&pdev->dev); +if (acpi_dev) + mlxplat_dev = pdev; + err =mlxplat_pre_init (&hotplug_resources, &hotplug_resources_size);if (err)return err;
@@ -6476,9 +6481,16 @@ static int mlxplat_remove(struct platform_device *pdev)return 0 ; } +static const struct acpi_device_id mlxplat_acpi_table[] = { + {"MLNXBF49" ,0 }, + {} +}; +MODULE_DEVICE_TABLE (acpi, mlxplat_acpi_table); +static struct platform_driver mlxplat_driver = { .driver = { .name ="mlxplat" , + .acpi_match_table =ACPI_PTR (mlxplat_acpi_table), .probe_type =PROBE_FORCE_SYNCHRONOUS , }, .probe = mlxplat_probe,
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 12/16 platform: mellanox: mlx-platform: Get interrupt line through ACPI
In reply to Vadim PasternakAdd support for getting system interrupt line from ACPI table.
---v1->v2:
- Comments pointed out by Ilpo:
- Remove ' acpi_dev ' declaration, move it to the previous patch.
--- drivers/platform/x86/mlx-platform.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/platform/x86/mlx-platform.c +11 -2
@@ -343,6 +343,7 @@* @hotplug_resources: system hotplug resources * @hotplug_resources_size: size of system hotplug resources * @hi2c_main_init_status: init status of I2C main bus +* @irq_fpga: FPGA IRQ number */ struct mlxplat_priv {struct platform_device *pdev_i2c;
@@ -356,6 +357,7 @@ struct mlxplat_priv {struct resource *hotplug_resources;unsigned int hotplug_resources_size;u8 i2c_main_init_status; +int irq_fpga; };static struct platform_device *mlxplat_dev;
@@ -6188,6 +6190,8 @@ static int mlxplat_post_init(struct mlxplat_priv *priv)/* Add hotplug driver */ if (mlxplat_hotplug) { mlxplat_hotplug->regmap = priv->regmap; +if (priv->irq_fpga) + mlxplat_hotplug->irq = priv->irq_fpga; priv->pdev_hotplug = platform_device_register_resndata(&mlxplat_dev->dev, "mlxreg-hotplug", PLATFORM_DEVID_NONE,
@@ -6398,11 +6402,15 @@ static int mlxplat_probe(struct platform_device *pdev)struct resource *hotplug_resources =NULL ;struct acpi_device *acpi_dev;struct mlxplat_priv *priv; -int i, err; +int irq_fpga =0 , i, err; acpi_dev =ACPI_COMPANION (&pdev->dev); -if (acpi_dev) +if (acpi_dev) { + irq_fpga =acpi_dev_gpio_irq_get (acpi_dev,0 ); +if (irq_fpga <0 ) +return -ENODEV ; mlxplat_dev = pdev; + } err =mlxplat_pre_init (&hotplug_resources, &hotplug_resources_size);if (err)
@@ -6417,6 +6425,7 @@ static int mlxplat_probe(struct platform_device *pdev)platform_set_drvdata (mlxplat_dev, priv); priv->hotplug_resources = hotplug_resources; priv->hotplug_resources_size = hotplug_resources_size; + priv->irq_fpga = irq_fpga;if (!mlxplat_regmap_config) mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config;
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 13/16 platform: mellanox: Add initial support for PCIe based programming logic device
In reply to Vadim PasternakExtend driver to support logic implemented by FPGA device connected through PCIe bus.
The motivation two support new generation of Nvidia COME module equipped with Lattice LFD2NX-40 FPGA device.
In order to support new Nvidia COME module FPGA device driver initialization flow is modified. In case FPGA device is detected, system resources are to be mapped to this device, otherwise system resources are to be mapped same as it has been done before for Lattice LPC based CPLD.
FPGA device is associated with three PCIe devices:
- PCIe-LPC bridge for main register space access.
- PCIe-I2C bridge for I2C controller access.
- PCIe-JTAG bridge for JTAG access.
---
- Comments pointed out by Ilpo:
- Suggested to use common label name in mlxplat_pci_fpga_device_init() to avoid labels duplication.
- Vadim: I would prefer to follow the convention we are keeping in the driver to have consistent code.
--- drivers/platform/x86/mlx-platform.c | 134 +++++++++++++++++++++++++++- 1 file changed, 132 insertions(+), 2 deletions(-)
drivers/platform/x86/mlx-platform.c +132 -2
@@ -12,6 +12,7 @@#include <linux/i2c-mux.h> #include <linux/io.h> #include <linux/module.h> +#include <linux/pci.h> #include <linux/platform_device.h> #include <linux/platform_data/i2c-mux-reg.h> #include <linux/platform_data/mlxreg.h>
@@ -331,6 +332,12 @@#define MLXPLAT_I2C_MAIN_BUS_NOTIFIED 0x01#define MLXPLAT_I2C_MAIN_BUS_HANDLE_CREATED 0x02 +/* Lattice FPGA PCI configuration */ +#define PCI_VENDOR_ID_LATTICE 0x1204 +#define PCI_DEVICE_ID_LATTICE_I2C_BRIDGE 0x9c2f +#define PCI_DEVICE_ID_LATTICE_JTAG_BRIDGE 0x9c30 +#define PCI_DEVICE_ID_LATTICE_LPC_BRIDGE 0x9c32 +/* mlxplat_priv - platform private data * @pdev_i2c - i2c controller platform device * @pdev_mux - array of mux platform devices
@@ -362,6 +369,7 @@ struct mlxplat_priv {static struct platform_device *mlxplat_dev;static int mlxplat_i2c_main_complition_notify (void *handle,int id); +static void __iomem *i2c_bridge_addr, *jtag_bridge_addr;/* Regions for LPC I2C controller and LPC base register space */ static const struct resource mlxplat_lpc_resources[] = {
@@ -5544,6 +5552,9 @@ static struct mlxreg_core_platform_data *mlxplat_fan;static struct mlxreg_core_platform_data *mlxplat_wd_data[MLXPLAT_CPLD_WD_MAX_DEVS ];static const struct regmap_config *mlxplat_regmap_config; +static struct pci_dev *lpc_bridge; +static struct pci_dev *i2c_bridge; +static struct pci_dev *jtag_bridge;/* Platform default reset function */ static int mlxplat_reboot_notifier (struct notifier_block *nb,unsigned long action,void *unused)
@@ -6172,15 +6183,131 @@ static void mlxplat_lpc_cpld_device_exit(void) { } +static int +mlxplat_pci_fpga_device_init (unsigned int device,const char *res_name,struct pci_dev **pci_bridge, +void __iomem **pci_bridge_addr) +{ +void __iomem *pci_mem_addr; +struct pci_dev *pci_dev; +int err; + + pci_dev =pci_get_device (PCI_VENDOR_ID_LATTICE , device,NULL ); +if (!pci_dev) +return -ENODEV ; + + err =pci_enable_device (pci_dev); +if (err) { +dev_err (&pci_dev->dev,"pci_enable_device failed with error %d\n" , err); + goto fail_pci_enable_device; + } + + err =pci_request_region (pci_dev,0 , res_name); +if (err) { +dev_err (&pci_dev->dev,"pci_request_regions failed with error %d\n" , err); + goto fail_pci_request_regions; + } + + err =dma_set_mask_and_coherent (&pci_dev->dev,DMA_BIT_MASK (64 )); +if (err) { + err =dma_set_mask (&pci_dev->dev,DMA_BIT_MASK (32 )); +if (err) { +dev_err (&pci_dev->dev,"dma_set_mask failed with error %d\n" , err); + goto fail_pci_set_dma_mask; + } + } + +pci_set_master (pci_dev); + + pci_mem_addr =devm_ioremap (&pci_dev->dev,pci_resource_start (pci_dev,0 ), +pci_resource_len (pci_dev,0 )); +if (!pci_mem_addr) { +dev_err (&mlxplat_dev->dev,"ioremap failed\n" ); + err = -EIO ; + goto fail_ioremap; + } + + *pci_bridge = pci_dev; + *pci_bridge_addr = pci_mem_addr; + +return 0 ; + +fail_ioremap: +fail_pci_set_dma_mask: +pci_release_regions (pci_dev); +fail_pci_request_regions: +pci_disable_device (pci_dev); +fail_pci_enable_device: +return err; +} + +static void +mlxplat_pci_fpga_device_exit (struct pci_dev *pci_bridge, +void __iomem *pci_bridge_addr) +{ +iounmap (pci_bridge_addr); +pci_release_regions (pci_bridge); +pci_disable_device (pci_bridge); +} + +static int +mlxplat_pci_fpga_devices_init (struct resource **hotplug_resources, +unsigned int *hotplug_resources_size) +{ +int err; + + err =mlxplat_pci_fpga_device_init (PCI_DEVICE_ID_LATTICE_LPC_BRIDGE , +"mlxplat_lpc_bridge" , &lpc_bridge, + &mlxplat_mlxcpld_regmap_ctx.base); +if (err) + goto mlxplat_pci_fpga_device_init_lpc_fail; + + err =mlxplat_pci_fpga_device_init (PCI_DEVICE_ID_LATTICE_I2C_BRIDGE , +"mlxplat_i2c_bridge" , &i2c_bridge, + &i2c_bridge_addr); +if (err) + goto mlxplat_pci_fpga_device_init_i2c_fail; + + err =mlxplat_pci_fpga_device_init (PCI_DEVICE_ID_LATTICE_JTAG_BRIDGE , +"mlxplat_jtag_bridge" , &jtag_bridge, + &jtag_bridge_addr); +if (err) + goto mlxplat_pci_fpga_device_init_jtag_fail; + +return 0 ; + +mlxplat_pci_fpga_device_init_jtag_fail: +mlxplat_pci_fpga_device_exit (i2c_bridge, i2c_bridge_addr); +mlxplat_pci_fpga_device_init_i2c_fail: +mlxplat_pci_fpga_device_exit (lpc_bridge, mlxplat_mlxcpld_regmap_ctx.base); +mlxplat_pci_fpga_device_init_lpc_fail: +return err; +} + +static void mlxplat_pci_fpga_devices_exit (void ) +{ +mlxplat_pci_fpga_device_exit (jtag_bridge, jtag_bridge_addr); +mlxplat_pci_fpga_device_exit (i2c_bridge, i2c_bridge_addr); +mlxplat_pci_fpga_device_exit (lpc_bridge, mlxplat_mlxcpld_regmap_ctx.base); +} +static int mlxplat_pre_init (struct resource **hotplug_resources,unsigned int *hotplug_resources_size) { -return mlxplat_lpc_cpld_device_init (hotplug_resources, hotplug_resources_size); +int err; + + err =mlxplat_pci_fpga_devices_init (hotplug_resources, hotplug_resources_size); +if (err == -ENODEV ) +return mlxplat_lpc_cpld_device_init (hotplug_resources, hotplug_resources_size); + +return err; }static void mlxplat_post_exit (void ) { -mlxplat_lpc_cpld_device_exit (); +if (lpc_bridge) +mlxplat_pci_fpga_devices_exit (); +else +mlxplat_lpc_cpld_device_exit (); }static int mlxplat_post_init (struct mlxplat_priv *priv)
@@ -6366,6 +6493,9 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) mlxplat_i2c->regmap = priv->regmap; mlxplat_i2c->handle = priv; +/* Set mapped base address of I2C-LPC bridge over PCIe */ +if (lpc_bridge) + mlxplat_i2c->addr = i2c_bridge_addr; priv->pdev_i2c = platform_device_register_resndata(&mlxplat_dev->dev, "i2c_mlxcpld", nr, priv->hotplug_resources, priv->hotplug_resources_size,
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 14/16 platform/mellanox: mlxreg-hotplug: Extend condition for notification callback processing
In reply to Vadim PasternakAllow processing of notification callback in routine mlxreg_hotplug_device_create() in case hotplug object is configured with action "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in case no I2C parent bus is specified.
--- drivers/platform/mellanox/mlxreg-hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/mellanox/mlxreg-hotplug.c +1 -1
@@ -112,7 +112,7 @@ static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv,* Return if adapter number is negative. It could be in case hotplug * event is not associated with hotplug device. */ -if (data->hpdev.nr <0 ) +if (data->hpdev.nr <0 && data->hpdev.action !=MLXREG_HOTPLUG_DEVICE_NO_ACTION )return 0 ; pdata =dev_get_platdata (&priv->pdev->dev);
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 15/16 platform: mellanox: nvsw-sn2201: change fans i2c busses.
In reply to Vadim PasternakFrom: Michael Shych <[email protected]>
Define the exact i2c bus (adapter number) of fans on the SN2201 system. This will cause fan's EEPROMs be connected already from nvsw-sn2201 platform driver and not from user space after receiving udev events.
--- drivers/platform/mellanox/nvsw-sn2201.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/platform/mellanox/nvsw-sn2201.c +8 -4
@@ -84,6 +84,10 @@#define NVSW_SN2201_MAIN_MUX_CH5_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 5)#define NVSW_SN2201_MAIN_MUX_CH6_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 6)#define NVSW_SN2201_MAIN_MUX_CH7_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 7) +#define NVSW_SN2201_2ND_MUX_CH0_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 1) +#define NVSW_SN2201_2ND_MUX_CH1_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 2) +#define NVSW_SN2201_2ND_MUX_CH2_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 3) +#define NVSW_SN2201_2ND_MUX_CH3_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 4)#define NVSW_SN2201_CPLD_NR NVSW_SN2201_MAIN_MUX_CH0_NR#define NVSW_SN2201_NR_NONE -1
@@ -425,28 +429,28 @@ static struct mlxreg_core_data nvsw_sn2201_fan_items_data[] = { .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(0), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[0], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH0_NR, }, { .label = "fan2", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(1), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[1], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH1_NR, }, { .label = "fan3", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(2), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[2], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH2_NR, }, { .label = "fan4", .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, .mask = BIT(3), .hpdev.brdinfo = &nvsw_sn2201_fan_devices[3], - .hpdev.nr = NVSW_SN2201_NR_NONE, + .hpdev.nr = NVSW_SN2201_2ND_MUX_CH3_NR, }, };
Signature · 1 line
2.20.1
Vadim Pasternak
maintainerPATCH v4 16/16 Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces
In reply to Vadim PasternakAdd documentation for the new attributes:
- CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min".
- JTAG capability: "jtag_cap", indicating the available method of CPLD/FPGA devices field update.
- System lid status: "lid_open".
- Reset caused by long press of power button: "reset_long_pwr_pb".
- Reset caused by switch board DC-DC converter device failure:
"reset_swb_dc_dc_pwr_fail".
---v3->v4:
Comments provided by Ilpo:
- Modify desription for "reset_swb_dc_dc_pwr_fail".v2->v3:
Comments provided by Hans:
- Document new attribute "reset_swb_dc_dc_pwr_fail".
--- .../ABI/stable/sysfs-driver-mlxreg-io | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+)
Documentation/ABI/stable/sysfs-driver-mlxreg-io +52 -0
@@ -662,3 +662,55 @@ Description: This file shows the system reset cause due to AC power failure. Value 1 in file means this is reset cause, 0 - otherwise. The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: These files show with which CPLD part numbers, version and minor + versions have been burned the 5-th CPLD device equipped on a + system. + + The files are read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file indicates the available method of CPLD/FPGA devices + field update through the JTAG chain: + b00 - field update through LPC bus register memory space. + b01 - Reserved. + b10 - Reserved. + b11 - field update through CPU GPIOs bit-banging. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: 1 - indicates that system lid is opened, otherwise 0. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file if set 1 indicates that system has been reset by + long press of power button. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file shows 1 in case the system reset happened due to the + failure of any DC-DC power converter devices equipped on the + switch board. + + The file is read only.
Signature · 1 line
2.20.1
Re: [PATCH platform-next v4 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces
Quoted 73 lines · Vadim Pasternak
Add documentation for the new attributes:
- CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min".
- JTAG capability: "jtag_cap", indicating the available method of CPLD/FPGA devices field update.
- System lid status: "lid_open".
- Reset caused by long press of power button: "reset_long_pwr_pb".
- Reset caused by switch board DC-DC converter device failure:
"reset_swb_dc_dc_pwr_fail".Signed-off-by Vadim Pasternak <[email protected]>Reviewed-by Michael Shych <[email protected]>Reviewed-by Hans de Goede <[email protected]>---
v3->v4:
Comments provided by Ilpo:
- Modify desription for "reset_swb_dc_dc_pwr_fail".v2->v3:
Comments provided by Hans:
- Document new attribute "reset_swb_dc_dc_pwr_fail".--- .../ABI/stable/sysfs-driver-mlxreg-io | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+)Documentation/ABI/stable/sysfs-driver-mlxreg-io +42
-0@@ -662,3 +662,55 @@ Description: This file shows the system reset cause due to AC power failure. Value 1 in file means this is reset cause, 0 - otherwise. The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: These files show with which CPLD part numbers, version and minor + versions have been burned the 5-th CPLD device equipped on a + system. + + The files are read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file indicates the available method of CPLD/FPGA devices + field update through the JTAG chain: + b00 - field update through LPC bus register memory space. + b01 - Reserved. + b10 - Reserved. + b11 - field update through CPU GPIOs bit-banging. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: 1 - indicates that system lid is opened, otherwise 0. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file if set 1 indicates that system has been reset by + long press of power button. + + The file is read only.
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure. · line 716
Quoted 10 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +10
-0+ +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file shows 1 in case the system reset happened due to the + failure of any DC-DC power converter devices equipped on the + switch board. + + The file is read only.
Thanks a lot, much clearer wording now.
Signature · 1 line
i.
Vadim Pasternak
maintainerRE: [PATCH platform-next v4 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces
Quoted 106 lines
-----Original Message-----
From: Ilpo Järvinen <[email protected]>
Sent: Tuesday, 22 August 2023 14:44
To: Vadim Pasternak <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH platform-next v4 16/16]Documentation/ABI: Add new attribute for mlxreg-io sysfs interfacesQuoted 19 lines · Vadim Pasternak
Add documentation for the new attributes:
- CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min".
- JTAG capability: "jtag_cap", indicating the available method of CPLD/FPGA devices field update.
- System lid status: "lid_open".
- Reset caused by long press of power button: "reset_long_pwr_pb".
- Reset caused by switch board DC-DC converter device failure:
"reset_swb_dc_dc_pwr_fail".Signed-off-by Vadim Pasternak <[email protected]>Reviewed-by Michael Shych <[email protected]>Reviewed-by Hans de Goede <[email protected]>---
v3->v4:
Comments provided by Ilpo:
- Modify desription for "reset_swb_dc_dc_pwr_fail".v2->v3:
Comments provided by Hans:
- Document new attribute "reset_swb_dc_dc_pwr_fail".Review
Quoted 5 lines
--- .../ABI/stable/sysfs-driver-mlxreg-io | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+)(quoted diff) +0
-0b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause
Quoted 4 lines
index 60953903d007..115302236627 100644
Documentation/ABI/stable/sysfs-driver-mlxreg-io +0
-0@@ -662,3 +662,55 @@ Description: This file shows the system reset causedue to AC power failure.
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure.
Quoted 5 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +2
-0Value 1 in file means this is reset cause, 0 - otherwise. The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause · line 667
Quoted 1 line
Documentation/ABI/stable/sysfs-driver-mlxreg-io +1
-0+What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause · line 668
Quoted 1 line
Documentation/ABI/stable/sysfs-driver-mlxreg-io +1
-0+What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure.
Quoted 4 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +4
-0+Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: These files show with which CPLD part numbers, version andminor
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause · line 673
Quoted 1 line
Documentation/ABI/stable/sysfs-driver-mlxreg-io +1
-0+ versions have been burned the 5-th CPLD device equipped ona
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure.
Quoted 5 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +5
-0+ system. + + The files are read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure.
Quoted 4 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +4
-0+Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file indicates the available method of CPLD/FPGAdevices
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure.
Quoted 9 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +9
-0+ field update through the JTAG chain: + b00 - field update through LPC bus register memory space. + b01 - Reserved. + b10 - Reserved. + b11 - field update through CPU GPIOs bit-banging. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure.
Quoted 8 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +8
-0+Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: 1 - indicates that system lid is opened, otherwise 0. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure.
Quoted 9 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +9
-0+Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file if set 1 indicates that system has been reset by + long press of power button. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure.
Quoted 4 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +4
-0+Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file shows 1 in case the system reset happened due tothe
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause · line 713
Quoted 1 line
Documentation/ABI/stable/sysfs-driver-mlxreg-io +1
-0+ failure of any DC-DC power converter devices equipped onthe
Quoted 7 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure. · line 716
Quoted 3 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +3
-0+ switch board. + + The file is read only.Thanks a lot, much clearer wording now.
Reviewed-by Ilpo Järvinen <[email protected]>
Thank you very much Ilpo for all your reviews!
Quoted 3 lines
--
i.
Re: [PATCH platform-next v4 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces
In reply to Ilpo JärvinenHi,
Quoted 11 lines · Ilpo Järvinen
Quoted 9 lines · Vadim Pasternak
Add documentation for the new attributes:
- CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min".
- JTAG capability: "jtag_cap", indicating the available method of CPLD/FPGA devices field update.
- System lid status: "lid_open".
- Reset caused by long press of power button: "reset_long_pwr_pb".
- Reset caused by switch board DC-DC converter device failure:
"reset_swb_dc_dc_pwr_fail".
Quoted 7 lines
Quoted 7 lines
Signed-off-by Vadim Pasternak <[email protected]>Reviewed-by Michael Shych <[email protected]>Reviewed-by Hans de Goede <[email protected]>---
v3->v4:
Comments provided by Ilpo:
- Modify desription for "reset_swb_dc_dc_pwr_fail".
Thank you for your patch-series, I've applied the series to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.
Regards,
Hans
Quoted 72 lines
Quoted 57 lines
v2->v3:
Comments provided by Hans:
- Document new attribute "reset_swb_dc_dc_pwr_fail".--- .../ABI/stable/sysfs-driver-mlxreg-io | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+)Documentation/ABI/stable/sysfs-driver-mlxreg-io +42
-0@@ -662,3 +662,55 @@ Description: This file shows the system reset cause due to AC power failure. Value 1 in file means this is reset cause, 0 - otherwise. The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: These files show with which CPLD part numbers, version and minor + versions have been burned the 5-th CPLD device equipped on a + system. + + The files are read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file indicates the available method of CPLD/FPGA devices + field update through the JTAG chain: + b00 - field update through LPC bus register memory space. + b01 - Reserved. + b10 - Reserved. + b11 - field update through CPU GPIOs bit-banging. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: 1 - indicates that system lid is opened, otherwise 0. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file if set 1 indicates that system has been reset by + long press of power button. + + The file is read only.Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure. · line 716
Quoted 10 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +10
-0+ +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file shows 1 in case the system reset happened due to the + failure of any DC-DC power converter devices equipped on the + switch board. + + The file is read only.Thanks a lot, much clearer wording now.
Reviewed-by Ilpo Järvinen <[email protected]>
Re: [PATCH platform-next v4 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces
Hi,
Quoted 26 lines · Hans de Goede
Hi,
Quoted 11 lines · Ilpo Järvinen
Quoted 9 lines · Vadim Pasternak
Add documentation for the new attributes:
- CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min".
- JTAG capability: "jtag_cap", indicating the available method of CPLD/FPGA devices field update.
- System lid status: "lid_open".
- Reset caused by long press of power button: "reset_long_pwr_pb".
- Reset caused by switch board DC-DC converter device failure:
"reset_swb_dc_dc_pwr_fail".Quoted 7 lines
Quoted 7 lines
Signed-off-by Vadim Pasternak <[email protected]>Reviewed-by Michael Shych <[email protected]>Reviewed-by Hans de Goede <[email protected]>---
v3->v4:
Comments provided by Ilpo:
- Modify desription for "reset_swb_dc_dc_pwr_fail".Thank you for your patch-series, I've applied the series to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Quoted 7 lines
Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.
Quick follow up I've squashed in a few whitespace changes into this (16/16) patch to fix a new "make htmldocs" warning:
/home/hans/projects/platform-drivers-x86/Documentation/ABI/stable/sysfs-driver-mlxreg-io:679: ERROR: Unexpected indentation.
Regards,
Hans
Quoted 78 lines
Regards,
Hans
Quoted 72 lines
Quoted 57 lines
v2->v3:
Comments provided by Hans:
- Document new attribute "reset_swb_dc_dc_pwr_fail".--- .../ABI/stable/sysfs-driver-mlxreg-io | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+)Documentation/ABI/stable/sysfs-driver-mlxreg-io +42
-0@@ -662,3 +662,55 @@ Description: This file shows the system reset cause due to AC power failure. Value 1 in file means this is reset cause, 0 - otherwise. The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: These files show with which CPLD part numbers, version and minor + versions have been burned the 5-th CPLD device equipped on a + system. + + The files are read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file indicates the available method of CPLD/FPGA devices + field update through the JTAG chain: + b00 - field update through LPC bus register memory space. + b01 - Reserved. + b10 - Reserved. + b11 - field update through CPU GPIOs bit-banging. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: 1 - indicates that system lid is opened, otherwise 0. + + The file is read only. + +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file if set 1 indicates that system has been reset by + long press of power button. + + The file is read only.Documentation/ABI/stable/sysfs-driver-mlxreg-io Description: This file shows the system reset cause due to AC power failure. · line 716
Quoted 10 lines
Documentation/ABI/stable/sysfs-driver-mlxreg-io +10
-0+ +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail +Date: August 2023 +KernelVersion: 6.6 +Contact: Vadim Pasternak <[email protected]> +Description: This file shows 1 in case the system reset happened due to the + failure of any DC-DC power converter devices equipped on the + switch board. + + The file is read only.Thanks a lot, much clearer wording now.
Reviewed-by Ilpo Järvinen <[email protected]>