Skip to content

Commit ada7c6a

Browse files
authoredDec 4, 2023
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.
1 parent ed8fa6a commit ada7c6a

File tree

163 files changed

+43782
-19
lines changed

Some content is hidden

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

163 files changed

+43782
-19
lines changed
 

‎.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ installer/x86_64/platforms/
4141
# Misc. files
4242
asic_config_checksum
4343
files/Aboot/boot0
44+
files/dsc/MANIFEST
45+
files/dsc/install_debian
46+
files/dsc/fs.zip
4447
files/initramfs-tools/arista-convertfs
4548
files/initramfs-tools/union-mount
4649

‎build_debian.sh

+20-7
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ TRUSTED_GPG_DIR=$BUILD_TOOL_PATH/trusted.gpg.d
5050
echo "Error: Invalid ONIE_IMAGE_PART_SIZE in onie image config file"
5151
exit 1
5252
}
53-
[ -n "$ONIE_INSTALLER_PAYLOAD" ] || {
54-
echo "Error: Invalid ONIE_INSTALLER_PAYLOAD in onie image config file"
53+
[ -n "$INSTALLER_PAYLOAD" ] || {
54+
echo "Error: Invalid INSTALLER_PAYLOAD in onie image config file"
5555
exit 1
5656
}
5757
[ -n "$FILESYSTEM_SQUASHFS" ] || {
@@ -753,14 +753,27 @@ sudo chroot $FILESYSTEM_ROOT update-initramfs -u
753753
## Convert initrd image to u-boot format
754754
if [[ $TARGET_BOOTLOADER == uboot ]]; then
755755
INITRD_FILE=initrd.img-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH}
756+
KERNEL_FILE=vmlinuz-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH}
756757
if [[ $CONFIGURED_ARCH == armhf ]]; then
757758
INITRD_FILE=initrd.img-${LINUX_KERNEL_VERSION}-armmp
758759
sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -A arm -O linux -T ramdisk -C gzip -d /boot/$INITRD_FILE /boot/u${INITRD_FILE}
759760
## Overwriting the initrd image with uInitrd
760761
sudo LANG=C chroot $FILESYSTEM_ROOT mv /boot/u${INITRD_FILE} /boot/$INITRD_FILE
761762
elif [[ $CONFIGURED_ARCH == arm64 ]]; then
762-
sudo cp -v $PLATFORM_DIR/${sonic_asic_platform}-${CONFIGURED_ARCH}/sonic_fit.its $FILESYSTEM_ROOT/boot/
763-
sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -f /boot/sonic_fit.its /boot/sonic_${CONFIGURED_ARCH}.fit
763+
if [[ $CONFIGURED_PLATFORM == pensando ]]; then
764+
## copy device tree file into boot (XXX: need to compile dtb from dts)
765+
sudo cp -v $PLATFORM_DIR/pensando/elba-asic-psci.dtb $FILESYSTEM_ROOT/boot/
766+
## make kernel as gzip file
767+
sudo LANG=C chroot $FILESYSTEM_ROOT gzip /boot/${KERNEL_FILE}
768+
sudo LANG=C chroot $FILESYSTEM_ROOT mv /boot/${KERNEL_FILE}.gz /boot/${KERNEL_FILE}
769+
## Convert initrd image to u-boot format
770+
sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -A arm64 -O linux -T ramdisk -C gzip -d /boot/$INITRD_FILE /boot/u${INITRD_FILE}
771+
## Overwriting the initrd image with uInitrd
772+
sudo LANG=C chroot $FILESYSTEM_ROOT mv /boot/u${INITRD_FILE} /boot/$INITRD_FILE
773+
else
774+
sudo cp -v $PLATFORM_DIR/${sonic_asic_platform}-${CONFIGURED_ARCH}/sonic_fit.its $FILESYSTEM_ROOT/boot/
775+
sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -f /boot/sonic_fit.its /boot/sonic_${CONFIGURED_ARCH}.fit
776+
fi
764777
fi
765778
fi
766779

@@ -811,7 +824,7 @@ if [[ "$CHANGE_DEFAULT_PASSWORD" == "y" ]]; then
811824
fi
812825

813826
## Compress most file system into squashfs file
814-
sudo rm -f $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS
827+
sudo rm -f $INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS
815828
## Output the file system total size for diag purpose
816829
## Note: -x to skip directories on different file systems, such as /proc
817830
sudo du -hsx $FILESYSTEM_ROOT
@@ -856,5 +869,5 @@ fi
856869
pushd $FILESYSTEM_ROOT && sudo tar -I $GZ_COMPRESS_PROGRAM -cf $OLDPWD/$FILESYSTEM_DOCKERFS -C ${DOCKERFS_PATH}var/lib/docker .; popd
857870

858871
## Compress together with /boot, /var/lib/docker and $PLATFORM_DIR as an installer payload zip file
859-
pushd $FILESYSTEM_ROOT && sudo tar -I $GZ_COMPRESS_PROGRAM -cf platform.tar.gz -C $PLATFORM_DIR . && sudo zip -n .gz $OLDPWD/$ONIE_INSTALLER_PAYLOAD -r boot/ platform.tar.gz; popd
860-
sudo zip -g -n .squashfs:.gz $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS $FILESYSTEM_DOCKERFS
872+
pushd $FILESYSTEM_ROOT && sudo tar -I $GZ_COMPRESS_PROGRAM -cf platform.tar.gz -C $PLATFORM_DIR . && sudo zip -n .gz $OLDPWD/$INSTALLER_PAYLOAD -r boot/ platform.tar.gz; popd
873+
sudo zip -g -n .squashfs:.gz $INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS $FILESYSTEM_DOCKERFS

0 commit comments

Comments
 (0)
Please sign in to comment.