* [PATCH platform-next v2 01/16] platform: mellanox: Add new attributes
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
@ 2023-08-14 20:33 ` Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 02/16] platform: mellanox: Add field upgrade capability register Vadim Pasternak
` (16 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:33 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
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.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
drivers/platform/x86/mlx-platform.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 7d33977d9c60..26748c285ddc 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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,
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 02/16] platform: mellanox: Add field upgrade capability register
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 01/16] platform: mellanox: Add new attributes Vadim Pasternak
@ 2023-08-14 20:33 ` Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 03/16] platform: mellanox: Modify reset causes description Vadim Pasternak
` (15 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:33 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Add 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).
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
drivers/platform/x86/mlx-platform.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 26748c285ddc..647a10252c2f 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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:
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 03/16] platform: mellanox: Modify reset causes description
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 01/16] platform: mellanox: Add new attributes Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 02/16] platform: mellanox: Add field upgrade capability register Vadim Pasternak
@ 2023-08-14 20:33 ` Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 04/16] platform: mellanox: mlx-platform: Modify health and power hotplug action Vadim Pasternak
` (14 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:33 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
For 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".
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
v0->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(-)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 647a10252c2f..5b0579752afb 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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,
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 04/16] platform: mellanox: mlx-platform: Modify health and power hotplug action
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (2 preceding siblings ...)
2023-08-14 20:33 ` [PATCH platform-next v2 03/16] platform: mellanox: Modify reset causes description Vadim Pasternak
@ 2023-08-14 20:33 ` Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 05/16] platform: mellanox: mlx-platform: Add reset cause attribute Vadim Pasternak
` (13 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:33 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Set 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.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
drivers/platform/x86/mlx-platform.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 5b0579752afb..648b27eff0b0 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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,
},
{
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 05/16] platform: mellanox: mlx-platform: Add reset cause attribute
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (3 preceding siblings ...)
2023-08-14 20:33 ` [PATCH platform-next v2 04/16] platform: mellanox: mlx-platform: Modify health and power hotplug action Vadim Pasternak
@ 2023-08-14 20:33 ` Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 06/16] platform: mellanox: mlx-platform: add support for additional CPLD Vadim Pasternak
` (12 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:33 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Extend 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.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
drivers/platform/x86/mlx-platform.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 648b27eff0b0..8e07ed3dc552 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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,
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 06/16] platform: mellanox: mlx-platform: add support for additional CPLD
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (4 preceding siblings ...)
2023-08-14 20:33 ` [PATCH platform-next v2 05/16] platform: mellanox: mlx-platform: Add reset cause attribute Vadim Pasternak
@ 2023-08-14 20:33 ` Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 07/16] platform: mellanox: mlx-platform: Modify power off callback Vadim Pasternak
` (11 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:33 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Extend to support 5-th CPLD version, PN and minimal version registers.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
drivers/platform/x86/mlx-platform.c | 31 +++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 8e07ed3dc552..dce35934cc37 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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:
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 07/16] platform: mellanox: mlx-platform: Modify power off callback
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (5 preceding siblings ...)
2023-08-14 20:33 ` [PATCH platform-next v2 06/16] platform: mellanox: mlx-platform: add support for additional CPLD Vadim Pasternak
@ 2023-08-14 20:33 ` Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 08/16] platform: mellanox: Cosmetic changes Vadim Pasternak
` (10 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:33 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Extend 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.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
v0->v2:
- Comments pointed out by Ilpo:
- Amend commit text.
---
drivers/platform/x86/mlx-platform.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index dce35934cc37..a505f619f337 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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)
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 08/16] platform: mellanox: Cosmetic changes
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (6 preceding siblings ...)
2023-08-14 20:33 ` [PATCH platform-next v2 07/16] platform: mellanox: mlx-platform: Modify power off callback Vadim Pasternak
@ 2023-08-14 20:33 ` Vadim Pasternak
2023-08-14 20:33 ` [PATCH platform-next v2 09/16] platform: mellanox: mlx-platform: Add reset callback Vadim Pasternak
` (9 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:33 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Fix routines and labels names by s/topolgy/topology.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
v0->v2:
- Comments pointed out by Ilpo:
- Fix commit text.
---
drivers/platform/x86/mlx-platform.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index a505f619f337..1010064d54e9 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 09/16] platform: mellanox: mlx-platform: Add reset callback
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (7 preceding siblings ...)
2023-08-14 20:33 ` [PATCH platform-next v2 08/16] platform: mellanox: Cosmetic changes Vadim Pasternak
@ 2023-08-14 20:33 ` Vadim Pasternak
2023-08-14 20:34 ` [PATCH platform-next v2 10/16] platform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infrastructure Vadim Pasternak
` (8 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:33 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
On L1 switches reset should include special actions against CPLD device
for performing graceful operations.
For that purpose, special PLATFORM_RESET# signal should be indicated.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
v0->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(-)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 1010064d54e9..296569492a71 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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();
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 10/16] platform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infrastructure
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (8 preceding siblings ...)
2023-08-14 20:33 ` [PATCH platform-next v2 09/16] platform: mellanox: mlx-platform: Add reset callback Vadim Pasternak
@ 2023-08-14 20:34 ` Vadim Pasternak
2023-08-14 20:34 ` [PATCH platform-next v2 11/16] platform: mellanox: mlx-platform: Introduce ACPI init flow Vadim Pasternak
` (7 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:34 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Currently 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.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
drivers/platform/x86/mlx-platform.c | 91 +++++++++++++++++++----------
1 file changed, 61 insertions(+), 30 deletions(-)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 296569492a71..73f887614e04 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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);
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 11/16] platform: mellanox: mlx-platform: Introduce ACPI init flow
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (9 preceding siblings ...)
2023-08-14 20:34 ` [PATCH platform-next v2 10/16] platform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infrastructure Vadim Pasternak
@ 2023-08-14 20:34 ` Vadim Pasternak
2023-08-14 20:34 ` [PATCH platform-next v2 12/16] platform: mellanox: mlx-platform: Get interrupt line through ACPI Vadim Pasternak
` (6 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:34 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Introduce support for ACPI initialization flow - add ACPI match hook.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
v0->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(+)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 73f887614e04..feedfba0acf3 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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,
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 12/16] platform: mellanox: mlx-platform: Get interrupt line through ACPI
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (10 preceding siblings ...)
2023-08-14 20:34 ` [PATCH platform-next v2 11/16] platform: mellanox: mlx-platform: Introduce ACPI init flow Vadim Pasternak
@ 2023-08-14 20:34 ` Vadim Pasternak
2023-08-14 20:34 ` [PATCH platform-next v2 13/16] platform: mellanox: Add initial support for PCIe based programming logic device Vadim Pasternak
` (5 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:34 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Add support for getting system interrupt line from ACPI table.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
v0->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(-)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index feedfba0acf3..3eccb6628ccc 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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;
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 13/16] platform: mellanox: Add initial support for PCIe based programming logic device
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (11 preceding siblings ...)
2023-08-14 20:34 ` [PATCH platform-next v2 12/16] platform: mellanox: mlx-platform: Get interrupt line through ACPI Vadim Pasternak
@ 2023-08-14 20:34 ` Vadim Pasternak
2023-08-14 20:34 ` [PATCH platform-next v2 14/16] platform/mellanox: mlxreg-hotplug: Extend condition for notification callback processing Vadim Pasternak
` (4 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:34 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Extend 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.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
- 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(-)
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 3eccb6628ccc..44f107965832 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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,
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 14/16] platform/mellanox: mlxreg-hotplug: Extend condition for notification callback processing
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (12 preceding siblings ...)
2023-08-14 20:34 ` [PATCH platform-next v2 13/16] platform: mellanox: Add initial support for PCIe based programming logic device Vadim Pasternak
@ 2023-08-14 20:34 ` Vadim Pasternak
2023-08-14 20:34 ` [PATCH platform-next v2 15/16] platform: mellanox: nvsw-sn2201: change fans i2c busses Vadim Pasternak
` (3 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:34 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Vadim Pasternak
Allow 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.
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
drivers/platform/mellanox/mlxreg-hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c
index b7dcc64cd238..c5abedd3514d 100644
--- a/drivers/platform/mellanox/mlxreg-hotplug.c
+++ b/drivers/platform/mellanox/mlxreg-hotplug.c
@@ -113,7 +113,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);
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 15/16] platform: mellanox: nvsw-sn2201: change fans i2c busses.
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (13 preceding siblings ...)
2023-08-14 20:34 ` [PATCH platform-next v2 14/16] platform/mellanox: mlxreg-hotplug: Extend condition for notification callback processing Vadim Pasternak
@ 2023-08-14 20:34 ` Vadim Pasternak
2023-08-14 20:34 ` [PATCH platform-next v2 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces Vadim Pasternak
` (2 subsequent siblings)
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:34 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, Michael Shych,
Vadim Pasternak
From: Michael Shych <michaelsh@nvidia.com>
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.
Signed-off-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
---
drivers/platform/mellanox/nvsw-sn2201.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c
index 7b9c107c17ce..75b699676ca6 100644
--- a/drivers/platform/mellanox/nvsw-sn2201.c
+++ b/drivers/platform/mellanox/nvsw-sn2201.c
@@ -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,
},
};
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* [PATCH platform-next v2 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (14 preceding siblings ...)
2023-08-14 20:34 ` [PATCH platform-next v2 15/16] platform: mellanox: nvsw-sn2201: change fans i2c busses Vadim Pasternak
@ 2023-08-14 20:34 ` Vadim Pasternak
2023-08-15 8:05 ` [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Hans de Goede
2023-08-21 13:19 ` Hans de Goede
17 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-14 20:34 UTC (permalink / raw)
To: hdegoede; +Cc: ilpo.jarvinen, platform-driver-x86, 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".
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
.../ABI/stable/sysfs-driver-mlxreg-io | 42 +++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
index 60953903d007..633be2bf2cd0 100644
--- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io
+++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
@@ -662,3 +662,45 @@ 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 <vadimp@nvidia.com>
+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 <vadimp@nvidia.com>
+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 <vadimp@nvidia.com>
+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 <vadimp@nvidia.com>
+Description: This file if set 1 indicates that system has been reset by
+ long press of power button.
+
+ The file is read only.
--
2.20.1
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (15 preceding siblings ...)
2023-08-14 20:34 ` [PATCH platform-next v2 16/16] Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces Vadim Pasternak
@ 2023-08-15 8:05 ` Hans de Goede
2023-08-15 8:09 ` Vadim Pasternak
2023-08-21 13:19 ` Hans de Goede
17 siblings, 1 reply; 25+ messages in thread
From: Hans de Goede @ 2023-08-15 8:05 UTC (permalink / raw)
To: Vadim Pasternak; +Cc: ilpo.jarvinen, platform-driver-x86
Hi,
It would be nice if there was a changelog somewhere in this cover
letter explaining what has changed in v2 ?
Regards,
Hans
On 8/14/23 22:33, Vadim Pasternak wrote:
> 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.
>
> 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 | 42 ++
> drivers/platform/mellanox/mlxreg-hotplug.c | 2 +-
> drivers/platform/mellanox/nvsw-sn2201.c | 12 +-
> drivers/platform/x86/mlx-platform.c | 376 ++++++++++++++++--
> 4 files changed, 383 insertions(+), 49 deletions(-)
>
^ permalink raw reply [flat|nested] 25+ messages in thread* RE: [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems
2023-08-15 8:05 ` [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Hans de Goede
@ 2023-08-15 8:09 ` Vadim Pasternak
2023-08-15 8:15 ` Hans de Goede
2023-08-15 8:15 ` Hans de Goede
0 siblings, 2 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-15 8:09 UTC (permalink / raw)
To: Hans de Goede
Cc: ilpo.jarvinen@linux.intel.com,
platform-driver-x86@vger.kernel.org
Hi Hans,
I put changelogs inside each patch, which was commented (v0 -> v2).
Would you like me to put it in cover?
Thanks,
Vadim.
> -----Original Message-----
> From: Hans de Goede <hdegoede@redhat.com>
> Sent: Tuesday, 15 August 2023 11:06
> To: Vadim Pasternak <vadimp@nvidia.com>
> Cc: ilpo.jarvinen@linux.intel.com; platform-driver-x86@vger.kernel.org
> Subject: Re: [PATCH platform-next v2 00/16] Add new features and
> amendments for Nvidia systems
>
> Hi,
>
> It would be nice if there was a changelog somewhere in this cover letter
> explaining what has changed in v2 ?
>
> Regards,
>
> Hans
>
> On 8/14/23 22:33, Vadim Pasternak wrote:
> > 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.
> >
> > 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 | 42 ++
> > drivers/platform/mellanox/mlxreg-hotplug.c | 2 +-
> > drivers/platform/mellanox/nvsw-sn2201.c | 12 +-
> > drivers/platform/x86/mlx-platform.c | 376 ++++++++++++++++--
> > 4 files changed, 383 insertions(+), 49 deletions(-)
> >
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems
2023-08-15 8:09 ` Vadim Pasternak
@ 2023-08-15 8:15 ` Hans de Goede
2023-08-15 8:15 ` Hans de Goede
1 sibling, 0 replies; 25+ messages in thread
From: Hans de Goede @ 2023-08-15 8:15 UTC (permalink / raw)
To: Vadim Pasternak
Cc: ilpo.jarvinen@linux.intel.com,
platform-driver-x86@vger.kernel.org
Hi,
On 8/15/23 10:09, Vadim Pasternak wrote:
> Hi Hans,
>
> I put changelogs inside each patch, which was commented (v0 -> v2).
> Would you like me to put it in cover?
Ah I see them now, I randomly checked 3 patches for
that and got unlucky.
Next time please put at least a summary of the Changes in
the cover, e.g. for this v2:
Changes in v2:
- Address review comments from Ilpo, see individual patches
for details.
Regards,
Hans
-
>
> Thanks,
> Vadim.
>
>> -----Original Message-----
>> From: Hans de Goede <hdegoede@redhat.com>
>> Sent: Tuesday, 15 August 2023 11:06
>> To: Vadim Pasternak <vadimp@nvidia.com>
>> Cc: ilpo.jarvinen@linux.intel.com; platform-driver-x86@vger.kernel.org
>> Subject: Re: [PATCH platform-next v2 00/16] Add new features and
>> amendments for Nvidia systems
>>
>> Hi,
>>
>> It would be nice if there was a changelog somewhere in this cover letter
>> explaining what has changed in v2 ?
>>
>> Regards,
>>
>> Hans
>>
>> On 8/14/23 22:33, Vadim Pasternak wrote:
>>> 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.
>>>
>>> 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 | 42 ++
>>> drivers/platform/mellanox/mlxreg-hotplug.c | 2 +-
>>> drivers/platform/mellanox/nvsw-sn2201.c | 12 +-
>>> drivers/platform/x86/mlx-platform.c | 376 ++++++++++++++++--
>>> 4 files changed, 383 insertions(+), 49 deletions(-)
>>>
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems
2023-08-15 8:09 ` Vadim Pasternak
2023-08-15 8:15 ` Hans de Goede
@ 2023-08-15 8:15 ` Hans de Goede
2023-08-15 8:20 ` Vadim Pasternak
1 sibling, 1 reply; 25+ messages in thread
From: Hans de Goede @ 2023-08-15 8:15 UTC (permalink / raw)
To: Vadim Pasternak
Cc: ilpo.jarvinen@linux.intel.com,
platform-driver-x86@vger.kernel.org
Hi,
On 8/15/23 10:09, Vadim Pasternak wrote:
> Hi Hans,
>
> I put changelogs inside each patch, which was commented (v0 -> v2).
> Would you like me to put it in cover?
Ah I see them now, I randomly checked 3 patches for
that and got unlucky.
Next time please put at least a summary of the Changes in
the cover, e.g. for this v2:
Changes in v2:
- Address review comments from Ilpo, see individual patches
for details.
Regards,
Hans
-
>
> Thanks,
> Vadim.
>
>> -----Original Message-----
>> From: Hans de Goede <hdegoede@redhat.com>
>> Sent: Tuesday, 15 August 2023 11:06
>> To: Vadim Pasternak <vadimp@nvidia.com>
>> Cc: ilpo.jarvinen@linux.intel.com; platform-driver-x86@vger.kernel.org
>> Subject: Re: [PATCH platform-next v2 00/16] Add new features and
>> amendments for Nvidia systems
>>
>> Hi,
>>
>> It would be nice if there was a changelog somewhere in this cover letter
>> explaining what has changed in v2 ?
>>
>> Regards,
>>
>> Hans
>>
>> On 8/14/23 22:33, Vadim Pasternak wrote:
>>> 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.
>>>
>>> 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 | 42 ++
>>> drivers/platform/mellanox/mlxreg-hotplug.c | 2 +-
>>> drivers/platform/mellanox/nvsw-sn2201.c | 12 +-
>>> drivers/platform/x86/mlx-platform.c | 376 ++++++++++++++++--
>>> 4 files changed, 383 insertions(+), 49 deletions(-)
>>>
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems
2023-08-15 8:15 ` Hans de Goede
@ 2023-08-15 8:20 ` Vadim Pasternak
0 siblings, 0 replies; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-15 8:20 UTC (permalink / raw)
To: Hans de Goede
Cc: ilpo.jarvinen@linux.intel.com,
platform-driver-x86@vger.kernel.org
> -----Original Message-----
> From: Hans de Goede <hdegoede@redhat.com>
> Sent: Tuesday, 15 August 2023 11:16
> To: Vadim Pasternak <vadimp@nvidia.com>
> Cc: ilpo.jarvinen@linux.intel.com; platform-driver-x86@vger.kernel.org
> Subject: Re: [PATCH platform-next v2 00/16] Add new features and
> amendments for Nvidia systems
>
> Hi,
>
> On 8/15/23 10:09, Vadim Pasternak wrote:
> > Hi Hans,
> >
> > I put changelogs inside each patch, which was commented (v0 -> v2).
> > Would you like me to put it in cover?
>
> Ah I see them now, I randomly checked 3 patches for that and got unlucky.
>
> Next time please put at least a summary of the Changes in the cover, e.g. for
> this v2:
>
> Changes in v2:
> - Address review comments from Ilpo, see individual patches
> for details.
Sure.
>
> Regards,
>
> Hans
>
>
>
>
>
>
> -
> >
> > Thanks,
> > Vadim.
> >
> >> -----Original Message-----
> >> From: Hans de Goede <hdegoede@redhat.com>
> >> Sent: Tuesday, 15 August 2023 11:06
> >> To: Vadim Pasternak <vadimp@nvidia.com>
> >> Cc: ilpo.jarvinen@linux.intel.com;
> >> platform-driver-x86@vger.kernel.org
> >> Subject: Re: [PATCH platform-next v2 00/16] Add new features and
> >> amendments for Nvidia systems
> >>
> >> Hi,
> >>
> >> It would be nice if there was a changelog somewhere in this cover
> >> letter explaining what has changed in v2 ?
> >>
> >> Regards,
> >>
> >> Hans
> >>
> >> On 8/14/23 22:33, Vadim Pasternak wrote:
> >>> 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.
> >>>
> >>> 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 | 42 ++
> >>> drivers/platform/mellanox/mlxreg-hotplug.c | 2 +-
> >>> drivers/platform/mellanox/nvsw-sn2201.c | 12 +-
> >>> drivers/platform/x86/mlx-platform.c | 376 ++++++++++++++++--
> >>> 4 files changed, 383 insertions(+), 49 deletions(-)
> >>>
> >
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems
2023-08-14 20:33 [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Vadim Pasternak
` (16 preceding siblings ...)
2023-08-15 8:05 ` [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems Hans de Goede
@ 2023-08-21 13:19 ` Hans de Goede
2023-08-21 16:29 ` Vadim Pasternak
17 siblings, 1 reply; 25+ messages in thread
From: Hans de Goede @ 2023-08-21 13:19 UTC (permalink / raw)
To: Vadim Pasternak; +Cc: ilpo.jarvinen, platform-driver-x86
Hi,
On 8/14/23 22:33, Vadim Pasternak wrote:
> 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.
Thanks.
1 remark about Patch #16: Documents new attributes, this does not document
the new reset_swb_dc_dc_pwr_fail attribute, please add this.
With that fixed the entire looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
for the series.
I tried applying this, but it is based on a tree which does not
have the recent: dd635e33b5c9a ("platform: mellanox: Introduce
support ofnew Nvidia L1 switch") commit causing patch 2/16 to
not apply.
Please rebase on top of the latest pdx86/for-next:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=for-next
and submit a version 3.
Regards,
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 | 42 ++
> drivers/platform/mellanox/mlxreg-hotplug.c | 2 +-
> drivers/platform/mellanox/nvsw-sn2201.c | 12 +-
> drivers/platform/x86/mlx-platform.c | 376 ++++++++++++++++--
> 4 files changed, 383 insertions(+), 49 deletions(-)
>
^ permalink raw reply [flat|nested] 25+ messages in thread* RE: [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems
2023-08-21 13:19 ` Hans de Goede
@ 2023-08-21 16:29 ` Vadim Pasternak
2023-08-21 17:05 ` Hans de Goede
0 siblings, 1 reply; 25+ messages in thread
From: Vadim Pasternak @ 2023-08-21 16:29 UTC (permalink / raw)
To: Hans de Goede
Cc: ilpo.jarvinen@linux.intel.com,
platform-driver-x86@vger.kernel.org
Hi Hans,
Thank you very much for review.
> -----Original Message-----
> From: Hans de Goede <hdegoede@redhat.com>
> Sent: Monday, 21 August 2023 16:20
> To: Vadim Pasternak <vadimp@nvidia.com>
> Cc: ilpo.jarvinen@linux.intel.com; platform-driver-x86@vger.kernel.org
> Subject: Re: [PATCH platform-next v2 00/16] Add new features and
> amendments for Nvidia systems
>
> Hi,
>
> On 8/14/23 22:33, Vadim Pasternak wrote:
> > 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.
>
> Thanks.
>
> 1 remark about Patch #16: Documents new attributes, this does not document
> the new reset_swb_dc_dc_pwr_fail attribute, please add this.
>
> With that fixed the entire looks good to me:
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>
> for the series.
>
> I tried applying this, but it is based on a tree which does not have the recent:
> dd635e33b5c9a ("platform: mellanox: Introduce support ofnew Nvidia L1
> switch") commit causing patch 2/16 to not apply.
>
> Please rebase on top of the latest pdx86/for-next:
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-
> x86.git/log/?h=for-next
I think the problem that branches:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=for-next
and
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
don't include series:
[PATCH platform 0/4] platform/x86: mlx-platform: Provide fixes for several issues
This patch set has been applied only to:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes
Can you, please cherry-pick this set to for-next or review-hans branch and I'll produce v3
on top of any of these two?
Otherwise, we'll have conflict.
This patch relocates some registers:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?h=fixes&id=d66a8aab7dc36c975bbaa6aa74cf7445878e7c69
And patch 2/16 cannot be applied, because it utilizes one of relocated offsets.
It seems not relayed to dd635e33b5c9a, which exists in all branches.
>
> and submit a version 3.
>
> Regards,
>
> 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 | 42 ++
> > drivers/platform/mellanox/mlxreg-hotplug.c | 2 +-
> > drivers/platform/mellanox/nvsw-sn2201.c | 12 +-
> > drivers/platform/x86/mlx-platform.c | 376 ++++++++++++++++--
> > 4 files changed, 383 insertions(+), 49 deletions(-)
> >
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH platform-next v2 00/16] Add new features and amendments for Nvidia systems
2023-08-21 16:29 ` Vadim Pasternak
@ 2023-08-21 17:05 ` Hans de Goede
0 siblings, 0 replies; 25+ messages in thread
From: Hans de Goede @ 2023-08-21 17:05 UTC (permalink / raw)
To: Vadim Pasternak
Cc: ilpo.jarvinen@linux.intel.com,
platform-driver-x86@vger.kernel.org
Hi Vadim,
On 8/21/23 18:29, Vadim Pasternak wrote:
> Hi Hans,
>
> Thank you very much for review.
>
>> -----Original Message-----
>> From: Hans de Goede <hdegoede@redhat.com>
>> Sent: Monday, 21 August 2023 16:20
>> To: Vadim Pasternak <vadimp@nvidia.com>
>> Cc: ilpo.jarvinen@linux.intel.com; platform-driver-x86@vger.kernel.org
>> Subject: Re: [PATCH platform-next v2 00/16] Add new features and
>> amendments for Nvidia systems
>>
>> Hi,
>>
>> On 8/14/23 22:33, Vadim Pasternak wrote:
>>> 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.
>>
>> Thanks.
>>
>> 1 remark about Patch #16: Documents new attributes, this does not document
>> the new reset_swb_dc_dc_pwr_fail attribute, please add this.
>>
>> With that fixed the entire looks good to me:
>>
>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>>
>> for the series.
>>
>> I tried applying this, but it is based on a tree which does not have the recent:
>> dd635e33b5c9a ("platform: mellanox: Introduce support ofnew Nvidia L1
>> switch") commit causing patch 2/16 to not apply.
>>
>> Please rebase on top of the latest pdx86/for-next:
>> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-
>> x86.git/log/?h=for-next
>
> I think the problem that branches:
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=for-next
> and
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
>
> don't include series:
> [PATCH platform 0/4] platform/x86: mlx-platform: Provide fixes for several issues
>
> This patch set has been applied only to:
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes
>
> Can you, please cherry-pick this set to for-next or review-hans branch and I'll produce v3
> on top of any of these two?
Ok. I've merged (1) pdx86/fixes into my review-hans branch now and pushed out the result. Please base v3 on top of the latest review-hans state.
1) It is prefered to avoid a single patch getting 2 commit ids which cherry-picking does, that is why I chose to do a back-merge here.
Regards,
Hans
^ permalink raw reply [flat|nested] 25+ messages in thread