DellEMC S6100 CPLD upgrade support (#3834)

* DelllEMC S6100 CPLD upgrade support

* Typo: CPLD
This commit is contained in:
paavaanan 2019-12-07 00:24:45 +05:30 committed by Sujin Kang
parent ba88f9c0ae
commit 8ad48a5243
3 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,32 @@
#!/usr/bin/python
import sys
import os
import struct
PORT_RES = '/dev/port'
POWER_CYCLE = '/tmp/powercycle'
def portio_reg_write(resource, offset, val):
fd = os.open(resource, os.O_RDWR)
if(fd < 0):
print 'file open failed %s" % resource'
return
if(os.lseek(fd, offset, os.SEEK_SET) != offset):
print 'lseek failed on %s' % resource
return
ret = os.write(fd, struct.pack('B', val))
if(ret != 1):
print 'write failed %d' % ret
return
os.close(fd)
if __name__ == "__main__":
# power-cycle the switch
if os.path.exists(POWER_CYCLE):
print "CPLD upgrade detected. Power-cycling the unit.."
os.system('io_rd_wr.py --set --val 05 --offset 210; io_rd_wr.py --set --val 00 --offset 211; io_rd_wr.py --set --val 03 --offset 213')
portio_reg_write(PORT_RES, 0xcf9, 0xe)

Binary file not shown.

View File

@ -4,7 +4,6 @@ common/dell_i2c_utils.sh usr/local/bin
common/io_rd_wr.py usr/local/bin
common/fstrim.timer etc/systemd/system
common/fstrim.service etc/systemd/system
common/platform_reboot usr/share/sonic/device/x86_64-dell_s6100_c2538-r0
s6100/scripts/platform_sensors.py usr/local/bin
s6100/scripts/sensors usr/bin
s6100/systemd/platform-modules-s6100.service etc/systemd/system