Skip to content

Commit

Permalink
[DellEMC] S5232 platform updates (sonic-net#4360)
Browse files Browse the repository at this point in the history
FPGA driver crash fix for stale buffer in i2c transfer
LED firmware load issue fix.
10G port swapfix
psu/sfp bug fixes to report correct states/status of hw
  • Loading branch information
srideepDell authored Apr 8, 2020
1 parent 837c13f commit 444cede
Show file tree
Hide file tree
Showing 16 changed files with 1,034 additions and 850 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Ethernet112 113,114,115,116 hundredGigE1/29 29 100000
Ethernet116 117,118,119,120 hundredGigE1/30 30 100000
Ethernet120 121,122,123,124 hundredGigE1/31 31 100000
Ethernet124 125,126,127,128 hundredGigE1/32 32 100000
Ethernet128 128 tenGigE1/33 33 10000
Ethernet129 129 tenGigE1/34 34 10000
Ethernet128 129 tenGigE1/33 33 10000
Ethernet129 128 tenGigE1/34 34 10000
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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 @@ -542,3 +542,5 @@ dport_map_port_66=127
dport_map_port_130=128

mmu_init_config="TD3-DEFAULT-LOSSLESS-P3P4"
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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 @@ -542,3 +542,4 @@ dport_map_port_66=127
dport_map_port_130=128

mmu_init_config="TD3-DEFAULT"
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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 @@ -615,3 +615,4 @@ dport_map_port_66=127
dport_map_port_130=128

mmu_init_config="TD3-DEFAULT"
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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 @@ -615,3 +615,4 @@ dport_map_port_66=127
dport_map_port_130=128

mmu_init_config="TD3-DEFAULT"
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
4 changes: 2 additions & 2 deletions device/dell/x86_64-dellemc_s5232f_c3538-r0/led_proc_init.soc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
#
#Led0
#led stop
m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
led stop
#m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
#led auto on
led start
86 changes: 56 additions & 30 deletions device/dell/x86_64-dellemc_s5232f_c3538-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@


S5232F_MAX_PSUS = 2
IPMI_PSU_DATA = "docker exec -it pmon ipmitool sdr list"
IPMI_PSU_DATA_DOCKER = "ipmitool sdr list"
IPMI_PSU1_DATA = "docker exec -it pmon ipmitool raw 0x04 0x2d 0x31 | awk '{print substr($0,9,1)}'"
IPMI_PSU1_DATA_DOCKER = "ipmitool raw 0x04 0x2d 0x31 | awk '{print substr($0,9,1)}'"
IPMI_PSU2_DATA = "docker exec -it pmon ipmitool raw 0x04 0x2d 0x32 | awk '{print substr($0,9,1)}'"
IPMI_PSU2_DATA_DOCKER = "ipmitool raw 0x04 0x2d 0x32 | awk '{print substr($0,9,1)}'"
PSU_PRESENCE = "PSU{0}_stat"
# Use this for older firmware
# PSU_PRESENCE="PSU{0}_prsnt"
ipmi_sdr_list = ""


try:
Expand All @@ -42,30 +43,26 @@ def isDockerEnv(self):
def get_pmc_register(self, reg_name):

status = 1
global ipmi_sdr_list
ipmi_dev_node = "/dev/pmi0"
ipmi_cmd = IPMI_PSU_DATA
ipmi_cmd_1 = IPMI_PSU1_DATA
ipmi_cmd_2 = IPMI_PSU1_DATA
dockerenv = self.isDockerEnv()
if dockerenv == True:
ipmi_cmd = IPMI_PSU_DATA_DOCKER

status, ipmi_sdr_list = commands.getstatusoutput(ipmi_cmd)
if index == 1:
status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU1_DATA_DOCKER)
elif index == 2:
status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU2_DATA_DOCKER)
else:
if index == 1:
status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU1_DATA)
elif index == 2:
status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU2_DATA)

if status:
logging.error('Failed to execute:' + ipmi_sdr_list)
sys.exit(0)

for item in ipmi_sdr_list.split("\n"):
if reg_name in item:
output = item.strip()

if not output:
print('\nFailed to fetch: ' + reg_name + ' sensor ')
logging.error('Failed to execute ipmitool')
sys.exit(0)

output = output.split('|')[1]
output = ipmi_sdr_list

logging.basicConfig(level=logging.DEBUG)
return output

def get_num_psus(self):
Expand All @@ -86,8 +83,26 @@ def get_psu_status(self, index):
"""
# Until psu_status is implemented this is hardcoded temporarily

status = 1
return status
psu_status = 'f'
ret_status = 1
dockerenv = self.isDockerEnv()
if dockerenv == True:
if index == 1:
ret_status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU1_DATA_DOCKER)
elif index == 2:
ret_status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU2_DATA_DOCKER)
else:
if index == 1:
ret_status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU1_DATA)
elif index == 2:
ret_status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU2_DATA)

if ret_status:
logging.error('Failed to execute ipmitool : ')
sys.exit(0)

psu_status = ipmi_sdr_list
return (not int(psu_status, 16) > 1)

def get_psu_presence(self, index):
"""
Expand All @@ -96,12 +111,23 @@ def get_psu_presence(self, index):
:param index: An integer, index of the PSU of which to query status
:return: Boolean, True if PSU is plugged, False if not
"""
status = 0
psu_reg_name = PSU_PRESENCE.format(index)
psu_status = int(self.get_pmc_register(psu_reg_name), 16)
if (psu_status != 'ERR'):
# Check for PSU presence
if (psu_status == 0x00):
status = 1
return status
psu_status = '0'
ret_status = 1
dockerenv = self.isDockerEnv()
if dockerenv == True:
if index == 1:
ret_status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU1_DATA_DOCKER)
elif index == 2:
ret_status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU2_DATA_DOCKER)
else:
if index == 1:
ret_status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU1_DATA)
elif index == 2:
ret_status, ipmi_sdr_list = commands.getstatusoutput(IPMI_PSU2_DATA)

if ret_status:
logging.error('Failed to execute ipmitool : ')
sys.exit(0)

psu_status = ipmi_sdr_list
return (int(psu_status, 16) & 1)
9 changes: 7 additions & 2 deletions device/dell/x86_64-dellemc_s5232f_c3538-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class SfpUtil(SfpUtilBase):
"""Platform-specific SfpUtil class"""

PORT_START = 1
PORT_END = 64
PORTS_IN_BLOCK = 64
PORT_END = 34
PORTS_IN_BLOCK = 32

BASE_RES_PATH = "/sys/bus/pci/devices/0000:04:00.0/resource0"

Expand Down Expand Up @@ -141,6 +141,11 @@ def get_presence(self, port_num):
# Mask off 4th bit for presence
mask = (1 << 4)

# Mask off 1st bit for presence 33,34
if (port_num > 32):
mask = (1 << 0)


# ModPrsL is active low
if reg_value & mask == 0:
return True
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"skip_ledd": true
"skip_ledd": true,
"skip_thermalctld": true
}
Loading

0 comments on commit 444cede

Please sign in to comment.