Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intgerate HW-MGMT 7.0030.0937 Changes #54

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/mellanox/hw-management.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
# Mellanox HW Management

MLNX_HW_MANAGEMENT_VERSION = 7.0020.4104
MLNX_HW_MANAGEMENT_VERSION = 7.0030.0937

export MLNX_HW_MANAGEMENT_VERSION

Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/hw-management/hw-mgmt
Submodule hw-mgmt updated 324 files
72 changes: 10 additions & 62 deletions platform/mellanox/hw-management/hwmgmt_nonup_patches
Original file line number Diff line number Diff line change
@@ -1,63 +1,11 @@
# Current non-upstream patch list, should be updated by hwmgmt_kernel_patches.py script
0099-mlxsw-core_hwmon-Fix-variable-names-for-hwmon-attrib.patch
0100-mlxsw-core_thermal-Rename-labels-according-to-naming.patch
0101-mlxsw-core_thermal-Remove-obsolete-API-for-query-res.patch
0102-mlxsw-reg-Add-mgpir_-prefix-to-MGPIR-fields-comments.patch
0103-mlxsw-core-Remove-unnecessary-asserts.patch
0104-mlxsw-reg-Extend-MTMP-register-with-new-slot-number-.patch
0105-mlxsw-reg-Extend-MTBR-register-with-new-slot-number-.patch
0106-mlxsw-reg-Extend-MCIA-register-with-new-slot-number-.patch
0107-mlxsw-reg-Extend-MCION-register-with-new-slot-number.patch
0108-mlxsw-reg-Extend-PMMP-register-with-new-slot-number-.patch
0109-mlxsw-reg-Extend-MGPIR-register-with-new-slot-fields.patch
0110-mlxsw-core_env-Pass-slot-index-during-PMAOS-register.patch
0111-mlxsw-reg-Add-new-field-to-Management-General-Periph.patch
0112-mlxsw-core-Extend-interfaces-for-cable-info-access-w.patch
0113-mlxsw-core-Extend-port-module-data-structures-for-li.patch
0114-mlxsw-core-Move-port-module-events-enablement-to-a-s.patch
0115-mlxsw-core_hwmon-Split-gearbox-initialization.patch
0116-mlxsw-core_hwmon-Extend-internal-structures-to-suppo.patch
0117-mlxsw-core_hwmon-Introduce-slot-parameter-in-hwmon-i.patch
0118-mlxsw-core_hwmon-Extend-hwmon-device-with-gearbox-ma.patch
0119-mlxsw-core_thermal-Extend-internal-structures-to-sup.patch
0120-mlxsw-core_thermal-Split-gearbox-initialization.patch
0121-mlxsw-core_thermal-Extend-thermal-area-with-gearbox-.patch
0122-mlxsw-core_thermal-Add-line-card-id-prefix-to-line-c.patch
0123-mlxsw-core_thermal-Use-exact-name-of-cooling-devices.patch
0124-mlxsw-core_thermal-Use-common-define-for-thermal-zon.patch
0125-devlink-add-support-to-create-line-card-and-expose-t.patch
0126-devlink-implement-line-card-provisioning.patch
0127-devlink-implement-line-card-active-state.patch
0128-devlink-add-port-to-line-card-relationship-set.patch
0129-devlink-introduce-linecard-info-get-message.patch
0130-devlink-introduce-linecard-info-get-message.patch
0131-mlxsw-reg-Add-Ports-Mapping-event-Configuration-Regi.patch
0132-mlxsw-reg-Add-Management-DownStream-Device-Query-Reg.patch
0133-mlxsw-reg-Add-Management-DownStream-Device-Control-R.patch
0134-mlxsw-reg-Add-Management-Binary-Code-Transfer-Regist.patch
0135-mlxsw-core_linecards-Add-line-card-objects-and-imple.patch
0136-mlxsw-core_linecards-Implement-line-card-activation-.patch
0137-mlxsw-core-Extend-driver-ops-by-remove-selected-port.patch
0138-mlxsw-spectrum-Add-port-to-linecard-mapping.patch
0139-mlxsw-reg-Introduce-Management-Temperature-Extended-.patch
0140-mlxsw-core-Add-APIs-for-thermal-sensor-mapping.patch
0141-mlxsw-reg-Add-Management-DownStream-Device-Tunneling.patch
0142-mlxsw-core_linecards-Probe-devices-for-provisioned-l.patch
0143-mlxsw-core_linecards-Expose-device-FW-version-over-d.patch
0144-mlxsw-core-Introduce-flash-update-components.patch
0145-mlxfw-Get-the-PSID-value-using-op-instead-of-passing.patch
0146-mlxsw-core_linecards-Implement-line-card-device-flas.patch
0147-mlxsw-core_linecards-Introduce-ops-for-linecards-sta.patch
0148-mlxsw-core-Add-interfaces-for-line-card-initializati.patch
0149-mlxsw-core_thermal-Add-interfaces-for-line-card-init.patch
0150-mlxsw-core_hwmon-Add-interfaces-for-line-card-initia.patch
0151-mlxsw-minimal-Prepare-driver-for-modular-system-supp.patch
0152-mlxsw-core-Extend-bus-init-function-with-event-handl.patch
0153-mlxsw-i2c-Add-support-for-system-events-handling.patch
0154-mlxsw-core-Export-line-card-API.patch
0155-mlxsw-minimal-Add-system-event-handler.patch
0156-mlxsw-minimal-Add-interfaces-for-line-card-initializ.patch
0163-platform-mellanox-Introduce-support-for-rack-manager.patch
0176-platform-mellanox-fix-reset_pwr_converter_fail-attri.patch
0177-Documentation-ABI-fix-description-of-fix-reset_pwr_c.patch
0178-platform-mellanox-Introduce-support-for-next-generat.patch
0049-leds-mlxreg-Provide-conversion-for-hardware-LED-colo.patch
0050-leds-mlxreg-Skip-setting-LED-color-during-initializa.patch
0051-leds-mlxreg-Allow-multi-instantiation-of-same-name-L.patch
0167-DS-lan743x-Add-support-for-fixed-phy.patch
0168-TMP-mlxsw-minimal-Ignore-error-reading-SPAD-register.patch
0169-TMP-mlxsw-i2c-Prevent-transaction-execution-for-spec.patch
0174-DS-mlxsw-core_linecards-Skip-devlink-and-provisionin.patch
0181-Revert-Fix-out-of-bounds-memory-accesses-in-thermal.patch
0268-DS-mlxsw-core_linecards-Disable-firmware-bundling-ma.patch
9002-TMP-fix-for-fan-minimum-speed.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
From 4db801c656712234c840883b68429e6d45080ea3 Mon Sep 17 00:00:00 2001
From: Vadim Pasternak <vadimp@nvidia.com>
Date: Tue, 6 Jul 2021 18:38:29 +0000
Subject: [PATCH backport v5.10.43 49/67] leds: mlxreg: Provide conversion for
hardware LED color code

