Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"skip_thermalctld": true,
"skip_ledd": true
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#Not supported in current SAI version
m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,5 @@ serdes_lane_config_media_type_27=copper
serdes_lane_config_media_type_28=copper
serdes_lane_config_media_type_24=copper

#sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#Not supported Until SAI 3.6
#m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
#m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,5 @@ serdes_lane_config_media_type_27=copper
serdes_lane_config_media_type_28=copper
serdes_lane_config_media_type_24=copper

#sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#Not supported Until SAI 3.6
#m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
#m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,5 @@ serdes_lane_config_media_type_27=copper
serdes_lane_config_media_type_28=copper
serdes_lane_config_media_type_24=copper

#sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
#Led0
#Support only after SAI 3.6
#led auto on
#led start
led start
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ def pci_get_value(resource, offset):
mm.close()
return val

def pci_mem_write(memmap, offset, data):
""" Write PCI device """
memmap.seek(offset)
memmap.write(struct.pack('I', data))

def pci_set_value(resource, val, offset):
""" Set a value to PCI device """
with open(resource, 'w+b') as filed:
memmap = None
try:
memmap = mmap.mmap(filed.fileno(), 0)
pci_mem_write(memmap, offset, val)
except EnvironmentError:
pass
if memmap is not None:
memmap.close()

# Read I2C device

def i2c_get(bus, i2caddr, ofs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ s5248f/scripts/sensors usr/bin
s5248f/scripts/qsfp_irq_enable.py usr/bin
s5248f/cfg/s5248f-modules.conf etc/modules-load.d
s5248f/systemd/platform-modules-s5248f.service etc/systemd/system
s5248f/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-dellemc_s5248f_c3538-r0
common/platform_reboot usr/share/sonic/device/x86_64-dellemc_s5248f_c3538-r0
common/fw-updater usr/local/bin
common/onie_mode_set usr/local/bin
Expand Down
10 changes: 10 additions & 0 deletions platform/broadcom/sonic-platform-modules-dell/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ override_dh_auto_build:
python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
cd $(MOD_SRC_DIR); \
elif [ $$mod = "s5248f" ]; then \
cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
cd $(MOD_SRC_DIR)/$${mod}; \
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
cd $(MOD_SRC_DIR); \
elif [ $$mod = "z9332f" ]; then \
cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
cd $(MOD_SRC_DIR)/$${mod}; \
Expand Down Expand Up @@ -103,6 +108,11 @@ override_dh_clean:
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
rm -rf $(MOD_SRC_DIR)/$${mod}/build; \
rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \
elif [ $$mod = "s5248f" ]; then \
rm -f $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
rm -rf $(MOD_SRC_DIR)/$${mod}/build; \
rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \
elif [ $$mod = "z9332f" ]; then \
rm -f $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ switch_board_modsel() {
done
}

install_python_api_package() {
device="/usr/share/sonic/device"
platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)

rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl)
}

remove_python_api_package() {
rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -eq 0 ]; then
rv=$(pip3 uninstall -y sonic-platform > /dev/null 2>/dev/null)
fi
}

platform_firmware_versions() {
FIRMWARE_VERSION_FILE=/var/log/firmware_versions
rm -rf ${FIRMWARE_VERSION_FILE}
Expand Down Expand Up @@ -146,13 +160,15 @@ if [ "$1" == "init" ]; then
switch_board_modsel
switch_board_led_default
#/usr/bin/qsfp_irq_enable.py
install_python_api_package
platform_firmware_versions

elif [ "$1" == "deinit" ]; then
sys_eeprom "delete_device"
switch_board_qsfp "delete_device"
switch_board_qsfp_mux "delete_device"

remove_python_api_package
modprobe -r i2c-mux-pca954x
modprobe -r i2c-dev
else
Expand Down
30 changes: 30 additions & 0 deletions platform/broadcom/sonic-platform-modules-dell/s5248f/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from setuptools import setup

setup(
name='sonic-platform',
version='1.0',
description='SONiC platform API implementation on DellEmc Platforms',
license='Apache 2.0',
author='SONiC Team',
author_email='[email protected]',
url='https://github.com/Azure/sonic-buildimage',
maintainer='DellEMC',
maintainer_email='[email protected]',
packages=[
'sonic_platform',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Plugins',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.7',
'Topic :: Utilities',
],
keywords='sonic SONiC platform PLATFORM',
)

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__all__ = ["platform", "chassis", "sfp", "eeprom", "component", "thermal", "psu", "fan", "fan_drawer", "watchdog"]
from sonic_platform import *

Loading