forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pensando platform (sonic-net#15978)
This commit adds support for pensando asic called ELBA. ELBA is used in pci based cards and in smartswitches. #### Why I did it This commit introduces pensando platform which is based on ELBA ASIC. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Created platform/pensando folder and created makefiles specific to pensando. This mainly creates pensando docker (which OEM's need to download before building an image) which has all the userspace to initialize and use the DPU (ELBA ASIC). Output of the build process creates two images which can be used from ONIE and goldfw. Recommendation is use to use ONIE. #### How to verify it Load the SONiC image via ONIE or goldfw and make sure the interfaces are UP. ##### Description for the changelog Add pensando platform support.
- Loading branch information
Showing
163 changed files
with
43,782 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
device/pensando/arm64-elba-asic-r0/Pensando-elba/port_config.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# name lanes alias speed autoneg fec | ||
Ethernet1 0,1,2,3 Ethernet1 100000 on rs | ||
Ethernet2 4,5,6,7 Ethernet2 100000 on rs |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Pensando-elba t1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pensando |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# | ||
# ssd_generic.py | ||
# | ||
# Generic implementation of the SSD health API | ||
# SSD models supported: | ||
# - InnoDisk | ||
# - StorFly | ||
# - Virtium | ||
|
||
try: | ||
import re | ||
import subprocess | ||
from sonic_platform_base.sonic_ssd.ssd_base import SsdBase | ||
except ImportError as e: | ||
raise ImportError (str(e) + "- required module not found") | ||
|
||
NOT_AVAILABLE = "N/A" | ||
MMC_DATA_PATH = "/sys/class/mmc_host/mmc0/mmc0:0001/{}" | ||
|
||
class SsdUtil(SsdBase): | ||
""" | ||
Generic implementation of the SSD health API | ||
""" | ||
model = NOT_AVAILABLE | ||
serial = NOT_AVAILABLE | ||
firmware = NOT_AVAILABLE | ||
temperature = NOT_AVAILABLE | ||
health = NOT_AVAILABLE | ||
ssd_info = NOT_AVAILABLE | ||
vendor_ssd_info = NOT_AVAILABLE | ||
|
||
def __init__(self, diskdev): | ||
|
||
self.dev = diskdev | ||
try: | ||
self.model = ("emmc {}".format(open(MMC_DATA_PATH.format("name")).read())).replace("\n", "") | ||
self.serial = open(MMC_DATA_PATH.format("serial")).read().replace("\n", "") | ||
self.firmware = open(MMC_DATA_PATH.format("fwrev")).read().replace("\n", "") | ||
value = open(MMC_DATA_PATH.format("life_time")).read().replace("\n", "") | ||
[lifetime_a, lifetime_b] = [int(val, 16) for val in value.split()] | ||
lifetime = lifetime_a if lifetime_a >= lifetime_b else lifetime_b | ||
self.health = float(100 - (lifetime*10)) | ||
except: | ||
pass | ||
|
||
def get_health(self): | ||
""" | ||
Retrieves current disk health in percentages | ||
Returns: | ||
A float number of current ssd health | ||
e.g. 83.5 | ||
""" | ||
return self.health | ||
|
||
def get_temperature(self): | ||
""" | ||
Retrieves current disk temperature in Celsius | ||
Returns: | ||
A float number of current temperature in Celsius | ||
e.g. 40.1 | ||
""" | ||
return self.temperature | ||
|
||
def get_model(self): | ||
""" | ||
Retrieves model for the given disk device | ||
Returns: | ||
A string holding disk model as provided by the manufacturer | ||
""" | ||
return self.model | ||
|
||
def get_firmware(self): | ||
""" | ||
Retrieves firmware version for the given disk device | ||
Returns: | ||
A string holding disk firmware version as provided by the manufacturer | ||
""" | ||
return self.firmware | ||
|
||
def get_serial(self): | ||
""" | ||
Retrieves serial number for the given disk device | ||
Returns: | ||
A string holding disk serial number as provided by the manufacturer | ||
""" | ||
return self.serial | ||
|
||
def get_vendor_output(self): | ||
""" | ||
Retrieves vendor specific data for the given disk device | ||
Returns: | ||
A string holding some vendor specific disk information | ||
""" | ||
return self.vendor_ssd_info |
10 changes: 10 additions & 0 deletions
10
device/pensando/arm64-elba-asic-r0/pmon_daemon_control.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"skip_thermalctld": true, | ||
"skip_fancontrol": true, | ||
"skip_ledd": true, | ||
"skip_psud": true, | ||
"skip_syseepromd": false, | ||
"skip_xcvrd": true, | ||
"skip_chassis_db_init": false, | ||
"skip_pcied": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"metadata_version": 1, | ||
"package_version": 2, | ||
"asic_compat": "elba", | ||
"build_date": "{{ build_date }}", | ||
"build_user": "{{ build_user }}", | ||
"installer": { | ||
"name": "install_debian", | ||
"verify": { | ||
"algorithm": "sha512", | ||
"hash": "{{ installer_sha }}" | ||
} | ||
}, | ||
"shas": { | ||
"fs.zip": "{{ installer_payload_sha }}" | ||
}, | ||
"package_compat": { | ||
"board_policy": "accept" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/bin/bash | ||
|
||
# {C} Copyright 2023 AMD Systems Inc. All rights reserved | ||
|
||
# This script starts/stops dpu sw | ||
|
||
|
||
### BEGIN INIT INFO | ||
# Provides: load-dpu | ||
# Required-Start: | ||
# Required-Stop: | ||
# Should-Start: | ||
# Should-Stop: | ||
# Default-Start: S | ||
# Default-Stop: 0 6 | ||
# Short-Description: Load dpu sw | ||
### END INIT INFO | ||
ACTIVE_FILE="/boot/active.txt" | ||
NIC_MOUNT="" | ||
LOG_FILE="/tmp/active_nic" | ||
TAG="latest" | ||
HOST_DIR=/host/dpu | ||
|
||
function start_dpu() | ||
{ | ||
modprobe ionic_mnic | ||
modprobe mnet_uio_pdrv_genirq | ||
modprobe mdev | ||
|
||
mkdir -p $HOST_DIR/update | ||
mkdir -p $HOST_DIR/sysconfig/config0 | ||
mkdir -p $HOST_DIR/sysconfig/config1 | ||
mkdir -p $HOST_DIR/obfl | ||
mkdir -p $HOST_DIR/data | ||
mkdir -p $HOST_DIR/tmpfsshare | ||
mkdir -p $HOST_DIR/runfs | ||
mkdir -p $HOST_DIR/logfs | ||
mount -t tmpfs -o size=20M,mode=1777 tmpfs $HOST_DIR/tmpfsshare | ||
mount -t tmpfs -o size=20M,mode=0755 runs $HOST_DIR/runfs | ||
mount -t tmpfs -o size=20M,mode=0755 logfs $HOST_DIR/logfs | ||
|
||
if [ -f "$ACTIVE_FILE" ]; then | ||
ACTIVE_CONTENTS=$(cat "$ACTIVE_FILE") | ||
ACTIVE_NIC=$(echo "$ACTIVE_CONTENTS" | cut -d " " -f 8-) | ||
if [ "$ACTIVE_NIC" = "/boot/nicA" ]; then | ||
NIC_MOUNT="-v /dev/shm:/dev/shm -v /boot/nicA/nic_core:/nic -v /boot/nicA/shared/conf/gen:/nic/conf/gen" | ||
elif [ "$ACTIVE_NIC" = "/boot/nicB" ]; then | ||
NIC_MOUNT="-v /dev/shm:/dev/shm -v /boot/nicB/nic_core:/nic -v /boot/nicB/shared/conf/gen:/nic/conf/gen" | ||
fi | ||
else | ||
echo "/boot/active.txt not present" > $LOG_FILE | ||
fi | ||
echo "Active Nic: $ACTIVE_NIC" >> $LOG_FILE | ||
echo "NIC_MOUNT: $NIC_MOUNT" >> $LOG_FILE | ||
|
||
docker ps -a --format "{{.ID}}\t{{.Image}}" | grep "docker-dpu:latest" | awk '{print $1}' | xargs -I {} docker rm {} | ||
|
||
docker run -v $HOST_DIR/update:/update -v $HOST_DIR/sysconfig/config0:/sysconfig/config0 -v $HOST_DIR/sysconfig/config1:/sysconfig/config1 -v $HOST_DIR/obfl:/obfl -v $HOST_DIR/data:/data -v $HOST_DIR/tmpfsshare:/tmp -v $HOST_DIR/runfs:/run -v $HOST_DIR/logfs:/var/log -v /sys:/sys $NIC_MOUNT --net=host --name=dpu --privileged docker-dpu:$TAG | ||
} | ||
|
||
case "$1" in | ||
start) | ||
echo -n "Start dpu... " | ||
|
||
start_dpu | ||
|
||
echo "done." | ||
;; | ||
|
||
stop) | ||
echo "Not supported" | ||
;; | ||
|
||
force-reload|restart) | ||
echo "Not supported" | ||
;; | ||
|
||
*) | ||
echo "Usage: /etc/init.d/dpu.init {start}" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 | ||
|
Oops, something went wrong.