In case register is set by hardware, convert hardware color code to
expose correct color to "sysfs".
For some LED color at initial state is set by hardware. Hardware
controls LED color until the first software write access to any LED
register - the first software access cancels hardware control.
If LED is under hardware control - detect the color in brightness_get()
function.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
---
drivers/leds/leds-mlxreg.c | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c
index 82aea1cd0c12..aa82f6a521f8 100644
--- a/drivers/leds/leds-mlxreg.c
+++ b/drivers/leds/leds-mlxreg.c
@@ -17,7 +17,9 @@
#define MLXREG_LED_OFFSET_BLINK_3HZ 0x01 /* Offset from solid: 3Hz blink */
#define MLXREG_LED_OFFSET_BLINK_6HZ 0x02 /* Offset from solid: 6Hz blink */
#define MLXREG_LED_IS_OFF 0x00 /* Off */
-#define MLXREG_LED_RED_SOLID 0x05 /* Solid red */
+#define MLXREG_LED_RED_SOLID_HW 0x01 /* Solid red or orange by hardware */
+#define MLXREG_LED_RED_SOLID 0x05 /* Solid red or orange */
+#define MLXREG_LED_GREEN_SOLID_HW 0x09 /* Solid green by hardware */
#define MLXREG_LED_GREEN_SOLID 0x0D /* Solid green */
#define MLXREG_LED_AMBER_SOLID 0x09 /* Solid amber */
#define MLXREG_LED_BLINK_3HZ 167 /* ~167 msec off/on - HW support */
@@ -30,6 +32,7 @@
* @data: led configuration data;
* @led_classdev: led class data;
* @base_color: base led color (other colors have constant offset from base);
+ * @base_color_hw: base led color set by hardware;
* @led_data: led data;
* @data_parent: pointer to private device control data of parent;
*/
@@ -37,6 +40,7 @@ struct mlxreg_led_data {
struct mlxreg_core_data *data;
struct led_classdev led_cdev;
u8 base_color;
+ u8 base_color_hw;
void *data_parent;
char led_cdev_name[MLXREG_CORE_LABEL_MAX_SIZE];
};
@@ -124,8 +128,17 @@ mlxreg_led_get_hw(struct mlxreg_led_data *led_data)
regval = regval & ~data->mask;
regval = (ror32(data->mask, data->bit) == 0xf0) ? ror32(regval,
data->bit) : ror32(regval, data->bit + 4);
- if (regval >= led_data->base_color &&
- regval <= (led_data->base_color + MLXREG_LED_OFFSET_BLINK_6HZ))
+
+ /*
+ * For some LED color at initial state is set by hardware. Hardware controls LED color
+ * until the first write access to any LED register. If LED is under hardware control -
+ * convert the value to the software mask to expose correct color. The first LED set by
+ * software cancels hardware control.
+ */
+ if ((regval >= led_data->base_color &&
+ regval <= (led_data->base_color + MLXREG_LED_OFFSET_BLINK_6HZ)) ||
+ (led_data->base_color_hw && regval >= led_data->base_color_hw &&
+ regval <= (led_data->base_color_hw + MLXREG_LED_OFFSET_BLINK_6HZ)))
return LED_FULL;

