sonic-buildimage/platform/mellanox/non-upstream-patches/patches/0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch
Vivek 342604a4bb
[mellanox] Integrate HW-MGMT Version 7.0030.2008 (#17170)
* [Mellanox] Don't populate arm64 Kconfig when integrating hw-mgmt

Signed-off-by: Vivek Reddy <vkarri@nvidia.com>

* Intgerate HW-MGMT 7.0030.2008 Changes

 ## Patch List
* 0285-UBUNTU-SAUCE-mlxbf-gige-Fix-intermittent-no-ip-issue.patch :
* 0286-pinctrl-Introduce-struct-pinfunction-and-PINCTRL_PIN.patch :
* 0287-pinctrl-mlxbf3-Add-pinctrl-driver-support.patch :
* 0288-UBUNTU-SAUCE-gpio-mmio-handle-ngpios-properly-in-bgp.patch :
* 0289-UBUNTU-SAUCE-gpio-mlxbf3-Add-gpio-driver-support.patch :
* 0291-mlxsw-core_hwmon-Align-modules-label-name-assignment.patch :
* 0292-mlxsw-i2c-Limit-single-transaction-buffer-size.patch :
* 0293-mlxsw-reg-Limit-MTBR-register-records-buffer-by-one-.patch :
* 0296-UBUNTU-SAUCE-mmc-sdhci-of-dwcmshc-Add-runtime-PM-ope.patch :
* 0298-UBUNTU-SAUCE-mlxbf-ptm-use-0444-instead-of-S_IRUGO.patch :
* 0299-UBUNTU-SAUCE-mlxbf-ptm-add-atx-debugfs-nodes.patch :
* 0300-UBUNTU-SAUCE-mlxbf-ptm-update-module-version.patch :
* 0301-UBUNTU-SAUCE-mlxbf-gige-Fix-kernel-panic-at-shutdown.patch :
* 0302-UBUNTU-SAUCE-mlxbf-bootctl-support-SMC-call-for-sett.patch :
* 0303-UBUNTU-SAUCE-Add-BF3-related-ACPI-config-and-Ring-de.patch :
* 0306-dt-bindings-trivial-devices-Add-infineon-xdpe1a2g7.patch :
* 0307-leds-mlxreg-Add-support-for-new-flavour-of-capabilit.patch :
* 0308-leds-mlxreg-Remove-code-for-amber-LED-colour.patch :
* 0308-platform_data-mlxreg-Add-capability-bit-and-mask-fie.patch :
* 0309-hwmon-mlxreg-fan-Add-support-for-new-flavour-of-capa.patch :
* 0310-hwmon-mlxreg-fan-Extend-number-of-supporetd-fans.patch :
* 0317-platform-mellanox-Introduce-support-for-switches-equ.patch :
* 0318-mellanox-Relocate-mlx-platform-driver.patch :
* 0319-UBUNTU-SAUCE-mlxbf-tmfifo-fix-potential-race.patch :
* 0320-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-the-Rx-packet-if-no-m.patch :
* 0321-UBUNTU-SAUCE-mlxbf-tmfifo-Drop-jumbo-frames.patch :
* 0322-UBUNTU-SAUCE-mlxbf-tmfifo.c-Amend-previous-tmfifo-pa.patch :
* 0323-mlxbf_gige-add-set_link_ksettings-ethtool-callback.patch :
* 0324-mlxbf_gige-fix-white-space-in-mlxbf_gige_eth_ioctl.patch :
* 0325-UBUNTU-SAUCE-mlxbf-bootctl-Fix-kernel-panic-due-to-b.patch :
* 0326-platform-mellanox-mlxreg-hotplug-Add-support-for-new.patch :
* 0327-platform-mellanox-mlx-platform-Change-register-name.patch :
* 0328-platform-mellanox-mlx-platform-Add-support-for-new-X.patch :

* [Mellanox] Remove thermal zone related code and replace with new one

* Revert "Revert "[Mellanox] Align PSU temperature sysfs node name with hw-management change (#16820)" (#16956)"

This reverts commit c2edc6f9d5.

---------

Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
Co-authored-by: Junchao-Mellanox <junchao@nvidia.com>
Co-authored-by: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com>
2023-11-16 22:49:29 +08:00

136 lines
5.2 KiB
Diff

From 8660928fa01c363f1aa826d392de2c6ef4924dcf Mon Sep 17 00:00:00 2001
From: Shih-Yi Chen <shihyic@nvidia.com>
Date: Wed, 5 Apr 2023 14:41:27 -0400
Subject: [PATCH] UBUNTU: SAUCE: Add BF3 related ACPI config and Ring device
creation code
X-NVConfidentiality: public
BugLink: https://bugs.launchpad.net/bugs/2015292
Fixed Missing ACPI device info in mlxbf_pka module. Added configuration info
and associated code to provision PKA ring devices.
Signed-off-by: Shih-Yi Chen <shihyic@nvidia.com>
Reviewed-by: Khalil Blaiech <kblaiech@nvidia.com>
Acked-by: Bartlomiej Zolnierkiewicz <bartlomiej.zolnierkiewicz@canonical.com>
Acked-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bartlomiej.zolnierkiewicz@canonical.com>
---
.../platform/mellanox/mlxbf_pka/mlxbf_pka_config.h | 9 ++++++---
.../platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c | 23 +++++++++++++++++++---
2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h
index 5b69d55be..c9543416b 100644
--- a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h
+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_config.h
@@ -37,7 +37,7 @@
#include "mlxbf_pka_addrs.h"
// The maximum number of PKA shims refered to as IO blocks.
-#define PKA_MAX_NUM_IO_BLOCKS 8
+#define PKA_MAX_NUM_IO_BLOCKS 24
// The maximum number of Rings supported by IO block (shim).
#define PKA_MAX_NUM_IO_BLOCK_RINGS 4
@@ -72,8 +72,11 @@
#define PKA_WINDOW_RAM_RING_MEM_SIZE 0x0800 // 2KB
#define PKA_WINDOW_RAM_DATA_MEM_SIZE 0x3800 // 14KB
-// Offset mask, common to both Window and Alternate Window RAM.
-#define PKA_WINDOW_RAM_OFFSET_MASK1 0x730000
+// Window RAM/Alternate Window RAM offset mask for BF1 and BF2
+#define PKA_WINDOW_RAM_OFFSET_MASK1 0x730000
+//
+// Window RAM/Alternate Window RAM offset mask for BF3
+#define PKA_WINDOW_RAM_OFFSET_MASK2 0x70000
// Macro for mapping PKA Ring address into Window RAM address. It converts the
// ring address, either physical address or virtual address, to valid address
diff --git a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c
index 9e26ccf21..6b171b2a6 100644
--- a/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c
+++ b/drivers/platform/mellanox/mlxbf_pka/mlxbf_pka_drv.c
@@ -34,6 +34,9 @@
#define PKA_DEVICE_ACPIHID_BF2 "MLNXBF20"
#define PKA_RING_DEVICE_ACPIHID_BF2 "MLNXBF21"
+#define PKA_DEVICE_ACPIHID_BF3 "MLNXBF51"
+#define PKA_RING_DEVICE_ACPIHID_BF3 "MLNXBF52"
+
#define PKA_DEVICE_ACCESS_MODE 0666
#define PKA_DEVICE_RES_CNT 7
@@ -49,7 +52,8 @@ enum pka_mem_res_idx {
enum pka_plat_type {
PKA_PLAT_TYPE_BF1 = 0, /* Platform type Bluefield-1 */
- PKA_PLAT_TYPE_BF2 /* Platform type Bluefield-2 */
+ PKA_PLAT_TYPE_BF2, /* Platform type Bluefield-2 */
+ PKA_PLAT_TYPE_BF3 /* Platform type Bluefield-3 */
};
static DEFINE_MUTEX(pka_drv_lock);
@@ -66,6 +70,9 @@ const char pka_ring_acpihid_bf1[] = PKA_RING_DEVICE_ACPIHID_BF1;
const char pka_acpihid_bf2[] = PKA_DEVICE_ACPIHID_BF2;
const char pka_ring_acpihid_bf2[] = PKA_RING_DEVICE_ACPIHID_BF2;
+const char pka_acpihid_bf3[] = PKA_DEVICE_ACPIHID_BF3;
+const char pka_ring_acpihid_bf3[] = PKA_RING_DEVICE_ACPIHID_BF3;
+
struct pka_drv_plat_info {
enum pka_plat_type type;
uint8_t fw_id;
@@ -79,6 +86,10 @@ static struct pka_drv_plat_info pka_drv_plat[] = {
[PKA_PLAT_TYPE_BF2] = {
.type = PKA_PLAT_TYPE_BF2,
.fw_id = PKA_FIRMWARE_IMAGE_2_ID
+ },
+ [PKA_PLAT_TYPE_BF3] = {
+ .type = PKA_PLAT_TYPE_BF3,
+ .fw_id = PKA_FIRMWARE_IMAGE_2_ID
}
};
@@ -87,6 +98,8 @@ static const struct acpi_device_id pka_drv_acpi_ids[] = {
{ PKA_RING_DEVICE_ACPIHID_BF1, 0 },
{ PKA_DEVICE_ACPIHID_BF2, (kernel_ulong_t)&pka_drv_plat[PKA_PLAT_TYPE_BF2] },
{ PKA_RING_DEVICE_ACPIHID_BF2, 0 },
+ { PKA_DEVICE_ACPIHID_BF3, (kernel_ulong_t)&pka_drv_plat[PKA_PLAT_TYPE_BF3] },
+ { PKA_RING_DEVICE_ACPIHID_BF3, 0 },
{},
};
@@ -967,6 +980,8 @@ static int pka_drv_probe_device(struct pka_info *info)
plat_info = (struct pka_drv_plat_info *)aid->driver_data;
if (plat_info->type <= PKA_PLAT_TYPE_BF2) {
wndw_ram_off_mask = PKA_WINDOW_RAM_OFFSET_MASK1;
+ } else if (plat_info->type <= PKA_PLAT_TYPE_BF3) {
+ wndw_ram_off_mask = PKA_WINDOW_RAM_OFFSET_MASK2;
} else {
PKA_ERROR(PKA_DRIVER, "Invalid platform type: %d\n",
(int)plat_info->type);
@@ -1210,7 +1225,8 @@ static int pka_drv_acpi_probe(struct platform_device *pdev,
return -EINVAL;
if (!strcmp(info->acpihid, pka_ring_acpihid_bf1)
- || !strcmp(info->acpihid, pka_ring_acpihid_bf2)) {
+ || !strcmp(info->acpihid, pka_ring_acpihid_bf2)
+ || !strcmp(info->acpihid, pka_ring_acpihid_bf3)) {
error = pka_drv_probe_ring_device(info);
if (error) {
PKA_DEBUG(PKA_DRIVER,
@@ -1222,7 +1238,8 @@ static int pka_drv_acpi_probe(struct platform_device *pdev,
pdev->name);
} else if (!strcmp(info->acpihid, pka_acpihid_bf1)
- || !strcmp(info->acpihid, pka_acpihid_bf2)) {
+ || !strcmp(info->acpihid, pka_acpihid_bf2)
+ || !strcmp(info->acpihid, pka_acpihid_bf3)) {
error = pka_drv_probe_device(info);
if (error) {
PKA_DEBUG(PKA_DRIVER,
--
2.14.1