Skip to content

Commit

Permalink
[mellanox]: Add SN4700 patches. (sonic-net#126)
Browse files Browse the repository at this point in the history
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
  • Loading branch information
nazariig authored Feb 25, 2020
1 parent d446f16 commit 231bebb
Show file tree
Hide file tree
Showing 6 changed files with 1,118 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
From acc9225e1db4bfc710c83c25f34b2b226060c350 Mon Sep 17 00:00:00 2001
From: Vadim Pasternak <vadimp@mellanox.com>
Date: Thu, 23 Jan 2020 14:58:38 +0200
Subject: [PATCH backport] firmware: dmi: Add access to the SKU ID string
backport

Backport of two below upstream commits.

commit b23908d3c48a37c46c6a26df2cdeab1610b360ba
Author: Simon Glass <sjg@chromium.org>
Date: Sun Jun 17 14:09:42 2018 +0200

firmware: dmi: Add access to the SKU ID string

This is used in some systems from user space for determining the
identity
of the device.

Expose this as a file so that that user-space tools don't need to
read
from /sys/firmware/dmi/tables/DMI

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jean Delvare <jdelvare@suse.de>

commit b23908d3c48a37c46c6a26df2cdeab1610b360ba
Author: Simon Glass <sjg@chromium.org>
Date: Sun Jun 17 14:09:42 2018 +0200

firmware: dmi: Add access to the SKU ID string

This is used in some systems from user space for determining the
identity
of the device.

Expose this as a file so that that user-space tools don't need to
read
from /sys/firmware/dmi/tables/DMI

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jean Delvare <jdelvare@suse.de>

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
---
drivers/firmware/dmi-id.c | 1 +
drivers/firmware/dmi_scan.c | 1 +
include/linux/mod_devicetable.h | 1 +
3 files changed, 3 insertions(+)

diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index dc269cb288c2..5c864ebe1127 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -47,6 +47,7 @@ DEFINE_DMI_ATTR_WITH_SHOW(product_name, 0444, DMI_PRODUCT_NAME);
DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION);
DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL);
DEFINE_DMI_ATTR_WITH_SHOW(product_uuid, 0400, DMI_PRODUCT_UUID);
+DEFINE_DMI_ATTR_WITH_SHOW(product_sku, 0444, DMI_PRODUCT_SKU);
DEFINE_DMI_ATTR_WITH_SHOW(product_family, 0400, DMI_PRODUCT_FAMILY);
DEFINE_DMI_ATTR_WITH_SHOW(board_vendor, 0444, DMI_BOARD_VENDOR);
DEFINE_DMI_ATTR_WITH_SHOW(board_name, 0444, DMI_BOARD_NAME);
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 150b923ef86d..d2a85a2e5b08 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -426,6 +426,7 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
dmi_save_uuid(dm, DMI_PRODUCT_UUID, 8);
+ dmi_save_ident(dm, DMI_PRODUCT_SKU, 25);
dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26);
break;
case 2: /* Base Board Information */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 616b31a1495d..103c14049a76 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -456,6 +456,7 @@ enum dmi_field {
DMI_PRODUCT_VERSION,
DMI_PRODUCT_SERIAL,
DMI_PRODUCT_UUID,
+ DMI_PRODUCT_SKU,
DMI_PRODUCT_FAMILY,
DMI_BOARD_VENDOR,
DMI_BOARD_NAME,
--
2.20.1

Loading

0 comments on commit 231bebb

Please sign in to comment.