return LED_OFF;
@@ -217,16 +230,20 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv)

led_cdev = &led_data->led_cdev;
led_data->data_parent = priv;
- if (strstr(data->label, "red") ||
- strstr(data->label, "orange")) {
+ if (strstr(data->label, "red")) {
+ brightness = LED_OFF;
+ led_data->base_color = MLXREG_LED_RED_SOLID;
+ } else if (strstr(data->label, "orange")) {
brightness = LED_OFF;
led_data->base_color = MLXREG_LED_RED_SOLID;
+ led_data->base_color_hw = MLXREG_LED_RED_SOLID_HW;
} else if (strstr(data->label, "amber")) {
brightness = LED_OFF;
led_data->base_color = MLXREG_LED_AMBER_SOLID;
} else {
brightness = LED_OFF;
led_data->base_color = MLXREG_LED_GREEN_SOLID;
+ led_data->base_color_hw = MLXREG_LED_GREEN_SOLID_HW;
}
snprintf(led_data->led_cdev_name, sizeof(led_data->led_cdev_name),
"mlxreg:%s", data->label);
--
2.20.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 3d0e396f29b5da17385c279946b70ee5cd373efe Mon Sep 17 00:00:00 2001
From: Vadim Pasternak <vadimp@nvidia.com>
Date: Wed, 7 Jul 2021 10:18:14 +0000
Subject: [PATCH backport 5.10 050/182] leds: mlxreg: Skip setting LED color
during initialization

Hardware controls LED through CPLD device and LED control ownership
passes to the software after it performs the first write operation for
any LED on a system.
For example, hardware sets "system" LED "green blink" during boot and
might change it to "red", in case something is went wrong from hardware
point of view.
The motivation for not setting LED during kernel initialization is for
keeping hardware settings visible for user, until user will not decide
to set LEDs according to user OS specific requirements.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
---
drivers/leds/leds-mlxreg.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c
index 82aea1cd0c12..7df4653a80d7 100644
--- a/drivers/leds/leds-mlxreg.c
+++ b/drivers/leds/leds-mlxreg.c
@@ -243,9 +243,6 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv)
if (err)
return err;

