Skip to content

Commit 21a1814

Browse files
committed
Add support for MtFuji elba dpu
This patchset adds sonic buildimage support for AMD-Pensando DPU on MtFuji DSS. MtFuji is a DSS being developed in collaboration with AMD-Pensando and Cisco for data center applications. MtFuji mounts elba based nic which is an AMD-Pensando PCI Distributed Services Card (DSC) whose support has been added in SONiC. The changes are verified on Pensando DSS-MTFUJI card. There is one 200G uplink port and no management port. The link and traffic has been tested on the port. Signed-off-by: Shantanu Shrivastava <[email protected]> Signed-off-by: Sahil Chaudhari <[email protected]>
1 parent a56cf79 commit 21a1814

File tree

122 files changed

+17582
-1597
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+17582
-1597
lines changed

build_debian.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,10 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'docke
547547
# Install scapy
548548
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'scapy==2.4.4'
549549

550+
# Install grpcio
551+
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'grpcio==1.58.0'
552+
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'grpcio-tools==1.58.0'
553+
550554
# The option --no-build-isolation can be removed when upgrading PyYAML to 6.0.1
551555
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'PyYAML==5.4.1' --no-build-isolation
552556

@@ -772,7 +776,16 @@ if [[ $TARGET_BOOTLOADER == uboot ]]; then
772776
elif [[ $CONFIGURED_ARCH == arm64 ]]; then
773777
if [[ $CONFIGURED_PLATFORM == pensando ]]; then
774778
## copy device tree file into boot (XXX: need to compile dtb from dts)
775-
sudo cp -v $PLATFORM_DIR/pensando/elba-asic-psci.dtb $FILESYSTEM_ROOT/boot/
779+
sudo cp -v $FILESYSTEM_ROOT/usr/lib/linux-image-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH}/pensando/elba-asic-psci.dtb $FILESYSTEM_ROOT/boot/
780+
sudo cp -v $FILESYSTEM_ROOT/usr/lib/linux-image-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH}/pensando/elba-asic-psci-lipari.dtb $FILESYSTEM_ROOT/boot/
781+
sudo cp -v $FILESYSTEM_ROOT/usr/lib/linux-image-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH}/pensando/elba-asic-psci-mtfuji.dtb $FILESYSTEM_ROOT/boot/
782+
sudo cp -v $PLATFORM_DIR/pensando/install_file $FILESYSTEM_ROOT/boot/
783+
if [ -e $PLATFORM_DIR/pensando/uboota.img ]; then
784+
sudo cp -v $PLATFORM_DIR/pensando/uboota.img $FILESYSTEM_ROOT/boot/
785+
fi
786+
if [ -e $PLATFORM_DIR/pensando/boot0.img ]; then
787+
sudo cp -v $PLATFORM_DIR/pensando/boot0.img $FILESYSTEM_ROOT/boot/
788+
fi
776789
## make kernel as gzip file
777790
sudo LANG=C chroot $FILESYSTEM_ROOT gzip /boot/${KERNEL_FILE}
778791
sudo LANG=C chroot $FILESYSTEM_ROOT mv /boot/${KERNEL_FILE}.gz /boot/${KERNEL_FILE}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#name lanes alias speed autoneg fec
2+
Ethernet0 0,1,2,3 Ethernet1/1 200000 on rs

