Skip to content

Commit

Permalink
AMD-Pensando ELBA SOC support (#322)
Browse files Browse the repository at this point in the history
* amd-pensando elba soc support

* AMD-Pensando ELBA SOC support

This patchset adds support for AMD-Pensando ELBA SOC.
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.
There are two uplink ports and one management port.
The links and traffic has been tested on all the ports.

Signed-off-by: Ashwin H <Ashwin.H@amd.com>

* Update patchset with review comments addressed

Update configs with only platform specific configs
Update commit message for few patches
Add quirks for pensando qspi controller which was missed in
earlier patchset.

* Update azp for pensando

Added platform along with architecture for azp builds.
Default platform is set to 'vs' as per latest change in
sonic-linux-kernel

* Remove ext3 fs config

* Remove legacy configs

* make generic config changes for arm64

Some configs part of pensando can be made arm64 generic config.
This change is done in this commit.

* Fix generic arm64 build

---------

Signed-off-by: Ashwin H <Ashwin.H@amd.com>
  • Loading branch information
ashwin-h committed Aug 30, 2023
1 parent a2aa335 commit 1800d11
Show file tree
Hide file tree
Showing 35 changed files with 13,550 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ parameters:
- armhf
- arm64

- name: platform
type: string
values:
- vs
- pensando
default: vs

- name: pool
type: string
values:
Expand All @@ -28,7 +35,7 @@ parameters:
jobs:
- job:
pool: ${{ parameters.pool }}
displayName: ${{ parameters.arch }}
displayName: ${{ parameters.platform }}-${{ parameters.arch }}
timeoutInMinutes: ${{ parameters.timeout }}

container:
Expand All @@ -43,7 +50,7 @@ jobs:
git config --global user.name "Guohan Lu"
export kernel_procure_method=build
cat /proc/cpuinfo
CONFIGURED_ARCH=${{ parameters.arch }} make
CONFIGURED_ARCH=${{ parameters.arch }} CONFIGURED_PLATFORM=${{ parameters.platform }} make
displayName: "Compile sonic kernel"
- publish: $(System.DefaultWorkingDirectory)/
artifact: ${{ parameters.artifact_name }}
Expand Down
7 changes: 7 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@ stages:
sonic_slave: sonic-slave-bullseye-armhf
artifact_name: sonic-linux-kernel.armhf

- template: .azure-pipelines/build-template.yml
parameters:
arch: arm64
platform: pensando
pool: sonicbld-arm64
sonic_slave: sonic-slave-bullseye-arm64
artifact_name: sonic-linux-kernel.pensando.arm64

120 changes: 120 additions & 0 deletions patch/0001-hwmon-ltc2978-Add-support-for-LTC3888.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
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

Add support for LTC3888 and LTC3888-1 driver
Add LTC3888 IOUT support.

Signed-off-by: David Clear <dac2@pensando.io>
Signed-off-by: Ashwin H <Ashwin.H@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
--- a/drivers/hwmon/pmbus/ltc2978.c
+++ b/drivers/hwmon/pmbus/ltc2978.c
@@ -23,7 +23,8 @@ enum chips {
/* Managers */
ltc2972, ltc2974, ltc2975, ltc2977, ltc2978, ltc2979, ltc2980,
/* Controllers */
- ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887, ltc3889, ltc7880,
+ ltc3880, ltc3882, ltc3883, ltc3884, ltc3886, ltc3887, ltc3888, ltc3889,
+ ltc7880,
/* Modules */
ltm2987, ltm4664, ltm4675, ltm4676, ltm4677, ltm4678, ltm4680, ltm4686,
ltm4700,
@@ -53,6 +54,8 @@ enum chips {
/* LTC3883, LTC3884, LTC3886, LTC3889 and LTC7880 only */
#define LTC3883_MFR_IIN_PEAK 0xe1

+/* LTC3888 only */
+#define LTC3888_MFR_TOTAL_IOUT 0xe1

/* LTC2975 only */
#define LTC2975_MFR_IIN_PEAK 0xc4
@@ -79,6 +82,8 @@ enum chips {
#define LTC3884_ID 0x4C00
#define LTC3886_ID 0x4600
#define LTC3887_ID 0x4700
+#define LTC3888_ID 0x4800
+#define LTC3888_ID_D1 0x4880 /* Dash 1 */
#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,
return ret;
}

+static int ltc3888_read_word_data(struct i2c_client *client, int page,
+ int phase, int reg)
+{
+ const struct pmbus_driver_info *info = pmbus_get_driver_info(client);
+ struct ltc2978_data *data = to_ltc2978_data(info);
+ int ret;
+
+ switch (reg) {
+ case PMBUS_VIRT_READ_IOUT_AVG:
+ ret = ltc_read_word_data(client, page, 0xff,
+ LTC3888_MFR_TOTAL_IOUT);
+ data->iout_max[page] = lin11_to_val(ret);
+ break;
+ default:
+ ret = ltc3880_read_word_data(client, page, phase, reg);
+ break;
+ }
+ return ret;
+}
+
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[] = {
{"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)
return ltc3886;
else if (chip_id == LTC3887_ID)
return ltc3887;
+ else if (chip_id == LTC3888_ID || chip_id == LTC3888_ID_D1)
+ return ltc3888;
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)
| PMBUS_HAVE_POUT
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
break;
+ case ltc3888:
+ data->features |= FEAT_CLEAR_PEAKS | FEAT_NEEDS_POLLING;
+ info->read_word_data = ltc3888_read_word_data;
+ info->pages = LTC3880_NUM_PAGES;
+ info->func[0] = PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_STATUS_IOUT
+ | PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP
+ | PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT
+ | PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2;
+ info->func[1] = PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_STATUS_IOUT
+ | PMBUS_HAVE_STATUS_TEMP | PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT
+ | PMBUS_HAVE_TEMP;
+ break;
default:
return -ENODEV;
}
@@ -853,6 +893,7 @@ static const struct of_device_id ltc2978_of_match[] = {
{ .compatible = "lltc,ltc3884" },
{ .compatible = "lltc,ltc3886" },
{ .compatible = "lltc,ltc3887" },
+ { .compatible = "lltc,ltc3888" },
{ .compatible = "lltc,ltc3889" },
{ .compatible = "lltc,ltc7880" },
{ .compatible = "lltc,ltm2987" },
--
2.17.1

Loading

0 comments on commit 1800d11

Please sign in to comment.