Skip to content

Commit b899479

Browse files
shanshriyxieca
authored andcommitted
Bookworm:AMD-Pensando ELBA SOC support (#353)
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.
1 parent 07a6d64 commit b899479

File tree

35 files changed

+1675
-2653
lines changed

35 files changed

+1675
-2653
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
1-
From 3405bf6f7413dfafa5d25f0b8f92f93160f382b4 Mon Sep 17 00:00:00 2001
2-
From: Ashwin H <Ashwin.H@amd.com>
3-
Date: Wed, 5 Jul 2023 07:04:49 +0000
4-
Subject: [PATCH 27/30] hwmon: (pmbus/tps53679) Add support for TI TPS53659
1+
From 770f3b2e6f2fca2267994f4a74b921b59d9cb9a8 Mon Sep 17 00:00:00 2001
2+
From: Shantanu Shrivastava <shanshri@amd.com>
3+
Date: Tue, 24 Oct 2023 08:25:24 +0000
4+
Subject: [PATCH] Add support for the TI TPS53659
55

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

8-
Signed-off-by: Ashwin H <[email protected]>
8+
Datasheet: https://www.ti.com/lit/gpn/tps53659
9+
10+
Signed-off-by: David Clear <[email protected]>
11+
Signed-off-by: Shantanu Shrivastava <[email protected]>
912
---
1013
drivers/hwmon/pmbus/tps53679.c | 9 ++++++++-
1114
1 file changed, 8 insertions(+), 1 deletion(-)
1215

1316
diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c
14-
index db2bdf2a1..126388d86 100644
17+
index 81b9d8136..df05e7498 100644
1518
--- a/drivers/hwmon/pmbus/tps53679.c
1619
+++ b/drivers/hwmon/pmbus/tps53679.c
1720
@@ -16,7 +16,7 @@
1821
#include "pmbus.h"
1922

2023
enum chips {
21-
- tps53647, tps53667, tps53679, tps53681, tps53688
22-
+ tps53647, tps53659, tps53667, tps53679, tps53681, tps53688
24+
- tps53647, tps53667, tps53676, tps53679, tps53681, tps53688
25+
+ tps53647, tps53659, tps53667, tps53676, tps53679, tps53681, tps53688
2326
};
2427

2528
#define TPS53647_PAGE_NUM 1
26-
@@ -206,6 +206,11 @@ static int tps53679_probe(struct i2c_client *client)
27-
info->pages = TPS53647_PAGE_NUM;
28-
info->identify = tps53679_identify;
29+
@@ -252,6 +252,11 @@ static int tps53679_probe(struct i2c_client *client)
30+
case tps53676:
31+
info->identify = tps53676_identify;
2932
break;
3033
+ case tps53659:
3134
+ info->pages = TPS53679_PAGE_NUM;
@@ -35,22 +38,22 @@ index db2bdf2a1..126388d86 100644
3538
case tps53679:
3639
case tps53688:
3740
info->pages = TPS53679_PAGE_NUM;
38-
@@ -227,6 +232,7 @@ static int tps53679_probe(struct i2c_client *client)
39-
static const struct i2c_device_id tps53679_id[] = {
41+
@@ -274,6 +279,7 @@ static const struct i2c_device_id tps53679_id[] = {
42+
{"bmr474", tps53676},
4043
{"tps53647", tps53647},
4144
{"tps53667", tps53667},
4245
+ {"tps53659", tps53659},
46+
{"tps53676", tps53676},
4347
{"tps53679", tps53679},
4448
{"tps53681", tps53681},
45-
{"tps53688", tps53688},
46-
@@ -238,6 +244,7 @@ MODULE_DEVICE_TABLE(i2c, tps53679_id);
49+
@@ -286,6 +292,7 @@ MODULE_DEVICE_TABLE(i2c, tps53679_id);
4750
static const struct of_device_id __maybe_unused tps53679_of_match[] = {
4851
{.compatible = "ti,tps53647", .data = (void *)tps53647},
4952
{.compatible = "ti,tps53667", .data = (void *)tps53667},
5053
+ {.compatible = "ti,tps53659", .data = (void *)tps53659},
54+
{.compatible = "ti,tps53676", .data = (void *)tps53676},
5155
{.compatible = "ti,tps53679", .data = (void *)tps53679},
5256
{.compatible = "ti,tps53681", .data = (void *)tps53681},
53-
{.compatible = "ti,tps53688", .data = (void *)tps53688},
5457
--
55-
2.17.1
58+
2.39.2
5659

patch/0001-hwmon-ltc2978-Add-support-for-LTC3888.patch renamed to patch/0001-Adding-support-LTC3888.patch

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

6-
Add support for LTC3888 and LTC3888-1 driver
7-
Add LTC3888 IOUT support.
6+
This patch adds support for the LTC3888 VRM.
87

9-
Signed-off-by: David Clear <[email protected]>
10-
Signed-off-by: Ashwin H <[email protected]>
8+
Datasheet:
9+
https://www.analog.com/media/en/technical-documentation/data-sheets/ltc3888-3888-1-3888-2.pdf
10+
11+
Signed-off-by: David Clear <[email protected]>
12+
Signed-off-by: Shantanu Shrivastava <[email protected]>
1113
---
1214
drivers/hwmon/pmbus/ltc2978.c | 43 ++++++++++++++++++++++++++++++++++-
1315
1 file changed, 42 insertions(+), 1 deletion(-)
1416

1517
diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c
16-
index 9a024cf70..34129f053 100644
18+
index 6d2592731..057278736 100644
1719
--- a/drivers/hwmon/pmbus/ltc2978.c
1820
+++ b/drivers/hwmon/pmbus/ltc2978.c
1921
@@ -23,7 +23,8 @@ enum chips {
@@ -44,7 +46,7 @@ index 9a024cf70..34129f053 100644
4446
#define LTM2987_ID_A 0x8010 /* A/B for two die IDs */
4547
#define LTM2987_ID_B 0x8020
4648
#define LTC3889_ID 0x4900
47-
@@ -456,6 +461,26 @@ static int ltc3883_read_word_data(struct i2c_client *client, int page,
49+
@@ -467,6 +472,26 @@ static int ltc3883_read_word_data(struct i2c_client *client, int page,
4850
return ret;
4951
}
5052

@@ -71,15 +73,15 @@ index 9a024cf70..34129f053 100644
7173
static int ltc2978_clear_peaks(struct ltc2978_data *data,
7274
struct i2c_client *client, int page)
7375
{
74-
@@ -535,6 +560,7 @@ static const struct i2c_device_id ltc2978_id[] = {
76+
@@ -546,6 +571,7 @@ static const struct i2c_device_id ltc2978_id[] = {
7577
{"ltc3884", ltc3884},
7678
{"ltc3886", ltc3886},
7779
{"ltc3887", ltc3887},
7880
+ {"ltc3888", ltc3888},
7981
{"ltc3889", ltc3889},
8082
{"ltc7880", ltc7880},
8183
{"ltm2987", ltm2987},
82-
@@ -621,6 +647,8 @@ static int ltc2978_get_id(struct i2c_client *client)
84+
@@ -649,6 +675,8 @@ static int ltc2978_get_id(struct i2c_client *client)
8385
return ltc3886;
8486
else if (chip_id == LTC3887_ID)
8587
return ltc3887;
@@ -88,7 +90,7 @@ index 9a024cf70..34129f053 100644
8890
else if (chip_id == LTC3889_ID)
8991
return ltc3889;
9092
else if (chip_id == LTC7880_ID)
91-
@@ -821,6 +849,18 @@ static int ltc2978_probe(struct i2c_client *client)
93+
@@ -850,6 +878,18 @@ static int ltc2978_probe(struct i2c_client *client)
9294
| PMBUS_HAVE_POUT
9395
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
9496
break;
@@ -107,7 +109,7 @@ index 9a024cf70..34129f053 100644
107109
default:
108110
return -ENODEV;
109111
}
110-
@@ -853,6 +893,7 @@ static const struct of_device_id ltc2978_of_match[] = {
112+
@@ -901,6 +941,7 @@ static const struct of_device_id ltc2978_of_match[] = {
111113
{ .compatible = "lltc,ltc3884" },
112114
{ .compatible = "lltc,ltc3886" },
113115
{ .compatible = "lltc,ltc3887" },
@@ -116,5 +118,5 @@ index 9a024cf70..34129f053 100644
116118
{ .compatible = "lltc,ltc7880" },
117119
{ .compatible = "lltc,ltm2987" },
118120
--
119-
2.17.1
121+
2.39.2
120122

patch/0002-i2c-designware-Recover-from-a-stuck-SDA-line.patch renamed to patch/0002-i2c-designware-Support-stuck-SDA-line-recovery.patch

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

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

13-
Signed-off-by: David Clear <[email protected]>
14-
Signed-off-by: Ashwin H <Ashwin.H@amd.com>
14+
Signed-off-by: David Clear <[email protected]>
15+
Signed-off-by: Shantanu Shrivastava <shanshri@amd.com>
1516
---
1617
drivers/i2c/busses/i2c-designware-common.c | 2 +
17-
drivers/i2c/busses/i2c-designware-core.h | 10 +++
18+
drivers/i2c/busses/i2c-designware-core.h | 11 +++
1819
drivers/i2c/busses/i2c-designware-master.c | 87 ++++++++++++++++++++-
1920
drivers/i2c/busses/i2c-designware-platdrv.c | 3 +
20-
4 files changed, 100 insertions(+), 2 deletions(-)
21+
4 files changed, 101 insertions(+), 2 deletions(-)
2122

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

3435
static int dw_reg_read(void *context, unsigned int reg, unsigned int *val)
3536
diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
36-
index eb5ef4d0f..f0be70e3e 100644
37+
index 56a029da4..54e6c44e6 100644
3738
--- a/drivers/i2c/busses/i2c-designware-core.h
3839
+++ b/drivers/i2c/busses/i2c-designware-core.h
3940
@@ -37,6 +37,7 @@
40-
#define DW_IC_CON_STOP_DET_IFADDRESSED 0x80
41-
#define DW_IC_CON_TX_EMPTY_CTRL 0x100
42-
#define DW_IC_CON_RX_FIFO_FULL_HLD_CTRL 0x200
43-
+#define DW_IC_CON_BUS_CLEAR_FEATURE_CTL 0x800
44-
45-
/*
46-
* Registers offset
47-
@@ -75,6 +76,8 @@
41+
#define DW_IC_CON_STOP_DET_IFADDRESSED BIT(7)
42+
#define DW_IC_CON_TX_EMPTY_CTRL BIT(8)
43+
#define DW_IC_CON_RX_FIFO_FULL_HLD_CTRL BIT(9)
44+
+#define DW_IC_CON_BUS_CLEAR_FEATURE_CTL BIT(11)
45+
46+
#define DW_IC_DATA_CMD_DAT GENMASK(7, 0)
47+
48+
@@ -77,6 +78,8 @@
4849
#define DW_IC_TX_ABRT_SOURCE 0x80
4950
#define DW_IC_ENABLE_STATUS 0x9c
5051
#define DW_IC_CLR_RESTART_DET 0xa8
@@ -53,45 +54,50 @@ index eb5ef4d0f..f0be70e3e 100644
5354
#define DW_IC_COMP_PARAM_1 0xf4
5455
#define DW_IC_COMP_VERSION 0xf8
5556
#define DW_IC_SDA_HOLD_MIN_VERS 0x3131312A
56-
@@ -94,6 +97,7 @@
57-
#define DW_IC_INTR_START_DET 0x400
58-
#define DW_IC_INTR_GEN_CALL 0x800
59-
#define DW_IC_INTR_RESTART_DET 0x1000
60-
+#define DW_IC_INTR_SCL_STUCK_AT_LOW 0x4000
57+
@@ -96,6 +99,7 @@
58+
#define DW_IC_INTR_START_DET BIT(10)
59+
#define DW_IC_INTR_GEN_CALL BIT(11)
60+
#define DW_IC_INTR_RESTART_DET BIT(12)
61+
+#define DW_IC_INTR_SCL_STUCK_AT_LOW BIT(14)
6162

6263
#define DW_IC_INTR_DEFAULT_MASK (DW_IC_INTR_RX_FULL | \
6364
DW_IC_INTR_TX_ABRT | \
64-
@@ -105,10 +109,13 @@
65+
@@ -107,14 +111,18 @@
6566
DW_IC_INTR_RX_UNDER | \
6667
DW_IC_INTR_RD_REQ)
6768

68-
+#define DW_IC_SDA_STUCK_RECOVERY_ENABLE 0x8
69+
+#define DW_IC_SDA_STUCK_RECOVERY_ENABLE BIT(3)
6970
+
70-
#define DW_IC_STATUS_ACTIVITY 0x1
71+
#define DW_IC_STATUS_ACTIVITY BIT(0)
7172
#define DW_IC_STATUS_TFE BIT(2)
7273
#define DW_IC_STATUS_MASTER_ACTIVITY BIT(5)
7374
#define DW_IC_STATUS_SLAVE_ACTIVITY BIT(6)
7475
+#define DW_IC_STATUS_SDA_STUCK_NOT_RECOVERED BIT(11)
7576

7677
#define DW_IC_SDA_HOLD_RX_SHIFT 16
77-
#define DW_IC_SDA_HOLD_RX_MASK GENMASK(23, DW_IC_SDA_HOLD_RX_SHIFT)
78-
@@ -153,6 +160,7 @@
78+
#define DW_IC_SDA_HOLD_RX_MASK GENMASK(23, 16)
79+
80+
+
81+
#define DW_IC_ERR_TX_ABRT 0x1
82+
83+
#define DW_IC_TAR_10BITADDR_MASTER BIT(12)
84+
@@ -156,6 +164,7 @@
7985
#define ABRT_SLAVE_FLUSH_TXFIFO 13
8086
#define ABRT_SLAVE_ARBLOST 14
8187
#define ABRT_SLAVE_RD_INTX 15
8288
+#define ABRT_SDA_STUCK_AT_LOW 17
8389

84-
#define DW_IC_TX_ABRT_7B_ADDR_NOACK (1UL << ABRT_7B_ADDR_NOACK)
85-
#define DW_IC_TX_ABRT_10ADDR1_NOACK (1UL << ABRT_10ADDR1_NOACK)
86-
@@ -165,6 +173,7 @@
87-
#define DW_IC_TX_ABRT_10B_RD_NORSTRT (1UL << ABRT_10B_RD_NORSTRT)
88-
#define DW_IC_TX_ABRT_MASTER_DIS (1UL << ABRT_MASTER_DIS)
89-
#define DW_IC_TX_ARB_LOST (1UL << ARB_LOST)
90-
+#define DW_IC_TX_ABRT_SDA_STUCK_AT_LOW (1UL << ABRT_SDA_STUCK_AT_LOW)
91-
#define DW_IC_RX_ABRT_SLAVE_RD_INTX (1UL << ABRT_SLAVE_RD_INTX)
92-
#define DW_IC_RX_ABRT_SLAVE_ARBLOST (1UL << ABRT_SLAVE_ARBLOST)
93-
#define DW_IC_RX_ABRT_SLAVE_FLUSH_TXFIFO (1UL << ABRT_SLAVE_FLUSH_TXFIFO)
94-
@@ -268,6 +277,7 @@ struct dw_i2c_dev {
90+
#define DW_IC_TX_ABRT_7B_ADDR_NOACK BIT(ABRT_7B_ADDR_NOACK)
91+
#define DW_IC_TX_ABRT_10ADDR1_NOACK BIT(ABRT_10ADDR1_NOACK)
92+
@@ -168,6 +177,7 @@
93+
#define DW_IC_TX_ABRT_10B_RD_NORSTRT BIT(ABRT_10B_RD_NORSTRT)
94+
#define DW_IC_TX_ABRT_MASTER_DIS BIT(ABRT_MASTER_DIS)
95+
#define DW_IC_TX_ARB_LOST BIT(ARB_LOST)
96+
+#define DW_IC_TX_ABRT_SDA_STUCK_AT_LOW BIT(ABRT_SDA_STUCK_AT_LOW)
97+
#define DW_IC_RX_ABRT_SLAVE_RD_INTX BIT(ABRT_SLAVE_RD_INTX)
98+
#define DW_IC_RX_ABRT_SLAVE_ARBLOST BIT(ABRT_SLAVE_ARBLOST)
99+
#define DW_IC_RX_ABRT_SLAVE_FLUSH_TXFIFO BIT(ABRT_SLAVE_FLUSH_TXFIFO)
100+
@@ -277,6 +287,7 @@ struct dw_i2c_dev {
95101
int rx_outstanding;
96102
struct i2c_timings timings;
97103
u32 sda_hold_time;
@@ -100,10 +106,10 @@ index eb5ef4d0f..f0be70e3e 100644
100106
u16 ss_lcnt;
101107
u16 fs_hcnt;
102108
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
103-
index 2871cf2ee..d678b5ab2 100644
109+
index dc3c5a15a..9834137a0 100644
104110
--- a/drivers/i2c/busses/i2c-designware-master.c
105111
+++ b/drivers/i2c/busses/i2c-designware-master.c
106-
@@ -33,6 +33,45 @@ static void i2c_dw_configure_fifo_master(struct dw_i2c_dev *dev)
112+
@@ -37,6 +37,45 @@ static void i2c_dw_configure_fifo_master(struct dw_i2c_dev *dev)
107113
regmap_write(dev->map, DW_IC_CON, dev->master_cfg);
108114
}
109115

@@ -148,8 +154,8 @@ index 2871cf2ee..d678b5ab2 100644
148154
+
149155
static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev)
150156
{
151-
const char *mode_str, *fp_str = "";
152-
@@ -500,6 +539,14 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
157+
u32 comp_param1;
158+
@@ -599,6 +638,14 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
153159
goto done;
154160
}
155161

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

@@ -204,7 +210,7 @@ index 2871cf2ee..d678b5ab2 100644
204210
static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
205211
{
206212
struct i2c_bus_recovery_info *rinfo = &dev->rinfo;
207-
@@ -718,8 +798,11 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
213+
@@ -833,8 +913,11 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
208214
struct gpio_desc *gpio;
209215

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

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

@@ -233,5 +239,5 @@ index ad91c7c0f..d7a6cbd99 100644
233239
case MODEL_MSCC_OCELOT:
234240
dev->ext = devm_platform_ioremap_resource(pdev, 1);
235241
--
236-
2.17.1
242+
2.39.2
237243

0 commit comments

Comments
 (0)