platform: mellanox: Add new attributes
authorVadim Pasternak <vadimp@nvidia.com>
Tue, 22 Aug 2023 11:34:36 +0000 (11:34 +0000)
committerHans de Goede <hdegoede@redhat.com>
Wed, 23 Aug 2023 15:31:27 +0000 (17:31 +0200)
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>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/mlx-platform.c

index 7d33977..26748c2 100644 (file)
@@ -3793,6 +3793,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = {
                .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,
                .mask = GENMASK(7, 0) & ~BIT(4),
@@ -4432,6 +4438,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_chassis_blade_regs_io_data[] = {
                .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,
                .mask = GENMASK(7, 0) & ~BIT(2),