device/pensando/arm64-elba-asic-flash128-r0/Pensando-elba/sai.profile

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
start_chassis_db=1
2+
chassis_db_address=0.0.0.0
3+
midplane_subnet=0.0.0.0/16
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
polaris
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pensando-elba t1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pensando
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
# {C} Copyright 2023 AMD Systems Inc. All rights reserved
3+
4+
DPU_DOCKER_INFO_DIR=/host/dpu-docker-info
5+
6+
function StopDpuDocker() {
7+
sync ; sync
8+
dpu_docker_name=$(<"$DPU_DOCKER_INFO_DIR/name")
9+
docker exec "$dpu_docker_name" rm /var/run/pcieport_data
10+
sync ; sync
11+
echo "Stopping dpu docker container"
12+
docker stop "$dpu_docker_name"
13+
sync ; sync
14+
}
15+
16+
StopDpuDocker
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# {C} Copyright 2023 AMD Systems Inc. All rights reserved
2+
# ssd_util.py
3+
#
4+
# AMD-pensando implementation of the SSD health API
5+
6+
try:
7+
import re
8+
import subprocess
9+
from sonic_platform_base.sonic_ssd.ssd_base import SsdBase
10+
except ImportError as e:
11+
raise ImportError (str(e) + "- required module not found")
12+
13+
NOT_AVAILABLE = "N/A"
14+
MMC_DATA_PATH = "/sys/class/mmc_host/mmc0/mmc0:0001/{}"
15+
16+
class SsdUtil(SsdBase):
17+
"""
18+
Generic implementation of the SSD health API
19+
"""
20+
model = NOT_AVAILABLE
21+
serial = NOT_AVAILABLE
22+
firmware = NOT_AVAILABLE
23+
temperature = NOT_AVAILABLE
24+
health = NOT_AVAILABLE
25+
ssd_info = NOT_AVAILABLE
26+
vendor_ssd_info = NOT_AVAILABLE
27+
28+
def __init__(self, diskdev):
29+
30+
self.dev = diskdev
31+
try:
32+
self.model = ("emmc {}".format(open(MMC_DATA_PATH.format("name")).read())).replace("\n", "")
33+
self.serial = open(MMC_DATA_PATH.format("serial")).read().replace("\n", "")
34+
self.firmware = open(MMC_DATA_PATH.format("fwrev")).read().replace("\n", "")
35+
value = open(MMC_DATA_PATH.format("life_time")).read().replace("\n", "")
36+
[lifetime_a, lifetime_b] = [int(val, 16) for val in value.split()]
37+
lifetime = lifetime_a if lifetime_a >= lifetime_b else lifetime_b
38+
self.health = float(100 - (lifetime*10))
39+
except:
40+
pass
41+
42+
def get_health(self):
43+
"""
44+
Retrieves current disk health in percentages
45+
46+
Returns:
47+
A float number of current ssd health
48+
e.g. 83.5
49+
"""
50+
return self.health
51+
52+
def get_temperature(self):
53+
"""
54+
Retrieves current disk temperature in Celsius
55+
56+
Returns:
57+
A float number of current temperature in Celsius
58+
e.g. 40.1
59+
"""
60+
return self.temperature
61+
62+
def get_model(self):
63+
"""
64+
Retrieves model for the given disk device
65+
66+
Returns:
67+
A string holding disk model as provided by the manufacturer
68+
"""
69+
return self.model
70+
71+
def get_firmware(self):
72+
"""
73+
Retrieves firmware version for the given disk device
74+
75+
Returns:
76+
A string holding disk firmware version as provided by the manufacturer
77+
"""
78+
return self.firmware
79+
80+
def get_serial(self):
81+
"""
82+
Retrieves serial number for the given disk device
83+
84+
Returns:
85+
A string holding disk serial number as provided by the manufacturer
86+
"""
87+
return self.serial
88+
89+
def get_vendor_output(self):
90+
"""
91+
Retrieves vendor specific data for the given disk device
92+
93+
Returns:
94+
A string holding some vendor specific disk information
95+
"""
96+
return self.vendor_ssd_info
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"skip_thermalctld": false,
3+
"skip_fancontrol": true,
4+
"skip_ledd": true,
5+
"skip_psud": true,
6+
"skip_syseepromd": false,
7+
"skip_xcvrd": false,
8+
"skip_chassis_db_init": false,
9+
"skip_chassisd": true,
10+
"skip_pcied": false,
11+
"include_sensormond": true
12+
}

0 commit comments

Comments
 (0)