- if (led_cdev->brightness)
- mlxreg_led_brightness_set(led_cdev,
- led_cdev->brightness);
dev_info(led_cdev->dev, "label: %s, mask: 0x%02x, offset:0x%02x\n",
data->label, data->mask, data->reg);
}
--
2.20.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
From 6782d682cb0510d0fee33f456ed3492834bad97d Mon Sep 17 00:00:00 2001
From: Vadim Pasternak <vadimp@nvidia.com>
Date: Wed, 7 Jul 2021 10:29:27 +0000
Subject: leds: mlxreg: Allow multi-instantiation of same name LED for modular
systems

It could be more than one instance of LED with the same name in the
modular systems. For example, "status" or "uid" LED can be located
on chassis and on each line card of modular system.
In order to avoid conflicts with duplicated names, append platform
device Id, which is unique, to LED name after driver name.
Thus, for example, "status" LED on chassis is to be called, like it is
called now on non-modular systems, on which platform device Id is not
specified: "mlxreg:status:green". While for the line cards LEDs it will
be called like: "pcicard48:status:green", "ibcard66:status:green",
etc. Where line card prefix is specified according to the type of bus
connecting line card to the chassis.

LED driver works on top of register space of the programmable devices
(CPLD or FPGA), providing the logic for LED control. The programmable
devices on the line cards are connected through I2C bus and LED driver
will work over I2C. On main board programmable device is connected
through LPC, and LED driver works over LPC.

The motivation it to provide support for new modular systems which
could be equipped with the different types of replaceable line cards
and management board.

Line cards are connected to the chassis through I2C interface for the
chassis management operations and through PCIe for the networking
operations.

The first type of line card supports 16x100GbE QSFP28 Ethernet ports.
Those line cards equipped with the programmable devices aimed for
system control of Nvidia Ethernet switch ASIC control, Nvidia FPGA,
Nvidia gearboxes (PHYs).
The next coming card generations are supposed to support:
- Line cards with 8x200Gbe QSFP28 Ethernet ports.
- Line cards with 4x400Gbe QSFP-DD Ethernet ports.
- Smart cards equipped with Nvidia ARM CPU for offloading and for fast
access to the storage (EBoF).
- Fabric cards for inter-connection.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
---
drivers/leds/leds-mlxreg.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c
index 0f2608a34..099ff4be2 100644
--- a/drivers/leds/leds-mlxreg.c
+++ b/drivers/leds/leds-mlxreg.c
@@ -245,8 +245,19 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv)
led_data->base_color = MLXREG_LED_GREEN_SOLID;
led_data->base_color_hw = MLXREG_LED_GREEN_SOLID_HW;
}
- snprintf(led_data->led_cdev_name, sizeof(led_data->led_cdev_name),
- "mlxreg:%s", data->label);
+
+ /*
+ * Id greater than zero is used for LEDs located on replaceable unit,
+ * like line card or fabric card. In this case Id is set to I2C bus
+ * number. Otherwise LEDs located on the main board. The field "identity"
+ * specifies the type of bus connecting line card to the chassis.
+ */
+ if (priv->pdev->id > 0)
+ sprintf(led_data->led_cdev_name, "%scard%d:%s", led_pdata->identity,
+ priv->pdev->id, data->label);
+ else
+ sprintf(led_data->led_cdev_name, "%s:%s", "mlxreg",
+ data->label);
led_cdev->name = led_data->led_cdev_name;
led_cdev->brightness = brightness;
led_cdev->max_brightness = LED_ON;
--
2.14.1

Loading