Skip to content

Commit

Permalink
Bookworm:AMD-Pensando ELBA SOC support (#353)
Browse files Browse the repository at this point in the history
This is a change request for updating the kernel patches for AMD-Pensando ELBA SOC to linux 6.1 based bookworm.

The patches has been refactored in line with the latest kernel patches released by pensando linux team.

Elba provides a secure, controlled portal to network services, storage, and the data center control plane. This SOC is used in AMD-Pensando PCI Distributed Services Card (DSC).

The changes are verified on Pensando DSC2-200 card.
  • Loading branch information
shanshri authored and yxieca committed Nov 20, 2023
1 parent 07a6d64 commit b899479
Show file tree
Hide file tree
Showing 35 changed files with 1,675 additions and 2,653 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
From 3405bf6f7413dfafa5d25f0b8f92f93160f382b4 Mon Sep 17 00:00:00 2001
From: Ashwin H <Ashwin.H@amd.com>
Date: Wed, 5 Jul 2023 07:04:49 +0000
Subject: [PATCH 27/30] hwmon: (pmbus/tps53679) Add support for TI TPS53659
From 770f3b2e6f2fca2267994f4a74b921b59d9cb9a8 Mon Sep 17 00:00:00 2001
From: Shantanu Shrivastava <shanshri@amd.com>
Date: Tue, 24 Oct 2023 08:25:24 +0000
Subject: [PATCH] Add support for the TI TPS53659

Add support for TI TPS53659 controller to the tps53679 pmbus driver
This patch adds support for the Texas Instruments TPS53659.

Signed-off-by: Ashwin H <Ashwin.H@amd.com>
Datasheet: https://www.ti.com/lit/gpn/tps53659

Signed-off-by: David Clear <dclear@amd.com>
Signed-off-by: Shantanu Shrivastava <shanshri@amd.com>
---
drivers/hwmon/pmbus/tps53679.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c
index db2bdf2a1..126388d86 100644
index 81b9d8136..df05e7498 100644
--- a/drivers/hwmon/pmbus/tps53679.c
+++ b/drivers/hwmon/pmbus/tps53679.c
@@ -16,7 +16,7 @@
#include "pmbus.h"

enum chips {
- tps53647, tps53667, tps53679, tps53681, tps53688
+ tps53647, tps53659, tps53667, tps53679, tps53681, tps53688
- tps53647, tps53667, tps53676, tps53679, tps53681, tps53688
+ tps53647, tps53659, tps53667, tps53676, tps53679, tps53681, tps53688
};

#define TPS53647_PAGE_NUM 1
@@ -206,6 +206,11 @@ static int tps53679_probe(struct i2c_client *client)
info->pages = TPS53647_PAGE_NUM;
info->identify = tps53679_identify;
@@ -252,6 +252,11 @@ static int tps53679_probe(struct i2c_client *client)
case tps53676:
info->identify = tps53676_identify;
break;
+ case tps53659:
+ info->pages = TPS53679_PAGE_NUM;
Expand All @@ -35,22 +38,22 @@ index db2bdf2a1..126388d86 100644
case tps53679:
case tps53688:
info->pages = TPS53679_PAGE_NUM;
@@ -227,6 +232,7 @@ static int tps53679_probe(struct i2c_client *client)
static const struct i2c_device_id tps53679_id[] = {
@@ -274,6 +279,7 @@ static const struct i2c_device_id tps53679_id[] = {
{"bmr474", tps53676},
{"tps53647", tps53647},
{"tps53667", tps53667},
+ {"tps53659", tps53659},
{"tps53676", tps53676},
{"tps53679", tps53679},
{"tps53681", tps53681},
{"tps53688", tps53688},
@@ -238,6 +244,7 @@ MODULE_DEVICE_TABLE(i2c, tps53679_id);
@@ -286,6 +292,7 @@ MODULE_DEVICE_TABLE(i2c, tps53679_id);
static const struct of_device_id __maybe_unused tps53679_of_match[] = {
{.compatible = "ti,tps53647", .data = (void *)tps53647},
{.compatible = "ti,tps53667", .data = (void *)tps53667},
+ {.compatible = "ti,tps53659", .data = (void *)tps53659},
{.compatible = "ti,tps53676", .data = (void *)tps53676},
{.compatible = "ti,tps53679", .data = (void *)tps53679},
{.compatible = "ti,tps53681", .data = (void *)tps53681},
{.compatible = "ti,tps53688", .data = (void *)tps53688},
--
2.17.1
2.39.2

Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
From 7096c2c942eb2294e42b279f6fd60d780fb13db5 Mon Sep 17 00:00:00 2001
From: Ashwin H <Ashwin.H@amd.com>
Date: Tue, 27 Jun 2023 06:32:53 +0000
Subject: [PATCH 01/30] hwmon: (ltc2978) Add support for LTC3888
From 8d398701b1062464c2618b95aed5798dc749a941 Mon Sep 17 00:00:00 2001
From: Shantanu Shrivastava <shanshri@amd.com>
Date: Tue, 24 Oct 2023 08:29:14 +0000
Subject: [PATCH] Adding support LTC3888

Add support for LTC3888 and LTC3888-1 driver
Add LTC3888 IOUT support.
This patch adds support for the LTC3888 VRM.

Signed-off-by: David Clear <dac2@pensando.io>
Signed-off-by: Ashwin H <Ashwin.H@amd.com>
Datasheet:
https://www.analog.com/media/en/technical-documentation/data-sheets/ltc3888-3888-1-3888-2.pdf

Signed-off-by: David Clear <dclear@amd.com>
Signed-off-by: Shantanu Shrivastava <shanshri@amd.com>
---
drivers/hwmon/pmbus/ltc2978.c | 43 ++++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c
index 9a024cf70..34129f053 100644
index 6d2592731..057278736 100644
--- a/drivers/hwmon/pmbus/ltc2978.c
+++ b/drivers/hwmon/pmbus/ltc2978.c
@@ -23,7 +23,8 @@ enum chips {
Expand Down Expand Up @@ -44,7 +46,7 @@ index 9a024cf70..34129f053 100644
#define LTM2987_ID_A 0x8010 /* A/B for two die IDs */
#define LTM2987_ID_B 0x8020
#define LTC3889_ID 0x4900
@@ -456,6 +461,26 @@ static int ltc3883_read_word_data(struct i2c_client *client, int page,
@@ -467,6 +472,26 @@ static int ltc3883_read_word_data(struct i2c_client *client, int page,
return ret;
}

Expand All @@ -71,15 +73,15 @@ index 9a024cf70..34129f053 100644
static int ltc2978_clear_peaks(struct ltc2978_data *data,
struct i2c_client *client, int page)
{
@@ -535,6 +560,7 @@ static const struct i2c_device_id ltc2978_id[] = {
@@ -546,6 +571,7 @@ static const struct i2c_device_id ltc2978_id[] = {
{"ltc3884", ltc3884},
{"ltc3886", ltc3886},
{"ltc3887", ltc3887},
+ {"ltc3888", ltc3888},
{"ltc3889", ltc3889},
{"ltc7880", ltc7880},
{"ltm2987", ltm2987},
@@ -621,6 +647,8 @@ static int ltc2978_get_id(struct i2c_client *client)
@@ -649,6 +675,8 @@ static int ltc2978_get_id(struct i2c_client *client)
return ltc3886;
else if (chip_id == LTC3887_ID)
return ltc3887;
Expand All @@ -88,7 +90,7 @@ index 9a024cf70..34129f053 100644
else if (chip_id == LTC3889_ID)
return ltc3889;
else if (chip_id == LTC7880_ID)
@@ -821,6 +849,18 @@ static int ltc2978_probe(struct i2c_client *client)
@@ -850,6 +878,18 @@ static int ltc2978_probe(struct i2c_client *client)
| PMBUS_HAVE_POUT
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
break;
Expand All @@ -107,7 +109,7 @@ index 9a024cf70..34129f053 100644
default:
return -ENODEV;
}
@@ -853,6 +893,7 @@ static const struct of_device_id ltc2978_of_match[] = {
@@ -901,6 +941,7 @@ static const struct of_device_id ltc2978_of_match[] = {
{ .compatible = "lltc,ltc3884" },
{ .compatible = "lltc,ltc3886" },
{ .compatible = "lltc,ltc3887" },
Expand All @@ -116,5 +118,5 @@ index 9a024cf70..34129f053 100644
{ .compatible = "lltc,ltc7880" },
{ .compatible = "lltc,ltm2987" },
--
2.17.1
2.39.2

Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
From 07d6fc782dd86ad386e9cc5eb13cbeec20a46db9 Mon Sep 17 00:00:00 2001
From: Ashwin H <Ashwin.H@amd.com>
Date: Tue, 27 Jun 2023 11:13:05 +0000
Subject: [PATCH 02/30] i2c: designware: Recover from a stuck SDA line
From f3c0cb78c3982c60e9a5e2705c9939f1eef84002 Mon Sep 17 00:00:00 2001
From: Shantanu Shrivastava <shanshri@amd.com>
Date: Tue, 24 Oct 2023 08:36:35 +0000
Subject: [PATCH] i2c-designware: Support stuck SDA line recovery

This patch supports the Designware I2C stuck bus recovery feature.
The procedure for stuck SDA recovery involves a polling loop in interrupt
The procedure for stuck SDA recovery involves a polling loop in
interrupt
mode. This should last just long enough for transmission of 9 bits,
after which the hardware should indicate that the recovery attempt is
complete. There have been examples where this fails, so there is also
a hard maximum on time in the recovery loop.

Signed-off-by: David Clear <dac2@pensando.io>
Signed-off-by: Ashwin H <Ashwin.H@amd.com>
Signed-off-by: David Clear <dclear@amd.com>
Signed-off-by: Shantanu Shrivastava <shanshri@amd.com>
---
drivers/i2c/busses/i2c-designware-common.c | 2 +
drivers/i2c/busses/i2c-designware-core.h | 10 +++
drivers/i2c/busses/i2c-designware-core.h | 11 +++
drivers/i2c/busses/i2c-designware-master.c | 87 ++++++++++++++++++++-
drivers/i2c/busses/i2c-designware-platdrv.c | 3 +
4 files changed, 100 insertions(+), 2 deletions(-)
4 files changed, 101 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c
index 9468c6c89..95b082361 100644
index 6fdb25a5f..8ac32dd41 100644
--- a/drivers/i2c/busses/i2c-designware-common.c
+++ b/drivers/i2c/busses/i2c-designware-common.c
@@ -56,6 +56,8 @@ static char *abort_sources[] = {
@@ -57,6 +57,8 @@ static char *abort_sources[] = {
"slave lost the bus while transmitting data to a remote master",
[ABRT_SLAVE_RD_INTX] =
"incorrect slave-transmitter mode configuration",
Expand All @@ -33,18 +34,18 @@ index 9468c6c89..95b082361 100644

static int dw_reg_read(void *context, unsigned int reg, unsigned int *val)
diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
index eb5ef4d0f..f0be70e3e 100644
index 56a029da4..54e6c44e6 100644
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -37,6 +37,7 @@
#define DW_IC_CON_STOP_DET_IFADDRESSED 0x80
#define DW_IC_CON_TX_EMPTY_CTRL 0x100
#define DW_IC_CON_RX_FIFO_FULL_HLD_CTRL 0x200
+#define DW_IC_CON_BUS_CLEAR_FEATURE_CTL 0x800

/*
* Registers offset
@@ -75,6 +76,8 @@
#define DW_IC_CON_STOP_DET_IFADDRESSED BIT(7)
#define DW_IC_CON_TX_EMPTY_CTRL BIT(8)
#define DW_IC_CON_RX_FIFO_FULL_HLD_CTRL BIT(9)
+#define DW_IC_CON_BUS_CLEAR_FEATURE_CTL BIT(11)

#define DW_IC_DATA_CMD_DAT GENMASK(7, 0)

@@ -77,6 +78,8 @@
#define DW_IC_TX_ABRT_SOURCE 0x80
#define DW_IC_ENABLE_STATUS 0x9c
#define DW_IC_CLR_RESTART_DET 0xa8
Expand All @@ -53,45 +54,50 @@ index eb5ef4d0f..f0be70e3e 100644
#define DW_IC_COMP_PARAM_1 0xf4
#define DW_IC_COMP_VERSION 0xf8
#define DW_IC_SDA_HOLD_MIN_VERS 0x3131312A
@@ -94,6 +97,7 @@
#define DW_IC_INTR_START_DET 0x400
#define DW_IC_INTR_GEN_CALL 0x800
#define DW_IC_INTR_RESTART_DET 0x1000
+#define DW_IC_INTR_SCL_STUCK_AT_LOW 0x4000
@@ -96,6 +99,7 @@
#define DW_IC_INTR_START_DET BIT(10)
#define DW_IC_INTR_GEN_CALL BIT(11)
#define DW_IC_INTR_RESTART_DET BIT(12)
+#define DW_IC_INTR_SCL_STUCK_AT_LOW BIT(14)

#define DW_IC_INTR_DEFAULT_MASK (DW_IC_INTR_RX_FULL | \
DW_IC_INTR_TX_ABRT | \
@@ -105,10 +109,13 @@
@@ -107,14 +111,18 @@
DW_IC_INTR_RX_UNDER | \
DW_IC_INTR_RD_REQ)

+#define DW_IC_SDA_STUCK_RECOVERY_ENABLE 0x8
+#define DW_IC_SDA_STUCK_RECOVERY_ENABLE BIT(3)
+
#define DW_IC_STATUS_ACTIVITY 0x1
#define DW_IC_STATUS_ACTIVITY BIT(0)
#define DW_IC_STATUS_TFE BIT(2)
#define DW_IC_STATUS_MASTER_ACTIVITY BIT(5)
#define DW_IC_STATUS_SLAVE_ACTIVITY BIT(6)
+#define DW_IC_STATUS_SDA_STUCK_NOT_RECOVERED BIT(11)

#define DW_IC_SDA_HOLD_RX_SHIFT 16
#define DW_IC_SDA_HOLD_RX_MASK GENMASK(23, DW_IC_SDA_HOLD_RX_SHIFT)
@@ -153,6 +160,7 @@
#define DW_IC_SDA_HOLD_RX_MASK GENMASK(23, 16)

+
#define DW_IC_ERR_TX_ABRT 0x1

#define DW_IC_TAR_10BITADDR_MASTER BIT(12)
@@ -156,6 +164,7 @@
#define ABRT_SLAVE_FLUSH_TXFIFO 13
#define ABRT_SLAVE_ARBLOST 14
#define ABRT_SLAVE_RD_INTX 15
+#define ABRT_SDA_STUCK_AT_LOW 17

#define DW_IC_TX_ABRT_7B_ADDR_NOACK (1UL << ABRT_7B_ADDR_NOACK)
#define DW_IC_TX_ABRT_10ADDR1_NOACK (1UL << ABRT_10ADDR1_NOACK)
@@ -165,6 +173,7 @@
#define DW_IC_TX_ABRT_10B_RD_NORSTRT (1UL << ABRT_10B_RD_NORSTRT)
#define DW_IC_TX_ABRT_MASTER_DIS (1UL << ABRT_MASTER_DIS)
#define DW_IC_TX_ARB_LOST (1UL << ARB_LOST)
+#define DW_IC_TX_ABRT_SDA_STUCK_AT_LOW (1UL << ABRT_SDA_STUCK_AT_LOW)
#define DW_IC_RX_ABRT_SLAVE_RD_INTX (1UL << ABRT_SLAVE_RD_INTX)
#define DW_IC_RX_ABRT_SLAVE_ARBLOST (1UL << ABRT_SLAVE_ARBLOST)
#define DW_IC_RX_ABRT_SLAVE_FLUSH_TXFIFO (1UL << ABRT_SLAVE_FLUSH_TXFIFO)
@@ -268,6 +277,7 @@ struct dw_i2c_dev {
#define DW_IC_TX_ABRT_7B_ADDR_NOACK BIT(ABRT_7B_ADDR_NOACK)
#define DW_IC_TX_ABRT_10ADDR1_NOACK BIT(ABRT_10ADDR1_NOACK)
@@ -168,6 +177,7 @@
#define DW_IC_TX_ABRT_10B_RD_NORSTRT BIT(ABRT_10B_RD_NORSTRT)
#define DW_IC_TX_ABRT_MASTER_DIS BIT(ABRT_MASTER_DIS)
#define DW_IC_TX_ARB_LOST BIT(ARB_LOST)
+#define DW_IC_TX_ABRT_SDA_STUCK_AT_LOW BIT(ABRT_SDA_STUCK_AT_LOW)
#define DW_IC_RX_ABRT_SLAVE_RD_INTX BIT(ABRT_SLAVE_RD_INTX)
#define DW_IC_RX_ABRT_SLAVE_ARBLOST BIT(ABRT_SLAVE_ARBLOST)
#define DW_IC_RX_ABRT_SLAVE_FLUSH_TXFIFO BIT(ABRT_SLAVE_FLUSH_TXFIFO)
@@ -277,6 +287,7 @@ struct dw_i2c_dev {
int rx_outstanding;
struct i2c_timings timings;
u32 sda_hold_time;
Expand All @@ -100,10 +106,10 @@ index eb5ef4d0f..f0be70e3e 100644
u16 ss_lcnt;
u16 fs_hcnt;
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
index 2871cf2ee..d678b5ab2 100644
index dc3c5a15a..9834137a0 100644
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -33,6 +33,45 @@ static void i2c_dw_configure_fifo_master(struct dw_i2c_dev *dev)
@@ -37,6 +37,45 @@ static void i2c_dw_configure_fifo_master(struct dw_i2c_dev *dev)
regmap_write(dev->map, DW_IC_CON, dev->master_cfg);
}

Expand Down Expand Up @@ -148,8 +154,8 @@ index 2871cf2ee..d678b5ab2 100644
+
static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev)
{
const char *mode_str, *fp_str = "";
@@ -500,6 +539,14 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
u32 comp_param1;
@@ -599,6 +638,14 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
goto done;
}

Expand All @@ -164,7 +170,7 @@ index 2871cf2ee..d678b5ab2 100644
/*
* We must disable the adapter before returning and signaling the end
* of the current transfer. Otherwise the hardware might continue
@@ -711,6 +758,39 @@ static void i2c_dw_unprepare_recovery(struct i2c_adapter *adap)
@@ -826,6 +873,39 @@ static void i2c_dw_unprepare_recovery(struct i2c_adapter *adap)
i2c_dw_init_master(dev);
}

Expand Down Expand Up @@ -204,7 +210,7 @@ index 2871cf2ee..d678b5ab2 100644
static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
{
struct i2c_bus_recovery_info *rinfo = &dev->rinfo;
@@ -718,8 +798,11 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
@@ -833,8 +913,11 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
struct gpio_desc *gpio;

gpio = devm_gpiod_get_optional(dev->dev, "scl", GPIOD_OUT_HIGH);
Expand All @@ -219,10 +225,10 @@ index 2871cf2ee..d678b5ab2 100644
rinfo->scl_gpiod = gpio;

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index ad91c7c0f..d7a6cbd99 100644
index 74182db03..7466d748b 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -135,6 +135,9 @@ static int dw_i2c_of_configure(struct platform_device *pdev)
@@ -136,6 +136,9 @@ static int dw_i2c_of_configure(struct platform_device *pdev)
{
struct dw_i2c_dev *dev = platform_get_drvdata(pdev);

Expand All @@ -233,5 +239,5 @@ index ad91c7c0f..d7a6cbd99 100644
case MODEL_MSCC_OCELOT:
dev->ext = devm_platform_ioremap_resource(pdev, 1);
--
2.17.1
2.39.2

Loading

0 comments on commit b899479

Please sign in to comment.